archbyte 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +0,0 @@
1
- (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(a){if(a.ep)return;a.ep=!0;const c=i(a);fetch(a.href,c)}})();function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fc={exports:{}},ts={},Oc={exports:{}},De={};/**
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 th;function s0(){if(th)return De;th=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function _(I,$,se){this.props=I,this.context=$,this.refs=S,this.updater=se||C}_.prototype.isReactComponent={},_.prototype.setState=function(I,$){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,$,"setState")},_.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function E(){}E.prototype=_.prototype;function P(I,$,se){this.props=I,this.context=$,this.refs=S,this.updater=se||C}var k=P.prototype=new E;k.constructor=P,N(k,_.prototype),k.isPureReactComponent=!0;var j=Array.isArray,F=Object.prototype.hasOwnProperty,L={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function Z(I,$,se){var le,de={},he=null,me=null;if($!=null)for(le in $.ref!==void 0&&(me=$.ref),$.key!==void 0&&(he=""+$.key),$)F.call($,le)&&!B.hasOwnProperty(le)&&(de[le]=$[le]);var oe=arguments.length-2;if(oe===1)de.children=se;else if(1<oe){for(var pe=Array(oe),je=0;je<oe;je++)pe[je]=arguments[je+2];de.children=pe}if(I&&I.defaultProps)for(le in oe=I.defaultProps,oe)de[le]===void 0&&(de[le]=oe[le]);return{$$typeof:t,type:I,key:he,ref:me,props:de,_owner:L.current}}function V(I,$){return{$$typeof:t,type:I.type,key:$,ref:I.ref,props:I.props,_owner:I._owner}}function J(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function U(I){var $={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(se){return $[se]})}var G=/\/+/g;function te(I,$){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):$.toString(36)}function z(I,$,se,le,de){var he=typeof I;(he==="undefined"||he==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(he){case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case t:case r:me=!0}}if(me)return me=I,de=de(me),I=le===""?"."+te(me,0):le,j(de)?(se="",I!=null&&(se=I.replace(G,"$&/")+"/"),z(de,$,se,"",function(je){return je})):de!=null&&(J(de)&&(de=V(de,se+(!de.key||me&&me.key===de.key?"":(""+de.key).replace(G,"$&/")+"/")+I)),$.push(de)),1;if(me=0,le=le===""?".":le+":",j(I))for(var oe=0;oe<I.length;oe++){he=I[oe];var pe=le+te(he,oe);me+=z(he,$,se,pe,de)}else if(pe=x(I),typeof pe=="function")for(I=pe.call(I),oe=0;!(he=I.next()).done;)he=he.value,pe=le+te(he,oe++),me+=z(he,$,se,pe,de);else if(he==="object")throw $=String(I),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return me}function Q(I,$,se){if(I==null)return I;var le=[],de=0;return z(I,le,"","",function(he){return $.call(se,he,de++)}),le}function W(I){if(I._status===-1){var $=I._result;$=$(),$.then(function(se){(I._status===0||I._status===-1)&&(I._status=1,I._result=se)},function(se){(I._status===0||I._status===-1)&&(I._status=2,I._result=se)}),I._status===-1&&(I._status=0,I._result=$)}if(I._status===1)return I._result.default;throw I._result}var K={current:null},M={transition:null},A={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:M,ReactCurrentOwner:L};function Y(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Q,forEach:function(I,$,se){Q(I,function(){$.apply(this,arguments)},se)},count:function(I){var $=0;return Q(I,function(){$++}),$},toArray:function(I){return Q(I,function($){return $})||[]},only:function(I){if(!J(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},De.Component=_,De.Fragment=i,De.Profiler=a,De.PureComponent=P,De.StrictMode=s,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,De.act=Y,De.cloneElement=function(I,$,se){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var le=N({},I.props),de=I.key,he=I.ref,me=I._owner;if($!=null){if($.ref!==void 0&&(he=$.ref,me=L.current),$.key!==void 0&&(de=""+$.key),I.type&&I.type.defaultProps)var oe=I.type.defaultProps;for(pe in $)F.call($,pe)&&!B.hasOwnProperty(pe)&&(le[pe]=$[pe]===void 0&&oe!==void 0?oe[pe]:$[pe])}var pe=arguments.length-2;if(pe===1)le.children=se;else if(1<pe){oe=Array(pe);for(var je=0;je<pe;je++)oe[je]=arguments[je+2];le.children=oe}return{$$typeof:t,type:I.type,key:de,ref:he,props:le,_owner:me}},De.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:c,_context:I},I.Consumer=I},De.createElement=Z,De.createFactory=function(I){var $=Z.bind(null,I);return $.type=I,$},De.createRef=function(){return{current:null}},De.forwardRef=function(I){return{$$typeof:h,render:I}},De.isValidElement=J,De.lazy=function(I){return{$$typeof:v,_payload:{_status:-1,_result:I},_init:W}},De.memo=function(I,$){return{$$typeof:g,type:I,compare:$===void 0?null:$}},De.startTransition=function(I){var $=M.transition;M.transition={};try{I()}finally{M.transition=$}},De.unstable_act=Y,De.useCallback=function(I,$){return K.current.useCallback(I,$)},De.useContext=function(I){return K.current.useContext(I)},De.useDebugValue=function(){},De.useDeferredValue=function(I){return K.current.useDeferredValue(I)},De.useEffect=function(I,$){return K.current.useEffect(I,$)},De.useId=function(){return K.current.useId()},De.useImperativeHandle=function(I,$,se){return K.current.useImperativeHandle(I,$,se)},De.useInsertionEffect=function(I,$){return K.current.useInsertionEffect(I,$)},De.useLayoutEffect=function(I,$){return K.current.useLayoutEffect(I,$)},De.useMemo=function(I,$){return K.current.useMemo(I,$)},De.useReducer=function(I,$,se){return K.current.useReducer(I,$,se)},De.useRef=function(I){return K.current.useRef(I)},De.useState=function(I){return K.current.useState(I)},De.useSyncExternalStore=function(I,$,se){return K.current.useSyncExternalStore(I,$,se)},De.useTransition=function(){return K.current.useTransition()},De.version="18.3.1",De}var nh;function vs(){return nh||(nh=1,Oc.exports=s0()),Oc.exports}/**
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 rh;function l0(){if(rh)return ts;rh=1;var t=vs(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(h,m,g){var v,y={},x=null,C=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(C=m.ref);for(v in m)s.call(m,v)&&!c.hasOwnProperty(v)&&(y[v]=m[v]);if(h&&h.defaultProps)for(v in m=h.defaultProps,m)y[v]===void 0&&(y[v]=m[v]);return{$$typeof:r,type:h,key:x,ref:C,props:y,_owner:a.current}}return ts.Fragment=i,ts.jsx=u,ts.jsxs=u,ts}var ih;function a0(){return ih||(ih=1,Fc.exports=l0()),Fc.exports}var d=a0(),b=vs();const jp=xu(b);var _l={},Hc={exports:{}},Wt={},Bc={exports:{}},Vc={};/**
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
- */var oh;function c0(){return oh||(oh=1,(function(t){function r(M,A){var Y=M.length;M.push(A);e:for(;0<Y;){var I=Y-1>>>1,$=M[I];if(0<a($,A))M[I]=A,M[Y]=$,Y=I;else break e}}function i(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var A=M[0],Y=M.pop();if(Y!==A){M[0]=Y;e:for(var I=0,$=M.length,se=$>>>1;I<se;){var le=2*(I+1)-1,de=M[le],he=le+1,me=M[he];if(0>a(de,Y))he<$&&0>a(me,de)?(M[I]=me,M[he]=Y,I=he):(M[I]=de,M[le]=Y,I=le);else if(he<$&&0>a(me,Y))M[I]=me,M[he]=Y,I=he;else break e}}return A}function a(M,A){var Y=M.sortIndex-A.sortIndex;return Y!==0?Y:M.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,h=u.now();t.unstable_now=function(){return u.now()-h}}var m=[],g=[],v=1,y=null,x=3,C=!1,N=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(M){for(var A=i(g);A!==null;){if(A.callback===null)s(g);else if(A.startTime<=M)s(g),A.sortIndex=A.expirationTime,r(m,A);else break;A=i(g)}}function j(M){if(S=!1,k(M),!N)if(i(m)!==null)N=!0,W(F);else{var A=i(g);A!==null&&K(j,A.startTime-M)}}function F(M,A){N=!1,S&&(S=!1,E(Z),Z=-1),C=!0;var Y=x;try{for(k(A),y=i(m);y!==null&&(!(y.expirationTime>A)||M&&!U());){var I=y.callback;if(typeof I=="function"){y.callback=null,x=y.priorityLevel;var $=I(y.expirationTime<=A);A=t.unstable_now(),typeof $=="function"?y.callback=$:y===i(m)&&s(m),k(A)}else s(m);y=i(m)}if(y!==null)var se=!0;else{var le=i(g);le!==null&&K(j,le.startTime-A),se=!1}return se}finally{y=null,x=Y,C=!1}}var L=!1,B=null,Z=-1,V=5,J=-1;function U(){return!(t.unstable_now()-J<V)}function G(){if(B!==null){var M=t.unstable_now();J=M;var A=!0;try{A=B(!0,M)}finally{A?te():(L=!1,B=null)}}else L=!1}var te;if(typeof P=="function")te=function(){P(G)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Q=z.port2;z.port1.onmessage=G,te=function(){Q.postMessage(null)}}else te=function(){_(G,0)};function W(M){B=M,L||(L=!0,te())}function K(M,A){Z=_(function(){M(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_continueExecution=function(){N||C||(N=!0,W(F))},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return i(m)},t.unstable_next=function(M){switch(x){case 1:case 2:case 3:var A=3;break;default:A=x}var Y=x;x=A;try{return M()}finally{x=Y}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var Y=x;x=M;try{return A()}finally{x=Y}},t.unstable_scheduleCallback=function(M,A,Y){var I=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,M){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Y+$,M={id:v++,callback:A,priorityLevel:M,startTime:Y,expirationTime:$,sortIndex:-1},Y>I?(M.sortIndex=Y,r(g,M),i(m)===null&&M===i(g)&&(S?(E(Z),Z=-1):S=!0,K(j,Y-I))):(M.sortIndex=$,r(m,M),N||C||(N=!0,W(F))),M},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(M){var A=x;return function(){var Y=x;x=A;try{return M.apply(this,arguments)}finally{x=Y}}}})(Vc)),Vc}var sh;function u0(){return sh||(sh=1,Bc.exports=c0()),Bc.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 lh;function d0(){if(lh)return Wt;lh=1;var t=vs(),r=u0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function c(e,n){u(e,n),u(e+"Capture",n)}function u(e,n){for(a[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[: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]*$/,v={},y={};function x(e){return m.call(y,e)?!0:m.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function C(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function N(e,n,o,l){if(n===null||typeof n>"u"||C(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function S(e,n,o,l,f,p,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=f,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=w}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];_[n]=new S(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){_[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_[e]=new S(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){_[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){_[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){_[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){_[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){_[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(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 n=e.replace(E,P);_[n]=new S(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(E,P);_[n]=new S(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(E,P);_[n]=new S(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){_[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){_[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(e,n,o,l){var f=_.hasOwnProperty(n)?_[n]:null;(f!==null?f.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(N(n,o,f,l)&&(o=null),l||f===null?x(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):f.mustUseProperty?e[f.propertyName]=o===null?f.type===3?!1:"":o:(n=f.attributeName,l=f.attributeNamespace,o===null?e.removeAttribute(n):(f=f.type,o=f===3||f===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),L=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),U=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),M=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=M&&e[M]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Object.assign,I;function $(e){if(I===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);I=n&&n[1]||""}return`
34
- `+I+e}var se=!1;function le(e,n){if(!e||se)return"";se=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ee){var l=ee}Reflect.construct(e,[],n)}else{try{n.call()}catch(ee){l=ee}e.call(n.prototype)}else{try{throw Error()}catch(ee){l=ee}e()}}catch(ee){if(ee&&l&&typeof ee.stack=="string"){for(var f=ee.stack.split(`
35
- `),p=l.stack.split(`
36
- `),w=f.length-1,T=p.length-1;1<=w&&0<=T&&f[w]!==p[T];)T--;for(;1<=w&&0<=T;w--,T--)if(f[w]!==p[T]){if(w!==1||T!==1)do if(w--,T--,0>T||f[w]!==p[T]){var D=`
37
- `+f[w].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=w&&0<=T);break}}}finally{se=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?$(e):""}function de(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function he(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 B:return"Fragment";case L:return"Portal";case V:return"Profiler";case Z:return"StrictMode";case te:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case J:return(e._context.displayName||"Context")+".Provider";case G:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return n=e.displayName||null,n!==null?n:he(e.type)||"Memo";case W:n=e._payload,e=e._init;try{return he(e(n))}catch{}}return null}function me(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(n);case 8:return n===Z?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pe(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function je(e){var n=pe(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,p=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){l=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ie(e){e._valueTracker||(e._valueTracker=je(e))}function ke(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=pe(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Ne(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 $e(e,n){var o=n.checked;return Y({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Fe(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=oe(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Ae(e,n){n=n.checked,n!=null&&k(e,"checked",n,!1)}function et(e,n){Ae(e,n);var o=oe(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?kt(e,n.type,o):n.hasOwnProperty("defaultValue")&&kt(e,n.type,oe(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function St(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function kt(e,n,o){(n!=="number"||Ne(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var ht=Array.isArray;function Nt(e,n,o,l){if(e=e.options,n){n={};for(var f=0;f<o.length;f++)n["$"+o[f]]=!0;for(o=0;o<e.length;o++)f=n.hasOwnProperty("$"+e[o].value),e[o].selected!==f&&(e[o].selected=f),f&&l&&(e[o].defaultSelected=!0)}else{for(o=""+oe(o),n=null,f=0;f<e.length;f++){if(e[f].value===o){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function At(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Y({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xt(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(ht(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:oe(o)}}function dr(e,n){var o=oe(n.value),l=oe(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function Qn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function be(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 rn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?be(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var on,Xr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,f){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,f)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(on=on||document.createElement("div"),on.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=on.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function hn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var pn={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},Lt=["Webkit","ms","Moz","O"];Object.keys(pn).forEach(function(e){Lt.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),pn[n]=pn[e]})});function Gr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||pn.hasOwnProperty(e)&&pn[e]?(""+n).trim():n+"px"}function Kr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,f=Gr(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,f):e[o]=f}}var yo=Y({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 fr(e,n){if(n){if(yo[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function hr(e,n){if(e.indexOf("-")===-1)return typeof n.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 pr=null;function Gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qr=null,Tt=null,vt=null;function mr(e){if(e=Oo(e)){if(typeof Qr!="function")throw Error(i(280));var n=e.stateNode;n&&(n=Hs(n),Qr(e.stateNode,e.type,n))}}function qr(e){Tt?vt?vt.push(e):vt=[e]:Tt=e}function mn(){if(Tt){var e=Tt,n=vt;if(vt=Tt=null,mr(e),n)for(e=0;e<n.length;e++)mr(n[e])}}function gr(e,n){return e(n)}function ji(){}var Zr=!1;function yr(e,n,o){if(Zr)return e(n,o);Zr=!0;try{return gr(e,n,o)}finally{Zr=!1,(Tt!==null||vt!==null)&&(ji(),mn())}}function gn(e,n){var o=e.stateNode;if(o===null)return null;var l=Hs(o);if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Pn=!1;if(h)try{var vr={};Object.defineProperty(vr,"passive",{get:function(){Pn=!0}}),window.addEventListener("test",vr,vr),window.removeEventListener("test",vr,vr)}catch{Pn=!1}function Dt(e,n,o,l,f,p,w,T,D){var ee=Array.prototype.slice.call(arguments,3);try{n.apply(o,ee)}catch(ce){this.onError(ce)}}var In=!1,lt=null,xr=!1,Et=null,bi={onError:function(e){In=!0,lt=e}};function Tn(e,n,o,l,f,p,w,T,D){In=!1,lt=null,Dt.apply(bi,arguments)}function vo(e,n,o,l,f,p,w,T,D){if(Tn.apply(this,arguments),In){if(In){var ee=lt;In=!1,lt=null}else throw Error(i(198));xr||(xr=!0,Et=ee)}}function Ct(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function tt(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function wr(e){if(Ct(e)!==e)throw Error(i(188))}function qn(e){var n=e.alternate;if(!n){if(n=Ct(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var f=o.return;if(f===null)break;var p=f.alternate;if(p===null){if(l=f.return,l!==null){o=l;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===o)return wr(f),e;if(p===l)return wr(f),n;p=p.sibling}throw Error(i(188))}if(o.return!==l.return)o=f,l=p;else{for(var w=!1,T=f.child;T;){if(T===o){w=!0,o=f,l=p;break}if(T===l){w=!0,l=f,o=p;break}T=T.sibling}if(!w){for(T=p.child;T;){if(T===o){w=!0,o=p,l=f;break}if(T===l){w=!0,l=p,o=f;break}T=T.sibling}if(!w)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function Jr(e){return e=qn(e),e!==null?ei(e):null}function ei(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ei(e);if(n!==null)return n;e=e.sibling}return null}var Kt=r.unstable_scheduleCallback,Rn=r.unstable_cancelCallback,xo=r.unstable_shouldYield,Mi=r.unstable_requestPaint,Ge=r.unstable_now,Pi=r.unstable_getCurrentPriorityLevel,Sr=r.unstable_ImmediatePriority,Ii=r.unstable_UserBlockingPriority,kr=r.unstable_NormalPriority,wo=r.unstable_LowPriority,Ti=r.unstable_IdlePriority,zn=null,_t=null;function Nr(e){if(_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(zn,e,void 0,(e.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:ko,An=Math.log,So=Math.LN2;function ko(e){return e>>>=0,e===0?32:31-(An(e)/So|0)|0}var yn=64,Ye=4194304;function $t(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 Er(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,f=e.suspendedLanes,p=e.pingedLanes,w=o&268435455;if(w!==0){var T=w&~f;T!==0?l=$t(T):(p&=w,p!==0&&(l=$t(p)))}else w=o&~f,w!==0?l=$t(w):p!==0&&(l=$t(p));if(l===0)return 0;if(n!==0&&n!==l&&(n&f)===0&&(f=l&-l,p=n&-n,f>=p||f===16&&(p&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-jt(n),f=1<<o,l|=e[o],n&=~f;return l}function Ri(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 No(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes;0<p;){var w=31-jt(p),T=1<<w,D=f[w];D===-1?((T&o)===0||(T&l)!==0)&&(f[w]=Ri(T,n)):D<=n&&(e.expiredLanes|=T),p&=~T}}function ti(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ln(){var e=yn;return yn<<=1,(yn&4194240)===0&&(yn=64),e}function ni(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Dn(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-jt(n),e[n]=o}function ri(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var f=31-jt(o),p=1<<f;n[f]=0,l[f]=-1,e[f]=-1,o&=~p}}function Eo(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-jt(o),f=1<<l;f&n|e[l]&n&&(e[l]|=n),o&=~f}}var Be=0;function Co(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var _o,Zn,_s,js,bs,jo=!1,vn=[],$n=null,Fn=null,sn=null,Cr=new Map,R=new Map,H=[],ne="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 ie(e,n){switch(e){case"focusin":case"focusout":$n=null;break;case"dragenter":case"dragleave":Fn=null;break;case"mouseover":case"mouseout":sn=null;break;case"pointerover":case"pointerout":Cr.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":R.delete(n.pointerId)}}function re(e,n,o,l,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:p,targetContainers:[f]},n!==null&&(n=Oo(n),n!==null&&Zn(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function ye(e,n,o,l,f){switch(n){case"focusin":return $n=re($n,e,n,o,l,f),!0;case"dragenter":return Fn=re(Fn,e,n,o,l,f),!0;case"mouseover":return sn=re(sn,e,n,o,l,f),!0;case"pointerover":var p=f.pointerId;return Cr.set(p,re(Cr.get(p)||null,e,n,o,l,f)),!0;case"gotpointercapture":return p=f.pointerId,R.set(p,re(R.get(p)||null,e,n,o,l,f)),!0}return!1}function _e(e){var n=ii(e.target);if(n!==null){var o=Ct(n);if(o!==null){if(n=o.tag,n===13){if(n=tt(o),n!==null){e.blockedOn=n,bs(e.priority,function(){_s(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function we(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=fa(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);pr=l,o.target.dispatchEvent(l),pr=null}else return n=Oo(o),n!==null&&Zn(n),e.blockedOn=o,!1;n.shift()}return!0}function Te(e,n,o){we(e)&&o.delete(n)}function Ue(){jo=!1,$n!==null&&we($n)&&($n=null),Fn!==null&&we(Fn)&&(Fn=null),sn!==null&&we(sn)&&(sn=null),Cr.forEach(Te),R.forEach(Te)}function We(e,n){e.blockedOn===n&&(e.blockedOn=null,jo||(jo=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ue)))}function ot(e){function n(f){return We(f,e)}if(0<vn.length){We(vn[0],e);for(var o=1;o<vn.length;o++){var l=vn[o];l.blockedOn===e&&(l.blockedOn=null)}}for($n!==null&&We($n,e),Fn!==null&&We(Fn,e),sn!==null&&We(sn,e),Cr.forEach(n),R.forEach(n),o=0;o<H.length;o++)l=H[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<H.length&&(o=H[0],o.blockedOn===null);)_e(o),o.blockedOn===null&&H.shift()}var Le=j.ReactCurrentBatchConfig,nt=!0;function On(e,n,o,l){var f=Be,p=Le.transition;Le.transition=null;try{Be=1,bo(e,n,o,l)}finally{Be=f,Le.transition=p}}function zi(e,n,o,l){var f=Be,p=Le.transition;Le.transition=null;try{Be=4,bo(e,n,o,l)}finally{Be=f,Le.transition=p}}function bo(e,n,o,l){if(nt){var f=fa(e,n,o,l);if(f===null)Ma(e,n,l,Ms,o),ie(e,l);else if(ye(f,e,n,o,l))l.stopPropagation();else if(ie(e,l),n&4&&-1<ne.indexOf(e)){for(;f!==null;){var p=Oo(f);if(p!==null&&_o(p),p=fa(e,n,o,l),p===null&&Ma(e,n,l,Ms,o),p===f)break;f=p}f!==null&&l.stopPropagation()}else Ma(e,n,l,null,o)}}var Ms=null;function fa(e,n,o,l){if(Ms=null,e=Gt(l),e=ii(e),e!==null)if(n=Ct(e),n===null)e=null;else if(o=n.tag,o===13){if(e=tt(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Ms=e,null}function Ou(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(Pi()){case Sr:return 1;case Ii:return 4;case kr:case wo:return 16;case Ti:return 536870912;default:return 16}default:return 16}}var _r=null,ha=null,Ps=null;function Hu(){if(Ps)return Ps;var e,n=ha,o=n.length,l,f="value"in _r?_r.value:_r.textContent,p=f.length;for(e=0;e<o&&n[e]===f[e];e++);var w=o-e;for(l=1;l<=w&&n[o-l]===f[p-l];l++);return Ps=f.slice(e,1<l?1-l:void 0)}function Is(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ts(){return!0}function Bu(){return!1}function Qt(e){function n(o,l,f,p,w){this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(o=e[T],this[T]=o?o(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ts:Bu,this.isPropagationStopped=Bu,this}return Y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),n}var Ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pa=Qt(Ai),Mo=Y({},Ai,{view:0,detail:0}),Rg=Qt(Mo),ma,ga,Po,Rs=Y({},Mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:va,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!==Po&&(Po&&e.type==="mousemove"?(ma=e.screenX-Po.screenX,ga=e.screenY-Po.screenY):ga=ma=0,Po=e),ma)},movementY:function(e){return"movementY"in e?e.movementY:ga}}),Vu=Qt(Rs),zg=Y({},Rs,{dataTransfer:0}),Ag=Qt(zg),Lg=Y({},Mo,{relatedTarget:0}),ya=Qt(Lg),Dg=Y({},Ai,{animationName:0,elapsedTime:0,pseudoElement:0}),$g=Qt(Dg),Fg=Y({},Ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Og=Qt(Fg),Hg=Y({},Ai,{data:0}),Wu=Qt(Hg),Bg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vg={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"},Wg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ug(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Wg[e])?!!n[e]:!1}function va(){return Ug}var Yg=Y({},Mo,{key:function(e){if(e.key){var n=Bg[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Is(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:va,charCode:function(e){return e.type==="keypress"?Is(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Is(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xg=Qt(Yg),Gg=Y({},Rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uu=Qt(Gg),Kg=Y({},Mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:va}),Qg=Qt(Kg),qg=Y({},Ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zg=Qt(qg),Jg=Y({},Rs,{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}),ey=Qt(Jg),ty=[9,13,27,32],xa=h&&"CompositionEvent"in window,Io=null;h&&"documentMode"in document&&(Io=document.documentMode);var ny=h&&"TextEvent"in window&&!Io,Yu=h&&(!xa||Io&&8<Io&&11>=Io),Xu=" ",Gu=!1;function Ku(e,n){switch(e){case"keyup":return ty.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Li=!1;function ry(e,n){switch(e){case"compositionend":return Qu(n);case"keypress":return n.which!==32?null:(Gu=!0,Xu);case"textInput":return e=n.data,e===Xu&&Gu?null:e;default:return null}}function iy(e,n){if(Li)return e==="compositionend"||!xa&&Ku(e,n)?(e=Hu(),Ps=ha=_r=null,Li=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Yu&&n.locale!=="ko"?null:n.data;default:return null}}var oy={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 qu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!oy[e.type]:n==="textarea"}function Zu(e,n,o,l){qr(l),n=$s(n,"onChange"),0<n.length&&(o=new pa("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var To=null,Ro=null;function sy(e){gd(e,0)}function zs(e){var n=Hi(e);if(ke(n))return e}function ly(e,n){if(e==="change")return n}var Ju=!1;if(h){var wa;if(h){var Sa="oninput"in document;if(!Sa){var ed=document.createElement("div");ed.setAttribute("oninput","return;"),Sa=typeof ed.oninput=="function"}wa=Sa}else wa=!1;Ju=wa&&(!document.documentMode||9<document.documentMode)}function td(){To&&(To.detachEvent("onpropertychange",nd),Ro=To=null)}function nd(e){if(e.propertyName==="value"&&zs(Ro)){var n=[];Zu(n,Ro,e,Gt(e)),yr(sy,n)}}function ay(e,n,o){e==="focusin"?(td(),To=n,Ro=o,To.attachEvent("onpropertychange",nd)):e==="focusout"&&td()}function cy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zs(Ro)}function uy(e,n){if(e==="click")return zs(n)}function dy(e,n){if(e==="input"||e==="change")return zs(n)}function fy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var xn=typeof Object.is=="function"?Object.is:fy;function zo(e,n){if(xn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!m.call(n,f)||!xn(e[f],n[f]))return!1}return!0}function rd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function id(e,n){var o=rd(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=rd(o)}}function od(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?od(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function sd(){for(var e=window,n=Ne();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ne(e.document)}return n}function ka(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function hy(e){var n=sd(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&od(o.ownerDocument.documentElement,o)){if(l!==null&&ka(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=o.textContent.length,p=Math.min(l.start,f);l=l.end===void 0?p:Math.min(l.end,f),!e.extend&&p>l&&(f=l,l=p,p=f),f=id(o,p);var w=id(o,l);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),p>l?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var py=h&&"documentMode"in document&&11>=document.documentMode,Di=null,Na=null,Ao=null,Ea=!1;function ld(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ea||Di==null||Di!==Ne(l)||(l=Di,"selectionStart"in l&&ka(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ao&&zo(Ao,l)||(Ao=l,l=$s(Na,"onSelect"),0<l.length&&(n=new pa("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=Di)))}function As(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var $i={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionend:As("Transition","TransitionEnd")},Ca={},ad={};h&&(ad=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function Ls(e){if(Ca[e])return Ca[e];if(!$i[e])return e;var n=$i[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in ad)return Ca[e]=n[o];return e}var cd=Ls("animationend"),ud=Ls("animationiteration"),dd=Ls("animationstart"),fd=Ls("transitionend"),hd=new Map,pd="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 jr(e,n){hd.set(e,n),c(n,[e])}for(var _a=0;_a<pd.length;_a++){var ja=pd[_a],my=ja.toLowerCase(),gy=ja[0].toUpperCase()+ja.slice(1);jr(my,"on"+gy)}jr(cd,"onAnimationEnd"),jr(ud,"onAnimationIteration"),jr(dd,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(fd,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),yy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lo));function md(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,vo(l,n,void 0,e),e.currentTarget=null}function gd(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],f=l.event;l=l.listeners;e:{var p=void 0;if(n)for(var w=l.length-1;0<=w;w--){var T=l[w],D=T.instance,ee=T.currentTarget;if(T=T.listener,D!==p&&f.isPropagationStopped())break e;md(f,T,ee),p=D}else for(w=0;w<l.length;w++){if(T=l[w],D=T.instance,ee=T.currentTarget,T=T.listener,D!==p&&f.isPropagationStopped())break e;md(f,T,ee),p=D}}}if(xr)throw e=Et,xr=!1,Et=null,e}function Ke(e,n){var o=n[Aa];o===void 0&&(o=n[Aa]=new Set);var l=e+"__bubble";o.has(l)||(yd(n,e,2,!1),o.add(l))}function ba(e,n,o){var l=0;n&&(l|=4),yd(o,e,l,n)}var Ds="_reactListening"+Math.random().toString(36).slice(2);function Do(e){if(!e[Ds]){e[Ds]=!0,s.forEach(function(o){o!=="selectionchange"&&(yy.has(o)||ba(o,!1,e),ba(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ds]||(n[Ds]=!0,ba("selectionchange",!1,n))}}function yd(e,n,o,l){switch(Ou(n)){case 1:var f=On;break;case 4:f=zi;break;default:f=bo}o=f.bind(null,n,o,e),f=void 0,!Pn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,o,{capture:!0,passive:f}):e.addEventListener(n,o,!0):f!==void 0?e.addEventListener(n,o,{passive:f}):e.addEventListener(n,o,!1)}function Ma(e,n,o,l,f){var p=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var T=l.stateNode.containerInfo;if(T===f||T.nodeType===8&&T.parentNode===f)break;if(w===4)for(w=l.return;w!==null;){var D=w.tag;if((D===3||D===4)&&(D=w.stateNode.containerInfo,D===f||D.nodeType===8&&D.parentNode===f))return;w=w.return}for(;T!==null;){if(w=ii(T),w===null)return;if(D=w.tag,D===5||D===6){l=p=w;continue e}T=T.parentNode}}l=l.return}yr(function(){var ee=p,ce=Gt(o),ue=[];e:{var ae=hd.get(e);if(ae!==void 0){var ge=pa,xe=e;switch(e){case"keypress":if(Is(o)===0)break e;case"keydown":case"keyup":ge=Xg;break;case"focusin":xe="focus",ge=ya;break;case"focusout":xe="blur",ge=ya;break;case"beforeblur":case"afterblur":ge=ya;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Vu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Ag;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Qg;break;case cd:case ud:case dd:ge=$g;break;case fd:ge=Zg;break;case"scroll":ge=Rg;break;case"wheel":ge=ey;break;case"copy":case"cut":case"paste":ge=Og;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Uu}var Se=(n&4)!==0,at=!Se&&e==="scroll",X=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var O=ee,q;O!==null;){q=O;var fe=q.stateNode;if(q.tag===5&&fe!==null&&(q=fe,X!==null&&(fe=gn(O,X),fe!=null&&Se.push($o(O,fe,q)))),at)break;O=O.return}0<Se.length&&(ae=new ge(ae,xe,null,o,ce),ue.push({event:ae,listeners:Se}))}}if((n&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ge=e==="mouseout"||e==="pointerout",ae&&o!==pr&&(xe=o.relatedTarget||o.fromElement)&&(ii(xe)||xe[Jn]))break e;if((ge||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(xe=o.relatedTarget||o.toElement,ge=ee,xe=xe?ii(xe):null,xe!==null&&(at=Ct(xe),xe!==at||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ge=null,xe=ee),ge!==xe)){if(Se=Vu,fe="onMouseLeave",X="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Uu,fe="onPointerLeave",X="onPointerEnter",O="pointer"),at=ge==null?ae:Hi(ge),q=xe==null?ae:Hi(xe),ae=new Se(fe,O+"leave",ge,o,ce),ae.target=at,ae.relatedTarget=q,fe=null,ii(ce)===ee&&(Se=new Se(X,O+"enter",xe,o,ce),Se.target=q,Se.relatedTarget=at,fe=Se),at=fe,ge&&xe)t:{for(Se=ge,X=xe,O=0,q=Se;q;q=Fi(q))O++;for(q=0,fe=X;fe;fe=Fi(fe))q++;for(;0<O-q;)Se=Fi(Se),O--;for(;0<q-O;)X=Fi(X),q--;for(;O--;){if(Se===X||X!==null&&Se===X.alternate)break t;Se=Fi(Se),X=Fi(X)}Se=null}else Se=null;ge!==null&&vd(ue,ae,ge,Se,!1),xe!==null&&at!==null&&vd(ue,at,xe,Se,!0)}}e:{if(ae=ee?Hi(ee):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var Ee=ly;else if(qu(ae))if(Ju)Ee=dy;else{Ee=cy;var Me=ay}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Ee=uy);if(Ee&&(Ee=Ee(e,ee))){Zu(ue,Ee,o,ce);break e}Me&&Me(e,ae,ee),e==="focusout"&&(Me=ae._wrapperState)&&Me.controlled&&ae.type==="number"&&kt(ae,"number",ae.value)}switch(Me=ee?Hi(ee):window,e){case"focusin":(qu(Me)||Me.contentEditable==="true")&&(Di=Me,Na=ee,Ao=null);break;case"focusout":Ao=Na=Di=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,ld(ue,o,ce);break;case"selectionchange":if(py)break;case"keydown":case"keyup":ld(ue,o,ce)}var Pe;if(xa)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Li?Ku(e,o)&&(ze="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ze="onCompositionStart");ze&&(Yu&&o.locale!=="ko"&&(Li||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Li&&(Pe=Hu()):(_r=ce,ha="value"in _r?_r.value:_r.textContent,Li=!0)),Me=$s(ee,ze),0<Me.length&&(ze=new Wu(ze,e,null,o,ce),ue.push({event:ze,listeners:Me}),Pe?ze.data=Pe:(Pe=Qu(o),Pe!==null&&(ze.data=Pe)))),(Pe=ny?ry(e,o):iy(e,o))&&(ee=$s(ee,"onBeforeInput"),0<ee.length&&(ce=new Wu("onBeforeInput","beforeinput",null,o,ce),ue.push({event:ce,listeners:ee}),ce.data=Pe))}gd(ue,n)})}function $o(e,n,o){return{instance:e,listener:n,currentTarget:o}}function $s(e,n){for(var o=n+"Capture",l=[];e!==null;){var f=e,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=gn(e,o),p!=null&&l.unshift($o(e,p,f)),p=gn(e,n),p!=null&&l.push($o(e,p,f))),e=e.return}return l}function Fi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function vd(e,n,o,l,f){for(var p=n._reactName,w=[];o!==null&&o!==l;){var T=o,D=T.alternate,ee=T.stateNode;if(D!==null&&D===l)break;T.tag===5&&ee!==null&&(T=ee,f?(D=gn(o,p),D!=null&&w.unshift($o(o,D,T))):f||(D=gn(o,p),D!=null&&w.push($o(o,D,T)))),o=o.return}w.length!==0&&e.push({event:n,listeners:w})}var vy=/\r\n?/g,xy=/\u0000|\uFFFD/g;function xd(e){return(typeof e=="string"?e:""+e).replace(vy,`
38
- `).replace(xy,"")}function Fs(e,n,o){if(n=xd(n),xd(e)!==n&&o)throw Error(i(425))}function Os(){}var Pa=null,Ia=null;function Ta(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ra=typeof setTimeout=="function"?setTimeout:void 0,wy=typeof clearTimeout=="function"?clearTimeout:void 0,wd=typeof Promise=="function"?Promise:void 0,Sy=typeof queueMicrotask=="function"?queueMicrotask:typeof wd<"u"?function(e){return wd.resolve(null).then(e).catch(ky)}:Ra;function ky(e){setTimeout(function(){throw e})}function za(e,n){var o=n,l=0;do{var f=o.nextSibling;if(e.removeChild(o),f&&f.nodeType===8)if(o=f.data,o==="/$"){if(l===0){e.removeChild(f),ot(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=f}while(o);ot(n)}function br(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Sd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var Oi=Math.random().toString(36).slice(2),Hn="__reactFiber$"+Oi,Fo="__reactProps$"+Oi,Jn="__reactContainer$"+Oi,Aa="__reactEvents$"+Oi,Ny="__reactListeners$"+Oi,Ey="__reactHandles$"+Oi;function ii(e){var n=e[Hn];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Jn]||o[Hn]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=Sd(e);e!==null;){if(o=e[Hn])return o;e=Sd(e)}return n}e=o,o=e.parentNode}return null}function Oo(e){return e=e[Hn]||e[Jn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Hs(e){return e[Fo]||null}var La=[],Bi=-1;function Mr(e){return{current:e}}function Qe(e){0>Bi||(e.current=La[Bi],La[Bi]=null,Bi--)}function Xe(e,n){Bi++,La[Bi]=e.current,e.current=n}var Pr={},bt=Mr(Pr),Ft=Mr(!1),oi=Pr;function Vi(e,n){var o=e.type.contextTypes;if(!o)return Pr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in o)f[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function Ot(e){return e=e.childContextTypes,e!=null}function Bs(){Qe(Ft),Qe(bt)}function kd(e,n,o){if(bt.current!==Pr)throw Error(i(168));Xe(bt,n),Xe(Ft,o)}function Nd(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var f in l)if(!(f in n))throw Error(i(108,me(e)||"Unknown",f));return Y({},o,l)}function Vs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pr,oi=bt.current,Xe(bt,e),Xe(Ft,Ft.current),!0}function Ed(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=Nd(e,n,oi),l.__reactInternalMemoizedMergedChildContext=e,Qe(Ft),Qe(bt),Xe(bt,e)):Qe(Ft),Xe(Ft,o)}var er=null,Ws=!1,Da=!1;function Cd(e){er===null?er=[e]:er.push(e)}function Cy(e){Ws=!0,Cd(e)}function Ir(){if(!Da&&er!==null){Da=!0;var e=0,n=Be;try{var o=er;for(Be=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}er=null,Ws=!1}catch(f){throw er!==null&&(er=er.slice(e+1)),Kt(Sr,Ir),f}finally{Be=n,Da=!1}}return null}var Wi=[],Ui=0,Us=null,Ys=0,ln=[],an=0,si=null,tr=1,nr="";function li(e,n){Wi[Ui++]=Ys,Wi[Ui++]=Us,Us=e,Ys=n}function _d(e,n,o){ln[an++]=tr,ln[an++]=nr,ln[an++]=si,si=e;var l=tr;e=nr;var f=32-jt(l)-1;l&=~(1<<f),o+=1;var p=32-jt(n)+f;if(30<p){var w=f-f%5;p=(l&(1<<w)-1).toString(32),l>>=w,f-=w,tr=1<<32-jt(n)+f|o<<f|l,nr=p+e}else tr=1<<p|o<<f|l,nr=e}function $a(e){e.return!==null&&(li(e,1),_d(e,1,0))}function Fa(e){for(;e===Us;)Us=Wi[--Ui],Wi[Ui]=null,Ys=Wi[--Ui],Wi[Ui]=null;for(;e===si;)si=ln[--an],ln[an]=null,nr=ln[--an],ln[an]=null,tr=ln[--an],ln[an]=null}var qt=null,Zt=null,qe=!1,wn=null;function jd(e,n){var o=fn(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function bd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,qt=e,Zt=br(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,qt=e,Zt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=si!==null?{id:tr,overflow:nr}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=fn(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,qt=e,Zt=null,!0):!1;default:return!1}}function Oa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ha(e){if(qe){var n=Zt;if(n){var o=n;if(!bd(e,n)){if(Oa(e))throw Error(i(418));n=br(o.nextSibling);var l=qt;n&&bd(e,n)?jd(l,o):(e.flags=e.flags&-4097|2,qe=!1,qt=e)}}else{if(Oa(e))throw Error(i(418));e.flags=e.flags&-4097|2,qe=!1,qt=e}}}function Md(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qt=e}function Xs(e){if(e!==qt)return!1;if(!qe)return Md(e),qe=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ta(e.type,e.memoizedProps)),n&&(n=Zt)){if(Oa(e))throw Pd(),Error(i(418));for(;n;)jd(e,n),n=br(n.nextSibling)}if(Md(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Zt=br(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Zt=null}}else Zt=qt?br(e.stateNode.nextSibling):null;return!0}function Pd(){for(var e=Zt;e;)e=br(e.nextSibling)}function Yi(){Zt=qt=null,qe=!1}function Ba(e){wn===null?wn=[e]:wn.push(e)}var _y=j.ReactCurrentBatchConfig;function Ho(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var l=o.stateNode}if(!l)throw Error(i(147,e));var f=l,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(w){var T=f.refs;w===null?delete T[p]:T[p]=w},n._stringRef=p,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function Gs(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Id(e){var n=e._init;return n(e._payload)}function Td(e){function n(X,O){if(e){var q=X.deletions;q===null?(X.deletions=[O],X.flags|=16):q.push(O)}}function o(X,O){if(!e)return null;for(;O!==null;)n(X,O),O=O.sibling;return null}function l(X,O){for(X=new Map;O!==null;)O.key!==null?X.set(O.key,O):X.set(O.index,O),O=O.sibling;return X}function f(X,O){return X=Fr(X,O),X.index=0,X.sibling=null,X}function p(X,O,q){return X.index=q,e?(q=X.alternate,q!==null?(q=q.index,q<O?(X.flags|=2,O):q):(X.flags|=2,O)):(X.flags|=1048576,O)}function w(X){return e&&X.alternate===null&&(X.flags|=2),X}function T(X,O,q,fe){return O===null||O.tag!==6?(O=Rc(q,X.mode,fe),O.return=X,O):(O=f(O,q),O.return=X,O)}function D(X,O,q,fe){var Ee=q.type;return Ee===B?ce(X,O,q.props.children,fe,q.key):O!==null&&(O.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===W&&Id(Ee)===O.type)?(fe=f(O,q.props),fe.ref=Ho(X,O,q),fe.return=X,fe):(fe=vl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=Ho(X,O,q),fe.return=X,fe)}function ee(X,O,q,fe){return O===null||O.tag!==4||O.stateNode.containerInfo!==q.containerInfo||O.stateNode.implementation!==q.implementation?(O=zc(q,X.mode,fe),O.return=X,O):(O=f(O,q.children||[]),O.return=X,O)}function ce(X,O,q,fe,Ee){return O===null||O.tag!==7?(O=mi(q,X.mode,fe,Ee),O.return=X,O):(O=f(O,q),O.return=X,O)}function ue(X,O,q){if(typeof O=="string"&&O!==""||typeof O=="number")return O=Rc(""+O,X.mode,q),O.return=X,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case F:return q=vl(O.type,O.key,O.props,null,X.mode,q),q.ref=Ho(X,null,O),q.return=X,q;case L:return O=zc(O,X.mode,q),O.return=X,O;case W:var fe=O._init;return ue(X,fe(O._payload),q)}if(ht(O)||A(O))return O=mi(O,X.mode,q,null),O.return=X,O;Gs(X,O)}return null}function ae(X,O,q,fe){var Ee=O!==null?O.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return Ee!==null?null:T(X,O,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case F:return q.key===Ee?D(X,O,q,fe):null;case L:return q.key===Ee?ee(X,O,q,fe):null;case W:return Ee=q._init,ae(X,O,Ee(q._payload),fe)}if(ht(q)||A(q))return Ee!==null?null:ce(X,O,q,fe,null);Gs(X,q)}return null}function ge(X,O,q,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return X=X.get(q)||null,T(O,X,""+fe,Ee);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case F:return X=X.get(fe.key===null?q:fe.key)||null,D(O,X,fe,Ee);case L:return X=X.get(fe.key===null?q:fe.key)||null,ee(O,X,fe,Ee);case W:var Me=fe._init;return ge(X,O,q,Me(fe._payload),Ee)}if(ht(fe)||A(fe))return X=X.get(q)||null,ce(O,X,fe,Ee,null);Gs(O,fe)}return null}function xe(X,O,q,fe){for(var Ee=null,Me=null,Pe=O,ze=O=0,gt=null;Pe!==null&&ze<q.length;ze++){Pe.index>ze?(gt=Pe,Pe=null):gt=Pe.sibling;var Ve=ae(X,Pe,q[ze],fe);if(Ve===null){Pe===null&&(Pe=gt);break}e&&Pe&&Ve.alternate===null&&n(X,Pe),O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve,Pe=gt}if(ze===q.length)return o(X,Pe),qe&&li(X,ze),Ee;if(Pe===null){for(;ze<q.length;ze++)Pe=ue(X,q[ze],fe),Pe!==null&&(O=p(Pe,O,ze),Me===null?Ee=Pe:Me.sibling=Pe,Me=Pe);return qe&&li(X,ze),Ee}for(Pe=l(X,Pe);ze<q.length;ze++)gt=ge(Pe,X,ze,q[ze],fe),gt!==null&&(e&&gt.alternate!==null&&Pe.delete(gt.key===null?ze:gt.key),O=p(gt,O,ze),Me===null?Ee=gt:Me.sibling=gt,Me=gt);return e&&Pe.forEach(function(Or){return n(X,Or)}),qe&&li(X,ze),Ee}function Se(X,O,q,fe){var Ee=A(q);if(typeof Ee!="function")throw Error(i(150));if(q=Ee.call(q),q==null)throw Error(i(151));for(var Me=Ee=null,Pe=O,ze=O=0,gt=null,Ve=q.next();Pe!==null&&!Ve.done;ze++,Ve=q.next()){Pe.index>ze?(gt=Pe,Pe=null):gt=Pe.sibling;var Or=ae(X,Pe,Ve.value,fe);if(Or===null){Pe===null&&(Pe=gt);break}e&&Pe&&Or.alternate===null&&n(X,Pe),O=p(Or,O,ze),Me===null?Ee=Or:Me.sibling=Or,Me=Or,Pe=gt}if(Ve.done)return o(X,Pe),qe&&li(X,ze),Ee;if(Pe===null){for(;!Ve.done;ze++,Ve=q.next())Ve=ue(X,Ve.value,fe),Ve!==null&&(O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve);return qe&&li(X,ze),Ee}for(Pe=l(X,Pe);!Ve.done;ze++,Ve=q.next())Ve=ge(Pe,X,ze,Ve.value,fe),Ve!==null&&(e&&Ve.alternate!==null&&Pe.delete(Ve.key===null?ze:Ve.key),O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve);return e&&Pe.forEach(function(o0){return n(X,o0)}),qe&&li(X,ze),Ee}function at(X,O,q,fe){if(typeof q=="object"&&q!==null&&q.type===B&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case F:e:{for(var Ee=q.key,Me=O;Me!==null;){if(Me.key===Ee){if(Ee=q.type,Ee===B){if(Me.tag===7){o(X,Me.sibling),O=f(Me,q.props.children),O.return=X,X=O;break e}}else if(Me.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===W&&Id(Ee)===Me.type){o(X,Me.sibling),O=f(Me,q.props),O.ref=Ho(X,Me,q),O.return=X,X=O;break e}o(X,Me);break}else n(X,Me);Me=Me.sibling}q.type===B?(O=mi(q.props.children,X.mode,fe,q.key),O.return=X,X=O):(fe=vl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=Ho(X,O,q),fe.return=X,X=fe)}return w(X);case L:e:{for(Me=q.key;O!==null;){if(O.key===Me)if(O.tag===4&&O.stateNode.containerInfo===q.containerInfo&&O.stateNode.implementation===q.implementation){o(X,O.sibling),O=f(O,q.children||[]),O.return=X,X=O;break e}else{o(X,O);break}else n(X,O);O=O.sibling}O=zc(q,X.mode,fe),O.return=X,X=O}return w(X);case W:return Me=q._init,at(X,O,Me(q._payload),fe)}if(ht(q))return xe(X,O,q,fe);if(A(q))return Se(X,O,q,fe);Gs(X,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,O!==null&&O.tag===6?(o(X,O.sibling),O=f(O,q),O.return=X,X=O):(o(X,O),O=Rc(q,X.mode,fe),O.return=X,X=O),w(X)):o(X,O)}return at}var Xi=Td(!0),Rd=Td(!1),Ks=Mr(null),Qs=null,Gi=null,Va=null;function Wa(){Va=Gi=Qs=null}function Ua(e){var n=Ks.current;Qe(Ks),e._currentValue=n}function Ya(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function Ki(e,n){Qs=e,Va=Gi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Ht=!0),e.firstContext=null)}function cn(e){var n=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:n,next:null},Gi===null){if(Qs===null)throw Error(i(308));Gi=e,Qs.dependencies={lanes:0,firstContext:e}}else Gi=Gi.next=e;return n}var ai=null;function Xa(e){ai===null?ai=[e]:ai.push(e)}function zd(e,n,o,l){var f=n.interleaved;return f===null?(o.next=o,Xa(n)):(o.next=f.next,f.next=o),n.interleaved=o,rr(e,l)}function rr(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Tr=!1;function Ga(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ad(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ir(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Rr(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,rr(e,o)}return f=l.interleaved,f===null?(n.next=n,Xa(l)):(n.next=f.next,f.next=n),l.interleaved=n,rr(e,o)}function qs(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Eo(e,o)}}function Ld(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};p===null?f=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?f=p=n:p=p.next=n}else f=p=n;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function Zs(e,n,o,l){var f=e.updateQueue;Tr=!1;var p=f.firstBaseUpdate,w=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var D=T,ee=D.next;D.next=null,w===null?p=ee:w.next=ee,w=D;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,T=ce.lastBaseUpdate,T!==w&&(T===null?ce.firstBaseUpdate=ee:T.next=ee,ce.lastBaseUpdate=D))}if(p!==null){var ue=f.baseState;w=0,ce=ee=D=null,T=p;do{var ae=T.lane,ge=T.eventTime;if((l&ae)===ae){ce!==null&&(ce=ce.next={eventTime:ge,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=e,Se=T;switch(ae=n,ge=o,Se.tag){case 1:if(xe=Se.payload,typeof xe=="function"){ue=xe.call(ge,ue,ae);break e}ue=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Se.payload,ae=typeof xe=="function"?xe.call(ge,ue,ae):xe,ae==null)break e;ue=Y({},ue,ae);break e;case 2:Tr=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,ae=f.effects,ae===null?f.effects=[T]:ae.push(T))}else ge={eventTime:ge,lane:ae,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ce===null?(ee=ce=ge,D=ue):ce=ce.next=ge,w|=ae;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;ae=T,T=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);if(ce===null&&(D=ue),f.baseState=D,f.firstBaseUpdate=ee,f.lastBaseUpdate=ce,n=f.shared.interleaved,n!==null){f=n;do w|=f.lane,f=f.next;while(f!==n)}else p===null&&(f.shared.lanes=0);di|=w,e.lanes=w,e.memoizedState=ue}}function Dd(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],f=l.callback;if(f!==null){if(l.callback=null,l=o,typeof f!="function")throw Error(i(191,f));f.call(l)}}}var Bo={},Bn=Mr(Bo),Vo=Mr(Bo),Wo=Mr(Bo);function ci(e){if(e===Bo)throw Error(i(174));return e}function Ka(e,n){switch(Xe(Wo,n),Xe(Vo,e),Xe(Bn,Bo),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:rn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=rn(n,e)}Qe(Bn),Xe(Bn,n)}function Qi(){Qe(Bn),Qe(Vo),Qe(Wo)}function $d(e){ci(Wo.current);var n=ci(Bn.current),o=rn(n,e.type);n!==o&&(Xe(Vo,e),Xe(Bn,o))}function Qa(e){Vo.current===e&&(Qe(Bn),Qe(Vo))}var rt=Mr(0);function Js(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var qa=[];function Za(){for(var e=0;e<qa.length;e++)qa[e]._workInProgressVersionPrimary=null;qa.length=0}var el=j.ReactCurrentDispatcher,Ja=j.ReactCurrentBatchConfig,ui=0,it=null,dt=null,pt=null,tl=!1,Uo=!1,Yo=0,jy=0;function Mt(){throw Error(i(321))}function ec(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!xn(e[o],n[o]))return!1;return!0}function tc(e,n,o,l,f,p){if(ui=p,it=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,el.current=e===null||e.memoizedState===null?Iy:Ty,e=o(l,f),Uo){p=0;do{if(Uo=!1,Yo=0,25<=p)throw Error(i(301));p+=1,pt=dt=null,n.updateQueue=null,el.current=Ry,e=o(l,f)}while(Uo)}if(el.current=il,n=dt!==null&&dt.next!==null,ui=0,pt=dt=it=null,tl=!1,n)throw Error(i(300));return e}function nc(){var e=Yo!==0;return Yo=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?it.memoizedState=pt=e:pt=pt.next=e,pt}function un(){if(dt===null){var e=it.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=pt===null?it.memoizedState:pt.next;if(n!==null)pt=n,dt=e;else{if(e===null)throw Error(i(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},pt===null?it.memoizedState=pt=e:pt=pt.next=e}return pt}function Xo(e,n){return typeof n=="function"?n(e):n}function rc(e){var n=un(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=dt,f=l.baseQueue,p=o.pending;if(p!==null){if(f!==null){var w=f.next;f.next=p.next,p.next=w}l.baseQueue=f=p,o.pending=null}if(f!==null){p=f.next,l=l.baseState;var T=w=null,D=null,ee=p;do{var ce=ee.lane;if((ui&ce)===ce)D!==null&&(D=D.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),l=ee.hasEagerState?ee.eagerState:e(l,ee.action);else{var ue={lane:ce,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};D===null?(T=D=ue,w=l):D=D.next=ue,it.lanes|=ce,di|=ce}ee=ee.next}while(ee!==null&&ee!==p);D===null?w=l:D.next=T,xn(l,n.memoizedState)||(Ht=!0),n.memoizedState=l,n.baseState=w,n.baseQueue=D,o.lastRenderedState=l}if(e=o.interleaved,e!==null){f=e;do p=f.lane,it.lanes|=p,di|=p,f=f.next;while(f!==e)}else f===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function ic(e){var n=un(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,f=o.pending,p=n.memoizedState;if(f!==null){o.pending=null;var w=f=f.next;do p=e(p,w.action),w=w.next;while(w!==f);xn(p,n.memoizedState)||(Ht=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),o.lastRenderedState=p}return[p,l]}function Fd(){}function Od(e,n){var o=it,l=un(),f=n(),p=!xn(l.memoizedState,f);if(p&&(l.memoizedState=f,Ht=!0),l=l.queue,oc(Vd.bind(null,o,l,e),[e]),l.getSnapshot!==n||p||pt!==null&&pt.memoizedState.tag&1){if(o.flags|=2048,Go(9,Bd.bind(null,o,l,f,n),void 0,null),mt===null)throw Error(i(349));(ui&30)!==0||Hd(o,n,f)}return f}function Hd(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=it.updateQueue,n===null?(n={lastEffect:null,stores:null},it.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Bd(e,n,o,l){n.value=o,n.getSnapshot=l,Wd(n)&&Ud(e)}function Vd(e,n,o){return o(function(){Wd(n)&&Ud(e)})}function Wd(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!xn(e,o)}catch{return!0}}function Ud(e){var n=rr(e,1);n!==null&&En(n,e,1,-1)}function Yd(e){var n=Vn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:e},n.queue=e,e=e.dispatch=Py.bind(null,it,e),[n.memoizedState,e]}function Go(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=it.updateQueue,n===null?(n={lastEffect:null,stores:null},it.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Xd(){return un().memoizedState}function nl(e,n,o,l){var f=Vn();it.flags|=e,f.memoizedState=Go(1|n,o,void 0,l===void 0?null:l)}function rl(e,n,o,l){var f=un();l=l===void 0?null:l;var p=void 0;if(dt!==null){var w=dt.memoizedState;if(p=w.destroy,l!==null&&ec(l,w.deps)){f.memoizedState=Go(n,o,p,l);return}}it.flags|=e,f.memoizedState=Go(1|n,o,p,l)}function Gd(e,n){return nl(8390656,8,e,n)}function oc(e,n){return rl(2048,8,e,n)}function Kd(e,n){return rl(4,2,e,n)}function Qd(e,n){return rl(4,4,e,n)}function qd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Zd(e,n,o){return o=o!=null?o.concat([e]):null,rl(4,4,qd.bind(null,n,e),o)}function sc(){}function Jd(e,n){var o=un();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&ec(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function ef(e,n){var o=un();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&ec(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function tf(e,n,o){return(ui&21)===0?(e.baseState&&(e.baseState=!1,Ht=!0),e.memoizedState=o):(xn(o,n)||(o=Ln(),it.lanes|=o,di|=o,e.baseState=!0),n)}function by(e,n){var o=Be;Be=o!==0&&4>o?o:4,e(!0);var l=Ja.transition;Ja.transition={};try{e(!1),n()}finally{Be=o,Ja.transition=l}}function nf(){return un().memoizedState}function My(e,n,o){var l=Dr(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},rf(e))of(n,o);else if(o=zd(e,n,o,l),o!==null){var f=zt();En(o,e,l,f),sf(o,n,l)}}function Py(e,n,o){var l=Dr(e),f={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(rf(e))of(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,T=p(w,o);if(f.hasEagerState=!0,f.eagerState=T,xn(T,w)){var D=n.interleaved;D===null?(f.next=f,Xa(n)):(f.next=D.next,D.next=f),n.interleaved=f;return}}catch{}finally{}o=zd(e,n,f,l),o!==null&&(f=zt(),En(o,e,l,f),sf(o,n,l))}}function rf(e){var n=e.alternate;return e===it||n!==null&&n===it}function of(e,n){Uo=tl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function sf(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Eo(e,o)}}var il={readContext:cn,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},Iy={readContext:cn,useCallback:function(e,n){return Vn().memoizedState=[e,n===void 0?null:n],e},useContext:cn,useEffect:Gd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,nl(4194308,4,qd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return nl(4194308,4,e,n)},useInsertionEffect:function(e,n){return nl(4,2,e,n)},useMemo:function(e,n){var o=Vn();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=Vn();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=My.bind(null,it,e),[l.memoizedState,e]},useRef:function(e){var n=Vn();return e={current:e},n.memoizedState=e},useState:Yd,useDebugValue:sc,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Yd(!1),n=e[0];return e=by.bind(null,e[1]),Vn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=it,f=Vn();if(qe){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),mt===null)throw Error(i(349));(ui&30)!==0||Hd(l,n,o)}f.memoizedState=o;var p={value:o,getSnapshot:n};return f.queue=p,Gd(Vd.bind(null,l,p,e),[e]),l.flags|=2048,Go(9,Bd.bind(null,l,p,o,n),void 0,null),o},useId:function(){var e=Vn(),n=mt.identifierPrefix;if(qe){var o=nr,l=tr;o=(l&~(1<<32-jt(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=Yo++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=jy++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Ty={readContext:cn,useCallback:Jd,useContext:cn,useEffect:oc,useImperativeHandle:Zd,useInsertionEffect:Kd,useLayoutEffect:Qd,useMemo:ef,useReducer:rc,useRef:Xd,useState:function(){return rc(Xo)},useDebugValue:sc,useDeferredValue:function(e){var n=un();return tf(n,dt.memoizedState,e)},useTransition:function(){var e=rc(Xo)[0],n=un().memoizedState;return[e,n]},useMutableSource:Fd,useSyncExternalStore:Od,useId:nf,unstable_isNewReconciler:!1},Ry={readContext:cn,useCallback:Jd,useContext:cn,useEffect:oc,useImperativeHandle:Zd,useInsertionEffect:Kd,useLayoutEffect:Qd,useMemo:ef,useReducer:ic,useRef:Xd,useState:function(){return ic(Xo)},useDebugValue:sc,useDeferredValue:function(e){var n=un();return dt===null?n.memoizedState=e:tf(n,dt.memoizedState,e)},useTransition:function(){var e=ic(Xo)[0],n=un().memoizedState;return[e,n]},useMutableSource:Fd,useSyncExternalStore:Od,useId:nf,unstable_isNewReconciler:!1};function Sn(e,n){if(e&&e.defaultProps){n=Y({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function lc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:Y({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var ol={isMounted:function(e){return(e=e._reactInternals)?Ct(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=zt(),f=Dr(e),p=ir(l,f);p.payload=n,o!=null&&(p.callback=o),n=Rr(e,p,f),n!==null&&(En(n,e,f,l),qs(n,e,f))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=zt(),f=Dr(e),p=ir(l,f);p.tag=1,p.payload=n,o!=null&&(p.callback=o),n=Rr(e,p,f),n!==null&&(En(n,e,f,l),qs(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=zt(),l=Dr(e),f=ir(o,l);f.tag=2,n!=null&&(f.callback=n),n=Rr(e,f,l),n!==null&&(En(n,e,l,o),qs(n,e,l))}};function lf(e,n,o,l,f,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,w):n.prototype&&n.prototype.isPureReactComponent?!zo(o,l)||!zo(f,p):!0}function af(e,n,o){var l=!1,f=Pr,p=n.contextType;return typeof p=="object"&&p!==null?p=cn(p):(f=Ot(n)?oi:bt.current,l=n.contextTypes,p=(l=l!=null)?Vi(e,f):Pr),n=new n(o,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=ol,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=p),n}function cf(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&ol.enqueueReplaceState(n,n.state,null)}function ac(e,n,o,l){var f=e.stateNode;f.props=o,f.state=e.memoizedState,f.refs={},Ga(e);var p=n.contextType;typeof p=="object"&&p!==null?f.context=cn(p):(p=Ot(n)?oi:bt.current,f.context=Vi(e,p)),f.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(lc(e,n,p,o),f.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(n=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),n!==f.state&&ol.enqueueReplaceState(f,f.state,null),Zs(e,o,f,l),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function qi(e,n){try{var o="",l=n;do o+=de(l),l=l.return;while(l);var f=o}catch(p){f=`
39
- Error generating stack: `+p.message+`
40
- `+p.stack}return{value:e,source:n,stack:f,digest:null}}function cc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function uc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var zy=typeof WeakMap=="function"?WeakMap:Map;function uf(e,n,o){o=ir(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){fl||(fl=!0,Cc=l),uc(e,n)},o}function df(e,n,o){o=ir(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var f=n.value;o.payload=function(){return l(f)},o.callback=function(){uc(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(o.callback=function(){uc(e,n),typeof l!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),o}function ff(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new zy;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(o)||(f.add(o),e=Gy.bind(null,e,n,o),n.then(e,e))}function hf(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function pf(e,n,o,l,f){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=ir(-1,1),n.tag=2,Rr(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Ay=j.ReactCurrentOwner,Ht=!1;function Rt(e,n,o,l){n.child=e===null?Rd(n,null,o,l):Xi(n,e.child,o,l)}function mf(e,n,o,l,f){o=o.render;var p=n.ref;return Ki(n,f),l=tc(e,n,o,l,p,f),o=nc(),e!==null&&!Ht?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,or(e,n,f)):(qe&&o&&$a(n),n.flags|=1,Rt(e,n,l,f),n.child)}function gf(e,n,o,l,f){if(e===null){var p=o.type;return typeof p=="function"&&!Tc(p)&&p.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=p,yf(e,n,p,l,f)):(e=vl(o.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&f)===0){var w=p.memoizedProps;if(o=o.compare,o=o!==null?o:zo,o(w,l)&&e.ref===n.ref)return or(e,n,f)}return n.flags|=1,e=Fr(p,l),e.ref=n.ref,e.return=n,n.child=e}function yf(e,n,o,l,f){if(e!==null){var p=e.memoizedProps;if(zo(p,l)&&e.ref===n.ref)if(Ht=!1,n.pendingProps=l=p,(e.lanes&f)!==0)(e.flags&131072)!==0&&(Ht=!0);else return n.lanes=e.lanes,or(e,n,f)}return dc(e,n,o,l,f)}function vf(e,n,o){var l=n.pendingProps,f=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(Ji,Jt),Jt|=o;else{if((o&1073741824)===0)return e=p!==null?p.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Xe(Ji,Jt),Jt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:o,Xe(Ji,Jt),Jt|=l}else p!==null?(l=p.baseLanes|o,n.memoizedState=null):l=o,Xe(Ji,Jt),Jt|=l;return Rt(e,n,f,o),n.child}function xf(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function dc(e,n,o,l,f){var p=Ot(o)?oi:bt.current;return p=Vi(n,p),Ki(n,f),o=tc(e,n,o,l,p,f),l=nc(),e!==null&&!Ht?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,or(e,n,f)):(qe&&l&&$a(n),n.flags|=1,Rt(e,n,o,f),n.child)}function wf(e,n,o,l,f){if(Ot(o)){var p=!0;Vs(n)}else p=!1;if(Ki(n,f),n.stateNode===null)ll(e,n),af(n,o,l),ac(n,o,l,f),l=!0;else if(e===null){var w=n.stateNode,T=n.memoizedProps;w.props=T;var D=w.context,ee=o.contextType;typeof ee=="object"&&ee!==null?ee=cn(ee):(ee=Ot(o)?oi:bt.current,ee=Vi(n,ee));var ce=o.getDerivedStateFromProps,ue=typeof ce=="function"||typeof w.getSnapshotBeforeUpdate=="function";ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==l||D!==ee)&&cf(n,w,l,ee),Tr=!1;var ae=n.memoizedState;w.state=ae,Zs(n,l,w,f),D=n.memoizedState,T!==l||ae!==D||Ft.current||Tr?(typeof ce=="function"&&(lc(n,o,ce,l),D=n.memoizedState),(T=Tr||lf(n,o,T,l,ae,D,ee))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=D),w.props=l,w.state=D,w.context=ee,l=T):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,Ad(e,n),T=n.memoizedProps,ee=n.type===n.elementType?T:Sn(n.type,T),w.props=ee,ue=n.pendingProps,ae=w.context,D=o.contextType,typeof D=="object"&&D!==null?D=cn(D):(D=Ot(o)?oi:bt.current,D=Vi(n,D));var ge=o.getDerivedStateFromProps;(ce=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ue||ae!==D)&&cf(n,w,l,D),Tr=!1,ae=n.memoizedState,w.state=ae,Zs(n,l,w,f);var xe=n.memoizedState;T!==ue||ae!==xe||Ft.current||Tr?(typeof ge=="function"&&(lc(n,o,ge,l),xe=n.memoizedState),(ee=Tr||lf(n,o,ee,l,ae,xe,D)||!1)?(ce||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,xe,D),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,xe,D)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=xe),w.props=l,w.state=xe,w.context=D,l=ee):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),l=!1)}return fc(e,n,o,l,p,f)}function fc(e,n,o,l,f,p){xf(e,n);var w=(n.flags&128)!==0;if(!l&&!w)return f&&Ed(n,o,!1),or(e,n,p);l=n.stateNode,Ay.current=n;var T=w&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Xi(n,e.child,null,p),n.child=Xi(n,null,T,p)):Rt(e,n,T,p),n.memoizedState=l.state,f&&Ed(n,o,!0),n.child}function Sf(e){var n=e.stateNode;n.pendingContext?kd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&kd(e,n.context,!1),Ka(e,n.containerInfo)}function kf(e,n,o,l,f){return Yi(),Ba(f),n.flags|=256,Rt(e,n,o,l),n.child}var hc={dehydrated:null,treeContext:null,retryLane:0};function pc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nf(e,n,o){var l=n.pendingProps,f=rt.current,p=!1,w=(n.flags&128)!==0,T;if((T=w)||(T=e!==null&&e.memoizedState===null?!1:(f&2)!==0),T?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),Xe(rt,f&1),e===null)return Ha(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=l.children,e=l.fallback,p?(l=n.mode,p=n.child,w={mode:"hidden",children:w},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=w):p=xl(w,l,0,null),e=mi(e,l,o,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=pc(o),n.memoizedState=hc,e):mc(n,w));if(f=e.memoizedState,f!==null&&(T=f.dehydrated,T!==null))return Ly(e,n,w,l,T,f,o);if(p){p=l.fallback,w=n.mode,f=e.child,T=f.sibling;var D={mode:"hidden",children:l.children};return(w&1)===0&&n.child!==f?(l=n.child,l.childLanes=0,l.pendingProps=D,n.deletions=null):(l=Fr(f,D),l.subtreeFlags=f.subtreeFlags&14680064),T!==null?p=Fr(T,p):(p=mi(p,w,o,null),p.flags|=2),p.return=n,l.return=n,l.sibling=p,n.child=l,l=p,p=n.child,w=e.child.memoizedState,w=w===null?pc(o):{baseLanes:w.baseLanes|o,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~o,n.memoizedState=hc,l}return p=e.child,e=p.sibling,l=Fr(p,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function mc(e,n){return n=xl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function sl(e,n,o,l){return l!==null&&Ba(l),Xi(n,e.child,null,o),e=mc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ly(e,n,o,l,f,p,w){if(o)return n.flags&256?(n.flags&=-257,l=cc(Error(i(422))),sl(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,f=n.mode,l=xl({mode:"visible",children:l.children},f,0,null),p=mi(p,f,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Xi(n,e.child,null,w),n.child.memoizedState=pc(w),n.memoizedState=hc,p);if((n.mode&1)===0)return sl(e,n,w,null);if(f.data==="$!"){if(l=f.nextSibling&&f.nextSibling.dataset,l)var T=l.dgst;return l=T,p=Error(i(419)),l=cc(p,l,void 0),sl(e,n,w,l)}if(T=(w&e.childLanes)!==0,Ht||T){if(l=mt,l!==null){switch(w&-w){case 4:f=2;break;case 16:f=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:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(l.suspendedLanes|w))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,rr(e,f),En(l,e,f,-1))}return Ic(),l=cc(Error(i(421))),sl(e,n,w,l)}return f.data==="$?"?(n.flags|=128,n.child=e.child,n=Ky.bind(null,e),f._reactRetry=n,null):(e=p.treeContext,Zt=br(f.nextSibling),qt=n,qe=!0,wn=null,e!==null&&(ln[an++]=tr,ln[an++]=nr,ln[an++]=si,tr=e.id,nr=e.overflow,si=n),n=mc(n,l.children),n.flags|=4096,n)}function Ef(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Ya(e.return,n,o)}function gc(e,n,o,l,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=o,p.tailMode=f)}function Cf(e,n,o){var l=n.pendingProps,f=l.revealOrder,p=l.tail;if(Rt(e,n,l.children,o),l=rt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ef(e,o,n);else if(e.tag===19)Ef(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Xe(rt,l),(n.mode&1)===0)n.memoizedState=null;else switch(f){case"forwards":for(o=n.child,f=null;o!==null;)e=o.alternate,e!==null&&Js(e)===null&&(f=o),o=o.sibling;o=f,o===null?(f=n.child,n.child=null):(f=o.sibling,o.sibling=null),gc(n,!1,f,o,p);break;case"backwards":for(o=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Js(e)===null){n.child=f;break}e=f.sibling,f.sibling=o,o=f,f=e}gc(n,!0,o,null,p);break;case"together":gc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function ll(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function or(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),di|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=Fr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Fr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Dy(e,n,o){switch(n.tag){case 3:Sf(n),Yi();break;case 5:$d(n);break;case 1:Ot(n.type)&&Vs(n);break;case 4:Ka(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,f=n.memoizedProps.value;Xe(Ks,l._currentValue),l._currentValue=f;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Xe(rt,rt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?Nf(e,n,o):(Xe(rt,rt.current&1),e=or(e,n,o),e!==null?e.sibling:null);Xe(rt,rt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return Cf(e,n,o);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Xe(rt,rt.current),l)break;return null;case 22:case 23:return n.lanes=0,vf(e,n,o)}return or(e,n,o)}var _f,yc,jf,bf;_f=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},yc=function(){},jf=function(e,n,o,l){var f=e.memoizedProps;if(f!==l){e=n.stateNode,ci(Bn.current);var p=null;switch(o){case"input":f=$e(e,f),l=$e(e,l),p=[];break;case"select":f=Y({},f,{value:void 0}),l=Y({},l,{value:void 0}),p=[];break;case"textarea":f=At(e,f),l=At(e,l),p=[];break;default:typeof f.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Os)}fr(o,l);var w;o=null;for(ee in f)if(!l.hasOwnProperty(ee)&&f.hasOwnProperty(ee)&&f[ee]!=null)if(ee==="style"){var T=f[ee];for(w in T)T.hasOwnProperty(w)&&(o||(o={}),o[w]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(a.hasOwnProperty(ee)?p||(p=[]):(p=p||[]).push(ee,null));for(ee in l){var D=l[ee];if(T=f!=null?f[ee]:void 0,l.hasOwnProperty(ee)&&D!==T&&(D!=null||T!=null))if(ee==="style")if(T){for(w in T)!T.hasOwnProperty(w)||D&&D.hasOwnProperty(w)||(o||(o={}),o[w]="");for(w in D)D.hasOwnProperty(w)&&T[w]!==D[w]&&(o||(o={}),o[w]=D[w])}else o||(p||(p=[]),p.push(ee,o)),o=D;else ee==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,T=T?T.__html:void 0,D!=null&&T!==D&&(p=p||[]).push(ee,D)):ee==="children"?typeof D!="string"&&typeof D!="number"||(p=p||[]).push(ee,""+D):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(a.hasOwnProperty(ee)?(D!=null&&ee==="onScroll"&&Ke("scroll",e),p||T===D||(p=[])):(p=p||[]).push(ee,D))}o&&(p=p||[]).push("style",o);var ee=p;(n.updateQueue=ee)&&(n.flags|=4)}},bf=function(e,n,o,l){o!==l&&(n.flags|=4)};function Ko(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Pt(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var f=e.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&14680064,l|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function $y(e,n,o){var l=n.pendingProps;switch(Fa(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(n),null;case 1:return Ot(n.type)&&Bs(),Pt(n),null;case 3:return l=n.stateNode,Qi(),Qe(Ft),Qe(bt),Za(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Xs(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,wn!==null&&(bc(wn),wn=null))),yc(e,n),Pt(n),null;case 5:Qa(n);var f=ci(Wo.current);if(o=n.type,e!==null&&n.stateNode!=null)jf(e,n,o,l,f),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return Pt(n),null}if(e=ci(Bn.current),Xs(n)){l=n.stateNode,o=n.type;var p=n.memoizedProps;switch(l[Hn]=n,l[Fo]=p,e=(n.mode&1)!==0,o){case"dialog":Ke("cancel",l),Ke("close",l);break;case"iframe":case"object":case"embed":Ke("load",l);break;case"video":case"audio":for(f=0;f<Lo.length;f++)Ke(Lo[f],l);break;case"source":Ke("error",l);break;case"img":case"image":case"link":Ke("error",l),Ke("load",l);break;case"details":Ke("toggle",l);break;case"input":Fe(l,p),Ke("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Ke("invalid",l);break;case"textarea":Xt(l,p),Ke("invalid",l)}fr(o,p),f=null;for(var w in p)if(p.hasOwnProperty(w)){var T=p[w];w==="children"?typeof T=="string"?l.textContent!==T&&(p.suppressHydrationWarning!==!0&&Fs(l.textContent,T,e),f=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&Fs(l.textContent,T,e),f=["children",""+T]):a.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&Ke("scroll",l)}switch(o){case"input":Ie(l),St(l,p,!0);break;case"textarea":Ie(l),Qn(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Os)}l=f,n.updateQueue=l,l!==null&&(n.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=be(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=w.createElement(o,{is:l.is}):(e=w.createElement(o),o==="select"&&(w=e,l.multiple?w.multiple=!0:l.size&&(w.size=l.size))):e=w.createElementNS(e,o),e[Hn]=n,e[Fo]=l,_f(e,n,!1,!1),n.stateNode=e;e:{switch(w=hr(o,l),o){case"dialog":Ke("cancel",e),Ke("close",e),f=l;break;case"iframe":case"object":case"embed":Ke("load",e),f=l;break;case"video":case"audio":for(f=0;f<Lo.length;f++)Ke(Lo[f],e);f=l;break;case"source":Ke("error",e),f=l;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),f=l;break;case"details":Ke("toggle",e),f=l;break;case"input":Fe(e,l),f=$e(e,l),Ke("invalid",e);break;case"option":f=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},f=Y({},l,{value:void 0}),Ke("invalid",e);break;case"textarea":Xt(e,l),f=At(e,l),Ke("invalid",e);break;default:f=l}fr(o,f),T=f;for(p in T)if(T.hasOwnProperty(p)){var D=T[p];p==="style"?Kr(e,D):p==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&Xr(e,D)):p==="children"?typeof D=="string"?(o!=="textarea"||D!=="")&&hn(e,D):typeof D=="number"&&hn(e,""+D):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?D!=null&&p==="onScroll"&&Ke("scroll",e):D!=null&&k(e,p,D,w))}switch(o){case"input":Ie(e),St(e,l,!1);break;case"textarea":Ie(e),Qn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+oe(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?Nt(e,!!l.multiple,p,!1):l.defaultValue!=null&&Nt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=Os)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Pt(n),null;case 6:if(e&&n.stateNode!=null)bf(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=ci(Wo.current),ci(Bn.current),Xs(n)){if(l=n.stateNode,o=n.memoizedProps,l[Hn]=n,(p=l.nodeValue!==o)&&(e=qt,e!==null))switch(e.tag){case 3:Fs(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fs(l.nodeValue,o,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Hn]=n,n.stateNode=l}return Pt(n),null;case 13:if(Qe(rt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&Zt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Pd(),Yi(),n.flags|=98560,p=!1;else if(p=Xs(n),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(i(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Hn]=n}else Yi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Pt(n),p=!1}else wn!==null&&(bc(wn),wn=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(rt.current&1)!==0?ft===0&&(ft=3):Ic())),n.updateQueue!==null&&(n.flags|=4),Pt(n),null);case 4:return Qi(),yc(e,n),e===null&&Do(n.stateNode.containerInfo),Pt(n),null;case 10:return Ua(n.type._context),Pt(n),null;case 17:return Ot(n.type)&&Bs(),Pt(n),null;case 19:if(Qe(rt),p=n.memoizedState,p===null)return Pt(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Ko(p,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=Js(e),w!==null){for(n.flags|=128,Ko(p,!1),l=w.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)p=o,e=l,p.flags&=14680066,w=p.alternate,w===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=w.childLanes,p.lanes=w.lanes,p.child=w.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=w.memoizedProps,p.memoizedState=w.memoizedState,p.updateQueue=w.updateQueue,p.type=w.type,e=w.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Xe(rt,rt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Ge()>eo&&(n.flags|=128,l=!0,Ko(p,!1),n.lanes=4194304)}else{if(!l)if(e=Js(w),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),Ko(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!qe)return Pt(n),null}else 2*Ge()-p.renderingStartTime>eo&&o!==1073741824&&(n.flags|=128,l=!0,Ko(p,!1),n.lanes=4194304);p.isBackwards?(w.sibling=n.child,n.child=w):(o=p.last,o!==null?o.sibling=w:n.child=w,p.last=w)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=Ge(),n.sibling=null,o=rt.current,Xe(rt,l?o&1|2:o&1),n):(Pt(n),null);case 22:case 23:return Pc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Jt&1073741824)!==0&&(Pt(n),n.subtreeFlags&6&&(n.flags|=8192)):Pt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Fy(e,n){switch(Fa(n),n.tag){case 1:return Ot(n.type)&&Bs(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Qi(),Qe(Ft),Qe(bt),Za(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Qa(n),null;case 13:if(Qe(rt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Yi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Qe(rt),null;case 4:return Qi(),null;case 10:return Ua(n.type._context),null;case 22:case 23:return Pc(),null;case 24:return null;default:return null}}var al=!1,It=!1,Oy=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Zi(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){st(e,n,l)}else o.current=null}function vc(e,n,o){try{o()}catch(l){st(e,n,l)}}var Mf=!1;function Hy(e,n){if(Pa=nt,e=sd(),ka(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var f=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,T=-1,D=-1,ee=0,ce=0,ue=e,ae=null;t:for(;;){for(var ge;ue!==o||f!==0&&ue.nodeType!==3||(T=w+f),ue!==p||l!==0&&ue.nodeType!==3||(D=w+l),ue.nodeType===3&&(w+=ue.nodeValue.length),(ge=ue.firstChild)!==null;)ae=ue,ue=ge;for(;;){if(ue===e)break t;if(ae===o&&++ee===f&&(T=w),ae===p&&++ce===l&&(D=w),(ge=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=ge}o=T===-1||D===-1?null:{start:T,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ia={focusedElem:e,selectionRange:o},nt=!1,ve=n;ve!==null;)if(n=ve,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ve=e;else for(;ve!==null;){n=ve;try{var xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var Se=xe.memoizedProps,at=xe.memoizedState,X=n.stateNode,O=X.getSnapshotBeforeUpdate(n.elementType===n.type?Se:Sn(n.type,Se),at);X.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var q=n.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(fe){st(n,n.return,fe)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return xe=Mf,Mf=!1,xe}function Qo(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&e)===e){var p=f.destroy;f.destroy=void 0,p!==void 0&&vc(n,o,p)}f=f.next}while(f!==l)}}function cl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function xc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function Pf(e){var n=e.alternate;n!==null&&(e.alternate=null,Pf(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Hn],delete n[Fo],delete n[Aa],delete n[Ny],delete n[Ey])),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 If(e){return e.tag===5||e.tag===3||e.tag===4}function Tf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||If(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 wc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Os));else if(l!==4&&(e=e.child,e!==null))for(wc(e,n,o),e=e.sibling;e!==null;)wc(e,n,o),e=e.sibling}function Sc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Sc(e,n,o),e=e.sibling;e!==null;)Sc(e,n,o),e=e.sibling}var xt=null,kn=!1;function zr(e,n,o){for(o=o.child;o!==null;)Rf(e,n,o),o=o.sibling}function Rf(e,n,o){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(zn,o)}catch{}switch(o.tag){case 5:It||Zi(o,n);case 6:var l=xt,f=kn;xt=null,zr(e,n,o),xt=l,kn=f,xt!==null&&(kn?(e=xt,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):xt.removeChild(o.stateNode));break;case 18:xt!==null&&(kn?(e=xt,o=o.stateNode,e.nodeType===8?za(e.parentNode,o):e.nodeType===1&&za(e,o),ot(e)):za(xt,o.stateNode));break;case 4:l=xt,f=kn,xt=o.stateNode.containerInfo,kn=!0,zr(e,n,o),xt=l,kn=f;break;case 0:case 11:case 14:case 15:if(!It&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){f=l=l.next;do{var p=f,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&vc(o,n,w),f=f.next}while(f!==l)}zr(e,n,o);break;case 1:if(!It&&(Zi(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(T){st(o,n,T)}zr(e,n,o);break;case 21:zr(e,n,o);break;case 22:o.mode&1?(It=(l=It)||o.memoizedState!==null,zr(e,n,o),It=l):zr(e,n,o);break;default:zr(e,n,o)}}function zf(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Oy),n.forEach(function(l){var f=Qy.bind(null,e,l);o.has(l)||(o.add(l),l.then(f,f))})}}function Nn(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l];try{var p=e,w=n,T=w;e:for(;T!==null;){switch(T.tag){case 5:xt=T.stateNode,kn=!1;break e;case 3:xt=T.stateNode.containerInfo,kn=!0;break e;case 4:xt=T.stateNode.containerInfo,kn=!0;break e}T=T.return}if(xt===null)throw Error(i(160));Rf(p,w,f),xt=null,kn=!1;var D=f.alternate;D!==null&&(D.return=null),f.return=null}catch(ee){st(f,n,ee)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Af(n,e),n=n.sibling}function Af(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nn(n,e),Wn(e),l&4){try{Qo(3,e,e.return),cl(3,e)}catch(Se){st(e,e.return,Se)}try{Qo(5,e,e.return)}catch(Se){st(e,e.return,Se)}}break;case 1:Nn(n,e),Wn(e),l&512&&o!==null&&Zi(o,o.return);break;case 5:if(Nn(n,e),Wn(e),l&512&&o!==null&&Zi(o,o.return),e.flags&32){var f=e.stateNode;try{hn(f,"")}catch(Se){st(e,e.return,Se)}}if(l&4&&(f=e.stateNode,f!=null)){var p=e.memoizedProps,w=o!==null?o.memoizedProps:p,T=e.type,D=e.updateQueue;if(e.updateQueue=null,D!==null)try{T==="input"&&p.type==="radio"&&p.name!=null&&Ae(f,p),hr(T,w);var ee=hr(T,p);for(w=0;w<D.length;w+=2){var ce=D[w],ue=D[w+1];ce==="style"?Kr(f,ue):ce==="dangerouslySetInnerHTML"?Xr(f,ue):ce==="children"?hn(f,ue):k(f,ce,ue,ee)}switch(T){case"input":et(f,p);break;case"textarea":dr(f,p);break;case"select":var ae=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var ge=p.value;ge!=null?Nt(f,!!p.multiple,ge,!1):ae!==!!p.multiple&&(p.defaultValue!=null?Nt(f,!!p.multiple,p.defaultValue,!0):Nt(f,!!p.multiple,p.multiple?[]:"",!1))}f[Fo]=p}catch(Se){st(e,e.return,Se)}}break;case 6:if(Nn(n,e),Wn(e),l&4){if(e.stateNode===null)throw Error(i(162));f=e.stateNode,p=e.memoizedProps;try{f.nodeValue=p}catch(Se){st(e,e.return,Se)}}break;case 3:if(Nn(n,e),Wn(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ot(n.containerInfo)}catch(Se){st(e,e.return,Se)}break;case 4:Nn(n,e),Wn(e);break;case 13:Nn(n,e),Wn(e),f=e.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(Ec=Ge())),l&4&&zf(e);break;case 22:if(ce=o!==null&&o.memoizedState!==null,e.mode&1?(It=(ee=It)||ce,Nn(n,e),It=ee):Nn(n,e),Wn(e),l&8192){if(ee=e.memoizedState!==null,(e.stateNode.isHidden=ee)&&!ce&&(e.mode&1)!==0)for(ve=e,ce=e.child;ce!==null;){for(ue=ve=ce;ve!==null;){switch(ae=ve,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:Qo(4,ae,ae.return);break;case 1:Zi(ae,ae.return);var xe=ae.stateNode;if(typeof xe.componentWillUnmount=="function"){l=ae,o=ae.return;try{n=l,xe.props=n.memoizedProps,xe.state=n.memoizedState,xe.componentWillUnmount()}catch(Se){st(l,o,Se)}}break;case 5:Zi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){$f(ue);continue}}ge!==null?(ge.return=ae,ve=ge):$f(ue)}ce=ce.sibling}e:for(ce=null,ue=e;;){if(ue.tag===5){if(ce===null){ce=ue;try{f=ue.stateNode,ee?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(T=ue.stateNode,D=ue.memoizedProps.style,w=D!=null&&D.hasOwnProperty("display")?D.display:null,T.style.display=Gr("display",w))}catch(Se){st(e,e.return,Se)}}}else if(ue.tag===6){if(ce===null)try{ue.stateNode.nodeValue=ee?"":ue.memoizedProps}catch(Se){st(e,e.return,Se)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===e)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===e)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===e)break e;ce===ue&&(ce=null),ue=ue.return}ce===ue&&(ce=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:Nn(n,e),Wn(e),l&4&&zf(e);break;case 21:break;default:Nn(n,e),Wn(e)}}function Wn(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(If(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var f=l.stateNode;l.flags&32&&(hn(f,""),l.flags&=-33);var p=Tf(e);Sc(e,p,f);break;case 3:case 4:var w=l.stateNode.containerInfo,T=Tf(e);wc(e,T,w);break;default:throw Error(i(161))}}catch(D){st(e,e.return,D)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function By(e,n,o){ve=e,Lf(e)}function Lf(e,n,o){for(var l=(e.mode&1)!==0;ve!==null;){var f=ve,p=f.child;if(f.tag===22&&l){var w=f.memoizedState!==null||al;if(!w){var T=f.alternate,D=T!==null&&T.memoizedState!==null||It;T=al;var ee=It;if(al=w,(It=D)&&!ee)for(ve=f;ve!==null;)w=ve,D=w.child,w.tag===22&&w.memoizedState!==null?Ff(f):D!==null?(D.return=w,ve=D):Ff(f);for(;p!==null;)ve=p,Lf(p),p=p.sibling;ve=f,al=T,It=ee}Df(e)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,ve=p):Df(e)}}function Df(e){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:It||cl(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!It)if(o===null)l.componentDidMount();else{var f=n.elementType===n.type?o.memoizedProps:Sn(n.type,o.memoizedProps);l.componentDidUpdate(f,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Dd(n,p,l);break;case 3:var w=n.updateQueue;if(w!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}Dd(n,w,o)}break;case 5:var T=n.stateNode;if(o===null&&n.flags&4){o=T;var D=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":D.autoFocus&&o.focus();break;case"img":D.src&&(o.src=D.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ee=n.alternate;if(ee!==null){var ce=ee.memoizedState;if(ce!==null){var ue=ce.dehydrated;ue!==null&&ot(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}It||n.flags&512&&xc(n)}catch(ae){st(n,n.return,ae)}}if(n===e){ve=null;break}if(o=n.sibling,o!==null){o.return=n.return,ve=o;break}ve=n.return}}function $f(e){for(;ve!==null;){var n=ve;if(n===e){ve=null;break}var o=n.sibling;if(o!==null){o.return=n.return,ve=o;break}ve=n.return}}function Ff(e){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{cl(4,n)}catch(D){st(n,o,D)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var f=n.return;try{l.componentDidMount()}catch(D){st(n,f,D)}}var p=n.return;try{xc(n)}catch(D){st(n,p,D)}break;case 5:var w=n.return;try{xc(n)}catch(D){st(n,w,D)}}}catch(D){st(n,n.return,D)}if(n===e){ve=null;break}var T=n.sibling;if(T!==null){T.return=n.return,ve=T;break}ve=n.return}}var Vy=Math.ceil,ul=j.ReactCurrentDispatcher,kc=j.ReactCurrentOwner,dn=j.ReactCurrentBatchConfig,He=0,mt=null,ct=null,wt=0,Jt=0,Ji=Mr(0),ft=0,qo=null,di=0,dl=0,Nc=0,Zo=null,Bt=null,Ec=0,eo=1/0,sr=null,fl=!1,Cc=null,Ar=null,hl=!1,Lr=null,pl=0,Jo=0,_c=null,ml=-1,gl=0;function zt(){return(He&6)!==0?Ge():ml!==-1?ml:ml=Ge()}function Dr(e){return(e.mode&1)===0?1:(He&2)!==0&&wt!==0?wt&-wt:_y.transition!==null?(gl===0&&(gl=Ln()),gl):(e=Be,e!==0||(e=window.event,e=e===void 0?16:Ou(e.type)),e)}function En(e,n,o,l){if(50<Jo)throw Jo=0,_c=null,Error(i(185));Dn(e,o,l),((He&2)===0||e!==mt)&&(e===mt&&((He&2)===0&&(dl|=o),ft===4&&$r(e,wt)),Vt(e,l),o===1&&He===0&&(n.mode&1)===0&&(eo=Ge()+500,Ws&&Ir()))}function Vt(e,n){var o=e.callbackNode;No(e,n);var l=Er(e,e===mt?wt:0);if(l===0)o!==null&&Rn(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&Rn(o),n===1)e.tag===0?Cy(Hf.bind(null,e)):Cd(Hf.bind(null,e)),Sy(function(){(He&6)===0&&Ir()}),o=null;else{switch(Co(l)){case 1:o=Sr;break;case 4:o=Ii;break;case 16:o=kr;break;case 536870912:o=Ti;break;default:o=kr}o=Kf(o,Of.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Of(e,n){if(ml=-1,gl=0,(He&6)!==0)throw Error(i(327));var o=e.callbackNode;if(to()&&e.callbackNode!==o)return null;var l=Er(e,e===mt?wt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=yl(e,l);else{n=l;var f=He;He|=2;var p=Vf();(mt!==e||wt!==n)&&(sr=null,eo=Ge()+500,hi(e,n));do try{Yy();break}catch(T){Bf(e,T)}while(!0);Wa(),ul.current=p,He=f,ct!==null?n=0:(mt=null,wt=0,n=ft)}if(n!==0){if(n===2&&(f=ti(e),f!==0&&(l=f,n=jc(e,f))),n===1)throw o=qo,hi(e,0),$r(e,l),Vt(e,Ge()),o;if(n===6)$r(e,l);else{if(f=e.current.alternate,(l&30)===0&&!Wy(f)&&(n=yl(e,l),n===2&&(p=ti(e),p!==0&&(l=p,n=jc(e,p))),n===1))throw o=qo,hi(e,0),$r(e,l),Vt(e,Ge()),o;switch(e.finishedWork=f,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:pi(e,Bt,sr);break;case 3:if($r(e,l),(l&130023424)===l&&(n=Ec+500-Ge(),10<n)){if(Er(e,0)!==0)break;if(f=e.suspendedLanes,(f&l)!==l){zt(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=Ra(pi.bind(null,e,Bt,sr),n);break}pi(e,Bt,sr);break;case 4:if($r(e,l),(l&4194240)===l)break;for(n=e.eventTimes,f=-1;0<l;){var w=31-jt(l);p=1<<w,w=n[w],w>f&&(f=w),l&=~p}if(l=f,l=Ge()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Vy(l/1960))-l,10<l){e.timeoutHandle=Ra(pi.bind(null,e,Bt,sr),l);break}pi(e,Bt,sr);break;case 5:pi(e,Bt,sr);break;default:throw Error(i(329))}}}return Vt(e,Ge()),e.callbackNode===o?Of.bind(null,e):null}function jc(e,n){var o=Zo;return e.current.memoizedState.isDehydrated&&(hi(e,n).flags|=256),e=yl(e,n),e!==2&&(n=Bt,Bt=o,n!==null&&bc(n)),e}function bc(e){Bt===null?Bt=e:Bt.push.apply(Bt,e)}function Wy(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var f=o[l],p=f.getSnapshot;f=f.value;try{if(!xn(p(),f))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function $r(e,n){for(n&=~Nc,n&=~dl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-jt(n),l=1<<o;e[o]=-1,n&=~l}}function Hf(e){if((He&6)!==0)throw Error(i(327));to();var n=Er(e,0);if((n&1)===0)return Vt(e,Ge()),null;var o=yl(e,n);if(e.tag!==0&&o===2){var l=ti(e);l!==0&&(n=l,o=jc(e,l))}if(o===1)throw o=qo,hi(e,0),$r(e,n),Vt(e,Ge()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,pi(e,Bt,sr),Vt(e,Ge()),null}function Mc(e,n){var o=He;He|=1;try{return e(n)}finally{He=o,He===0&&(eo=Ge()+500,Ws&&Ir())}}function fi(e){Lr!==null&&Lr.tag===0&&(He&6)===0&&to();var n=He;He|=1;var o=dn.transition,l=Be;try{if(dn.transition=null,Be=1,e)return e()}finally{Be=l,dn.transition=o,He=n,(He&6)===0&&Ir()}}function Pc(){Jt=Ji.current,Qe(Ji)}function hi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,wy(o)),ct!==null)for(o=ct.return;o!==null;){var l=o;switch(Fa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Bs();break;case 3:Qi(),Qe(Ft),Qe(bt),Za();break;case 5:Qa(l);break;case 4:Qi();break;case 13:Qe(rt);break;case 19:Qe(rt);break;case 10:Ua(l.type._context);break;case 22:case 23:Pc()}o=o.return}if(mt=e,ct=e=Fr(e.current,null),wt=Jt=n,ft=0,qo=null,Nc=dl=di=0,Bt=Zo=null,ai!==null){for(n=0;n<ai.length;n++)if(o=ai[n],l=o.interleaved,l!==null){o.interleaved=null;var f=l.next,p=o.pending;if(p!==null){var w=p.next;p.next=f,l.next=w}o.pending=l}ai=null}return e}function Bf(e,n){do{var o=ct;try{if(Wa(),el.current=il,tl){for(var l=it.memoizedState;l!==null;){var f=l.queue;f!==null&&(f.pending=null),l=l.next}tl=!1}if(ui=0,pt=dt=it=null,Uo=!1,Yo=0,kc.current=null,o===null||o.return===null){ft=1,qo=n,ct=null;break}e:{var p=e,w=o.return,T=o,D=n;if(n=wt,T.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=D,ce=T,ue=ce.tag;if((ce.mode&1)===0&&(ue===0||ue===11||ue===15)){var ae=ce.alternate;ae?(ce.updateQueue=ae.updateQueue,ce.memoizedState=ae.memoizedState,ce.lanes=ae.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ge=hf(w);if(ge!==null){ge.flags&=-257,pf(ge,w,T,p,n),ge.mode&1&&ff(p,ee,n),n=ge,D=ee;var xe=n.updateQueue;if(xe===null){var Se=new Set;Se.add(D),n.updateQueue=Se}else xe.add(D);break e}else{if((n&1)===0){ff(p,ee,n),Ic();break e}D=Error(i(426))}}else if(qe&&T.mode&1){var at=hf(w);if(at!==null){(at.flags&65536)===0&&(at.flags|=256),pf(at,w,T,p,n),Ba(qi(D,T));break e}}p=D=qi(D,T),ft!==4&&(ft=2),Zo===null?Zo=[p]:Zo.push(p),p=w;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var X=uf(p,D,n);Ld(p,X);break e;case 1:T=D;var O=p.type,q=p.stateNode;if((p.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Ar===null||!Ar.has(q)))){p.flags|=65536,n&=-n,p.lanes|=n;var fe=df(p,T,n);Ld(p,fe);break e}}p=p.return}while(p!==null)}Uf(o)}catch(Ee){n=Ee,ct===o&&o!==null&&(ct=o=o.return);continue}break}while(!0)}function Vf(){var e=ul.current;return ul.current=il,e===null?il:e}function Ic(){(ft===0||ft===3||ft===2)&&(ft=4),mt===null||(di&268435455)===0&&(dl&268435455)===0||$r(mt,wt)}function yl(e,n){var o=He;He|=2;var l=Vf();(mt!==e||wt!==n)&&(sr=null,hi(e,n));do try{Uy();break}catch(f){Bf(e,f)}while(!0);if(Wa(),He=o,ul.current=l,ct!==null)throw Error(i(261));return mt=null,wt=0,ft}function Uy(){for(;ct!==null;)Wf(ct)}function Yy(){for(;ct!==null&&!xo();)Wf(ct)}function Wf(e){var n=Gf(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,n===null?Uf(e):ct=n,kc.current=null}function Uf(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=$y(o,n,Jt),o!==null){ct=o;return}}else{if(o=Fy(o,n),o!==null){o.flags&=32767,ct=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,ct=null;return}}if(n=n.sibling,n!==null){ct=n;return}ct=n=e}while(n!==null);ft===0&&(ft=5)}function pi(e,n,o){var l=Be,f=dn.transition;try{dn.transition=null,Be=1,Xy(e,n,o,l)}finally{dn.transition=f,Be=l}return null}function Xy(e,n,o,l){do to();while(Lr!==null);if((He&6)!==0)throw Error(i(327));o=e.finishedWork;var f=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var p=o.lanes|o.childLanes;if(ri(e,p),e===mt&&(ct=mt=null,wt=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||hl||(hl=!0,Kf(kr,function(){return to(),null})),p=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||p){p=dn.transition,dn.transition=null;var w=Be;Be=1;var T=He;He|=4,kc.current=null,Hy(e,o),Af(o,e),hy(Ia),nt=!!Pa,Ia=Pa=null,e.current=o,By(o),Mi(),He=T,Be=w,dn.transition=p}else e.current=o;if(hl&&(hl=!1,Lr=e,pl=f),p=e.pendingLanes,p===0&&(Ar=null),Nr(o.stateNode),Vt(e,Ge()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)f=n[o],l(f.value,{componentStack:f.stack,digest:f.digest});if(fl)throw fl=!1,e=Cc,Cc=null,e;return(pl&1)!==0&&e.tag!==0&&to(),p=e.pendingLanes,(p&1)!==0?e===_c?Jo++:(Jo=0,_c=e):Jo=0,Ir(),null}function to(){if(Lr!==null){var e=Co(pl),n=dn.transition,o=Be;try{if(dn.transition=null,Be=16>e?16:e,Lr===null)var l=!1;else{if(e=Lr,Lr=null,pl=0,(He&6)!==0)throw Error(i(331));var f=He;for(He|=4,ve=e.current;ve!==null;){var p=ve,w=p.child;if((ve.flags&16)!==0){var T=p.deletions;if(T!==null){for(var D=0;D<T.length;D++){var ee=T[D];for(ve=ee;ve!==null;){var ce=ve;switch(ce.tag){case 0:case 11:case 15:Qo(8,ce,p)}var ue=ce.child;if(ue!==null)ue.return=ce,ve=ue;else for(;ve!==null;){ce=ve;var ae=ce.sibling,ge=ce.return;if(Pf(ce),ce===ee){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var xe=p.alternate;if(xe!==null){var Se=xe.child;if(Se!==null){xe.child=null;do{var at=Se.sibling;Se.sibling=null,Se=at}while(Se!==null)}}ve=p}}if((p.subtreeFlags&2064)!==0&&w!==null)w.return=p,ve=w;else e:for(;ve!==null;){if(p=ve,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Qo(9,p,p.return)}var X=p.sibling;if(X!==null){X.return=p.return,ve=X;break e}ve=p.return}}var O=e.current;for(ve=O;ve!==null;){w=ve;var q=w.child;if((w.subtreeFlags&2064)!==0&&q!==null)q.return=w,ve=q;else e:for(w=O;ve!==null;){if(T=ve,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:cl(9,T)}}catch(Ee){st(T,T.return,Ee)}if(T===w){ve=null;break e}var fe=T.sibling;if(fe!==null){fe.return=T.return,ve=fe;break e}ve=T.return}}if(He=f,Ir(),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(zn,e)}catch{}l=!0}return l}finally{Be=o,dn.transition=n}}return!1}function Yf(e,n,o){n=qi(o,n),n=uf(e,n,1),e=Rr(e,n,1),n=zt(),e!==null&&(Dn(e,1,n),Vt(e,n))}function st(e,n,o){if(e.tag===3)Yf(e,e,o);else for(;n!==null;){if(n.tag===3){Yf(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ar===null||!Ar.has(l))){e=qi(o,e),e=df(n,e,1),n=Rr(n,e,1),e=zt(),n!==null&&(Dn(n,1,e),Vt(n,e));break}}n=n.return}}function Gy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=zt(),e.pingedLanes|=e.suspendedLanes&o,mt===e&&(wt&o)===o&&(ft===4||ft===3&&(wt&130023424)===wt&&500>Ge()-Ec?hi(e,0):Nc|=o),Vt(e,n)}function Xf(e,n){n===0&&((e.mode&1)===0?n=1:(n=Ye,Ye<<=1,(Ye&130023424)===0&&(Ye=4194304)));var o=zt();e=rr(e,n),e!==null&&(Dn(e,n,o),Vt(e,o))}function Ky(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Xf(e,o)}function Qy(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Xf(e,o)}var Gf;Gf=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ft.current)Ht=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Ht=!1,Dy(e,n,o);Ht=(e.flags&131072)!==0}else Ht=!1,qe&&(n.flags&1048576)!==0&&_d(n,Ys,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;ll(e,n),e=n.pendingProps;var f=Vi(n,bt.current);Ki(n,o),f=tc(null,n,l,e,f,o);var p=nc();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ot(l)?(p=!0,Vs(n)):p=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ga(n),f.updater=ol,n.stateNode=f,f._reactInternals=n,ac(n,l,e,o),n=fc(null,n,l,!0,p,o)):(n.tag=0,qe&&p&&$a(n),Rt(null,n,f,o),n=n.child),n;case 16:l=n.elementType;e:{switch(ll(e,n),e=n.pendingProps,f=l._init,l=f(l._payload),n.type=l,f=n.tag=Zy(l),e=Sn(l,e),f){case 0:n=dc(null,n,l,e,o);break e;case 1:n=wf(null,n,l,e,o);break e;case 11:n=mf(null,n,l,e,o);break e;case 14:n=gf(null,n,l,Sn(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:Sn(l,f),dc(e,n,l,f,o);case 1:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:Sn(l,f),wf(e,n,l,f,o);case 3:e:{if(Sf(n),e===null)throw Error(i(387));l=n.pendingProps,p=n.memoizedState,f=p.element,Ad(e,n),Zs(n,l,null,o);var w=n.memoizedState;if(l=w.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){f=qi(Error(i(423)),n),n=kf(e,n,l,o,f);break e}else if(l!==f){f=qi(Error(i(424)),n),n=kf(e,n,l,o,f);break e}else for(Zt=br(n.stateNode.containerInfo.firstChild),qt=n,qe=!0,wn=null,o=Rd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Yi(),l===f){n=or(e,n,o);break e}Rt(e,n,l,o)}n=n.child}return n;case 5:return $d(n),e===null&&Ha(n),l=n.type,f=n.pendingProps,p=e!==null?e.memoizedProps:null,w=f.children,Ta(l,f)?w=null:p!==null&&Ta(l,p)&&(n.flags|=32),xf(e,n),Rt(e,n,w,o),n.child;case 6:return e===null&&Ha(n),null;case 13:return Nf(e,n,o);case 4:return Ka(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Xi(n,null,l,o):Rt(e,n,l,o),n.child;case 11:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:Sn(l,f),mf(e,n,l,f,o);case 7:return Rt(e,n,n.pendingProps,o),n.child;case 8:return Rt(e,n,n.pendingProps.children,o),n.child;case 12:return Rt(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,f=n.pendingProps,p=n.memoizedProps,w=f.value,Xe(Ks,l._currentValue),l._currentValue=w,p!==null)if(xn(p.value,w)){if(p.children===f.children&&!Ft.current){n=or(e,n,o);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var T=p.dependencies;if(T!==null){w=p.child;for(var D=T.firstContext;D!==null;){if(D.context===l){if(p.tag===1){D=ir(-1,o&-o),D.tag=2;var ee=p.updateQueue;if(ee!==null){ee=ee.shared;var ce=ee.pending;ce===null?D.next=D:(D.next=ce.next,ce.next=D),ee.pending=D}}p.lanes|=o,D=p.alternate,D!==null&&(D.lanes|=o),Ya(p.return,o,n),T.lanes|=o;break}D=D.next}}else if(p.tag===10)w=p.type===n.type?null:p.child;else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=o,T=w.alternate,T!==null&&(T.lanes|=o),Ya(w,o,n),w=p.sibling}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===n){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}Rt(e,n,f.children,o),n=n.child}return n;case 9:return f=n.type,l=n.pendingProps.children,Ki(n,o),f=cn(f),l=l(f),n.flags|=1,Rt(e,n,l,o),n.child;case 14:return l=n.type,f=Sn(l,n.pendingProps),f=Sn(l.type,f),gf(e,n,l,f,o);case 15:return yf(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:Sn(l,f),ll(e,n),n.tag=1,Ot(l)?(e=!0,Vs(n)):e=!1,Ki(n,o),af(n,l,f),ac(n,l,f,o),fc(null,n,l,!0,e,o);case 19:return Cf(e,n,o);case 22:return vf(e,n,o)}throw Error(i(156,n.tag))};function Kf(e,n){return Kt(e,n)}function qy(e,n,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,n,o,l){return new qy(e,n,o,l)}function Tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zy(e){if(typeof e=="function")return Tc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===G)return 11;if(e===Q)return 14}return 2}function Fr(e,n){var o=e.alternate;return o===null?(o=fn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function vl(e,n,o,l,f,p){var w=2;if(l=e,typeof e=="function")Tc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case B:return mi(o.children,f,p,n);case Z:w=8,f|=8;break;case V:return e=fn(12,o,n,f|2),e.elementType=V,e.lanes=p,e;case te:return e=fn(13,o,n,f),e.elementType=te,e.lanes=p,e;case z:return e=fn(19,o,n,f),e.elementType=z,e.lanes=p,e;case K:return xl(o,f,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:w=10;break e;case U:w=9;break e;case G:w=11;break e;case Q:w=14;break e;case W:w=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=fn(w,o,n,f),n.elementType=e,n.type=l,n.lanes=p,n}function mi(e,n,o,l){return e=fn(7,e,l,n),e.lanes=o,e}function xl(e,n,o,l){return e=fn(22,e,l,n),e.elementType=K,e.lanes=o,e.stateNode={isHidden:!1},e}function Rc(e,n,o){return e=fn(6,e,null,n),e.lanes=o,e}function zc(e,n,o){return n=fn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Jy(e,n,o,l,f){this.tag=n,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=ni(0),this.expirationTimes=ni(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ni(0),this.identifierPrefix=l,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Ac(e,n,o,l,f,p,w,T,D){return e=new Jy(e,n,o,T,D),n===1?(n=1,p===!0&&(n|=8)):n=0,p=fn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ga(p),e}function e0(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function Qf(e){if(!e)return Pr;e=e._reactInternals;e:{if(Ct(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Ot(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Ot(o))return Nd(e,o,n)}return n}function qf(e,n,o,l,f,p,w,T,D){return e=Ac(o,l,!0,e,f,p,w,T,D),e.context=Qf(null),o=e.current,l=zt(),f=Dr(o),p=ir(l,f),p.callback=n??null,Rr(o,p,f),e.current.lanes=f,Dn(e,f,l),Vt(e,l),e}function wl(e,n,o,l){var f=n.current,p=zt(),w=Dr(f);return o=Qf(o),n.context===null?n.context=o:n.pendingContext=o,n=ir(p,w),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Rr(f,n,w),e!==null&&(En(e,f,w,p),qs(e,f,w)),w}function Sl(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 Zf(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function Lc(e,n){Zf(e,n),(e=e.alternate)&&Zf(e,n)}function t0(){return null}var Jf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Dc(e){this._internalRoot=e}kl.prototype.render=Dc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));wl(e,n,null,null)},kl.prototype.unmount=Dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;fi(function(){wl(null,e,null,null)}),n[Jn]=null}};function kl(e){this._internalRoot=e}kl.prototype.unstable_scheduleHydration=function(e){if(e){var n=js();e={blockedOn:null,target:e,priority:n};for(var o=0;o<H.length&&n!==0&&n<H[o].priority;o++);H.splice(o,0,e),o===0&&_e(e)}};function $c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function eh(){}function n0(e,n,o,l,f){if(f){if(typeof l=="function"){var p=l;l=function(){var ee=Sl(w);p.call(ee)}}var w=qf(n,l,e,0,null,!1,!1,"",eh);return e._reactRootContainer=w,e[Jn]=w.current,Do(e.nodeType===8?e.parentNode:e),fi(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof l=="function"){var T=l;l=function(){var ee=Sl(D);T.call(ee)}}var D=Ac(e,0,!1,null,null,!1,!1,"",eh);return e._reactRootContainer=D,e[Jn]=D.current,Do(e.nodeType===8?e.parentNode:e),fi(function(){wl(n,D,o,l)}),D}function El(e,n,o,l,f){var p=o._reactRootContainer;if(p){var w=p;if(typeof f=="function"){var T=f;f=function(){var D=Sl(w);T.call(D)}}wl(n,w,e,f)}else w=n0(o,n,e,f,l);return Sl(w)}_o=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=$t(n.pendingLanes);o!==0&&(Eo(n,o|1),Vt(n,Ge()),(He&6)===0&&(eo=Ge()+500,Ir()))}break;case 13:fi(function(){var l=rr(e,1);if(l!==null){var f=zt();En(l,e,1,f)}}),Lc(e,1)}},Zn=function(e){if(e.tag===13){var n=rr(e,134217728);if(n!==null){var o=zt();En(n,e,134217728,o)}Lc(e,134217728)}},_s=function(e){if(e.tag===13){var n=Dr(e),o=rr(e,n);if(o!==null){var l=zt();En(o,e,n,l)}Lc(e,n)}},js=function(){return Be},bs=function(e,n){var o=Be;try{return Be=e,n()}finally{Be=o}},Qr=function(e,n,o){switch(n){case"input":if(et(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var f=Hs(l);if(!f)throw Error(i(90));ke(l),et(l,f)}}}break;case"textarea":dr(e,o);break;case"select":n=o.value,n!=null&&Nt(e,!!o.multiple,n,!1)}},gr=Mc,ji=fi;var r0={usingClientEntryPoint:!1,Events:[Oo,Hi,Hs,qr,mn,Mc]},es={findFiberByHostInstance:ii,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},i0={bundleType:es.bundleType,version:es.version,rendererPackageName:es.rendererPackageName,rendererConfig:es.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Jr(e),e===null?null:e.stateNode},findFiberByHostInstance:es.findFiberByHostInstance||t0,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 Cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cl.isDisabled&&Cl.supportsFiber)try{zn=Cl.inject(i0),_t=Cl}catch{}}return Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r0,Wt.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$c(n))throw Error(i(200));return e0(e,n,null,o)},Wt.createRoot=function(e,n){if(!$c(e))throw Error(i(299));var o=!1,l="",f=Jf;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),n=Ac(e,1,!1,null,null,o,!1,l,f),e[Jn]=n.current,Do(e.nodeType===8?e.parentNode:e),new Dc(n)},Wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Jr(n),e=e===null?null:e.stateNode,e},Wt.flushSync=function(e){return fi(e)},Wt.hydrate=function(e,n,o){if(!Nl(n))throw Error(i(200));return El(null,e,n,!0,o)},Wt.hydrateRoot=function(e,n,o){if(!$c(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,f=!1,p="",w=Jf;if(o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onRecoverableError!==void 0&&(w=o.onRecoverableError)),n=qf(n,null,e,1,o??null,f,!1,p,w),e[Jn]=n.current,Do(e),l)for(e=0;e<l.length;e++)o=l[e],f=o._getVersion,f=f(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,f]:n.mutableSourceEagerHydrationData.push(o,f);return new kl(n)},Wt.render=function(e,n,o){if(!Nl(n))throw Error(i(200));return El(null,e,n,!1,o)},Wt.unmountComponentAtNode=function(e){if(!Nl(e))throw Error(i(40));return e._reactRootContainer?(fi(function(){El(null,null,e,!1,function(){e._reactRootContainer=null,e[Jn]=null})}),!0):!1},Wt.unstable_batchedUpdates=Mc,Wt.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Nl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return El(e,n,o,!1,l)},Wt.version="18.3.1-next-f1338f8080-20240426",Wt}var ah;function bp(){if(ah)return Hc.exports;ah=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Hc.exports=d0(),Hc.exports}var ch;function f0(){if(ch)return _l;ch=1;var t=bp();return _l.createRoot=t.createRoot,_l.hydrateRoot=t.hydrateRoot,_l}var h0=f0();const p0=xu(h0);function ut(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=ut(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var m0={value:()=>{}};function Jl(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new Ll(i)}function Ll(t){this._=t}function g0(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");if(a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}Ll.prototype=Jl.prototype={constructor:Ll,on:function(t,r){var i=this._,s=g0(t+"",i),a,c=-1,u=s.length;if(arguments.length<2){for(;++c<u;)if((a=(t=s[c]).type)&&(a=y0(i[a],t.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<u;)if(a=(t=s[c]).type)i[a]=uh(i[a],t.name,r);else if(r==null)for(a in i)i[a]=uh(i[a],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new Ll(t)},call:function(t,r){if((a=arguments.length-2)>0)for(var i=new Array(a),s=0,a,c;s<a;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,a=c.length;s<a;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],a=0,c=s.length;a<c;++a)s[a].value.apply(r,i)}};function y0(t,r){for(var i=0,s=t.length,a;i<s;++i)if((a=t[i]).name===r)return a.value}function uh(t,r,i){for(var s=0,a=t.length;s<a;++s)if(t[s].name===r){t[s]=m0,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var iu="http://www.w3.org/1999/xhtml";const dh={svg:"http://www.w3.org/2000/svg",xhtml:iu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ea(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),dh.hasOwnProperty(r)?{space:dh[r],local:t}:t}function v0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===iu&&r.documentElement.namespaceURI===iu?r.createElement(t):r.createElementNS(i,t)}}function x0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Mp(t){var r=ea(t);return(r.local?x0:v0)(r)}function w0(){}function wu(t){return t==null?w0:function(){return this.querySelector(t)}}function S0(t){typeof t!="function"&&(t=wu(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=new Array(u),m,g,v=0;v<u;++v)(m=c[v])&&(g=t.call(m,m.__data__,v,c))&&("__data__"in m&&(g.__data__=m.__data__),h[v]=g);return new nn(s,this._parents)}function k0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function N0(){return[]}function Pp(t){return t==null?N0:function(){return this.querySelectorAll(t)}}function E0(t){return function(){return k0(t.apply(this,arguments))}}function C0(t){typeof t=="function"?t=E0(t):t=Pp(t);for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var u=r[c],h=u.length,m,g=0;g<h;++g)(m=u[g])&&(s.push(t.call(m,m.__data__,g,u)),a.push(m));return new nn(s,a)}function Ip(t){return function(){return this.matches(t)}}function Tp(t){return function(r){return r.matches(t)}}var _0=Array.prototype.find;function j0(t){return function(){return _0.call(this.children,t)}}function b0(){return this.firstElementChild}function M0(t){return this.select(t==null?b0:j0(typeof t=="function"?t:Tp(t)))}var P0=Array.prototype.filter;function I0(){return Array.from(this.children)}function T0(t){return function(){return P0.call(this.children,t)}}function R0(t){return this.selectAll(t==null?I0:T0(typeof t=="function"?t:Tp(t)))}function z0(t){typeof t!="function"&&(t=Ip(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=[],m,g=0;g<u;++g)(m=c[g])&&t.call(m,m.__data__,g,c)&&h.push(m);return new nn(s,this._parents)}function Rp(t){return new Array(t.length)}function A0(){return new nn(this._enter||this._groups.map(Rp),this._parents)}function Hl(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Hl.prototype={constructor:Hl,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function L0(t){return function(){return t}}function D0(t,r,i,s,a,c){for(var u=0,h,m=r.length,g=c.length;u<g;++u)(h=r[u])?(h.__data__=c[u],s[u]=h):i[u]=new Hl(t,c[u]);for(;u<m;++u)(h=r[u])&&(a[u]=h)}function $0(t,r,i,s,a,c,u){var h,m,g=new Map,v=r.length,y=c.length,x=new Array(v),C;for(h=0;h<v;++h)(m=r[h])&&(x[h]=C=u.call(m,m.__data__,h,r)+"",g.has(C)?a[h]=m:g.set(C,m));for(h=0;h<y;++h)C=u.call(t,c[h],h,c)+"",(m=g.get(C))?(s[h]=m,m.__data__=c[h],g.delete(C)):i[h]=new Hl(t,c[h]);for(h=0;h<v;++h)(m=r[h])&&g.get(x[h])===m&&(a[h]=m)}function F0(t){return t.__data__}function O0(t,r){if(!arguments.length)return Array.from(this,F0);var i=r?$0:D0,s=this._parents,a=this._groups;typeof t!="function"&&(t=L0(t));for(var c=a.length,u=new Array(c),h=new Array(c),m=new Array(c),g=0;g<c;++g){var v=s[g],y=a[g],x=y.length,C=H0(t.call(v,v&&v.__data__,g,s)),N=C.length,S=h[g]=new Array(N),_=u[g]=new Array(N),E=m[g]=new Array(x);i(v,y,S,_,E,C,r);for(var P=0,k=0,j,F;P<N;++P)if(j=S[P]){for(P>=k&&(k=P+1);!(F=_[k])&&++k<N;);j._next=F||null}}return u=new nn(u,s),u._enter=h,u._exit=m,u}function H0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function B0(){return new nn(this._exit||this._groups.map(Rp),this._parents)}function V0(t,r,i){var s=this.enter(),a=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(a=r(a),a&&(a=a.selection())),i==null?c.remove():i(c),s&&a?s.merge(a).order():a}function W0(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,a=i.length,c=s.length,u=Math.min(a,c),h=new Array(a),m=0;m<u;++m)for(var g=i[m],v=s[m],y=g.length,x=h[m]=new Array(y),C,N=0;N<y;++N)(C=g[N]||v[N])&&(x[N]=C);for(;m<a;++m)h[m]=i[m];return new nn(h,this._parents)}function U0(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],a=s.length-1,c=s[a],u;--a>=0;)(u=s[a])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function Y0(t){t||(t=X0);function r(y,x){return y&&x?t(y.__data__,x.__data__):!y-!x}for(var i=this._groups,s=i.length,a=new Array(s),c=0;c<s;++c){for(var u=i[c],h=u.length,m=a[c]=new Array(h),g,v=0;v<h;++v)(g=u[v])&&(m[v]=g);m.sort(r)}return new nn(a,this._parents).order()}function X0(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function G0(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function K0(){return Array.from(this)}function Q0(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],a=0,c=s.length;a<c;++a){var u=s[a];if(u)return u}return null}function q0(){let t=0;for(const r of this)++t;return t}function Z0(){return!this.node()}function J0(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var a=r[i],c=0,u=a.length,h;c<u;++c)(h=a[c])&&t.call(h,h.__data__,c,a);return this}function ev(t){return function(){this.removeAttribute(t)}}function tv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function nv(t,r){return function(){this.setAttribute(t,r)}}function rv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function iv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function ov(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function sv(t,r){var i=ea(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?tv:ev:typeof r=="function"?i.local?ov:iv:i.local?rv:nv)(i,r))}function zp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lv(t){return function(){this.style.removeProperty(t)}}function av(t,r,i){return function(){this.style.setProperty(t,r,i)}}function cv(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function uv(t,r,i){return arguments.length>1?this.each((r==null?lv:typeof r=="function"?cv:av)(t,r,i??"")):fo(this.node(),t)}function fo(t,r){return t.style.getPropertyValue(r)||zp(t).getComputedStyle(t,null).getPropertyValue(r)}function dv(t){return function(){delete this[t]}}function fv(t,r){return function(){this[t]=r}}function hv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function pv(t,r){return arguments.length>1?this.each((r==null?dv:typeof r=="function"?hv:fv)(t,r)):this.node()[t]}function Ap(t){return t.trim().split(/^|\s+/)}function Su(t){return t.classList||new Lp(t)}function Lp(t){this._node=t,this._names=Ap(t.getAttribute("class")||"")}Lp.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Dp(t,r){for(var i=Su(t),s=-1,a=r.length;++s<a;)i.add(r[s])}function $p(t,r){for(var i=Su(t),s=-1,a=r.length;++s<a;)i.remove(r[s])}function mv(t){return function(){Dp(this,t)}}function gv(t){return function(){$p(this,t)}}function yv(t,r){return function(){(r.apply(this,arguments)?Dp:$p)(this,t)}}function vv(t,r){var i=Ap(t+"");if(arguments.length<2){for(var s=Su(this.node()),a=-1,c=i.length;++a<c;)if(!s.contains(i[a]))return!1;return!0}return this.each((typeof r=="function"?yv:r?mv:gv)(i,r))}function xv(){this.textContent=""}function wv(t){return function(){this.textContent=t}}function Sv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function kv(t){return arguments.length?this.each(t==null?xv:(typeof t=="function"?Sv:wv)(t)):this.node().textContent}function Nv(){this.innerHTML=""}function Ev(t){return function(){this.innerHTML=t}}function Cv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function _v(t){return arguments.length?this.each(t==null?Nv:(typeof t=="function"?Cv:Ev)(t)):this.node().innerHTML}function jv(){this.nextSibling&&this.parentNode.appendChild(this)}function bv(){return this.each(jv)}function Mv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Pv(){return this.each(Mv)}function Iv(t){var r=typeof t=="function"?t:Mp(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Tv(){return null}function Rv(t,r){var i=typeof t=="function"?t:Mp(t),s=r==null?Tv:typeof r=="function"?r:wu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function zv(){var t=this.parentNode;t&&t.removeChild(this)}function Av(){return this.each(zv)}function Lv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Dv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function $v(t){return this.select(t?Dv:Lv)}function Fv(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ov(t){return function(r){t.call(this,r,this.__data__)}}function Hv(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function Bv(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,a=r.length,c;i<a;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function Vv(t,r,i){return function(){var s=this.__on,a,c=Ov(r);if(s){for(var u=0,h=s.length;u<h;++u)if((a=s[u]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=c,a.options=i),a.value=r;return}}this.addEventListener(t.type,c,i),a={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(a):this.__on=[a]}}function Wv(t,r,i){var s=Hv(t+""),a,c=s.length,u;if(arguments.length<2){var h=this.node().__on;if(h){for(var m=0,g=h.length,v;m<g;++m)for(a=0,v=h[m];a<c;++a)if((u=s[a]).type===v.type&&u.name===v.name)return v.value}return}for(h=r?Vv:Bv,a=0;a<c;++a)this.each(h(s[a],r,i));return this}function Fp(t,r,i){var s=zp(t),a=s.CustomEvent;typeof a=="function"?a=new a(r,i):(a=s.document.createEvent("Event"),i?(a.initEvent(r,i.bubbles,i.cancelable),a.detail=i.detail):a.initEvent(r,!1,!1)),t.dispatchEvent(a)}function Uv(t,r){return function(){return Fp(this,t,r)}}function Yv(t,r){return function(){return Fp(this,t,r.apply(this,arguments))}}function Xv(t,r){return this.each((typeof r=="function"?Yv:Uv)(t,r))}function*Gv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],a=0,c=s.length,u;a<c;++a)(u=s[a])&&(yield u)}var Op=[null];function nn(t,r){this._groups=t,this._parents=r}function xs(){return new nn([[document.documentElement]],Op)}function Kv(){return this}nn.prototype=xs.prototype={constructor:nn,select:S0,selectAll:C0,selectChild:M0,selectChildren:R0,filter:z0,data:O0,enter:A0,exit:B0,join:V0,merge:W0,selection:Kv,order:U0,sort:Y0,call:G0,nodes:K0,node:Q0,size:q0,empty:Z0,each:J0,attr:sv,style:uv,property:pv,classed:vv,text:kv,html:_v,raise:bv,lower:Pv,append:Iv,insert:Rv,remove:Av,clone:$v,datum:Fv,on:Wv,dispatch:Xv,[Symbol.iterator]:Gv};function tn(t){return typeof t=="string"?new nn([[document.querySelector(t)]],[document.documentElement]):new nn([[t]],Op)}function Qv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Cn(t,r){if(t=Qv(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var a=r.getBoundingClientRect();return[t.clientX-a.left-r.clientLeft,t.clientY-a.top-r.clientTop]}}return[t.pageX,t.pageY]}const qv={passive:!1},as={capture:!0,passive:!1};function Wc(t){t.stopImmediatePropagation()}function co(t){t.preventDefault(),t.stopImmediatePropagation()}function Hp(t){var r=t.document.documentElement,i=tn(t).on("dragstart.drag",co,as);"onselectstart"in r?i.on("selectstart.drag",co,as):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Bp(t,r){var i=t.document.documentElement,s=tn(t).on("dragstart.drag",null);r&&(s.on("click.drag",co,as),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const jl=t=>()=>t;function ou(t,{sourceEvent:r,subject:i,target:s,identifier:a,active:c,x:u,y:h,dx:m,dy:g,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:v}})}ou.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Zv(t){return!t.ctrlKey&&!t.button}function Jv(){return this.parentNode}function ex(t,r){return r??{x:t.x,y:t.y}}function tx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vp(){var t=Zv,r=Jv,i=ex,s=tx,a={},c=Jl("start","drag","end"),u=0,h,m,g,v,y=0;function x(j){j.on("mousedown.drag",C).filter(s).on("touchstart.drag",_).on("touchmove.drag",E,qv).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(j,F){if(!(v||!t.call(this,j,F))){var L=k(this,r.call(this,j,F),j,F,"mouse");L&&(tn(j.view).on("mousemove.drag",N,as).on("mouseup.drag",S,as),Hp(j.view),Wc(j),g=!1,h=j.clientX,m=j.clientY,L("start",j))}}function N(j){if(co(j),!g){var F=j.clientX-h,L=j.clientY-m;g=F*F+L*L>y}a.mouse("drag",j)}function S(j){tn(j.view).on("mousemove.drag mouseup.drag",null),Bp(j.view,g),co(j),a.mouse("end",j)}function _(j,F){if(t.call(this,j,F)){var L=j.changedTouches,B=r.call(this,j,F),Z=L.length,V,J;for(V=0;V<Z;++V)(J=k(this,B,j,F,L[V].identifier,L[V]))&&(Wc(j),J("start",j,L[V]))}}function E(j){var F=j.changedTouches,L=F.length,B,Z;for(B=0;B<L;++B)(Z=a[F[B].identifier])&&(co(j),Z("drag",j,F[B]))}function P(j){var F=j.changedTouches,L=F.length,B,Z;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),B=0;B<L;++B)(Z=a[F[B].identifier])&&(Wc(j),Z("end",j,F[B]))}function k(j,F,L,B,Z,V){var J=c.copy(),U=Cn(V||L,F),G,te,z;if((z=i.call(j,new ou("beforestart",{sourceEvent:L,target:x,identifier:Z,active:u,x:U[0],y:U[1],dx:0,dy:0,dispatch:J}),B))!=null)return G=z.x-U[0]||0,te=z.y-U[1]||0,function Q(W,K,M){var A=U,Y;switch(W){case"start":a[Z]=Q,Y=u++;break;case"end":delete a[Z],--u;case"drag":U=Cn(M||K,F),Y=u;break}J.call(W,j,new ou(W,{sourceEvent:K,subject:z,target:x,identifier:Z,active:Y,x:U[0]+G,y:U[1]+te,dx:U[0]-A[0],dy:U[1]-A[1],dispatch:J}),B)}}return x.filter=function(j){return arguments.length?(t=typeof j=="function"?j:jl(!!j),x):t},x.container=function(j){return arguments.length?(r=typeof j=="function"?j:jl(j),x):r},x.subject=function(j){return arguments.length?(i=typeof j=="function"?j:jl(j),x):i},x.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:jl(!!j),x):s},x.on=function(){var j=c.on.apply(c,arguments);return j===c?x:j},x.clickDistance=function(j){return arguments.length?(y=(j=+j)*j,x):Math.sqrt(y)},x}function ku(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Wp(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function ws(){}var cs=.7,Bl=1/cs,uo="\\s*([+-]?\\d+)\\s*",us="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nx=/^#([0-9a-f]{3,8})$/,rx=new RegExp(`^rgb\\(${uo},${uo},${uo}\\)$`),ix=new RegExp(`^rgb\\(${Yn},${Yn},${Yn}\\)$`),ox=new RegExp(`^rgba\\(${uo},${uo},${uo},${us}\\)$`),sx=new RegExp(`^rgba\\(${Yn},${Yn},${Yn},${us}\\)$`),lx=new RegExp(`^hsl\\(${us},${Yn},${Yn}\\)$`),ax=new RegExp(`^hsla\\(${us},${Yn},${Yn},${us}\\)$`),fh={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};ku(ws,Si,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hh,formatHex:hh,formatHex8:cx,formatHsl:ux,formatRgb:ph,toString:ph});function hh(){return this.rgb().formatHex()}function cx(){return this.rgb().formatHex8()}function ux(){return Up(this).formatHsl()}function ph(){return this.rgb().formatRgb()}function Si(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=nx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?mh(r):i===3?new Ut(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?bl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?bl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=rx.exec(t))?new Ut(r[1],r[2],r[3],1):(r=ix.exec(t))?new Ut(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=ox.exec(t))?bl(r[1],r[2],r[3],r[4]):(r=sx.exec(t))?bl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=lx.exec(t))?vh(r[1],r[2]/100,r[3]/100,1):(r=ax.exec(t))?vh(r[1],r[2]/100,r[3]/100,r[4]):fh.hasOwnProperty(t)?mh(fh[t]):t==="transparent"?new Ut(NaN,NaN,NaN,0):null}function mh(t){return new Ut(t>>16&255,t>>8&255,t&255,1)}function bl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Ut(t,r,i,s)}function dx(t){return t instanceof ws||(t=Si(t)),t?(t=t.rgb(),new Ut(t.r,t.g,t.b,t.opacity)):new Ut}function su(t,r,i,s){return arguments.length===1?dx(t):new Ut(t,r,i,s??1)}function Ut(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}ku(Ut,su,Wp(ws,{brighter(t){return t=t==null?Bl:Math.pow(Bl,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?cs:Math.pow(cs,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ut(vi(this.r),vi(this.g),vi(this.b),Vl(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:gh,formatHex:gh,formatHex8:fx,formatRgb:yh,toString:yh}));function gh(){return`#${yi(this.r)}${yi(this.g)}${yi(this.b)}`}function fx(){return`#${yi(this.r)}${yi(this.g)}${yi(this.b)}${yi((isNaN(this.opacity)?1:this.opacity)*255)}`}function yh(){const t=Vl(this.opacity);return`${t===1?"rgb(":"rgba("}${vi(this.r)}, ${vi(this.g)}, ${vi(this.b)}${t===1?")":`, ${t})`}`}function Vl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function yi(t){return t=vi(t),(t<16?"0":"")+t.toString(16)}function vh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new _n(t,r,i,s)}function Up(t){if(t instanceof _n)return new _n(t.h,t.s,t.l,t.opacity);if(t instanceof ws||(t=Si(t)),!t)return new _n;if(t instanceof _n)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,a=Math.min(r,i,s),c=Math.max(r,i,s),u=NaN,h=c-a,m=(c+a)/2;return h?(r===c?u=(i-s)/h+(i<s)*6:i===c?u=(s-r)/h+2:u=(r-i)/h+4,h/=m<.5?c+a:2-c-a,u*=60):h=m>0&&m<1?0:u,new _n(u,h,m,t.opacity)}function hx(t,r,i,s){return arguments.length===1?Up(t):new _n(t,r,i,s??1)}function _n(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}ku(_n,hx,Wp(ws,{brighter(t){return t=t==null?Bl:Math.pow(Bl,t),new _n(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?cs:Math.pow(cs,t),new _n(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,a=2*i-s;return new Ut(Uc(t>=240?t-240:t+120,a,s),Uc(t,a,s),Uc(t<120?t+240:t-120,a,s),this.opacity)},clamp(){return new _n(xh(this.h),Ml(this.s),Ml(this.l),Vl(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 t=Vl(this.opacity);return`${t===1?"hsl(":"hsla("}${xh(this.h)}, ${Ml(this.s)*100}%, ${Ml(this.l)*100}%${t===1?")":`, ${t})`}`}}));function xh(t){return t=(t||0)%360,t<0?t+360:t}function Ml(t){return Math.max(0,Math.min(1,t||0))}function Uc(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const Nu=t=>()=>t;function px(t,r){return function(i){return t+i*r}}function mx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function gx(t){return(t=+t)==1?Yp:function(r,i){return i-r?mx(r,i,t):Nu(isNaN(r)?i:r)}}function Yp(t,r){var i=r-t;return i?px(t,i):Nu(isNaN(t)?r:t)}const Wl=(function t(r){var i=gx(r);function s(a,c){var u=i((a=su(a)).r,(c=su(c)).r),h=i(a.g,c.g),m=i(a.b,c.b),g=Yp(a.opacity,c.opacity);return function(v){return a.r=u(v),a.g=h(v),a.b=m(v),a.opacity=g(v),a+""}}return s.gamma=t,s})(1);function yx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),a;return function(c){for(a=0;a<i;++a)s[a]=t[a]*(1-c)+r[a]*c;return s}}function vx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function xx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,a=new Array(s),c=new Array(i),u;for(u=0;u<s;++u)a[u]=ss(t[u],r[u]);for(;u<i;++u)c[u]=r[u];return function(h){for(u=0;u<s;++u)c[u]=a[u](h);return c}}function wx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Un(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Sx(t,r){var i={},s={},a;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(a in r)a in t?i[a]=ss(t[a],r[a]):s[a]=r[a];return function(c){for(a in i)s[a]=i[a](c);return s}}var lu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yc=new RegExp(lu.source,"g");function kx(t){return function(){return t}}function Nx(t){return function(r){return t(r)+""}}function Xp(t,r){var i=lu.lastIndex=Yc.lastIndex=0,s,a,c,u=-1,h=[],m=[];for(t=t+"",r=r+"";(s=lu.exec(t))&&(a=Yc.exec(r));)(c=a.index)>i&&(c=r.slice(i,c),h[u]?h[u]+=c:h[++u]=c),(s=s[0])===(a=a[0])?h[u]?h[u]+=a:h[++u]=a:(h[++u]=null,m.push({i:u,x:Un(s,a)})),i=Yc.lastIndex;return i<r.length&&(c=r.slice(i),h[u]?h[u]+=c:h[++u]=c),h.length<2?m[0]?Nx(m[0].x):kx(r):(r=m.length,function(g){for(var v=0,y;v<r;++v)h[(y=m[v]).i]=y.x(g);return h.join("")})}function ss(t,r){var i=typeof r,s;return r==null||i==="boolean"?Nu(r):(i==="number"?Un:i==="string"?(s=Si(r))?(r=s,Wl):Xp:r instanceof Si?Wl:r instanceof Date?wx:vx(r)?yx:Array.isArray(r)?xx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Sx:Un)(t,r)}var wh=180/Math.PI,au={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gp(t,r,i,s,a,c){var u,h,m;return(u=Math.sqrt(t*t+r*r))&&(t/=u,r/=u),(m=t*i+r*s)&&(i-=t*m,s-=r*m),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,m/=h),t*s<r*i&&(t=-t,r=-r,m=-m,u=-u),{translateX:a,translateY:c,rotate:Math.atan2(r,t)*wh,skewX:Math.atan(m)*wh,scaleX:u,scaleY:h}}var Pl;function Ex(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?au:Gp(r.a,r.b,r.c,r.d,r.e,r.f)}function Cx(t){return t==null||(Pl||(Pl=document.createElementNS("http://www.w3.org/2000/svg","g")),Pl.setAttribute("transform",t),!(t=Pl.transform.baseVal.consolidate()))?au:(t=t.matrix,Gp(t.a,t.b,t.c,t.d,t.e,t.f))}function Kp(t,r,i,s){function a(g){return g.length?g.pop()+" ":""}function c(g,v,y,x,C,N){if(g!==y||v!==x){var S=C.push("translate(",null,r,null,i);N.push({i:S-4,x:Un(g,y)},{i:S-2,x:Un(v,x)})}else(y||x)&&C.push("translate("+y+r+x+i)}function u(g,v,y,x){g!==v?(g-v>180?v+=360:v-g>180&&(g+=360),x.push({i:y.push(a(y)+"rotate(",null,s)-2,x:Un(g,v)})):v&&y.push(a(y)+"rotate("+v+s)}function h(g,v,y,x){g!==v?x.push({i:y.push(a(y)+"skewX(",null,s)-2,x:Un(g,v)}):v&&y.push(a(y)+"skewX("+v+s)}function m(g,v,y,x,C,N){if(g!==y||v!==x){var S=C.push(a(C)+"scale(",null,",",null,")");N.push({i:S-4,x:Un(g,y)},{i:S-2,x:Un(v,x)})}else(y!==1||x!==1)&&C.push(a(C)+"scale("+y+","+x+")")}return function(g,v){var y=[],x=[];return g=t(g),v=t(v),c(g.translateX,g.translateY,v.translateX,v.translateY,y,x),u(g.rotate,v.rotate,y,x),h(g.skewX,v.skewX,y,x),m(g.scaleX,g.scaleY,v.scaleX,v.scaleY,y,x),g=v=null,function(C){for(var N=-1,S=x.length,_;++N<S;)y[(_=x[N]).i]=_.x(C);return y.join("")}}}var _x=Kp(Ex,"px, ","px)","deg)"),jx=Kp(Cx,", ",")",")"),bx=1e-12;function Sh(t){return((t=Math.exp(t))+1/t)/2}function Mx(t){return((t=Math.exp(t))-1/t)/2}function Px(t){return((t=Math.exp(2*t))-1)/(t+1)}const Dl=(function t(r,i,s){function a(c,u){var h=c[0],m=c[1],g=c[2],v=u[0],y=u[1],x=u[2],C=v-h,N=y-m,S=C*C+N*N,_,E;if(S<bx)E=Math.log(x/g)/r,_=function(B){return[h+B*C,m+B*N,g*Math.exp(r*B*E)]};else{var P=Math.sqrt(S),k=(x*x-g*g+s*S)/(2*g*i*P),j=(x*x-g*g-s*S)/(2*x*i*P),F=Math.log(Math.sqrt(k*k+1)-k),L=Math.log(Math.sqrt(j*j+1)-j);E=(L-F)/r,_=function(B){var Z=B*E,V=Sh(F),J=g/(i*P)*(V*Px(r*Z+F)-Mx(F));return[h+J*C,m+J*N,g*V/Sh(r*Z+F)]}}return _.duration=E*1e3*r/Math.SQRT2,_}return a.rho=function(c){var u=Math.max(.001,+c),h=u*u,m=h*h;return t(u,h,m)},a})(Math.SQRT2,2,4);var ho=0,is=0,ns=0,Qp=1e3,Ul,os,Yl=0,ki=0,ta=0,ds=typeof performance=="object"&&performance.now?performance:Date,qp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Eu(){return ki||(qp(Ix),ki=ds.now()+ta)}function Ix(){ki=0}function Xl(){this._call=this._time=this._next=null}Xl.prototype=Zp.prototype={constructor:Xl,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Eu():+i)+(r==null?0:+r),!this._next&&os!==this&&(os?os._next=this:Ul=this,os=this),this._call=t,this._time=i,cu()},stop:function(){this._call&&(this._call=null,this._time=1/0,cu())}};function Zp(t,r,i){var s=new Xl;return s.restart(t,r,i),s}function Tx(){Eu(),++ho;for(var t=Ul,r;t;)(r=ki-t._time)>=0&&t._call.call(void 0,r),t=t._next;--ho}function kh(){ki=(Yl=ds.now())+ta,ho=is=0;try{Tx()}finally{ho=0,zx(),ki=0}}function Rx(){var t=ds.now(),r=t-Yl;r>Qp&&(ta-=r,Yl=t)}function zx(){for(var t,r=Ul,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:Ul=i);os=t,cu(s)}function cu(t){if(!ho){is&&(is=clearTimeout(is));var r=t-ki;r>24?(t<1/0&&(is=setTimeout(kh,t-ds.now()-ta)),ns&&(ns=clearInterval(ns))):(ns||(Yl=ds.now(),ns=setInterval(Rx,Qp)),ho=1,qp(kh))}}function Nh(t,r,i){var s=new Xl;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,i),s}var Ax=Jl("start","end","cancel","interrupt"),Lx=[],Jp=0,Eh=1,uu=2,$l=3,Ch=4,du=5,Fl=6;function na(t,r,i,s,a,c){var u=t.__transition;if(!u)t.__transition={};else if(i in u)return;Dx(t,i,{name:r,index:s,group:a,on:Ax,tween:Lx,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Jp})}function Cu(t,r){var i=Mn(t,r);if(i.state>Jp)throw new Error("too late; already scheduled");return i}function Kn(t,r){var i=Mn(t,r);if(i.state>$l)throw new Error("too late; already running");return i}function Mn(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Dx(t,r,i){var s=t.__transition,a;s[r]=i,i.timer=Zp(c,0,i.time);function c(g){i.state=Eh,i.timer.restart(u,i.delay,i.time),i.delay<=g&&u(g-i.delay)}function u(g){var v,y,x,C;if(i.state!==Eh)return m();for(v in s)if(C=s[v],C.name===i.name){if(C.state===$l)return Nh(u);C.state===Ch?(C.state=Fl,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[v]):+v<r&&(C.state=Fl,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[v])}if(Nh(function(){i.state===$l&&(i.state=Ch,i.timer.restart(h,i.delay,i.time),h(g))}),i.state=uu,i.on.call("start",t,t.__data__,i.index,i.group),i.state===uu){for(i.state=$l,a=new Array(x=i.tween.length),v=0,y=-1;v<x;++v)(C=i.tween[v].value.call(t,t.__data__,i.index,i.group))&&(a[++y]=C);a.length=y+1}}function h(g){for(var v=g<i.duration?i.ease.call(null,g/i.duration):(i.timer.restart(m),i.state=du,1),y=-1,x=a.length;++y<x;)a[y].call(t,v);i.state===du&&(i.on.call("end",t,t.__data__,i.index,i.group),m())}function m(){i.state=Fl,i.timer.stop(),delete s[r];for(var g in s)return;delete t.__transition}}function Ol(t,r){var i=t.__transition,s,a,c=!0,u;if(i){r=r==null?null:r+"";for(u in i){if((s=i[u]).name!==r){c=!1;continue}a=s.state>uu&&s.state<du,s.state=Fl,s.timer.stop(),s.on.call(a?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[u]}c&&delete t.__transition}}function $x(t){return this.each(function(){Ol(this,t)})}function Fx(t,r){var i,s;return function(){var a=Kn(this,t),c=a.tween;if(c!==i){s=i=c;for(var u=0,h=s.length;u<h;++u)if(s[u].name===r){s=s.slice(),s.splice(u,1);break}}a.tween=s}}function Ox(t,r,i){var s,a;if(typeof i!="function")throw new Error;return function(){var c=Kn(this,t),u=c.tween;if(u!==s){a=(s=u).slice();for(var h={name:r,value:i},m=0,g=a.length;m<g;++m)if(a[m].name===r){a[m]=h;break}m===g&&a.push(h)}c.tween=a}}function Hx(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Mn(this.node(),i).tween,a=0,c=s.length,u;a<c;++a)if((u=s[a]).name===t)return u.value;return null}return this.each((r==null?Fx:Ox)(i,t,r))}function _u(t,r,i){var s=t._id;return t.each(function(){var a=Kn(this,s);(a.value||(a.value={}))[r]=i.apply(this,arguments)}),function(a){return Mn(a,s).value[r]}}function em(t,r){var i;return(typeof r=="number"?Un:r instanceof Si?Wl:(i=Si(r))?(r=i,Wl):Xp)(t,r)}function Bx(t){return function(){this.removeAttribute(t)}}function Vx(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wx(t,r,i){var s,a=i+"",c;return function(){var u=this.getAttribute(t);return u===a?null:u===s?c:c=r(s=u,i)}}function Ux(t,r,i){var s,a=i+"",c;return function(){var u=this.getAttributeNS(t.space,t.local);return u===a?null:u===s?c:c=r(s=u,i)}}function Yx(t,r,i){var s,a,c;return function(){var u,h=i(this),m;return h==null?void this.removeAttribute(t):(u=this.getAttribute(t),m=h+"",u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h)))}}function Xx(t,r,i){var s,a,c;return function(){var u,h=i(this),m;return h==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),m=h+"",u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h)))}}function Gx(t,r){var i=ea(t),s=i==="transform"?jx:em;return this.attrTween(t,typeof r=="function"?(i.local?Xx:Yx)(i,s,_u(this,"attr."+t,r)):r==null?(i.local?Vx:Bx)(i):(i.local?Ux:Wx)(i,s,r))}function Kx(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Qx(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function qx(t,r){var i,s;function a(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Qx(t,c)),i}return a._value=r,a}function Zx(t,r){var i,s;function a(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Kx(t,c)),i}return a._value=r,a}function Jx(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var s=ea(t);return this.tween(i,(s.local?qx:Zx)(s,r))}function ew(t,r){return function(){Cu(this,t).delay=+r.apply(this,arguments)}}function tw(t,r){return r=+r,function(){Cu(this,t).delay=r}}function nw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?ew:tw)(r,t)):Mn(this.node(),r).delay}function rw(t,r){return function(){Kn(this,t).duration=+r.apply(this,arguments)}}function iw(t,r){return r=+r,function(){Kn(this,t).duration=r}}function ow(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?rw:iw)(r,t)):Mn(this.node(),r).duration}function sw(t,r){if(typeof r!="function")throw new Error;return function(){Kn(this,t).ease=r}}function lw(t){var r=this._id;return arguments.length?this.each(sw(r,t)):Mn(this.node(),r).ease}function aw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Kn(this,t).ease=i}}function cw(t){if(typeof t!="function")throw new Error;return this.each(aw(this._id,t))}function uw(t){typeof t!="function"&&(t=Ip(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=[],m,g=0;g<u;++g)(m=c[g])&&t.call(m,m.__data__,g,c)&&h.push(m);return new cr(s,this._parents,this._name,this._id)}function dw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,a=i.length,c=Math.min(s,a),u=new Array(s),h=0;h<c;++h)for(var m=r[h],g=i[h],v=m.length,y=u[h]=new Array(v),x,C=0;C<v;++C)(x=m[C]||g[C])&&(y[C]=x);for(;h<s;++h)u[h]=r[h];return new cr(u,this._parents,this._name,this._id)}function fw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function hw(t,r,i){var s,a,c=fw(r)?Cu:Kn;return function(){var u=c(this,t),h=u.on;h!==s&&(a=(s=h).copy()).on(r,i),u.on=a}}function pw(t,r){var i=this._id;return arguments.length<2?Mn(this.node(),i).on.on(t):this.each(hw(i,t,r))}function mw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function gw(){return this.on("end.remove",mw(this._id))}function yw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=wu(t));for(var s=this._groups,a=s.length,c=new Array(a),u=0;u<a;++u)for(var h=s[u],m=h.length,g=c[u]=new Array(m),v,y,x=0;x<m;++x)(v=h[x])&&(y=t.call(v,v.__data__,x,h))&&("__data__"in v&&(y.__data__=v.__data__),g[x]=y,na(g[x],r,i,x,g,Mn(v,i)));return new cr(c,this._parents,r,i)}function vw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Pp(t));for(var s=this._groups,a=s.length,c=[],u=[],h=0;h<a;++h)for(var m=s[h],g=m.length,v,y=0;y<g;++y)if(v=m[y]){for(var x=t.call(v,v.__data__,y,m),C,N=Mn(v,i),S=0,_=x.length;S<_;++S)(C=x[S])&&na(C,r,i,S,x,N);c.push(x),u.push(v)}return new cr(c,u,r,i)}var xw=xs.prototype.constructor;function ww(){return new xw(this._groups,this._parents)}function Sw(t,r){var i,s,a;return function(){var c=fo(this,t),u=(this.style.removeProperty(t),fo(this,t));return c===u?null:c===i&&u===s?a:a=r(i=c,s=u)}}function tm(t){return function(){this.style.removeProperty(t)}}function kw(t,r,i){var s,a=i+"",c;return function(){var u=fo(this,t);return u===a?null:u===s?c:c=r(s=u,i)}}function Nw(t,r,i){var s,a,c;return function(){var u=fo(this,t),h=i(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),fo(this,t))),u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h))}}function Ew(t,r){var i,s,a,c="style."+r,u="end."+c,h;return function(){var m=Kn(this,t),g=m.on,v=m.value[c]==null?h||(h=tm(r)):void 0;(g!==i||a!==v)&&(s=(i=g).copy()).on(u,a=v),m.on=s}}function Cw(t,r,i){var s=(t+="")=="transform"?_x:em;return r==null?this.styleTween(t,Sw(t,s)).on("end.style."+t,tm(t)):typeof r=="function"?this.styleTween(t,Nw(t,s,_u(this,"style."+t,r))).each(Ew(this._id,t)):this.styleTween(t,kw(t,s,r),i).on("end.style."+t,null)}function _w(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function jw(t,r,i){var s,a;function c(){var u=r.apply(this,arguments);return u!==a&&(s=(a=u)&&_w(t,u,i)),s}return c._value=r,c}function bw(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,jw(t,r,i??""))}function Mw(t){return function(){this.textContent=t}}function Pw(t){return function(){var r=t(this);this.textContent=r??""}}function Iw(t){return this.tween("text",typeof t=="function"?Pw(_u(this,"text",t)):Mw(t==null?"":t+""))}function Tw(t){return function(r){this.textContent=t.call(this,r)}}function Rw(t){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Tw(a)),r}return s._value=t,s}function zw(t){var r="text";if(arguments.length<1)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,Rw(t))}function Aw(){for(var t=this._name,r=this._id,i=nm(),s=this._groups,a=s.length,c=0;c<a;++c)for(var u=s[c],h=u.length,m,g=0;g<h;++g)if(m=u[g]){var v=Mn(m,r);na(m,t,i,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new cr(s,this._parents,t,i)}function Lw(){var t,r,i=this,s=i._id,a=i.size();return new Promise(function(c,u){var h={value:u},m={value:function(){--a===0&&c()}};i.each(function(){var g=Kn(this,s),v=g.on;v!==t&&(r=(t=v).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(m)),g.on=r}),a===0&&c()})}var Dw=0;function cr(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function nm(){return++Dw}var lr=xs.prototype;cr.prototype={constructor:cr,select:yw,selectAll:vw,selectChild:lr.selectChild,selectChildren:lr.selectChildren,filter:uw,merge:dw,selection:ww,transition:Aw,call:lr.call,nodes:lr.nodes,node:lr.node,size:lr.size,empty:lr.empty,each:lr.each,on:pw,attr:Gx,attrTween:Jx,style:Cw,styleTween:bw,text:Iw,textTween:zw,remove:gw,tween:Hx,delay:nw,duration:ow,ease:lw,easeVarying:cw,end:Lw,[Symbol.iterator]:lr[Symbol.iterator]};function $w(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Fw={time:null,delay:0,duration:250,ease:$w};function Ow(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function Hw(t){var r,i;t instanceof cr?(r=t._id,t=t._name):(r=nm(),(i=Fw).time=Eu(),t=t==null?null:t+"");for(var s=this._groups,a=s.length,c=0;c<a;++c)for(var u=s[c],h=u.length,m,g=0;g<h;++g)(m=u[g])&&na(m,t,r,g,u,i||Ow(m,r));return new cr(s,this._parents,t,r)}xs.prototype.interrupt=$x;xs.prototype.transition=Hw;const Il=t=>()=>t;function Bw(t,{sourceEvent:r,target:i,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function ar(t,r,i){this.k=t,this.x=r,this.y=i}ar.prototype={constructor:ar,scale:function(t){return t===1?this:new ar(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new ar(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ra=new ar(1,0,0);rm.prototype=ar.prototype;function rm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ra;return t.__zoom}function Xc(t){t.stopImmediatePropagation()}function rs(t){t.preventDefault(),t.stopImmediatePropagation()}function Vw(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Ww(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function _h(){return this.__zoom||ra}function Uw(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Yw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xw(t,r,i){var s=t.invertX(r[0][0])-i[0][0],a=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],u=t.invertY(r[1][1])-i[1][1];return t.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function im(){var t=Vw,r=Ww,i=Xw,s=Uw,a=Yw,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],h=250,m=Dl,g=Jl("start","zoom","end"),v,y,x,C=500,N=150,S=0,_=10;function E(z){z.property("__zoom",_h).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",J).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(z,Q,W,K){var M=z.selection?z.selection():z;M.property("__zoom",_h),z!==M?F(z,Q,W,K):M.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},E.scaleBy=function(z,Q,W,K){E.scaleTo(z,function(){var M=this.__zoom.k,A=typeof Q=="function"?Q.apply(this,arguments):Q;return M*A},W,K)},E.scaleTo=function(z,Q,W,K){E.transform(z,function(){var M=r.apply(this,arguments),A=this.__zoom,Y=W==null?j(M):typeof W=="function"?W.apply(this,arguments):W,I=A.invert(Y),$=typeof Q=="function"?Q.apply(this,arguments):Q;return i(k(P(A,$),Y,I),M,u)},W,K)},E.translateBy=function(z,Q,W,K){E.transform(z,function(){return i(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof W=="function"?W.apply(this,arguments):W),r.apply(this,arguments),u)},null,K)},E.translateTo=function(z,Q,W,K,M){E.transform(z,function(){var A=r.apply(this,arguments),Y=this.__zoom,I=K==null?j(A):typeof K=="function"?K.apply(this,arguments):K;return i(ra.translate(I[0],I[1]).scale(Y.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof W=="function"?-W.apply(this,arguments):-W),A,u)},K,M)};function P(z,Q){return Q=Math.max(c[0],Math.min(c[1],Q)),Q===z.k?z:new ar(Q,z.x,z.y)}function k(z,Q,W){var K=Q[0]-W[0]*z.k,M=Q[1]-W[1]*z.k;return K===z.x&&M===z.y?z:new ar(z.k,K,M)}function j(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function F(z,Q,W,K){z.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var M=this,A=arguments,Y=L(M,A).event(K),I=r.apply(M,A),$=W==null?j(I):typeof W=="function"?W.apply(M,A):W,se=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),le=M.__zoom,de=typeof Q=="function"?Q.apply(M,A):Q,he=m(le.invert($).concat(se/le.k),de.invert($).concat(se/de.k));return function(me){if(me===1)me=de;else{var oe=he(me),pe=se/oe[2];me=new ar(pe,$[0]-oe[0]*pe,$[1]-oe[1]*pe)}Y.zoom(null,me)}})}function L(z,Q,W){return!W&&z.__zooming||new B(z,Q)}function B(z,Q){this.that=z,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,Q),this.taps=0}B.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,Q){return this.mouse&&z!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var Q=tn(this.that).datum();g.call(z,this.that,new Bw(z,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:g}),Q)}};function Z(z,...Q){if(!t.apply(this,arguments))return;var W=L(this,Q).event(z),K=this.__zoom,M=Math.max(c[0],Math.min(c[1],K.k*Math.pow(2,s.apply(this,arguments)))),A=Cn(z);if(W.wheel)(W.mouse[0][0]!==A[0]||W.mouse[0][1]!==A[1])&&(W.mouse[1]=K.invert(W.mouse[0]=A)),clearTimeout(W.wheel);else{if(K.k===M)return;W.mouse=[A,K.invert(A)],Ol(this),W.start()}rs(z),W.wheel=setTimeout(Y,N),W.zoom("mouse",i(k(P(K,M),W.mouse[0],W.mouse[1]),W.extent,u));function Y(){W.wheel=null,W.end()}}function V(z,...Q){if(x||!t.apply(this,arguments))return;var W=z.currentTarget,K=L(this,Q,!0).event(z),M=tn(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",se,!0),A=Cn(z,W),Y=z.clientX,I=z.clientY;Hp(z.view),Xc(z),K.mouse=[A,this.__zoom.invert(A)],Ol(this),K.start();function $(le){if(rs(le),!K.moved){var de=le.clientX-Y,he=le.clientY-I;K.moved=de*de+he*he>S}K.event(le).zoom("mouse",i(k(K.that.__zoom,K.mouse[0]=Cn(le,W),K.mouse[1]),K.extent,u))}function se(le){M.on("mousemove.zoom mouseup.zoom",null),Bp(le.view,K.moved),rs(le),K.event(le).end()}}function J(z,...Q){if(t.apply(this,arguments)){var W=this.__zoom,K=Cn(z.changedTouches?z.changedTouches[0]:z,this),M=W.invert(K),A=W.k*(z.shiftKey?.5:2),Y=i(k(P(W,A),K,M),r.apply(this,Q),u);rs(z),h>0?tn(this).transition().duration(h).call(F,Y,K,z):tn(this).call(E.transform,Y,K,z)}}function U(z,...Q){if(t.apply(this,arguments)){var W=z.touches,K=W.length,M=L(this,Q,z.changedTouches.length===K).event(z),A,Y,I,$;for(Xc(z),Y=0;Y<K;++Y)I=W[Y],$=Cn(I,this),$=[$,this.__zoom.invert($),I.identifier],M.touch0?!M.touch1&&M.touch0[2]!==$[2]&&(M.touch1=$,M.taps=0):(M.touch0=$,A=!0,M.taps=1+!!v);v&&(v=clearTimeout(v)),A&&(M.taps<2&&(y=$[0],v=setTimeout(function(){v=null},C)),Ol(this),M.start())}}function G(z,...Q){if(this.__zooming){var W=L(this,Q).event(z),K=z.changedTouches,M=K.length,A,Y,I,$;for(rs(z),A=0;A<M;++A)Y=K[A],I=Cn(Y,this),W.touch0&&W.touch0[2]===Y.identifier?W.touch0[0]=I:W.touch1&&W.touch1[2]===Y.identifier&&(W.touch1[0]=I);if(Y=W.that.__zoom,W.touch1){var se=W.touch0[0],le=W.touch0[1],de=W.touch1[0],he=W.touch1[1],me=(me=de[0]-se[0])*me+(me=de[1]-se[1])*me,oe=(oe=he[0]-le[0])*oe+(oe=he[1]-le[1])*oe;Y=P(Y,Math.sqrt(me/oe)),I=[(se[0]+de[0])/2,(se[1]+de[1])/2],$=[(le[0]+he[0])/2,(le[1]+he[1])/2]}else if(W.touch0)I=W.touch0[0],$=W.touch0[1];else return;W.zoom("touch",i(k(Y,I,$),W.extent,u))}}function te(z,...Q){if(this.__zooming){var W=L(this,Q).event(z),K=z.changedTouches,M=K.length,A,Y;for(Xc(z),x&&clearTimeout(x),x=setTimeout(function(){x=null},C),A=0;A<M;++A)Y=K[A],W.touch0&&W.touch0[2]===Y.identifier?delete W.touch0:W.touch1&&W.touch1[2]===Y.identifier&&delete W.touch1;if(W.touch1&&!W.touch0&&(W.touch0=W.touch1,delete W.touch1),W.touch0)W.touch0[1]=this.__zoom.invert(W.touch0[0]);else if(W.end(),W.taps===2&&(Y=Cn(Y,this),Math.hypot(y[0]-Y[0],y[1]-Y[1])<_)){var I=tn(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return E.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:Il(+z),E):s},E.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Il(!!z),E):t},E.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:Il(!!z),E):a},E.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Il([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),E):r},E.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],E):[c[0],c[1]]},E.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(z){return arguments.length?(i=z,E):i},E.duration=function(z){return arguments.length?(h=+z,E):h},E.interpolate=function(z){return arguments.length?(m=z,E):m},E.on=function(){var z=g.on.apply(g,arguments);return z===g?E:z},E.clickDistance=function(z){return arguments.length?(S=(z=+z)*z,E):Math.sqrt(S)},E.tapDistance=function(z){return arguments.length?(_=+z,E):_},E}const Gn={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},fs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],om=["Enter"," ","Escape"],sm={"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:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"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 Ni;(function(t){t.Strict="strict",t.Loose="loose"})(Ni||(Ni={}));var xi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(xi||(xi={}));var hs;(function(t){t.Partial="partial",t.Full="full"})(hs||(hs={}));const lm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Vr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Vr||(Vr={}));var ps;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(ps||(ps={}));var Ce;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ce||(Ce={}));const jh={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function am(t){return t===null?null:t?"valid":"invalid"}const cm=t=>"id"in t&&"source"in t&&"target"in t,Gw=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),ju=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ss=(t,r=[0,0])=>{const{width:i,height:s}=ur(t),a=t.origin??r,c=i*a[0],u=s*a[1];return{x:t.position.x-c,y:t.position.y-u}},Kw=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,a)=>{const c=typeof a=="string";let u=!r.nodeLookup&&!c?a:void 0;r.nodeLookup&&(u=c?r.nodeLookup.get(a):ju(a)?a:r.nodeLookup.get(a.id));const h=u?Gl(u,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ia(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return oa(i)},ks=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(a=>{(r.filter===void 0||r.filter(a))&&(i=ia(i,Gl(a)),s=!0)}),s?oa(i):{x:0,y:0,width:0,height:0}},bu=(t,r,[i,s,a]=[0,0,1],c=!1,u=!1)=>{const h={...Es(r,[i,s,a]),width:r.width/a,height:r.height/a},m=[];for(const g of t.values()){const{measured:v,selectable:y=!0,hidden:x=!1}=g;if(u&&!y||x)continue;const C=v.width??g.width??g.initialWidth??null,N=v.height??g.height??g.initialHeight??null,S=ms(h,mo(g)),_=(C??0)*(N??0),E=c&&S>0;(!g.internals.handleBounds||E||S>=_||g.dragging)&&m.push(g)}return m},Qw=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function qw(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!a.hidden)&&(!s||s.has(a.id))&&i.set(a.id,a)}),i}async function Zw({nodes:t,width:r,height:i,panZoom:s,minZoom:a,maxZoom:c},u){if(t.size===0)return Promise.resolve(!0);const h=qw(t,u),m=ks(h),g=Mu(m,r,i,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??c,(u==null?void 0:u.padding)??.1);return await s.setViewport(g,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function um({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:a,onError:c}){const u=i.get(t),h=u.parentId?i.get(u.parentId):void 0,{x:m,y:g}=h?h.internals.positionAbsolute:{x:0,y:0},v=u.origin??s;let y=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!h)c==null||c("005",Gn.error005());else{const C=h.measured.width,N=h.measured.height;C&&N&&(y=[[m,g],[m+C,g+N]])}else h&&go(u.extent)&&(y=[[u.extent[0][0]+m,u.extent[0][1]+g],[u.extent[1][0]+m,u.extent[1][1]+g]]);const x=go(y)?Ei(r,y,u.measured):r;return(u.measured.width===void 0||u.measured.height===void 0)&&(c==null||c("015",Gn.error015())),{position:{x:x.x-m+(u.measured.width??0)*v[0],y:x.y-g+(u.measured.height??0)*v[1]},positionAbsolute:x}}async function Jw({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:a}){const c=new Set(t.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const C=c.has(x.id),N=!C&&x.parentId&&u.find(S=>S.id===x.parentId);(C||N)&&u.push(x)}const h=new Set(r.map(x=>x.id)),m=s.filter(x=>x.deletable!==!1),v=Qw(u,m);for(const x of m)h.has(x.id)&&!v.find(N=>N.id===x.id)&&v.push(x);if(!a)return{edges:v,nodes:u};const y=await a({nodes:u,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:u}:{edges:[],nodes:[]}:y}const po=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Ei=(t={x:0,y:0},r,i)=>({x:po(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:po(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function dm(t,r,i){const{width:s,height:a}=ur(i),{x:c,y:u}=i.internals.positionAbsolute;return Ei(t,[[c,u],[c+s,u+a]],r)}const bh=(t,r,i)=>t<r?po(Math.abs(t-r),1,r)/r:t>i?-po(Math.abs(t-i),1,r)/r:0,fm=(t,r,i=15,s=40)=>{const a=bh(t.x,s,r.width-s)*i,c=bh(t.y,s,r.height-s)*i;return[a,c]},ia=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),fu=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),oa=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),mo=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=ju(t)?t.internals.positionAbsolute:Ss(t,r);return{x:i,y:s,width:((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},Gl=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=ju(t)?t.internals.positionAbsolute:Ss(t,r);return{x:i,y:s,x2:i+(((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},hm=(t,r)=>oa(ia(fu(t),fu(r))),ms=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},Mh=t=>jn(t.width)&&jn(t.height)&&jn(t.x)&&jn(t.y),jn=t=>!isNaN(t)&&isFinite(t),e1=(t,r)=>{},Ns=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Es=({x:t,y:r},[i,s,a],c=!1,u=[1,1])=>{const h={x:(t-i)/a,y:(r-s)/a};return c?Ns(h,u):h},Kl=({x:t,y:r},[i,s,a])=>({x:t*a+i,y:r*a+s});function no(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function t1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=no(t,i),a=no(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=no(t.top??t.y??0,i),a=no(t.bottom??t.y??0,i),c=no(t.left??t.x??0,r),u=no(t.right??t.x??0,r);return{top:s,right:u,bottom:a,left:c,x:c+u,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function n1(t,r,i,s,a,c){const{x:u,y:h}=Kl(t,[r,i,s]),{x:m,y:g}=Kl({x:t.x+t.width,y:t.y+t.height},[r,i,s]),v=a-m,y=c-g;return{left:Math.floor(u),top:Math.floor(h),right:Math.floor(v),bottom:Math.floor(y)}}const Mu=(t,r,i,s,a,c)=>{const u=t1(c,r,i),h=(r-u.x)/t.width,m=(i-u.y)/t.height,g=Math.min(h,m),v=po(g,s,a),y=t.x+t.width/2,x=t.y+t.height/2,C=r/2-y*v,N=i/2-x*v,S=n1(t,C,N,v,r,i),_={left:Math.min(S.left-u.left,0),top:Math.min(S.top-u.top,0),right:Math.min(S.right-u.right,0),bottom:Math.min(S.bottom-u.bottom,0)};return{x:C-_.left+_.right,y:N-_.top+_.bottom,zoom:v}},gs=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function go(t){return t!=null&&t!=="parent"}function ur(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function pm(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function mm(t,r={width:0,height:0},i,s,a){const c={...t},u=s.get(i);if(u){const h=u.origin||a;c.x+=u.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=u.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Ph(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function r1(){let t,r;return{promise:new Promise((s,a)=>{t=s,r=a}),resolve:t,reject:r}}function i1(t){return{...sm,...t||{}}}function ls(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:a}){const{x:c,y:u}=bn(t),h=Es({x:c-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},s),{x:m,y:g}=i?Ns(h,r):h;return{xSnapped:m,ySnapped:g,...h}}const Pu=t=>({width:t.offsetWidth,height:t.offsetHeight}),gm=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},o1=["INPUT","SELECT","TEXTAREA"];function ym(t){var s,a;const r=((a=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:a[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:o1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const vm=t=>"clientX"in t,bn=(t,r)=>{var c,u;const i=vm(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,a=i?t.clientY:(u=t.touches)==null?void 0:u[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)}},Ih=(t,r,i,s,a)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(u=>{const h=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:a,position:u.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Pu(u)}})};function xm({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:h}){const m=t*.125+a*.375+u*.375+i*.125,g=r*.125+c*.375+h*.375+s*.125,v=Math.abs(m-t),y=Math.abs(g-r);return[m,g,v,y]}function Tl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Th({pos:t,x1:r,y1:i,x2:s,y2:a,c}){switch(t){case Ce.Left:return[r-Tl(r-s,c),i];case Ce.Right:return[r+Tl(s-r,c),i];case Ce.Top:return[r,i-Tl(i-a,c)];case Ce.Bottom:return[r,i+Tl(a-i,c)]}}function wm({sourceX:t,sourceY:r,sourcePosition:i=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top,curvature:u=.25}){const[h,m]=Th({pos:i,x1:t,y1:r,x2:s,y2:a,c:u}),[g,v]=Th({pos:c,x1:s,y1:a,x2:t,y2:r,c:u}),[y,x,C,N]=xm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:h,sourceControlY:m,targetControlX:g,targetControlY:v});return[`M${t},${r} C${h},${m} ${g},${v} ${s},${a}`,y,x,C,N]}function Sm({sourceX:t,sourceY:r,targetX:i,targetY:s}){const a=Math.abs(i-t)/2,c=i<t?i+a:i-a,u=Math.abs(s-r)/2,h=s<r?s+u:s-u;return[c,h,a,u]}function s1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const u=a&&i?s+1e3:s,h=Math.max(t.parentId||a&&t.selected?t.internals.z:0,r.parentId||a&&r.selected?r.internals.z:0);return u+h}function l1({sourceNode:t,targetNode:r,width:i,height:s,transform:a}){const c=ia(Gl(t),Gl(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:i/a[2],height:s/a[2]};return ms(u,oa(c))>0}const km=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,a1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),Nm=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||km;let a;return cm(t)?a={...t}:a={...t,id:s(t)},a1(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))},c1=(t,r,i,s={shouldReplaceId:!0})=>{const{id:a,...c}=t;if(!r.source||!r.target||!i.find(g=>g.id===t.id))return i;const h=s.getEdgeId||km,m={...c,id:s.shouldReplaceId?h(r):a,source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle};return i.filter(g=>g.id!==a).concat(m)};function Em({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[a,c,u,h]=Sm({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,a,c,u,h]}const Rh={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},u1=({source:t,sourcePosition:r=Ce.Bottom,target:i})=>r===Ce.Left||r===Ce.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},zh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function d1({source:t,sourcePosition:r=Ce.Bottom,target:i,targetPosition:s=Ce.Top,center:a,offset:c,stepPosition:u}){const h=Rh[r],m=Rh[s],g={x:t.x+h.x*c,y:t.y+h.y*c},v={x:i.x+m.x*c,y:i.y+m.y*c},y=u1({source:g,sourcePosition:r,target:v}),x=y.x!==0?"x":"y",C=y[x];let N=[],S,_;const E={x:0,y:0},P={x:0,y:0},[,,k,j]=Sm({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[x]*m[x]===-1){x==="x"?(S=a.x??g.x+(v.x-g.x)*u,_=a.y??(g.y+v.y)/2):(S=a.x??(g.x+v.x)/2,_=a.y??g.y+(v.y-g.y)*u);const L=[{x:S,y:g.y},{x:S,y:v.y}],B=[{x:g.x,y:_},{x:v.x,y:_}];h[x]===C?N=x==="x"?L:B:N=x==="x"?B:L}else{const L=[{x:g.x,y:v.y}],B=[{x:v.x,y:g.y}];if(x==="x"?N=h.x===C?B:L:N=h.y===C?L:B,r===s){const G=Math.abs(t[x]-i[x]);if(G<=c){const te=Math.min(c-1,c-G);h[x]===C?E[x]=(g[x]>t[x]?-1:1)*te:P[x]=(v[x]>i[x]?-1:1)*te}}if(r!==s){const G=x==="x"?"y":"x",te=h[x]===m[G],z=g[G]>v[G],Q=g[G]<v[G];(h[x]===1&&(!te&&z||te&&Q)||h[x]!==1&&(!te&&Q||te&&z))&&(N=x==="x"?L:B)}const Z={x:g.x+E.x,y:g.y+E.y},V={x:v.x+P.x,y:v.y+P.y},J=Math.max(Math.abs(Z.x-N[0].x),Math.abs(V.x-N[0].x)),U=Math.max(Math.abs(Z.y-N[0].y),Math.abs(V.y-N[0].y));J>=U?(S=(Z.x+V.x)/2,_=N[0].y):(S=N[0].x,_=(Z.y+V.y)/2)}return[[t,{x:g.x+E.x,y:g.y+E.y},...N,{x:v.x+P.x,y:v.y+P.y},i],S,_,k,j]}function f1(t,r,i,s){const a=Math.min(zh(t,r)/2,zh(r,i)/2,s),{x:c,y:u}=r;if(t.x===c&&c===i.x||t.y===u&&u===i.y)return`L${c} ${u}`;if(t.y===u){const g=t.x<i.x?-1:1,v=t.y<i.y?1:-1;return`L ${c+a*g},${u}Q ${c},${u} ${c},${u+a*v}`}const h=t.x<i.x?1:-1,m=t.y<i.y?-1:1;return`L ${c},${u+a*m}Q ${c},${u} ${c+a*h},${u}`}function hu({sourceX:t,sourceY:r,sourcePosition:i=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top,borderRadius:u=5,centerX:h,centerY:m,offset:g=20,stepPosition:v=.5}){const[y,x,C,N,S]=d1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:a},targetPosition:c,center:{x:h,y:m},offset:g,stepPosition:v});return[y.reduce((E,P,k)=>{let j="";return k>0&&k<y.length-1?j=f1(y[k-1],P,y[k+1],u):j=`${k===0?"M":"L"}${P.x} ${P.y}`,E+=j,E},""),x,C,N,S]}function Ah(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function h1(t){var y;const{sourceNode:r,targetNode:i}=t;if(!Ah(r)||!Ah(i))return null;const s=r.internals.handleBounds||Lh(r.handles),a=i.internals.handleBounds||Lh(i.handles),c=Dh((s==null?void 0:s.source)??[],t.sourceHandle),u=Dh(t.connectionMode===Ni.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),t.targetHandle);if(!c||!u)return(y=t.onError)==null||y.call(t,"008",Gn.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||Ce.Bottom,m=(u==null?void 0:u.position)||Ce.Top,g=Ci(r,c,h),v=Ci(i,u,m);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:h,targetPosition:m}}function Lh(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Ci(t,r,i=Ce.Left,s=!1){const a=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:u,height:h}=r??ur(t);if(s)return{x:a+u/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case Ce.Top:return{x:a+u/2,y:c};case Ce.Right:return{x:a+u,y:c+h/2};case Ce.Bottom:return{x:a+u/2,y:c+h};case Ce.Left:return{x:a,y:c+h/2}}}function Dh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function pu(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function p1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:a}){const c=new Set;return t.reduce((u,h)=>([h.markerStart||s,h.markerEnd||a].forEach(m=>{if(m&&typeof m=="object"){const g=pu(m,r);c.has(g)||(u.push({id:g,color:m.color||i,...m}),c.add(g))}}),u),[]).sort((u,h)=>u.id.localeCompare(h.id))}const Cm=1e3,m1=10,Iu={nodeOrigin:[0,0],nodeExtent:fs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},g1={...Iu,checkEquality:!0};function Tu(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function y1(t,r,i){const s=Tu(Iu,i);for(const a of t.values())if(a.parentId)zu(a,t,r,s);else{const c=Ss(a,s.nodeOrigin),u=go(a.extent)?a.extent:s.nodeExtent,h=Ei(c,u,ur(a));a.internals.positionAbsolute=h}}function v1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const a of t.handles){const c={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?i.push(c):a.type==="target"&&s.push(c)}return{source:i,target:s}}function Ru(t){return t==="manual"}function mu(t,r,i,s={}){var g,v;const a=Tu(g1,s),c={i:0},u=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!Ru(a.zIndexMode)?Cm:0;let m=t.length>0;r.clear(),i.clear();for(const y of t){let x=u.get(y.id);if(a.checkEquality&&y===(x==null?void 0:x.internals.userNode))r.set(y.id,x);else{const C=Ss(y,a.nodeOrigin),N=go(y.extent)?y.extent:a.nodeExtent,S=Ei(C,N,ur(y));x={...a.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(v=y.measured)==null?void 0:v.height},internals:{positionAbsolute:S,handleBounds:v1(y,x),z:_m(y,h,a.zIndexMode),userNode:y}},r.set(y.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(m=!1),y.parentId&&zu(x,r,i,s,c)}return m}function x1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function zu(t,r,i,s,a){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:h,zIndexMode:m}=Tu(Iu,s),g=t.parentId,v=r.get(g);if(!v){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}x1(t,i),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*m1),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const y=c&&!Ru(m)?Cm:0,{x,y:C,z:N}=w1(t,v,u,h,y,m),{positionAbsolute:S}=t.internals,_=x!==S.x||C!==S.y;(_||N!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:_?{x,y:C}:S,z:N}})}function _m(t,r,i){const s=jn(t.zIndex)?t.zIndex:0;return Ru(i)?s:s+(t.selected?r:0)}function w1(t,r,i,s,a,c){const{x:u,y:h}=r.internals.positionAbsolute,m=ur(t),g=Ss(t,i),v=go(t.extent)?Ei(g,t.extent,m):g;let y=Ei({x:u+v.x,y:h+v.y},s,m);t.extent==="parent"&&(y=dm(y,m,r));const x=_m(t,a,c),C=r.internals.z??0;return{x:y.x,y:y.y,z:C>=x?C+1:x}}function Au(t,r,i,s=[0,0]){var u;const a=[],c=new Map;for(const h of t){const m=r.get(h.parentId);if(!m)continue;const g=((u=c.get(h.parentId))==null?void 0:u.expandedRect)??mo(m),v=hm(g,h.rect);c.set(h.parentId,{expandedRect:v,parent:m})}return c.size>0&&c.forEach(({expandedRect:h,parent:m},g)=>{var k;const v=m.internals.positionAbsolute,y=ur(m),x=m.origin??s,C=h.x<v.x?Math.round(Math.abs(v.x-h.x)):0,N=h.y<v.y?Math.round(Math.abs(v.y-h.y)):0,S=Math.max(y.width,Math.round(h.width)),_=Math.max(y.height,Math.round(h.height)),E=(S-y.width)*x[0],P=(_-y.height)*x[1];(C>0||N>0||E||P)&&(a.push({id:g,type:"position",position:{x:m.position.x-C+E,y:m.position.y-N+P}}),(k=i.get(g))==null||k.forEach(j=>{t.some(F=>F.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+C,y:j.position.y+N}})})),(y.width<h.width||y.height<h.height||C||N)&&a.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:S+(C?x[0]*C-E:0),height:_+(N?x[1]*N-P:0)}})}),a}function S1(t,r,i,s,a,c,u){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let m=!1;if(!h)return{changes:[],updatedInternals:m};const g=[],v=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(v.transform),x=[];for(const C of t.values()){const N=r.get(C.id);if(!N)continue;if(N.hidden){r.set(N.id,{...N,internals:{...N.internals,handleBounds:void 0}}),m=!0;continue}const S=Pu(C.nodeElement),_=N.measured.width!==S.width||N.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!N.internals.handleBounds||C.force))){const P=C.nodeElement.getBoundingClientRect(),k=go(N.extent)?N.extent:c;let{positionAbsolute:j}=N.internals;N.parentId&&N.extent==="parent"?j=dm(j,S,r.get(N.parentId)):k&&(j=Ei(j,k,S));const F={...N,measured:S,internals:{...N.internals,positionAbsolute:j,handleBounds:{source:Ih("source",C.nodeElement,P,y,N.id),target:Ih("target",C.nodeElement,P,y,N.id)}}};r.set(N.id,F),N.parentId&&zu(F,r,i,{nodeOrigin:a,zIndexMode:u}),m=!0,_&&(g.push({id:N.id,type:"dimensions",dimensions:S}),N.expandParent&&N.parentId&&x.push({id:N.id,parentId:N.parentId,rect:mo(F,a)}))}}if(x.length>0){const C=Au(x,r,i,a);g.push(...C)}return{changes:g,updatedInternals:m}}async function k1({delta:t,panZoom:r,transform:i,translateExtent:s,width:a,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const u=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[a,c]],s),h=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(h)}function $h(t,r,i,s,a,c){let u=a;const h=s.get(u)||new Map;s.set(u,h.set(i,r)),u=`${a}-${t}`;const m=s.get(u)||new Map;if(s.set(u,m.set(i,r)),c){u=`${a}-${t}-${c}`;const g=s.get(u)||new Map;s.set(u,g.set(i,r))}}function jm(t,r,i){t.clear(),r.clear();for(const s of i){const{source:a,target:c,sourceHandle:u=null,targetHandle:h=null}=s,m={edgeId:s.id,source:a,target:c,sourceHandle:u,targetHandle:h},g=`${a}-${u}--${c}-${h}`,v=`${c}-${h}--${a}-${u}`;$h("source",m,v,t,a,u),$h("target",m,g,t,c,h),r.set(s.id,s)}}function bm(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:bm(i,r):!1}function Fh(t,r,i){var a;let s=t;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function N1(t,r,i,s){const a=new Map;for(const[c,u]of t)if((u.selected||u.id===s)&&(!u.parentId||!bm(u,t))&&(u.draggable||r&&typeof u.draggable>"u")){const h=t.get(c);h&&a.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return a}function Gc({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var u,h,m;const a=[];for(const[g,v]of r){const y=(u=i.get(g))==null?void 0:u.internals.userNode;y&&a.push({...y,position:v.position,dragging:s})}if(!t)return[a[0],a];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((m=r.get(t))==null?void 0:m.position)||c.position,dragging:s}:a[0],a]}function E1({dragItems:t,snapGrid:r,x:i,y:s}){const a=t.values().next().value;if(!a)return null;const c={x:i-a.distance.x,y:s-a.distance.y},u=Ns(c,r);return{x:u.x-c.x,y:u.y-c.y}}function C1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:a}){let c={x:null,y:null},u=0,h=new Map,m=!1,g={x:0,y:0},v=null,y=!1,x=null,C=!1,N=!1,S=null;function _({noDragClassName:P,handleSelector:k,domNode:j,isSelectable:F,nodeId:L,nodeClickDistance:B=0}){x=tn(j);function Z({x:G,y:te}){const{nodeLookup:z,nodeExtent:Q,snapGrid:W,snapToGrid:K,nodeOrigin:M,onNodeDrag:A,onSelectionDrag:Y,onError:I,updateNodePositions:$}=r();c={x:G,y:te};let se=!1;const le=h.size>1,de=le&&Q?fu(ks(h)):null,he=le&&K?E1({dragItems:h,snapGrid:W,x:G,y:te}):null;for(const[me,oe]of h){if(!z.has(me))continue;let pe={x:G-oe.distance.x,y:te-oe.distance.y};K&&(pe=he?{x:Math.round(pe.x+he.x),y:Math.round(pe.y+he.y)}:Ns(pe,W));let je=null;if(le&&Q&&!oe.extent&&de){const{positionAbsolute:Ne}=oe.internals,$e=Ne.x-de.x+Q[0][0],Fe=Ne.x+oe.measured.width-de.x2+Q[1][0],Ae=Ne.y-de.y+Q[0][1],et=Ne.y+oe.measured.height-de.y2+Q[1][1];je=[[$e,Ae],[Fe,et]]}const{position:Ie,positionAbsolute:ke}=um({nodeId:me,nextPosition:pe,nodeLookup:z,nodeExtent:je||Q,nodeOrigin:M,onError:I});se=se||oe.position.x!==Ie.x||oe.position.y!==Ie.y,oe.position=Ie,oe.internals.positionAbsolute=ke}if(N=N||se,!!se&&($(h,!0),S&&(s||A||!L&&Y))){const[me,oe]=Gc({nodeId:L,dragItems:h,nodeLookup:z});s==null||s(S,h,me,oe),A==null||A(S,me,oe),L||Y==null||Y(S,oe)}}async function V(){if(!v)return;const{transform:G,panBy:te,autoPanSpeed:z,autoPanOnNodeDrag:Q}=r();if(!Q){m=!1,cancelAnimationFrame(u);return}const[W,K]=fm(g,v,z);(W!==0||K!==0)&&(c.x=(c.x??0)-W/G[2],c.y=(c.y??0)-K/G[2],await te({x:W,y:K})&&Z(c)),u=requestAnimationFrame(V)}function J(G){var le;const{nodeLookup:te,multiSelectionActive:z,nodesDraggable:Q,transform:W,snapGrid:K,snapToGrid:M,selectNodesOnDrag:A,onNodeDragStart:Y,onSelectionDragStart:I,unselectNodesAndEdges:$}=r();y=!0,(!A||!F)&&!z&&L&&((le=te.get(L))!=null&&le.selected||$()),F&&A&&L&&(t==null||t(L));const se=ls(G.sourceEvent,{transform:W,snapGrid:K,snapToGrid:M,containerBounds:v});if(c=se,h=N1(te,Q,se,L),h.size>0&&(i||Y||!L&&I)){const[de,he]=Gc({nodeId:L,dragItems:h,nodeLookup:te});i==null||i(G.sourceEvent,h,de,he),Y==null||Y(G.sourceEvent,de,he),L||I==null||I(G.sourceEvent,he)}}const U=Vp().clickDistance(B).on("start",G=>{const{domNode:te,nodeDragThreshold:z,transform:Q,snapGrid:W,snapToGrid:K}=r();v=(te==null?void 0:te.getBoundingClientRect())||null,C=!1,N=!1,S=G.sourceEvent,z===0&&J(G),c=ls(G.sourceEvent,{transform:Q,snapGrid:W,snapToGrid:K,containerBounds:v}),g=bn(G.sourceEvent,v)}).on("drag",G=>{const{autoPanOnNodeDrag:te,transform:z,snapGrid:Q,snapToGrid:W,nodeDragThreshold:K,nodeLookup:M}=r(),A=ls(G.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:W,containerBounds:v});if(S=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||L&&!M.has(L))&&(C=!0),!C){if(!m&&te&&y&&(m=!0,V()),!y){const Y=bn(G.sourceEvent,v),I=Y.x-g.x,$=Y.y-g.y;Math.sqrt(I*I+$*$)>K&&J(G)}(c.x!==A.xSnapped||c.y!==A.ySnapped)&&h&&y&&(g=bn(G.sourceEvent,v),Z(A))}}).on("end",G=>{if(!(!y||C)&&(m=!1,y=!1,cancelAnimationFrame(u),h.size>0)){const{nodeLookup:te,updateNodePositions:z,onNodeDragStop:Q,onSelectionDragStop:W}=r();if(N&&(z(h,!1),N=!1),a||Q||!L&&W){const[K,M]=Gc({nodeId:L,dragItems:h,nodeLookup:te,dragging:!1});a==null||a(G.sourceEvent,h,K,M),Q==null||Q(G.sourceEvent,K,M),L||W==null||W(G.sourceEvent,M)}}}).filter(G=>{const te=G.target;return!G.button&&(!P||!Fh(te,`.${P}`,j))&&(!k||Fh(te,k,j))});x.call(U)}function E(){x==null||x.on(".drag",null)}return{update:_,destroy:E}}function _1(t,r,i){const s=[],a={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())ms(a,mo(c))>0&&s.push(c);return s}const j1=250;function b1(t,r,i,s){var h,m;let a=[],c=1/0;const u=_1(t,i,r+j1);for(const g of u){const v=[...((h=g.internals.handleBounds)==null?void 0:h.source)??[],...((m=g.internals.handleBounds)==null?void 0:m.target)??[]];for(const y of v){if(s.nodeId===y.nodeId&&s.type===y.type&&s.id===y.id)continue;const{x,y:C}=Ci(g,y,y.position,!0),N=Math.sqrt(Math.pow(x-t.x,2)+Math.pow(C-t.y,2));N>r||(N<c?(a=[{...y,x,y:C}],c=N):N===c&&a.push({...y,x,y:C}))}}if(!a.length)return null;if(a.length>1){const g=s.type==="source"?"target":"source";return a.find(v=>v.type===g)??a[0]}return a[0]}function Mm(t,r,i,s,a,c=!1){var g,v,y;const u=s.get(t);if(!u)return null;const h=a==="strict"?(g=u.internals.handleBounds)==null?void 0:g[r]:[...((v=u.internals.handleBounds)==null?void 0:v.source)??[],...((y=u.internals.handleBounds)==null?void 0:y.target)??[]],m=(i?h==null?void 0:h.find(x=>x.id===i):h==null?void 0:h[0])??null;return m&&c?{...m,...Ci(u,m,m.position,!0)}:m}function Pm(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function M1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const Im=()=>!0;function P1(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:a,edgeUpdaterType:c,isTarget:u,domNode:h,nodeLookup:m,lib:g,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:C,onConnectStart:N,onConnect:S,onConnectEnd:_,isValidConnection:E=Im,onReconnectEnd:P,updateConnection:k,getTransform:j,getFromHandle:F,autoPanSpeed:L,dragThreshold:B=1,handleDomNode:Z}){const V=gm(t.target);let J=0,U;const{x:G,y:te}=bn(t),z=Pm(c,Z),Q=h==null?void 0:h.getBoundingClientRect();let W=!1;if(!Q||!z)return;const K=Mm(a,z,s,m,r);if(!K)return;let M=bn(t,Q),A=!1,Y=null,I=!1,$=null;function se(){if(!v||!Q)return;const[Ie,ke]=fm(M,Q,L);x({x:Ie,y:ke}),J=requestAnimationFrame(se)}const le={...K,nodeId:a,type:z,position:K.position},de=m.get(a);let me={inProgress:!0,isValid:null,from:Ci(de,le,Ce.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:de,to:M,toHandle:null,toPosition:jh[le.position],toNode:null,pointer:M};function oe(){W=!0,k(me),N==null||N(t,{nodeId:a,handleId:s,handleType:z})}B===0&&oe();function pe(Ie){if(!W){const{x:et,y:St}=bn(Ie),kt=et-G,ht=St-te;if(!(kt*kt+ht*ht>B*B))return;oe()}if(!F()||!le){je(Ie);return}const ke=j();M=bn(Ie,Q),U=b1(Es(M,ke,!1,[1,1]),i,m,le),A||(se(),A=!0);const Ne=Tm(Ie,{handle:U,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:u?"target":"source",isValidConnection:E,doc:V,lib:g,flowId:y,nodeLookup:m});$=Ne.handleDomNode,Y=Ne.connection,I=M1(!!U,Ne.isValid);const $e=m.get(a),Fe=$e?Ci($e,le,Ce.Left,!0):me.from,Ae={...me,from:Fe,isValid:I,to:Ne.toHandle&&I?Kl({x:Ne.toHandle.x,y:Ne.toHandle.y},ke):M,toHandle:Ne.toHandle,toPosition:I&&Ne.toHandle?Ne.toHandle.position:jh[le.position],toNode:Ne.toHandle?m.get(Ne.toHandle.nodeId):null,pointer:M};k(Ae),me=Ae}function je(Ie){if(!("touches"in Ie&&Ie.touches.length>0)){if(W){(U||$)&&Y&&I&&(S==null||S(Y));const{inProgress:ke,...Ne}=me,$e={...Ne,toPosition:me.toHandle?me.toPosition:null};_==null||_(Ie,$e),c&&(P==null||P(Ie,$e))}C(),cancelAnimationFrame(J),A=!1,I=!1,Y=null,$=null,V.removeEventListener("mousemove",pe),V.removeEventListener("mouseup",je),V.removeEventListener("touchmove",pe),V.removeEventListener("touchend",je)}}V.addEventListener("mousemove",pe),V.addEventListener("mouseup",je),V.addEventListener("touchmove",pe),V.addEventListener("touchend",je)}function Tm(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:a,fromType:c,doc:u,lib:h,flowId:m,isValidConnection:g=Im,nodeLookup:v}){const y=c==="target",x=r?u.querySelector(`.${h}-flow__handle[data-id="${m}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:N}=bn(t),S=u.elementFromPoint(C,N),_=S!=null&&S.classList.contains(`${h}-flow__handle`)?S:x,E={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const P=Pm(void 0,_),k=_.getAttribute("data-nodeid"),j=_.getAttribute("data-handleid"),F=_.classList.contains("connectable"),L=_.classList.contains("connectableend");if(!k||!P)return E;const B={source:y?k:s,sourceHandle:y?j:a,target:y?s:k,targetHandle:y?a:j};E.connection=B;const V=F&&L&&(i===Ni.Strict?y&&P==="source"||!y&&P==="target":k!==s||j!==a);E.isValid=V&&g(B),E.toHandle=Mm(k,P,j,v,i,!0)}return E}const gu={onPointerDown:P1,isValid:Tm};function I1({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const a=tn(t);function c({translateExtent:h,width:m,height:g,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:C=!1}){const N=k=>{if(k.sourceEvent.type!=="wheel"||!r)return;const j=i(),F=k.sourceEvent.ctrlKey&&gs()?10:1,L=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*v,B=j[2]*Math.pow(2,L*F);r.scaleTo(B)};let S=[0,0];const _=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(S=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},E=k=>{const j=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!r)return;const F=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],L=[F[0]-S[0],F[1]-S[1]];S=F;const B=s()*Math.max(j[2],Math.log(j[2]))*(C?-1:1),Z={x:j[0]-L[0]*B,y:j[1]-L[1]*B},V=[[0,0],[m,g]];r.setViewportConstrained({x:Z.x,y:Z.y,zoom:j[2]},V,h)},P=im().on("start",_).on("zoom",y?E:null).on("zoom.wheel",x?N:null);a.call(P,{})}function u(){a.on("zoom",null)}return{update:c,destroy:u,pointer:Cn}}const sa=t=>({x:t.x,y:t.y,zoom:t.k}),Kc=({x:t,y:r,zoom:i})=>ra.translate(t,r).scale(i),lo=(t,r)=>t.target.closest(`.${r}`),Rm=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),T1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Qc=(t,r=0,i=T1,s=()=>{})=>{const a=typeof r=="number"&&r>0;return a||s(),a?t.transition().duration(r).ease(i).on("end",s):t},zm=t=>{const r=t.ctrlKey&&gs()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function R1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:g}){return v=>{if(lo(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=i.property("__zoom").k||1;if(v.ctrlKey&&u){const _=Cn(v),E=zm(v),P=y*Math.pow(2,E);s.scaleTo(i,P,_,v);return}const x=v.deltaMode===1?20:1;let C=a===xi.Vertical?0:v.deltaX*x,N=a===xi.Horizontal?0:v.deltaY*x;!gs()&&v.shiftKey&&a!==xi.Vertical&&(C=v.deltaY*x,N=0),s.translateBy(i,-(C/y)*c,-(N/y)*c,{internal:!0});const S=sa(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(v,S),t.panScrollTimeout=setTimeout(()=>{g==null||g(v,S),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(v,S))}}function z1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,a){const c=s.type==="wheel",u=!r&&c&&!s.ctrlKey,h=lo(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),u||h)return null;s.preventDefault(),i.call(this,s,a)}}function A1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,u,h;if((c=s.sourceEvent)!=null&&c.internal)return;const a=sa(s.transform);t.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,a))}}function L1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:a}){return c=>{var u,h;t.usedRightMouseButton=!!(i&&Rm(r,t.mouseButton??0)),(u=c.sourceEvent)!=null&&u.sync||s([c.transform.x,c.transform.y,c.transform.k]),a&&!((h=c.sourceEvent)!=null&&h.internal)&&(a==null||a(c.sourceEvent,sa(c.transform)))}}function D1({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:c}){return u=>{var h;if(!((h=u.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&Rm(r,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=sa(u.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,m)},i?150:0)}}}function $1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:h,noPanClassName:m,lib:g,connectionInProgress:v}){return y=>{var _;const x=t||r,C=i&&y.ctrlKey,N=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(lo(y,`${g}-flow__node`)||lo(y,`${g}-flow__edge`)))return!0;if(!s&&!x&&!a&&!c&&!i||u||v&&!N||lo(y,h)&&N||lo(y,m)&&(!N||a&&N&&!t)||!i&&y.ctrlKey&&N)return!1;if(!i&&y.type==="touchstart"&&((_=y.touches)==null?void 0:_.length)>1)return y.preventDefault(),!1;if(!x&&!a&&!C&&N||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const S=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||N)&&S}}function F1({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:a,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:h,onDraggingChange:m}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),y=im().scaleExtent([r,i]).translateExtent(s),x=tn(t).call(y);P({x:a.x,y:a.y,zoom:po(a.zoom,r,i)},[[0,0],[v.width,v.height]],s);const C=x.on("wheel.zoom"),N=x.on("dblclick.zoom");y.wheelDelta(zm);function S(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?ss:Dl).transform(Qc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function _({noWheelClassName:U,noPanClassName:G,onPaneContextMenu:te,userSelectionActive:z,panOnScroll:Q,panOnDrag:W,panOnScrollMode:K,panOnScrollSpeed:M,preventScrolling:A,zoomOnPinch:Y,zoomOnScroll:I,zoomOnDoubleClick:$,zoomActivationKeyPressed:se,lib:le,onTransformChange:de,connectionInProgress:he,paneClickDistance:me,selectionOnDrag:oe}){z&&!g.isZoomingOrPanning&&E();const pe=Q&&!se&&!z;y.clickDistance(oe?1/0:!jn(me)||me<0?0:me);const je=pe?R1({zoomPanValues:g,noWheelClassName:U,d3Selection:x,d3Zoom:y,panOnScrollMode:K,panOnScrollSpeed:M,zoomOnPinch:Y,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):z1({noWheelClassName:U,preventScrolling:A,d3ZoomHandler:C});if(x.on("wheel.zoom",je,{passive:!1}),!z){const ke=A1({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:u});y.on("start",ke);const Ne=L1({zoomPanValues:g,panOnDrag:W,onPaneContextMenu:!!te,onPanZoom:c,onTransformChange:de});y.on("zoom",Ne);const $e=D1({zoomPanValues:g,panOnDrag:W,panOnScroll:Q,onPaneContextMenu:te,onPanZoomEnd:h,onDraggingChange:m});y.on("end",$e)}const Ie=$1({zoomActivationKeyPressed:se,panOnDrag:W,zoomOnScroll:I,panOnScroll:Q,zoomOnDoubleClick:$,zoomOnPinch:Y,userSelectionActive:z,noPanClassName:G,noWheelClassName:U,lib:le,connectionInProgress:he});y.filter(Ie),$?x.on("dblclick.zoom",N):x.on("dblclick.zoom",null)}function E(){y.on("zoom",null)}async function P(U,G,te){const z=Kc(U),Q=y==null?void 0:y.constrain()(z,G,te);return Q&&await S(Q),new Promise(W=>W(Q))}async function k(U,G){const te=Kc(U);return await S(te,G),new Promise(z=>z(te))}function j(U){if(x){const G=Kc(U),te=x.property("__zoom");(te.k!==U.zoom||te.x!==U.x||te.y!==U.y)&&(y==null||y.transform(x,G,null,{sync:!0}))}}function F(){const U=x?rm(x.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function L(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?ss:Dl).scaleTo(Qc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function B(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?ss:Dl).scaleBy(Qc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function Z(U){y==null||y.scaleExtent(U)}function V(U){y==null||y.translateExtent(U)}function J(U){const G=!jn(U)||U<0?0:U;y==null||y.clickDistance(G)}return{update:_,destroy:E,setViewport:k,setViewportConstrained:P,getViewport:F,scaleTo:L,scaleBy:B,setScaleExtent:Z,setTranslateExtent:V,syncViewport:j,setClickDistance:J}}var _i;(function(t){t.Line="line",t.Handle="handle"})(_i||(_i={}));const O1=["top-left","top-right","bottom-left","bottom-right"],H1=["top","right","bottom","left"];function B1({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:a,affectsY:c}){const u=t-r,h=i-s,m=[u>0?1:u<0?-1:0,h>0?1:h<0?-1:0];return u&&a&&(m[0]=m[0]*-1),h&&c&&(m[1]=m[1]*-1),m}function Oh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),a=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:a}}function Hr(t,r){return Math.max(0,r-t)}function Br(t,r){return Math.max(0,t-r)}function Rl(t,r,i){return Math.max(0,r-t,t-i)}function Hh(t,r){return t?!r:r}function V1(t,r,i,s,a,c,u,h){let{affectsX:m,affectsY:g}=r;const{isHorizontal:v,isVertical:y}=r,x=v&&y,{xSnapped:C,ySnapped:N}=i,{minWidth:S,maxWidth:_,minHeight:E,maxHeight:P}=s,{x:k,y:j,width:F,height:L,aspectRatio:B}=t;let Z=Math.floor(v?C-t.pointerX:0),V=Math.floor(y?N-t.pointerY:0);const J=F+(m?-Z:Z),U=L+(g?-V:V),G=-c[0]*F,te=-c[1]*L;let z=Rl(J,S,_),Q=Rl(U,E,P);if(u){let M=0,A=0;m&&Z<0?M=Hr(k+Z+G,u[0][0]):!m&&Z>0&&(M=Br(k+J+G,u[1][0])),g&&V<0?A=Hr(j+V+te,u[0][1]):!g&&V>0&&(A=Br(j+U+te,u[1][1])),z=Math.max(z,M),Q=Math.max(Q,A)}if(h){let M=0,A=0;m&&Z>0?M=Br(k+Z,h[0][0]):!m&&Z<0&&(M=Hr(k+J,h[1][0])),g&&V>0?A=Br(j+V,h[0][1]):!g&&V<0&&(A=Hr(j+U,h[1][1])),z=Math.max(z,M),Q=Math.max(Q,A)}if(a){if(v){const M=Rl(J/B,E,P)*B;if(z=Math.max(z,M),u){let A=0;!m&&!g||m&&!g&&x?A=Br(j+te+J/B,u[1][1])*B:A=Hr(j+te+(m?Z:-Z)/B,u[0][1])*B,z=Math.max(z,A)}if(h){let A=0;!m&&!g||m&&!g&&x?A=Hr(j+J/B,h[1][1])*B:A=Br(j+(m?Z:-Z)/B,h[0][1])*B,z=Math.max(z,A)}}if(y){const M=Rl(U*B,S,_)/B;if(Q=Math.max(Q,M),u){let A=0;!m&&!g||g&&!m&&x?A=Br(k+U*B+G,u[1][0])/B:A=Hr(k+(g?V:-V)*B+G,u[0][0])/B,Q=Math.max(Q,A)}if(h){let A=0;!m&&!g||g&&!m&&x?A=Hr(k+U*B,h[1][0])/B:A=Br(k+(g?V:-V)*B,h[0][0])/B,Q=Math.max(Q,A)}}}V=V+(V<0?Q:-Q),Z=Z+(Z<0?z:-z),a&&(x?J>U*B?V=(Hh(m,g)?-Z:Z)/B:Z=(Hh(m,g)?-V:V)*B:v?(V=Z/B,g=m):(Z=V*B,m=g));const W=m?k+Z:k,K=g?j+V:j;return{width:F+(m?-Z:Z),height:L+(g?-V:V),x:c[0]*Z*(m?-1:1)+W,y:c[1]*V*(g?-1:1)+K}}const Am={width:0,height:0,x:0,y:0},W1={...Am,pointerX:0,pointerY:0,aspectRatio:1};function U1(t){return[[0,0],[t.measured.width,t.measured.height]]}function Y1(t,r,i){const s=r.position.x+t.position.x,a=r.position.y+t.position.y,c=t.measured.width??0,u=t.measured.height??0,h=i[0]*c,m=i[1]*u;return[[s-h,a-m],[s+c-h,a+u-m]]}function X1({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:a}){const c=tn(t);let u={controlDirection:Oh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:g,boundaries:v,keepAspectRatio:y,resizeDirection:x,onResizeStart:C,onResize:N,onResizeEnd:S,shouldResize:_}){let E={...Am},P={...W1};u={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:Oh(g)};let k,j=null,F=[],L,B,Z,V=!1;const J=Vp().on("start",U=>{const{nodeLookup:G,transform:te,snapGrid:z,snapToGrid:Q,nodeOrigin:W,paneDomNode:K}=i();if(k=G.get(r),!k)return;j=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:A}=ls(U.sourceEvent,{transform:te,snapGrid:z,snapToGrid:Q,containerBounds:j});E={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},P={...E,pointerX:M,pointerY:A,aspectRatio:E.width/E.height},L=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(L=G.get(k.parentId),B=L&&k.extent==="parent"?U1(L):void 0),F=[],Z=void 0;for(const[Y,I]of G)if(I.parentId===r&&(F.push({id:Y,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const $=Y1(I,k,I.origin??W);Z?Z=[[Math.min($[0][0],Z[0][0]),Math.min($[0][1],Z[0][1])],[Math.max($[1][0],Z[1][0]),Math.max($[1][1],Z[1][1])]]:Z=$}C==null||C(U,{...E})}).on("drag",U=>{const{transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q}=i(),W=ls(U.sourceEvent,{transform:G,snapGrid:te,snapToGrid:z,containerBounds:j}),K=[];if(!k)return;const{x:M,y:A,width:Y,height:I}=E,$={},se=k.origin??Q,{width:le,height:de,x:he,y:me}=V1(P,u.controlDirection,W,u.boundaries,u.keepAspectRatio,se,B,Z),oe=le!==Y,pe=de!==I,je=he!==M&&oe,Ie=me!==A&&pe;if(!je&&!Ie&&!oe&&!pe)return;if((je||Ie||se[0]===1||se[1]===1)&&($.x=je?he:E.x,$.y=Ie?me:E.y,E.x=$.x,E.y=$.y,F.length>0)){const Fe=he-M,Ae=me-A;for(const et of F)et.position={x:et.position.x-Fe+se[0]*(le-Y),y:et.position.y-Ae+se[1]*(de-I)},K.push(et)}if((oe||pe)&&($.width=oe&&(!u.resizeDirection||u.resizeDirection==="horizontal")?le:E.width,$.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?de:E.height,E.width=$.width,E.height=$.height),L&&k.expandParent){const Fe=se[0]*($.width??0);$.x&&$.x<Fe&&(E.x=Fe,P.x=P.x-($.x-Fe));const Ae=se[1]*($.height??0);$.y&&$.y<Ae&&(E.y=Ae,P.y=P.y-($.y-Ae))}const ke=B1({width:E.width,prevWidth:Y,height:E.height,prevHeight:I,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={...E,direction:ke};(_==null?void 0:_(U,Ne))!==!1&&(V=!0,N==null||N(U,Ne),s($,K))}).on("end",U=>{V&&(S==null||S(U,{...E}),a==null||a({...E}),V=!1)});c.call(J)}function m(){c.on(".drag",null)}return{update:h,destroy:m}}var qc={exports:{}},Zc={},Jc={exports:{}},eu={};/**
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 Bh;function G1(){if(Bh)return eu;Bh=1;var t=vs();function r(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,a=t.useEffect,c=t.useLayoutEffect,u=t.useDebugValue;function h(y,x){var C=x(),N=s({inst:{value:C,getSnapshot:x}}),S=N[0].inst,_=N[1];return c(function(){S.value=C,S.getSnapshot=x,m(S)&&_({inst:S})},[y,C,x]),a(function(){return m(S)&&_({inst:S}),y(function(){m(S)&&_({inst:S})})},[y]),u(C),C}function m(y){var x=y.getSnapshot;y=y.value;try{var C=x();return!i(y,C)}catch{return!0}}function g(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return eu.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,eu}var Vh;function K1(){return Vh||(Vh=1,Jc.exports=G1()),Jc.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 Wh;function Q1(){if(Wh)return Zc;Wh=1;var t=vs(),r=K1();function i(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var s=typeof Object.is=="function"?Object.is:i,a=r.useSyncExternalStore,c=t.useRef,u=t.useEffect,h=t.useMemo,m=t.useDebugValue;return Zc.useSyncExternalStoreWithSelector=function(g,v,y,x,C){var N=c(null);if(N.current===null){var S={hasValue:!1,value:null};N.current=S}else S=N.current;N=h(function(){function E(L){if(!P){if(P=!0,k=L,L=x(L),C!==void 0&&S.hasValue){var B=S.value;if(C(B,L))return j=B}return j=L}if(B=j,s(k,L))return B;var Z=x(L);return C!==void 0&&C(B,Z)?(k=L,B):(k=L,j=Z)}var P=!1,k,j,F=y===void 0?null:y;return[function(){return E(v())},F===null?void 0:function(){return E(F())}]},[v,y,x,C]);var _=a(g,N[0],N[1]);return u(function(){S.hasValue=!0,S.value=_},[_]),m(_),_},Zc}var Uh;function q1(){return Uh||(Uh=1,qc.exports=Q1()),qc.exports}var Z1=q1();const J1=xu(Z1),eS={},Yh=t=>{let r;const i=new Set,s=(v,y)=>{const x=typeof v=="function"?v(r):v;if(!Object.is(x,r)){const C=r;r=y??(typeof x!="object"||x===null)?x:Object.assign({},r,x),i.forEach(N=>N(r,C))}},a=()=>r,m={setState:s,getState:a,getInitialState:()=>g,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(eS?"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."),i.clear()}},g=r=t(s,a,m);return m},tS=t=>t?Yh(t):Yh,{useDebugValue:nS}=jp,{useSyncExternalStoreWithSelector:rS}=J1,iS=t=>t;function Lm(t,r=iS,i){const s=rS(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return nS(s),s}const Xh=(t,r)=>{const i=tS(t),s=(a,c=r)=>Lm(i,a,c);return Object.assign(s,i),s},oS=(t,r)=>t?Xh(t,r):Xh;function Ze(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,a]of t)if(!Object.is(a,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}bp();const la=b.createContext(null),sS=la.Provider,Dm=Gn.error001();function Oe(t,r){const i=b.useContext(la);if(i===null)throw new Error(Dm);return Lm(i,t,r)}function Je(){const t=b.useContext(la);if(t===null)throw new Error(Dm);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Gh={display:"none"},lS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$m="react-flow__node-desc",Fm="react-flow__edge-desc",aS="react-flow__aria-live",cS=t=>t.ariaLiveMessage,uS=t=>t.ariaLabelConfig;function dS({rfId:t}){const r=Oe(cS);return d.jsx("div",{id:`${aS}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:lS,children:r})}function fS({rfId:t,disableKeyboardA11y:r}){const i=Oe(uS);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${$m}-${t}`,style:Gh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${Fm}-${t}`,style:Gh,children:i["edge.a11yDescription.default"]}),!r&&d.jsx(dS,{rfId:t})]})}const aa=b.forwardRef(({position:t="top-left",children:r,className:i,style:s,...a},c)=>{const u=`${t}`.split("-");return d.jsx("div",{className:ut(["react-flow__panel",i,...u]),style:s,ref:c,...a,children:r})});aa.displayName="Panel";function hS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:d.jsx(aa,{position:r,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 pS=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},zl=t=>t.id;function mS(t,r){return Ze(t.selectedNodes.map(zl),r.selectedNodes.map(zl))&&Ze(t.selectedEdges.map(zl),r.selectedEdges.map(zl))}function gS({onSelectionChange:t}){const r=Je(),{selectedNodes:i,selectedEdges:s}=Oe(pS,mS);return b.useEffect(()=>{const a={nodes:i,edges:s};t==null||t(a),r.getState().onSelectionChangeHandlers.forEach(c=>c(a))},[i,s,t]),null}const yS=t=>!!t.onSelectionChangeHandlers;function vS({onSelectionChange:t}){const r=Oe(yS);return t||r?d.jsx(gS,{onSelectionChange:t}):null}const Om=[0,0],xS={x:0,y:0,zoom:1},wS=["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"],Kh=[...wS,"rfId"],SS=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Qh={translateExtent:fs,nodeOrigin:Om,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kS(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:c,setNodeExtent:u,reset:h,setDefaultNodesAndEdges:m}=Oe(SS,Ze),g=Je();b.useEffect(()=>(m(t.defaultNodes,t.defaultEdges),()=>{v.current=Qh,h()}),[]);const v=b.useRef(Qh);return b.useEffect(()=>{for(const y of Kh){const x=t[y],C=v.current[y];x!==C&&(typeof t[y]>"u"||(y==="nodes"?r(x):y==="edges"?i(x):y==="minZoom"?s(x):y==="maxZoom"?a(x):y==="translateExtent"?c(x):y==="nodeExtent"?u(x):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:i1(x)}):y==="fitView"?g.setState({fitViewQueued:x}):y==="fitViewOptions"?g.setState({fitViewOptions:x}):g.setState({[y]:x})))}v.current=t},Kh.map(y=>t[y])),null}function qh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function NS(t){var s;const[r,i]=b.useState(t==="system"?null:t);return b.useEffect(()=>{if(t!=="system"){i(t);return}const a=qh(),c=()=>i(a!=null&&a.matches?"dark":"light");return c(),a==null||a.addEventListener("change",c),()=>{a==null||a.removeEventListener("change",c)}},[t]),r!==null?r:(s=qh())!=null&&s.matches?"dark":"light"}const Zh=typeof document<"u"?document:null;function ys(t=null,r={target:Zh,actInsideInputWithModifier:!0}){const[i,s]=b.useState(!1),a=b.useRef(!1),c=b.useRef(new Set([])),[u,h]=b.useMemo(()=>{if(t!==null){const g=(Array.isArray(t)?t:[t]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),v=g.reduce((y,x)=>y.concat(...x),[]);return[g,v]}return[[],[]]},[t]);return b.useEffect(()=>{const m=(r==null?void 0:r.target)??Zh,g=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const v=C=>{var _,E;if(a.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!a.current||a.current&&!g)&&ym(C))return!1;const S=ep(C.code,h);if(c.current.add(C[S]),Jh(u,c.current,!1)){const P=((E=(_=C.composedPath)==null?void 0:_.call(C))==null?void 0:E[0])||C.target,k=(P==null?void 0:P.nodeName)==="BUTTON"||(P==null?void 0:P.nodeName)==="A";r.preventDefault!==!1&&(a.current||!k)&&C.preventDefault(),s(!0)}},y=C=>{const N=ep(C.code,h);Jh(u,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[N]),C.key==="Meta"&&c.current.clear(),a.current=!1},x=()=>{c.current.clear(),s(!1)};return m==null||m.addEventListener("keydown",v),m==null||m.addEventListener("keyup",y),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{m==null||m.removeEventListener("keydown",v),m==null||m.removeEventListener("keyup",y),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[t,s]),i}function Jh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(a=>r.has(a)))}function ep(t,r){return r.includes(t)?"code":"key"}const ES=()=>{const t=Je();return b.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,{duration:i==null?void 0:i.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,a,c],panZoom:u}=t.getState();return u?(await u.setViewport({x:r.x??s,y:r.y??a,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:a,minZoom:c,maxZoom:u,panZoom:h}=t.getState(),m=Mu(r,s,a,c,u,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(m,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:a,snapToGrid:c,domNode:u}=t.getState();if(!u)return r;const{x:h,y:m}=u.getBoundingClientRect(),g={x:r.x-h,y:r.y-m},v=i.snapGrid??a,y=i.snapToGrid??c;return Es(g,s,y,v)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:a,y:c}=s.getBoundingClientRect(),u=Kl(r,i);return{x:u.x+a,y:u.y+c}}}),[])};function Hm(t,r){const i=[],s=new Map,a=[];for(const c of t)if(c.type==="add"){a.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const u=s.get(c.id);u?u.push(c):s.set(c.id,[c])}for(const c of r){const u=s.get(c.id);if(!u){i.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const h={...c};for(const m of u)CS(m,h);i.push(h)}return a.length&&a.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function CS(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Bm(t,r){return Hm(t,r)}function Vm(t,r){return Hm(t,r)}function gi(t,r){return{id:t,type:"select",selected:r}}function ao(t,r=new Set,i=!1){const s=[];for(const[a,c]of t){const u=r.has(a);!(c.selected===void 0&&!u)&&c.selected!==u&&(i&&(c.selected=u),s.push(gi(c.id,u)))}return s}function tp({items:t=[],lookup:r}){var a;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,u]of t.entries()){const h=r.get(u.id),m=((a=h==null?void 0:h.internals)==null?void 0:a.userNode)??h;m!==void 0&&m!==u&&i.push({id:u.id,item:u,type:"replace"}),m===void 0&&i.push({item:u,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function np(t){return{id:t.id,type:"remove"}}const rp=t=>Gw(t),_S=t=>cm(t);function Wm(t){return b.forwardRef(t)}const jS=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ip(t){const[r,i]=b.useState(BigInt(0)),[s]=b.useState(()=>bS(()=>i(a=>a+BigInt(1))));return jS(()=>{const a=s.get();a.length&&(t(a),s.reset())},[r]),s}function bS(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Um=b.createContext(null);function MS({children:t}){const r=Je(),i=b.useCallback(h=>{const{nodes:m=[],setNodes:g,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:C,onNodesChangeMiddlewareMap:N}=r.getState();let S=m;for(const E of h)S=typeof E=="function"?E(S):E;let _=tp({items:S,lookup:x});for(const E of N.values())_=E(_);v&&g(S),_.length>0?y==null||y(_):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:P,setNodes:k}=r.getState();E&&k(P)})},[]),s=ip(i),a=b.useCallback(h=>{const{edges:m=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=r.getState();let C=m;for(const N of h)C=typeof N=="function"?N(C):N;v?g(C):y&&y(tp({items:C,lookup:x}))},[]),c=ip(a),u=b.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return d.jsx(Um.Provider,{value:u,children:t})}function PS(){const t=b.useContext(Um);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const IS=t=>!!t.panZoom;function Lu(){const t=ES(),r=Je(),i=PS(),s=Oe(IS),a=b.useMemo(()=>{const c=y=>r.getState().nodeLookup.get(y),u=y=>{i.nodeQueue.push(y)},h=y=>{i.edgeQueue.push(y)},m=y=>{var E,P;const{nodeLookup:x,nodeOrigin:C}=r.getState(),N=rp(y)?y:x.get(y.id),S=N.parentId?mm(N.position,N.measured,N.parentId,x,C):N.position,_={...N,position:S,width:((E=N.measured)==null?void 0:E.width)??N.width,height:((P=N.measured)==null?void 0:P.height)??N.height};return mo(_)},g=(y,x,C={replace:!1})=>{u(N=>N.map(S=>{if(S.id===y){const _=typeof x=="function"?x(S):x;return C.replace&&rp(_)?_:{...S,..._}}return S}))},v=(y,x,C={replace:!1})=>{h(N=>N.map(S=>{if(S.id===y){const _=typeof x=="function"?x(S):x;return C.replace&&_S(_)?_:{...S,..._}}return S}))};return{getNodes:()=>r.getState().nodes.map(y=>({...y})),getNode:y=>{var x;return(x=c(y))==null?void 0:x.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:y=[]}=r.getState();return y.map(x=>({...x}))},getEdge:y=>r.getState().edgeLookup.get(y),setNodes:u,setEdges:h,addNodes:y=>{const x=Array.isArray(y)?y:[y];i.nodeQueue.push(C=>[...C,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];i.edgeQueue.push(C=>[...C,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:C}=r.getState(),[N,S,_]=C;return{nodes:y.map(E=>({...E})),edges:x.map(E=>({...E})),viewport:{x:N,y:S,zoom:_}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:C,edges:N,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:E,triggerEdgeChanges:P,onDelete:k,onBeforeDelete:j}=r.getState(),{nodes:F,edges:L}=await Jw({nodesToRemove:y,edgesToRemove:x,nodes:C,edges:N,onBeforeDelete:j}),B=L.length>0,Z=F.length>0;if(B){const V=L.map(np);_==null||_(L),P(V)}if(Z){const V=F.map(np);S==null||S(F),E(V)}return(Z||B)&&(k==null||k({nodes:F,edges:L})),{deletedNodes:F,deletedEdges:L}},getIntersectingNodes:(y,x=!0,C)=>{const N=Mh(y),S=N?y:m(y),_=C!==void 0;return S?(C||r.getState().nodes).filter(E=>{const P=r.getState().nodeLookup.get(E.id);if(P&&!N&&(E.id===y.id||!P.internals.positionAbsolute))return!1;const k=mo(_?E:P),j=ms(k,S);return x&&j>0||j>=k.width*k.height||j>=S.width*S.height}):[]},isNodeIntersecting:(y,x,C=!0)=>{const S=Mh(y)?y:m(y);if(!S)return!1;const _=ms(S,x);return C&&_>0||_>=x.width*x.height||_>=S.width*S.height},updateNode:g,updateNodeData:(y,x,C={replace:!1})=>{g(y,N=>{const S=typeof x=="function"?x(N):x;return C.replace?{...N,data:S}:{...N,data:{...N.data,...S}}},C)},updateEdge:v,updateEdgeData:(y,x,C={replace:!1})=>{v(y,N=>{const S=typeof x=="function"?x(N):x;return C.replace?{...N,data:S}:{...N,data:{...N.data,...S}}},C)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:C}=r.getState();return Kw(y,{nodeLookup:x,nodeOrigin:C})},getHandleConnections:({type:y,id:x,nodeId:C})=>{var N;return Array.from(((N=r.getState().connectionLookup.get(`${C}-${y}${x?`-${x}`:""}`))==null?void 0:N.values())??[])},getNodeConnections:({type:y,handleId:x,nodeId:C})=>{var N;return Array.from(((N=r.getState().connectionLookup.get(`${C}${y?x?`-${y}-${x}`:`-${y}`:""}`))==null?void 0:N.values())??[])},fitView:async y=>{const x=r.getState().fitViewResolver??r1();return r.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),i.nodeQueue.push(C=>[...C]),x.promise}}},[]);return b.useMemo(()=>({...a,...t,viewportInitialized:s}),[s])}const op=t=>t.selected,TS=typeof window<"u"?window:void 0;function RS({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Je(),{deleteElements:s}=Lu(),a=ys(t,{actInsideInputWithModifier:!1}),c=ys(r,{target:TS});b.useEffect(()=>{if(a){const{edges:u,nodes:h}=i.getState();s({nodes:h.filter(op),edges:u.filter(op)}),i.setState({nodesSelectionActive:!1})}},[a]),b.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function zS(t){const r=Je();b.useEffect(()=>{const i=()=>{var a,c,u,h;if(!t.current||!(((c=(a=t.current).checkVisibility)==null?void 0:c.call(a))??!0))return!1;const s=Pu(t.current);(s.height===0||s.width===0)&&((h=(u=r.getState()).onError)==null||h.call(u,"004",Gn.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const ca={position:"absolute",width:"100%",height:"100%",top:0,left:0},AS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function LS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=xi.Free,zoomOnDoubleClick:u=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:C=!0,children:N,noWheelClassName:S,noPanClassName:_,onViewportChange:E,isControlledViewport:P,paneClickDistance:k,selectionOnDrag:j}){const F=Je(),L=b.useRef(null),{userSelectionActive:B,lib:Z,connectionInProgress:V}=Oe(AS,Ze),J=ys(x),U=b.useRef();zS(L);const G=b.useCallback(te=>{E==null||E({x:te[0],y:te[1],zoom:te[2]}),P||F.setState({transform:te})},[E,P]);return b.useEffect(()=>{if(L.current){U.current=F1({domNode:L.current,minZoom:v,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:W=>F.setState({paneDragging:W}),onPanZoomStart:(W,K)=>{const{onViewportChangeStart:M,onMoveStart:A}=F.getState();A==null||A(W,K),M==null||M(K)},onPanZoom:(W,K)=>{const{onViewportChange:M,onMove:A}=F.getState();A==null||A(W,K),M==null||M(K)},onPanZoomEnd:(W,K)=>{const{onViewportChangeEnd:M,onMoveEnd:A}=F.getState();A==null||A(W,K),M==null||M(K)}});const{x:te,y:z,zoom:Q}=U.current.getViewport();return F.setState({panZoom:U.current,transform:[te,z,Q],domNode:L.current.closest(".react-flow")}),()=>{var W;(W=U.current)==null||W.destroy()}}},[]),b.useEffect(()=>{var te;(te=U.current)==null||te.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:h,zoomActivationKeyPressed:J,preventScrolling:C,noPanClassName:_,userSelectionActive:B,noWheelClassName:S,lib:Z,onTransformChange:G,connectionInProgress:V,selectionOnDrag:j,paneClickDistance:k})},[t,r,i,s,a,c,u,h,J,C,_,B,S,Z,G,V,j,k]),d.jsx("div",{className:"react-flow__renderer",ref:L,style:ca,children:N})}const DS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function $S(){const{userSelectionActive:t,userSelectionRect:r}=Oe(DS,Ze);return t&&r?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const tu=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},FS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function OS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=hs.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:u,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:C,children:N}){const S=Je(),{userSelectionActive:_,elementsSelectable:E,dragging:P,connectionInProgress:k}=Oe(FS,Ze),j=E&&(t||_),F=b.useRef(null),L=b.useRef(),B=b.useRef(new Set),Z=b.useRef(new Set),V=b.useRef(!1),J=M=>{if(V.current||k){V.current=!1;return}m==null||m(M),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},U=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}g==null||g(M)},G=v?M=>v(M):void 0,te=M=>{V.current&&(M.stopPropagation(),V.current=!1)},z=M=>{var de,he;const{domNode:A}=S.getState();if(L.current=A==null?void 0:A.getBoundingClientRect(),!L.current)return;const Y=M.target===F.current;if(!Y&&!!M.target.closest(".nokey")||!t||!(c&&Y||r)||M.button!==0||!M.isPrimary)return;(he=(de=M.target)==null?void 0:de.setPointerCapture)==null||he.call(de,M.pointerId),V.current=!1;const{x:se,y:le}=bn(M.nativeEvent,L.current);S.setState({userSelectionRect:{width:0,height:0,startX:se,startY:le,x:se,y:le}}),Y||(M.stopPropagation(),M.preventDefault())},Q=M=>{const{userSelectionRect:A,transform:Y,nodeLookup:I,edgeLookup:$,connectionLookup:se,triggerNodeChanges:le,triggerEdgeChanges:de,defaultEdgeOptions:he,resetSelectedElements:me}=S.getState();if(!L.current||!A)return;const{x:oe,y:pe}=bn(M.nativeEvent,L.current),{startX:je,startY:Ie}=A;if(!V.current){const Ae=r?0:a;if(Math.hypot(oe-je,pe-Ie)<=Ae)return;me(),u==null||u(M)}V.current=!0;const ke={startX:je,startY:Ie,x:oe<je?oe:je,y:pe<Ie?pe:Ie,width:Math.abs(oe-je),height:Math.abs(pe-Ie)},Ne=B.current,$e=Z.current;B.current=new Set(bu(I,ke,Y,i===hs.Partial,!0).map(Ae=>Ae.id)),Z.current=new Set;const Fe=(he==null?void 0:he.selectable)??!0;for(const Ae of B.current){const et=se.get(Ae);if(et)for(const{edgeId:St}of et.values()){const kt=$.get(St);kt&&(kt.selectable??Fe)&&Z.current.add(St)}}if(!Ph(Ne,B.current)){const Ae=ao(I,B.current,!0);le(Ae)}if(!Ph($e,Z.current)){const Ae=ao($,Z.current);de(Ae)}S.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})},W=M=>{var A,Y;M.button===0&&((Y=(A=M.target)==null?void 0:A.releasePointerCapture)==null||Y.call(A,M.pointerId),!_&&M.target===F.current&&S.getState().userSelectionRect&&(J==null||J(M)),S.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(h==null||h(M),S.setState({nodesSelectionActive:B.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return d.jsxs("div",{className:ut(["react-flow__pane",{draggable:K,dragging:P,selection:t}]),onClick:j?void 0:tu(J,F),onContextMenu:tu(U,F),onWheel:tu(G,F),onPointerEnter:j?void 0:y,onPointerMove:j?Q:x,onPointerUp:j?W:void 0,onPointerDownCapture:j?z:void 0,onClickCapture:j?te:void 0,onPointerLeave:C,ref:F,style:ca,children:[N,d.jsx($S,{})]})}function yu({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:h,onError:m}=r.getState(),g=h.get(t);if(!g){m==null||m("012",Gn.error012(t));return}r.setState({nodesSelectionActive:!1}),g.selected?(i||g.selected&&u)&&(c({nodes:[g],edges:[]}),requestAnimationFrame(()=>{var v;return(v=s==null?void 0:s.current)==null?void 0:v.blur()})):a([t])}function Ym({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:a,isSelectable:c,nodeClickDistance:u}){const h=Je(),[m,g]=b.useState(!1),v=b.useRef();return b.useEffect(()=>{v.current=C1({getStoreItems:()=>h.getState(),onNodeMouseDown:y=>{yu({id:y,store:h,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),b.useEffect(()=>{var y,x;if(r)(y=v.current)==null||y.destroy();else if(t.current)return(x=v.current)==null||x.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:a,nodeClickDistance:u}),()=>{var C;(C=v.current)==null||C.destroy()}},[i,s,r,c,t,a]),m}const HS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Xm(){const t=Je();return b.useCallback(i=>{const{nodeExtent:s,snapToGrid:a,snapGrid:c,nodesDraggable:u,onError:h,updateNodePositions:m,nodeLookup:g,nodeOrigin:v}=t.getState(),y=new Map,x=HS(u),C=a?c[0]:5,N=a?c[1]:5,S=i.direction.x*C*i.factor,_=i.direction.y*N*i.factor;for(const[,E]of g){if(!x(E))continue;let P={x:E.internals.positionAbsolute.x+S,y:E.internals.positionAbsolute.y+_};a&&(P=Ns(P,c));const{position:k,positionAbsolute:j}=um({nodeId:E.id,nextPosition:P,nodeLookup:g,nodeExtent:s,nodeOrigin:v,onError:h});E.position=k,E.internals.positionAbsolute=j,y.set(E.id,E)}m(y)},[])}const Du=b.createContext(null),BS=Du.Provider;Du.Consumer;const Gm=()=>b.useContext(Du),VS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),WS=(t,r,i)=>s=>{const{connectionClickStartHandle:a,connectionMode:c,connection:u}=s,{fromHandle:h,toHandle:m,isValid:g}=u,v=(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:v,clickConnecting:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===i,isPossibleEndHandle:c===Ni.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!a,valid:v&&g}};function US({type:t="source",position:r=Ce.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:c=!0,id:u,onConnect:h,children:m,className:g,onMouseDown:v,onTouchStart:y,...x},C){var Q,W;const N=u||null,S=t==="target",_=Je(),E=Gm(),{connectOnClick:P,noPanClassName:k,rfId:j}=Oe(VS,Ze),{connectingFrom:F,connectingTo:L,clickConnecting:B,isPossibleEndHandle:Z,connectionInProcess:V,clickConnectionInProcess:J,valid:U}=Oe(WS(E,N,t),Ze);E||(W=(Q=_.getState()).onError)==null||W.call(Q,"010",Gn.error010());const G=K=>{const{defaultEdgeOptions:M,onConnect:A,hasDefaultEdges:Y}=_.getState(),I={...M,...K};if(Y){const{edges:$,setEdges:se}=_.getState();se(Nm(I,$))}A==null||A(I),h==null||h(I)},te=K=>{if(!E)return;const M=vm(K.nativeEvent);if(a&&(M&&K.button===0||!M)){const A=_.getState();gu.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:S,handleId:N,nodeId:E,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:A.onConnectEnd,updateConnection:A.updateConnection,onConnect:G,isValidConnection:i||A.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}M?v==null||v(K):y==null||y(K)},z=K=>{const{onClickConnectStart:M,onClickConnectEnd:A,connectionClickStartHandle:Y,connectionMode:I,isValidConnection:$,lib:se,rfId:le,nodeLookup:de,connection:he}=_.getState();if(!E||!Y&&!a)return;if(!Y){M==null||M(K.nativeEvent,{nodeId:E,handleId:N,handleType:t}),_.setState({connectionClickStartHandle:{nodeId:E,type:t,id:N}});return}const me=gm(K.target),oe=i||$,{connection:pe,isValid:je}=gu.isValid(K.nativeEvent,{handle:{nodeId:E,id:N,type:t},connectionMode:I,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:oe,flowId:le,doc:me,lib:se,nodeLookup:de});je&&pe&&G(pe);const Ie=structuredClone(he);delete Ie.inProgress,Ie.toPosition=Ie.toHandle?Ie.toHandle.position:null,A==null||A(K,Ie),_.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":N,"data-nodeid":E,"data-handlepos":r,"data-id":`${j}-${E}-${N}-${t}`,className:ut(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",k,g,{source:!S,target:S,connectable:s,connectablestart:a,connectableend:c,clickconnecting:B,connectingfrom:F,connectingto:L,valid:U,connectionindicator:s&&(!V||Z)&&(V||J?c:a)}]),onMouseDown:te,onTouchStart:te,onClick:P?z:void 0,ref:C,...x,children:m})}const Wr=b.memo(Wm(US));function YS({data:t,isConnectable:r,sourcePosition:i=Ce.Bottom}){return d.jsxs(d.Fragment,{children:[t==null?void 0:t.label,d.jsx(Wr,{type:"source",position:i,isConnectable:r})]})}function XS({data:t,isConnectable:r,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Wr,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,d.jsx(Wr,{type:"source",position:s,isConnectable:r})]})}function GS(){return null}function KS({data:t,isConnectable:r,targetPosition:i=Ce.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Wr,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const Ql={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},sp={input:YS,default:XS,output:KS,group:GS};function QS(t){var r,i,s,a;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((a=t.style)==null?void 0:a.height)}}const qS=t=>{const{width:r,height:i,x:s,y:a}=ks(t.nodeLookup,{filter:c=>!!c.selected});return{width:jn(r)?r:null,height:jn(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${a}px)`}};function ZS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Je(),{width:a,height:c,transformString:u,userSelectionActive:h}=Oe(qS,Ze),m=Xm(),g=b.useRef(null);if(b.useEffect(()=>{var x;i||(x=g.current)==null||x.focus({preventScroll:!0})},[i]),Ym({nodeRef:g}),h||!a||!c)return null;const v=t?x=>{const C=s.getState().nodes.filter(N=>N.selected);t(x,C)}:void 0,y=x=>{Object.prototype.hasOwnProperty.call(Ql,x.key)&&(x.preventDefault(),m({direction:Ql[x.key],factor:x.shiftKey?4:1}))};return d.jsx("div",{className:ut(["react-flow__nodesselection","react-flow__container",r]),style:{transform:u},children:d.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:i?void 0:-1,onKeyDown:i?void 0:y,style:{width:a,height:c}})})}const lp=typeof window<"u"?window:void 0,JS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Km({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:g,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:C,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:j,panOnScrollSpeed:F,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:Z,defaultViewport:V,translateExtent:J,minZoom:U,maxZoom:G,preventScrolling:te,onSelectionContextMenu:z,noWheelClassName:Q,noPanClassName:W,disableKeyboardA11y:K,onViewportChange:M,isControlledViewport:A}){const{nodesSelectionActive:Y,userSelectionActive:I}=Oe(JS,Ze),$=ys(g,{target:lp}),se=ys(S,{target:lp}),le=se||Z,de=se||j,he=v&&le!==!0,me=$||I||he;return RS({deleteKeyCode:m,multiSelectionKeyCode:N}),d.jsx(LS,{onPaneContextMenu:c,elementsSelectable:E,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:de,panOnScrollSpeed:F,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:!$&&le,defaultViewport:V,translateExtent:J,minZoom:U,maxZoom:G,zoomActivationKeyCode:_,preventScrolling:te,noWheelClassName:Q,noPanClassName:W,onViewportChange:M,isControlledViewport:A,paneClickDistance:h,selectionOnDrag:he,children:d.jsxs(OS,{onSelectionStart:x,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:le,isSelecting:!!me,selectionMode:y,selectionKeyPressed:$,paneClickDistance:h,selectionOnDrag:he,children:[t,Y&&d.jsx(ZS,{onSelectionContextMenu:z,noPanClassName:W,disableKeyboardA11y:K})]})})}Km.displayName="FlowRenderer";const ek=b.memo(Km),tk=t=>r=>t?bu(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function nk(t){return Oe(b.useCallback(tk(t),[t]),Ze)}const rk=t=>t.updateNodeInternals;function ik(){const t=Oe(rk),[r]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(a=>{const c=a.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:a.target,force:!0})}),t(s)}));return b.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function ok({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const a=Je(),c=b.useRef(null),u=b.useRef(null),h=b.useRef(t.sourcePosition),m=b.useRef(t.targetPosition),g=b.useRef(r),v=i&&!!t.internals.handleBounds;return b.useEffect(()=>{c.current&&!t.hidden&&(!v||u.current!==c.current)&&(u.current&&(s==null||s.unobserve(u.current)),s==null||s.observe(c.current),u.current=c.current)},[v,t.hidden]),b.useEffect(()=>()=>{u.current&&(s==null||s.unobserve(u.current),u.current=null)},[]),b.useEffect(()=>{if(c.current){const y=g.current!==r,x=h.current!==t.sourcePosition,C=m.current!==t.targetPosition;(y||x||C)&&(g.current=r,h.current=t.sourcePosition,m.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function sk({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:a,onContextMenu:c,onDoubleClick:u,nodesDraggable:h,elementsSelectable:m,nodesConnectable:g,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:C,disableKeyboardA11y:N,rfId:S,nodeTypes:_,nodeClickDistance:E,onError:P}){const{node:k,internals:j,isParent:F}=Oe(oe=>{const pe=oe.nodeLookup.get(t),je=oe.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:je}},Ze);let L=k.type||"default",B=(_==null?void 0:_[L])||sp[L];B===void 0&&(P==null||P("003",Gn.error003(L)),L="default",B=(_==null?void 0:_.default)||sp.default);const Z=!!(k.draggable||h&&typeof k.draggable>"u"),V=!!(k.selectable||m&&typeof k.selectable>"u"),J=!!(k.connectable||g&&typeof k.connectable>"u"),U=!!(k.focusable||v&&typeof k.focusable>"u"),G=Je(),te=pm(k),z=ok({node:k,nodeType:L,hasDimensions:te,resizeObserver:y}),Q=Ym({nodeRef:z,disabled:k.hidden||!Z,noDragClassName:x,handleSelector:k.dragHandle,nodeId:t,isSelectable:V,nodeClickDistance:E}),W=Xm();if(k.hidden)return null;const K=ur(k),M=QS(k),A=V||Z||r||i||s||a,Y=i?oe=>i(oe,{...j.userNode}):void 0,I=s?oe=>s(oe,{...j.userNode}):void 0,$=a?oe=>a(oe,{...j.userNode}):void 0,se=c?oe=>c(oe,{...j.userNode}):void 0,le=u?oe=>u(oe,{...j.userNode}):void 0,de=oe=>{const{selectNodesOnDrag:pe,nodeDragThreshold:je}=G.getState();V&&(!pe||!Z||je>0)&&yu({id:t,store:G,nodeRef:z}),r&&r(oe,{...j.userNode})},he=oe=>{if(!(ym(oe.nativeEvent)||N)){if(om.includes(oe.key)&&V){const pe=oe.key==="Escape";yu({id:t,store:G,unselect:pe,nodeRef:z})}else if(Z&&k.selected&&Object.prototype.hasOwnProperty.call(Ql,oe.key)){oe.preventDefault();const{ariaLabelConfig:pe}=G.getState();G.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:oe.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),W({direction:Ql[oe.key],factor:oe.shiftKey?4:1})}}},me=()=>{var $e;if(N||!(($e=z.current)!=null&&$e.matches(":focus-visible")))return;const{transform:oe,width:pe,height:je,autoPanOnNodeFocus:Ie,setCenter:ke}=G.getState();if(!Ie)return;bu(new Map([[t,k]]),{x:0,y:0,width:pe,height:je},oe,!0).length>0||ke(k.position.x+K.width/2,k.position.y+K.height/2,{zoom:oe[2]})};return d.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${L}`,{[C]:Z},k.className,{selected:k.selected,selectable:V,parent:F,draggable:Z,dragging:Q}]),ref:z,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:te?"visible":"hidden",...k.style,...M},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Y,onMouseMove:I,onMouseLeave:$,onContextMenu:se,onClick:de,onDoubleClick:le,onKeyDown:U?he:void 0,tabIndex:U?0:void 0,onFocus:U?me:void 0,role:k.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":N?void 0:`${$m}-${S}`,"aria-label":k.ariaLabel,...k.domAttributes,children:d.jsx(BS,{value:t,children:d.jsx(B,{id:t,data:k.data,type:L,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:k.selected??!1,selectable:V,draggable:Z,deletable:k.deletable??!0,isConnectable:J,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:Q,dragHandle:k.dragHandle,zIndex:j.z,parentId:k.parentId,...K})})})}var lk=b.memo(sk);const ak=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Qm(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,onError:c}=Oe(ak,Ze),u=nk(t.onlyRenderVisibleElements),h=ik();return d.jsx("div",{className:"react-flow__nodes",style:ca,children:u.map(m=>d.jsx(lk,{id:m,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:c},m))})}Qm.displayName="NodeRenderer";const ck=b.memo(Qm);function uk(t){return Oe(b.useCallback(i=>{if(!t)return i.edges.map(a=>a.id);const s=[];if(i.width&&i.height)for(const a of i.edges){const c=i.nodeLookup.get(a.source),u=i.nodeLookup.get(a.target);c&&u&&l1({sourceNode:c,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&s.push(a.id)}return s},[t]),Ze)}const dk=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return d.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},fk=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return d.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ap={[ps.Arrow]:dk,[ps.ArrowClosed]:fk};function hk(t){const r=Je();return b.useMemo(()=>{var a,c;return Object.prototype.hasOwnProperty.call(ap,t)?ap[t]:((c=(a=r.getState()).onError)==null||c.call(a,"009",Gn.error009(t)),null)},[t])}const pk=({id:t,type:r,color:i,width:s=12.5,height:a=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:h="auto-start-reverse"})=>{const m=hk(r);return m?d.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:d.jsx(m,{color:i,strokeWidth:u})}):null},qm=({defaultColor:t,rfId:r})=>{const i=Oe(c=>c.edges),s=Oe(c=>c.defaultEdgeOptions),a=b.useMemo(()=>p1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return a.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:a.map(c=>d.jsx(pk,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};qm.displayName="MarkerDefinitions";var mk=b.memo(qm);function Zm({x:t,y:r,label:i,labelStyle:s,labelShowBg:a=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:h=2,children:m,className:g,...v}){const[y,x]=b.useState({x:1,y:0,width:0,height:0}),C=ut(["react-flow__edge-textwrapper",g]),N=b.useRef(null);return b.useEffect(()=>{if(N.current){const S=N.current.getBBox();x({x:S.x,y:S.y,width:S.width,height:S.height})}},[i]),i?d.jsxs("g",{transform:`translate(${t-y.width/2} ${r-y.height/2})`,className:C,visibility:y.width?"visible":"hidden",...v,children:[a&&d.jsx("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),d.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:N,style:s,children:i}),m]}):null}Zm.displayName="EdgeText";const gk=b.memo(Zm);function ua({path:t,labelX:r,labelY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:g=20,...v}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...v,d:t,fill:"none",className:ut(["react-flow__edge-path",v.className])}),g?d.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,s&&jn(r)&&jn(i)?d.jsx(gk,{x:r,y:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function cp({pos:t,x1:r,y1:i,x2:s,y2:a}){return t===Ce.Left||t===Ce.Right?[.5*(r+s),i]:[r,.5*(i+a)]}function Jm({sourceX:t,sourceY:r,sourcePosition:i=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top}){const[u,h]=cp({pos:i,x1:t,y1:r,x2:s,y2:a}),[m,g]=cp({pos:c,x1:s,y1:a,x2:t,y2:r}),[v,y,x,C]=xm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:u,sourceControlY:h,targetControlX:m,targetControlY:g});return[`M${t},${r} C${u},${h} ${m},${g} ${s},${a}`,v,y,x,C]}function eg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,sourcePosition:u,targetPosition:h,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,interactionWidth:E})=>{const[P,k,j]=Jm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h}),F=t.isInternal?void 0:r;return d.jsx(ua,{id:F,path:P,labelX:k,labelY:j,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,interactionWidth:E})})}const yk=eg({isInternal:!1}),tg=eg({isInternal:!0});yk.displayName="SimpleBezierEdge";tg.displayName="SimpleBezierEdgeInternal";function ng(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:C=Ce.Bottom,targetPosition:N=Ce.Top,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:P})=>{const[k,j,F]=hu({sourceX:i,sourceY:s,sourcePosition:C,targetX:a,targetY:c,targetPosition:N,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),L=t.isInternal?void 0:r;return d.jsx(ua,{id:L,path:k,labelX:j,labelY:F,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:P})})}const rg=ng({isInternal:!1}),ig=ng({isInternal:!0});rg.displayName="SmoothStepEdge";ig.displayName="SmoothStepEdgeInternal";function og(t){return b.memo(({id:r,...i})=>{var a;const s=t.isInternal?void 0:r;return d.jsx(rg,{...i,id:s,pathOptions:b.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(a=i.pathOptions)==null?void 0:a.offset])})})}const vk=og({isInternal:!1}),sg=og({isInternal:!0});vk.displayName="StepEdge";sg.displayName="StepEdgeInternal";function lg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:C,markerStart:N,interactionWidth:S})=>{const[_,E,P]=Em({sourceX:i,sourceY:s,targetX:a,targetY:c}),k=t.isInternal?void 0:r;return d.jsx(ua,{id:k,path:_,labelX:E,labelY:P,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:C,markerStart:N,interactionWidth:S})})}const xk=lg({isInternal:!1}),ag=lg({isInternal:!0});xk.displayName="StraightEdge";ag.displayName="StraightEdgeInternal";function cg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,sourcePosition:u=Ce.Bottom,targetPosition:h=Ce.Top,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:P})=>{const[k,j,F]=wm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h,curvature:E==null?void 0:E.curvature}),L=t.isInternal?void 0:r;return d.jsx(ua,{id:L,path:k,labelX:j,labelY:F,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,interactionWidth:P})})}const wk=cg({isInternal:!1}),ug=cg({isInternal:!0});wk.displayName="BezierEdge";ug.displayName="BezierEdgeInternal";const up={default:ug,straight:ag,step:sg,smoothstep:ig,simplebezier:tg},dp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Sk=(t,r,i)=>i===Ce.Left?t-r:i===Ce.Right?t+r:t,kk=(t,r,i)=>i===Ce.Top?t-r:i===Ce.Bottom?t+r:t,fp="react-flow__edgeupdater";function hp({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:a,onMouseEnter:c,onMouseOut:u,type:h}){return d.jsx("circle",{onMouseDown:a,onMouseEnter:c,onMouseOut:u,className:ut([fp,`${fp}-${h}`]),cx:Sk(r,s,t),cy:kk(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function Nk({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:a,targetX:c,targetY:u,sourcePosition:h,targetPosition:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:C}){const N=Je(),S=(j,F)=>{if(j.button!==0)return;const{autoPanOnConnect:L,domNode:B,isValidConnection:Z,connectionMode:V,connectionRadius:J,lib:U,onConnectStart:G,onConnectEnd:te,cancelConnection:z,nodeLookup:Q,rfId:W,panBy:K,updateConnection:M}=N.getState(),A=F.type==="target",Y=(se,le)=>{x(!1),y==null||y(se,i,F.type,le)},I=se=>g==null?void 0:g(i,se),$=(se,le)=>{x(!0),v==null||v(j,i,F.type),G==null||G(se,le)};gu.onPointerDown(j.nativeEvent,{autoPanOnConnect:L,connectionMode:V,connectionRadius:J,domNode:B,handleId:F.id,nodeId:F.nodeId,nodeLookup:Q,isTarget:A,edgeUpdaterType:F.type,lib:U,flowId:W,cancelConnection:z,panBy:K,isValidConnection:Z,onConnect:I,onConnectStart:$,onConnectEnd:te,onReconnectEnd:Y,updateConnection:M,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,dragThreshold:N.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},_=j=>S(j,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),E=j=>S(j,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),P=()=>C(!0),k=()=>C(!1);return d.jsxs(d.Fragment,{children:[(t===!0||t==="source")&&d.jsx(hp,{position:h,centerX:s,centerY:a,radius:r,onMouseDown:_,onMouseEnter:P,onMouseOut:k,type:"source"}),(t===!0||t==="target")&&d.jsx(hp,{position:m,centerX:c,centerY:u,radius:r,onMouseDown:E,onMouseEnter:P,onMouseOut:k,type:"target"})]})}function Ek({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:a,onDoubleClick:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,rfId:N,edgeTypes:S,noPanClassName:_,onError:E,disableKeyboardA11y:P}){let k=Oe(ke=>ke.edgeLookup.get(t));const j=Oe(ke=>ke.defaultEdgeOptions);k=j?{...j,...k}:k;let F=k.type||"default",L=(S==null?void 0:S[F])||up[F];L===void 0&&(E==null||E("011",Gn.error011(F)),F="default",L=(S==null?void 0:S.default)||up.default);const B=!!(k.focusable||r&&typeof k.focusable>"u"),Z=typeof y<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),V=!!(k.selectable||s&&typeof k.selectable>"u"),J=b.useRef(null),[U,G]=b.useState(!1),[te,z]=b.useState(!1),Q=Je(),{zIndex:W,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$}=Oe(b.useCallback(ke=>{const Ne=ke.nodeLookup.get(k.source),$e=ke.nodeLookup.get(k.target);if(!Ne||!$e)return{zIndex:k.zIndex,...dp};const Fe=h1({id:t,sourceNode:Ne,targetNode:$e,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ke.connectionMode,onError:E});return{zIndex:s1({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:$e,elevateOnSelect:ke.elevateEdgesOnSelect,zIndexMode:ke.zIndexMode}),...Fe||dp}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Ze),se=b.useMemo(()=>k.markerStart?`url('#${pu(k.markerStart,N)}')`:void 0,[k.markerStart,N]),le=b.useMemo(()=>k.markerEnd?`url('#${pu(k.markerEnd,N)}')`:void 0,[k.markerEnd,N]);if(k.hidden||K===null||M===null||A===null||Y===null)return null;const de=ke=>{var Ae;const{addSelectedEdges:Ne,unselectNodesAndEdges:$e,multiSelectionActive:Fe}=Q.getState();V&&(Q.setState({nodesSelectionActive:!1}),k.selected&&Fe?($e({nodes:[],edges:[k]}),(Ae=J.current)==null||Ae.blur()):Ne([t])),a&&a(ke,k)},he=c?ke=>{c(ke,{...k})}:void 0,me=u?ke=>{u(ke,{...k})}:void 0,oe=h?ke=>{h(ke,{...k})}:void 0,pe=m?ke=>{m(ke,{...k})}:void 0,je=g?ke=>{g(ke,{...k})}:void 0,Ie=ke=>{var Ne;if(!P&&om.includes(ke.key)&&V){const{unselectNodesAndEdges:$e,addSelectedEdges:Fe}=Q.getState();ke.key==="Escape"?((Ne=J.current)==null||Ne.blur(),$e({edges:[k]})):Fe([t])}};return d.jsx("svg",{style:{zIndex:W},children:d.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${F}`,k.className,_,{selected:k.selected,animated:k.animated,inactive:!V&&!a,updating:U,selectable:V}]),onClick:de,onDoubleClick:he,onContextMenu:me,onMouseEnter:oe,onMouseMove:pe,onMouseLeave:je,onKeyDown:B?Ie:void 0,tabIndex:B?0:void 0,role:k.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":B?`${Fm}-${N}`:void 0,ref:J,...k.domAttributes,children:[!te&&d.jsx(L,{id:t,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:V,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:se,markerEnd:le,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),Z&&d.jsx(Nk,{edge:k,isReconnectable:Z,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$,setUpdateHover:G,setReconnecting:z})]})})}var Ck=b.memo(Ek);const _k=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function dg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:a,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:C,onReconnectEnd:N,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:E,elementsSelectable:P,onError:k}=Oe(_k,Ze),j=uk(r);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(mk,{defaultColor:t,rfId:i}),j.map(F=>d.jsx(Ck,{id:F,edgesFocusable:_,edgesReconnectable:E,elementsSelectable:P,noPanClassName:a,onReconnect:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:C,onReconnectEnd:N,rfId:i,onError:k,edgeTypes:s,disableKeyboardA11y:S},F))]})}dg.displayName="EdgeRenderer";const jk=b.memo(dg),bk=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function Mk({children:t}){const r=Oe(bk);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function Pk(t){const r=Lu(),i=b.useRef(!1);b.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const Ik=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function Tk(t){const r=Oe(Ik),i=Je();return b.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function Rk(t){return t.connection.inProgress?{...t.connection,to:Es(t.connection.to,t.transform)}:{...t.connection}}function zk(t){return Rk}function Ak(t){const r=zk();return Oe(r,Ze)}const Lk=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function Dk({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:a,width:c,height:u,isValid:h,inProgress:m}=Oe(Lk,Ze);return!(c&&a&&m)?null:d.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:ut(["react-flow__connection",am(h)]),children:d.jsx(fg,{style:r,type:i,CustomComponent:s,isValid:h})})})}const fg=({style:t,type:r=Vr.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:a,from:c,fromNode:u,fromHandle:h,fromPosition:m,to:g,toNode:v,toHandle:y,toPosition:x,pointer:C}=Ak();if(!a)return;if(i)return d.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:u,fromHandle:h,fromX:c.x,fromY:c.y,toX:g.x,toY:g.y,fromPosition:m,toPosition:x,connectionStatus:am(s),toNode:v,toHandle:y,pointer:C});let N="";const S={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:x};switch(r){case Vr.Bezier:[N]=wm(S);break;case Vr.SimpleBezier:[N]=Jm(S);break;case Vr.Step:[N]=hu({...S,borderRadius:0});break;case Vr.SmoothStep:[N]=hu(S);break;default:[N]=Em(S)}return d.jsx("path",{d:N,fill:"none",className:"react-flow__connection-path",style:t})};fg.displayName="ConnectionLine";const $k={};function pp(t=$k){b.useRef(t),Je(),b.useEffect(()=>{},[t])}function Fk(){Je(),b.useRef(!1),b.useEffect(()=>{},[])}function hg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:C,connectionLineType:N,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:P,selectionOnDrag:k,selectionMode:j,multiSelectionKeyCode:F,panActivationKeyCode:L,zoomActivationKeyCode:B,deleteKeyCode:Z,onlyRenderVisibleElements:V,elementsSelectable:J,defaultViewport:U,translateExtent:G,minZoom:te,maxZoom:z,preventScrolling:Q,defaultMarkerColor:W,zoomOnScroll:K,zoomOnPinch:M,panOnScroll:A,panOnScrollSpeed:Y,panOnScrollMode:I,zoomOnDoubleClick:$,panOnDrag:se,onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneScroll:oe,onPaneContextMenu:pe,paneClickDistance:je,nodeClickDistance:Ie,onEdgeContextMenu:ke,onEdgeMouseEnter:Ne,onEdgeMouseMove:$e,onEdgeMouseLeave:Fe,reconnectRadius:Ae,onReconnect:et,onReconnectStart:St,onReconnectEnd:kt,noDragClassName:ht,noWheelClassName:Nt,noPanClassName:At,disableKeyboardA11y:Xt,nodeExtent:dr,rfId:Qn,viewport:be,onViewportChange:rn}){return pp(t),pp(r),Fk(),Pk(i),Tk(be),d.jsx(ek,{onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneContextMenu:pe,onPaneScroll:oe,paneClickDistance:je,deleteKeyCode:Z,selectionKeyCode:P,selectionOnDrag:k,selectionMode:j,onSelectionStart:x,onSelectionEnd:C,multiSelectionKeyCode:F,panActivationKeyCode:L,zoomActivationKeyCode:B,elementsSelectable:J,zoomOnScroll:K,zoomOnPinch:M,zoomOnDoubleClick:$,panOnScroll:A,panOnScrollSpeed:Y,panOnScrollMode:I,panOnDrag:se,defaultViewport:U,translateExtent:G,minZoom:te,maxZoom:z,onSelectionContextMenu:y,preventScrolling:Q,noDragClassName:ht,noWheelClassName:Nt,noPanClassName:At,disableKeyboardA11y:Xt,onViewportChange:rn,isControlledViewport:!!be,children:d.jsxs(Mk,{children:[d.jsx(jk,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:et,onReconnectStart:St,onReconnectEnd:kt,onlyRenderVisibleElements:V,onEdgeContextMenu:ke,onEdgeMouseEnter:Ne,onEdgeMouseMove:$e,onEdgeMouseLeave:Fe,reconnectRadius:Ae,defaultMarkerColor:W,noPanClassName:At,disableKeyboardA11y:Xt,rfId:Qn}),d.jsx(Dk,{style:S,type:N,component:_,containerStyle:E}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(ck,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:Ie,onlyRenderVisibleElements:V,noPanClassName:At,noDragClassName:ht,disableKeyboardA11y:Xt,nodeExtent:dr,rfId:Qn}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}hg.displayName="GraphView";const Ok=b.memo(hg),mp=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const C=new Map,N=new Map,S=new Map,_=new Map,E=s??r??[],P=i??t??[],k=v??[0,0],j=y??fs;jm(S,_,E);const F=mu(P,C,N,{nodeOrigin:k,nodeExtent:j,zIndexMode:x});let L=[0,0,1];if(u&&a&&c){const B=ks(C,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:Z,y:V,zoom:J}=Mu(B,a,c,m,g,(h==null?void 0:h.padding)??.1);L=[Z,V,J]}return{rfId:"1",width:a??0,height:c??0,transform:L,nodes:P,nodesInitialized:F,nodeLookup:C,parentLookup:N,edges:E,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:fs,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ni.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,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:u??!1,fitViewOptions:h,fitViewResolver:null,connection:{...lm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:e1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:sm,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Hk=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>oS((C,N)=>{async function S(){const{nodeLookup:_,panZoom:E,fitViewOptions:P,fitViewResolver:k,width:j,height:F,minZoom:L,maxZoom:B}=N();E&&(await Zw({nodes:_,width:j,height:F,panZoom:E,minZoom:L,maxZoom:B},P),k==null||k.resolve(!0),C({fitViewResolver:null}))}return{...mp({nodes:t,edges:r,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,defaultNodes:i,defaultEdges:s,zIndexMode:x}),setNodes:_=>{const{nodeLookup:E,parentLookup:P,nodeOrigin:k,elevateNodesOnSelect:j,fitViewQueued:F,zIndexMode:L}=N(),B=mu(_,E,P,{nodeOrigin:k,nodeExtent:y,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:L});F&&B?(S(),C({nodes:_,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0})):C({nodes:_,nodesInitialized:B})},setEdges:_=>{const{connectionLookup:E,edgeLookup:P}=N();jm(E,P,_),C({edges:_})},setDefaultNodesAndEdges:(_,E)=>{if(_){const{setNodes:P}=N();P(_),C({hasDefaultNodes:!0})}if(E){const{setEdges:P}=N();P(E),C({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:E,nodeLookup:P,parentLookup:k,domNode:j,nodeOrigin:F,nodeExtent:L,debug:B,fitViewQueued:Z,zIndexMode:V}=N(),{changes:J,updatedInternals:U}=S1(_,P,k,j,F,L,V);U&&(y1(P,k,{nodeOrigin:F,nodeExtent:L,zIndexMode:V}),Z?(S(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(J==null?void 0:J.length)>0&&(B&&console.log("React Flow: trigger node changes",J),E==null||E(J)))},updateNodePositions:(_,E=!1)=>{const P=[];let k=[];const{nodeLookup:j,triggerNodeChanges:F,connection:L,updateConnection:B,onNodesChangeMiddlewareMap:Z}=N();for(const[V,J]of _){const U=j.get(V),G=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(J!=null&&J.position)),te={id:V,type:"position",position:G?{x:Math.max(0,J.position.x),y:Math.max(0,J.position.y)}:J.position,dragging:E};if(U&&L.inProgress&&L.fromNode.id===U.id){const z=Ci(U,L.fromHandle,Ce.Left,!0);B({...L,from:z})}G&&U.parentId&&P.push({id:V,parentId:U.parentId,rect:{...J.internals.positionAbsolute,width:J.measured.width??0,height:J.measured.height??0}}),k.push(te)}if(P.length>0){const{parentLookup:V,nodeOrigin:J}=N(),U=Au(P,j,V,J);k.push(...U)}for(const V of Z.values())k=V(k);F(k)},triggerNodeChanges:_=>{const{onNodesChange:E,setNodes:P,nodes:k,hasDefaultNodes:j,debug:F}=N();if(_!=null&&_.length){if(j){const L=Bm(_,k);P(L)}F&&console.log("React Flow: trigger node changes",_),E==null||E(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:E,setEdges:P,edges:k,hasDefaultEdges:j,debug:F}=N();if(_!=null&&_.length){if(j){const L=Vm(_,k);P(L)}F&&console.log("React Flow: trigger edge changes",_),E==null||E(_)}},addSelectedNodes:_=>{const{multiSelectionActive:E,edgeLookup:P,nodeLookup:k,triggerNodeChanges:j,triggerEdgeChanges:F}=N();if(E){const L=_.map(B=>gi(B,!0));j(L);return}j(ao(k,new Set([..._]),!0)),F(ao(P))},addSelectedEdges:_=>{const{multiSelectionActive:E,edgeLookup:P,nodeLookup:k,triggerNodeChanges:j,triggerEdgeChanges:F}=N();if(E){const L=_.map(B=>gi(B,!0));F(L);return}F(ao(P,new Set([..._]))),j(ao(k,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:E}={})=>{const{edges:P,nodes:k,nodeLookup:j,triggerNodeChanges:F,triggerEdgeChanges:L}=N(),B=_||k,Z=E||P,V=B.map(U=>{const G=j.get(U.id);return G&&(G.selected=!1),gi(U.id,!1)}),J=Z.map(U=>gi(U.id,!1));F(V),L(J)},setMinZoom:_=>{const{panZoom:E,maxZoom:P}=N();E==null||E.setScaleExtent([_,P]),C({minZoom:_})},setMaxZoom:_=>{const{panZoom:E,minZoom:P}=N();E==null||E.setScaleExtent([P,_]),C({maxZoom:_})},setTranslateExtent:_=>{var E;(E=N().panZoom)==null||E.setTranslateExtent(_),C({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:E,triggerNodeChanges:P,triggerEdgeChanges:k,elementsSelectable:j}=N();if(!j)return;const F=E.reduce((B,Z)=>Z.selected?[...B,gi(Z.id,!1)]:B,[]),L=_.reduce((B,Z)=>Z.selected?[...B,gi(Z.id,!1)]:B,[]);P(F),k(L)},setNodeExtent:_=>{const{nodes:E,nodeLookup:P,parentLookup:k,nodeOrigin:j,elevateNodesOnSelect:F,nodeExtent:L,zIndexMode:B}=N();_[0][0]===L[0][0]&&_[0][1]===L[0][1]&&_[1][0]===L[1][0]&&_[1][1]===L[1][1]||(mu(E,P,k,{nodeOrigin:j,nodeExtent:_,elevateNodesOnSelect:F,checkEquality:!1,zIndexMode:B}),C({nodeExtent:_}))},panBy:_=>{const{transform:E,width:P,height:k,panZoom:j,translateExtent:F}=N();return k1({delta:_,panZoom:j,transform:E,translateExtent:F,width:P,height:k})},setCenter:async(_,E,P)=>{const{width:k,height:j,maxZoom:F,panZoom:L}=N();if(!L)return Promise.resolve(!1);const B=typeof(P==null?void 0:P.zoom)<"u"?P.zoom:F;return await L.setViewport({x:k/2-_*B,y:j/2-E*B,zoom:B},{duration:P==null?void 0:P.duration,ease:P==null?void 0:P.ease,interpolate:P==null?void 0:P.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...lm}})},updateConnection:_=>{C({connection:_})},reset:()=>C({...mp()})}},Object.is);function pg({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:a,initialHeight:c,initialMinZoom:u,initialMaxZoom:h,initialFitViewOptions:m,fitView:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:C}){const[N]=b.useState(()=>Hk({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:g,minZoom:u,maxZoom:h,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return d.jsx(sS,{value:N,children:d.jsx(MS,{children:C})})}function Bk({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:a,width:c,height:u,fitView:h,fitViewOptions:m,minZoom:g,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:C}){return b.useContext(la)?d.jsx(d.Fragment,{children:t}):d.jsx(pg,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:c,initialHeight:u,fitView:h,initialFitViewOptions:m,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:C,children:t})}const Vk={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Wk({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:a,nodeTypes:c,edgeTypes:u,onNodeClick:h,onEdgeClick:m,onInit:g,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:C,onConnectStart:N,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:j,onNodeContextMenu:F,onNodeDoubleClick:L,onNodeDragStart:B,onNodeDrag:Z,onNodeDragStop:V,onNodesDelete:J,onEdgesDelete:U,onDelete:G,onSelectionChange:te,onSelectionDragStart:z,onSelectionDrag:Q,onSelectionDragStop:W,onSelectionContextMenu:K,onSelectionStart:M,onSelectionEnd:A,onBeforeDelete:Y,connectionMode:I,connectionLineType:$=Vr.Bezier,connectionLineStyle:se,connectionLineComponent:le,connectionLineContainerStyle:de,deleteKeyCode:he="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:oe=!1,selectionMode:pe=hs.Full,panActivationKeyCode:je="Space",multiSelectionKeyCode:Ie=gs()?"Meta":"Control",zoomActivationKeyCode:ke=gs()?"Meta":"Control",snapToGrid:Ne,snapGrid:$e,onlyRenderVisibleElements:Fe=!1,selectNodesOnDrag:Ae,nodesDraggable:et,autoPanOnNodeFocus:St,nodesConnectable:kt,nodesFocusable:ht,nodeOrigin:Nt=Om,edgesFocusable:At,edgesReconnectable:Xt,elementsSelectable:dr=!0,defaultViewport:Qn=xS,minZoom:be=.5,maxZoom:rn=2,translateExtent:on=fs,preventScrolling:Xr=!0,nodeExtent:hn,defaultMarkerColor:pn="#b1b1b7",zoomOnScroll:Lt=!0,zoomOnPinch:Gr=!0,panOnScroll:Kr=!1,panOnScrollSpeed:yo=.5,panOnScrollMode:fr=xi.Free,zoomOnDoubleClick:hr=!0,panOnDrag:pr=!0,onPaneClick:Gt,onPaneMouseEnter:Qr,onPaneMouseMove:Tt,onPaneMouseLeave:vt,onPaneScroll:mr,onPaneContextMenu:qr,paneClickDistance:mn=1,nodeClickDistance:gr=0,children:ji,onReconnect:Zr,onReconnectStart:yr,onReconnectEnd:gn,onEdgeContextMenu:Pn,onEdgeDoubleClick:vr,onEdgeMouseEnter:Dt,onEdgeMouseMove:In,onEdgeMouseLeave:lt,reconnectRadius:xr=10,onNodesChange:Et,onEdgesChange:bi,noDragClassName:Tn="nodrag",noWheelClassName:vo="nowheel",noPanClassName:Ct="nopan",fitView:tt,fitViewOptions:wr,connectOnClick:qn,attributionPosition:Jr,proOptions:ei,defaultEdgeOptions:Kt,elevateNodesOnSelect:Rn=!0,elevateEdgesOnSelect:xo=!1,disableKeyboardA11y:Mi=!1,autoPanOnConnect:Ge,autoPanOnNodeDrag:Pi,autoPanSpeed:Sr,connectionRadius:Ii,isValidConnection:kr,onError:wo,style:Ti,id:zn,nodeDragThreshold:_t,connectionDragThreshold:Nr,viewport:jt,onViewportChange:An,width:So,height:ko,colorMode:yn="light",debug:Ye,onScroll:$t,ariaLabelConfig:Er,zIndexMode:Ri="basic",...No},ti){const Ln=zn||"1",ni=NS(yn),Dn=b.useCallback(ri=>{ri.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),$t==null||$t(ri)},[$t]);return d.jsx("div",{"data-testid":"rf__wrapper",...No,onScroll:Dn,style:{...Ti,...Vk},ref:ti,className:ut(["react-flow",a,ni]),id:zn,role:"application",children:d.jsxs(Bk,{nodes:t,edges:r,width:So,height:ko,fitView:tt,fitViewOptions:wr,minZoom:be,maxZoom:rn,nodeOrigin:Nt,nodeExtent:hn,zIndexMode:Ri,children:[d.jsx(Ok,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:j,onNodeContextMenu:F,onNodeDoubleClick:L,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:se,connectionLineComponent:le,connectionLineContainerStyle:de,selectionKeyCode:me,selectionOnDrag:oe,selectionMode:pe,deleteKeyCode:he,multiSelectionKeyCode:Ie,panActivationKeyCode:je,zoomActivationKeyCode:ke,onlyRenderVisibleElements:Fe,defaultViewport:Qn,translateExtent:on,minZoom:be,maxZoom:rn,preventScrolling:Xr,zoomOnScroll:Lt,zoomOnPinch:Gr,zoomOnDoubleClick:hr,panOnScroll:Kr,panOnScrollSpeed:yo,panOnScrollMode:fr,panOnDrag:pr,onPaneClick:Gt,onPaneMouseEnter:Qr,onPaneMouseMove:Tt,onPaneMouseLeave:vt,onPaneScroll:mr,onPaneContextMenu:qr,paneClickDistance:mn,nodeClickDistance:gr,onSelectionContextMenu:K,onSelectionStart:M,onSelectionEnd:A,onReconnect:Zr,onReconnectStart:yr,onReconnectEnd:gn,onEdgeContextMenu:Pn,onEdgeDoubleClick:vr,onEdgeMouseEnter:Dt,onEdgeMouseMove:In,onEdgeMouseLeave:lt,reconnectRadius:xr,defaultMarkerColor:pn,noDragClassName:Tn,noWheelClassName:vo,noPanClassName:Ct,rfId:Ln,disableKeyboardA11y:Mi,nodeExtent:hn,viewport:jt,onViewportChange:An}),d.jsx(kS,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:N,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,nodesDraggable:et,autoPanOnNodeFocus:St,nodesConnectable:kt,nodesFocusable:ht,edgesFocusable:At,edgesReconnectable:Xt,elementsSelectable:dr,elevateNodesOnSelect:Rn,elevateEdgesOnSelect:xo,minZoom:be,maxZoom:rn,nodeExtent:hn,onNodesChange:Et,onEdgesChange:bi,snapToGrid:Ne,snapGrid:$e,connectionMode:I,translateExtent:on,connectOnClick:qn,defaultEdgeOptions:Kt,fitView:tt,fitViewOptions:wr,onNodesDelete:J,onEdgesDelete:U,onDelete:G,onNodeDragStart:B,onNodeDrag:Z,onNodeDragStop:V,onSelectionDrag:Q,onSelectionDragStart:z,onSelectionDragStop:W,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:Ct,nodeOrigin:Nt,rfId:Ln,autoPanOnConnect:Ge,autoPanOnNodeDrag:Pi,autoPanSpeed:Sr,onError:wo,connectionRadius:Ii,isValidConnection:kr,selectNodesOnDrag:Ae,nodeDragThreshold:_t,connectionDragThreshold:Nr,onBeforeDelete:Y,debug:Ye,ariaLabelConfig:Er,zIndexMode:Ri}),d.jsx(vS,{onSelectionChange:te}),ji,d.jsx(hS,{proOptions:ei,position:Jr}),d.jsx(fS,{rfId:Ln,disableKeyboardA11y:Mi})]})})}var mg=Wm(Wk);function Uk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Bm(a,c)),[]);return[r,i,s]}function Yk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Vm(a,c)),[]);return[r,i,s]}function Xk({dimensions:t,lineWidth:r,variant:i,className:s}){return d.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ut(["react-flow__background-pattern",i,s])})}function Gk({radius:t,className:r}){return d.jsx("circle",{cx:t,cy:t,r:t,className:ut(["react-flow__background-pattern","dots",r])})}var Xn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Xn||(Xn={}));const Kk={[Xn.Dots]:1,[Xn.Lines]:1,[Xn.Cross]:6},Qk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function gg({id:t,variant:r=Xn.Dots,gap:i=20,size:s,lineWidth:a=1,offset:c=0,color:u,bgColor:h,style:m,className:g,patternClassName:v}){const y=b.useRef(null),{transform:x,patternId:C}=Oe(Qk,Ze),N=s||Kk[r],S=r===Xn.Dots,_=r===Xn.Cross,E=Array.isArray(i)?i:[i,i],P=[E[0]*x[2]||1,E[1]*x[2]||1],k=N*x[2],j=Array.isArray(c)?c:[c,c],F=_?[k,k]:P,L=[j[0]*x[2]||1+F[0]/2,j[1]*x[2]||1+F[1]/2],B=`${C}${t||""}`;return d.jsxs("svg",{className:ut(["react-flow__background",g]),style:{...m,...ca,"--xy-background-color-props":h,"--xy-background-pattern-color-props":u},ref:y,"data-testid":"rf__background",children:[d.jsx("pattern",{id:B,x:x[0]%P[0],y:x[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:S?d.jsx(Gk,{radius:k/2,className:v}):d.jsx(Xk,{dimensions:F,lineWidth:a,variant:r,className:v})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}gg.displayName="Background";const yg=b.memo(gg);function qk(){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 Zk(){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 Jk(){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 eN(){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 tN(){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 Al({children:t,className:r,...i}){return d.jsx("button",{type:"button",className:ut(["react-flow__controls-button",r]),...i,children:t})}const nN=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function vg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:c,onZoomOut:u,onFitView:h,onInteractiveChange:m,className:g,children:v,position:y="bottom-left",orientation:x="vertical","aria-label":C}){const N=Je(),{isInteractive:S,minZoomReached:_,maxZoomReached:E,ariaLabelConfig:P}=Oe(nN,Ze),{zoomIn:k,zoomOut:j,fitView:F}=Lu(),L=()=>{k(),c==null||c()},B=()=>{j(),u==null||u()},Z=()=>{F(a),h==null||h()},V=()=>{N.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),m==null||m(!S)},J=x==="horizontal"?"horizontal":"vertical";return d.jsxs(aa,{className:ut(["react-flow__controls",J,g]),position:y,style:t,"data-testid":"rf__controls","aria-label":C??P["controls.ariaLabel"],children:[r&&d.jsxs(d.Fragment,{children:[d.jsx(Al,{onClick:L,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:E,children:d.jsx(qk,{})}),d.jsx(Al,{onClick:B,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:_,children:d.jsx(Zk,{})})]}),i&&d.jsx(Al,{className:"react-flow__controls-fitview",onClick:Z,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:d.jsx(Jk,{})}),s&&d.jsx(Al,{className:"react-flow__controls-interactive",onClick:V,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:S?d.jsx(tN,{}):d.jsx(eN,{})}),v]})}vg.displayName="Controls";const xg=b.memo(vg);function rN({id:t,x:r,y:i,width:s,height:a,style:c,color:u,strokeColor:h,strokeWidth:m,className:g,borderRadius:v,shapeRendering:y,selected:x,onClick:C}){const{background:N,backgroundColor:S}=c||{},_=u||N||S;return d.jsx("rect",{className:ut(["react-flow__minimap-node",{selected:x},g]),x:r,y:i,rx:v,ry:v,width:s,height:a,style:{fill:_,stroke:h,strokeWidth:m},shapeRendering:y,onClick:C?E=>C(E,t):void 0})}const iN=b.memo(rN),oN=t=>t.nodes.map(r=>r.id),nu=t=>t instanceof Function?t:()=>t;function sN({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:c=iN,onClick:u}){const h=Oe(oN,Ze),m=nu(r),g=nu(t),v=nu(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:h.map(x=>d.jsx(aN,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:c,onClick:u,shapeRendering:y},x))})}function lN({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:h,onClick:m}){const{node:g,x:v,y,width:x,height:C}=Oe(N=>{const{internals:S}=N.nodeLookup.get(t),_=S.userNode,{x:E,y:P}=S.positionAbsolute,{width:k,height:j}=ur(_);return{node:_,x:E,y:P,width:k,height:j}},Ze);return!g||g.hidden||!pm(g)?null:d.jsx(h,{x:v,y,width:x,height:C,style:g.style,selected:!!g.selected,className:s(g),color:r(g),borderRadius:a,strokeColor:i(g),strokeWidth:c,shapeRendering:u,onClick:m,id:g.id})}const aN=b.memo(lN);var cN=b.memo(sN);const uN=200,dN=150,fN=t=>!t.hidden,hN=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?hm(ks(t.nodeLookup,{filter:fN}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},pN="react-flow__minimap-desc";function wg({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:a="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:h,bgColor:m,maskColor:g,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:C,onNodeClick:N,pannable:S=!1,zoomable:_=!1,ariaLabel:E,inversePan:P,zoomStep:k=1,offsetScale:j=5}){const F=Je(),L=b.useRef(null),{boundingRect:B,viewBB:Z,rfId:V,panZoom:J,translateExtent:U,flowWidth:G,flowHeight:te,ariaLabelConfig:z}=Oe(hN,Ze),Q=(t==null?void 0:t.width)??uN,W=(t==null?void 0:t.height)??dN,K=B.width/Q,M=B.height/W,A=Math.max(K,M),Y=A*Q,I=A*W,$=j*A,se=B.x-(Y-B.width)/2-$,le=B.y-(I-B.height)/2-$,de=Y+$*2,he=I+$*2,me=`${pN}-${V}`,oe=b.useRef(0),pe=b.useRef();oe.current=A,b.useEffect(()=>{if(L.current&&J)return pe.current=I1({domNode:L.current,panZoom:J,getTransform:()=>F.getState().transform,getViewScale:()=>oe.current}),()=>{var Ne;(Ne=pe.current)==null||Ne.destroy()}},[J]),b.useEffect(()=>{var Ne;(Ne=pe.current)==null||Ne.update({translateExtent:U,width:G,height:te,inversePan:P,pannable:S,zoomStep:k,zoomable:_})},[S,_,P,k,U,G,te]);const je=C?Ne=>{var Ae;const[$e,Fe]=((Ae=pe.current)==null?void 0:Ae.pointer(Ne))||[0,0];C(Ne,{x:$e,y:Fe})}:void 0,Ie=N?b.useCallback((Ne,$e)=>{const Fe=F.getState().nodeLookup.get($e).internals.userNode;N(Ne,Fe)},[]):void 0,ke=E??z["minimap.ariaLabel"];return d.jsx(aa,{position:x,style:{...t,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*A:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:ut(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:Q,height:W,viewBox:`${se} ${le} ${de} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:L,onClick:je,children:[ke&&d.jsx("title",{id:me,children:ke}),d.jsx(cN,{onClick:Ie,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:h}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${se-$},${le-$}h${de+$*2}v${he+$*2}h${-de-$*2}z
62
- M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wg.displayName="MiniMap";b.memo(wg);const mN=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,gN={[_i.Line]:"right",[_i.Handle]:"bottom-right"};function yN({nodeId:t,position:r,variant:i=_i.Handle,className:s,style:a=void 0,children:c,color:u,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:x,autoScale:C=!0,shouldResize:N,onResizeStart:S,onResize:_,onResizeEnd:E}){const P=Gm(),k=typeof t=="string"?t:P,j=Je(),F=b.useRef(null),L=i===_i.Handle,B=Oe(b.useCallback(mN(L&&C),[L,C]),Ze),Z=b.useRef(null),V=r??gN[i];b.useEffect(()=>{if(!(!F.current||!k))return Z.current||(Z.current=X1({domNode:F.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:U,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,domNode:W}=j.getState();return{nodeLookup:U,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,paneDomNode:W}},onChange:(U,G)=>{const{triggerNodeChanges:te,nodeLookup:z,parentLookup:Q,nodeOrigin:W}=j.getState(),K=[],M={x:U.x,y:U.y},A=z.get(k);if(A&&A.expandParent&&A.parentId){const Y=A.origin??W,I=U.width??A.measured.width??0,$=U.height??A.measured.height??0,se={id:A.id,parentId:A.parentId,rect:{width:I,height:$,...mm({x:U.x??A.position.x,y:U.y??A.position.y},{width:I,height:$},A.parentId,z,Y)}},le=Au([se],z,Q,W);K.push(...le),M.x=U.x?Math.max(Y[0]*I,U.x):void 0,M.y=U.y?Math.max(Y[1]*$,U.y):void 0}if(M.x!==void 0&&M.y!==void 0){const Y={id:k,type:"position",position:{...M}};K.push(Y)}if(U.width!==void 0&&U.height!==void 0){const I={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};K.push(I)}for(const Y of G){const I={...Y,type:"position"};K.push(I)}te(K)},onEnd:({width:U,height:G})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:U,height:G}};j.getState().triggerNodeChanges([te])}})),Z.current.update({controlPosition:V,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:E,shouldResize:N}),()=>{var U;(U=Z.current)==null||U.destroy()}},[V,h,m,g,v,y,S,_,E,N]);const J=V.split("-");return d.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...J,i,s]),ref:F,style:{...a,scale:B,...u&&{[L?"backgroundColor":"borderColor"]:u}},children:c})}const gp=b.memo(yN);function vN({nodeId:t,isVisible:r=!0,handleClassName:i,handleStyle:s,lineClassName:a,lineStyle:c,color:u,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,autoScale:x=!0,shouldResize:C,onResizeStart:N,onResize:S,onResizeEnd:_}){return r?d.jsxs(d.Fragment,{children:[H1.map(E=>d.jsx(gp,{className:a,style:c,nodeId:t,position:E,variant:_i.Line,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:N,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:S,onResizeEnd:_},E)),O1.map(E=>d.jsx(gp,{className:i,style:s,nodeId:t,position:E,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:N,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:S,onResizeEnd:_},E))]}):null}function xN(t,r){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const i=document.implementation.createHTMLDocument(),s=i.createElement("base"),a=i.createElement("a");return i.head.appendChild(s),i.body.appendChild(a),r&&(s.href=r),a.href=t,a.href}const wN=(()=>{let t=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${r()}${t}`)})();function Ur(t){const r=[];for(let i=0,s=t.length;i<s;i++)r.push(t[i]);return r}let ro=null;function Sg(t={}){return ro||(t.includeStyleProperties?(ro=t.includeStyleProperties,ro):(ro=Ur(window.getComputedStyle(document.documentElement)),ro))}function ql(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function SN(t){const r=ql(t,"border-left-width"),i=ql(t,"border-right-width");return t.clientWidth+r+i}function kN(t){const r=ql(t,"border-top-width"),i=ql(t,"border-bottom-width");return t.clientHeight+r+i}function kg(t,r={}){const i=r.width||SN(t),s=r.height||kN(t);return{width:i,height:s}}function NN(){let t,r;try{r=process}catch{}const i=r&&r.env?r.env.devicePixelRatio:null;return i&&(t=parseInt(i,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const en=16384;function EN(t){(t.width>en||t.height>en)&&(t.width>en&&t.height>en?t.width>t.height?(t.height*=en/t.width,t.width=en):(t.width*=en/t.height,t.height=en):t.width>en?(t.height*=en/t.width,t.width=en):(t.width*=en/t.height,t.height=en))}function Zl(t){return new Promise((r,i)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>r(s))})},s.onerror=i,s.crossOrigin="anonymous",s.decoding="async",s.src=t})}async function CN(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function _N(t,r,i){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),c=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${r}`),a.setAttribute("height",`${i}`),a.setAttribute("viewBox",`0 0 ${r} ${i}`),c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("externalResourcesRequired","true"),a.appendChild(c),c.appendChild(t),CN(a)}const Yt=(t,r)=>{if(t instanceof r)return!0;const i=Object.getPrototypeOf(t);return i===null?!1:i.constructor.name===r.name||Yt(i,r)};function jN(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function bN(t,r){return Sg(r).map(i=>{const s=t.getPropertyValue(i),a=t.getPropertyPriority(i);return`${i}: ${s}${a?" !important":""};`}).join(" ")}function MN(t,r,i,s){const a=`.${t}:${r}`,c=i.cssText?jN(i):bN(i,s);return document.createTextNode(`${a}{${c}}`)}function yp(t,r,i,s){const a=window.getComputedStyle(t,i),c=a.getPropertyValue("content");if(c===""||c==="none")return;const u=wN();try{r.className=`${r.className} ${u}`}catch{return}const h=document.createElement("style");h.appendChild(MN(u,i,a,s)),r.appendChild(h)}function PN(t,r,i){yp(t,r,":before",i),yp(t,r,":after",i)}const vp="application/font-woff",xp="image/jpeg",IN={woff:vp,woff2:vp,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:xp,jpeg:xp,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function TN(t){const r=/\.([^./]*?)$/g.exec(t);return r?r[1]:""}function $u(t){const r=TN(t).toLowerCase();return IN[r]||""}function RN(t){return t.split(/,/)[1]}function vu(t){return t.search(/^(data:)/)!==-1}function zN(t,r){return`data:${r};base64,${t}`}async function Ng(t,r,i){const s=await fetch(t,r);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((c,u)=>{const h=new FileReader;h.onerror=u,h.onloadend=()=>{try{c(i({res:s,result:h.result}))}catch(m){u(m)}},h.readAsDataURL(a)})}const ru={};function AN(t,r,i){let s=t.replace(/\?.*/,"");return i&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),r?`[${r}]${s}`:s}async function Fu(t,r,i){const s=AN(t,r,i.includeQueryParams);if(ru[s]!=null)return ru[s];i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const c=await Ng(t,i.fetchRequestInit,({res:u,result:h})=>(r||(r=u.headers.get("Content-Type")||""),RN(h)));a=zN(c,r)}catch(c){a=i.imagePlaceholder||"";let u=`Failed to fetch resource: ${t}`;c&&(u=typeof c=="string"?c:c.message),u&&console.warn(u)}return ru[s]=a,a}async function LN(t){const r=t.toDataURL();return r==="data:,"?t.cloneNode(!1):Zl(r)}async function DN(t,r){if(t.currentSrc){const c=document.createElement("canvas"),u=c.getContext("2d");c.width=t.clientWidth,c.height=t.clientHeight,u==null||u.drawImage(t,0,0,c.width,c.height);const h=c.toDataURL();return Zl(h)}const i=t.poster,s=$u(i),a=await Fu(i,s,r);return Zl(a)}async function $N(t,r){var i;try{if(!((i=t==null?void 0:t.contentDocument)===null||i===void 0)&&i.body)return await da(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function FN(t,r){return Yt(t,HTMLCanvasElement)?LN(t):Yt(t,HTMLVideoElement)?DN(t,r):Yt(t,HTMLIFrameElement)?$N(t,r):t.cloneNode(Eg(t))}const ON=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Eg=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function HN(t,r,i){var s,a;if(Eg(r))return r;let c=[];return ON(t)&&t.assignedNodes?c=Ur(t.assignedNodes()):Yt(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?c=Ur(t.contentDocument.body.childNodes):c=Ur(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),c.length===0||Yt(t,HTMLVideoElement)||await c.reduce((u,h)=>u.then(()=>da(h,i)).then(m=>{m&&r.appendChild(m)}),Promise.resolve()),r}function BN(t,r,i){const s=r.style;if(!s)return;const a=window.getComputedStyle(t);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):Sg(i).forEach(c=>{let u=a.getPropertyValue(c);c==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Yt(t,HTMLIFrameElement)&&c==="display"&&u==="inline"&&(u="block"),c==="d"&&r.getAttribute("d")&&(u=`path(${r.getAttribute("d")})`),s.setProperty(c,u,a.getPropertyPriority(c))})}function VN(t,r){Yt(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Yt(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function WN(t,r){if(Yt(t,HTMLSelectElement)){const s=Array.from(r.children).find(a=>t.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function UN(t,r,i){return Yt(r,Element)&&(BN(t,r,i),PN(t,r,i),VN(t,r),WN(t,r)),r}async function YN(t,r){const i=t.querySelectorAll?t.querySelectorAll("use"):[];if(i.length===0)return t;const s={};for(let c=0;c<i.length;c++){const h=i[c].getAttribute("xlink:href");if(h){const m=t.querySelector(h),g=document.querySelector(h);!m&&g&&!s[h]&&(s[h]=await da(g,r,!0))}}const a=Object.values(s);if(a.length){const c="http://www.w3.org/1999/xhtml",u=document.createElementNS(c,"svg");u.setAttribute("xmlns",c),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const h=document.createElementNS(c,"defs");u.appendChild(h);for(let m=0;m<a.length;m++)h.appendChild(a[m]);t.appendChild(u)}return t}async function da(t,r,i){return!i&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>FN(s,r)).then(s=>HN(t,s,r)).then(s=>UN(t,s,r)).then(s=>YN(s,r))}const Cg=/url\((['"]?)([^'"]+?)\1\)/g,XN=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,GN=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function KN(t){const r=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function QN(t){const r=[];return t.replace(Cg,(i,s,a)=>(r.push(a),i)),r.filter(i=>!vu(i))}async function qN(t,r,i,s,a){try{const c=i?xN(r,i):r,u=$u(r);let h;return a||(h=await Fu(c,u,s)),t.replace(KN(r),`$1${h}$3`)}catch{}return t}function ZN(t,{preferredFontFormat:r}){return r?t.replace(GN,i=>{for(;;){const[s,,a]=XN.exec(i)||[];if(!a)return"";if(a===r)return`src: ${s};`}}):t}function _g(t){return t.search(Cg)!==-1}async function jg(t,r,i){if(!_g(t))return t;const s=ZN(t,i);return QN(s).reduce((c,u)=>c.then(h=>qN(h,u,r,i)),Promise.resolve(s))}async function io(t,r,i){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const c=await jg(a,null,i);return r.style.setProperty(t,c,r.style.getPropertyPriority(t)),!0}return!1}async function JN(t,r){await io("background",t,r)||await io("background-image",t,r),await io("mask",t,r)||await io("-webkit-mask",t,r)||await io("mask-image",t,r)||await io("-webkit-mask-image",t,r)}async function eE(t,r){const i=Yt(t,HTMLImageElement);if(!(i&&!vu(t.src))&&!(Yt(t,SVGImageElement)&&!vu(t.href.baseVal)))return;const s=i?t.src:t.href.baseVal,a=await Fu(s,$u(s),r);await new Promise((c,u)=>{t.onload=c,t.onerror=r.onImageErrorHandler?(...m)=>{try{c(r.onImageErrorHandler(...m))}catch(g){u(g)}}:u;const h=t;h.decode&&(h.decode=c),h.loading==="lazy"&&(h.loading="eager"),i?(t.srcset="",t.src=a):t.href.baseVal=a})}async function tE(t,r){const s=Ur(t.childNodes).map(a=>bg(a,r));await Promise.all(s).then(()=>t)}async function bg(t,r){Yt(t,Element)&&(await JN(t,r),await eE(t,r),await tE(t,r))}function nE(t,r){const{style:i}=t;r.backgroundColor&&(i.backgroundColor=r.backgroundColor),r.width&&(i.width=`${r.width}px`),r.height&&(i.height=`${r.height}px`);const s=r.style;return s!=null&&Object.keys(s).forEach(a=>{i[a]=s[a]}),t}const wp={};async function Sp(t){let r=wp[t];if(r!=null)return r;const s=await(await fetch(t)).text();return r={url:t,cssText:s},wp[t]=r,r}async function kp(t,r){let i=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,c=(i.match(/url\([^)]+\)/g)||[]).map(async u=>{let h=u.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,t.url).href),Ng(h,r.fetchRequestInit,({result:m})=>(i=i.replace(u,`url(${m})`),[u,m]))});return Promise.all(c).then(()=>i)}function Np(t){if(t==null)return[];const r=[],i=/(\/\*[\s\S]*?\*\/)/gi;let s=t.replace(i,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=a.exec(s);if(m===null)break;r.push(m[0])}s=s.replace(a,"");const c=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(u,"gi");for(;;){let m=c.exec(s);if(m===null){if(m=h.exec(s),m===null)break;c.lastIndex=h.lastIndex}else h.lastIndex=c.lastIndex;r.push(m[0])}return r}async function rE(t,r){const i=[],s=[];return t.forEach(a=>{if("cssRules"in a)try{Ur(a.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let h=u+1;const m=c.href,g=Sp(m).then(v=>kp(v,r)).then(v=>Np(v).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?h+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(v=>{console.error("Error loading remote css",v.toString())});s.push(g)}})}catch(c){const u=t.find(h=>h.href==null)||document.styleSheets[0];a.href!=null&&s.push(Sp(a.href).then(h=>kp(h,r)).then(h=>Np(h).forEach(m=>{u.insertRule(m,u.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(t.forEach(a=>{if("cssRules"in a)try{Ur(a.cssRules||[]).forEach(c=>{i.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${a.href}`,c)}}),i))}function iE(t){return t.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>_g(r.style.getPropertyValue("src")))}async function oE(t,r){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const i=Ur(t.ownerDocument.styleSheets),s=await rE(i,r);return iE(s)}function Mg(t){return t.trim().replace(/["']/g,"")}function sE(t){const r=new Set;function i(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(c=>{r.add(Mg(c))}),Array.from(s.children).forEach(c=>{c instanceof HTMLElement&&i(c)})}return i(t),r}async function lE(t,r){const i=await oE(t,r),s=sE(t);return(await Promise.all(i.filter(c=>s.has(Mg(c.style.fontFamily))).map(c=>{const u=c.parentStyleSheet?c.parentStyleSheet.href:null;return jg(c.cssText,u,r)}))).join(`
63
- `)}async function aE(t,r){const i=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await lE(t,r);if(i){const s=document.createElement("style"),a=document.createTextNode(i);s.appendChild(a),t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s)}}async function Pg(t,r={}){const{width:i,height:s}=kg(t,r),a=await da(t,r,!0);return await aE(a,r),await bg(a,r),nE(a,r),await _N(a,i,s)}async function cE(t,r={}){const{width:i,height:s}=kg(t,r),a=await Pg(t,r),c=await Zl(a),u=document.createElement("canvas"),h=u.getContext("2d"),m=r.pixelRatio||NN(),g=r.canvasWidth||i,v=r.canvasHeight||s;return u.width=g*m,u.height=v*m,r.skipAutoScale||EN(u),u.style.width=`${g}`,u.style.height=`${v}`,r.backgroundColor&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,u.width,u.height)),h.drawImage(c,0,0,u.width,u.height),u}async function uE(t,r={}){return(await cE(t,r)).toDataURL()}function dE({feature:t,onClose:r}){return d.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:r,children:d.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:i=>i.stopPropagation(),children:[d.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),d.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[t," is a Pro feature"]}),d.jsxs("p",{style:{color:"#aaa",margin:"0 0 24px",fontSize:14,lineHeight:1.5},children:["Upgrade to Pro for ",t.toLowerCase(),", drift detection, premium agents, and more."]}),d.jsx("a",{href:"https://heartbyte.io/archbyte/pricing",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",background:"#7c3aed",color:"#fff",padding:"10px 28px",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:14},children:"Upgrade to Pro"}),d.jsx("button",{onClick:r,style:{display:"block",margin:"16px auto 0",background:"none",border:"none",color:"#888",cursor:"pointer",fontSize:13},children:"Maybe later"})]})})}function Ep({trigger:t,triggerClassName:r,contentClassName:i,children:s,disabled:a}){const[c,u]=b.useState(!1),h=b.useRef(null);return b.useEffect(()=>{if(!c)return;const m=v=>{h.current&&!h.current.contains(v.target)&&u(!1)},g=()=>u(!1);return document.addEventListener("mousedown",m),document.addEventListener("dropdown:closeall",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("dropdown:closeall",g)}},[c]),d.jsxs("div",{ref:h,className:"dropdown-wrapper",children:[d.jsx("button",{className:r,onClick:()=>!a&&u(!c),disabled:a,children:t}),c&&d.jsx("div",{className:`dropdown-menu ${i||""}`,onClick:()=>u(!1),children:s})]})}const fE={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},Cp={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function hE({data:t,selected:r}){var g,v,y,x,C;const i=t,s=i.label.split(`
64
- `),a=s[0],c=s.slice(1).join(`
65
- `),u=["arch-node",i.layer,i.active?"active":"",i.highlighted?"highlighted":"",i.locked?"locked":"",i.isConnected===!0?"connected":"",i.isConnected===!1?"dimmed":"",i.changeType?`change-${i.changeType}`:"",i.healthScore!=null?i.healthScore>=75?"health-green":i.healthScore>=50?"health-amber":"health-red":"",(g=i.healthFlags)!=null&&g.isOrphan?"health-orphan":"",(v=i.healthFlags)!=null&&v.isHub?"health-hub":"",(y=i.healthFlags)!=null&&y.inCycle?"health-cycle":"",(x=i.pendingFiles)!=null&&x.length?"has-pending-changes":""].filter(Boolean).join(" "),h=fE[i.layer]||"#868e96",m=Cp[i.nodeType]||Cp.component;return d.jsxs(d.Fragment,{children:[d.jsx(vN,{color:h,isVisible:r,minWidth:100,minHeight:60}),d.jsxs("div",{className:u,style:{minWidth:i.width||130,width:"100%",height:"100%"},children:[d.jsx(Wr,{type:"target",position:Ce.Top}),d.jsx(Wr,{type:"target",position:Ce.Left}),d.jsx("div",{className:"node-type-icon",children:m}),d.jsxs("div",{className:"node-content",children:[d.jsx("div",{className:"label",children:a}),c&&d.jsx("div",{className:"sublabel",children:c}),i.description&&d.jsx("div",{className:"node-desc",children:i.description})]}),i.techStack&&i.techStack.length>0&&d.jsx("div",{className:"node-tech-row",children:i.techStack.slice(0,3).map((N,S)=>d.jsx("span",{className:"node-tech-pill",children:N},S))}),i.changeType&&d.jsx("div",{className:`change-indicator change-${i.changeType}`,children:i.changeType==="added"?"+":i.changeType==="modified"?"~":"-"}),i.pendingFiles&&i.pendingFiles.length>0&&d.jsxs("div",{className:"pending-change-badge",children:[i.pendingFiles.some(N=>N.event==="add")?"+":"~",i.pendingFiles.length]}),((C=i.healthFlags)==null?void 0:C.isHub)&&i.healthScore!=null&&d.jsx("div",{className:"health-hub-badge",children:"HUB"}),d.jsx(Wr,{type:"source",position:Ce.Bottom}),d.jsx(Wr,{type:"source",position:Ce.Right})]})]})}const Ig=b.memo(hE),pE={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function mE({selectedEnvironment:t,environments:r,onSelectEnvironment:i}){if(!r||Object.keys(r).length===0)return null;const s=Object.keys(r);return d.jsx("div",{className:"environment-tabs",children:s.map(a=>{var g;const c=t===a,u=r==null?void 0:r[a],h=(u==null?void 0:u.color)||pE[a]||"#6b7280",m=(u==null?void 0:u.label)||a.charAt(0).toUpperCase()+a.slice(1);return d.jsxs("button",{className:`env-tab ${c?"selected":""}`,onClick:()=>i(a),style:{"--env-color":h},children:[d.jsx("span",{className:"env-indicator"}),d.jsx("span",{className:"env-label",children:m}),c&&u&&d.jsx("span",{className:"env-meta",children:[u.deployment,u.scaling,(g=u.urlPatterns||u.urls)==null?void 0:g[0]].filter(Boolean).join(" | ")})]},a)})})}const gE=b.memo(mE);function wi({children:t,className:r,style:i}){const s=b.useRef(null),[a,c]=b.useState({x:0,y:0}),u=b.useRef(!1),h=b.useRef({x:0,y:0}),m=b.useRef({x:0,y:0}),g=b.useCallback(v=>{const y=v.target;if(!y.closest("[data-drag-handle]")||y.closest("button"))return;u.current=!0,h.current={x:v.clientX,y:v.clientY},m.current={...a},v.preventDefault();const C=S=>{u.current&&c({x:m.current.x+(S.clientX-h.current.x),y:m.current.y+(S.clientY-h.current.y)})},N=()=>{u.current=!1,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",N)},[a]);return d.jsx("div",{ref:s,className:r,style:{...i,transform:`translate(${a.x}px, ${a.y}px)`},onMouseDown:g,children:t})}function yE(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function vE(t){return new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function xE({visible:t,onClose:r}){const[i,s]=b.useState(null),a=b.useCallback(async()=>{try{const c=await fetch("/api/stats");c.ok&&s(await c.json())}catch{}},[]);return b.useEffect(()=>{t&&a()},[t,a]),!t||!i?null:d.jsxs(wi,{className:"stats-overlay",children:[d.jsxs("div",{className:"stats-overlay-header","data-drag-handle":!0,children:[d.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),(i.durationMs||i.filesScanned||i.analyzedAt)&&d.jsxs("div",{className:"stats-scan-info",children:[i.durationMs!=null&&d.jsx("span",{className:"scan-info-item",children:yE(i.durationMs)}),i.filesScanned!=null&&d.jsxs("span",{className:"scan-info-item",children:[i.filesScanned.toLocaleString()," files"]}),i.tokenUsage&&d.jsxs("span",{className:"scan-info-item",children:[(i.tokenUsage.input+i.tokenUsage.output).toLocaleString()," tokens"]}),i.analyzedAt&&d.jsx("span",{className:"scan-info-item",children:vE(i.analyzedAt)})]}),d.jsxs("div",{className:"stats-grid",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.components}),d.jsx("div",{className:"stat-label",children:"Components"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.totalConnections}),d.jsx("div",{className:"stat-label",children:"Connections"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.databases}),d.jsx("div",{className:"stat-label",children:"Databases"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.externalServices}),d.jsx("div",{className:"stat-label",children:"External"})]}),d.jsxs("div",{className:`stat-card ${i.orphans>0?"highlight":""}`,children:[d.jsx("div",{className:"stat-value",children:i.orphans}),d.jsx("div",{className:"stat-label",children:"Orphans"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.flows}),d.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const wE=b.memo(xE);function SE({visible:t,onClose:r,builtinRules:i,customRules:s,onAddRule:a,onDeleteRule:c,onSave:u,saving:h}){const[m,g]=b.useState("builtin"),[v,y]=b.useState(""),[x,C]=b.useState(""),[N,S]=b.useState(""),[_,E]=b.useState("warn");if(!t)return null;const P=()=>{!v.trim()||!x.trim()||!N.trim()||(a({name:v.trim(),from:x.trim(),to:N.trim(),level:_}),y(""),C(""),S(""),E("warn"))};return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:999},onClick:r}),d.jsxs("div",{className:"rules-config-modal",children:[d.jsxs("div",{className:"rules-modal-header",children:[d.jsx("span",{className:"rules-modal-title",children:"Configure Rules"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),d.jsxs("div",{className:"rules-modal-tabs",children:[d.jsx("button",{className:`rules-modal-tab ${m==="builtin"?"active":""}`,onClick:()=>g("builtin"),children:"Built-in"}),d.jsx("button",{className:`rules-modal-tab ${m==="custom"?"active":""}`,onClick:()=>g("custom"),children:"Custom"})]}),d.jsxs("div",{className:"rules-modal-content",children:[m==="builtin"&&d.jsxs("div",{children:[d.jsx("div",{className:"rules-section-title",children:"Built-in Architecture Rules"}),i.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No built-in rules available"}):i.map(k=>d.jsxs("div",{className:"rule-config-item",children:[d.jsx("div",{className:"rule-config-name",children:k.name}),d.jsx("div",{className:"rule-config-desc",children:k.description||"No description"})]},k.name))]}),m==="custom"&&d.jsxs("div",{children:[d.jsx("div",{className:"rules-section-title",children:"Custom Rules"}),s.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No custom rules yet"}):s.map((k,j)=>d.jsxs("div",{className:"rule-config-item custom",children:[d.jsxs("div",{className:"rule-config-name",children:[k.name,d.jsx("span",{className:`rule-level-badge ${k.level}`,children:k.level})]}),d.jsxs("div",{className:"rule-config-matcher",children:[k.from," → ",k.to]}),d.jsx("button",{className:"panel-btn red small rule-delete-btn",onClick:()=>c(j),children:"x"})]},j)),d.jsxs("div",{className:"rule-add-form",children:[d.jsx("div",{className:"rule-add-title",children:"Add Custom Rule"}),d.jsx("input",{type:"text",placeholder:"Rule name",value:v,onChange:k=>y(k.target.value),className:"rule-input"}),d.jsxs("div",{className:"rule-add-row",children:[d.jsx("input",{type:"text",placeholder:"From (e.g. layer:presentation)",value:x,onChange:k=>C(k.target.value),className:"rule-input"}),d.jsx("span",{className:"rule-arrow",children:"→"}),d.jsx("input",{type:"text",placeholder:"To (e.g. layer:data)",value:N,onChange:k=>S(k.target.value),className:"rule-input"})]}),d.jsxs("div",{className:"rule-add-row",children:[d.jsxs("select",{value:_,onChange:k=>E(k.target.value),className:"rule-select",children:[d.jsx("option",{value:"warn",children:"warn"}),d.jsx("option",{value:"error",children:"error"})]}),d.jsx("button",{className:"panel-btn green small",onClick:P,children:"Add"})]})]}),d.jsx("div",{className:"rules-save-row",children:d.jsx("button",{className:"panel-btn cyan",onClick:u,disabled:h,children:h?"Saving...":"Save & Re-audit"})})]})]})]})]})}const kE=b.memo(SE);function yt(t,r){fetch("/api/ui-event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:t,detail:r})}).catch(()=>{})}function NE(t){return t>=75?"var(--accent-green)":t>=50?"var(--accent-amber)":"var(--accent-red)"}function EE({visible:t,onClose:r,onHighlightNode:i}){var Z;const[s,a]=b.useState(null),[c,u]=b.useState(!1),[h,m]=b.useState(!1),[g,v]=b.useState([]),[y,x]=b.useState(!1),[C,N]=b.useState("issues"),[S,_]=b.useState({issues:{rules:!1,structural:!1},metrics:{metrics:!1,components:!1}}),E=(V,J)=>{_(U=>({...U,[V]:{...U[V],[J]:!U[V][J]}}))},P=b.useCallback(async()=>{var V;yt("audit-run"),u(!0);try{const J=await fetch("/api/audit");if(J.ok){const U=await J.json();a(U),(V=U.rules)!=null&&V.custom&&v(U.rules.custom)}}catch{}u(!1)},[]);b.useEffect(()=>{t&&P()},[t,P]);const k=async()=>{x(!0);try{await fetch("/api/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:g})}),await P()}catch{}x(!1)},j=V=>{v(g.filter((J,U)=>U!==V))};if(!t)return null;const F=(s==null?void 0:s.issues.filter(V=>V.type==="rule-violation"))||[],L=(s==null?void 0:s.issues.filter(V=>V.type==="structural"))||[],B=s?[...s.nodes].sort((V,J)=>V.modularityIndex-J.modularityIndex):[];return d.jsxs(wi,{className:"audit-panel",children:[d.jsxs("div",{className:"audit-header","data-drag-handle":!0,children:[d.jsx("span",{className:"audit-title",children:"Architecture Audit"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("button",{className:"panel-btn cyan small",onClick:P,disabled:c,children:c?"...":"Re-audit"}),d.jsx("button",{className:`panel-btn small ${h?"cyan":""}`,onClick:()=>m(!h),children:"Config"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),d.jsxs("div",{className:"audit-tabs",children:[d.jsx("button",{className:`audit-tab ${C==="issues"?"active":""}`,onClick:()=>N("issues"),children:"Issues"}),d.jsx("button",{className:`audit-tab ${C==="metrics"?"active":""}`,onClick:()=>N("metrics"),children:"Metrics"})]}),c&&!s?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Auditing..."}):s?d.jsxs(d.Fragment,{children:[C==="issues"&&d.jsxs(d.Fragment,{children:[F.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("issues","rules"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.issues.rules?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Rule Violations (",F.length,")"]})]}),S.issues.rules&&d.jsx("div",{className:"audit-section-content",children:F.map((V,J)=>d.jsxs("div",{className:`audit-issue ${V.level}`,onClick:()=>{V.nodeIds&&V.nodeIds.length>0&&i(V.nodeIds[0])},children:[d.jsxs("div",{className:"audit-issue-rule",children:[V.rule,V.ruleType==="custom"&&d.jsx("span",{className:"rule-type-badge custom",children:"custom"})]}),d.jsx("div",{className:"audit-issue-message",children:V.message})]},J))})]}),L.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("issues","structural"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.issues.structural?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Structural Issues (",L.length,")"]})]}),S.issues.structural&&d.jsx("div",{className:"audit-section-content",children:L.map((V,J)=>d.jsxs("div",{className:`audit-issue ${V.level}`,onClick:()=>{V.nodeIds&&V.nodeIds.length>0&&i(V.nodeIds[0])},children:[d.jsx("div",{className:"audit-issue-rule",children:V.metric}),d.jsx("div",{className:"audit-issue-message",children:V.message})]},J))})]})]}),C==="metrics"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("metrics","metrics"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.metrics.metrics?"▼":"▶"}),d.jsx("span",{className:"audit-section-title",children:"Architecture Metrics"})]}),S.metrics.metrics&&d.jsx("div",{className:"audit-section-content",children:d.jsxs("div",{className:"audit-metrics",children:[d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"Circular Dependencies"}),d.jsx("span",{style:{color:s.metrics.circularDependencies>0?"var(--accent-red)":"var(--accent-green)"},children:s.metrics.circularDependencies})]}),d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"High-Degree Hubs"}),d.jsx("span",{style:{color:s.metrics.highDegreeHubCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.highDegreeHubCount})]}),d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"Disconnected"}),d.jsx("span",{style:{color:s.metrics.disconnectedComponentCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.disconnectedComponentCount})]})]})})]}),d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("metrics","components"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.metrics.components?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Component Health (",s.nodes.length,")"]})]}),S.metrics.components&&d.jsx("div",{className:"audit-section-content",children:B.map(V=>d.jsxs("div",{className:"audit-component-item",onClick:()=>i(V.id),children:[d.jsx("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:NE(V.modularityIndex),flexShrink:0},title:`Health: ${V.modularityIndex}/100`}),d.jsxs("div",{className:"audit-component-info",children:[d.jsx("div",{className:"audit-component-name",children:V.label}),d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)"},children:[V.inDegree,"↓ ",V.outDegree,"↑"]})]})]},V.id))})]})]}),d.jsx(kE,{visible:h,onClose:()=>m(!1),builtinRules:((Z=s.rules)==null?void 0:Z.builtin)||[],customRules:g,onAddRule:V=>{v([...g,V])},onDeleteRule:V=>j(V),onSave:k,saving:y})]}):null]})}const CE=b.memo(EE);function _E({visible:t}){const[r,i]=b.useState([]),[s,a]=b.useState(null),[c,u]=b.useState(null),[h,m]=b.useState(!0),[g,v]=b.useState(null),[y,x]=b.useState(null),C=b.useRef(null),N=b.useCallback(async()=>{try{const P=await fetch("/api/workflow/list");P.ok&&i(await P.json())}catch{}m(!1)},[]),S=b.useCallback(async P=>{try{const k=await fetch(`/api/workflow/status/${P}`);if(k.ok){const j=await k.json();u(j),j&&g===P&&(j.status==="completed"||j.status==="failed")&&(v(null),N())}}catch{}},[g,N]);b.useEffect(()=>{if(t){N();const P=setInterval(N,g?3e3:1e4);return()=>clearInterval(P)}},[t,N,g]),b.useEffect(()=>(C.current&&clearInterval(C.current),s&&(S(s),C.current=setInterval(()=>S(s),g?3e3:1e4)),()=>{C.current&&clearInterval(C.current)}),[s,S,g]);const _=async P=>{yt("workflow-run",P),x(null);try{const k=await fetch(`/api/workflow/run/${P}`,{method:"POST"});if(k.ok)v(P);else{const j=await k.json();x(j.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},E=async P=>{x(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:P})})).ok&&(u(null),N())}catch{}};return t?h?d.jsx("div",{className:"ops-section",children:d.jsx("div",{className:"ops-empty",children:"Loading..."})}):r.length===0?d.jsx("div",{className:"ops-section",children:d.jsxs("div",{className:"ops-empty",children:["No workflows available.",d.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):d.jsxs("div",{className:"ops-section",children:[y&&d.jsx("div",{className:"wf-error",children:y}),r.map(P=>{const k=s===P.id,j=g===P.id;return d.jsxs("div",{className:"wf-item",children:[d.jsxs("div",{className:"wf-header",onClick:()=>a(k?null:P.id),children:[d.jsxs("div",{className:"wf-header-left",children:[d.jsx("span",{className:"wf-expand",children:k?"−":"+"}),d.jsx("span",{className:"wf-name",children:P.name}),P.builtin&&d.jsx("span",{className:"wf-tag",children:"built-in"})]}),(j||P.status)&&d.jsx("span",{className:`wf-status ${j?"running":P.status}`,children:j?"running":P.status==="completed"?"done":P.status})]}),k&&d.jsxs("div",{className:"wf-detail",children:[d.jsx("div",{className:"wf-desc",children:P.description}),c&&c.workflowId===P.id?d.jsxs("div",{className:"wf-steps",children:[Object.entries(c.steps).map(([F,L])=>d.jsxs("div",{className:`wf-step ${L.status}`,children:[d.jsx("span",{className:"wf-step-icon",children:L.status==="completed"?"✓":L.status==="running"?"▶":L.status==="failed"?"✗":"○"}),d.jsx("span",{className:"wf-step-id",children:F})]},F)),(()=>{const F=Object.keys(c.steps).length,L=Object.values(c.steps).filter(Z=>Z.status==="completed").length,B=F>0?Math.round(L/F*100):0;return d.jsxs("div",{className:"wf-progress",children:[d.jsx("div",{className:"wf-progress-bar",children:d.jsx("div",{className:"wf-progress-fill",style:{width:`${B}%`}})}),d.jsxs("span",{className:"wf-progress-label",children:[B,"%"]})]})})()]}):d.jsx("div",{className:"wf-steps-preview",children:P.steps.length>0?P.steps.join(" → "):"No state yet"}),d.jsxs("div",{className:"wf-actions",children:[d.jsx("button",{className:"panel-btn cyan",disabled:j,onClick:()=>_(P.id),children:j?"Running...":"Run"}),(P.status==="completed"||P.status==="failed")&&!j&&d.jsx("button",{className:"panel-btn amber",onClick:()=>E(P.id),children:"Reset"})]})]})]},P.id)})]}):null}const jE=b.memo(_E);function bE({projectInfo:t}){const[r,i]=b.useState(!1),s=b.useRef(null);return b.useEffect(()=>{if(!r)return;const a=c=>{s.current&&!s.current.contains(c.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]),t?d.jsxs("div",{className:"project-info-wrapper",ref:s,children:[d.jsx("button",{className:"project-info-trigger",onClick:()=>i(!r),children:t.name}),r&&d.jsxs("div",{className:"project-info-popup",children:[d.jsxs("div",{className:"project-info-header",children:[d.jsx("span",{className:"project-info-name",children:t.name}),t.primaryLanguage&&d.jsx("span",{className:"project-info-lang",children:t.primaryLanguage})]}),t.description&&d.jsx("p",{className:"project-info-desc",children:t.description}),t.isMonorepo&&d.jsx("div",{className:"project-info-badge",children:"Monorepo"}),t.workspacePath&&d.jsxs("a",{className:"project-info-vscode",href:`vscode://file${t.workspacePath}`,title:"Open folder in VS Code",children:[d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M17.583 2.214L12.52 6.768 7.84 3.96 2.4 5.88v12.24l5.44 1.92 4.68-2.808 5.063 4.554L21.6 19.8V4.2l-4.017-1.986zM7.84 15.12V8.88l4.68 3.12-4.68 3.12zm9.743 2.544l-3.96-3.564 3.96-3.564v7.128z"})}),"Open in VS Code"]})]})]}):null}const ME={architecture:Ig},PE=1500;function IE({flow:t,architecture:r,onClose:i}){var C;const[s,a]=b.useState(0),[c,u]=b.useState(new Set([(C=t.steps[0])==null?void 0:C.edge])),[h,m]=b.useState(!0),{flowNodeIds:g,flowEdges:v}=b.useMemo(()=>{const N=new Set(t.steps.map(E=>E.edge)),S=r.edges.filter(E=>N.has(E.id)),_=new Set;return S.forEach(E=>{_.add(E.source),_.add(E.target)}),{flowNodeIds:_,flowEdges:S}},[t,r]),y=b.useMemo(()=>{const N=r.nodes.filter(J=>g.has(J.id)),S=320,_=140,E=80,P=80,k=new Map,j=new Map;g.forEach(J=>{k.set(J,0),j.set(J,[])}),v.forEach(J=>{g.has(J.source)&&g.has(J.target)&&(j.get(J.source).push(J.target),k.set(J.target,(k.get(J.target)||0)+1))});const F=new Map,L=[];for(k.forEach((J,U)=>{J===0&&(L.push(U),F.set(U,0))});L.length>0;){const J=L.shift(),U=F.get(J);for(const G of j.get(J)||[]){const te=U+1;(!F.has(G)||F.get(G)<te)&&F.set(G,te),k.set(G,k.get(G)-1),k.get(G)===0&&L.push(G)}}N.forEach(J=>{F.has(J.id)||F.set(J.id,0)});const B=new Map;N.forEach(J=>{const U=F.get(J.id);B.has(U)||B.set(U,[]),B.get(U).push(J)});const Z=[...B.keys()].sort((J,U)=>J-U),V=new Map;return Z.forEach((J,U)=>{B.get(J).forEach((te,z)=>{V.set(te.id,{x:E+U*S,y:P+z*_})})}),N.map(J=>{const U=V.get(J.id)||{x:E,y:P};return{id:J.id,type:"architecture",position:U,data:{label:J.label,layer:J.layer,nodeType:J.type,width:J.width,height:J.height,path:J.path,techStack:J.techStack,description:J.description},style:{width:J.width,zIndex:1}}})},[r,g,v]);b.useEffect(()=>{if(!h)return;const N=setInterval(()=>{a(S=>{const _=S+1;if(_>=t.steps.length)return u(new Set([t.steps[0].edge])),0;const E=new Set;for(let P=0;P<=_;P++)E.add(t.steps[P].edge);return u(E),_})},PE);return()=>clearInterval(N)},[h,t]);const x=b.useMemo(()=>{const N=new Map;return t.steps.forEach((S,_)=>{N.has(S.edge)||N.set(S.edge,_+1)}),v.map(S=>{const _=c.has(S.id),E=N.get(S.id);return{id:S.id,source:S.source,target:S.target,label:_&&E?`${E}`:void 0,labelStyle:_&&E?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:_&&E?{fill:t.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:_?t.color:S.color||"var(--border-color)",strokeWidth:_?5:2,opacity:_?1:.3,filter:_?"brightness(0.85) saturate(1.4)":void 0},animated:_,type:"smoothstep"}})},[v,c,t]);return d.jsx("div",{className:"flow-hud-overlay",children:d.jsxs(wi,{className:"flow-hud-panel",children:[d.jsxs("div",{className:"flow-hud-header","data-drag-handle":!0,children:[d.jsxs("div",{className:"flow-hud-title",children:[d.jsx("span",{className:"flow-hud-dot",style:{background:t.color}}),d.jsx("span",{children:t.name})]}),d.jsxs("div",{className:"flow-hud-controls",children:[h?d.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!1),title:"Pause",children:"⏸"}):d.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!0),title:"Play",children:"▶"}),d.jsx("button",{className:"flow-hud-close",onClick:i,title:"Close",children:"✕"})]})]}),d.jsx("div",{className:"flow-hud-description",children:t.description}),d.jsx("div",{className:"flow-hud-canvas",children:d.jsxs(mg,{nodes:y,edges:x,nodeTypes:ME,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[d.jsx(yg,{variant:Xn.Dots,gap:20,size:1,color:"var(--grid-color)"}),d.jsx(xg,{showInteractive:!1})]})}),d.jsx("div",{className:"flow-hud-steps",children:t.steps.map((N,S)=>d.jsxs("div",{className:`flow-hud-step ${S<=s?"active":""} ${S===s?"current":""}`,style:{borderColor:S<=s?t.color:void 0},children:[d.jsx("span",{className:"flow-hud-step-num",style:{background:S<=s?t.color:void 0},children:S+1}),N.label]},S))})]})})}function TE(t){return d.jsx(pg,{children:d.jsx(IE,{...t})})}const RE=b.memo(TE),zE=[{key:"anthropic",name:"Anthropic",icon:"A",models:"Claude 3.5 Sonnet, Claude 3 Opus",description:"Advanced reasoning and code analysis",requiresKey:!0},{key:"openai",name:"OpenAI",icon:"O",models:"GPT-4o, GPT-4 Turbo",description:"Versatile general-purpose models",requiresKey:!0},{key:"google",name:"Google",icon:"G",models:"Gemini 1.5 Pro, Gemini 1.5 Flash",description:"Fast multimodal analysis",requiresKey:!0}];function AE({onComplete:t}){const[r,i]=b.useState(1),[s,a]=b.useState(null),[c,u]=b.useState(""),[h,m]=b.useState(!1),[g,v]=b.useState(null),y=S=>{a(S),u(""),v(null),S.requiresKey?i(2):i(3)},x=()=>{if(!c.trim()){v("API key is required");return}v(null),i(3)},C=async()=>{if(s){m(!0),v(null);try{const S={provider:s.key};s.requiresKey&&c.trim()&&(S.apiKey=c.trim());const _=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if(!_.ok){const E=await _.json();throw new Error(E.error||"Failed to save configuration")}t()}catch(S){v(S instanceof Error?S.message:"Failed to save configuration"),m(!1)}}},N=()=>{v(null),r===3&&(s!=null&&s.requiresKey)?i(2):r===3&&!(s!=null&&s.requiresKey)?i(1):(i(1),a(null),u(""))};return d.jsx("div",{style:Re.overlay,onClick:S=>S.stopPropagation(),children:d.jsxs("div",{style:Re.modal,children:[d.jsxs("div",{style:Re.header,children:[d.jsx("div",{style:Re.headerIcon,children:"⚙"}),d.jsx("h2",{style:Re.title,children:"Set Up Your AI Provider"}),d.jsx("p",{style:Re.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),d.jsx("div",{style:Re.stepIndicator,children:[1,2,3].map(S=>d.jsxs("div",{style:Re.stepRow,children:[d.jsx("div",{style:{...Re.stepDot,background:S<=r?"#7c3aed":"#3a3a4a",color:S<=r?"#fff":"#888"},children:S}),d.jsx("span",{style:{...Re.stepLabel,color:S<=r?"#ccc":"#666"},children:S===1?"Provider":S===2?"API Key":"Confirm"}),S<3&&d.jsx("div",{style:{...Re.stepLine,background:S<r?"#7c3aed":"#3a3a4a"}})]},S))}),r===1&&d.jsx("div",{style:Re.stepContent,children:d.jsx("div",{style:Re.providerGrid,children:zE.map(S=>d.jsxs("button",{style:{...Re.providerCard,borderColor:(s==null?void 0:s.key)===S.key?"#7c3aed":"#5a5a7a"},onClick:()=>y(S),onMouseEnter:_=>{_.currentTarget.style.borderColor="#7c3aed",_.currentTarget.style.background="#2a2a3e"},onMouseLeave:_=>{(s==null?void 0:s.key)!==S.key&&(_.currentTarget.style.borderColor="#5a5a7a"),_.currentTarget.style.background="#252536"},children:[d.jsx("div",{style:Re.providerIcon,children:S.icon}),d.jsx("div",{style:Re.providerName,children:S.name}),d.jsx("div",{style:Re.providerModels,children:S.models}),d.jsx("div",{style:Re.providerDesc,children:S.description}),!S.requiresKey&&d.jsx("div",{style:Re.noKeyBadge,children:"No API key needed"})]},S.key))})}),r===2&&s&&d.jsx("div",{style:Re.stepContent,children:d.jsxs("div",{style:Re.keySection,children:[d.jsxs("div",{style:Re.selectedProviderBadge,children:[d.jsx("span",{style:Re.providerIconSmall,children:s.icon}),d.jsx("span",{children:s.name})]}),d.jsx("label",{style:Re.label,children:"API Key"}),d.jsx("input",{type:"password",value:c,onChange:S=>{u(S.target.value),v(null)},placeholder:`Enter your ${s.name} API key`,style:Re.input,autoFocus:!0,onKeyDown:S=>{S.key==="Enter"&&x()}}),d.jsxs("p",{style:Re.keyHint,children:["Your key is stored locally in ",d.jsx("code",{style:Re.code,children:".archbyte/config.json"})," and never sent to external servers."]}),g&&d.jsx("div",{style:Re.error,children:g}),d.jsxs("div",{style:Re.buttonRow,children:[d.jsx("button",{style:Re.backBtn,onClick:N,children:"Back"}),d.jsx("button",{style:{...Re.primaryBtn,opacity:c.trim()?1:.5,cursor:c.trim()?"pointer":"not-allowed"},onClick:x,disabled:!c.trim(),children:"Continue"})]})]})}),r===3&&s&&d.jsx("div",{style:Re.stepContent,children:d.jsxs("div",{style:Re.confirmSection,children:[d.jsx("div",{style:Re.confirmIcon,children:"✓"}),d.jsx("h3",{style:Re.confirmTitle,children:"Ready to Analyze"}),d.jsxs("div",{style:Re.confirmDetails,children:[d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"Provider"}),d.jsxs("span",{style:Re.confirmValue,children:[d.jsx("span",{style:Re.providerIconSmall,children:s.icon}),s.name]})]}),d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"Models"}),d.jsx("span",{style:Re.confirmValue,children:s.models})]}),s.requiresKey&&d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"API Key"}),d.jsxs("span",{style:Re.confirmValue,children:["*".repeat(Math.min(c.length,8)),"...",c.slice(-4)]})]})]}),g&&d.jsx("div",{style:Re.error,children:g}),d.jsxs("div",{style:Re.buttonRow,children:[d.jsx("button",{style:Re.backBtn,onClick:N,children:"Back"}),d.jsx("button",{style:{...Re.runBtn,opacity:h?.6:1,cursor:h?"wait":"pointer"},onClick:C,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Re={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},LE={"security-audit":{label:"Security Audit",icon:"⚠",color:"var(--accent-red)"},compliance:{label:"Compliance",icon:"☑",color:"var(--accent-cyan)"},performance:{label:"Performance",icon:"⚡",color:"var(--accent-amber)"},"dependency-risk":{label:"Dependency Risk",icon:"⬢",color:"#c084fc"},migration:{label:"Migration Plan",icon:"→",color:"var(--accent-green)"},"api-contracts":{label:"API Contracts",icon:"↔",color:"#60a5fa"},"drift-detection":{label:"Drift Detection",icon:"◎",color:"#f472b6"}},Yr={critical:0,high:1,medium:2,low:3};function Cs({severity:t}){const r={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},i={critical:"hsl(0 90% 55% / 0.15)",high:"hsl(25 95% 53% / 0.15)",medium:"hsl(38 92% 50% / 0.15)",low:"hsl(142 76% 42% / 0.15)"},s={critical:"hsl(0 90% 55% / 0.3)",high:"hsl(25 95% 53% / 0.3)",medium:"hsl(38 92% 50% / 0.3)",low:"hsl(142 76% 42% / 0.3)"};return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r[t],background:i[t],border:`1px solid ${s[t]}`,whiteSpace:"nowrap"},children:t})}function DE({value:t}){const r=Math.round(t*100);return d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:`${r}%`,height:"100%",borderRadius:2,background:r>=80?"var(--accent-green)":r>=50?"var(--accent-amber)":"var(--accent-red)"}})}),d.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[r,"%"]})]})}function $E({status:t}){const i={compliant:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},partial:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},"non-compliant":{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function FE({status:t}){const i={completed:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},"in-progress":{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",border:"var(--border-color)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function OE({driftType:t}){const i={added:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},removed:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},modified:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function HE({data:t}){const r=[...t.findings].sort((i,s)=>Yr[i.severity]-Yr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.owaspId}),d.jsx(Cs,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.title}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.affectedComponent&&d.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",i.affectedComponent]})]},s))})}function BE({data:t}){return t.statuses.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.statuses.map((r,i)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[d.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:r.framework}),d.jsx($E,{status:r.status})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[d.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:r.controls>0?`${Math.round(r.passing/r.controls*100)}%`:"0%",height:"100%",borderRadius:2,background:r.status==="compliant"?"var(--accent-green)":r.status==="partial"?"var(--accent-amber)":"var(--accent-red)",transition:"width 0.3s"}})}),d.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[r.passing,"/",r.controls]})]}),r.findings.length>0&&d.jsx("div",{style:{marginTop:4},children:r.findings.map((s,a)=>d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},a))})]},i))})}function VE({data:t}){const r=[...t.bottlenecks].sort((i,s)=>Yr[i.severity]-Yr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.component}),d.jsx(Cs,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.metric}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.recommendation&&d.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:i.recommendation})]},s))})}function WE({data:t}){const r=[...t.risks].sort((i,s)=>s.riskScore-i.riskScore);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[i.package,d.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",i.version]})]}),d.jsx(Cs,{severity:i.severity})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[d.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),d.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:`${i.riskScore}%`,height:"100%",borderRadius:2,background:i.riskScore>=75?"var(--accent-red)":i.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:i.riskScore})]}),i.reasons.length>0&&d.jsx("div",{style:{marginTop:2},children:i.reasons.map((a,c)=>d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",a]},c))})]},s))})}function UE({data:t}){const r=[...t.steps].sort((i,s)=>i.order-s.order);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.status==="completed"?"var(--accent-green)":i.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:i.status==="completed"?.7:1},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",i.order]}),d.jsx(FE,{status:i.status})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.title}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.estimatedEffort&&d.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",i.estimatedEffort]})]},s))})}function YE({data:t}){const r=[...t.mismatches].sort((i,s)=>Yr[i.severity]-Yr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:i.endpoint}),d.jsx(Cs,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:i.field}),d.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),d.jsx("div",{style:{color:"var(--accent-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(142 76% 42% / 0.08)",borderRadius:3},children:i.specValue})]}),d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),d.jsx("div",{style:{color:"var(--accent-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(0 90% 55% / 0.08)",borderRadius:3},children:i.implValue})]})]})]},s))})}function XE({data:t}){const r=[...t.detections].sort((i,s)=>Yr[i.severity]-Yr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.component}),d.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[d.jsx(OE,{driftType:i.driftType}),d.jsx(Cs,{severity:i.severity})]})]}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(i.detectedAt).toLocaleString()})]},s))})}function GE({visible:t,onClose:r,results:i}){const[s,a]=b.useState(new Set),[c,u]=b.useState(!1),[h,m]=b.useState([]),g=b.useCallback(_=>{a(E=>{const P=new Set(E);return P.has(_)?P.delete(_):P.add(_),P})},[]),v=b.useCallback(async()=>{u(!0);try{const _=await fetch("/api/premium-agents/results");if(_.ok){const E=await _.json();Array.isArray(E)&&m(E)}}catch{}u(!1)},[]);b.useEffect(()=>{t&&v()},[t,v]);const y=i.length>0?i:h,x=new Map;y.forEach(_=>{x.set(_.agentId,_)});const C=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection"];function N(_){const E=_.data;switch(E.agentId){case"security-audit":return E.findings.length;case"compliance":return E.statuses.length;case"performance":return E.bottlenecks.length;case"dependency-risk":return E.risks.length;case"migration":return E.steps.length;case"api-contracts":return E.mismatches.length;case"drift-detection":return E.detections.length}}function S(_){const E=_.data;switch(E.agentId){case"security-audit":return d.jsx(HE,{data:E});case"compliance":return d.jsx(BE,{data:E});case"performance":return d.jsx(VE,{data:E});case"dependency-risk":return d.jsx(WE,{data:E});case"migration":return d.jsx(UE,{data:E});case"api-contracts":return d.jsx(YE,{data:E});case"drift-detection":return d.jsx(XE,{data:E})}}return t?d.jsxs(wi,{style:{position:"absolute",top:60,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[d.jsxs("div",{"data-drag-handle":!0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)",cursor:"grab"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),d.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d.jsx("button",{className:"panel-btn cyan small",onClick:v,disabled:c,children:c?"...":"Refresh"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),d.jsx("div",{style:{padding:"8px 10px 12px"},children:c&&y.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):y.length===0?d.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",d.jsx("span",{style:{display:"block",marginTop:6,fontSize:10,color:"var(--accent-cyan)",opacity:.7,fontFamily:"'JetBrains Mono', monospace"},children:"Run agents to see results here"})]}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:C.map(_=>{const E=x.get(_);if(!E)return null;const P=LE[_],k=s.has(_),j=N(E);return d.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[d.jsxs("div",{onClick:()=>g(_),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:k?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:F=>{k||(F.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:F=>{k||(F.currentTarget.style.background="transparent")},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:12},children:P.icon}),d.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:P.label}),j>0&&d.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:j})]}),d.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:d.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:k?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),k&&d.jsxs("div",{style:{padding:"6px 10px 10px"},children:[d.jsxs("div",{style:{marginBottom:8},children:[d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),d.jsx(DE,{value:E.confidence})]}),S(E),d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(E.timestamp).toLocaleString()})]})]},_)})})}),y.length>0&&d.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[y.length," of ",C.length," agents reporting"]})]}):null}const KE=b.memo(GE);function oo(t,r){return!t||t.length===0?!0:t.includes(r)}const QE=1500,qE={architecture:Ig};function ZE(t,r){const u=["presentation","application","data","external","deployment"],h={};t.forEach(v=>{const y=v.layer||"application";h[y]||(h[y]=[]),h[y].push(v)});const m=new Map;let g=100;return u.forEach(v=>{const y=h[v]||[];y.forEach((x,C)=>{m.set(x.id,{x:100+C*250,y:g})}),y.length>0&&(g+=180)}),Object.entries(h).forEach(([v,y])=>{u.includes(v)||(y.forEach((x,C)=>{m.set(x.id,{x:100+C*250,y:g})}),g+=180)}),t.map(v=>{const y=v.userPositioned?{x:v.x,y:v.y}:m.get(v.id)||{x:100,y:100};return{id:v.id,type:"architecture",position:y,data:{label:v.label,layer:v.layer,nodeType:v.type,width:v.width,height:v.height,path:v.path,techStack:v.techStack,description:v.description},style:{width:v.width,zIndex:1}}})}function _p(t,r="#64748b"){return t.map(i=>({id:i.id,source:i.source,target:i.target,label:void 0,labelStyle:void 0,labelBgStyle:void 0,labelBgPadding:[4,3],style:{stroke:i.color||r,strokeWidth:2,...i.style==="dashed"&&{strokeDasharray:"8 4"}},animated:i.animated||!1,type:"smoothstep",markerEnd:{type:ps.ArrowClosed,width:16,height:16,color:i.color||r}}))}function so({title:t,defaultOpen:r,children:i}){const[s,a]=b.useState(r??!1);return d.jsxs("div",{className:`dd-section ${s?"open":""}`,children:[d.jsxs("button",{className:"dd-section-header",onClick:()=>a(!s),children:[d.jsx("span",{className:"dd-section-chevron",children:s?"▾":"▸"}),d.jsx("span",{className:"dd-section-title",children:t})]}),s&&d.jsx("div",{className:"dd-section-content",children:i})]})}function Tg(t,r,i=0){return t.slice(0,50).map((s,a)=>{const c=s.path.replace(r+"/","").split("/").pop()||s.path,u=i*12;return s.type==="directory"?d.jsxs("div",{children:[d.jsxs("div",{className:"dd-tree-entry dir",style:{paddingLeft:u},children:[d.jsx("span",{className:"dd-tree-icon",children:"📁"})," ",c,"/"]}),s.children&&Tg(s.children,r,i+1)]},a):d.jsxs("div",{className:"dd-tree-entry file",style:{paddingLeft:u},children:[d.jsx("span",{className:"dd-tree-icon",children:"📄"})," ",c]},a)})}function JE(){var Cr;const[t,r,i]=Uk([]),[s,a,c]=Yk([]),[u,h]=b.useState(null),[m,g]=b.useState(!1),[v,y]=b.useState(null),[x]=b.useState([]),[C,N]=b.useState(!0),[S,_]=b.useState(null),[E,P]=b.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!0,workflows:!1,chat:!1,premiumAgents:!1}}),[k,j]=b.useState(!1),[F,L]=b.useState(null),[B,Z]=b.useState(!1),[V,J]=b.useState(null),[U,G]=b.useState(!1),[te,z]=b.useState(null),[,Q]=b.useState(null),[W,K]=b.useState(null),[M,A]=b.useState(null),[Y,I]=b.useState(-1),[$,se]=b.useState(!1),[le,de]=b.useState(new Set),[he,me]=b.useState(!1),[oe,pe]=b.useState(new Set),[je,Ie]=b.useState(new Set),[ke,Ne]=b.useState(null),[$e,Fe]=b.useState("layer"),[Ae,et]=b.useState(!1),[St,kt]=b.useState(!1),[ht,Nt]=b.useState(!1),[At,Xt]=b.useState(!1),[dr,Qn]=b.useState([]),[be,rn]=b.useState(null),[on,Xr]=b.useState(!1),[hn,pn]=b.useState(!1),[Lt,Gr]=b.useState("develop"),[,Kr]=b.useState([]),[yo,fr]=b.useState(),[hr,pr]=b.useState(null),[Gt,Qr]=b.useState(null),[Tt,vt]=b.useState(new Map),[mr,qr]=b.useState(!1),mn=b.useRef([]),[gr,ji]=b.useState([]),Zr=50,[,yr]=b.useState([]),[,gn]=b.useState([]),[Pn,vr]=b.useState(new Set),[Dt,In]=b.useState(new Set),[lt,xr]=b.useState(()=>{const R=localStorage.getItem("archbyte-theme");return R==="dark"||R==="light"?R:"light"});b.useEffect(()=>{document.documentElement.setAttribute("data-theme",lt),localStorage.setItem("archbyte-theme",lt)},[lt]);const[Et]=b.useState(()=>!!window.__ARCHBYTE_DATA__),[bi,Tn]=b.useState(!1),[vo,Ct]=b.useState(!1),[tt,wr]=b.useState(null),qn=lt==="dark"?"#64748b":"#94a3b8",Jr="#fff",ei=20,Kt=10,Rn=b.useCallback(async()=>{const R=window.__ARCHBYTE_DATA__;if(R){Nr(R),P({loggedIn:!0,email:null,tier:"premium",features:{analyze:!0,validate:!0,workflows:!0,chat:!0,premiumAgents:!0}}),j(!0),g(!0),N(!1);return}try{await Ti()}catch(H){console.error("Failed to load architecture:",H),_("Failed to connect to server"),_t()}finally{N(!1)}},[]),xo=async()=>{try{const R=await fetch("/api/tools-git");if(R.ok){const H=await R.json();Qr(H)}}catch{}},Mi=async()=>{try{const R=await fetch("/api/config");if(R.ok){const H=await R.json();if(Q(H),H.environments){fr(H.environments);const ne=Object.keys(H.environments);ne.length>0&&!ne.includes(Lt)&&Gr(ne[0])}}}catch{}},Ge=async()=>{try{const R=await fetch("/api/license");if(R.ok){const H=await R.json();P(H),j(!0)}}catch{j(!0)}},Pi=async()=>{try{const R=await fetch("/api/project");if(R.ok){const H=await R.json();H&&K(H)}}catch{}},Sr=async()=>{try{const R=await fetch("/api/analysis-status");if(R.ok){const H=await R.json();(H==null?void 0:H.status)==="error"&&H.error?J(H.error):J(null)}}catch{}},Ii=async()=>{try{const R=await fetch("/api/changes/pending");if(R.ok){const H=await R.json();H.count>0&&z({count:H.count,files:H.files||[],componentChanges:H.componentChanges||[],unmapped:H.unmapped||[]})}}catch{}},kr=b.useCallback(async()=>{yt("quick-scan");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"static"})})}catch(R){console.error("Failed to start quick re-analysis:",R)}},[]),wo=b.useCallback(async()=>{yt("re-analyze");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"llm"})})}catch(R){console.error("Failed to start full re-analysis:",R)}},[]),Ti=async()=>{const R="/events",H="/api/architecture";xo(),Mi(),Pi(),Ge(),Sr(),Ii();try{const ne=new EventSource(R);return ne.onopen=()=>{console.log("SSE connected"),g(!0),_(null)},ne.onmessage=ie=>{try{const re=JSON.parse(ie.data);console.log("SSE message:",re.type),re.architecture&&Nr(re.architecture),re.type==="git_update"&&re.gitInfo&&Kr(re.gitInfo),re.type==="premium_agent_result"&&re.premiumResults&&Qn(re.premiumResults),re.type==="changes:detected"&&z({count:re.count,files:re.files||[],componentChanges:re.componentChanges||[],unmapped:re.unmapped||[]}),re.type==="changes:cleared"&&z(null),re.type==="analyzing:started"&&(G(!0),z(null)),re.type==="analyzing:finished"&&(G(!1),re.success===!1&&re.error?J(re.error):(J(null),Pi(),Sr()))}catch(re){console.error("Failed to parse SSE message:",re)}},ne.onerror=ie=>{console.error("SSE error:",ie),ne.close(),g(!1),zn(H)},()=>ne.close()}catch{zn(H)}},zn=async R=>{try{const H=await fetch(R);if(H.ok){const ne=await H.json();Nr(ne),g(!0)}else _t()}catch{_t()}},_t=()=>{const R={nodes:[{id:"frontend",type:"component",label:`Frontend
66
- (Web App)`,layer:"presentation",x:150,y:170,width:200,height:100,color:"#d0ebff"},{id:"backend",type:"service",label:`Backend
67
- (API)`,layer:"application",x:150,y:370,width:200,height:100,color:"#ffe8cc"},{id:"database",type:"database",label:"Database",layer:"data",x:150,y:570,width:200,height:80,color:"#b2f2bb"}],edges:[{id:"e1",source:"frontend",target:"backend",color:"#1971c2"},{id:"e2",source:"backend",target:"database",color:"#2f9e44"}],flows:[],lastUpdated:new Date().toISOString(),version:1};Nr(R)},Nr=R=>{h(R),y(R.lastUpdated),R.gitInfo&&Kr(R.gitInfo),R.environments&&fr(R.environments)};b.useEffect(()=>{if(!u)return;const R=u.nodes.filter(re=>oo(re.environments,Lt)&&!oe.has(re.id)&&!je.has(re.layer)),H=new Set(R.map(re=>re.id)),ne=u.edges.filter(re=>oo(re.environments,Lt)&&H.has(re.source)&&H.has(re.target)),ie=ZE(R);r(ie),a(_p(ne,qn))},[u,Lt,oe,je,qn]),b.useEffect(()=>{var H;if(!((H=te==null?void 0:te.componentChanges)!=null&&H.length))return;const R=new Map;for(const ne of te.componentChanges)R.set(ne.componentId,ne.files);r(ne=>ne.map(ie=>{const re=R.get(ie.id);return re?{...ie,data:{...ie.data,pendingFiles:re}}:ie.data.pendingFiles?{...ie,data:{...ie.data,pendingFiles:null}}:ie}))},[te,r]),b.useEffect(()=>{Rn()},[Rn]),b.useEffect(()=>{if(!$||!M)return;const R=setInterval(()=>{I(H=>{const ne=H+1;if(ne>=M.steps.length)return de(new Set([M.steps[0].edge])),0;const ie=new Set;for(let re=0;re<=ne;re++)ie.add(M.steps[re].edge);return de(ie),ne})},QE);return()=>clearInterval(R)},[$,M]),b.useEffect(()=>{if(!u)return;const R=u.nodes.filter(ye=>oo(ye.environments,Lt)),H=new Set(R.map(ye=>ye.id)),ne=u.edges.filter(ye=>oo(ye.environments,Lt)&&H.has(ye.source)&&H.has(ye.target)),ie=new Map;M&&M.steps.forEach((ye,_e)=>{ie.has(ye.edge)||ie.set(ye.edge,_e+1)});const re=ne.map(ye=>{const _e=le.has(ye.id),we=M==null?void 0:M.steps.some(Ue=>Ue.edge===ye.id),Te=ie.get(ye.id);return{id:ye.id,source:ye.source,target:ye.target,label:_e&&Te?`${Te}`:void 0,labelStyle:_e&&Te?{fill:Jr,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:_e&&Te?{fill:(M==null?void 0:M.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:_e?(M==null?void 0:M.color)||ye.color:ye.color||qn,strokeWidth:_e?6:3,opacity:M?we?1:.15:1,filter:_e?"brightness(0.85) saturate(1.4)":void 0},animated:_e,type:"smoothstep"}});a(re)},[le,M,u,Lt,qn,Jr]);const jt=R=>{yt("flow-select",R.name),A(R),I(0),de(new Set([R.steps[0].edge])),se(!0),me(!0)},An=()=>{if(se(!1),A(null),I(-1),de(new Set),me(!1),u){const R=u.nodes.filter(ie=>oo(ie.environments,Lt)),H=new Set(R.map(ie=>ie.id)),ne=u.edges.filter(ie=>oo(ie.environments,Lt)&&H.has(ie.source)&&H.has(ie.target));a(_p(ne,qn))}},So=()=>{se(!1)},ko=()=>{M&&se(!0)},yn=b.useRef(oe);b.useEffect(()=>{yn.current=oe},[oe]);const Ye=b.useCallback(()=>{yr(R=>{const H={nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(yn.current)},ne=[...R,H];return ne.length>Zr&&ne.shift(),ne}),gn([])},[s]),$t=b.useCallback(R=>{pr(R),setTimeout(()=>pr(null),3e3)},[]),Er=b.useCallback(()=>{pe(new Set)},[]);b.useCallback(R=>{Ie(H=>{const ne=new Set(H);return ne.has(R)?ne.delete(R):ne.add(R),ne})},[]);const Ri=b.useCallback((R,H)=>{if(!u)return;const ne=u.nodes.find(ie=>ie.id===H.id);ne&&(yt("node-click",`${ne.id} (${ne.label})`),wr(ne),Ct(!0))},[u]),No=b.useCallback(()=>{yt("pane-click"),Ne(null)},[]);b.useEffect(()=>{mn.current=t},[t]);const ti=b.useCallback(R=>{i(R);const H=R.some(ie=>ie.type==="position"&&ie.dragging===!1&&ie.position),ne=R.some(ie=>ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1);(H||ne)&&Ye(),R.forEach(ie=>{if(ie.type==="position"&&ie.dragging===!1&&ie.position){const re=mn.current.find(ye=>ye.id===ie.id);re&&vt(ye=>{var Te,Ue,We,ot;const _e=new Map(ye),we=_e.get(ie.id);return _e.set(ie.id,{id:ie.id,x:ie.position.x,y:ie.position.y,width:(we==null?void 0:we.width)??((Te=re.style)==null?void 0:Te.width)??((Ue=re.data)==null?void 0:Ue.width)??100,height:(we==null?void 0:we.height)??((We=re.style)==null?void 0:We.height)??((ot=re.data)==null?void 0:ot.height)??60}),_e})}if(ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1){const re=mn.current.find(ye=>ye.id===ie.id);re&&vt(ye=>{const _e=new Map(ye),we=_e.get(ie.id);return _e.set(ie.id,{id:ie.id,x:(we==null?void 0:we.x)??re.position.x,y:(we==null?void 0:we.y)??re.position.y,width:ie.dimensions.width,height:ie.dimensions.height}),_e})}})},[i,Ye]),Ln=b.useCallback(async()=>{if(Tt.size!==0){yt("save-positions"),qr(!0);try{const R=Array.from(Tt.values()),H=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:R})});if(H.ok)vt(new Map),console.log("Changes saved successfully");else{const ne=await H.json();console.error("Failed to save changes:",ne)}}catch(R){console.error("Error saving changes:",R)}finally{qr(!1)}}},[Tt]),ni=b.useCallback(()=>{vt(new Map),Rn()},[Rn]),Dn=b.useCallback(()=>{yr(R=>{if(R.length===0)return R;const H=[...R],ne=H.pop();if(gn(ie=>[...ie,{nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(yn.current)}]),r(ne.nodes),a(ne.edges),pe(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(re=>{var _e,we,Te,Ue;const ye=u.nodes.find(We=>We.id===re.id);if(ye){const We=re.position.x,ot=re.position.y,Le=((_e=re.style)==null?void 0:_e.width)??((we=re.data)==null?void 0:we.width)??100,nt=((Te=re.style)==null?void 0:Te.height)??((Ue=re.data)==null?void 0:Ue.height)??60;(We!==ye.x||ot!==ye.y||Le!==ye.width||nt!==ye.height)&&ie.set(re.id,{id:re.id,x:We,y:ot,width:Le,height:nt})}}),vt(ie)}return H})},[s,r,a,u]),ri=b.useCallback(()=>{gn(R=>{if(R.length===0)return R;const H=[...R],ne=H.pop();if(yr(ie=>[...ie,{nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(yn.current)}]),r(ne.nodes),a(ne.edges),pe(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(re=>{var _e,we,Te,Ue;const ye=u.nodes.find(We=>We.id===re.id);if(ye){const We=re.position.x,ot=re.position.y,Le=((_e=re.style)==null?void 0:_e.width)??((we=re.data)==null?void 0:we.width)??100,nt=((Te=re.style)==null?void 0:Te.height)??((Ue=re.data)==null?void 0:Ue.height)??60;(We!==ye.x||ot!==ye.y||Le!==ye.width||nt!==ye.height)&&ie.set(re.id,{id:re.id,x:We,y:ot,width:Le,height:nt})}}),vt(ie)}return H})},[s,r,a,u]),Eo=b.useCallback(({nodes:R})=>{In(new Set(R.map(H=>H.id))),R.length===1?Ne(R[0].id):R.length===0&&Ne(null)},[]),Be=b.useCallback(()=>{if(Dt.size===0&&!ke)return;Ye();const R=Dt.size>0?Dt:new Set([ke]);pe(H=>new Set([...H,...R])),In(new Set),Ne(null)},[Dt,ke,Ye]),Co=b.useCallback(()=>{const R=Dt.size>0?Dt:ke?new Set([ke]):new Set;if(R.size===0)return;const H=t.filter(ne=>R.has(ne.id));ji(H)},[t,Dt,ke]),_o=b.useCallback(()=>{if(gr.length===0)return;Ye();const R=50,H=gr.map((ne,ie)=>{var re;return{...ne,id:`${ne.id}-copy-${Date.now()}-${ie}`,position:{x:ne.position.x+R,y:ne.position.y+R},selected:!0,data:{...ne.data,label:`${((re=ne.data)==null?void 0:re.label)||ne.id} (copy)`}}});r(ne=>[...ne.map(ie=>({...ie,selected:!1})),...H]),H.forEach(ne=>{vt(ie=>{var ye,_e,we,Te;const re=new Map(ie);return re.set(ne.id,{id:ne.id,x:ne.position.x,y:ne.position.y,width:((ye=ne.style)==null?void 0:ye.width)||((_e=ne.data)==null?void 0:_e.width)||100,height:((we=ne.style)==null?void 0:we.height)||((Te=ne.data)==null?void 0:Te.height)||60}),re})})},[gr,r,Ye]),Zn=b.useCallback((R,H)=>{const ne=Dt.size>0?Dt:ke?new Set([ke]):new Set;ne.size!==0&&(Ye(),r(ie=>ie.map(re=>{if(ne.has(re.id)&&!Pn.has(re.id)){const ye={x:re.position.x+R,y:re.position.y+H};return vt(_e=>{var Te,Ue,We,ot;const we=new Map(_e);return we.set(re.id,{id:re.id,x:ye.x,y:ye.y,width:((Te=re.style)==null?void 0:Te.width)||((Ue=re.data)==null?void 0:Ue.width)||100,height:((We=re.style)==null?void 0:We.height)||((ot=re.data)==null?void 0:ot.height)||60}),we}),{...re,position:ye}}return re})))},[Dt,ke,Pn,r,Ye]),_s=b.useCallback(R=>{const H={id:`edge-${R.source}-${R.target}-${Date.now()}`,source:R.source,target:R.target,type:"smoothstep",animated:!0,style:{stroke:lt==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(ne=>Nm(H,ne))},[a,lt]),js=b.useCallback((R,H)=>{Ye(),a(ne=>c1(R,H,ne))},[a,Ye]),bs=b.useCallback(async()=>{yt("export","png");const R=document.querySelector(".react-flow");if(R){Tn(!0);try{const H=await uE(R,{backgroundColor:lt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),ne=document.createElement("a");ne.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,ne.href=H,ne.click()}catch(H){console.error("Failed to export PNG:",H)}finally{Tn(!1)}}},[lt]),jo=b.useCallback(async()=>{yt("export","svg");const R=document.querySelector(".react-flow");if(R){Tn(!0);try{const H=await Pg(R,{backgroundColor:lt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),ne=document.createElement("a");ne.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,ne.href=H,ne.click()}catch(H){console.error("Failed to export SVG:",H)}finally{Tn(!1)}}},[lt]),vn=b.useCallback(async R=>{yt("export",R),Tn(!0);try{const H=await fetch(`/api/export?format=${R}`);if(!H.ok)throw new Error("Export failed");const ne=await H.blob(),ie=R==="mermaid"?"mmd":R==="plantuml"?"puml":R==="markdown"?"md":R,re=document.createElement("a");re.download=`architecture.${ie}`,re.href=URL.createObjectURL(ne),re.click(),URL.revokeObjectURL(re.href)}catch(H){console.error(`Failed to export ${R}:`,H)}finally{Tn(!1)}},[]);b.useCallback(()=>{if(!u)return;Ye();const R=250,H=100,ne=100,ie=t.map((re,ye)=>({...re,position:{x:H+ye*R,y:ne}}));r(ie),Fe("horizontal")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=150,H=100,ne=100,ie=t.map((re,ye)=>({...re,position:{x:H,y:ne+ye*R}}));r(ie),Fe("vertical")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=280,H=180,ne=100,ie=100,re=Math.ceil(Math.sqrt(t.length)),ye=t.map((_e,we)=>({..._e,position:{x:ne+we%re*R,y:ie+Math.floor(we/re)*H}}));r(ye),Fe("grid")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=320,H=160,ne=100,ie=100,re=new Set(t.map(Le=>Le.id)),ye=new Map,_e=new Map;re.forEach(Le=>{ye.set(Le,0),_e.set(Le,[])}),s.forEach(Le=>{re.has(Le.source)&&re.has(Le.target)&&(_e.get(Le.source).push(Le.target),ye.set(Le.target,(ye.get(Le.target)||0)+1))});const we=new Map,Te=[];for(ye.forEach((Le,nt)=>{Le===0&&(Te.push(nt),we.set(nt,0))});Te.length>0;){const Le=Te.shift(),nt=we.get(Le);for(const On of _e.get(Le)||[]){const zi=nt+1;(!we.has(On)||we.get(On)<zi)&&we.set(On,zi),ye.set(On,ye.get(On)-1),ye.get(On)===0&&Te.push(On)}}t.forEach(Le=>{we.has(Le.id)||we.set(Le.id,0)});const Ue=new Map;t.forEach(Le=>{const nt=we.get(Le.id);Ue.has(nt)||Ue.set(nt,[]),Ue.get(nt).push(Le)});const We=[];[...Ue.keys()].sort((Le,nt)=>Le-nt).forEach((Le,nt)=>{Ue.get(Le).forEach((zi,bo)=>{We.push({...zi,position:{x:ne+nt*R,y:ie+bo*H}})})}),r(We),Fe("flow")},[u,t,s,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=250,H=180,ne=100,ie=100,re={};t.forEach(Te=>{var We;const Ue=((We=Te.data)==null?void 0:We.layer)||"application";re[Ue]||(re[Ue]=[]),re[Ue].push(Te)});const ye=["presentation","application","data","external","deployment"];let _e=ie;const we=[];ye.forEach(Te=>{const Ue=re[Te]||[];Ue.forEach((We,ot)=>{we.push({...We,position:{x:ne+ot*R,y:_e}})}),Ue.length>0&&(_e+=H)}),Object.entries(re).forEach(([Te,Ue])=>{ye.includes(Te)||(Ue.forEach((We,ot)=>{we.push({...We,position:{x:ne+ot*R,y:_e}})}),_e+=H)}),r(we),Fe("layer")},[u,t,r,Ye]);const $n=b.useCallback(async R=>{yt("deep-drill",R),Xr(!0),pn(!0),rn(null);try{const H=await fetch(`/api/component/${encodeURIComponent(R)}/deep`);if(H.ok){const ne=await H.json();rn(ne)}}catch{}Xr(!1)},[]),Fn=b.useCallback((R,H)=>{if(!u)return;const ne=u.nodes.find(ie=>ie.id===H.id);ne&&(wr(ne),Ct(!0))},[u]);b.useEffect(()=>{const R=H=>{if(H.target instanceof HTMLInputElement||H.target instanceof HTMLTextAreaElement)return;const ie=navigator.platform.toUpperCase().indexOf("MAC")>=0?H.metaKey:H.ctrlKey;if(H.key==="Backspace"||H.key==="Delete"){H.preventDefault(),Be();return}if(ie&&H.key==="c"){H.preventDefault(),Co();return}if(ie&&H.key==="v"){H.preventDefault(),_o();return}if(ie&&H.shiftKey&&H.key==="z"){H.preventDefault(),ri();return}if(ie&&H.key==="z"){H.preventDefault(),Dn();return}if(ie&&H.key==="s"){H.preventDefault(),Ln();return}if(H.key==="Escape"){Ct(!1),pn(!1),An();return}if(H.key==="ArrowUp"){H.preventDefault(),Zn(0,H.shiftKey?-Kt*5:-Kt);return}if(H.key==="ArrowDown"){H.preventDefault(),Zn(0,H.shiftKey?Kt*5:Kt);return}if(H.key==="ArrowLeft"){H.preventDefault(),Zn(H.shiftKey?-Kt*5:-Kt,0);return}if(H.key==="ArrowRight"){H.preventDefault(),Zn(H.shiftKey?Kt*5:Kt,0);return}};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Be,Co,_o,Ln,Zn,Dn,ri]);const sn=b.useMemo(()=>u?u.nodes.filter(R=>oe.has(R.id)):[],[u,oe]);return b.useEffect(()=>{u&&r(R=>R.map(H=>({...H,data:{...H.data,highlighted:H.id===hr}})))},[hr,u]),C?d.jsx("div",{className:"app",children:d.jsxs("div",{className:"loading",children:[d.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):d.jsxs("div",{className:"app",children:[d.jsxs("div",{className:"branding-header",children:[d.jsxs("div",{className:"archbyte-brand",children:[d.jsx("span",{className:"archbyte-name",children:"ArchByte"}),W?d.jsx(bE,{projectInfo:W}):d.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),E.loggedIn&&d.jsx("div",{className:"branding-account",children:E.email&&d.jsxs("span",{className:"account-email",children:[E.email,E.tier==="premium"&&d.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),d.jsxs("div",{className:"toolbar",children:[d.jsxs("div",{className:"toolbar-left",children:[d.jsxs("div",{className:"toolbar-section",children:[d.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),d.jsxs("div",{className:"toolbar-section-items",children:[d.jsxs(Ep,{trigger:M?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flow-dot-inline",style:{background:M.color}}),M.name]}):d.jsx(d.Fragment,{children:"▶ Flows ▾"}),triggerClassName:`toolbar-btn ${M?"has-active-flow":""}`,children:[M&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"dropdown-item flow-clear",onClick:An,children:"⏹ Clear active flow"}),d.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const R=["user-journey","data-pipeline","system","deployment","error-recovery"],H={"user-journey":"User Journey","data-pipeline":"Data Pipeline",system:"System",deployment:"Deployment","error-recovery":"Error / Recovery"},ne={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},ie={};for(const _e of u.flows){const we=_e.category||"system";ie[we]||(ie[we]=[]),ie[we].push(_e)}const re=[];for(const _e of R){const we=ie[_e];if(we!=null&&we.length){re.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:ne[_e]}}),H[_e]||_e]},`cat-${_e}`));for(const Te of we)re.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Te.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Te.id?An():jt(Te)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Te.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Te.name}),(M==null?void 0:M.id)===Te.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Te.id))}}const ye=new Set(R);for(const[_e,we]of Object.entries(ie))if(!ye.has(_e)&&we!=null&&we.length){re.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),_e]},`cat-${_e}`));for(const Te of we)re.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Te.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Te.id?An():jt(Te)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Te.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Te.name}),(M==null?void 0:M.id)===Te.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Te.id))}return re})():d.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]}),d.jsx("button",{className:`toolbar-btn premium-btn ${E.features.audit?"":"premium-locked"} ${St?"active":""}`,onClick:()=>{if(!E.features.audit){L("Audit");return}yt("audit-toggle",St?"close":"open"),kt(!St)},children:"Audit"})]})]}),!Et&&d.jsxs("div",{className:"toolbar-section",children:[d.jsx("span",{className:"toolbar-section-label",children:"Ops"}),d.jsxs("div",{className:"toolbar-section-items",children:[d.jsx("button",{className:`toolbar-btn premium-btn ${E.features.workflows?"":"premium-locked"} ${ht?"active":""}`,title:E.features.workflows?"":"Available in Pro",onClick:()=>{if(!E.features.workflows){L("Workflows");return}yt("workflows-toggle",ht?"close":"open"),Nt(!ht),Xt(!1)},children:"Workflows"}),d.jsx("button",{className:`toolbar-btn premium-btn ${E.features.premiumAgents?"":"premium-locked"} ${At?"active":""}`,title:E.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!E.features.premiumAgents){L("Pro Agents");return}yt("agents-toggle",At?"close":"open"),At?Xt(!1):(Xt(!0),Nt(!1))},children:"Agents"})]})]})]}),d.jsxs("div",{className:"toolbar-right",children:[U&&!Et&&d.jsxs("span",{className:"toolbar-analyzing",children:[d.jsx("span",{className:"analyzing-pulse"}),"Re-analyzing..."]}),V&&!Et&&d.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>J(null),title:V,children:"Analysis failed"}),!Et&&d.jsx("button",{className:"toolbar-btn",onClick:async()=>{yt("reload"),await fetch("/api/reload",{method:"POST"})},title:"Reload architecture and refresh pending changes",children:"Reload"}),d.jsx("button",{className:`toolbar-btn ${Ae?"active":""}`,onClick:()=>{yt("stats-toggle",Ae?"close":"open"),et(!Ae)},children:"Stats"}),d.jsxs(Ep,{trigger:bi?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:bi,children:[d.jsx("div",{className:"dropdown-label",children:"Image"}),d.jsx("button",{className:"dropdown-item",onClick:bs,children:"PNG"}),d.jsx("button",{className:"dropdown-item",onClick:jo,children:"SVG"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Diagram"}),d.jsx("button",{className:"dropdown-item",onClick:()=>vn("mermaid"),children:"Mermaid"}),d.jsx("button",{className:"dropdown-item",onClick:()=>vn("plantuml"),children:"PlantUML"}),d.jsx("button",{className:"dropdown-item",onClick:()=>vn("dot"),children:"DOT"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Document"}),d.jsx("button",{className:"dropdown-item",onClick:()=>vn("markdown"),children:"Markdown"}),d.jsx("button",{className:"dropdown-item",onClick:()=>vn("json"),children:"JSON"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Interactive"}),d.jsx("button",{className:`dropdown-item ${E.tier!=="premium"?"premium-locked":""}`,onClick:()=>{if(E.tier!=="premium"){L("HTML Export");return}vn("html")},children:"HTML"})]}),d.jsx("button",{className:"toolbar-btn-icon",onClick:()=>{const R=lt==="dark"?"light":"dark";yt("theme-toggle",R),xr(R)},title:`Switch to ${lt==="dark"?"light":"dark"} mode`,children:lt==="dark"?"☀":"☽"})]})]}),te&&te.count>0&&!U&&!Et&&d.jsxs("div",{className:"changes-banner",children:[d.jsx("span",{className:"changes-banner-pulse"}),d.jsxs("span",{className:"changes-banner-text",children:[te.componentChanges.length>0?`${te.componentChanges.length} component${te.componentChanges.length!==1?"s":""} affected`:`${te.count} file${te.count!==1?"s":""} changed`,d.jsxs("span",{className:"changes-banner-file-count",children:["(",te.count," file",te.count!==1?"s":"",")"]})]}),te.componentChanges.length>0&&d.jsxs("div",{className:"changes-banner-components",children:[te.componentChanges.map(R=>{const H=R.files.some(ie=>ie.event==="add"),ne=R.files.some(ie=>ie.event==="unlink");return d.jsxs("button",{className:"changes-component-chip",onClick:()=>$t(R.componentId),children:[H&&d.jsx("span",{className:"changes-event-dot new"}),ne&&d.jsx("span",{className:"changes-event-dot del"}),!H&&!ne&&d.jsx("span",{className:"changes-event-dot mod"}),R.componentName,d.jsx("span",{className:"changes-component-count",children:R.files.length})]},R.componentId)}),te.unmapped.length>0&&d.jsxs("span",{className:"changes-component-chip unmapped",title:te.unmapped.map(R=>`${R.event==="add"?"+":R.event==="unlink"?"-":"~"} ${R.path}`).join(`
68
- `),children:["Other",d.jsx("span",{className:"changes-component-count",children:te.unmapped.length})]})]}),d.jsxs("div",{className:"changes-banner-actions",children:[d.jsx("button",{className:"changes-banner-btn quick",onClick:kr,title:"Fast re-scan using static analysis only (~2s)",children:"Quick Scan"}),d.jsx("button",{className:"changes-banner-btn full",onClick:wo,title:"Full re-scan using AI agents for deeper analysis",children:"Re-analyze"})]}),d.jsx("button",{className:"changes-banner-dismiss",onClick:()=>z(null),title:"Dismiss",children:"x"})]}),d.jsx(gE,{selectedEnvironment:Lt,environments:yo,onSelectEnvironment:Gr}),d.jsxs("div",{className:"canvas-container",children:[d.jsx("div",{className:"watermark",children:"archbyte"}),d.jsxs(mg,{nodes:t.map(R=>({...R,draggable:!Pn.has(R.id),data:{...R.data,locked:Pn.has(R.id)}})),edges:s.map(R=>{var H;return{...R,style:{...R.style,opacity:1,strokeWidth:((H=R.style)==null?void 0:H.strokeWidth)||2}}}),onNodesChange:ti,onEdgesChange:c,onNodeClick:(R,H)=>{Ri(R,H)},onNodeDoubleClick:Fn,onPaneClick:()=>{No(),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:_s,onReconnect:js,edgesReconnectable:!0,onSelectionChange:Eo,nodeTypes:qE,connectionMode:Ni.Loose,snapToGrid:!0,snapGrid:[ei,ei],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[d.jsx(yg,{color:lt==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Xn.Dots}),d.jsx(xg,{})]}),vo&&tt&&d.jsxs(wi,{className:"node-details-panel",children:[d.jsxs("div",{className:"node-details-header","data-drag-handle":!0,children:[d.jsxs("div",{children:[d.jsx("div",{className:"node-details-title",children:tt.label.split(`
69
- `)[0]}),d.jsxs("div",{className:"node-details-type-row",children:[d.jsxs("span",{children:[tt.layer," • ",tt.type]}),tt.path&&d.jsx("button",{className:"panel-btn small green",onClick:()=>{$n(tt.id),Ct(!1)},disabled:on,children:on?"...":"INSPECT"})]})]}),d.jsx("button",{className:"panel-close-btn",onClick:()=>Ct(!1),children:"×"})]}),tt.path&&d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Path"}),d.jsx("div",{className:"node-details-path",style:{userSelect:"text"},children:tt.path})]}),tt.techStack&&tt.techStack.length>0&&d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),d.jsx("div",{className:"node-details-tech-stack",children:tt.techStack.map((R,H)=>d.jsx("span",{className:"tech-badge",children:R},H))})]}),d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Connections"}),d.jsxs("div",{className:"node-details-connections",children:[u==null?void 0:u.edges.filter(R=>R.source===tt.id||R.target===tt.id).map(R=>{const H=R.source===tt.id,ne=H?R.target:R.source,ie=u==null?void 0:u.nodes.find(re=>re.id===ne);return d.jsxs("div",{className:"connection-item-detailed",onClick:()=>$t(ne),style:{cursor:"pointer"},title:`Click to highlight ${(ie==null?void 0:ie.label.split(`
70
- `)[0])||ne}`,children:[d.jsxs("div",{className:"connection-header",children:[d.jsx("span",{className:"connection-arrow",children:H?"→":"←"}),d.jsx("span",{className:"connection-target",children:(ie==null?void 0:ie.label.split(`
71
- `)[0])||ne})]}),R.label&&d.jsx("div",{className:"connection-label",children:R.label})]},R.id)}),(u==null?void 0:u.edges.filter(R=>R.source===tt.id||R.target===tt.id).length)===0&&d.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),(()=>{var H;const R=(H=te==null?void 0:te.componentChanges)==null?void 0:H.find(ne=>ne.componentId===tt.id);return!R||R.files.length===0?null:d.jsxs("div",{className:"pending-sticky-note",children:[d.jsxs("div",{className:"pending-sticky-header",children:[R.files.length," file",R.files.length!==1?"s":""," changed"]}),R.files.slice(0,8).map((ne,ie)=>d.jsxs("div",{className:`pending-file-row ${ne.event}`,children:[d.jsx("span",{className:"pending-file-event",children:ne.event==="add"?"+":ne.event==="unlink"?"-":"~"}),d.jsx("span",{className:"pending-file-name",children:ne.path.split("/").pop()})]},ie)),R.files.length>8&&d.jsxs("div",{className:"pending-file-more",children:["+",R.files.length-8," more"]})]})})()]}),hn&&d.jsxs(wi,{className:"deep-drill-panel",children:[d.jsxs("div",{className:"deep-drill-header","data-drag-handle":!0,children:[d.jsxs("div",{children:[d.jsx("div",{className:"deep-drill-title",children:(be==null?void 0:be.componentName)||"INSPECT"}),d.jsx("div",{className:"deep-drill-subtitle",children:(be==null?void 0:be.componentPath)||"Scanning..."})]}),d.jsx("button",{className:"panel-close-btn",onClick:()=>pn(!1),children:"x"})]}),on&&d.jsxs("div",{className:"deep-drill-loading",children:[d.jsx("div",{className:"loading-spinner"}),"Scanning component..."]}),be&&!on&&d.jsxs("div",{className:"deep-drill-body",children:[d.jsxs("div",{className:"deep-drill-meta",children:["Scanned in ",be.durationMs,"ms"]}),d.jsxs(so,{title:"Metrics",defaultOpen:!0,children:[d.jsxs("div",{className:"dd-metric-grid",children:[d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.fileCount}),d.jsx("div",{className:"dd-metric-label",children:"Files"})]}),d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.codeFileCount}),d.jsx("div",{className:"dd-metric-label",children:"Code Files"})]}),d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.totalLines.toLocaleString()}),d.jsx("div",{className:"dd-metric-label",children:"Lines"})]})]}),be.metrics.languages.length>0&&d.jsx("div",{className:"dd-lang-badges",children:be.metrics.languages.map(R=>d.jsxs("span",{className:"dd-lang-badge",children:[R.language," (",R.files,")"]},R.language))})]}),(be.structure.keyFiles.length>0||be.structure.publicExports.length>0)&&d.jsxs(so,{title:"Internal Structure",children:[be.structure.keyFiles.length>0&&d.jsx("div",{className:"dd-key-files",children:be.structure.keyFiles.slice(0,10).map((R,H)=>d.jsxs("div",{className:"dd-key-file-item",children:[d.jsx("span",{className:"dd-role-badge",children:R.role}),d.jsx("span",{className:"dd-file-path",children:R.path.replace(be.componentPath+"/","")})]},H))}),be.structure.publicExports.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Public Exports"}),d.jsx("div",{className:"dd-exports",children:be.structure.publicExports.slice(0,15).map((R,H)=>d.jsx("span",{className:"dd-export-name",children:R},H))})]})]}),be.dependencies.manifest&&d.jsxs(so,{title:`Dependencies (${be.dependencies.manifest})`,children:[be.dependencies.production.length>0&&d.jsxs("div",{className:"dd-dep-list",children:[be.dependencies.production.slice(0,15).map((R,H)=>d.jsx("span",{className:`dd-dep-badge ${R.category?"categorized":""}`,title:R.category||R.name,children:R.displayName},H)),be.dependencies.production.length>15&&d.jsxs("span",{className:"dd-dep-more",children:["+",be.dependencies.production.length-15," more"]})]}),be.dependencies.development.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Dev Dependencies"}),d.jsxs("div",{className:"dd-dep-list",children:[be.dependencies.development.slice(0,10).map((R,H)=>d.jsx("span",{className:"dd-dep-badge dev",title:R.category||R.name,children:R.displayName},H)),be.dependencies.development.length>10&&d.jsxs("span",{className:"dd-dep-more",children:["+",be.dependencies.development.length-10," more"]})]})]})]}),be.patterns.length>0&&d.jsx(so,{title:"Code Patterns",children:be.patterns.map((R,H)=>d.jsxs("div",{className:"dd-pattern-group",children:[d.jsxs("div",{className:"dd-pattern-header",children:[d.jsx("span",{className:"dd-pattern-label",children:R.label}),d.jsx("span",{className:"dd-pattern-count",children:R.count})]}),d.jsx("div",{className:"dd-pattern-matches",children:R.matches.slice(0,3).map((ne,ie)=>d.jsxs("div",{className:"dd-pattern-match",children:[d.jsxs("span",{className:"dd-match-file",children:[ne.file.replace(be.componentPath+"/",""),":",ne.line]}),d.jsx("span",{className:"dd-match-content",children:ne.content})]},ie))})]},H))}),(be.connections.outgoing.length>0||be.connections.incoming.length>0)&&d.jsxs(so,{title:"Connections",children:[be.connections.outgoing.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Outgoing"}),be.connections.outgoing.map((R,H)=>d.jsxs("div",{className:"dd-connection-item",children:[d.jsx("span",{className:"dd-conn-arrow",children:"->"}),d.jsx("span",{className:"dd-conn-name",children:R.targetName}),R.type&&d.jsx("span",{className:"dd-conn-type",children:R.type})]},H))]}),be.connections.incoming.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Incoming"}),be.connections.incoming.map((R,H)=>d.jsxs("div",{className:"dd-connection-item",children:[d.jsx("span",{className:"dd-conn-arrow",children:"<-"}),d.jsx("span",{className:"dd-conn-name",children:R.sourceName}),R.type&&d.jsx("span",{className:"dd-conn-type",children:R.type})]},H))]})]}),be.fileTree.length>0&&d.jsx(so,{title:"File Tree",children:d.jsx("div",{className:"dd-file-tree",children:Tg(be.fileTree,be.componentPath)})})]})]}),Tt.size>0&&!Et&&d.jsxs("div",{className:"save-panel",children:[d.jsxs("span",{className:"save-panel-text",children:[Tt.size," unsaved change",Tt.size!==1?"s":""]}),d.jsx("button",{className:"save-btn",onClick:Ln,disabled:mr,children:mr?"Saving...":"Save Changes"}),d.jsx("button",{className:"discard-btn",onClick:ni,disabled:mr,children:"Discard"})]}),sn.length>0&&d.jsxs("div",{className:"hidden-nodes-panel",children:[d.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",sn.length,")",d.jsx("button",{className:"panel-btn cyan small",onClick:Er,children:"Show All"})]}),d.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:sn.map(R=>d.jsxs("div",{className:"hidden-node-item",children:[d.jsx("span",{className:"hidden-node-name",children:R.label.split(`
72
- `)[0]}),d.jsx("button",{className:"panel-btn green small",onClick:()=>showNode(R.id),children:"Show"})]},R.id))})]}),M&&d.jsxs("div",{className:"flow-progress-bar",children:[d.jsx("span",{className:"flow-progress-dot",style:{background:M.color}}),d.jsx("span",{className:"flow-progress-name",children:M.name}),d.jsx("div",{className:"flow-progress-steps",children:M.steps.map((R,H)=>d.jsx("div",{className:`flow-progress-step ${H<=Y?"active":""} ${H===Y?"current":""}`,style:{borderColor:H<=Y?M.color:void 0},title:R.label,children:R.label},H))}),d.jsxs("div",{className:"flow-progress-controls",children:[$?d.jsx("button",{className:"flow-progress-btn",onClick:So,title:"Pause",children:"⏸"}):d.jsx("button",{className:"flow-progress-btn",onClick:ko,title:"Resume",children:"▶"}),d.jsx("button",{className:"flow-progress-btn stop",onClick:An,title:"Stop",children:"⏹"})]})]}),he&&M&&u&&d.jsx(RE,{flow:M,architecture:u,onClose:An}),d.jsx(wE,{visible:Ae,onClose:()=>et(!1)}),d.jsx(CE,{visible:St,onClose:()=>kt(!1),onHighlightNode:R=>{$t(R)}}),ht&&d.jsxs(wi,{className:"ops-panel",children:[d.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[d.jsx("span",{className:"ops-panel-title",children:"Workflows"}),d.jsx("button",{className:"panel-close-btn",onClick:()=>Nt(!1),children:"x"})]}),d.jsx(jE,{visible:!0})]}),d.jsx(KE,{visible:At,onClose:()=>Xt(!1),results:dr}),x.length>0&&d.jsxs("div",{className:"agent-panel",children:[d.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((R,H)=>d.jsxs("div",{className:"agent-item",children:[d.jsx("div",{className:`agent-dot ${H===0?"active":""}`}),d.jsx("span",{className:"agent-name",children:R.agentName}),d.jsx("span",{className:"agent-target",children:R.targetComponent||R.action})]},H))]})]}),Et&&d.jsxs("a",{href:"https://archbyte.heartbyte.io",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",bottom:6,right:8,display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"hsl(185 75% 50%)",background:"hsla(222, 47%, 8%, 0.85)",backdropFilter:"blur(8px)",border:"1px solid hsla(185, 75%, 50%, 0.25)",borderRadius:6,textDecoration:"none",zIndex:50,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.02em"},children:[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:"M12 2L2 7l10 5 10-5-10-5z"}),d.jsx("path",{d:"M2 17l10 5 10-5"}),d.jsx("path",{d:"M2 12l10 5 10-5"})]}),"archbyte.heartbyte.io"]}),d.jsxs("div",{className:"status-bar",children:[d.jsxs("div",{className:"status-left",children:[!Et&&d.jsxs("div",{className:"status-indicator",children:[d.jsx("div",{className:`status-dot ${m?"":"disconnected"}`}),d.jsx("span",{children:m?"Live":"Offline"})]}),Et&&d.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:"Standalone Export"}),S&&!Et&&d.jsx("span",{style:{color:"var(--accent-red)"},children:S})]}),d.jsx("div",{className:"status-center",children:d.jsx("a",{href:"mailto:archbyte@heartbyte.io",style:{color:"var(--text-dim)",fontSize:11,textDecoration:"none"},children:"archbyte@heartbyte.io"})}),d.jsxs("div",{className:"status-right",children:[d.jsx("span",{children:v?`Updated ${new Date(v).toLocaleTimeString()}`:"Waiting..."}),Gt?d.jsxs("span",{className:"git-status",children:[Gt.repo&&d.jsx("a",{href:((Cr=Gt.remoteUrl)==null?void 0:Cr.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Gt.remoteUrl||"",children:Gt.repo}),d.jsx("span",{className:"git-branch",children:Gt.branch}),d.jsx("span",{className:"git-hash",children:Gt.commit})]}):d.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),B&&d.jsx(AE,{onComplete:()=>{Z(!1),Rn()}}),F&&d.jsx(dE,{feature:F,onClose:()=>L(null)})]})}p0.createRoot(document.getElementById("root")).render(d.jsx(jp.StrictMode,{children:d.jsx(JE,{})}));