hyperbook 0.61.3 → 0.62.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,227 +0,0 @@
|
|
|
1
|
-
(function(Ci){typeof define=="function"&&define.amd?define(Ci):Ci()})(function(){"use strict";function Ci(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ir={exports:{}},Te={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var jd;function ev(){if(jd)return Te;jd=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.iterator;function p(A){return A===null||typeof A!="object"?null:(A=b&&A[b]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function N(A,$,F){this.props=A,this.context=$,this.refs=E,this.updater=F||x}N.prototype.isReactComponent={},N.prototype.setState=function(A,$){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,$,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function M(){}M.prototype=N.prototype;function O(A,$,F){this.props=A,this.context=$,this.refs=E,this.updater=F||x}var _=O.prototype=new M;_.constructor=O,w(_,N.prototype),_.isPureReactComponent=!0;var C=Array.isArray,k={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function U(A,$,F,le,ee,de){return F=de.ref,{$$typeof:n,type:A,key:$,ref:F!==void 0?F:null,props:de}}function Q(A,$){return U(A.type,$,void 0,void 0,void 0,A.props)}function q(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function te(A){var $={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(F){return $[F]})}var J=/\/+/g;function V(A,$){return typeof A=="object"&&A!==null&&A.key!=null?te(""+A.key):$.toString(36)}function Y(){}function j(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(Y,Y):(A.status="pending",A.then(function($){A.status==="pending"&&(A.status="fulfilled",A.value=$)},function($){A.status==="pending"&&(A.status="rejected",A.reason=$)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function B(A,$,F,le,ee){var de=typeof A;(de==="undefined"||de==="boolean")&&(A=null);var fe=!1;if(A===null)fe=!0;else switch(de){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(A.$$typeof){case n:case a:fe=!0;break;case y:return fe=A._init,B(fe(A._payload),$,F,le,ee)}}if(fe)return ee=ee(A),fe=le===""?"."+V(A,0):le,C(ee)?(F="",fe!=null&&(F=fe.replace(J,"$&/")+"/"),B(ee,$,F,"",function(ge){return ge})):ee!=null&&(q(ee)&&(ee=Q(ee,F+(ee.key==null||A&&A.key===ee.key?"":(""+ee.key).replace(J,"$&/")+"/")+fe)),$.push(ee)),1;fe=0;var he=le===""?".":le+":";if(C(A))for(var ie=0;ie<A.length;ie++)le=A[ie],de=he+V(le,ie),fe+=B(le,$,F,de,ee);else if(ie=p(A),typeof ie=="function")for(A=ie.call(A),ie=0;!(le=A.next()).done;)le=le.value,de=he+V(le,ie++),fe+=B(le,$,F,de,ee);else if(de==="object"){if(typeof A.then=="function")return B(j(A),$,F,le,ee);throw $=String(A),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return fe}function z(A,$,F){if(A==null)return A;var le=[],ee=0;return B(A,le,"","",function(de){return $.call(F,de,ee++)}),le}function L(A){if(A._status===-1){var $=A._result;$=$(),$.then(function(F){(A._status===0||A._status===-1)&&(A._status=1,A._result=F)},function(F){(A._status===0||A._status===-1)&&(A._status=2,A._result=F)}),A._status===-1&&(A._status=0,A._result=$)}if(A._status===1)return A._result.default;throw A._result}var G=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function X(){}return Te.Children={map:z,forEach:function(A,$,F){z(A,function(){$.apply(this,arguments)},F)},count:function(A){var $=0;return z(A,function(){$++}),$},toArray:function(A){return z(A,function($){return $})||[]},only:function(A){if(!q(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Te.Component=N,Te.Fragment=u,Te.Profiler=o,Te.PureComponent=O,Te.StrictMode=s,Te.Suspense=g,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,Te.act=function(){throw Error("act(...) is not supported in production builds of React.")},Te.cache=function(A){return function(){return A.apply(null,arguments)}},Te.cloneElement=function(A,$,F){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var le=w({},A.props),ee=A.key,de=void 0;if($!=null)for(fe in $.ref!==void 0&&(de=void 0),$.key!==void 0&&(ee=""+$.key),$)!H.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(le[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)le.children=F;else if(1<fe){for(var he=Array(fe),ie=0;ie<fe;ie++)he[ie]=arguments[ie+2];le.children=he}return U(A.type,ee,void 0,void 0,de,le)},Te.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Te.createElement=function(A,$,F){var le,ee={},de=null;if($!=null)for(le in $.key!==void 0&&(de=""+$.key),$)H.call($,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ee[le]=$[le]);var fe=arguments.length-2;if(fe===1)ee.children=F;else if(1<fe){for(var he=Array(fe),ie=0;ie<fe;ie++)he[ie]=arguments[ie+2];ee.children=he}if(A&&A.defaultProps)for(le in fe=A.defaultProps,fe)ee[le]===void 0&&(ee[le]=fe[le]);return U(A,de,void 0,void 0,null,ee)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(A){return{$$typeof:h,render:A}},Te.isValidElement=q,Te.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:L}},Te.memo=function(A,$){return{$$typeof:m,type:A,compare:$===void 0?null:$}},Te.startTransition=function(A){var $=k.T,F={};k.T=F;try{var le=A(),ee=k.S;ee!==null&&ee(F,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(X,G)}catch(de){G(de)}finally{k.T=$}},Te.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},Te.use=function(A){return k.H.use(A)},Te.useActionState=function(A,$,F){return k.H.useActionState(A,$,F)},Te.useCallback=function(A,$){return k.H.useCallback(A,$)},Te.useContext=function(A){return k.H.useContext(A)},Te.useDebugValue=function(){},Te.useDeferredValue=function(A,$){return k.H.useDeferredValue(A,$)},Te.useEffect=function(A,$){return k.H.useEffect(A,$)},Te.useId=function(){return k.H.useId()},Te.useImperativeHandle=function(A,$,F){return k.H.useImperativeHandle(A,$,F)},Te.useInsertionEffect=function(A,$){return k.H.useInsertionEffect(A,$)},Te.useLayoutEffect=function(A,$){return k.H.useLayoutEffect(A,$)},Te.useMemo=function(A,$){return k.H.useMemo(A,$)},Te.useOptimistic=function(A,$){return k.H.useOptimistic(A,$)},Te.useReducer=function(A,$,F){return k.H.useReducer(A,$,F)},Te.useRef=function(A){return k.H.useRef(A)},Te.useState=function(A){return k.H.useState(A)},Te.useSyncExternalStore=function(A,$,F){return k.H.useSyncExternalStore(A,$,F)},Te.useTransition=function(){return k.H.useTransition()},Te.version="19.0.0",Te}var Od;function Mi(){return Od||(Od=1,ir.exports=ev()),ir.exports}var D=Mi();const ur=Ci(D);var sr={exports:{}},Ti={},or={exports:{}},rr={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* scheduler.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var zd;function tv(){return zd||(zd=1,function(n){function a(z,L){var G=z.length;z.push(L);e:for(;0<G;){var X=G-1>>>1,A=z[X];if(0<o(A,L))z[X]=L,z[G]=A,G=X;else break e}}function u(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var L=z[0],G=z.pop();if(G!==L){z[0]=G;e:for(var X=0,A=z.length,$=A>>>1;X<$;){var F=2*(X+1)-1,le=z[F],ee=F+1,de=z[ee];if(0>o(le,G))ee<A&&0>o(de,le)?(z[X]=de,z[ee]=G,X=ee):(z[X]=le,z[F]=G,X=F);else if(ee<A&&0>o(de,G))z[X]=de,z[ee]=G,X=ee;else break e}}return L}function o(z,L){var G=z.sortIndex-L.sortIndex;return G!==0?G:z.id-L.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var g=[],m=[],y=1,b=null,p=3,x=!1,w=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function _(z){for(var L=u(m);L!==null;){if(L.callback===null)s(m);else if(L.startTime<=z)s(m),L.sortIndex=L.expirationTime,a(g,L);else break;L=u(m)}}function C(z){if(E=!1,_(z),!w)if(u(g)!==null)w=!0,j();else{var L=u(m);L!==null&&B(C,L.startTime-z)}}var k=!1,H=-1,U=5,Q=-1;function q(){return!(n.unstable_now()-Q<U)}function te(){if(k){var z=n.unstable_now();Q=z;var L=!0;try{e:{w=!1,E&&(E=!1,M(H),H=-1),x=!0;var G=p;try{t:{for(_(z),b=u(g);b!==null&&!(b.expirationTime>z&&q());){var X=b.callback;if(typeof X=="function"){b.callback=null,p=b.priorityLevel;var A=X(b.expirationTime<=z);if(z=n.unstable_now(),typeof A=="function"){b.callback=A,_(z),L=!0;break t}b===u(g)&&s(g),_(z)}else s(g);b=u(g)}if(b!==null)L=!0;else{var $=u(m);$!==null&&B(C,$.startTime-z),L=!1}}break e}finally{b=null,p=G,x=!1}L=void 0}}finally{L?J():k=!1}}}var J;if(typeof O=="function")J=function(){O(te)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Y=V.port2;V.port1.onmessage=te,J=function(){Y.postMessage(null)}}else J=function(){N(te,0)};function j(){k||(k=!0,J())}function B(z,L){H=N(function(){z(n.unstable_now())},L)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_continueExecution=function(){w||x||(w=!0,j())},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return u(g)},n.unstable_next=function(z){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var G=p;p=L;try{return z()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=p;p=z;try{return L()}finally{p=G}},n.unstable_scheduleCallback=function(z,L,G){var X=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?X+G:X):G=X,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=G+A,z={id:y++,callback:L,priorityLevel:z,startTime:G,expirationTime:A,sortIndex:-1},G>X?(z.sortIndex=G,a(m,z),u(g)===null&&z===u(m)&&(E?(M(H),H=-1):E=!0,B(C,G-X))):(z.sortIndex=A,a(g,z),w||x||(w=!0,j())),z},n.unstable_shouldYield=q,n.unstable_wrapCallback=function(z){var L=p;return function(){var G=p;p=L;try{return z.apply(this,arguments)}finally{p=G}}}}(rr)),rr}var Dd;function nv(){return Dd||(Dd=1,or.exports=tv()),or.exports}var cr={exports:{}},Ot={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var kd;function lv(){if(kd)return Ot;kd=1;var n=Mi();function a(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var s={d:{f:u,r:function(){throw Error(a(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(g,m,y){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:g,containerInfo:m,implementation:y}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ot.createPortal=function(g,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(a(299));return c(g,m,null,y)},Ot.flushSync=function(g){var m=f.T,y=s.p;try{if(f.T=null,s.p=2,g)return g()}finally{f.T=m,s.p=y,s.d.f()}},Ot.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,s.d.C(g,m))},Ot.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},Ot.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var y=m.as,b=h(y,m.crossOrigin),p=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?s.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:b,integrity:p,fetchPriority:x}):y==="script"&&s.d.X(g,{crossOrigin:b,integrity:p,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Ot.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);s.d.M(g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&s.d.M(g)},Ot.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,b=h(y,m.crossOrigin);s.d.L(g,y,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Ot.preloadModule=function(g,m){if(typeof g=="string")if(m){var y=h(m.as,m.crossOrigin);s.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else s.d.m(g)},Ot.requestFormReset=function(g){s.d.r(g)},Ot.unstable_batchedUpdates=function(g,m){return g(m)},Ot.useFormState=function(g,m,y){return f.H.useFormState(g,m,y)},Ot.useFormStatus=function(){return f.H.useHostTransitionStatus()},Ot.version="19.0.0",Ot}var Rd;function Hd(){if(Rd)return cr.exports;Rd=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),cr.exports=lv(),cr.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom-client.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Ld;function av(){if(Ld)return Ti;Ld=1;var n=nv(),a=Mi(),u=Hd();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}var c=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),p=Symbol.for("react.consumer"),x=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),C=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=k&&e[k]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case h:return"Portal";case y:return"Profiler";case m:return"StrictMode";case E:return"Suspense";case N:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:return(e.displayName||"Context")+".Provider";case p:return(e._context.displayName||"Context")+".Consumer";case w:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var q=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.assign,J,V;function Y(e){if(J===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);J=t&&t[1]||"",V=-1<l.stack.indexOf(`
|
|
34
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
35
|
-
`+J+e+V}var j=!1;function B(e,t){if(!e||j)return"";j=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(ne){var P=ne}Reflect.construct(e,[],re)}else{try{re.call()}catch(ne){P=ne}e.call(re.prototype)}}else{try{throw Error()}catch(ne){P=ne}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(ne){if(ne&&P&&typeof ne.stack=="string")return[ne.stack,P.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=i.DetermineComponentFrameRoot(),S=d[0],T=d[1];if(S&&T){var R=S.split(`
|
|
36
|
-
`),K=T.split(`
|
|
37
|
-
`);for(r=i=0;i<R.length&&!R[i].includes("DetermineComponentFrameRoot");)i++;for(;r<K.length&&!K[r].includes("DetermineComponentFrameRoot");)r++;if(i===R.length||r===K.length)for(i=R.length-1,r=K.length-1;1<=i&&0<=r&&R[i]!==K[r];)r--;for(;1<=i&&0<=r;i--,r--)if(R[i]!==K[r]){if(i!==1||r!==1)do if(i--,r--,0>r||R[i]!==K[r]){var ae=`
|
|
38
|
-
`+R[i].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=i&&0<=r);break}}}finally{j=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Y(l):""}function z(e){switch(e.tag){case 26:case 27:case 5:return Y(e.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 15:return e=B(e.type,!1),e;case 11:return e=B(e.type.render,!1),e;case 1:return e=B(e.type,!0),e;default:return""}}function L(e){try{var t="";do t+=z(e),e=e.return;while(e);return t}catch(l){return`
|
|
39
|
-
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}}function G(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function X(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function A(e){if(G(e)!==e)throw Error(s(188))}function $(e){var t=e.alternate;if(!t){if(t=G(e),t===null)throw Error(s(188));return t!==e?null:e}for(var l=e,i=t;;){var r=l.return;if(r===null)break;var d=r.alternate;if(d===null){if(i=r.return,i!==null){l=i;continue}break}if(r.child===d.child){for(d=r.child;d;){if(d===l)return A(r),e;if(d===i)return A(r),t;d=d.sibling}throw Error(s(188))}if(l.return!==i.return)l=r,i=d;else{for(var S=!1,T=r.child;T;){if(T===l){S=!0,l=r,i=d;break}if(T===i){S=!0,i=r,l=d;break}T=T.sibling}if(!S){for(T=d.child;T;){if(T===l){S=!0,l=d,i=r;break}if(T===i){S=!0,i=d,l=r;break}T=T.sibling}if(!S)throw Error(s(189))}}if(l.alternate!==i)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?e:t}function F(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=F(e),t!==null)return t;e=e.sibling}return null}var le=Array.isArray,ee=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],he=-1;function ie(e){return{current:e}}function ge(e){0>he||(e.current=fe[he],fe[he]=null,he--)}function me(e,t){he++,fe[he]=e.current,e.current=t}var be=ie(null),xe=ie(null),pe=ie(null),we=ie(null);function Ae(e,t){switch(me(pe,t),me(xe,e),me(be,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?A1(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=A1(e),t=j1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ge(be),me(be,t)}function je(){ge(be),ge(xe),ge(pe)}function Ne(e){e.memoizedState!==null&&me(we,e);var t=be.current,l=j1(t,e.type);t!==l&&(me(xe,e),me(be,l))}function Le(e){xe.current===e&&(ge(be),ge(xe)),we.current===e&&(ge(we),Zu._currentValue=de)}var Ut=Object.prototype.hasOwnProperty,Ze=n.unstable_scheduleCallback,Dt=n.unstable_cancelCallback,sn=n.unstable_shouldYield,st=n.unstable_requestPaint,St=n.unstable_now,on=n.unstable_getCurrentPriorityLevel,ft=n.unstable_ImmediatePriority,rn=n.unstable_UserBlockingPriority,Et=n.unstable_NormalPriority,El=n.unstable_LowPriority,Ln=n.unstable_IdlePriority,Jn=n.log,$t=n.unstable_setDisableYieldValue,kt=null,ot=null;function _l(e){if(ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(kt,e,void 0,(e.current.flags&128)===128)}catch{}}function Gt(e){if(typeof Jn=="function"&&$t(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(kt,e)}catch{}}var vt=Math.clz32?Math.clz32:tt,Nl=Math.log,Oe=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-(Nl(e)/Oe|0)|0}var dt=128,bt=4194304;function Ye(e){var t=e&42;if(t!==0)return t;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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pt(e,t){var l=e.pendingLanes;if(l===0)return 0;var i=0,r=e.suspendedLanes,d=e.pingedLanes,S=e.warmLanes;e=e.finishedLanes!==0;var T=l&134217727;return T!==0?(l=T&~r,l!==0?i=Ye(l):(d&=T,d!==0?i=Ye(d):e||(S=T&~S,S!==0&&(i=Ye(S))))):(T=l&~r,T!==0?i=Ye(T):d!==0?i=Ye(d):e||(S=l&~S,S!==0&&(i=Ye(S)))),i===0?0:t!==0&&t!==i&&!(t&r)&&(r=i&-i,S=t&-t,r>=S||r===32&&(S&4194176)!==0)?t:i}function Zt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wn(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cn(){var e=dt;return dt<<=1,!(dt&4194176)&&(dt=128),e}function Cl(){var e=bt;return bt<<=1,!(bt&62914560)&&(bt=4194304),e}function oe(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ce(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function se(e,t,l,i,r,d){var S=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var T=e.entanglements,R=e.expirationTimes,K=e.hiddenUpdates;for(l=S&~l;0<l;){var ae=31-vt(l),re=1<<ae;T[ae]=0,R[ae]=-1;var P=K[ae];if(P!==null)for(K[ae]=null,ae=0;ae<P.length;ae++){var ne=P[ae];ne!==null&&(ne.lane&=-536870913)}l&=~re}i!==0&&Me(e,i,0),d!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=d&~(S&~t))}function Me(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-vt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&4194218}function Je(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-vt(l),r=1<<i;r&t|e[i]&t&&(e[i]|=t),l&=~r}}function We(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Q1(e.type))}function ht(e,t){var l=ee.p;try{return ee.p=e,t()}finally{ee.p=l}}var Bt=Math.random().toString(36).slice(2),_t="__reactFiber$"+Bt,Rt="__reactProps$"+Bt,Ml="__reactContainer$"+Bt,$a="__reactEvents$"+Bt,Zs="__reactListeners$"+Bt,Ks="__reactHandles$"+Bt,Qs="__reactResources$"+Bt,oa="__reactMarker$"+Bt;function lu(e){delete e[_t],delete e[Rt],delete e[$a],delete e[Zs],delete e[Ks]}function Fn(e){var t=e[_t];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ml]||l[_t]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=D1(e);e!==null;){if(l=e[_t])return l;e=D1(e)}return t}e=l,l=e.parentNode}return null}function Tl(e){if(e=e[_t]||e[Ml]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ra(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function In(e){var t=e[Qs];return t||(t=e[Qs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[oa]=!0}var Js=new Set,Ws={};function Pn(e,t){Al(e,t),Al(e+"Capture",t)}function Al(e,t){for(Ws[e]=t,e=0;e<t.length;e++)Js.add(t[e])}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nc=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),au={},Fs={};function Cc(e){return Ut.call(Fs,e)?!0:Ut.call(au,e)?!1:Nc.test(e)?Fs[e]=!0:(au[e]=!0,!1)}function Ga(e,t,l){if(Cc(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Za(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Tn(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Is(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Mc(e){var t=Is(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var r=l.get,d=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(S){i=""+S,d.call(this,S)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function el(e){e._valueTracker||(e._valueTracker=Mc(e))}function Ps(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=Is(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function Ka(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}}var Tc=/[\n"\\]/g;function Ht(e){return e.replace(Tc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,l,i,r,d,S,T){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?Qa(e,S,Kt(t)):l!=null?Qa(e,S,Kt(l)):i!=null&&e.removeAttribute("value"),r==null&&d!=null&&(e.defaultChecked=!!d),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+Kt(T):e.removeAttribute("name")}function eo(e,t,l,i,r,d,S,T){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||t!=null))return;l=l!=null?""+Kt(l):"",t=t!=null?""+Kt(t):l,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S)}function Qa(e,t,l){t==="number"&&Ka(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ja(e,t,l,i){if(e=e.options,t){t={};for(var r=0;r<l.length;r++)t["$"+l[r]]=!0;for(l=0;l<e.length;l++)r=t.hasOwnProperty("$"+e[l].value),e[l].selected!==r&&(e[l].selected=r),r&&i&&(e[l].defaultSelected=!0)}else{for(l=""+Kt(l),t=null,r=0;r<e.length;r++){if(e[r].value===l){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Rp(e,t,l){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Kt(l):""}function Hp(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(s(92));if(le(i)){if(1<i.length)throw Error(s(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=Kt(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i)}function Wa(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var WC=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Lp(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||WC.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Up(e,t,l){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var r in t)i=t[r],t.hasOwnProperty(r)&&l[r]!==i&&Lp(e,r,i)}else for(var d in t)t.hasOwnProperty(d)&&Lp(e,d,t[d])}function Ac(e){if(e.indexOf("-")===-1)return!1;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 FC=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),IC=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function to(e){return IC.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var jc=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fa=null,Ia=null;function Bp(e){var t=Tl(e);if(t&&(e=t.stateNode)){var l=e[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ht(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var r=i[Rt]||null;if(!r)throw Error(s(90));iu(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&Ps(i)}break e;case"textarea":Rp(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ja(e,!!l.multiple,t,!1)}}}var zc=!1;function Vp(e,t,l){if(zc)return e(t,l);zc=!0;try{var i=e(t);return i}finally{if(zc=!1,(Fa!==null||Ia!==null)&&(Bo(),Fa&&(t=Fa,e=Ia,Ia=Fa=null,Bp(t),e)))for(t=0;t<e.length;t++)Bp(e[t])}}function uu(e,t){var l=e.stateNode;if(l===null)return null;var i=l[Rt]||null;if(i===null)return null;l=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(s(231,t,typeof l));return l}var Dc=!1;if(Mn)try{var su={};Object.defineProperty(su,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",su,su),window.removeEventListener("test",su,su)}catch{Dc=!1}var jl=null,kc=null,no=null;function Yp(){if(no)return no;var e,t=kc,l=t.length,i,r="value"in jl?jl.value:jl.textContent,d=r.length;for(e=0;e<l&&t[e]===r[e];e++);var S=l-e;for(i=1;i<=S&&t[l-i]===r[d-i];i++);return no=r.slice(e,1<i?1-i:void 0)}function lo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ao(){return!0}function qp(){return!1}function Qt(e){function t(l,i,r,d,S){this._reactName=l,this._targetInst=r,this.type=i,this.nativeEvent=d,this.target=S,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(l=e[T],this[T]=l?l(d):d[T]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ao:qp,this.isPropagationStopped=qp,this}return te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ao)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ao)},persist:function(){},isPersistent:ao}),t}var ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},io=Qt(ca),ou=te({},ca,{view:0,detail:0}),PC=Qt(ou),Rc,Hc,ru,uo=te({},ou,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,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!==ru&&(ru&&e.type==="mousemove"?(Rc=e.screenX-ru.screenX,Hc=e.screenY-ru.screenY):Hc=Rc=0,ru=e),Rc)},movementY:function(e){return"movementY"in e?e.movementY:Hc}}),Xp=Qt(uo),eM=te({},uo,{dataTransfer:0}),tM=Qt(eM),nM=te({},ou,{relatedTarget:0}),Lc=Qt(nM),lM=te({},ca,{animationName:0,elapsedTime:0,pseudoElement:0}),aM=Qt(lM),iM=te({},ca,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uM=Qt(iM),sM=te({},ca,{data:0}),$p=Qt(sM),oM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rM={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"},cM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fM(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cM[e])?!!t[e]:!1}function Uc(){return fM}var dM=te({},ou,{key:function(e){if(e.key){var t=oM[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rM[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(e){return e.type==="keypress"?lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hM=Qt(dM),gM=te({},uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gp=Qt(gM),mM=te({},ou,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),pM=Qt(mM),yM=te({},ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),vM=Qt(yM),bM=te({},uo,{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}),xM=Qt(bM),wM=te({},ca,{newState:0,oldState:0}),SM=Qt(wM),EM=[9,13,27,32],Bc=Mn&&"CompositionEvent"in window,cu=null;Mn&&"documentMode"in document&&(cu=document.documentMode);var _M=Mn&&"TextEvent"in window&&!cu,Zp=Mn&&(!Bc||cu&&8<cu&&11>=cu),Kp=" ",Qp=!1;function Jp(e,t){switch(e){case"keyup":return EM.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function NM(e,t){switch(e){case"compositionend":return Wp(t);case"keypress":return t.which!==32?null:(Qp=!0,Kp);case"textInput":return e=t.data,e===Kp&&Qp?null:e;default:return null}}function CM(e,t){if(Pa)return e==="compositionend"||!Bc&&Jp(e,t)?(e=Yp(),no=kc=jl=null,Pa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zp&&t.locale!=="ko"?null:t.data;default:return null}}var MM={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 Fp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MM[e.type]:t==="textarea"}function Ip(e,t,l,i){Fa?Ia?Ia.push(i):Ia=[i]:Fa=i,t=$o(t,"onChange"),0<t.length&&(l=new io("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var fu=null,du=null;function TM(e){_1(e,0)}function so(e){var t=ra(e);if(Ps(t))return e}function Pp(e,t){if(e==="change")return t}var e0=!1;if(Mn){var Vc;if(Mn){var Yc="oninput"in document;if(!Yc){var t0=document.createElement("div");t0.setAttribute("oninput","return;"),Yc=typeof t0.oninput=="function"}Vc=Yc}else Vc=!1;e0=Vc&&(!document.documentMode||9<document.documentMode)}function n0(){fu&&(fu.detachEvent("onpropertychange",l0),du=fu=null)}function l0(e){if(e.propertyName==="value"&&so(du)){var t=[];Ip(t,du,e,Oc(e)),Vp(TM,t)}}function AM(e,t,l){e==="focusin"?(n0(),fu=t,du=l,fu.attachEvent("onpropertychange",l0)):e==="focusout"&&n0()}function jM(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return so(du)}function OM(e,t){if(e==="click")return so(t)}function zM(e,t){if(e==="input"||e==="change")return so(t)}function DM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:DM;function hu(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var r=l[i];if(!Ut.call(t,r)||!en(e[r],t[r]))return!1}return!0}function a0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i0(e,t){var l=a0(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=a0(l)}}function u0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?u0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function s0(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ka(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ka(e.document)}return t}function qc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function kM(e,t){var l=s0(t);t=e.focusedElem;var i=e.selectionRange;if(l!==t&&t&&t.ownerDocument&&u0(t.ownerDocument.documentElement,t)){if(i!==null&&qc(t)){if(e=i.start,l=i.end,l===void 0&&(l=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(l,t.value.length);else if(l=(e=t.ownerDocument||document)&&e.defaultView||window,l.getSelection){l=l.getSelection();var r=t.textContent.length,d=Math.min(i.start,r);i=i.end===void 0?d:Math.min(i.end,r),!l.extend&&d>i&&(r=i,i=d,d=r),r=i0(t,d);var S=i0(t,i);r&&S&&(l.rangeCount!==1||l.anchorNode!==r.node||l.anchorOffset!==r.offset||l.focusNode!==S.node||l.focusOffset!==S.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),l.removeAllRanges(),d>i?(l.addRange(e),l.extend(S.node,S.offset)):(e.setEnd(S.node,S.offset),l.addRange(e)))}}for(e=[],l=t;l=l.parentNode;)l.nodeType===1&&e.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)l=e[t],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var RM=Mn&&"documentMode"in document&&11>=document.documentMode,ei=null,Xc=null,gu=null,$c=!1;function o0(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;$c||ei==null||ei!==Ka(i)||(i=ei,"selectionStart"in i&&qc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),gu&&hu(gu,i)||(gu=i,i=$o(Xc,"onSelect"),0<i.length&&(t=new io("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=ei)))}function fa(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ti={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},Gc={},r0={};Mn&&(r0=document.createElement("div").style,"AnimationEvent"in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),"TransitionEvent"in window||delete ti.transitionend.transition);function da(e){if(Gc[e])return Gc[e];if(!ti[e])return e;var t=ti[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in r0)return Gc[e]=t[l];return e}var c0=da("animationend"),f0=da("animationiteration"),d0=da("animationstart"),HM=da("transitionrun"),LM=da("transitionstart"),UM=da("transitioncancel"),h0=da("transitionend"),g0=new Map,m0="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function An(e,t){g0.set(e,t),Pn(t,[e])}var cn=[],ni=0,Zc=0;function oo(){for(var e=ni,t=Zc=ni=0;t<e;){var l=cn[t];cn[t++]=null;var i=cn[t];cn[t++]=null;var r=cn[t];cn[t++]=null;var d=cn[t];if(cn[t++]=null,i!==null&&r!==null){var S=i.pending;S===null?r.next=r:(r.next=S.next,S.next=r),i.pending=r}d!==0&&p0(l,r,d)}}function ro(e,t,l,i){cn[ni++]=e,cn[ni++]=t,cn[ni++]=l,cn[ni++]=i,Zc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Kc(e,t,l,i){return ro(e,t,l,i),co(e)}function Ol(e,t){return ro(e,null,null,t),co(e)}function p0(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var r=!1,d=e.return;d!==null;)d.childLanes|=l,i=d.alternate,i!==null&&(i.childLanes|=l),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(r=!0)),e=d,d=d.return;r&&t!==null&&e.tag===3&&(d=e.stateNode,r=31-vt(l),d=d.hiddenUpdates,e=d[r],e===null?d[r]=[t]:e.push(t),t.lane=l|536870912)}function co(e){if(50<Bu)throw Bu=0,ed=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={},y0=new WeakMap;function fn(e,t){if(typeof e=="object"&&e!==null){var l=y0.get(e);return l!==void 0?l:(t={value:e,source:t,stack:L(t)},y0.set(e,t),t)}return{value:e,source:t,stack:L(t)}}var ai=[],ii=0,fo=null,ho=0,dn=[],hn=0,ha=null,tl=1,nl="";function ga(e,t){ai[ii++]=ho,ai[ii++]=fo,fo=e,ho=t}function v0(e,t,l){dn[hn++]=tl,dn[hn++]=nl,dn[hn++]=ha,ha=e;var i=tl;e=nl;var r=32-vt(i)-1;i&=~(1<<r),l+=1;var d=32-vt(t)+r;if(30<d){var S=r-r%5;d=(i&(1<<S)-1).toString(32),i>>=S,r-=S,tl=1<<32-vt(t)+r|l<<r|i,nl=d+e}else tl=1<<d|l<<r|i,nl=e}function Qc(e){e.return!==null&&(ga(e,1),v0(e,1,0))}function Jc(e){for(;e===fo;)fo=ai[--ii],ai[ii]=null,ho=ai[--ii],ai[ii]=null;for(;e===ha;)ha=dn[--hn],dn[hn]=null,nl=dn[--hn],dn[hn]=null,tl=dn[--hn],dn[hn]=null}var Vt=null,Tt=null,Be=!1,jn=null,Un=!1,Wc=Error(s(519));function ma(e){var t=Error(s(418,""));throw yu(fn(t,e)),Wc}function b0(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[_t]=e,t[Rt]=i,l){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(l=0;l<Yu.length;l++)He(Yu[l],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),eo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),el(t);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Hp(t,i.value,i.defaultValue,i.children),el(t)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||T1(t.textContent,l)?(i.popover!=null&&(He("beforetoggle",t),He("toggle",t)),i.onScroll!=null&&He("scroll",t),i.onScrollEnd!=null&&He("scrollend",t),i.onClick!=null&&(t.onclick=Go),t=!0):t=!1,t||ma(e)}function x0(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 3:case 27:Un=!0;return;case 5:case 13:Un=!1;return;default:Vt=Vt.return}}function mu(e){if(e!==Vt)return!1;if(!Be)return x0(e),Be=!0,!1;var t=!1,l;if((l=e.tag!==3&&e.tag!==27)&&((l=e.tag===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||yd(e.type,e.memoizedProps)),l=!l),l&&(t=!0),t&&Tt&&ma(e),x0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(l=e.data,l==="/$"){if(t===0){Tt=zn(e.nextSibling);break e}t--}else l!=="$"&&l!=="$!"&&l!=="$?"||t++;e=e.nextSibling}Tt=null}}else Tt=Vt?zn(e.stateNode.nextSibling):null;return!0}function pu(){Tt=Vt=null,Be=!1}function yu(e){jn===null?jn=[e]:jn.push(e)}var vu=Error(s(460)),w0=Error(s(474)),Fc={then:function(){}};function S0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function go(){}function E0(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(go,go),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===vu?Error(s(483)):e;default:if(typeof t.status=="string")t.then(go,go);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=i}},function(i){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===vu?Error(s(483)):e}throw bu=t,vu}}var bu=null;function _0(){if(bu===null)throw Error(s(459));var e=bu;return bu=null,e}var ui=null,xu=0;function mo(e){var t=xu;return xu+=1,ui===null&&(ui=[]),E0(ui,e,t)}function wu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function po(e,t){throw t.$$typeof===c?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function N0(e){var t=e._init;return t(e._payload)}function C0(e){function t(W,Z){if(e){var I=W.deletions;I===null?(W.deletions=[Z],W.flags|=16):I.push(Z)}}function l(W,Z){if(!e)return null;for(;Z!==null;)t(W,Z),Z=Z.sibling;return null}function i(W){for(var Z=new Map;W!==null;)W.key!==null?Z.set(W.key,W):Z.set(W.index,W),W=W.sibling;return Z}function r(W,Z){return W=Xl(W,Z),W.index=0,W.sibling=null,W}function d(W,Z,I){return W.index=I,e?(I=W.alternate,I!==null?(I=I.index,I<Z?(W.flags|=33554434,Z):I):(W.flags|=33554434,Z)):(W.flags|=1048576,Z)}function S(W){return e&&W.alternate===null&&(W.flags|=33554434),W}function T(W,Z,I,ue){return Z===null||Z.tag!==6?(Z=Zf(I,W.mode,ue),Z.return=W,Z):(Z=r(Z,I),Z.return=W,Z)}function R(W,Z,I,ue){var ye=I.type;return ye===g?ae(W,Z,I.props.children,ue,I.key):Z!==null&&(Z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===O&&N0(ye)===Z.type)?(Z=r(Z,I.props),wu(Z,I),Z.return=W,Z):(Z=ko(I.type,I.key,I.props,null,W.mode,ue),wu(Z,I),Z.return=W,Z)}function K(W,Z,I,ue){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==I.containerInfo||Z.stateNode.implementation!==I.implementation?(Z=Kf(I,W.mode,ue),Z.return=W,Z):(Z=r(Z,I.children||[]),Z.return=W,Z)}function ae(W,Z,I,ue,ye){return Z===null||Z.tag!==7?(Z=Na(I,W.mode,ue,ye),Z.return=W,Z):(Z=r(Z,I),Z.return=W,Z)}function re(W,Z,I){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Zf(""+Z,W.mode,I),Z.return=W,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case f:return I=ko(Z.type,Z.key,Z.props,null,W.mode,I),wu(I,Z),I.return=W,I;case h:return Z=Kf(Z,W.mode,I),Z.return=W,Z;case O:var ue=Z._init;return Z=ue(Z._payload),re(W,Z,I)}if(le(Z)||H(Z))return Z=Na(Z,W.mode,I,null),Z.return=W,Z;if(typeof Z.then=="function")return re(W,mo(Z),I);if(Z.$$typeof===x)return re(W,Oo(W,Z),I);po(W,Z)}return null}function P(W,Z,I,ue){var ye=Z!==null?Z.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return ye!==null?null:T(W,Z,""+I,ue);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case f:return I.key===ye?R(W,Z,I,ue):null;case h:return I.key===ye?K(W,Z,I,ue):null;case O:return ye=I._init,I=ye(I._payload),P(W,Z,I,ue)}if(le(I)||H(I))return ye!==null?null:ae(W,Z,I,ue,null);if(typeof I.then=="function")return P(W,Z,mo(I),ue);if(I.$$typeof===x)return P(W,Z,Oo(W,I),ue);po(W,I)}return null}function ne(W,Z,I,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return W=W.get(I)||null,T(Z,W,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case f:return W=W.get(ue.key===null?I:ue.key)||null,R(Z,W,ue,ye);case h:return W=W.get(ue.key===null?I:ue.key)||null,K(Z,W,ue,ye);case O:var De=ue._init;return ue=De(ue._payload),ne(W,Z,I,ue,ye)}if(le(ue)||H(ue))return W=W.get(I)||null,ae(Z,W,ue,ye,null);if(typeof ue.then=="function")return ne(W,Z,I,mo(ue),ye);if(ue.$$typeof===x)return ne(W,Z,I,Oo(Z,ue),ye);po(Z,ue)}return null}function Se(W,Z,I,ue){for(var ye=null,De=null,Ee=Z,_e=Z=0,Mt=null;Ee!==null&&_e<I.length;_e++){Ee.index>_e?(Mt=Ee,Ee=null):Mt=Ee.sibling;var Ve=P(W,Ee,I[_e],ue);if(Ve===null){Ee===null&&(Ee=Mt);break}e&&Ee&&Ve.alternate===null&&t(W,Ee),Z=d(Ve,Z,_e),De===null?ye=Ve:De.sibling=Ve,De=Ve,Ee=Mt}if(_e===I.length)return l(W,Ee),Be&&ga(W,_e),ye;if(Ee===null){for(;_e<I.length;_e++)Ee=re(W,I[_e],ue),Ee!==null&&(Z=d(Ee,Z,_e),De===null?ye=Ee:De.sibling=Ee,De=Ee);return Be&&ga(W,_e),ye}for(Ee=i(Ee);_e<I.length;_e++)Mt=ne(Ee,W,_e,I[_e],ue),Mt!==null&&(e&&Mt.alternate!==null&&Ee.delete(Mt.key===null?_e:Mt.key),Z=d(Mt,Z,_e),De===null?ye=Mt:De.sibling=Mt,De=Mt);return e&&Ee.forEach(function(Wl){return t(W,Wl)}),Be&&ga(W,_e),ye}function Ce(W,Z,I,ue){if(I==null)throw Error(s(151));for(var ye=null,De=null,Ee=Z,_e=Z=0,Mt=null,Ve=I.next();Ee!==null&&!Ve.done;_e++,Ve=I.next()){Ee.index>_e?(Mt=Ee,Ee=null):Mt=Ee.sibling;var Wl=P(W,Ee,Ve.value,ue);if(Wl===null){Ee===null&&(Ee=Mt);break}e&&Ee&&Wl.alternate===null&&t(W,Ee),Z=d(Wl,Z,_e),De===null?ye=Wl:De.sibling=Wl,De=Wl,Ee=Mt}if(Ve.done)return l(W,Ee),Be&&ga(W,_e),ye;if(Ee===null){for(;!Ve.done;_e++,Ve=I.next())Ve=re(W,Ve.value,ue),Ve!==null&&(Z=d(Ve,Z,_e),De===null?ye=Ve:De.sibling=Ve,De=Ve);return Be&&ga(W,_e),ye}for(Ee=i(Ee);!Ve.done;_e++,Ve=I.next())Ve=ne(Ee,W,_e,Ve.value,ue),Ve!==null&&(e&&Ve.alternate!==null&&Ee.delete(Ve.key===null?_e:Ve.key),Z=d(Ve,Z,_e),De===null?ye=Ve:De.sibling=Ve,De=Ve);return e&&Ee.forEach(function(IT){return t(W,IT)}),Be&&ga(W,_e),ye}function it(W,Z,I,ue){if(typeof I=="object"&&I!==null&&I.type===g&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case f:e:{for(var ye=I.key;Z!==null;){if(Z.key===ye){if(ye=I.type,ye===g){if(Z.tag===7){l(W,Z.sibling),ue=r(Z,I.props.children),ue.return=W,W=ue;break e}}else if(Z.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===O&&N0(ye)===Z.type){l(W,Z.sibling),ue=r(Z,I.props),wu(ue,I),ue.return=W,W=ue;break e}l(W,Z);break}else t(W,Z);Z=Z.sibling}I.type===g?(ue=Na(I.props.children,W.mode,ue,I.key),ue.return=W,W=ue):(ue=ko(I.type,I.key,I.props,null,W.mode,ue),wu(ue,I),ue.return=W,W=ue)}return S(W);case h:e:{for(ye=I.key;Z!==null;){if(Z.key===ye)if(Z.tag===4&&Z.stateNode.containerInfo===I.containerInfo&&Z.stateNode.implementation===I.implementation){l(W,Z.sibling),ue=r(Z,I.children||[]),ue.return=W,W=ue;break e}else{l(W,Z);break}else t(W,Z);Z=Z.sibling}ue=Kf(I,W.mode,ue),ue.return=W,W=ue}return S(W);case O:return ye=I._init,I=ye(I._payload),it(W,Z,I,ue)}if(le(I))return Se(W,Z,I,ue);if(H(I)){if(ye=H(I),typeof ye!="function")throw Error(s(150));return I=ye.call(I),Ce(W,Z,I,ue)}if(typeof I.then=="function")return it(W,Z,mo(I),ue);if(I.$$typeof===x)return it(W,Z,Oo(W,I),ue);po(W,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,Z!==null&&Z.tag===6?(l(W,Z.sibling),ue=r(Z,I),ue.return=W,W=ue):(l(W,Z),ue=Zf(I,W.mode,ue),ue.return=W,W=ue),S(W)):l(W,Z)}return function(W,Z,I,ue){try{xu=0;var ye=it(W,Z,I,ue);return ui=null,ye}catch(Ee){if(Ee===vu)throw Ee;var De=yn(29,Ee,null,W.mode);return De.lanes=ue,De.return=W,De}finally{}}}var pa=C0(!0),M0=C0(!1),si=ie(null),yo=ie(0);function T0(e,t){e=hl,me(yo,e),me(si,t),hl=e|t.baseLanes}function Ic(){me(yo,hl),me(si,si.current)}function Pc(){hl=yo.current,ge(si),ge(yo)}var gn=ie(null),Bn=null;function zl(e){var t=e.alternate;me(xt,xt.current&1),me(gn,e),Bn===null&&(t===null||si.current!==null||t.memoizedState!==null)&&(Bn=e)}function A0(e){if(e.tag===22){if(me(xt,xt.current),me(gn,e),Bn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Bn=e)}}else Dl()}function Dl(){me(xt,xt.current),me(gn,gn.current)}function ll(e){ge(gn),Bn===e&&(Bn=null),ge(xt)}var xt=ie(0);function vo(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var BM=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},VM=n.unstable_scheduleCallback,YM=n.unstable_NormalPriority,wt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ef(){return{controller:new BM,data:new Map,refCount:0}}function Su(e){e.refCount--,e.refCount===0&&VM(YM,function(){e.controller.abort()})}var Eu=null,tf=0,oi=0,ri=null;function qM(e,t){if(Eu===null){var l=Eu=[];tf=0,oi=od(),ri={status:"pending",value:void 0,then:function(i){l.push(i)}}}return tf++,t.then(j0,j0),t}function j0(){if(--tf===0&&Eu!==null){ri!==null&&(ri.status="fulfilled");var e=Eu;Eu=null,oi=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function XM(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(r){l.push(r)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var r=0;r<l.length;r++)(0,l[r])(t)},function(r){for(i.status="rejected",i.reason=r,r=0;r<l.length;r++)(0,l[r])(void 0)}),i}var O0=q.S;q.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&qM(e,t),O0!==null&&O0(e,t)};var ya=ie(null);function nf(){var e=ya.current;return e!==null?e:Ke.pooledCache}function bo(e,t){t===null?me(ya,ya.current):me(ya,t.pool)}function z0(){var e=nf();return e===null?null:{parent:wt._currentValue,pool:e}}var kl=0,ze=null,qe=null,mt=null,xo=!1,ci=!1,va=!1,wo=0,_u=0,fi=null,$M=0;function rt(){throw Error(s(321))}function lf(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!en(e[l],t[l]))return!1;return!0}function af(e,t,l,i,r,d){return kl=d,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?ba:Rl,va=!1,d=l(i,r),va=!1,ci&&(d=k0(t,l,i,r)),D0(e),d}function D0(e){q.H=Vn;var t=qe!==null&&qe.next!==null;if(kl=0,mt=qe=ze=null,xo=!1,_u=0,fi=null,t)throw Error(s(300));e===null||Nt||(e=e.dependencies,e!==null&&jo(e)&&(Nt=!0))}function k0(e,t,l,i){ze=e;var r=0;do{if(ci&&(fi=null),_u=0,ci=!1,25<=r)throw Error(s(301));if(r+=1,mt=qe=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}q.H=xa,d=t(l,i)}while(ci);return d}function GM(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Nu(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(ze.flags|=1024),t}function uf(){var e=wo!==0;return wo=0,e}function sf(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function of(e){if(xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xo=!1}kl=0,mt=qe=ze=null,ci=!1,_u=wo=0,fi=null}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?ze.memoizedState=mt=e:mt=mt.next=e,mt}function pt(){if(qe===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=mt===null?ze.memoizedState:mt.next;if(t!==null)mt=t,qe=e;else{if(e===null)throw ze.alternate===null?Error(s(467)):Error(s(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},mt===null?ze.memoizedState=mt=e:mt=mt.next=e}return mt}var So;So=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function Nu(e){var t=_u;return _u+=1,fi===null&&(fi=[]),e=E0(fi,e,t),t=ze,(mt===null?t.memoizedState:mt.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?ba:Rl),e}function Eo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Nu(e);if(e.$$typeof===x)return Lt(e)}throw Error(s(438,String(e)))}function rf(e){var t=null,l=ze.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=So(),ze.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=C;return t.index++,l}function al(e,t){return typeof t=="function"?t(e):t}function _o(e){var t=pt();return cf(t,qe,e)}function cf(e,t,l){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=l;var r=e.baseQueue,d=i.pending;if(d!==null){if(r!==null){var S=r.next;r.next=d.next,d.next=S}t.baseQueue=r=d,i.pending=null}if(d=e.baseState,r===null)e.memoizedState=d;else{t=r.next;var T=S=null,R=null,K=t,ae=!1;do{var re=K.lane&-536870913;if(re!==K.lane?(Ue&re)===re:(kl&re)===re){var P=K.revertLane;if(P===0)R!==null&&(R=R.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),re===oi&&(ae=!0);else if((kl&P)===P){K=K.next,P===oi&&(ae=!0);continue}else re={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(T=R=re,S=d):R=R.next=re,ze.lanes|=P,$l|=P;re=K.action,va&&l(d,re),d=K.hasEagerState?K.eagerState:l(d,re)}else P={lane:re,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(T=R=P,S=d):R=R.next=P,ze.lanes|=re,$l|=re;K=K.next}while(K!==null&&K!==t);if(R===null?S=d:R.next=T,!en(d,e.memoizedState)&&(Nt=!0,ae&&(l=ri,l!==null)))throw l;e.memoizedState=d,e.baseState=S,e.baseQueue=R,i.lastRenderedState=d}return r===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ff(e){var t=pt(),l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=e;var i=l.dispatch,r=l.pending,d=t.memoizedState;if(r!==null){l.pending=null;var S=r=r.next;do d=e(d,S.action),S=S.next;while(S!==r);en(d,t.memoizedState)||(Nt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),l.lastRenderedState=d}return[d,i]}function R0(e,t,l){var i=ze,r=pt(),d=Be;if(d){if(l===void 0)throw Error(s(407));l=l()}else l=t();var S=!en((qe||r).memoizedState,l);if(S&&(r.memoizedState=l,Nt=!0),r=r.queue,gf(U0.bind(null,i,r,e),[e]),r.getSnapshot!==t||S||mt!==null&&mt.memoizedState.tag&1){if(i.flags|=2048,di(9,L0.bind(null,i,r,l,t),{destroy:void 0},null),Ke===null)throw Error(s(349));d||kl&60||H0(i,t,l)}return l}function H0(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ze.updateQueue,t===null?(t=So(),ze.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function L0(e,t,l,i){t.value=l,t.getSnapshot=i,B0(t)&&V0(e)}function U0(e,t,l){return l(function(){B0(t)&&V0(e)})}function B0(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!en(e,l)}catch{return!0}}function V0(e){var t=Ol(e,2);t!==null&&Yt(t,e,2)}function df(e){var t=Jt();if(typeof e=="function"){var l=e;if(e=l(),va){Gt(!0);try{l()}finally{Gt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:e},t}function Y0(e,t,l,i){return e.baseState=l,cf(e,qe,typeof i=="function"?i:al)}function ZM(e,t,l,i,r){if(Mo(e))throw Error(s(485));if(e=t.action,e!==null){var d={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){d.listeners.push(S)}};q.T!==null?l(!0):d.isTransition=!1,i(d),l=t.pending,l===null?(d.next=t.pending=d,q0(t,d)):(d.next=l.next,t.pending=l.next=d)}}function q0(e,t){var l=t.action,i=t.payload,r=e.state;if(t.isTransition){var d=q.T,S={};q.T=S;try{var T=l(r,i),R=q.S;R!==null&&R(S,T),X0(e,t,T)}catch(K){hf(e,t,K)}finally{q.T=d}}else try{d=l(r,i),X0(e,t,d)}catch(K){hf(e,t,K)}}function X0(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){$0(e,t,i)},function(i){return hf(e,t,i)}):$0(e,t,l)}function $0(e,t,l){t.status="fulfilled",t.value=l,G0(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,q0(e,l)))}function hf(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,G0(t),t=t.next;while(t!==i)}e.action=null}function G0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Z0(e,t){return t}function K0(e,t){if(Be){var l=Ke.formState;if(l!==null){e:{var i=ze;if(Be){if(Tt){t:{for(var r=Tt,d=Un;r.nodeType!==8;){if(!d){r=null;break t}if(r=zn(r.nextSibling),r===null){r=null;break t}}d=r.data,r=d==="F!"||d==="F"?r:null}if(r){Tt=zn(r.nextSibling),i=r.data==="F!";break e}}ma(i)}i=!1}i&&(t=l[0])}}return l=Jt(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z0,lastRenderedState:t},l.queue=i,l=fy.bind(null,ze,i),i.dispatch=l,i=df(!1),d=bf.bind(null,ze,!1,i.queue),i=Jt(),r={state:t,dispatch:null,action:e,pending:null},i.queue=r,l=ZM.bind(null,ze,r,d,l),r.dispatch=l,i.memoizedState=e,[t,l,!1]}function Q0(e){var t=pt();return J0(t,qe,e)}function J0(e,t,l){t=cf(e,t,Z0)[0],e=_o(al)[0],t=typeof t=="object"&&t!==null&&typeof t.then=="function"?Nu(t):t;var i=pt(),r=i.queue,d=r.dispatch;return l!==i.memoizedState&&(ze.flags|=2048,di(9,KM.bind(null,r,l),{destroy:void 0},null)),[t,d,e]}function KM(e,t){e.action=t}function W0(e){var t=pt(),l=qe;if(l!==null)return J0(t,l,e);pt(),t=t.memoizedState,l=pt();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function di(e,t,l,i){return e={tag:e,create:t,inst:l,deps:i,next:null},t=ze.updateQueue,t===null&&(t=So(),ze.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function F0(){return pt().memoizedState}function No(e,t,l,i){var r=Jt();ze.flags|=e,r.memoizedState=di(1|t,l,{destroy:void 0},i===void 0?null:i)}function Co(e,t,l,i){var r=pt();i=i===void 0?null:i;var d=r.memoizedState.inst;qe!==null&&i!==null&&lf(i,qe.memoizedState.deps)?r.memoizedState=di(t,l,d,i):(ze.flags|=e,r.memoizedState=di(1|t,l,d,i))}function I0(e,t){No(8390656,8,e,t)}function gf(e,t){Co(2048,8,e,t)}function P0(e,t){return Co(4,2,e,t)}function ey(e,t){return Co(4,4,e,t)}function ty(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ny(e,t,l){l=l!=null?l.concat([e]):null,Co(4,4,ty.bind(null,t,e),l)}function mf(){}function ly(e,t){var l=pt();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&lf(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function ay(e,t){var l=pt();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&lf(t,i[1]))return i[0];if(i=e(),va){Gt(!0);try{e()}finally{Gt(!1)}}return l.memoizedState=[i,t],i}function pf(e,t,l){return l===void 0||kl&1073741824?e.memoizedState=t:(e.memoizedState=l,e=u1(),ze.lanes|=e,$l|=e,l)}function iy(e,t,l,i){return en(l,t)?l:si.current!==null?(e=pf(e,l,i),en(e,t)||(Nt=!0),e):kl&42?(e=u1(),ze.lanes|=e,$l|=e,t):(Nt=!0,e.memoizedState=l)}function uy(e,t,l,i,r){var d=ee.p;ee.p=d!==0&&8>d?d:8;var S=q.T,T={};q.T=T,bf(e,!1,t,l);try{var R=r(),K=q.S;if(K!==null&&K(T,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ae=XM(R,i);Cu(e,t,ae,an(e))}else Cu(e,t,i,an(e))}catch(re){Cu(e,t,{then:function(){},status:"rejected",reason:re},an())}finally{ee.p=d,q.T=S}}function QM(){}function yf(e,t,l,i){if(e.tag!==5)throw Error(s(476));var r=sy(e).queue;uy(e,r,t,de,l===null?QM:function(){return oy(e),l(i)})}function sy(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:de},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function oy(e){var t=sy(e).next.queue;Cu(e,t,{},an())}function vf(){return Lt(Zu)}function ry(){return pt().memoizedState}function cy(){return pt().memoizedState}function JM(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=an();e=Ul(l);var i=Bl(t,e,l);i!==null&&(Yt(i,t,l),Au(i,t,l)),t={cache:ef()},e.payload=t;return}t=t.return}}function WM(e,t,l){var i=an();l={lane:i,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},Mo(e)?dy(t,l):(l=Kc(e,t,l,i),l!==null&&(Yt(l,e,i),hy(l,t,i)))}function fy(e,t,l){var i=an();Cu(e,t,l,i)}function Cu(e,t,l,i){var r={lane:i,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(Mo(e))dy(t,r);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var S=t.lastRenderedState,T=d(S,l);if(r.hasEagerState=!0,r.eagerState=T,en(T,S))return ro(e,t,r,0),Ke===null&&oo(),!1}catch{}finally{}if(l=Kc(e,t,r,i),l!==null)return Yt(l,e,i),hy(l,t,i),!0}return!1}function bf(e,t,l,i){if(i={lane:2,revertLane:od(),action:i,hasEagerState:!1,eagerState:null,next:null},Mo(e)){if(t)throw Error(s(479))}else t=Kc(e,l,i,2),t!==null&&Yt(t,e,2)}function Mo(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function dy(e,t){ci=xo=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function hy(e,t,l){if(l&4194176){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Je(e,l)}}var Vn={readContext:Lt,use:Eo,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt};Vn.useCacheRefresh=rt,Vn.useMemoCache=rt,Vn.useHostTransitionStatus=rt,Vn.useFormState=rt,Vn.useActionState=rt,Vn.useOptimistic=rt;var ba={readContext:Lt,use:Eo,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:I0,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,No(4194308,4,ty.bind(null,t,e),l)},useLayoutEffect:function(e,t){return No(4194308,4,e,t)},useInsertionEffect:function(e,t){No(4,2,e,t)},useMemo:function(e,t){var l=Jt();t=t===void 0?null:t;var i=e();if(va){Gt(!0);try{e()}finally{Gt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=Jt();if(l!==void 0){var r=l(t);if(va){Gt(!0);try{l(t)}finally{Gt(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=WM.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:function(e){e=df(e);var t=e.queue,l=fy.bind(null,ze,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:mf,useDeferredValue:function(e,t){var l=Jt();return pf(l,e,t)},useTransition:function(){var e=df(!1);return e=uy.bind(null,ze,e.queue,!0,!1),Jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=ze,r=Jt();if(Be){if(l===void 0)throw Error(s(407));l=l()}else{if(l=t(),Ke===null)throw Error(s(349));Ue&60||H0(i,t,l)}r.memoizedState=l;var d={value:l,getSnapshot:t};return r.queue=d,I0(U0.bind(null,i,d,e),[e]),i.flags|=2048,di(9,L0.bind(null,i,d,l,t),{destroy:void 0},null),l},useId:function(){var e=Jt(),t=Ke.identifierPrefix;if(Be){var l=nl,i=tl;l=(i&~(1<<32-vt(i)-1)).toString(32)+l,t=":"+t+"R"+l,l=wo++,0<l&&(t+="H"+l.toString(32)),t+=":"}else l=$M++,t=":"+t+"r"+l.toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return Jt().memoizedState=JM.bind(null,ze)}};ba.useMemoCache=rf,ba.useHostTransitionStatus=vf,ba.useFormState=K0,ba.useActionState=K0,ba.useOptimistic=function(e){var t=Jt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=bf.bind(null,ze,!0,l),l.dispatch=t,[e,t]};var Rl={readContext:Lt,use:Eo,useCallback:ly,useContext:Lt,useEffect:gf,useImperativeHandle:ny,useInsertionEffect:P0,useLayoutEffect:ey,useMemo:ay,useReducer:_o,useRef:F0,useState:function(){return _o(al)},useDebugValue:mf,useDeferredValue:function(e,t){var l=pt();return iy(l,qe.memoizedState,e,t)},useTransition:function(){var e=_o(al)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Nu(e),t]},useSyncExternalStore:R0,useId:ry};Rl.useCacheRefresh=cy,Rl.useMemoCache=rf,Rl.useHostTransitionStatus=vf,Rl.useFormState=Q0,Rl.useActionState=Q0,Rl.useOptimistic=function(e,t){var l=pt();return Y0(l,qe,e,t)};var xa={readContext:Lt,use:Eo,useCallback:ly,useContext:Lt,useEffect:gf,useImperativeHandle:ny,useInsertionEffect:P0,useLayoutEffect:ey,useMemo:ay,useReducer:ff,useRef:F0,useState:function(){return ff(al)},useDebugValue:mf,useDeferredValue:function(e,t){var l=pt();return qe===null?pf(l,e,t):iy(l,qe.memoizedState,e,t)},useTransition:function(){var e=ff(al)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Nu(e),t]},useSyncExternalStore:R0,useId:ry};xa.useCacheRefresh=cy,xa.useMemoCache=rf,xa.useHostTransitionStatus=vf,xa.useFormState=W0,xa.useActionState=W0,xa.useOptimistic=function(e,t){var l=pt();return qe!==null?Y0(l,qe,e,t):(l.baseState=e,[e,l.queue.dispatch])};function xf(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:te({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var wf={isMounted:function(e){return(e=e._reactInternals)?G(e)===e:!1},enqueueSetState:function(e,t,l){e=e._reactInternals;var i=an(),r=Ul(i);r.payload=t,l!=null&&(r.callback=l),t=Bl(e,r,i),t!==null&&(Yt(t,e,i),Au(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=an(),r=Ul(i);r.tag=1,r.payload=t,l!=null&&(r.callback=l),t=Bl(e,r,i),t!==null&&(Yt(t,e,i),Au(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=an(),i=Ul(l);i.tag=2,t!=null&&(i.callback=t),t=Bl(e,i,l),t!==null&&(Yt(t,e,l),Au(t,e,l))}};function gy(e,t,l,i,r,d,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,S):t.prototype&&t.prototype.isPureReactComponent?!hu(l,i)||!hu(r,d):!0}function my(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&wf.enqueueReplaceState(t,t.state,null)}function wa(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=te({},l));for(var r in e)l[r]===void 0&&(l[r]=e[r])}return l}var To=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function py(e){To(e)}function yy(e){console.error(e)}function vy(e){To(e)}function Ao(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function by(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Sf(e,t,l){return l=Ul(l),l.tag=3,l.payload={element:null},l.callback=function(){Ao(e,t)},l}function xy(e){return e=Ul(e),e.tag=3,e}function wy(e,t,l,i){var r=l.type.getDerivedStateFromError;if(typeof r=="function"){var d=i.value;e.payload=function(){return r(d)},e.callback=function(){by(t,l,i)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){by(t,l,i),typeof r!="function"&&(Gl===null?Gl=new Set([this]):Gl.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function FM(e,t,l,i,r){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&Tu(t,l,r,!0),l=gn.current,l!==null){switch(l.tag){case 13:return Bn===null?ld():l.alternate===null&&at===0&&(at=3),l.flags&=-257,l.flags|=65536,l.lanes=r,i===Fc?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),id(e,i,r)),!1;case 22:return l.flags|=65536,i===Fc?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),id(e,i,r)),!1}throw Error(s(435,l.tag))}return id(e,i,r),ld(),!1}if(Be)return t=gn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==Wc&&(e=Error(s(422),{cause:i}),yu(fn(e,l)))):(i!==Wc&&(t=Error(s(423),{cause:i}),yu(fn(t,l))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,i=fn(i,l),r=Sf(e.stateNode,i,r),Lf(e,r),at!==4&&(at=2)),!1;var d=Error(s(520),{cause:i});if(d=fn(d,l),Lu===null?Lu=[d]:Lu.push(d),at!==4&&(at=2),t===null)return!0;i=fn(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=r&-r,l.lanes|=e,e=Sf(l.stateNode,i,e),Lf(l,e),!1;case 1:if(t=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Gl===null||!Gl.has(d))))return l.flags|=65536,r&=-r,l.lanes|=r,r=xy(r),wy(r,e,l,i),Lf(l,r),!1}l=l.return}while(l!==null);return!1}var Sy=Error(s(461)),Nt=!1;function At(e,t,l,i){t.child=e===null?M0(t,null,l,i):pa(t,e.child,l,i)}function Ey(e,t,l,i,r){l=l.render;var d=t.ref;if("ref"in i){var S={};for(var T in i)T!=="ref"&&(S[T]=i[T])}else S=i;return Ea(t),i=af(e,t,l,S,d,r),T=uf(),e!==null&&!Nt?(sf(e,t,r),il(e,t,r)):(Be&&T&&Qc(t),t.flags|=1,At(e,t,i,r),t.child)}function _y(e,t,l,i,r){if(e===null){var d=l.type;return typeof d=="function"&&!Gf(d)&&d.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=d,Ny(e,t,d,i,r)):(e=ko(l.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Of(e,r)){var S=d.memoizedProps;if(l=l.compare,l=l!==null?l:hu,l(S,i)&&e.ref===t.ref)return il(e,t,r)}return t.flags|=1,e=Xl(d,i),e.ref=t.ref,e.return=t,t.child=e}function Ny(e,t,l,i,r){if(e!==null){var d=e.memoizedProps;if(hu(d,i)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=i=d,Of(e,r))e.flags&131072&&(Nt=!0);else return t.lanes=e.lanes,il(e,t,r)}return Ef(e,t,l,i,r)}function Cy(e,t,l){var i=t.pendingProps,r=i.children,d=(t.stateNode._pendingVisibility&2)!==0,S=e!==null?e.memoizedState:null;if(Mu(e,t),i.mode==="hidden"||d){if(t.flags&128){if(i=S!==null?S.baseLanes|l:l,e!==null){for(r=t.child=e.child,d=0;r!==null;)d=d|r.lanes|r.childLanes,r=r.sibling;t.childLanes=d&~i}else t.childLanes=0,t.child=null;return My(e,t,i,l)}if(l&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bo(t,S!==null?S.cachePool:null),S!==null?T0(t,S):Ic(),A0(t);else return t.lanes=t.childLanes=536870912,My(e,t,S!==null?S.baseLanes|l:l,l)}else S!==null?(bo(t,S.cachePool),T0(t,S),Dl(),t.memoizedState=null):(e!==null&&bo(t,null),Ic(),Dl());return At(e,t,r,l),t.child}function My(e,t,l,i){var r=nf();return r=r===null?null:{parent:wt._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&bo(t,null),Ic(),A0(t),e!==null&&Tu(e,t,i,!0),null}function Mu(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(e===null||e.ref!==l)&&(t.flags|=2097664)}}function Ef(e,t,l,i,r){return Ea(t),l=af(e,t,l,i,void 0,r),i=uf(),e!==null&&!Nt?(sf(e,t,r),il(e,t,r)):(Be&&i&&Qc(t),t.flags|=1,At(e,t,l,r),t.child)}function Ty(e,t,l,i,r,d){return Ea(t),t.updateQueue=null,l=k0(t,i,l,r),D0(e),i=uf(),e!==null&&!Nt?(sf(e,t,d),il(e,t,d)):(Be&&i&&Qc(t),t.flags|=1,At(e,t,l,d),t.child)}function Ay(e,t,l,i,r){if(Ea(t),t.stateNode===null){var d=li,S=l.contextType;typeof S=="object"&&S!==null&&(d=Lt(S)),d=new l(i,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=wf,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=i,d.state=t.memoizedState,d.refs={},Rf(t),S=l.contextType,d.context=typeof S=="object"&&S!==null?Lt(S):li,d.state=t.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(xf(t,l,S,i),d.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(S=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),S!==d.state&&wf.enqueueReplaceState(d,d.state,null),Ou(t,i,d,r),ju(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){d=t.stateNode;var T=t.memoizedProps,R=wa(l,T);d.props=R;var K=d.context,ae=l.contextType;S=li,typeof ae=="object"&&ae!==null&&(S=Lt(ae));var re=l.getDerivedStateFromProps;ae=typeof re=="function"||typeof d.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,ae||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(T||K!==S)&&my(t,d,i,S),Ll=!1;var P=t.memoizedState;d.state=P,Ou(t,i,d,r),ju(),K=t.memoizedState,T||P!==K||Ll?(typeof re=="function"&&(xf(t,l,re,i),K=t.memoizedState),(R=Ll||gy(t,l,R,i,P,K,S))?(ae||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=K),d.props=i,d.state=K,d.context=S,i=R):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{d=t.stateNode,Hf(e,t),S=t.memoizedProps,ae=wa(l,S),d.props=ae,re=t.pendingProps,P=d.context,K=l.contextType,R=li,typeof K=="object"&&K!==null&&(R=Lt(K)),T=l.getDerivedStateFromProps,(K=typeof T=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(S!==re||P!==R)&&my(t,d,i,R),Ll=!1,P=t.memoizedState,d.state=P,Ou(t,i,d,r),ju();var ne=t.memoizedState;S!==re||P!==ne||Ll||e!==null&&e.dependencies!==null&&jo(e.dependencies)?(typeof T=="function"&&(xf(t,l,T,i),ne=t.memoizedState),(ae=Ll||gy(t,l,ae,i,P,ne,R)||e!==null&&e.dependencies!==null&&jo(e.dependencies))?(K||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(i,ne,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(i,ne,R)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||S===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),d.props=i,d.state=ne,d.context=R,i=ae):(typeof d.componentDidUpdate!="function"||S===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),i=!1)}return d=i,Mu(e,t),i=(t.flags&128)!==0,d||i?(d=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&i?(t.child=pa(t,e.child,null,r),t.child=pa(t,null,l,r)):At(e,t,l,r),t.memoizedState=d.state,e=t.child):e=il(e,t,r),e}function jy(e,t,l,i){return pu(),t.flags|=256,At(e,t,l,i),t.child}var _f={dehydrated:null,treeContext:null,retryLane:0};function Nf(e){return{baseLanes:e,cachePool:z0()}}function Cf(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=vn),e}function Oy(e,t,l){var i=t.pendingProps,r=!1,d=(t.flags&128)!==0,S;if((S=d)||(S=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),S&&(r=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(r?zl(t):Dl(),Be){var T=Tt,R;if(R=T){e:{for(R=T,T=Un;R.nodeType!==8;){if(!T){T=null;break e}if(R=zn(R.nextSibling),R===null){T=null;break e}}T=R}T!==null?(t.memoizedState={dehydrated:T,treeContext:ha!==null?{id:tl,overflow:nl}:null,retryLane:536870912},R=yn(18,null,null,0),R.stateNode=T,R.return=t,t.child=R,Vt=t,Tt=null,R=!0):R=!1}R||ma(t)}if(T=t.memoizedState,T!==null&&(T=T.dehydrated,T!==null))return T.data==="$!"?t.lanes=16:t.lanes=536870912,null;ll(t)}return T=i.children,i=i.fallback,r?(Dl(),r=t.mode,T=Tf({mode:"hidden",children:T},r),i=Na(i,r,l,null),T.return=t,i.return=t,T.sibling=i,t.child=T,r=t.child,r.memoizedState=Nf(l),r.childLanes=Cf(e,S,l),t.memoizedState=_f,i):(zl(t),Mf(t,T))}if(R=e.memoizedState,R!==null&&(T=R.dehydrated,T!==null)){if(d)t.flags&256?(zl(t),t.flags&=-257,t=Af(e,t,l)):t.memoizedState!==null?(Dl(),t.child=e.child,t.flags|=128,t=null):(Dl(),r=i.fallback,T=t.mode,i=Tf({mode:"visible",children:i.children},T),r=Na(r,T,l,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,pa(t,e.child,null,l),i=t.child,i.memoizedState=Nf(l),i.childLanes=Cf(e,S,l),t.memoizedState=_f,t=r);else if(zl(t),T.data==="$!"){if(S=T.nextSibling&&T.nextSibling.dataset,S)var K=S.dgst;S=K,i=Error(s(419)),i.stack="",i.digest=S,yu({value:i,source:null,stack:null}),t=Af(e,t,l)}else if(Nt||Tu(e,t,l,!1),S=(l&e.childLanes)!==0,Nt||S){if(S=Ke,S!==null){if(i=l&-l,i&42)i=1;else switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:i=64;break;case 268435456:i=134217728;break;default:i=0}if(i=i&(S.suspendedLanes|l)?0:i,i!==0&&i!==R.retryLane)throw R.retryLane=i,Ol(e,i),Yt(S,e,i),Sy}T.data==="$?"||ld(),t=Af(e,t,l)}else T.data==="$?"?(t.flags|=128,t.child=e.child,t=dT.bind(null,e),T._reactRetry=t,t=null):(e=R.treeContext,Tt=zn(T.nextSibling),Vt=t,Be=!0,jn=null,Un=!1,e!==null&&(dn[hn++]=tl,dn[hn++]=nl,dn[hn++]=ha,tl=e.id,nl=e.overflow,ha=t),t=Mf(t,i.children),t.flags|=4096);return t}return r?(Dl(),r=i.fallback,T=t.mode,R=e.child,K=R.sibling,i=Xl(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&31457280,K!==null?r=Xl(K,r):(r=Na(r,T,l,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,i=r,r=t.child,T=e.child.memoizedState,T===null?T=Nf(l):(R=T.cachePool,R!==null?(K=wt._currentValue,R=R.parent!==K?{parent:K,pool:K}:R):R=z0(),T={baseLanes:T.baseLanes|l,cachePool:R}),r.memoizedState=T,r.childLanes=Cf(e,S,l),t.memoizedState=_f,i):(zl(t),l=e.child,e=l.sibling,l=Xl(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=l,t.memoizedState=null,l)}function Mf(e,t){return t=Tf({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Tf(e,t){return l1(e,t,0,null)}function Af(e,t,l){return pa(t,e.child,null,l),e=Mf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zy(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Df(e.return,t,l)}function jf(e,t,l,i,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=i,d.tail=l,d.tailMode=r)}function Dy(e,t,l){var i=t.pendingProps,r=i.revealOrder,d=i.tail;if(At(e,t,i.children,l),i=xt.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zy(e,l,t);else if(e.tag===19)zy(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(me(xt,i),r){case"forwards":for(l=t.child,r=null;l!==null;)e=l.alternate,e!==null&&vo(e)===null&&(r=l),l=l.sibling;l=r,l===null?(r=t.child,t.child=null):(r=l.sibling,l.sibling=null),jf(t,!1,r,l,d);break;case"backwards":for(l=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&vo(e)===null){t.child=r;break}e=r.sibling,r.sibling=l,l=r,r=e}jf(t,!0,l,null,d);break;case"together":jf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function il(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,!(l&t.childLanes))if(e!==null){if(Tu(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,l=Xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Xl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Of(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&jo(e)))}function IM(e,t,l){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),Hl(t,wt,e.memoizedState.cache),pu();break;case 27:case 5:Ne(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:Hl(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(zl(t),t.flags|=128,null):l&t.child.childLanes?Oy(e,t,l):(zl(t),e=il(e,t,l),e!==null?e.sibling:null);zl(t);break;case 19:var r=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(Tu(e,t,l,!1),i=(l&t.childLanes)!==0),r){if(i)return Dy(e,t,l);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),me(xt,xt.current),i)break;return null;case 22:case 23:return t.lanes=0,Cy(e,t,l);case 24:Hl(t,wt,e.memoizedState.cache)}return il(e,t,l)}function ky(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!Of(e,l)&&!(t.flags&128))return Nt=!1,IM(e,t,l);Nt=!!(e.flags&131072)}else Nt=!1,Be&&t.flags&1048576&&v0(t,ho,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,r=i._init;if(i=r(i._payload),t.type=i,typeof i=="function")Gf(i)?(e=wa(i,e),t.tag=1,t=Ay(null,t,i,e,l)):(t.tag=0,t=Ef(null,t,i,e,l));else{if(i!=null){if(r=i.$$typeof,r===w){t.tag=11,t=Ey(null,t,i,e,l);break e}else if(r===M){t.tag=14,t=_y(null,t,i,e,l);break e}}throw t=Q(i)||i,Error(s(306,t,""))}}return t;case 0:return Ef(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,r=wa(i,t.pendingProps),Ay(e,t,i,r,l);case 3:e:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(s(387));var d=t.pendingProps;r=t.memoizedState,i=r.element,Hf(e,t),Ou(t,d,null,l);var S=t.memoizedState;if(d=S.cache,Hl(t,wt,d),d!==r.cache&&kf(t,[wt],l,!0),ju(),d=S.element,r.isDehydrated)if(r={element:d,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=jy(e,t,d,l);break e}else if(d!==i){i=fn(Error(s(424)),t),yu(i),t=jy(e,t,d,l);break e}else for(Tt=zn(t.stateNode.containerInfo.firstChild),Vt=t,Be=!0,jn=null,Un=!0,l=M0(t,null,d,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pu(),d===i){t=il(e,t,l);break e}At(e,t,d,l)}t=t.child}return t;case 26:return Mu(e,t),e===null?(l=L1(t.type,null,t.pendingProps,null))?t.memoizedState=l:Be||(l=t.type,e=t.pendingProps,i=Zo(pe.current).createElement(l),i[_t]=t,i[Rt]=e,jt(i,l,e),gt(i),t.stateNode=i):t.memoizedState=L1(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&Be&&(i=t.stateNode=k1(t.type,t.pendingProps,pe.current),Vt=t,Un=!0,Tt=zn(i.firstChild)),i=t.pendingProps.children,e!==null||Be?At(e,t,i,l):t.child=pa(t,null,i,l),Mu(e,t),t.child;case 5:return e===null&&Be&&((r=i=Tt)&&(i=TT(i,t.type,t.pendingProps,Un),i!==null?(t.stateNode=i,Vt=t,Tt=zn(i.firstChild),Un=!1,r=!0):r=!1),r||ma(t)),Ne(t),r=t.type,d=t.pendingProps,S=e!==null?e.memoizedProps:null,i=d.children,yd(r,d)?i=null:S!==null&&yd(r,S)&&(t.flags|=32),t.memoizedState!==null&&(r=af(e,t,GM,null,null,l),Zu._currentValue=r),Mu(e,t),At(e,t,i,l),t.child;case 6:return e===null&&Be&&((e=l=Tt)&&(l=AT(l,t.pendingProps,Un),l!==null?(t.stateNode=l,Vt=t,Tt=null,e=!0):e=!1),e||ma(t)),null;case 13:return Oy(e,t,l);case 4:return Ae(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=pa(t,null,i,l):At(e,t,i,l),t.child;case 11:return Ey(e,t,t.type,t.pendingProps,l);case 7:return At(e,t,t.pendingProps,l),t.child;case 8:return At(e,t,t.pendingProps.children,l),t.child;case 12:return At(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Hl(t,t.type,i.value),At(e,t,i.children,l),t.child;case 9:return r=t.type._context,i=t.pendingProps.children,Ea(t),r=Lt(r),i=i(r),t.flags|=1,At(e,t,i,l),t.child;case 14:return _y(e,t,t.type,t.pendingProps,l);case 15:return Ny(e,t,t.type,t.pendingProps,l);case 19:return Dy(e,t,l);case 22:return Cy(e,t,l);case 24:return Ea(t),i=Lt(wt),e===null?(r=nf(),r===null&&(r=Ke,d=ef(),r.pooledCache=d,d.refCount++,d!==null&&(r.pooledCacheLanes|=l),r=d),t.memoizedState={parent:i,cache:r},Rf(t),Hl(t,wt,r)):(e.lanes&l&&(Hf(e,t),Ou(t,null,null,l),ju()),r=e.memoizedState,d=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Hl(t,wt,i)):(i=d.cache,Hl(t,wt,i),i!==r.cache&&kf(t,[wt],l,!0))),At(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}var zf=ie(null),Sa=null,ul=null;function Hl(e,t,l){me(zf,t._currentValue),t._currentValue=l}function sl(e){e._currentValue=zf.current,ge(zf)}function Df(e,t,l){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===l)break;e=e.return}}function kf(e,t,l,i){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var d=r.dependencies;if(d!==null){var S=r.child;d=d.firstContext;e:for(;d!==null;){var T=d;d=r;for(var R=0;R<t.length;R++)if(T.context===t[R]){d.lanes|=l,T=d.alternate,T!==null&&(T.lanes|=l),Df(d.return,l,e),i||(S=null);break e}d=T.next}}else if(r.tag===18){if(S=r.return,S===null)throw Error(s(341));S.lanes|=l,d=S.alternate,d!==null&&(d.lanes|=l),Df(S,l,e),S=null}else S=r.child;if(S!==null)S.return=r;else for(S=r;S!==null;){if(S===e){S=null;break}if(r=S.sibling,r!==null){r.return=S.return,S=r;break}S=S.return}r=S}}function Tu(e,t,l,i){e=null;for(var r=t,d=!1;r!==null;){if(!d){if(r.flags&524288)d=!0;else if(r.flags&262144)break}if(r.tag===10){var S=r.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var T=r.type;en(r.pendingProps.value,S.value)||(e!==null?e.push(T):e=[T])}}else if(r===we.current){if(S=r.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Zu):e=[Zu])}r=r.return}e!==null&&kf(t,e,l,i),t.flags|=262144}function jo(e){for(e=e.firstContext;e!==null;){if(!en(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){Sa=e,ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Lt(e){return Ry(Sa,e)}function Oo(e,t){return Sa===null&&Ea(e),Ry(e,t)}function Ry(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ul===null){if(e===null)throw Error(s(308));ul=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ul=ul.next=t;return l}var Ll=!1;function Rf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Bl(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,et&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=co(e),p0(e,null,l),t}return ro(e,i,t,l),co(e)}function Au(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194176)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Je(e,l)}}function Lf(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var r=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?r=d=S:d=d.next=S,l=l.next}while(l!==null);d===null?r=d=t:d=d.next=t}else r=d=t;l={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:d,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Uf=!1;function ju(){if(Uf){var e=ri;if(e!==null)throw e}}function Ou(e,t,l,i){Uf=!1;var r=e.updateQueue;Ll=!1;var d=r.firstBaseUpdate,S=r.lastBaseUpdate,T=r.shared.pending;if(T!==null){r.shared.pending=null;var R=T,K=R.next;R.next=null,S===null?d=K:S.next=K,S=R;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==S&&(T===null?ae.firstBaseUpdate=K:T.next=K,ae.lastBaseUpdate=R))}if(d!==null){var re=r.baseState;S=0,ae=K=R=null,T=d;do{var P=T.lane&-536870913,ne=P!==T.lane;if(ne?(Ue&P)===P:(i&P)===P){P!==0&&P===oi&&(Uf=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Se=e,Ce=T;P=t;var it=l;switch(Ce.tag){case 1:if(Se=Ce.payload,typeof Se=="function"){re=Se.call(it,re,P);break e}re=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ce.payload,P=typeof Se=="function"?Se.call(it,re,P):Se,P==null)break e;re=te({},re,P);break e;case 2:Ll=!0}}P=T.callback,P!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=r.callbacks,ne===null?r.callbacks=[P]:ne.push(P))}else ne={lane:P,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(K=ae=ne,R=re):ae=ae.next=ne,S|=P;if(T=T.next,T===null){if(T=r.shared.pending,T===null)break;ne=T,T=ne.next,ne.next=null,r.lastBaseUpdate=ne,r.shared.pending=null}}while(!0);ae===null&&(R=re),r.baseState=R,r.firstBaseUpdate=K,r.lastBaseUpdate=ae,d===null&&(r.shared.lanes=0),$l|=S,e.lanes=S,e.memoizedState=re}}function Hy(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Ly(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Hy(l[e],t)}function zu(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var r=i.next;l=r;do{if((l.tag&e)===e){i=void 0;var d=l.create,S=l.inst;i=d(),S.destroy=i}l=l.next}while(l!==r)}}catch(T){Ge(t,t.return,T)}}function Vl(e,t,l){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var d=r.next;i=d;do{if((i.tag&e)===e){var S=i.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,r=t;var R=l;try{T()}catch(K){Ge(r,R,K)}}}i=i.next}while(i!==d)}}catch(K){Ge(t,t.return,K)}}function Uy(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Ly(t,l)}catch(i){Ge(e,e.return,i)}}}function By(e,t,l){l.props=wa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Ge(e,t,i)}}function _a(e,t){try{var l=e.ref;if(l!==null){var i=e.stateNode;switch(e.tag){case 26:case 27:case 5:var r=i;break;default:r=i}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(d){Ge(e,t,d)}}function tn(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(r){Ge(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(r){Ge(e,t,r)}else l.current=null}function Vy(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(r){Ge(e,e.return,r)}}function Yy(e,t,l){try{var i=e.stateNode;ET(i,e.type,l,t),i[Rt]=t}catch(r){Ge(e,e.return,r)}}function qy(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27||e.tag===4}function Bf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==27&&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 Vf(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.nodeType===8?l.parentNode.insertBefore(e,t):l.insertBefore(e,t):(l.nodeType===8?(t=l.parentNode,t.insertBefore(e,l)):(t=l,t.appendChild(e)),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Go));else if(i!==4&&i!==27&&(e=e.child,e!==null))for(Vf(e,t,l),e=e.sibling;e!==null;)Vf(e,t,l),e=e.sibling}function zo(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&i!==27&&(e=e.child,e!==null))for(zo(e,t,l),e=e.sibling;e!==null;)zo(e,t,l),e=e.sibling}var ol=!1,lt=!1,Yf=!1,Xy=typeof WeakSet=="function"?WeakSet:Set,Ct=null,$y=!1;function PM(e,t){if(e=e.containerInfo,md=Io,e=s0(e),qc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var r=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var S=0,T=-1,R=-1,K=0,ae=0,re=e,P=null;t:for(;;){for(var ne;re!==l||r!==0&&re.nodeType!==3||(T=S+r),re!==d||i!==0&&re.nodeType!==3||(R=S+i),re.nodeType===3&&(S+=re.nodeValue.length),(ne=re.firstChild)!==null;)P=re,re=ne;for(;;){if(re===e)break t;if(P===l&&++K===r&&(T=S),P===d&&++ae===i&&(R=S),(ne=re.nextSibling)!==null)break;re=P,P=re.parentNode}re=ne}l=T===-1||R===-1?null:{start:T,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(pd={focusedElem:e,selectionRange:l},Io=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,d=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&d!==null){e=void 0,l=t,r=d.memoizedProps,d=d.memoizedState,i=l.stateNode;try{var Se=wa(l.type,r,l.elementType===l.type);e=i.getSnapshotBeforeUpdate(Se,d),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Ge(l,l.return,Ce)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)xd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}return Se=$y,$y=!1,Se}function Gy(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:cl(e,l),i&4&&zu(5,l);break;case 1:if(cl(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(T){Ge(l,l.return,T)}else{var r=wa(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(T){Ge(l,l.return,T)}}i&64&&Uy(l),i&512&&_a(l,l.return);break;case 3:if(cl(e,l),i&64&&(i=l.updateQueue,i!==null)){if(e=null,l.child!==null)switch(l.child.tag){case 27:case 5:e=l.child.stateNode;break;case 1:e=l.child.stateNode}try{Ly(i,e)}catch(T){Ge(l,l.return,T)}}break;case 26:cl(e,l),i&512&&_a(l,l.return);break;case 27:case 5:cl(e,l),t===null&&i&4&&Vy(l),i&512&&_a(l,l.return);break;case 12:cl(e,l);break;case 13:cl(e,l),i&4&&Qy(e,l);break;case 22:if(r=l.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||lt;var d=ol,S=lt;ol=r,(lt=t)&&!S?Yl(e,l,(l.subtreeFlags&8772)!==0):cl(e,l),ol=d,lt=S}i&512&&(l.memoizedProps.mode==="manual"?_a(l,l.return):tn(l,l.return));break;default:cl(e,l)}}function Zy(e){var t=e.alternate;t!==null&&(e.alternate=null,Zy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yt=null,nn=!1;function rl(e,t,l){for(l=l.child;l!==null;)Ky(e,t,l),l=l.sibling}function Ky(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(kt,l)}catch{}switch(l.tag){case 26:lt||tn(l,t),rl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:lt||tn(l,t);var i=yt,r=nn;for(yt=l.stateNode,rl(e,t,l),l=l.stateNode,t=l.attributes;t.length;)l.removeAttributeNode(t[0]);lu(l),yt=i,nn=r;break;case 5:lt||tn(l,t);case 6:r=yt;var d=nn;if(yt=null,rl(e,t,l),yt=r,nn=d,yt!==null)if(nn)try{e=yt,i=l.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)}catch(S){Ge(l,t,S)}else try{yt.removeChild(l.stateNode)}catch(S){Ge(l,t,S)}break;case 18:yt!==null&&(nn?(t=yt,l=l.stateNode,t.nodeType===8?bd(t.parentNode,l):t.nodeType===1&&bd(t,l),Wu(t)):bd(yt,l.stateNode));break;case 4:i=yt,r=nn,yt=l.stateNode.containerInfo,nn=!0,rl(e,t,l),yt=i,nn=r;break;case 0:case 11:case 14:case 15:lt||Vl(2,l,t),lt||Vl(4,l,t),rl(e,t,l);break;case 1:lt||(tn(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&By(l,t,i)),rl(e,t,l);break;case 21:rl(e,t,l);break;case 22:lt||tn(l,t),lt=(i=lt)||l.memoizedState!==null,rl(e,t,l),lt=i;break;default:rl(e,t,l)}}function Qy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wu(e)}catch(l){Ge(t,t.return,l)}}function eT(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xy),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xy),t;default:throw Error(s(435,e.tag))}}function qf(e,t){var l=eT(e);t.forEach(function(i){var r=hT.bind(null,e,i);l.has(i)||(l.add(i),i.then(r,r))})}function mn(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var r=l[i],d=e,S=t,T=S;e:for(;T!==null;){switch(T.tag){case 27:case 5:yt=T.stateNode,nn=!1;break e;case 3:yt=T.stateNode.containerInfo,nn=!0;break e;case 4:yt=T.stateNode.containerInfo,nn=!0;break e}T=T.return}if(yt===null)throw Error(s(160));Ky(d,S,r),yt=null,nn=!1,d=r.alternate,d!==null&&(d.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Jy(t,e),t=t.sibling}var On=null;function Jy(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:mn(t,e),pn(e),i&4&&(Vl(3,e,e.return),zu(3,e),Vl(5,e,e.return));break;case 1:mn(t,e),pn(e),i&512&&(lt||l===null||tn(l,l.return)),i&64&&ol&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var r=On;if(mn(t,e),pn(e),i&512&&(lt||l===null||tn(l,l.return)),i&4){var d=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":d=r.getElementsByTagName("title")[0],(!d||d[oa]||d[_t]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=r.createElement(i),r.head.insertBefore(d,r.querySelector("head > title"))),jt(d,i,l),d[_t]=e,gt(d),i=d;break e;case"link":var S=V1("link","href",r).get(i+(l.href||""));if(S){for(var T=0;T<S.length;T++)if(d=S[T],d.getAttribute("href")===(l.href==null?null:l.href)&&d.getAttribute("rel")===(l.rel==null?null:l.rel)&&d.getAttribute("title")===(l.title==null?null:l.title)&&d.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(T,1);break t}}d=r.createElement(i),jt(d,i,l),r.head.appendChild(d);break;case"meta":if(S=V1("meta","content",r).get(i+(l.content||""))){for(T=0;T<S.length;T++)if(d=S[T],d.getAttribute("content")===(l.content==null?null:""+l.content)&&d.getAttribute("name")===(l.name==null?null:l.name)&&d.getAttribute("property")===(l.property==null?null:l.property)&&d.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&d.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(T,1);break t}}d=r.createElement(i),jt(d,i,l),r.head.appendChild(d);break;default:throw Error(s(468,i))}d[_t]=e,gt(d),i=d}e.stateNode=i}else Y1(r,e.type,e.stateNode);else e.stateNode=B1(r,i,e.memoizedProps);else d!==i?(d===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):d.count--,i===null?Y1(r,e.type,e.stateNode):B1(r,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Yy(e,e.memoizedProps,l.memoizedProps)}break;case 27:if(i&4&&e.alternate===null){r=e.stateNode,d=e.memoizedProps;try{for(var R=r.firstChild;R;){var K=R.nextSibling,ae=R.nodeName;R[oa]||ae==="HEAD"||ae==="BODY"||ae==="SCRIPT"||ae==="STYLE"||ae==="LINK"&&R.rel.toLowerCase()==="stylesheet"||r.removeChild(R),R=K}for(var re=e.type,P=r.attributes;P.length;)r.removeAttributeNode(P[0]);jt(r,re,d),r[_t]=e,r[Rt]=d}catch(Se){Ge(e,e.return,Se)}}case 5:if(mn(t,e),pn(e),i&512&&(lt||l===null||tn(l,l.return)),e.flags&32){r=e.stateNode;try{Wa(r,"")}catch(Se){Ge(e,e.return,Se)}}i&4&&e.stateNode!=null&&(r=e.memoizedProps,Yy(e,r,l!==null?l.memoizedProps:r)),i&1024&&(Yf=!0);break;case 6:if(mn(t,e),pn(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(Se){Ge(e,e.return,Se)}}break;case 3:if(Jo=null,r=On,On=Ko(t.containerInfo),mn(t,e),On=r,pn(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{Wu(t.containerInfo)}catch(Se){Ge(e,e.return,Se)}Yf&&(Yf=!1,Wy(e));break;case 4:i=On,On=Ko(e.stateNode.containerInfo),mn(t,e),pn(e),On=i;break;case 12:mn(t,e),pn(e);break;case 13:mn(t,e),pn(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ff=St()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,qf(e,i)));break;case 22:if(i&512&&(lt||l===null||tn(l,l.return)),R=e.memoizedState!==null,K=l!==null&&l.memoizedState!==null,ae=ol,re=lt,ol=ae||R,lt=re||K,mn(t,e),lt=re,ol=ae,pn(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,i&8192&&(t._visibility=R?t._visibility&-2:t._visibility|1,R&&(t=ol||lt,l===null||K||t||hi(e)),e.memoizedProps===null||e.memoizedProps.mode!=="manual"))e:for(l=null,t=e;;){if(t.tag===5||t.tag===26||t.tag===27){if(l===null){K=l=t;try{if(r=K.stateNode,R)d=r.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{S=K.stateNode,T=K.memoizedProps.style;var ne=T!=null&&T.hasOwnProperty("display")?T.display:null;S.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Se){Ge(K,K.return,Se)}}}else if(t.tag===6){if(l===null){K=t;try{K.stateNode.nodeValue=R?"":K.memoizedProps}catch(Se){Ge(K,K.return,Se)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,qf(e,l))));break;case 19:mn(t,e),pn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,qf(e,i)));break;case 21:break;default:mn(t,e),pn(e)}}function pn(e){var t=e.flags;if(t&2){try{if(e.tag!==27){e:{for(var l=e.return;l!==null;){if(qy(l)){var i=l;break e}l=l.return}throw Error(s(160))}switch(i.tag){case 27:var r=i.stateNode,d=Bf(e);zo(e,d,r);break;case 5:var S=i.stateNode;i.flags&32&&(Wa(S,""),i.flags&=-33);var T=Bf(e);zo(e,T,S);break;case 3:case 4:var R=i.stateNode.containerInfo,K=Bf(e);Vf(e,K,R);break;default:throw Error(s(161))}}}catch(ae){Ge(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wy(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wy(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function cl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Gy(e,t.alternate,t),t=t.sibling}function hi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vl(4,t,t.return),hi(t);break;case 1:tn(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&By(t,t.return,l),hi(t);break;case 26:case 27:case 5:tn(t,t.return),hi(t);break;case 22:tn(t,t.return),t.memoizedState===null&&hi(t);break;default:hi(t)}e=e.sibling}}function Yl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,r=e,d=t,S=d.flags;switch(d.tag){case 0:case 11:case 15:Yl(r,d,l),zu(4,d);break;case 1:if(Yl(r,d,l),i=d,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(K){Ge(i,i.return,K)}if(i=d,r=i.updateQueue,r!==null){var T=i.stateNode;try{var R=r.shared.hiddenCallbacks;if(R!==null)for(r.shared.hiddenCallbacks=null,r=0;r<R.length;r++)Hy(R[r],T)}catch(K){Ge(i,i.return,K)}}l&&S&64&&Uy(d),_a(d,d.return);break;case 26:case 27:case 5:Yl(r,d,l),l&&i===null&&S&4&&Vy(d),_a(d,d.return);break;case 12:Yl(r,d,l);break;case 13:Yl(r,d,l),l&&S&4&&Qy(r,d);break;case 22:d.memoizedState===null&&Yl(r,d,l),_a(d,d.return);break;default:Yl(r,d,l)}t=t.sibling}}function Xf(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Su(l))}function $f(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Su(e))}function ql(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fy(e,t,l,i),t=t.sibling}function Fy(e,t,l,i){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ql(e,t,l,i),r&2048&&zu(9,t);break;case 3:ql(e,t,l,i),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Su(e)));break;case 12:if(r&2048){ql(e,t,l,i),e=t.stateNode;try{var d=t.memoizedProps,S=d.id,T=d.onPostCommit;typeof T=="function"&&T(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Ge(t,t.return,R)}}else ql(e,t,l,i);break;case 23:break;case 22:d=t.stateNode,t.memoizedState!==null?d._visibility&4?ql(e,t,l,i):Du(e,t):d._visibility&4?ql(e,t,l,i):(d._visibility|=4,gi(e,t,l,i,(t.subtreeFlags&10256)!==0)),r&2048&&Xf(t.alternate,t);break;case 24:ql(e,t,l,i),r&2048&&$f(t.alternate,t);break;default:ql(e,t,l,i)}}function gi(e,t,l,i,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var d=e,S=t,T=l,R=i,K=S.flags;switch(S.tag){case 0:case 11:case 15:gi(d,S,T,R,r),zu(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&4?gi(d,S,T,R,r):Du(d,S):(ae._visibility|=4,gi(d,S,T,R,r)),r&&K&2048&&Xf(S.alternate,S);break;case 24:gi(d,S,T,R,r),r&&K&2048&&$f(S.alternate,S);break;default:gi(d,S,T,R,r)}t=t.sibling}}function Du(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,r=i.flags;switch(i.tag){case 22:Du(l,i),r&2048&&Xf(i.alternate,i);break;case 24:Du(l,i),r&2048&&$f(i.alternate,i);break;default:Du(l,i)}t=t.sibling}}var ku=8192;function mi(e){if(e.subtreeFlags&ku)for(e=e.child;e!==null;)Iy(e),e=e.sibling}function Iy(e){switch(e.tag){case 26:mi(e),e.flags&ku&&e.memoizedState!==null&&qT(On,e.memoizedState,e.memoizedProps);break;case 5:mi(e);break;case 3:case 4:var t=On;On=Ko(e.stateNode.containerInfo),mi(e),On=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ku,ku=16777216,mi(e),ku=t):mi(e));break;default:mi(e)}}function Py(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ru(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];Ct=i,t1(i,e)}Py(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)e1(e),e=e.sibling}function e1(e){switch(e.tag){case 0:case 11:case 15:Ru(e),e.flags&2048&&Vl(9,e,e.return);break;case 3:Ru(e);break;case 12:Ru(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,Do(e)):Ru(e);break;default:Ru(e)}}function Do(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];Ct=i,t1(i,e)}Py(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vl(8,t,t.return),Do(t);break;case 22:l=t.stateNode,l._visibility&4&&(l._visibility&=-5,Do(t));break;default:Do(t)}e=e.sibling}}function t1(e,t){for(;Ct!==null;){var l=Ct;switch(l.tag){case 0:case 11:case 15:Vl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Su(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,Ct=i;else e:for(l=e;Ct!==null;){i=Ct;var r=i.sibling,d=i.return;if(Zy(i),i===l){Ct=null;break e}if(r!==null){r.return=d,Ct=r;break e}Ct=d}}}function tT(e,t,l,i){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(e,t,l,i){return new tT(e,t,l,i)}function Gf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xl(e,t){var l=e.alternate;return l===null?(l=yn(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&31457280,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function n1(e,t){e.flags&=31457282;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ko(e,t,l,i,r,d){var S=0;if(i=e,typeof e=="function")Gf(e)&&(S=1);else if(typeof e=="string")S=VT(e,l,be.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case g:return Na(l.children,r,d,t);case m:S=8,r|=24;break;case y:return e=yn(12,l,t,r|2),e.elementType=y,e.lanes=d,e;case E:return e=yn(13,l,t,r),e.elementType=E,e.lanes=d,e;case N:return e=yn(19,l,t,r),e.elementType=N,e.lanes=d,e;case _:return l1(l,r,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b:case x:S=10;break e;case p:S=9;break e;case w:S=11;break e;case M:S=14;break e;case O:S=16,i=null;break e}S=29,l=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=yn(S,l,t,r),t.elementType=e,t.type=i,t.lanes=d,t}function Na(e,t,l,i){return e=yn(7,e,i,t),e.lanes=l,e}function l1(e,t,l,i){e=yn(22,e,i,t),e.elementType=_,e.lanes=l;var r={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var d=r._current;if(d===null)throw Error(s(456));if(!(r._pendingVisibility&2)){var S=Ol(d,2);S!==null&&(r._pendingVisibility|=2,Yt(S,d,2))}},attach:function(){var d=r._current;if(d===null)throw Error(s(456));if(r._pendingVisibility&2){var S=Ol(d,2);S!==null&&(r._pendingVisibility&=-3,Yt(S,d,2))}}};return e.stateNode=r,e}function Zf(e,t,l){return e=yn(6,e,null,t),e.lanes=l,e}function Kf(e,t,l){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fl(e){e.flags|=4}function a1(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!q1(t)){if(t=gn.current,t!==null&&((Ue&4194176)===Ue?Bn!==null:(Ue&62914560)!==Ue&&!(Ue&536870912)||t!==Bn))throw bu=Fc,w0;e.flags|=8192}}function Ro(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Cl():536870912,e.lanes|=t,yi|=t)}function Hu(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var r=e.child;r!==null;)l|=r.lanes|r.childLanes,i|=r.subtreeFlags&31457280,i|=r.flags&31457280,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)l|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function nT(e,t,l){var i=t.pendingProps;switch(Jc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),sl(wt),je(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(mu(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,jn!==null&&(td(jn),jn=null))),Pe(t),null;case 26:return l=t.memoizedState,e===null?(fl(t),l!==null?(Pe(t),a1(t,l)):(Pe(t),t.flags&=-16777217)):l?l!==e.memoizedState?(fl(t),Pe(t),a1(t,l)):(Pe(t),t.flags&=-16777217):(e.memoizedProps!==i&&fl(t),Pe(t),t.flags&=-16777217),null;case 27:Le(t),l=pe.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&fl(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Pe(t),null}e=be.current,mu(t)?b0(t):(e=k1(r,i,l),t.stateNode=e,fl(t))}return Pe(t),null;case 5:if(Le(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&fl(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Pe(t),null}if(e=be.current,mu(t))b0(t);else{switch(r=Zo(pe.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?e.multiple=!0:i.size&&(e.size=i.size);break;default:e=typeof i.is=="string"?r.createElement(l,{is:i.is}):r.createElement(l)}}e[_t]=t,e[Rt]=i;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(jt(e,l,i),l){case"button":case"input":case"select":case"textarea":e=!!i.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&fl(t)}}return Pe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&fl(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=pe.current,mu(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,r=Vt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[_t]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||T1(e.nodeValue,l)),e||ma(t)}else e=Zo(e).createTextNode(i),e[_t]=t,t.stateNode=e}return Pe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=mu(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[_t]=t}else pu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pe(t),r=!1}else jn!==null&&(td(jn),jn=null),r=!0;if(!r)return t.flags&256?(ll(t),t):(ll(t),null)}if(ll(t),t.flags&128)return t.lanes=l,t;if(l=i!==null,e=e!==null&&e.memoizedState!==null,l){i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var d=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==r&&(i.flags|=2048)}return l!==e&&l&&(t.child.flags|=8192),Ro(t,t.updateQueue),Pe(t),null;case 4:return je(),e===null&&dd(t.stateNode.containerInfo),Pe(t),null;case 10:return sl(t.type),Pe(t),null;case 19:if(ge(xt),r=t.memoizedState,r===null)return Pe(t),null;if(i=(t.flags&128)!==0,d=r.rendering,d===null)if(i)Hu(r,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(d=vo(e),d!==null){for(t.flags|=128,Hu(r,!1),e=d.updateQueue,t.updateQueue=e,Ro(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)n1(l,e),l=l.sibling;return me(xt,xt.current&1|2),t.child}e=e.sibling}r.tail!==null&&St()>Ho&&(t.flags|=128,i=!0,Hu(r,!1),t.lanes=4194304)}else{if(!i)if(e=vo(d),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ro(t,e),Hu(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Be)return Pe(t),null}else 2*St()-r.renderingStartTime>Ho&&l!==536870912&&(t.flags|=128,i=!0,Hu(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=St(),t.sibling=null,e=xt.current,me(xt,i?e&1|2:e&1),t):(Pe(t),null);case 22:case 23:return ll(t),Pc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?l&536870912&&!(t.flags&128)&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),l=t.updateQueue,l!==null&&Ro(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&ge(ya),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),sl(wt),Pe(t),null;case 25:return null}throw Error(s(156,t.tag))}function lT(e,t){switch(Jc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sl(wt),je(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 13:if(ll(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));pu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(xt),null;case 4:return je(),null;case 10:return sl(t.type),null;case 22:case 23:return ll(t),Pc(),e!==null&&ge(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return sl(wt),null;case 25:return null;default:return null}}function i1(e,t){switch(Jc(t),t.tag){case 3:sl(wt),je();break;case 26:case 27:case 5:Le(t);break;case 4:je();break;case 13:ll(t);break;case 19:ge(xt);break;case 10:sl(t.type);break;case 22:case 23:ll(t),Pc(),e!==null&&ge(ya);break;case 24:sl(wt)}}var aT={getCacheForType:function(e){var t=Lt(wt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l}},iT=typeof WeakMap=="function"?WeakMap:Map,et=0,Ke=null,ke=null,Ue=0,Qe=0,ln=null,dl=!1,pi=!1,Qf=!1,hl=0,at=0,$l=0,Ca=0,Jf=0,vn=0,yi=0,Lu=null,Yn=null,Wf=!1,Ff=0,Ho=1/0,Lo=null,Gl=null,Uo=!1,Ma=null,Uu=0,If=0,Pf=null,Bu=0,ed=null;function an(){if(et&2&&Ue!==0)return Ue&-Ue;if(q.T!==null){var e=oi;return e!==0?e:od()}return nt()}function u1(){vn===0&&(vn=!(Ue&536870912)||Be?Cn():536870912);var e=gn.current;return e!==null&&(e.flags|=32),vn}function Yt(e,t,l){(e===Ke&&Qe===2||e.cancelPendingCommit!==null)&&(vi(e,0),gl(e,Ue,vn,!1)),ce(e,l),(!(et&2)||e!==Ke)&&(e===Ke&&(!(et&2)&&(Ca|=l),at===4&&gl(e,Ue,vn,!1)),qn(e))}function s1(e,t,l){if(et&6)throw Error(s(327));var i=!l&&(t&60)===0&&(t&e.expiredLanes)===0||Zt(e,t),r=i?oT(e,t):ad(e,t,!0),d=i;do{if(r===0){pi&&!i&&gl(e,t,0,!1);break}else if(r===6)gl(e,t,0,!dl);else{if(l=e.current.alternate,d&&!uT(l)){r=ad(e,t,!1),d=!1;continue}if(r===2){if(d=t,e.errorRecoveryDisabledLanes&d)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var T=e;r=Lu;var R=T.current.memoizedState.isDehydrated;if(R&&(vi(T,S).flags|=256),S=ad(T,S,!1),S!==2){if(Qf&&!R){T.errorRecoveryDisabledLanes|=d,Ca|=d,r=4;break e}d=Yn,Yn=r,d!==null&&td(d)}r=S}if(d=!1,r!==2)continue}}if(r===1){vi(e,0),gl(e,t,0,!0);break}e:{switch(i=e,r){case 0:case 1:throw Error(s(345));case 4:if((t&4194176)===t){gl(i,t,vn,!dl);break e}break;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(s(329))}if(i.finishedWork=l,i.finishedLanes=t,(t&62914560)===t&&(d=Ff+300-St(),10<d)){if(gl(i,t,vn,!dl),Pt(i,0)!==0)break e;i.timeoutHandle=O1(o1.bind(null,i,l,Yn,Lo,Wf,t,vn,Ca,yi,dl,2,-0,0),d);break e}o1(i,l,Yn,Lo,Wf,t,vn,Ca,yi,dl,0,-0,0)}}break}while(!0);qn(e)}function td(e){Yn===null?Yn=e:Yn.push.apply(Yn,e)}function o1(e,t,l,i,r,d,S,T,R,K,ae,re,P){var ne=t.subtreeFlags;if((ne&8192||(ne&16785408)===16785408)&&(Gu={stylesheets:null,count:0,unsuspend:YT},Iy(t),t=XT(),t!==null)){e.cancelPendingCommit=t(m1.bind(null,e,l,i,r,S,T,R,1,re,P)),gl(e,d,S,!K);return}m1(e,l,i,r,S,T,R,ae,re,P)}function uT(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var r=l[i],d=r.getSnapshot;r=r.value;try{if(!en(d(),r))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gl(e,t,l,i){t&=~Jf,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var d=31-vt(r),S=1<<d;i[d]=-1,r&=~S}l!==0&&Me(e,l,t)}function Bo(){return et&6?!0:(Vu(0),!1)}function nd(){if(ke!==null){if(Qe===0)var e=ke.return;else e=ke,ul=Sa=null,of(e),ui=null,xu=0,e=ke;for(;e!==null;)i1(e.alternate,e),e=e.return;ke=null}}function vi(e,t){e.finishedWork=null,e.finishedLanes=0;var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,NT(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),nd(),Ke=e,ke=l=Xl(e.current,null),Ue=t,Qe=0,ln=null,dl=!1,pi=Zt(e,t),Qf=!1,yi=vn=Jf=Ca=$l=at=0,Yn=Lu=null,Wf=!1,t&8&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var r=31-vt(i),d=1<<r;t|=e[r],i&=~d}return hl=t,oo(),l}function r1(e,t){ze=null,q.H=Vn,t===vu?(t=_0(),Qe=3):t===w0?(t=_0(),Qe=4):Qe=t===Sy?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,ke===null&&(at=1,Ao(e,fn(t,e.current)))}function c1(){var e=q.H;return q.H=Vn,e===null?Vn:e}function f1(){var e=q.A;return q.A=aT,e}function ld(){at=4,dl||(Ue&4194176)!==Ue&&gn.current!==null||(pi=!0),!($l&134217727)&&!(Ca&134217727)||Ke===null||gl(Ke,Ue,vn,!1)}function ad(e,t,l){var i=et;et|=2;var r=c1(),d=f1();(Ke!==e||Ue!==t)&&(Lo=null,vi(e,t)),t=!1;var S=at;e:do try{if(Qe!==0&&ke!==null){var T=ke,R=ln;switch(Qe){case 8:nd(),S=6;break e;case 3:case 2:case 6:gn.current===null&&(t=!0);var K=Qe;if(Qe=0,ln=null,bi(e,T,R,K),l&&pi){S=0;break e}break;default:K=Qe,Qe=0,ln=null,bi(e,T,R,K)}}sT(),S=at;break}catch(ae){r1(e,ae)}while(!0);return t&&e.shellSuspendCounter++,ul=Sa=null,et=i,q.H=r,q.A=d,ke===null&&(Ke=null,Ue=0,oo()),S}function sT(){for(;ke!==null;)d1(ke)}function oT(e,t){var l=et;et|=2;var i=c1(),r=f1();Ke!==e||Ue!==t?(Lo=null,Ho=St()+500,vi(e,t)):pi=Zt(e,t);e:do try{if(Qe!==0&&ke!==null){t=ke;var d=ln;t:switch(Qe){case 1:Qe=0,ln=null,bi(e,t,d,1);break;case 2:if(S0(d)){Qe=0,ln=null,h1(t);break}t=function(){Qe===2&&Ke===e&&(Qe=7),qn(e)},d.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:S0(d)?(Qe=0,ln=null,h1(t)):(Qe=0,ln=null,bi(e,t,d,7));break;case 5:var S=null;switch(ke.tag){case 26:S=ke.memoizedState;case 5:case 27:var T=ke;if(!S||q1(S)){Qe=0,ln=null;var R=T.sibling;if(R!==null)ke=R;else{var K=T.return;K!==null?(ke=K,Vo(K)):ke=null}break t}}Qe=0,ln=null,bi(e,t,d,5);break;case 6:Qe=0,ln=null,bi(e,t,d,6);break;case 8:nd(),at=6;break e;default:throw Error(s(462))}}rT();break}catch(ae){r1(e,ae)}while(!0);return ul=Sa=null,q.H=i,q.A=r,et=l,ke!==null?0:(Ke=null,Ue=0,oo(),at)}function rT(){for(;ke!==null&&!sn();)d1(ke)}function d1(e){var t=ky(e.alternate,e,hl);e.memoizedProps=e.pendingProps,t===null?Vo(e):ke=t}function h1(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Ty(l,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=Ty(l,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:of(t);default:i1(l,t),t=ke=n1(t,hl),t=ky(l,t,hl)}e.memoizedProps=e.pendingProps,t===null?Vo(e):ke=t}function bi(e,t,l,i){ul=Sa=null,of(t),ui=null,xu=0;var r=t.return;try{if(FM(e,r,t,l,Ue)){at=1,Ao(e,fn(l,e.current)),ke=null;return}}catch(d){if(r!==null)throw ke=r,d;at=1,Ao(e,fn(l,e.current)),ke=null;return}t.flags&32768?(Be||i===1?e=!0:pi||Ue&536870912?e=!1:(dl=e=!0,(i===2||i===3||i===6)&&(i=gn.current,i!==null&&i.tag===13&&(i.flags|=16384))),g1(t,e)):Vo(t)}function Vo(e){var t=e;do{if(t.flags&32768){g1(t,dl);return}e=t.return;var l=nT(t.alternate,t,hl);if(l!==null){ke=l;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);at===0&&(at=5)}function g1(e,t){do{var l=lT(e.alternate,e);if(l!==null){l.flags&=32767,ke=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=l}while(e!==null);at=6,ke=null}function m1(e,t,l,i,r,d,S,T,R,K){var ae=q.T,re=ee.p;try{ee.p=2,q.T=null,cT(e,t,l,i,re,r,d,S,T,R,K)}finally{q.T=ae,ee.p=re}}function cT(e,t,l,i,r,d,S,T){do xi();while(Ma!==null);if(et&6)throw Error(s(327));var R=e.finishedWork;if(i=e.finishedLanes,R===null)return null;if(e.finishedWork=null,e.finishedLanes=0,R===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var K=R.lanes|R.childLanes;if(K|=Zc,se(e,i,K,d,S,T),e===Ke&&(ke=Ke=null,Ue=0),!(R.subtreeFlags&10256)&&!(R.flags&10256)||Uo||(Uo=!0,If=K,Pf=l,gT(Et,function(){return xi(),null})),l=(R.flags&15990)!==0,R.subtreeFlags&15990||l?(l=q.T,q.T=null,d=ee.p,ee.p=2,S=et,et|=4,PM(e,R),Jy(R,e),kM(pd,e.containerInfo),Io=!!md,pd=md=null,e.current=R,Gy(e,R.alternate,R),st(),et=S,ee.p=d,q.T=l):e.current=R,Uo?(Uo=!1,Ma=e,Uu=i):p1(e,K),K=e.pendingLanes,K===0&&(Gl=null),_l(R.stateNode),qn(e),t!==null)for(r=e.onRecoverableError,R=0;R<t.length;R++)K=t[R],r(K.value,{componentStack:K.stack});return Uu&3&&xi(),K=e.pendingLanes,i&4194218&&K&42?e===ed?Bu++:(Bu=0,ed=e):Bu=0,Vu(0),null}function p1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Su(t)))}function xi(){if(Ma!==null){var e=Ma,t=If;If=0;var l=We(Uu),i=q.T,r=ee.p;try{if(ee.p=32>l?32:l,q.T=null,Ma===null)var d=!1;else{l=Pf,Pf=null;var S=Ma,T=Uu;if(Ma=null,Uu=0,et&6)throw Error(s(331));var R=et;if(et|=4,e1(S.current),Fy(S,S.current,T,l),et=R,Vu(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(kt,S)}catch{}d=!0}return d}finally{ee.p=r,q.T=i,p1(e,t)}}return!1}function y1(e,t,l){t=fn(l,t),t=Sf(e.stateNode,t,2),e=Bl(e,t,2),e!==null&&(ce(e,2),qn(e))}function Ge(e,t,l){if(e.tag===3)y1(e,e,l);else for(;t!==null;){if(t.tag===3){y1(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Gl===null||!Gl.has(i))){e=fn(l,e),l=xy(2),i=Bl(t,l,2),i!==null&&(wy(l,i,t,e),ce(i,2),qn(i));break}}t=t.return}}function id(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new iT;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(l)||(Qf=!0,r.add(l),e=fT.bind(null,e,t,l),t.then(e,e))}function fT(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ke===e&&(Ue&l)===l&&(at===4||at===3&&(Ue&62914560)===Ue&&300>St()-Ff?!(et&2)&&vi(e,0):Jf|=l,yi===Ue&&(yi=0)),qn(e)}function v1(e,t){t===0&&(t=Cl()),e=Ol(e,t),e!==null&&(ce(e,t),qn(e))}function dT(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),v1(e,l)}function hT(e,t){var l=0;switch(e.tag){case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(l=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),v1(e,l)}function gT(e,t){return Ze(e,t)}var Yo=null,wi=null,ud=!1,qo=!1,sd=!1,Ta=0;function qn(e){e!==wi&&e.next===null&&(wi===null?Yo=wi=e:wi=wi.next=e),qo=!0,ud||(ud=!0,pT(mT))}function Vu(e,t){if(!sd&&qo){sd=!0;do for(var l=!1,i=Yo;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var d=0;else{var S=i.suspendedLanes,T=i.pingedLanes;d=(1<<31-vt(42|e)+1)-1,d&=r&~(S&~T),d=d&201326677?d&201326677|1:d?d|2:0}d!==0&&(l=!0,w1(i,d))}else d=Ue,d=Pt(i,i===Ke?d:0),!(d&3)||Zt(i,d)||(l=!0,w1(i,d));i=i.next}while(l);sd=!1}}function mT(){qo=ud=!1;var e=0;Ta!==0&&(_T()&&(e=Ta),Ta=0);for(var t=St(),l=null,i=Yo;i!==null;){var r=i.next,d=b1(i,t);d===0?(i.next=null,l===null?Yo=r:l.next=r,r===null&&(wi=l)):(l=i,(e!==0||d&3)&&(qo=!0)),i=r}Vu(e)}function b1(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var S=31-vt(d),T=1<<S,R=r[S];R===-1?(!(T&l)||T&i)&&(r[S]=Wn(T,t)):R<=t&&(e.expiredLanes|=T),d&=~T}if(t=Ke,l=Ue,l=Pt(e,e===t?l:0),i=e.callbackNode,l===0||e===t&&Qe===2||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Dt(i),e.callbackNode=null,e.callbackPriority=0;if(!(l&3)||Zt(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&Dt(i),We(l)){case 2:case 8:l=rn;break;case 32:l=Et;break;case 268435456:l=Ln;break;default:l=Et}return i=x1.bind(null,e),l=Ze(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&Dt(i),e.callbackPriority=2,e.callbackNode=null,2}function x1(e,t){var l=e.callbackNode;if(xi()&&e.callbackNode!==l)return null;var i=Ue;return i=Pt(e,e===Ke?i:0),i===0?null:(s1(e,i,t),b1(e,St()),e.callbackNode!=null&&e.callbackNode===l?x1.bind(null,e):null)}function w1(e,t){if(xi())return null;s1(e,t,!0)}function pT(e){CT(function(){et&6?Ze(ft,e):e()})}function od(){return Ta===0&&(Ta=Cn()),Ta}function S1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:to(""+e)}function E1(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function yT(e,t,l,i,r){if(t==="submit"&&l&&l.stateNode===r){var d=S1((r[Rt]||null).action),S=i.submitter;S&&(t=(t=S[Rt]||null)?S1(t.formAction):S.getAttribute("formAction"),t!==null&&(d=t,S=null));var T=new io("action","action",null,i,r);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ta!==0){var R=S?E1(r,S):new FormData(r);yf(l,{pending:!0,data:R,method:r.method,action:d},null,R)}}else typeof d=="function"&&(T.preventDefault(),R=S?E1(r,S):new FormData(r),yf(l,{pending:!0,data:R,method:r.method,action:d},d,R))},currentTarget:r}]})}}for(var rd=0;rd<m0.length;rd++){var cd=m0[rd],vT=cd.toLowerCase(),bT=cd[0].toUpperCase()+cd.slice(1);An(vT,"on"+bT)}An(c0,"onAnimationEnd"),An(f0,"onAnimationIteration"),An(d0,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(HM,"onTransitionRun"),An(LM,"onTransitionStart"),An(UM,"onTransitionCancel"),An(h0,"onTransitionEnd"),Al("onMouseEnter",["mouseout","mouseover"]),Al("onMouseLeave",["mouseout","mouseover"]),Al("onPointerEnter",["pointerout","pointerover"]),Al("onPointerLeave",["pointerout","pointerover"]),Pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yu="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(" "),xT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yu));function _1(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],r=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var S=i.length-1;0<=S;S--){var T=i[S],R=T.instance,K=T.currentTarget;if(T=T.listener,R!==d&&r.isPropagationStopped())break e;d=T,r.currentTarget=K;try{d(r)}catch(ae){To(ae)}r.currentTarget=null,d=R}else for(S=0;S<i.length;S++){if(T=i[S],R=T.instance,K=T.currentTarget,T=T.listener,R!==d&&r.isPropagationStopped())break e;d=T,r.currentTarget=K;try{d(r)}catch(ae){To(ae)}r.currentTarget=null,d=R}}}}function He(e,t){var l=t[$a];l===void 0&&(l=t[$a]=new Set);var i=e+"__bubble";l.has(i)||(N1(t,e,2,!1),l.add(i))}function fd(e,t,l){var i=0;t&&(i|=4),N1(l,e,i,t)}var Xo="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Xo]){e[Xo]=!0,Js.forEach(function(l){l!=="selectionchange"&&(xT.has(l)||fd(l,!1,e),fd(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xo]||(t[Xo]=!0,fd("selectionchange",!1,t))}}function N1(e,t,l,i){switch(Q1(t)){case 2:var r=ZT;break;case 8:r=KT;break;default:r=Nd}l=r.bind(null,t,l,e),r=void 0,!Dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,l,{capture:!0,passive:r}):e.addEventListener(t,l,!0):r!==void 0?e.addEventListener(t,l,{passive:r}):e.addEventListener(t,l,!1)}function hd(e,t,l,i,r){var d=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var T=i.stateNode.containerInfo;if(T===r||T.nodeType===8&&T.parentNode===r)break;if(S===4)for(S=i.return;S!==null;){var R=S.tag;if((R===3||R===4)&&(R=S.stateNode.containerInfo,R===r||R.nodeType===8&&R.parentNode===r))return;S=S.return}for(;T!==null;){if(S=Fn(T),S===null)return;if(R=S.tag,R===5||R===6||R===26||R===27){i=d=S;continue e}T=T.parentNode}}i=i.return}Vp(function(){var K=d,ae=Oc(l),re=[];e:{var P=g0.get(e);if(P!==void 0){var ne=io,Se=e;switch(e){case"keypress":if(lo(l)===0)break e;case"keydown":case"keyup":ne=hM;break;case"focusin":Se="focus",ne=Lc;break;case"focusout":Se="blur",ne=Lc;break;case"beforeblur":case"afterblur":ne=Lc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=tM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=pM;break;case c0:case f0:case d0:ne=aM;break;case h0:ne=vM;break;case"scroll":case"scrollend":ne=PC;break;case"wheel":ne=xM;break;case"copy":case"cut":case"paste":ne=uM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Gp;break;case"toggle":case"beforetoggle":ne=SM}var Ce=(t&4)!==0,it=!Ce&&(e==="scroll"||e==="scrollend"),W=Ce?P!==null?P+"Capture":null:P;Ce=[];for(var Z=K,I;Z!==null;){var ue=Z;if(I=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||I===null||W===null||(ue=uu(Z,W),ue!=null&&Ce.push(qu(Z,ue,I))),it)break;Z=Z.return}0<Ce.length&&(P=new ne(P,Se,null,l,ae),re.push({event:P,listeners:Ce}))}}if(!(t&7)){e:{if(P=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",P&&l!==jc&&(Se=l.relatedTarget||l.fromElement)&&(Fn(Se)||Se[Ml]))break e;if((ne||P)&&(P=ae.window===ae?ae:(P=ae.ownerDocument)?P.defaultView||P.parentWindow:window,ne?(Se=l.relatedTarget||l.toElement,ne=K,Se=Se?Fn(Se):null,Se!==null&&(it=G(Se),Ce=Se.tag,Se!==it||Ce!==5&&Ce!==27&&Ce!==6)&&(Se=null)):(ne=null,Se=K),ne!==Se)){if(Ce=Xp,ue="onMouseLeave",W="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Gp,ue="onPointerLeave",W="onPointerEnter",Z="pointer"),it=ne==null?P:ra(ne),I=Se==null?P:ra(Se),P=new Ce(ue,Z+"leave",ne,l,ae),P.target=it,P.relatedTarget=I,ue=null,Fn(ae)===K&&(Ce=new Ce(W,Z+"enter",Se,l,ae),Ce.target=I,Ce.relatedTarget=it,ue=Ce),it=ue,ne&&Se)t:{for(Ce=ne,W=Se,Z=0,I=Ce;I;I=Si(I))Z++;for(I=0,ue=W;ue;ue=Si(ue))I++;for(;0<Z-I;)Ce=Si(Ce),Z--;for(;0<I-Z;)W=Si(W),I--;for(;Z--;){if(Ce===W||W!==null&&Ce===W.alternate)break t;Ce=Si(Ce),W=Si(W)}Ce=null}else Ce=null;ne!==null&&C1(re,P,ne,Ce,!1),Se!==null&&it!==null&&C1(re,it,Se,Ce,!0)}}e:{if(P=K?ra(K):window,ne=P.nodeName&&P.nodeName.toLowerCase(),ne==="select"||ne==="input"&&P.type==="file")var ye=Pp;else if(Fp(P))if(e0)ye=zM;else{ye=jM;var De=AM}else ne=P.nodeName,!ne||ne.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?K&&Ac(K.elementType)&&(ye=Pp):ye=OM;if(ye&&(ye=ye(e,K))){Ip(re,ye,l,ae);break e}De&&De(e,P,K),e==="focusout"&&K&&P.type==="number"&&K.memoizedProps.value!=null&&Qa(P,"number",P.value)}switch(De=K?ra(K):window,e){case"focusin":(Fp(De)||De.contentEditable==="true")&&(ei=De,Xc=K,gu=null);break;case"focusout":gu=Xc=ei=null;break;case"mousedown":$c=!0;break;case"contextmenu":case"mouseup":case"dragend":$c=!1,o0(re,l,ae);break;case"selectionchange":if(RM)break;case"keydown":case"keyup":o0(re,l,ae)}var Ee;if(Bc)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Pa?Jp(e,l)&&(_e="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(_e="onCompositionStart");_e&&(Zp&&l.locale!=="ko"&&(Pa||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Pa&&(Ee=Yp()):(jl=ae,kc="value"in jl?jl.value:jl.textContent,Pa=!0)),De=$o(K,_e),0<De.length&&(_e=new $p(_e,e,null,l,ae),re.push({event:_e,listeners:De}),Ee?_e.data=Ee:(Ee=Wp(l),Ee!==null&&(_e.data=Ee)))),(Ee=_M?NM(e,l):CM(e,l))&&(_e=$o(K,"onBeforeInput"),0<_e.length&&(De=new $p("onBeforeInput","beforeinput",null,l,ae),re.push({event:De,listeners:_e}),De.data=Ee)),yT(re,e,K,l,ae)}_1(re,t)})}function qu(e,t,l){return{instance:e,listener:t,currentTarget:l}}function $o(e,t){for(var l=t+"Capture",i=[];e!==null;){var r=e,d=r.stateNode;r=r.tag,r!==5&&r!==26&&r!==27||d===null||(r=uu(e,l),r!=null&&i.unshift(qu(e,r,d)),r=uu(e,t),r!=null&&i.push(qu(e,r,d))),e=e.return}return i}function Si(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function C1(e,t,l,i,r){for(var d=t._reactName,S=[];l!==null&&l!==i;){var T=l,R=T.alternate,K=T.stateNode;if(T=T.tag,R!==null&&R===i)break;T!==5&&T!==26&&T!==27||K===null||(R=K,r?(K=uu(l,d),K!=null&&S.unshift(qu(l,K,R))):r||(K=uu(l,d),K!=null&&S.push(qu(l,K,R)))),l=l.return}S.length!==0&&e.push({event:t,listeners:S})}var wT=/\r\n?/g,ST=/\u0000|\uFFFD/g;function M1(e){return(typeof e=="string"?e:""+e).replace(wT,`
|
|
41
|
-
`).replace(ST,"")}function T1(e,t){return t=M1(t),M1(e)===t}function Go(){}function Xe(e,t,l,i,r,d){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Wa(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Wa(e,""+i);break;case"className":Za(e,"class",i);break;case"tabIndex":Za(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Za(e,l,i);break;case"style":Up(e,i,d);break;case"data":if(t!=="object"){Za(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=to(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(l==="formAction"?(t!=="input"&&Xe(e,t,"name",r.name,r,null),Xe(e,t,"formEncType",r.formEncType,r,null),Xe(e,t,"formMethod",r.formMethod,r,null),Xe(e,t,"formTarget",r.formTarget,r,null)):(Xe(e,t,"encType",r.encType,r,null),Xe(e,t,"method",r.method,r,null),Xe(e,t,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=to(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=Go);break;case"onScroll":i!=null&&He("scroll",e);break;case"onScrollEnd":i!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=l}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}l=to(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""+i):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":He("beforetoggle",e),He("toggle",e),Ga(e,"popover",i);break;case"xlinkActuate":Tn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Tn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Tn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Tn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Tn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Tn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Tn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Tn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Tn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ga(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=FC.get(l)||l,Ga(e,l,i))}}function gd(e,t,l,i,r,d){switch(l){case"style":Up(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(l=i.__html,l!=null){if(r.children!=null)throw Error(s(60));e.innerHTML=l}}break;case"children":typeof i=="string"?Wa(e,i):(typeof i=="number"||typeof i=="bigint")&&Wa(e,""+i);break;case"onScroll":i!=null&&He("scroll",e);break;case"onScrollEnd":i!=null&&He("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Go);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ws.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(r=l.endsWith("Capture"),t=l.slice(2,r?l.length-7:void 0),d=e[Rt]||null,d=d!=null?d[l]:null,typeof d=="function"&&e.removeEventListener(t,d,r),typeof i=="function")){typeof d!="function"&&d!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,r);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):Ga(e,l,i)}}}function jt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var i=!1,r=!1,d;for(d in l)if(l.hasOwnProperty(d)){var S=l[d];if(S!=null)switch(d){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Xe(e,t,d,S,l,null)}}r&&Xe(e,t,"srcSet",l.srcSet,l,null),i&&Xe(e,t,"src",l.src,l,null);return;case"input":He("invalid",e);var T=d=S=r=null,R=null,K=null;for(i in l)if(l.hasOwnProperty(i)){var ae=l[i];if(ae!=null)switch(i){case"name":r=ae;break;case"type":S=ae;break;case"checked":R=ae;break;case"defaultChecked":K=ae;break;case"value":d=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,t));break;default:Xe(e,t,i,ae,l,null)}}eo(e,d,T,R,K,S,r,!1),el(e);return;case"select":He("invalid",e),i=S=d=null;for(r in l)if(l.hasOwnProperty(r)&&(T=l[r],T!=null))switch(r){case"value":d=T;break;case"defaultValue":S=T;break;case"multiple":i=T;default:Xe(e,t,r,T,l,null)}t=d,l=S,e.multiple=!!i,t!=null?Ja(e,!!i,t,!1):l!=null&&Ja(e,!!i,l,!0);return;case"textarea":He("invalid",e),d=r=i=null;for(S in l)if(l.hasOwnProperty(S)&&(T=l[S],T!=null))switch(S){case"value":i=T;break;case"defaultValue":r=T;break;case"children":d=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(s(91));break;default:Xe(e,t,S,T,l,null)}Hp(e,i,r,d),el(e);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(i=l[R],i!=null))switch(R){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Xe(e,t,R,i,l,null)}return;case"dialog":He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(i=0;i<Yu.length;i++)He(Yu[i],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in l)if(l.hasOwnProperty(K)&&(i=l[K],i!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Xe(e,t,K,i,l,null)}return;default:if(Ac(t)){for(ae in l)l.hasOwnProperty(ae)&&(i=l[ae],i!==void 0&&gd(e,t,ae,i,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(i=l[T],i!=null&&Xe(e,t,T,i,l,null))}function ET(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,d=null,S=null,T=null,R=null,K=null,ae=null;for(ne in l){var re=l[ne];if(l.hasOwnProperty(ne)&&re!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":R=re;default:i.hasOwnProperty(ne)||Xe(e,t,ne,null,i,re)}}for(var P in i){var ne=i[P];if(re=l[P],i.hasOwnProperty(P)&&(ne!=null||re!=null))switch(P){case"type":d=ne;break;case"name":r=ne;break;case"checked":K=ne;break;case"defaultChecked":ae=ne;break;case"value":S=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,t));break;default:ne!==re&&Xe(e,t,P,ne,i,re)}}iu(e,S,T,R,K,ae,d,r);return;case"select":ne=S=T=P=null;for(d in l)if(R=l[d],l.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":ne=R;default:i.hasOwnProperty(d)||Xe(e,t,d,null,i,R)}for(r in i)if(d=i[r],R=l[r],i.hasOwnProperty(r)&&(d!=null||R!=null))switch(r){case"value":P=d;break;case"defaultValue":T=d;break;case"multiple":S=d;default:d!==R&&Xe(e,t,r,d,i,R)}t=T,l=S,i=ne,P!=null?Ja(e,!!l,P,!1):!!i!=!!l&&(t!=null?Ja(e,!!l,t,!0):Ja(e,!!l,l?[]:"",!1));return;case"textarea":ne=P=null;for(T in l)if(r=l[T],l.hasOwnProperty(T)&&r!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Xe(e,t,T,null,i,r)}for(S in i)if(r=i[S],d=l[S],i.hasOwnProperty(S)&&(r!=null||d!=null))switch(S){case"value":P=r;break;case"defaultValue":ne=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(s(91));break;default:r!==d&&Xe(e,t,S,r,i,d)}Rp(e,P,ne);return;case"option":for(var Se in l)if(P=l[Se],l.hasOwnProperty(Se)&&P!=null&&!i.hasOwnProperty(Se))switch(Se){case"selected":e.selected=!1;break;default:Xe(e,t,Se,null,i,P)}for(R in i)if(P=i[R],ne=l[R],i.hasOwnProperty(R)&&P!==ne&&(P!=null||ne!=null))switch(R){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Xe(e,t,R,P,i,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in l)P=l[Ce],l.hasOwnProperty(Ce)&&P!=null&&!i.hasOwnProperty(Ce)&&Xe(e,t,Ce,null,i,P);for(K in i)if(P=i[K],ne=l[K],i.hasOwnProperty(K)&&P!==ne&&(P!=null||ne!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(137,t));break;default:Xe(e,t,K,P,i,ne)}return;default:if(Ac(t)){for(var it in l)P=l[it],l.hasOwnProperty(it)&&P!==void 0&&!i.hasOwnProperty(it)&&gd(e,t,it,void 0,i,P);for(ae in i)P=i[ae],ne=l[ae],!i.hasOwnProperty(ae)||P===ne||P===void 0&&ne===void 0||gd(e,t,ae,P,i,ne);return}}for(var W in l)P=l[W],l.hasOwnProperty(W)&&P!=null&&!i.hasOwnProperty(W)&&Xe(e,t,W,null,i,P);for(re in i)P=i[re],ne=l[re],!i.hasOwnProperty(re)||P===ne||P==null&&ne==null||Xe(e,t,re,P,i,ne)}var md=null,pd=null;function Zo(e){return e.nodeType===9?e:e.ownerDocument}function A1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j1(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function yd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vd=null;function _T(){var e=window.event;return e&&e.type==="popstate"?e===vd?!1:(vd=e,!0):(vd=null,!1)}var O1=typeof setTimeout=="function"?setTimeout:void 0,NT=typeof clearTimeout=="function"?clearTimeout:void 0,z1=typeof Promise=="function"?Promise:void 0,CT=typeof queueMicrotask=="function"?queueMicrotask:typeof z1<"u"?function(e){return z1.resolve(null).then(e).catch(MT)}:O1;function MT(e){setTimeout(function(){throw e})}function bd(e,t){var l=t,i=0;do{var r=l.nextSibling;if(e.removeChild(l),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(i===0){e.removeChild(r),Wu(t);return}i--}else l!=="$"&&l!=="$?"&&l!=="$!"||i++;l=r}while(l);Wu(t)}function xd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":xd(l),lu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function TT(e,t,l,i){for(;e.nodeType===1;){var r=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[oa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==r.rel||e.getAttribute("href")!==(r.href==null?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=zn(e.nextSibling),e===null)break}return null}function AT(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=zn(e.nextSibling),e===null))return null;return e}function zn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function D1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"){if(t===0)return e;t--}else l==="/$"&&t++}e=e.previousSibling}return null}function k1(e,t,l){switch(t=Zo(l),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}var bn=new Map,R1=new Set;function Ko(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var ml=ee.d;ee.d={f:jT,r:OT,D:zT,C:DT,L:kT,m:RT,X:LT,S:HT,M:UT};function jT(){var e=ml.f(),t=Bo();return e||t}function OT(e){var t=Tl(e);t!==null&&t.tag===5&&t.type==="form"?oy(t):ml.r(e)}var Ei=typeof document>"u"?null:document;function H1(e,t,l){var i=Ei;if(i&&typeof t=="string"&&t){var r=Ht(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof l=="string"&&(r+='[crossorigin="'+l+'"]'),R1.has(r)||(R1.add(r),e={rel:e,crossOrigin:l,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),jt(t,"link",e),gt(t),i.head.appendChild(t)))}}function zT(e){ml.D(e),H1("dns-prefetch",e,null)}function DT(e,t){ml.C(e,t),H1("preconnect",e,t)}function kT(e,t,l){ml.L(e,t,l);var i=Ei;if(i&&e&&t){var r='link[rel="preload"][as="'+Ht(t)+'"]';t==="image"&&l&&l.imageSrcSet?(r+='[imagesrcset="'+Ht(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(r+='[imagesizes="'+Ht(l.imageSizes)+'"]')):r+='[href="'+Ht(e)+'"]';var d=r;switch(t){case"style":d=_i(e);break;case"script":d=Ni(e)}bn.has(d)||(e=te({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),bn.set(d,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(Xu(d))||t==="script"&&i.querySelector($u(d))||(t=i.createElement("link"),jt(t,"link",e),gt(t),i.head.appendChild(t)))}}function RT(e,t){ml.m(e,t);var l=Ei;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ht(i)+'"][href="'+Ht(e)+'"]',d=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Ni(e)}if(!bn.has(d)&&(e=te({rel:"modulepreload",href:e},t),bn.set(d,e),l.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector($u(d)))return}i=l.createElement("link"),jt(i,"link",e),gt(i),l.head.appendChild(i)}}}function HT(e,t,l){ml.S(e,t,l);var i=Ei;if(i&&e){var r=In(i).hoistableStyles,d=_i(e);t=t||"default";var S=r.get(d);if(!S){var T={loading:0,preload:null};if(S=i.querySelector(Xu(d)))T.loading=5;else{e=te({rel:"stylesheet",href:e,"data-precedence":t},l),(l=bn.get(d))&&wd(e,l);var R=S=i.createElement("link");gt(R),jt(R,"link",e),R._p=new Promise(function(K,ae){R.onload=K,R.onerror=ae}),R.addEventListener("load",function(){T.loading|=1}),R.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Qo(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:T},r.set(d,S)}}}function LT(e,t){ml.X(e,t);var l=Ei;if(l&&e){var i=In(l).hoistableScripts,r=Ni(e),d=i.get(r);d||(d=l.querySelector($u(r)),d||(e=te({src:e,async:!0},t),(t=bn.get(r))&&Sd(e,t),d=l.createElement("script"),gt(d),jt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(r,d))}}function UT(e,t){ml.M(e,t);var l=Ei;if(l&&e){var i=In(l).hoistableScripts,r=Ni(e),d=i.get(r);d||(d=l.querySelector($u(r)),d||(e=te({src:e,async:!0,type:"module"},t),(t=bn.get(r))&&Sd(e,t),d=l.createElement("script"),gt(d),jt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(r,d))}}function L1(e,t,l,i){var r=(r=pe.current)?Ko(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=_i(l.href),l=In(r).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=_i(l.href);var d=In(r).hoistableStyles,S=d.get(e);if(S||(r=r.ownerDocument||r,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,S),(d=r.querySelector(Xu(e)))&&!d._p&&(S.instance=d,S.state.loading=5),bn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},bn.set(e,l),d||BT(r,e,l,S.state))),t&&i===null)throw Error(s(528,""));return S}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ni(l),l=In(r).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function _i(e){return'href="'+Ht(e)+'"'}function Xu(e){return'link[rel="stylesheet"]['+e+"]"}function U1(e){return te({},e,{"data-precedence":e.precedence,precedence:null})}function BT(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),jt(t,"link",l),gt(t),e.head.appendChild(t))}function Ni(e){return'[src="'+Ht(e)+'"]'}function $u(e){return"script[async]"+e}function B1(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Ht(l.href)+'"]');if(i)return t.instance=i,gt(i),i;var r=te({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),gt(i),jt(i,"style",r),Qo(i,l.precedence,e),t.instance=i;case"stylesheet":r=_i(l.href);var d=e.querySelector(Xu(r));if(d)return t.state.loading|=4,t.instance=d,gt(d),d;i=U1(l),(r=bn.get(r))&&wd(i,r),d=(e.ownerDocument||e).createElement("link"),gt(d);var S=d;return S._p=new Promise(function(T,R){S.onload=T,S.onerror=R}),jt(d,"link",i),t.state.loading|=4,Qo(d,l.precedence,e),t.instance=d;case"script":return d=Ni(l.src),(r=e.querySelector($u(d)))?(t.instance=r,gt(r),r):(i=l,(r=bn.get(d))&&(i=te({},l),Sd(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),gt(r),jt(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,Qo(i,l.precedence,e));return t.instance}function Qo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,d=r,S=0;S<i.length;S++){var T=i[S];if(T.dataset.precedence===t)d=T;else if(d!==r)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function wd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jo=null;function V1(e,t,l){if(Jo===null){var i=new Map,r=Jo=new Map;r.set(l,i)}else r=Jo,i=r.get(l),i||(i=new Map,r.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),r=0;r<l.length;r++){var d=l[r];if(!(d[oa]||d[_t]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var S=d.getAttribute(t)||"";S=e+S;var T=i.get(S);T?T.push(d):i.set(S,[d])}}return i}function Y1(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function VT(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function q1(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Gu=null;function YT(){}function qT(e,t,l){if(Gu===null)throw Error(s(475));var i=Gu;if(t.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=_i(l.href),d=e.querySelector(Xu(r));if(d){e=d._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(i.count++,i=Wo.bind(i),e.then(i,i)),t.state.loading|=4,t.instance=d,gt(d);return}d=e.ownerDocument||e,l=U1(l),(r=bn.get(r))&&wd(l,r),d=d.createElement("link"),gt(d);var S=d;S._p=new Promise(function(T,R){S.onload=T,S.onerror=R}),jt(d,"link",l),t.instance=d}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(i.count++,t=Wo.bind(i),e.addEventListener("load",t),e.addEventListener("error",t))}}function XT(){if(Gu===null)throw Error(s(475));var e=Gu;return e.stylesheets&&e.count===0&&Ed(e,e.stylesheets),0<e.count?function(t){var l=setTimeout(function(){if(e.stylesheets&&Ed(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(l)}}:null}function Wo(){if(this.count--,this.count===0){if(this.stylesheets)Ed(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fo=null;function Ed(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fo=new Map,t.forEach($T,e),Fo=null,Wo.call(e))}function $T(e,t){if(!(t.state.loading&4)){var l=Fo.get(e);if(l)var i=l.get(null);else{l=new Map,Fo.set(e,l);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<r.length;d++){var S=r[d];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),i=S)}i&&l.set(null,i)}r=t.instance,S=r.getAttribute("data-precedence"),d=l.get(S)||i,d===i&&l.set(null,r),l.set(S,r),this.count++,i=Wo.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),d?d.parentNode.insertBefore(r,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Zu={$$typeof:x,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function GT(e,t,l,i,r,d,S,T){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=oe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oe(0),this.hiddenUpdates=oe(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=d,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function X1(e,t,l,i,r,d,S,T,R,K,ae,re){return e=new GT(e,t,l,S,T,R,K,re),t=1,d===!0&&(t|=24),d=yn(3,null,null,t),e.current=d,d.stateNode=e,t=ef(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:i,isDehydrated:l,cache:t},Rf(d),e}function $1(e){return e?(e=li,e):li}function G1(e,t,l,i,r,d){r=$1(r),i.context===null?i.context=r:i.pendingContext=r,i=Ul(t),i.payload={element:l},d=d===void 0?null:d,d!==null&&(i.callback=d),l=Bl(e,i,t),l!==null&&(Yt(l,e,t),Au(l,e,t))}function Z1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function _d(e,t){Z1(e,t),(e=e.alternate)&&Z1(e,t)}function K1(e){if(e.tag===13){var t=Ol(e,67108864);t!==null&&Yt(t,e,67108864),_d(e,67108864)}}var Io=!0;function ZT(e,t,l,i){var r=q.T;q.T=null;var d=ee.p;try{ee.p=2,Nd(e,t,l,i)}finally{ee.p=d,q.T=r}}function KT(e,t,l,i){var r=q.T;q.T=null;var d=ee.p;try{ee.p=8,Nd(e,t,l,i)}finally{ee.p=d,q.T=r}}function Nd(e,t,l,i){if(Io){var r=Cd(i);if(r===null)hd(e,t,i,Po,l),J1(e,i);else if(JT(r,e,t,l,i))i.stopPropagation();else if(J1(e,i),t&4&&-1<QT.indexOf(e)){for(;r!==null;){var d=Tl(r);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var S=Ye(d.pendingLanes);if(S!==0){var T=d;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var R=1<<31-vt(S);T.entanglements[1]|=R,S&=~R}qn(d),!(et&6)&&(Ho=St()+500,Vu(0))}}break;case 13:T=Ol(d,2),T!==null&&Yt(T,d,2),Bo(),_d(d,2)}if(d=Cd(i),d===null&&hd(e,t,i,Po,l),d===r)break;r=d}r!==null&&i.stopPropagation()}else hd(e,t,i,null,l)}}function Cd(e){return e=Oc(e),Md(e)}var Po=null;function Md(e){if(Po=null,e=Fn(e),e!==null){var t=G(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=X(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Po=e,null}function Q1(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(on()){case ft:return 2;case rn:return 8;case Et:case El:return 32;case Ln:return 268435456;default:return 32}default:return 32}}var Td=!1,Zl=null,Kl=null,Ql=null,Ku=new Map,Qu=new Map,Jl=[],QT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function J1(e,t){switch(e){case"focusin":case"focusout":Zl=null;break;case"dragenter":case"dragleave":Kl=null;break;case"mouseover":case"mouseout":Ql=null;break;case"pointerover":case"pointerout":Ku.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qu.delete(t.pointerId)}}function Ju(e,t,l,i,r,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:d,targetContainers:[r]},t!==null&&(t=Tl(t),t!==null&&K1(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function JT(e,t,l,i,r){switch(t){case"focusin":return Zl=Ju(Zl,e,t,l,i,r),!0;case"dragenter":return Kl=Ju(Kl,e,t,l,i,r),!0;case"mouseover":return Ql=Ju(Ql,e,t,l,i,r),!0;case"pointerover":var d=r.pointerId;return Ku.set(d,Ju(Ku.get(d)||null,e,t,l,i,r)),!0;case"gotpointercapture":return d=r.pointerId,Qu.set(d,Ju(Qu.get(d)||null,e,t,l,i,r)),!0}return!1}function W1(e){var t=Fn(e.target);if(t!==null){var l=G(t);if(l!==null){if(t=l.tag,t===13){if(t=X(l),t!==null){e.blockedOn=t,ht(e.priority,function(){if(l.tag===13){var i=an(),r=Ol(l,i);r!==null&&Yt(r,l,i),_d(l,i)}});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function er(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Cd(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);jc=i,l.target.dispatchEvent(i),jc=null}else return t=Tl(l),t!==null&&K1(t),e.blockedOn=l,!1;t.shift()}return!0}function F1(e,t,l){er(e)&&l.delete(t)}function WT(){Td=!1,Zl!==null&&er(Zl)&&(Zl=null),Kl!==null&&er(Kl)&&(Kl=null),Ql!==null&&er(Ql)&&(Ql=null),Ku.forEach(F1),Qu.forEach(F1)}function tr(e,t){e.blockedOn===t&&(e.blockedOn=null,Td||(Td=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,WT)))}var nr=null;function I1(e){nr!==e&&(nr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){nr===e&&(nr=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],r=e[t+2];if(typeof i!="function"){if(Md(i||l)===null)continue;break}var d=Tl(l);d!==null&&(e.splice(t,3),t-=3,yf(d,{pending:!0,data:r,method:l.method,action:i},i,r))}}))}function Wu(e){function t(R){return tr(R,e)}Zl!==null&&tr(Zl,e),Kl!==null&&tr(Kl,e),Ql!==null&&tr(Ql,e),Ku.forEach(t),Qu.forEach(t);for(var l=0;l<Jl.length;l++){var i=Jl[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jl.length&&(l=Jl[0],l.blockedOn===null);)W1(l),l.blockedOn===null&&Jl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var r=l[i],d=l[i+1],S=r[Rt]||null;if(typeof d=="function")S||I1(l);else if(S){var T=null;if(d&&d.hasAttribute("formAction")){if(r=d,S=d[Rt]||null)T=S.formAction;else if(Md(r)!==null)continue}else T=S.action;typeof T=="function"?l[i+1]=T:(l.splice(i,3),i-=3),I1(l)}}}function Ad(e){this._internalRoot=e}lr.prototype.render=Ad.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var l=t.current,i=an();G1(l,i,e,t,null,null)},lr.prototype.unmount=Ad.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&xi(),G1(e.current,2,null,e,null,null),Bo(),t[Ml]=null}};function lr(e){this._internalRoot=e}lr.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Jl.length&&t!==0&&t<Jl[l].priority;l++);Jl.splice(l,0,e),l===0&&W1(e)}};var P1=a.version;if(P1!=="19.0.0")throw Error(s(527,P1,"19.0.0"));ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=$(t),e=e!==null?F(e):null,e=e===null?null:e.stateNode,e};var FT={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:q,findFiberByHostInstance:Fn,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ar=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ar.isDisabled&&ar.supportsFiber)try{kt=ar.inject(FT),ot=ar}catch{}}return Ti.createRoot=function(e,t){if(!o(e))throw Error(s(299));var l=!1,i="",r=py,d=yy,S=vy,T=null;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(T=t.unstable_transitionCallbacks)),t=X1(e,1,!1,null,null,l,i,r,d,S,T,null),e[Ml]=t.current,dd(e.nodeType===8?e.parentNode:e),new Ad(t)},Ti.hydrateRoot=function(e,t,l){if(!o(e))throw Error(s(299));var i=!1,r="",d=py,S=yy,T=vy,R=null,K=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(r=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(R=l.unstable_transitionCallbacks),l.formState!==void 0&&(K=l.formState)),t=X1(e,1,!0,t,l??null,i,r,d,S,T,R,K),t.context=$1(null),l=t.current,i=an(),r=Ul(i),r.callback=null,Bl(l,r,i),t.current.lanes=i,ce(t,i),qn(t),e[Ml]=t.current,dd(e),new lr(t)},Ti.version="19.0.0",Ti}var Ud;function iv(){if(Ud)return sr.exports;Ud=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),sr.exports=av(),sr.exports}var uv=iv(),sv=Object.defineProperty,ov=(n,a,u)=>a in n?sv(n,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):n[a]=u,Fu=(n,a,u)=>ov(n,typeof a!="symbol"?a+"":a,u);const rv={stringify:n=>n?"true":"false",parse:n=>/^[ty1-9]/i.test(n)},cv={stringify:n=>n.name,parse:(n,a,u)=>{const s=(()=>{if(typeof window<"u"&&n in window)return window[n];if(typeof global<"u"&&n in global)return global[n]})();return typeof s=="function"?s.bind(u):void 0}},fv={stringify:n=>JSON.stringify(n),parse:n=>JSON.parse(n)},dv={stringify:n=>`${n}`,parse:n=>parseFloat(n)},hv={stringify:n=>n,parse:n=>n},fr={string:hv,number:dv,boolean:rv,function:cv,json:fv};function gv(n){return n.replace(/([a-z0-9])([A-Z])/g,(a,u,s)=>`${u}-${s.toLowerCase()}`)}const Iu=Symbol.for("r2wc.render"),Pu=Symbol.for("r2wc.connected"),Fl=Symbol.for("r2wc.context"),Xn=Symbol.for("r2wc.props");function mv(n,a,u){var s,o,c;a.props||(a.props=n.propTypes?Object.keys(n.propTypes):[]),a.events||(a.events=[]);const f=Array.isArray(a.props)?a.props.slice():Object.keys(a.props),h=Array.isArray(a.events)?a.events.slice():Object.keys(a.events),g={},m={},y={},b={};for(const x of f){g[x]=Array.isArray(a.props)?"string":a.props[x];const w=gv(x);y[x]=w,b[w]=x}for(const x of h)m[x]=Array.isArray(a.events)?{}:a.events[x];class p extends HTMLElement{constructor(){super(),Fu(this,c,!0),Fu(this,o),Fu(this,s,{}),Fu(this,"container"),a.shadow?this.container=this.attachShadow({mode:a.shadow}):this.container=this,this[Xn].container=this.container;for(const w of f){const E=y[w],N=this.getAttribute(E),M=g[w],O=M?fr[M]:null;O!=null&&O.parse&&N&&(this[Xn][w]=O.parse(N,E,this))}for(const w of h)this[Xn][w]=E=>{const N=w.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(N,{detail:E,...m[w]}))}}static get observedAttributes(){return Object.keys(b)}connectedCallback(){this[Pu]=!0,this[Iu]()}disconnectedCallback(){this[Pu]=!1,this[Fl]&&u.unmount(this[Fl]),delete this[Fl]}attributeChangedCallback(w,E,N){const M=b[w],O=g[M],_=O?fr[O]:null;M in g&&_!=null&&_.parse&&N&&(this[Xn][M]=_.parse(N,w,this),this[Iu]())}[(c=Pu,o=Fl,s=Xn,Iu)](){this[Pu]&&(this[Fl]?u.update(this[Fl],this[Xn]):this[Fl]=u.mount(this.container,n,this[Xn]))}}for(const x of f){const w=y[x],E=g[x];Object.defineProperty(p.prototype,x,{enumerable:!0,configurable:!0,get(){return this[Xn][x]},set(N){this[Xn][x]=N;const M=E?fr[E]:null;if(M!=null&&M.stringify){const O=M.stringify(N,w,this);this.getAttribute(w)!==O&&this.setAttribute(w,O)}else this[Iu]()}})}return p}function pv(n,a,u){const s=uv.createRoot(n),o=ur.createElement(a,u);return s.render(o),{root:s,ReactComponent:a}}function yv({root:n,ReactComponent:a},u){const s=ur.createElement(a,u);n.render(s)}function vv({root:n}){n.unmount()}function Bd(n,a={}){return mv(n,a,{mount:pv,update:yv,unmount:vv})}var dr={exports:{}},Ai={};/**
|
|
42
|
-
* @license React
|
|
43
|
-
* react-jsx-runtime.production.js
|
|
44
|
-
*
|
|
45
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the MIT license found in the
|
|
48
|
-
* LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/var Vd;function bv(){if(Vd)return Ai;Vd=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function u(s,o,c){var f=null;if(c!==void 0&&(f=""+c),o.key!==void 0&&(f=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:n,type:s,key:f,ref:o!==void 0?o:null,props:c}}return Ai.Fragment=a,Ai.jsx=u,Ai.jsxs=u,Ai}var Yd;function xv(){return Yd||(Yd=1,dr.exports=bv()),dr.exports}var v=xv();function ct(n){if(typeof n=="string"||typeof n=="number")return""+n;let a="";if(Array.isArray(n))for(let u=0,s;u<n.length;u++)(s=ct(n[u]))!==""&&(a+=(a&&" ")+s);else for(let u in n)n[u]&&(a+=(a&&" ")+u);return a}var wv={value:()=>{}};function es(){for(var n=0,a=arguments.length,u={},s;n<a;++n){if(!(s=arguments[n]+"")||s in u||/[\s.]/.test(s))throw new Error("illegal type: "+s);u[s]=[]}return new ts(u)}function ts(n){this._=n}function Sv(n,a){return n.trim().split(/^|\s+/).map(function(u){var s="",o=u.indexOf(".");if(o>=0&&(s=u.slice(o+1),u=u.slice(0,o)),u&&!a.hasOwnProperty(u))throw new Error("unknown type: "+u);return{type:u,name:s}})}ts.prototype=es.prototype={constructor:ts,on:function(n,a){var u=this._,s=Sv(n+"",u),o,c=-1,f=s.length;if(arguments.length<2){for(;++c<f;)if((o=(n=s[c]).type)&&(o=Ev(u[o],n.name)))return o;return}if(a!=null&&typeof a!="function")throw new Error("invalid callback: "+a);for(;++c<f;)if(o=(n=s[c]).type)u[o]=qd(u[o],n.name,a);else if(a==null)for(o in u)u[o]=qd(u[o],n.name,null);return this},copy:function(){var n={},a=this._;for(var u in a)n[u]=a[u].slice();return new ts(n)},call:function(n,a){if((o=arguments.length-2)>0)for(var u=new Array(o),s=0,o,c;s<o;++s)u[s]=arguments[s+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(c=this._[n],s=0,o=c.length;s<o;++s)c[s].value.apply(a,u)},apply:function(n,a,u){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var s=this._[n],o=0,c=s.length;o<c;++o)s[o].value.apply(a,u)}};function Ev(n,a){for(var u=0,s=n.length,o;u<s;++u)if((o=n[u]).name===a)return o.value}function qd(n,a,u){for(var s=0,o=n.length;s<o;++s)if(n[s].name===a){n[s]=wv,n=n.slice(0,s).concat(n.slice(s+1));break}return u!=null&&n.push({name:a,value:u}),n}var hr="http://www.w3.org/1999/xhtml";const Xd={svg:"http://www.w3.org/2000/svg",xhtml:hr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ns(n){var a=n+="",u=a.indexOf(":");return u>=0&&(a=n.slice(0,u))!=="xmlns"&&(n=n.slice(u+1)),Xd.hasOwnProperty(a)?{space:Xd[a],local:n}:n}function _v(n){return function(){var a=this.ownerDocument,u=this.namespaceURI;return u===hr&&a.documentElement.namespaceURI===hr?a.createElement(n):a.createElementNS(u,n)}}function Nv(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function $d(n){var a=ns(n);return(a.local?Nv:_v)(a)}function Cv(){}function gr(n){return n==null?Cv:function(){return this.querySelector(n)}}function Mv(n){typeof n!="function"&&(n=gr(n));for(var a=this._groups,u=a.length,s=new Array(u),o=0;o<u;++o)for(var c=a[o],f=c.length,h=s[o]=new Array(f),g,m,y=0;y<f;++y)(g=c[y])&&(m=n.call(g,g.__data__,y,c))&&("__data__"in g&&(m.__data__=g.__data__),h[y]=m);return new Wt(s,this._parents)}function Tv(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function Av(){return[]}function Gd(n){return n==null?Av:function(){return this.querySelectorAll(n)}}function jv(n){return function(){return Tv(n.apply(this,arguments))}}function Ov(n){typeof n=="function"?n=jv(n):n=Gd(n);for(var a=this._groups,u=a.length,s=[],o=[],c=0;c<u;++c)for(var f=a[c],h=f.length,g,m=0;m<h;++m)(g=f[m])&&(s.push(n.call(g,g.__data__,m,f)),o.push(g));return new Wt(s,o)}function Zd(n){return function(){return this.matches(n)}}function Kd(n){return function(a){return a.matches(n)}}var zv=Array.prototype.find;function Dv(n){return function(){return zv.call(this.children,n)}}function kv(){return this.firstElementChild}function Rv(n){return this.select(n==null?kv:Dv(typeof n=="function"?n:Kd(n)))}var Hv=Array.prototype.filter;function Lv(){return Array.from(this.children)}function Uv(n){return function(){return Hv.call(this.children,n)}}function Bv(n){return this.selectAll(n==null?Lv:Uv(typeof n=="function"?n:Kd(n)))}function Vv(n){typeof n!="function"&&(n=Zd(n));for(var a=this._groups,u=a.length,s=new Array(u),o=0;o<u;++o)for(var c=a[o],f=c.length,h=s[o]=[],g,m=0;m<f;++m)(g=c[m])&&n.call(g,g.__data__,m,c)&&h.push(g);return new Wt(s,this._parents)}function Qd(n){return new Array(n.length)}function Yv(){return new Wt(this._enter||this._groups.map(Qd),this._parents)}function ls(n,a){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=a}ls.prototype={constructor:ls,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,a){return this._parent.insertBefore(n,a)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function qv(n){return function(){return n}}function Xv(n,a,u,s,o,c){for(var f=0,h,g=a.length,m=c.length;f<m;++f)(h=a[f])?(h.__data__=c[f],s[f]=h):u[f]=new ls(n,c[f]);for(;f<g;++f)(h=a[f])&&(o[f]=h)}function $v(n,a,u,s,o,c,f){var h,g,m=new Map,y=a.length,b=c.length,p=new Array(y),x;for(h=0;h<y;++h)(g=a[h])&&(p[h]=x=f.call(g,g.__data__,h,a)+"",m.has(x)?o[h]=g:m.set(x,g));for(h=0;h<b;++h)x=f.call(n,c[h],h,c)+"",(g=m.get(x))?(s[h]=g,g.__data__=c[h],m.delete(x)):u[h]=new ls(n,c[h]);for(h=0;h<y;++h)(g=a[h])&&m.get(p[h])===g&&(o[h]=g)}function Gv(n){return n.__data__}function Zv(n,a){if(!arguments.length)return Array.from(this,Gv);var u=a?$v:Xv,s=this._parents,o=this._groups;typeof n!="function"&&(n=qv(n));for(var c=o.length,f=new Array(c),h=new Array(c),g=new Array(c),m=0;m<c;++m){var y=s[m],b=o[m],p=b.length,x=Kv(n.call(y,y&&y.__data__,m,s)),w=x.length,E=h[m]=new Array(w),N=f[m]=new Array(w),M=g[m]=new Array(p);u(y,b,E,N,M,x,a);for(var O=0,_=0,C,k;O<w;++O)if(C=E[O]){for(O>=_&&(_=O+1);!(k=N[_])&&++_<w;);C._next=k||null}}return f=new Wt(f,s),f._enter=h,f._exit=g,f}function Kv(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function Qv(){return new Wt(this._exit||this._groups.map(Qd),this._parents)}function Jv(n,a,u){var s=this.enter(),o=this,c=this.exit();return typeof n=="function"?(s=n(s),s&&(s=s.selection())):s=s.append(n+""),a!=null&&(o=a(o),o&&(o=o.selection())),u==null?c.remove():u(c),s&&o?s.merge(o).order():o}function Wv(n){for(var a=n.selection?n.selection():n,u=this._groups,s=a._groups,o=u.length,c=s.length,f=Math.min(o,c),h=new Array(o),g=0;g<f;++g)for(var m=u[g],y=s[g],b=m.length,p=h[g]=new Array(b),x,w=0;w<b;++w)(x=m[w]||y[w])&&(p[w]=x);for(;g<o;++g)h[g]=u[g];return new Wt(h,this._parents)}function Fv(){for(var n=this._groups,a=-1,u=n.length;++a<u;)for(var s=n[a],o=s.length-1,c=s[o],f;--o>=0;)(f=s[o])&&(c&&f.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(f,c),c=f);return this}function Iv(n){n||(n=Pv);function a(b,p){return b&&p?n(b.__data__,p.__data__):!b-!p}for(var u=this._groups,s=u.length,o=new Array(s),c=0;c<s;++c){for(var f=u[c],h=f.length,g=o[c]=new Array(h),m,y=0;y<h;++y)(m=f[y])&&(g[y]=m);g.sort(a)}return new Wt(o,this._parents).order()}function Pv(n,a){return n<a?-1:n>a?1:n>=a?0:NaN}function eb(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function tb(){return Array.from(this)}function nb(){for(var n=this._groups,a=0,u=n.length;a<u;++a)for(var s=n[a],o=0,c=s.length;o<c;++o){var f=s[o];if(f)return f}return null}function lb(){let n=0;for(const a of this)++n;return n}function ab(){return!this.node()}function ib(n){for(var a=this._groups,u=0,s=a.length;u<s;++u)for(var o=a[u],c=0,f=o.length,h;c<f;++c)(h=o[c])&&n.call(h,h.__data__,c,o);return this}function ub(n){return function(){this.removeAttribute(n)}}function sb(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ob(n,a){return function(){this.setAttribute(n,a)}}function rb(n,a){return function(){this.setAttributeNS(n.space,n.local,a)}}function cb(n,a){return function(){var u=a.apply(this,arguments);u==null?this.removeAttribute(n):this.setAttribute(n,u)}}function fb(n,a){return function(){var u=a.apply(this,arguments);u==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,u)}}function db(n,a){var u=ns(n);if(arguments.length<2){var s=this.node();return u.local?s.getAttributeNS(u.space,u.local):s.getAttribute(u)}return this.each((a==null?u.local?sb:ub:typeof a=="function"?u.local?fb:cb:u.local?rb:ob)(u,a))}function Jd(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function hb(n){return function(){this.style.removeProperty(n)}}function gb(n,a,u){return function(){this.style.setProperty(n,a,u)}}function mb(n,a,u){return function(){var s=a.apply(this,arguments);s==null?this.style.removeProperty(n):this.style.setProperty(n,s,u)}}function pb(n,a,u){return arguments.length>1?this.each((a==null?hb:typeof a=="function"?mb:gb)(n,a,u??"")):Aa(this.node(),n)}function Aa(n,a){return n.style.getPropertyValue(a)||Jd(n).getComputedStyle(n,null).getPropertyValue(a)}function yb(n){return function(){delete this[n]}}function vb(n,a){return function(){this[n]=a}}function bb(n,a){return function(){var u=a.apply(this,arguments);u==null?delete this[n]:this[n]=u}}function xb(n,a){return arguments.length>1?this.each((a==null?yb:typeof a=="function"?bb:vb)(n,a)):this.node()[n]}function Wd(n){return n.trim().split(/^|\s+/)}function mr(n){return n.classList||new Fd(n)}function Fd(n){this._node=n,this._names=Wd(n.getAttribute("class")||"")}Fd.prototype={add:function(n){var a=this._names.indexOf(n);a<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var a=this._names.indexOf(n);a>=0&&(this._names.splice(a,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function Id(n,a){for(var u=mr(n),s=-1,o=a.length;++s<o;)u.add(a[s])}function Pd(n,a){for(var u=mr(n),s=-1,o=a.length;++s<o;)u.remove(a[s])}function wb(n){return function(){Id(this,n)}}function Sb(n){return function(){Pd(this,n)}}function Eb(n,a){return function(){(a.apply(this,arguments)?Id:Pd)(this,n)}}function _b(n,a){var u=Wd(n+"");if(arguments.length<2){for(var s=mr(this.node()),o=-1,c=u.length;++o<c;)if(!s.contains(u[o]))return!1;return!0}return this.each((typeof a=="function"?Eb:a?wb:Sb)(u,a))}function Nb(){this.textContent=""}function Cb(n){return function(){this.textContent=n}}function Mb(n){return function(){var a=n.apply(this,arguments);this.textContent=a??""}}function Tb(n){return arguments.length?this.each(n==null?Nb:(typeof n=="function"?Mb:Cb)(n)):this.node().textContent}function Ab(){this.innerHTML=""}function jb(n){return function(){this.innerHTML=n}}function Ob(n){return function(){var a=n.apply(this,arguments);this.innerHTML=a??""}}function zb(n){return arguments.length?this.each(n==null?Ab:(typeof n=="function"?Ob:jb)(n)):this.node().innerHTML}function Db(){this.nextSibling&&this.parentNode.appendChild(this)}function kb(){return this.each(Db)}function Rb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Hb(){return this.each(Rb)}function Lb(n){var a=typeof n=="function"?n:$d(n);return this.select(function(){return this.appendChild(a.apply(this,arguments))})}function Ub(){return null}function Bb(n,a){var u=typeof n=="function"?n:$d(n),s=a==null?Ub:typeof a=="function"?a:gr(a);return this.select(function(){return this.insertBefore(u.apply(this,arguments),s.apply(this,arguments)||null)})}function Vb(){var n=this.parentNode;n&&n.removeChild(this)}function Yb(){return this.each(Vb)}function qb(){var n=this.cloneNode(!1),a=this.parentNode;return a?a.insertBefore(n,this.nextSibling):n}function Xb(){var n=this.cloneNode(!0),a=this.parentNode;return a?a.insertBefore(n,this.nextSibling):n}function $b(n){return this.select(n?Xb:qb)}function Gb(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Zb(n){return function(a){n.call(this,a,this.__data__)}}function Kb(n){return n.trim().split(/^|\s+/).map(function(a){var u="",s=a.indexOf(".");return s>=0&&(u=a.slice(s+1),a=a.slice(0,s)),{type:a,name:u}})}function Qb(n){return function(){var a=this.__on;if(a){for(var u=0,s=-1,o=a.length,c;u<o;++u)c=a[u],(!n.type||c.type===n.type)&&c.name===n.name?this.removeEventListener(c.type,c.listener,c.options):a[++s]=c;++s?a.length=s:delete this.__on}}}function Jb(n,a,u){return function(){var s=this.__on,o,c=Zb(a);if(s){for(var f=0,h=s.length;f<h;++f)if((o=s[f]).type===n.type&&o.name===n.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=c,o.options=u),o.value=a;return}}this.addEventListener(n.type,c,u),o={type:n.type,name:n.name,value:a,listener:c,options:u},s?s.push(o):this.__on=[o]}}function Wb(n,a,u){var s=Kb(n+""),o,c=s.length,f;if(arguments.length<2){var h=this.node().__on;if(h){for(var g=0,m=h.length,y;g<m;++g)for(o=0,y=h[g];o<c;++o)if((f=s[o]).type===y.type&&f.name===y.name)return y.value}return}for(h=a?Jb:Qb,o=0;o<c;++o)this.each(h(s[o],a,u));return this}function eh(n,a,u){var s=Jd(n),o=s.CustomEvent;typeof o=="function"?o=new o(a,u):(o=s.document.createEvent("Event"),u?(o.initEvent(a,u.bubbles,u.cancelable),o.detail=u.detail):o.initEvent(a,!1,!1)),n.dispatchEvent(o)}function Fb(n,a){return function(){return eh(this,n,a)}}function Ib(n,a){return function(){return eh(this,n,a.apply(this,arguments))}}function Pb(n,a){return this.each((typeof a=="function"?Ib:Fb)(n,a))}function*ex(){for(var n=this._groups,a=0,u=n.length;a<u;++a)for(var s=n[a],o=0,c=s.length,f;o<c;++o)(f=s[o])&&(yield f)}var th=[null];function Wt(n,a){this._groups=n,this._parents=a}function ji(){return new Wt([[document.documentElement]],th)}function tx(){return this}Wt.prototype=ji.prototype={constructor:Wt,select:Mv,selectAll:Ov,selectChild:Rv,selectChildren:Bv,filter:Vv,data:Zv,enter:Yv,exit:Qv,join:Jv,merge:Wv,selection:tx,order:Fv,sort:Iv,call:eb,nodes:tb,node:nb,size:lb,empty:ab,each:ib,attr:db,style:pb,property:xb,classed:_b,text:Tb,html:zb,raise:kb,lower:Hb,append:Lb,insert:Bb,remove:Yb,clone:$b,datum:Gb,on:Wb,dispatch:Pb,[Symbol.iterator]:ex};function Ft(n){return typeof n=="string"?new Wt([[document.querySelector(n)]],[document.documentElement]):new Wt([[n]],th)}function nx(n){let a;for(;a=n.sourceEvent;)n=a;return n}function xn(n,a){if(n=nx(n),a===void 0&&(a=n.currentTarget),a){var u=a.ownerSVGElement||a;if(u.createSVGPoint){var s=u.createSVGPoint();return s.x=n.clientX,s.y=n.clientY,s=s.matrixTransform(a.getScreenCTM().inverse()),[s.x,s.y]}if(a.getBoundingClientRect){var o=a.getBoundingClientRect();return[n.clientX-o.left-a.clientLeft,n.clientY-o.top-a.clientTop]}}return[n.pageX,n.pageY]}const lx={passive:!1},Oi={capture:!0,passive:!1};function pr(n){n.stopImmediatePropagation()}function ja(n){n.preventDefault(),n.stopImmediatePropagation()}function nh(n){var a=n.document.documentElement,u=Ft(n).on("dragstart.drag",ja,Oi);"onselectstart"in a?u.on("selectstart.drag",ja,Oi):(a.__noselect=a.style.MozUserSelect,a.style.MozUserSelect="none")}function lh(n,a){var u=n.document.documentElement,s=Ft(n).on("dragstart.drag",null);a&&(s.on("click.drag",ja,Oi),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in u?s.on("selectstart.drag",null):(u.style.MozUserSelect=u.__noselect,delete u.__noselect)}const as=n=>()=>n;function yr(n,{sourceEvent:a,subject:u,target:s,identifier:o,active:c,x:f,y:h,dx:g,dy:m,dispatch:y}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},subject:{value:u,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:g,enumerable:!0,configurable:!0},dy:{value:m,enumerable:!0,configurable:!0},_:{value:y}})}yr.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function ax(n){return!n.ctrlKey&&!n.button}function ix(){return this.parentNode}function ux(n,a){return a??{x:n.x,y:n.y}}function sx(){return navigator.maxTouchPoints||"ontouchstart"in this}function ah(){var n=ax,a=ix,u=ux,s=sx,o={},c=es("start","drag","end"),f=0,h,g,m,y,b=0;function p(C){C.on("mousedown.drag",x).filter(s).on("touchstart.drag",N).on("touchmove.drag",M,lx).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(C,k){if(!(y||!n.call(this,C,k))){var H=_(this,a.call(this,C,k),C,k,"mouse");H&&(Ft(C.view).on("mousemove.drag",w,Oi).on("mouseup.drag",E,Oi),nh(C.view),pr(C),m=!1,h=C.clientX,g=C.clientY,H("start",C))}}function w(C){if(ja(C),!m){var k=C.clientX-h,H=C.clientY-g;m=k*k+H*H>b}o.mouse("drag",C)}function E(C){Ft(C.view).on("mousemove.drag mouseup.drag",null),lh(C.view,m),ja(C),o.mouse("end",C)}function N(C,k){if(n.call(this,C,k)){var H=C.changedTouches,U=a.call(this,C,k),Q=H.length,q,te;for(q=0;q<Q;++q)(te=_(this,U,C,k,H[q].identifier,H[q]))&&(pr(C),te("start",C,H[q]))}}function M(C){var k=C.changedTouches,H=k.length,U,Q;for(U=0;U<H;++U)(Q=o[k[U].identifier])&&(ja(C),Q("drag",C,k[U]))}function O(C){var k=C.changedTouches,H=k.length,U,Q;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),U=0;U<H;++U)(Q=o[k[U].identifier])&&(pr(C),Q("end",C,k[U]))}function _(C,k,H,U,Q,q){var te=c.copy(),J=xn(q||H,k),V,Y,j;if((j=u.call(C,new yr("beforestart",{sourceEvent:H,target:p,identifier:Q,active:f,x:J[0],y:J[1],dx:0,dy:0,dispatch:te}),U))!=null)return V=j.x-J[0]||0,Y=j.y-J[1]||0,function B(z,L,G){var X=J,A;switch(z){case"start":o[Q]=B,A=f++;break;case"end":delete o[Q],--f;case"drag":J=xn(G||L,k),A=f;break}te.call(z,C,new yr(z,{sourceEvent:L,subject:j,target:p,identifier:Q,active:A,x:J[0]+V,y:J[1]+Y,dx:J[0]-X[0],dy:J[1]-X[1],dispatch:te}),U)}}return p.filter=function(C){return arguments.length?(n=typeof C=="function"?C:as(!!C),p):n},p.container=function(C){return arguments.length?(a=typeof C=="function"?C:as(C),p):a},p.subject=function(C){return arguments.length?(u=typeof C=="function"?C:as(C),p):u},p.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:as(!!C),p):s},p.on=function(){var C=c.on.apply(c,arguments);return C===c?p:C},p.clickDistance=function(C){return arguments.length?(b=(C=+C)*C,p):Math.sqrt(b)},p}function vr(n,a,u){n.prototype=a.prototype=u,u.constructor=n}function ih(n,a){var u=Object.create(n.prototype);for(var s in a)u[s]=a[s];return u}function zi(){}var Di=.7,is=1/Di,Oa="\\s*([+-]?\\d+)\\s*",ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ox=/^#([0-9a-f]{3,8})$/,rx=new RegExp(`^rgb\\(${Oa},${Oa},${Oa}\\)$`),cx=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),fx=new RegExp(`^rgba\\(${Oa},${Oa},${Oa},${ki}\\)$`),dx=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${ki}\\)$`),hx=new RegExp(`^hsl\\(${ki},${Dn},${Dn}\\)$`),gx=new RegExp(`^hsla\\(${ki},${Dn},${Dn},${ki}\\)$`),uh={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};vr(zi,Il,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:mx,formatHsl:px,formatRgb:oh,toString:oh});function sh(){return this.rgb().formatHex()}function mx(){return this.rgb().formatHex8()}function px(){return hh(this).formatHsl()}function oh(){return this.rgb().formatRgb()}function Il(n){var a,u;return n=(n+"").trim().toLowerCase(),(a=ox.exec(n))?(u=a[1].length,a=parseInt(a[1],16),u===6?rh(a):u===3?new qt(a>>8&15|a>>4&240,a>>4&15|a&240,(a&15)<<4|a&15,1):u===8?us(a>>24&255,a>>16&255,a>>8&255,(a&255)/255):u===4?us(a>>12&15|a>>8&240,a>>8&15|a>>4&240,a>>4&15|a&240,((a&15)<<4|a&15)/255):null):(a=rx.exec(n))?new qt(a[1],a[2],a[3],1):(a=cx.exec(n))?new qt(a[1]*255/100,a[2]*255/100,a[3]*255/100,1):(a=fx.exec(n))?us(a[1],a[2],a[3],a[4]):(a=dx.exec(n))?us(a[1]*255/100,a[2]*255/100,a[3]*255/100,a[4]):(a=hx.exec(n))?dh(a[1],a[2]/100,a[3]/100,1):(a=gx.exec(n))?dh(a[1],a[2]/100,a[3]/100,a[4]):uh.hasOwnProperty(n)?rh(uh[n]):n==="transparent"?new qt(NaN,NaN,NaN,0):null}function rh(n){return new qt(n>>16&255,n>>8&255,n&255,1)}function us(n,a,u,s){return s<=0&&(n=a=u=NaN),new qt(n,a,u,s)}function yx(n){return n instanceof zi||(n=Il(n)),n?(n=n.rgb(),new qt(n.r,n.g,n.b,n.opacity)):new qt}function br(n,a,u,s){return arguments.length===1?yx(n):new qt(n,a,u,s??1)}function qt(n,a,u,s){this.r=+n,this.g=+a,this.b=+u,this.opacity=+s}vr(qt,br,ih(zi,{brighter(n){return n=n==null?is:Math.pow(is,n),new qt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Di:Math.pow(Di,n),new qt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new qt(Pl(this.r),Pl(this.g),Pl(this.b),ss(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:ch,formatHex:ch,formatHex8:vx,formatRgb:fh,toString:fh}));function ch(){return`#${ea(this.r)}${ea(this.g)}${ea(this.b)}`}function vx(){return`#${ea(this.r)}${ea(this.g)}${ea(this.b)}${ea((isNaN(this.opacity)?1:this.opacity)*255)}`}function fh(){const n=ss(this.opacity);return`${n===1?"rgb(":"rgba("}${Pl(this.r)}, ${Pl(this.g)}, ${Pl(this.b)}${n===1?")":`, ${n})`}`}function ss(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Pl(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ea(n){return n=Pl(n),(n<16?"0":"")+n.toString(16)}function dh(n,a,u,s){return s<=0?n=a=u=NaN:u<=0||u>=1?n=a=NaN:a<=0&&(n=NaN),new wn(n,a,u,s)}function hh(n){if(n instanceof wn)return new wn(n.h,n.s,n.l,n.opacity);if(n instanceof zi||(n=Il(n)),!n)return new wn;if(n instanceof wn)return n;n=n.rgb();var a=n.r/255,u=n.g/255,s=n.b/255,o=Math.min(a,u,s),c=Math.max(a,u,s),f=NaN,h=c-o,g=(c+o)/2;return h?(a===c?f=(u-s)/h+(u<s)*6:u===c?f=(s-a)/h+2:f=(a-u)/h+4,h/=g<.5?c+o:2-c-o,f*=60):h=g>0&&g<1?0:f,new wn(f,h,g,n.opacity)}function bx(n,a,u,s){return arguments.length===1?hh(n):new wn(n,a,u,s??1)}function wn(n,a,u,s){this.h=+n,this.s=+a,this.l=+u,this.opacity=+s}vr(wn,bx,ih(zi,{brighter(n){return n=n==null?is:Math.pow(is,n),new wn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Di:Math.pow(Di,n),new wn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,a=isNaN(n)||isNaN(this.s)?0:this.s,u=this.l,s=u+(u<.5?u:1-u)*a,o=2*u-s;return new qt(xr(n>=240?n-240:n+120,o,s),xr(n,o,s),xr(n<120?n+240:n-120,o,s),this.opacity)},clamp(){return new wn(gh(this.h),os(this.s),os(this.l),ss(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 n=ss(this.opacity);return`${n===1?"hsl(":"hsla("}${gh(this.h)}, ${os(this.s)*100}%, ${os(this.l)*100}%${n===1?")":`, ${n})`}`}}));function gh(n){return n=(n||0)%360,n<0?n+360:n}function os(n){return Math.max(0,Math.min(1,n||0))}function xr(n,a,u){return(n<60?a+(u-a)*n/60:n<180?u:n<240?a+(u-a)*(240-n)/60:a)*255}const wr=n=>()=>n;function xx(n,a){return function(u){return n+u*a}}function wx(n,a,u){return n=Math.pow(n,u),a=Math.pow(a,u)-n,u=1/u,function(s){return Math.pow(n+s*a,u)}}function Sx(n){return(n=+n)==1?mh:function(a,u){return u-a?wx(a,u,n):wr(isNaN(a)?u:a)}}function mh(n,a){var u=a-n;return u?xx(n,u):wr(isNaN(n)?a:n)}const rs=function n(a){var u=Sx(a);function s(o,c){var f=u((o=br(o)).r,(c=br(c)).r),h=u(o.g,c.g),g=u(o.b,c.b),m=mh(o.opacity,c.opacity);return function(y){return o.r=f(y),o.g=h(y),o.b=g(y),o.opacity=m(y),o+""}}return s.gamma=n,s}(1);function Ex(n,a){a||(a=[]);var u=n?Math.min(a.length,n.length):0,s=a.slice(),o;return function(c){for(o=0;o<u;++o)s[o]=n[o]*(1-c)+a[o]*c;return s}}function _x(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Nx(n,a){var u=a?a.length:0,s=n?Math.min(u,n.length):0,o=new Array(s),c=new Array(u),f;for(f=0;f<s;++f)o[f]=Ri(n[f],a[f]);for(;f<u;++f)c[f]=a[f];return function(h){for(f=0;f<s;++f)c[f]=o[f](h);return c}}function Cx(n,a){var u=new Date;return n=+n,a=+a,function(s){return u.setTime(n*(1-s)+a*s),u}}function kn(n,a){return n=+n,a=+a,function(u){return n*(1-u)+a*u}}function Mx(n,a){var u={},s={},o;(n===null||typeof n!="object")&&(n={}),(a===null||typeof a!="object")&&(a={});for(o in a)o in n?u[o]=Ri(n[o],a[o]):s[o]=a[o];return function(c){for(o in u)s[o]=u[o](c);return s}}var Sr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Er=new RegExp(Sr.source,"g");function Tx(n){return function(){return n}}function Ax(n){return function(a){return n(a)+""}}function ph(n,a){var u=Sr.lastIndex=Er.lastIndex=0,s,o,c,f=-1,h=[],g=[];for(n=n+"",a=a+"";(s=Sr.exec(n))&&(o=Er.exec(a));)(c=o.index)>u&&(c=a.slice(u,c),h[f]?h[f]+=c:h[++f]=c),(s=s[0])===(o=o[0])?h[f]?h[f]+=o:h[++f]=o:(h[++f]=null,g.push({i:f,x:kn(s,o)})),u=Er.lastIndex;return u<a.length&&(c=a.slice(u),h[f]?h[f]+=c:h[++f]=c),h.length<2?g[0]?Ax(g[0].x):Tx(a):(a=g.length,function(m){for(var y=0,b;y<a;++y)h[(b=g[y]).i]=b.x(m);return h.join("")})}function Ri(n,a){var u=typeof a,s;return a==null||u==="boolean"?wr(a):(u==="number"?kn:u==="string"?(s=Il(a))?(a=s,rs):ph:a instanceof Il?rs:a instanceof Date?Cx:_x(a)?Ex:Array.isArray(a)?Nx:typeof a.valueOf!="function"&&typeof a.toString!="function"||isNaN(a)?Mx:kn)(n,a)}var yh=180/Math.PI,_r={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vh(n,a,u,s,o,c){var f,h,g;return(f=Math.sqrt(n*n+a*a))&&(n/=f,a/=f),(g=n*u+a*s)&&(u-=n*g,s-=a*g),(h=Math.sqrt(u*u+s*s))&&(u/=h,s/=h,g/=h),n*s<a*u&&(n=-n,a=-a,g=-g,f=-f),{translateX:o,translateY:c,rotate:Math.atan2(a,n)*yh,skewX:Math.atan(g)*yh,scaleX:f,scaleY:h}}var cs;function jx(n){const a=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return a.isIdentity?_r:vh(a.a,a.b,a.c,a.d,a.e,a.f)}function Ox(n){return n==null||(cs||(cs=document.createElementNS("http://www.w3.org/2000/svg","g")),cs.setAttribute("transform",n),!(n=cs.transform.baseVal.consolidate()))?_r:(n=n.matrix,vh(n.a,n.b,n.c,n.d,n.e,n.f))}function bh(n,a,u,s){function o(m){return m.length?m.pop()+" ":""}function c(m,y,b,p,x,w){if(m!==b||y!==p){var E=x.push("translate(",null,a,null,u);w.push({i:E-4,x:kn(m,b)},{i:E-2,x:kn(y,p)})}else(b||p)&&x.push("translate("+b+a+p+u)}function f(m,y,b,p){m!==y?(m-y>180?y+=360:y-m>180&&(m+=360),p.push({i:b.push(o(b)+"rotate(",null,s)-2,x:kn(m,y)})):y&&b.push(o(b)+"rotate("+y+s)}function h(m,y,b,p){m!==y?p.push({i:b.push(o(b)+"skewX(",null,s)-2,x:kn(m,y)}):y&&b.push(o(b)+"skewX("+y+s)}function g(m,y,b,p,x,w){if(m!==b||y!==p){var E=x.push(o(x)+"scale(",null,",",null,")");w.push({i:E-4,x:kn(m,b)},{i:E-2,x:kn(y,p)})}else(b!==1||p!==1)&&x.push(o(x)+"scale("+b+","+p+")")}return function(m,y){var b=[],p=[];return m=n(m),y=n(y),c(m.translateX,m.translateY,y.translateX,y.translateY,b,p),f(m.rotate,y.rotate,b,p),h(m.skewX,y.skewX,b,p),g(m.scaleX,m.scaleY,y.scaleX,y.scaleY,b,p),m=y=null,function(x){for(var w=-1,E=p.length,N;++w<E;)b[(N=p[w]).i]=N.x(x);return b.join("")}}}var zx=bh(jx,"px, ","px)","deg)"),Dx=bh(Ox,", ",")",")"),kx=1e-12;function xh(n){return((n=Math.exp(n))+1/n)/2}function Rx(n){return((n=Math.exp(n))-1/n)/2}function Hx(n){return((n=Math.exp(2*n))-1)/(n+1)}const fs=function n(a,u,s){function o(c,f){var h=c[0],g=c[1],m=c[2],y=f[0],b=f[1],p=f[2],x=y-h,w=b-g,E=x*x+w*w,N,M;if(E<kx)M=Math.log(p/m)/a,N=function(U){return[h+U*x,g+U*w,m*Math.exp(a*U*M)]};else{var O=Math.sqrt(E),_=(p*p-m*m+s*E)/(2*m*u*O),C=(p*p-m*m-s*E)/(2*p*u*O),k=Math.log(Math.sqrt(_*_+1)-_),H=Math.log(Math.sqrt(C*C+1)-C);M=(H-k)/a,N=function(U){var Q=U*M,q=xh(k),te=m/(u*O)*(q*Hx(a*Q+k)-Rx(k));return[h+te*x,g+te*w,m*q/xh(a*Q+k)]}}return N.duration=M*1e3*a/Math.SQRT2,N}return o.rho=function(c){var f=Math.max(.001,+c),h=f*f,g=h*h;return n(f,h,g)},o}(Math.SQRT2,2,4);var za=0,Hi=0,Li=0,wh=1e3,ds,Ui,hs=0,ta=0,gs=0,Bi=typeof performance=="object"&&performance.now?performance:Date,Sh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Nr(){return ta||(Sh(Lx),ta=Bi.now()+gs)}function Lx(){ta=0}function ms(){this._call=this._time=this._next=null}ms.prototype=Eh.prototype={constructor:ms,restart:function(n,a,u){if(typeof n!="function")throw new TypeError("callback is not a function");u=(u==null?Nr():+u)+(a==null?0:+a),!this._next&&Ui!==this&&(Ui?Ui._next=this:ds=this,Ui=this),this._call=n,this._time=u,Cr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cr())}};function Eh(n,a,u){var s=new ms;return s.restart(n,a,u),s}function Ux(){Nr(),++za;for(var n=ds,a;n;)(a=ta-n._time)>=0&&n._call.call(void 0,a),n=n._next;--za}function _h(){ta=(hs=Bi.now())+gs,za=Hi=0;try{Ux()}finally{za=0,Vx(),ta=0}}function Bx(){var n=Bi.now(),a=n-hs;a>wh&&(gs-=a,hs=n)}function Vx(){for(var n,a=ds,u,s=1/0;a;)a._call?(s>a._time&&(s=a._time),n=a,a=a._next):(u=a._next,a._next=null,a=n?n._next=u:ds=u);Ui=n,Cr(s)}function Cr(n){if(!za){Hi&&(Hi=clearTimeout(Hi));var a=n-ta;a>24?(n<1/0&&(Hi=setTimeout(_h,n-Bi.now()-gs)),Li&&(Li=clearInterval(Li))):(Li||(hs=Bi.now(),Li=setInterval(Bx,wh)),za=1,Sh(_h))}}function Nh(n,a,u){var s=new ms;return a=a==null?0:+a,s.restart(o=>{s.stop(),n(o+a)},a,u),s}var Yx=es("start","end","cancel","interrupt"),qx=[],Ch=0,Mh=1,Mr=2,ps=3,Th=4,Tr=5,ys=6;function vs(n,a,u,s,o,c){var f=n.__transition;if(!f)n.__transition={};else if(u in f)return;Xx(n,u,{name:a,index:s,group:o,on:Yx,tween:qx,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Ch})}function Ar(n,a){var u=Sn(n,a);if(u.state>Ch)throw new Error("too late; already scheduled");return u}function Rn(n,a){var u=Sn(n,a);if(u.state>ps)throw new Error("too late; already running");return u}function Sn(n,a){var u=n.__transition;if(!u||!(u=u[a]))throw new Error("transition not found");return u}function Xx(n,a,u){var s=n.__transition,o;s[a]=u,u.timer=Eh(c,0,u.time);function c(m){u.state=Mh,u.timer.restart(f,u.delay,u.time),u.delay<=m&&f(m-u.delay)}function f(m){var y,b,p,x;if(u.state!==Mh)return g();for(y in s)if(x=s[y],x.name===u.name){if(x.state===ps)return Nh(f);x.state===Th?(x.state=ys,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete s[y]):+y<a&&(x.state=ys,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete s[y])}if(Nh(function(){u.state===ps&&(u.state=Th,u.timer.restart(h,u.delay,u.time),h(m))}),u.state=Mr,u.on.call("start",n,n.__data__,u.index,u.group),u.state===Mr){for(u.state=ps,o=new Array(p=u.tween.length),y=0,b=-1;y<p;++y)(x=u.tween[y].value.call(n,n.__data__,u.index,u.group))&&(o[++b]=x);o.length=b+1}}function h(m){for(var y=m<u.duration?u.ease.call(null,m/u.duration):(u.timer.restart(g),u.state=Tr,1),b=-1,p=o.length;++b<p;)o[b].call(n,y);u.state===Tr&&(u.on.call("end",n,n.__data__,u.index,u.group),g())}function g(){u.state=ys,u.timer.stop(),delete s[a];for(var m in s)return;delete n.__transition}}function bs(n,a){var u=n.__transition,s,o,c=!0,f;if(u){a=a==null?null:a+"";for(f in u){if((s=u[f]).name!==a){c=!1;continue}o=s.state>Mr&&s.state<Tr,s.state=ys,s.timer.stop(),s.on.call(o?"interrupt":"cancel",n,n.__data__,s.index,s.group),delete u[f]}c&&delete n.__transition}}function $x(n){return this.each(function(){bs(this,n)})}function Gx(n,a){var u,s;return function(){var o=Rn(this,n),c=o.tween;if(c!==u){s=u=c;for(var f=0,h=s.length;f<h;++f)if(s[f].name===a){s=s.slice(),s.splice(f,1);break}}o.tween=s}}function Zx(n,a,u){var s,o;if(typeof u!="function")throw new Error;return function(){var c=Rn(this,n),f=c.tween;if(f!==s){o=(s=f).slice();for(var h={name:a,value:u},g=0,m=o.length;g<m;++g)if(o[g].name===a){o[g]=h;break}g===m&&o.push(h)}c.tween=o}}function Kx(n,a){var u=this._id;if(n+="",arguments.length<2){for(var s=Sn(this.node(),u).tween,o=0,c=s.length,f;o<c;++o)if((f=s[o]).name===n)return f.value;return null}return this.each((a==null?Gx:Zx)(u,n,a))}function jr(n,a,u){var s=n._id;return n.each(function(){var o=Rn(this,s);(o.value||(o.value={}))[a]=u.apply(this,arguments)}),function(o){return Sn(o,s).value[a]}}function Ah(n,a){var u;return(typeof a=="number"?kn:a instanceof Il?rs:(u=Il(a))?(a=u,rs):ph)(n,a)}function Qx(n){return function(){this.removeAttribute(n)}}function Jx(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Wx(n,a,u){var s,o=u+"",c;return function(){var f=this.getAttribute(n);return f===o?null:f===s?c:c=a(s=f,u)}}function Fx(n,a,u){var s,o=u+"",c;return function(){var f=this.getAttributeNS(n.space,n.local);return f===o?null:f===s?c:c=a(s=f,u)}}function Ix(n,a,u){var s,o,c;return function(){var f,h=u(this),g;return h==null?void this.removeAttribute(n):(f=this.getAttribute(n),g=h+"",f===g?null:f===s&&g===o?c:(o=g,c=a(s=f,h)))}}function Px(n,a,u){var s,o,c;return function(){var f,h=u(this),g;return h==null?void this.removeAttributeNS(n.space,n.local):(f=this.getAttributeNS(n.space,n.local),g=h+"",f===g?null:f===s&&g===o?c:(o=g,c=a(s=f,h)))}}function e2(n,a){var u=ns(n),s=u==="transform"?Dx:Ah;return this.attrTween(n,typeof a=="function"?(u.local?Px:Ix)(u,s,jr(this,"attr."+n,a)):a==null?(u.local?Jx:Qx)(u):(u.local?Fx:Wx)(u,s,a))}function t2(n,a){return function(u){this.setAttribute(n,a.call(this,u))}}function n2(n,a){return function(u){this.setAttributeNS(n.space,n.local,a.call(this,u))}}function l2(n,a){var u,s;function o(){var c=a.apply(this,arguments);return c!==s&&(u=(s=c)&&n2(n,c)),u}return o._value=a,o}function a2(n,a){var u,s;function o(){var c=a.apply(this,arguments);return c!==s&&(u=(s=c)&&t2(n,c)),u}return o._value=a,o}function i2(n,a){var u="attr."+n;if(arguments.length<2)return(u=this.tween(u))&&u._value;if(a==null)return this.tween(u,null);if(typeof a!="function")throw new Error;var s=ns(n);return this.tween(u,(s.local?l2:a2)(s,a))}function u2(n,a){return function(){Ar(this,n).delay=+a.apply(this,arguments)}}function s2(n,a){return a=+a,function(){Ar(this,n).delay=a}}function o2(n){var a=this._id;return arguments.length?this.each((typeof n=="function"?u2:s2)(a,n)):Sn(this.node(),a).delay}function r2(n,a){return function(){Rn(this,n).duration=+a.apply(this,arguments)}}function c2(n,a){return a=+a,function(){Rn(this,n).duration=a}}function f2(n){var a=this._id;return arguments.length?this.each((typeof n=="function"?r2:c2)(a,n)):Sn(this.node(),a).duration}function d2(n,a){if(typeof a!="function")throw new Error;return function(){Rn(this,n).ease=a}}function h2(n){var a=this._id;return arguments.length?this.each(d2(a,n)):Sn(this.node(),a).ease}function g2(n,a){return function(){var u=a.apply(this,arguments);if(typeof u!="function")throw new Error;Rn(this,n).ease=u}}function m2(n){if(typeof n!="function")throw new Error;return this.each(g2(this._id,n))}function p2(n){typeof n!="function"&&(n=Zd(n));for(var a=this._groups,u=a.length,s=new Array(u),o=0;o<u;++o)for(var c=a[o],f=c.length,h=s[o]=[],g,m=0;m<f;++m)(g=c[m])&&n.call(g,g.__data__,m,c)&&h.push(g);return new $n(s,this._parents,this._name,this._id)}function y2(n){if(n._id!==this._id)throw new Error;for(var a=this._groups,u=n._groups,s=a.length,o=u.length,c=Math.min(s,o),f=new Array(s),h=0;h<c;++h)for(var g=a[h],m=u[h],y=g.length,b=f[h]=new Array(y),p,x=0;x<y;++x)(p=g[x]||m[x])&&(b[x]=p);for(;h<s;++h)f[h]=a[h];return new $n(f,this._parents,this._name,this._id)}function v2(n){return(n+"").trim().split(/^|\s+/).every(function(a){var u=a.indexOf(".");return u>=0&&(a=a.slice(0,u)),!a||a==="start"})}function b2(n,a,u){var s,o,c=v2(a)?Ar:Rn;return function(){var f=c(this,n),h=f.on;h!==s&&(o=(s=h).copy()).on(a,u),f.on=o}}function x2(n,a){var u=this._id;return arguments.length<2?Sn(this.node(),u).on.on(n):this.each(b2(u,n,a))}function w2(n){return function(){var a=this.parentNode;for(var u in this.__transition)if(+u!==n)return;a&&a.removeChild(this)}}function S2(){return this.on("end.remove",w2(this._id))}function E2(n){var a=this._name,u=this._id;typeof n!="function"&&(n=gr(n));for(var s=this._groups,o=s.length,c=new Array(o),f=0;f<o;++f)for(var h=s[f],g=h.length,m=c[f]=new Array(g),y,b,p=0;p<g;++p)(y=h[p])&&(b=n.call(y,y.__data__,p,h))&&("__data__"in y&&(b.__data__=y.__data__),m[p]=b,vs(m[p],a,u,p,m,Sn(y,u)));return new $n(c,this._parents,a,u)}function _2(n){var a=this._name,u=this._id;typeof n!="function"&&(n=Gd(n));for(var s=this._groups,o=s.length,c=[],f=[],h=0;h<o;++h)for(var g=s[h],m=g.length,y,b=0;b<m;++b)if(y=g[b]){for(var p=n.call(y,y.__data__,b,g),x,w=Sn(y,u),E=0,N=p.length;E<N;++E)(x=p[E])&&vs(x,a,u,E,p,w);c.push(p),f.push(y)}return new $n(c,f,a,u)}var N2=ji.prototype.constructor;function C2(){return new N2(this._groups,this._parents)}function M2(n,a){var u,s,o;return function(){var c=Aa(this,n),f=(this.style.removeProperty(n),Aa(this,n));return c===f?null:c===u&&f===s?o:o=a(u=c,s=f)}}function jh(n){return function(){this.style.removeProperty(n)}}function T2(n,a,u){var s,o=u+"",c;return function(){var f=Aa(this,n);return f===o?null:f===s?c:c=a(s=f,u)}}function A2(n,a,u){var s,o,c;return function(){var f=Aa(this,n),h=u(this),g=h+"";return h==null&&(g=h=(this.style.removeProperty(n),Aa(this,n))),f===g?null:f===s&&g===o?c:(o=g,c=a(s=f,h))}}function j2(n,a){var u,s,o,c="style."+a,f="end."+c,h;return function(){var g=Rn(this,n),m=g.on,y=g.value[c]==null?h||(h=jh(a)):void 0;(m!==u||o!==y)&&(s=(u=m).copy()).on(f,o=y),g.on=s}}function O2(n,a,u){var s=(n+="")=="transform"?zx:Ah;return a==null?this.styleTween(n,M2(n,s)).on("end.style."+n,jh(n)):typeof a=="function"?this.styleTween(n,A2(n,s,jr(this,"style."+n,a))).each(j2(this._id,n)):this.styleTween(n,T2(n,s,a),u).on("end.style."+n,null)}function z2(n,a,u){return function(s){this.style.setProperty(n,a.call(this,s),u)}}function D2(n,a,u){var s,o;function c(){var f=a.apply(this,arguments);return f!==o&&(s=(o=f)&&z2(n,f,u)),s}return c._value=a,c}function k2(n,a,u){var s="style."+(n+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(a==null)return this.tween(s,null);if(typeof a!="function")throw new Error;return this.tween(s,D2(n,a,u??""))}function R2(n){return function(){this.textContent=n}}function H2(n){return function(){var a=n(this);this.textContent=a??""}}function L2(n){return this.tween("text",typeof n=="function"?H2(jr(this,"text",n)):R2(n==null?"":n+""))}function U2(n){return function(a){this.textContent=n.call(this,a)}}function B2(n){var a,u;function s(){var o=n.apply(this,arguments);return o!==u&&(a=(u=o)&&U2(o)),a}return s._value=n,s}function V2(n){var a="text";if(arguments.length<1)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,B2(n))}function Y2(){for(var n=this._name,a=this._id,u=Oh(),s=this._groups,o=s.length,c=0;c<o;++c)for(var f=s[c],h=f.length,g,m=0;m<h;++m)if(g=f[m]){var y=Sn(g,a);vs(g,n,u,m,f,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new $n(s,this._parents,n,u)}function q2(){var n,a,u=this,s=u._id,o=u.size();return new Promise(function(c,f){var h={value:f},g={value:function(){--o===0&&c()}};u.each(function(){var m=Rn(this,s),y=m.on;y!==n&&(a=(n=y).copy(),a._.cancel.push(h),a._.interrupt.push(h),a._.end.push(g)),m.on=a}),o===0&&c()})}var X2=0;function $n(n,a,u,s){this._groups=n,this._parents=a,this._name=u,this._id=s}function Oh(){return++X2}var Gn=ji.prototype;$n.prototype={constructor:$n,select:E2,selectAll:_2,selectChild:Gn.selectChild,selectChildren:Gn.selectChildren,filter:p2,merge:y2,selection:C2,transition:Y2,call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:x2,attr:e2,attrTween:i2,style:O2,styleTween:k2,text:L2,textTween:V2,remove:S2,tween:Kx,delay:o2,duration:f2,ease:h2,easeVarying:m2,end:q2,[Symbol.iterator]:Gn[Symbol.iterator]};function $2(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var G2={time:null,delay:0,duration:250,ease:$2};function Z2(n,a){for(var u;!(u=n.__transition)||!(u=u[a]);)if(!(n=n.parentNode))throw new Error(`transition ${a} not found`);return u}function K2(n){var a,u;n instanceof $n?(a=n._id,n=n._name):(a=Oh(),(u=G2).time=Nr(),n=n==null?null:n+"");for(var s=this._groups,o=s.length,c=0;c<o;++c)for(var f=s[c],h=f.length,g,m=0;m<h;++m)(g=f[m])&&vs(g,n,a,m,f,u||Z2(g,a));return new $n(s,this._parents,n,a)}ji.prototype.interrupt=$x,ji.prototype.transition=K2;const xs=n=>()=>n;function Q2(n,{sourceEvent:a,target:u,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:a,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Zn(n,a,u){this.k=n,this.x=a,this.y=u}Zn.prototype={constructor:Zn,scale:function(n){return n===1?this:new Zn(this.k*n,this.x,this.y)},translate:function(n,a){return n===0&a===0?this:new Zn(this.k,this.x+this.k*n,this.y+this.k*a)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ws=new Zn(1,0,0);zh.prototype=Zn.prototype;function zh(n){for(;!n.__zoom;)if(!(n=n.parentNode))return ws;return n.__zoom}function Or(n){n.stopImmediatePropagation()}function Vi(n){n.preventDefault(),n.stopImmediatePropagation()}function J2(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function W2(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Dh(){return this.__zoom||ws}function F2(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function I2(){return navigator.maxTouchPoints||"ontouchstart"in this}function P2(n,a,u){var s=n.invertX(a[0][0])-u[0][0],o=n.invertX(a[1][0])-u[1][0],c=n.invertY(a[0][1])-u[0][1],f=n.invertY(a[1][1])-u[1][1];return n.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),f>c?(c+f)/2:Math.min(0,c)||Math.max(0,f))}function kh(){var n=J2,a=W2,u=P2,s=F2,o=I2,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],h=250,g=fs,m=es("start","zoom","end"),y,b,p,x=500,w=150,E=0,N=10;function M(j){j.property("__zoom",Dh).on("wheel.zoom",Q,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",te).filter(o).on("touchstart.zoom",J).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(j,B,z,L){var G=j.selection?j.selection():j;G.property("__zoom",Dh),j!==G?k(j,B,z,L):G.interrupt().each(function(){H(this,arguments).event(L).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},M.scaleBy=function(j,B,z,L){M.scaleTo(j,function(){var G=this.__zoom.k,X=typeof B=="function"?B.apply(this,arguments):B;return G*X},z,L)},M.scaleTo=function(j,B,z,L){M.transform(j,function(){var G=a.apply(this,arguments),X=this.__zoom,A=z==null?C(G):typeof z=="function"?z.apply(this,arguments):z,$=X.invert(A),F=typeof B=="function"?B.apply(this,arguments):B;return u(_(O(X,F),A,$),G,f)},z,L)},M.translateBy=function(j,B,z,L){M.transform(j,function(){return u(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof z=="function"?z.apply(this,arguments):z),a.apply(this,arguments),f)},null,L)},M.translateTo=function(j,B,z,L,G){M.transform(j,function(){var X=a.apply(this,arguments),A=this.__zoom,$=L==null?C(X):typeof L=="function"?L.apply(this,arguments):L;return u(ws.translate($[0],$[1]).scale(A.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof z=="function"?-z.apply(this,arguments):-z),X,f)},L,G)};function O(j,B){return B=Math.max(c[0],Math.min(c[1],B)),B===j.k?j:new Zn(B,j.x,j.y)}function _(j,B,z){var L=B[0]-z[0]*j.k,G=B[1]-z[1]*j.k;return L===j.x&&G===j.y?j:new Zn(j.k,L,G)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function k(j,B,z,L){j.on("start.zoom",function(){H(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(L).end()}).tween("zoom",function(){var G=this,X=arguments,A=H(G,X).event(L),$=a.apply(G,X),F=z==null?C($):typeof z=="function"?z.apply(G,X):z,le=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),ee=G.__zoom,de=typeof B=="function"?B.apply(G,X):B,fe=g(ee.invert(F).concat(le/ee.k),de.invert(F).concat(le/de.k));return function(he){if(he===1)he=de;else{var ie=fe(he),ge=le/ie[2];he=new Zn(ge,F[0]-ie[0]*ge,F[1]-ie[1]*ge)}A.zoom(null,he)}})}function H(j,B,z){return!z&&j.__zooming||new U(j,B)}function U(j,B){this.that=j,this.args=B,this.active=0,this.sourceEvent=null,this.extent=a.apply(j,B),this.taps=0}U.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,B){return this.mouse&&j!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var B=Ft(this.that).datum();m.call(j,this.that,new Q2(j,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:m}),B)}};function Q(j,...B){if(!n.apply(this,arguments))return;var z=H(this,B).event(j),L=this.__zoom,G=Math.max(c[0],Math.min(c[1],L.k*Math.pow(2,s.apply(this,arguments)))),X=xn(j);if(z.wheel)(z.mouse[0][0]!==X[0]||z.mouse[0][1]!==X[1])&&(z.mouse[1]=L.invert(z.mouse[0]=X)),clearTimeout(z.wheel);else{if(L.k===G)return;z.mouse=[X,L.invert(X)],bs(this),z.start()}Vi(j),z.wheel=setTimeout(A,w),z.zoom("mouse",u(_(O(L,G),z.mouse[0],z.mouse[1]),z.extent,f));function A(){z.wheel=null,z.end()}}function q(j,...B){if(p||!n.apply(this,arguments))return;var z=j.currentTarget,L=H(this,B,!0).event(j),G=Ft(j.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",le,!0),X=xn(j,z),A=j.clientX,$=j.clientY;nh(j.view),Or(j),L.mouse=[X,this.__zoom.invert(X)],bs(this),L.start();function F(ee){if(Vi(ee),!L.moved){var de=ee.clientX-A,fe=ee.clientY-$;L.moved=de*de+fe*fe>E}L.event(ee).zoom("mouse",u(_(L.that.__zoom,L.mouse[0]=xn(ee,z),L.mouse[1]),L.extent,f))}function le(ee){G.on("mousemove.zoom mouseup.zoom",null),lh(ee.view,L.moved),Vi(ee),L.event(ee).end()}}function te(j,...B){if(n.apply(this,arguments)){var z=this.__zoom,L=xn(j.changedTouches?j.changedTouches[0]:j,this),G=z.invert(L),X=z.k*(j.shiftKey?.5:2),A=u(_(O(z,X),L,G),a.apply(this,B),f);Vi(j),h>0?Ft(this).transition().duration(h).call(k,A,L,j):Ft(this).call(M.transform,A,L,j)}}function J(j,...B){if(n.apply(this,arguments)){var z=j.touches,L=z.length,G=H(this,B,j.changedTouches.length===L).event(j),X,A,$,F;for(Or(j),A=0;A<L;++A)$=z[A],F=xn($,this),F=[F,this.__zoom.invert(F),$.identifier],G.touch0?!G.touch1&&G.touch0[2]!==F[2]&&(G.touch1=F,G.taps=0):(G.touch0=F,X=!0,G.taps=1+!!y);y&&(y=clearTimeout(y)),X&&(G.taps<2&&(b=F[0],y=setTimeout(function(){y=null},x)),bs(this),G.start())}}function V(j,...B){if(this.__zooming){var z=H(this,B).event(j),L=j.changedTouches,G=L.length,X,A,$,F;for(Vi(j),X=0;X<G;++X)A=L[X],$=xn(A,this),z.touch0&&z.touch0[2]===A.identifier?z.touch0[0]=$:z.touch1&&z.touch1[2]===A.identifier&&(z.touch1[0]=$);if(A=z.that.__zoom,z.touch1){var le=z.touch0[0],ee=z.touch0[1],de=z.touch1[0],fe=z.touch1[1],he=(he=de[0]-le[0])*he+(he=de[1]-le[1])*he,ie=(ie=fe[0]-ee[0])*ie+(ie=fe[1]-ee[1])*ie;A=O(A,Math.sqrt(he/ie)),$=[(le[0]+de[0])/2,(le[1]+de[1])/2],F=[(ee[0]+fe[0])/2,(ee[1]+fe[1])/2]}else if(z.touch0)$=z.touch0[0],F=z.touch0[1];else return;z.zoom("touch",u(_(A,$,F),z.extent,f))}}function Y(j,...B){if(this.__zooming){var z=H(this,B).event(j),L=j.changedTouches,G=L.length,X,A;for(Or(j),p&&clearTimeout(p),p=setTimeout(function(){p=null},x),X=0;X<G;++X)A=L[X],z.touch0&&z.touch0[2]===A.identifier?delete z.touch0:z.touch1&&z.touch1[2]===A.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(A=xn(A,this),Math.hypot(b[0]-A[0],b[1]-A[1])<N)){var $=Ft(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return M.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:xs(+j),M):s},M.filter=function(j){return arguments.length?(n=typeof j=="function"?j:xs(!!j),M):n},M.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:xs(!!j),M):o},M.extent=function(j){return arguments.length?(a=typeof j=="function"?j:xs([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),M):a},M.scaleExtent=function(j){return arguments.length?(c[0]=+j[0],c[1]=+j[1],M):[c[0],c[1]]},M.translateExtent=function(j){return arguments.length?(f[0][0]=+j[0][0],f[1][0]=+j[1][0],f[0][1]=+j[0][1],f[1][1]=+j[1][1],M):[[f[0][0],f[0][1]],[f[1][0],f[1][1]]]},M.constrain=function(j){return arguments.length?(u=j,M):u},M.duration=function(j){return arguments.length?(h=+j,M):h},M.interpolate=function(j){return arguments.length?(g=j,M):g},M.on=function(){var j=m.on.apply(m,arguments);return j===m?M:j},M.clickDistance=function(j){return arguments.length?(E=(j=+j)*j,M):Math.sqrt(E)},M.tapDistance=function(j){return arguments.length?(N=+j,M):N},M}const Hn={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:n=>`Node type "${n}" 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:a,sourceHandle:u,targetHandle:s})=>`Couldn't create edge for ${n} handle id: "${n==="source"?u:s}", edge id: ${a}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/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."},Yi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Rh=["Enter"," ","Escape"],Hh={"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:n,x:a,y:u})=>`Moved selected node ${n}. New position, x: ${a}, y: ${u}`,"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 Da;(function(n){n.Strict="strict",n.Loose="loose"})(Da||(Da={}));var na;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(na||(na={}));var qi;(function(n){n.Partial="partial",n.Full="full"})(qi||(qi={}));const Lh={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var pl;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(pl||(pl={}));var Ss;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Ss||(Ss={}));var ve;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(ve||(ve={}));const Uh={[ve.Left]:ve.Right,[ve.Right]:ve.Left,[ve.Top]:ve.Bottom,[ve.Bottom]:ve.Top};function Bh(n){return n===null?null:n?"valid":"invalid"}const Vh=n=>"id"in n&&"source"in n&&"target"in n,ew=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),zr=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),Xi=(n,a=[0,0])=>{const{width:u,height:s}=Kn(n),o=n.origin??a,c=u*o[0],f=s*o[1];return{x:n.position.x-c,y:n.position.y-f}},Yh=(n,a={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const u=n.reduce((s,o)=>{const c=typeof o=="string";let f=!a.nodeLookup&&!c?o:void 0;a.nodeLookup&&(f=c?a.nodeLookup.get(o):zr(o)?o:a.nodeLookup.get(o.id));const h=f?Ns(f,a.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Es(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _s(u)},$i=(n,a={})=>{if(n.size===0)return{x:0,y:0,width:0,height:0};let u={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach(s=>{if(a.filter===void 0||a.filter(s)){const o=Ns(s);u=Es(u,o)}}),_s(u)},Dr=(n,a,[u,s,o]=[0,0,1],c=!1,f=!1)=>{const h={...Ki(a,[u,s,o]),width:a.width/o,height:a.height/o},g=[];for(const m of n.values()){const{measured:y,selectable:b=!0,hidden:p=!1}=m;if(f&&!b||p)continue;const x=y.width??m.width??m.initialWidth??null,w=y.height??m.height??m.initialHeight??null,E=Gi(h,Ra(m)),N=(x??0)*(w??0),M=c&&E>0;(!m.internals.handleBounds||M||E>=N||m.dragging)&&g.push(m)}return g},tw=(n,a)=>{const u=new Set;return n.forEach(s=>{u.add(s.id)}),a.filter(s=>u.has(s.source)||u.has(s.target))};function nw(n,a){const u=new Map,s=a!=null&&a.nodes?new Set(a.nodes.map(o=>o.id)):null;return n.forEach(o=>{o.measured.width&&o.measured.height&&((a==null?void 0:a.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&u.set(o.id,o)}),u}async function lw({nodes:n,width:a,height:u,panZoom:s,minZoom:o,maxZoom:c},f){if(n.size===0)return Promise.resolve(!0);const h=nw(n,f),g=$i(h),m=Ms(g,a,u,(f==null?void 0:f.minZoom)??o,(f==null?void 0:f.maxZoom)??c,(f==null?void 0:f.padding)??.1);return await s.setViewport(m,{duration:f==null?void 0:f.duration,ease:f==null?void 0:f.ease,interpolate:f==null?void 0:f.interpolate}),Promise.resolve(!0)}function qh({nodeId:n,nextPosition:a,nodeLookup:u,nodeOrigin:s=[0,0],nodeExtent:o,onError:c}){const f=u.get(n),h=f.parentId?u.get(f.parentId):void 0,{x:g,y:m}=h?h.internals.positionAbsolute:{x:0,y:0},y=f.origin??s;let b=f.extent||o;if(f.extent==="parent"&&!f.expandParent)if(!h)c==null||c("005",Hn.error005());else{const x=h.measured.width,w=h.measured.height;x&&w&&(b=[[g,m],[g+x,m+w]])}else h&&La(f.extent)&&(b=[[f.extent[0][0]+g,f.extent[0][1]+m],[f.extent[1][0]+g,f.extent[1][1]+m]]);const p=La(b)?la(a,b,f.measured):a;return(f.measured.width===void 0||f.measured.height===void 0)&&(c==null||c("015",Hn.error015())),{position:{x:p.x-g+(f.measured.width??0)*y[0],y:p.y-m+(f.measured.height??0)*y[1]},positionAbsolute:p}}async function aw({nodesToRemove:n=[],edgesToRemove:a=[],nodes:u,edges:s,onBeforeDelete:o}){const c=new Set(n.map(p=>p.id)),f=[];for(const p of u){if(p.deletable===!1)continue;const x=c.has(p.id),w=!x&&p.parentId&&f.find(E=>E.id===p.parentId);(x||w)&&f.push(p)}const h=new Set(a.map(p=>p.id)),g=s.filter(p=>p.deletable!==!1),y=tw(f,g);for(const p of g)h.has(p.id)&&!y.find(w=>w.id===p.id)&&y.push(p);if(!o)return{edges:y,nodes:f};const b=await o({nodes:f,edges:y});return typeof b=="boolean"?b?{edges:y,nodes:f}:{edges:[],nodes:[]}:b}const ka=(n,a=0,u=1)=>Math.min(Math.max(n,a),u),la=(n={x:0,y:0},a,u)=>({x:ka(n.x,a[0][0],a[1][0]-((u==null?void 0:u.width)??0)),y:ka(n.y,a[0][1],a[1][1]-((u==null?void 0:u.height)??0))});function Xh(n,a,u){const{width:s,height:o}=Kn(u),{x:c,y:f}=u.internals.positionAbsolute;return la(n,[[c,f],[c+s,f+o]],a)}const $h=(n,a,u)=>n<a?ka(Math.abs(n-a),1,a)/a:n>u?-ka(Math.abs(n-u),1,a)/a:0,Gh=(n,a,u=15,s=40)=>{const o=$h(n.x,s,a.width-s)*u,c=$h(n.y,s,a.height-s)*u;return[o,c]},Es=(n,a)=>({x:Math.min(n.x,a.x),y:Math.min(n.y,a.y),x2:Math.max(n.x2,a.x2),y2:Math.max(n.y2,a.y2)}),kr=({x:n,y:a,width:u,height:s})=>({x:n,y:a,x2:n+u,y2:a+s}),_s=({x:n,y:a,x2:u,y2:s})=>({x:n,y:a,width:u-n,height:s-a}),Ra=(n,a=[0,0])=>{var o,c;const{x:u,y:s}=zr(n)?n.internals.positionAbsolute:Xi(n,a);return{x:u,y:s,width:((o=n.measured)==null?void 0:o.width)??n.width??n.initialWidth??0,height:((c=n.measured)==null?void 0:c.height)??n.height??n.initialHeight??0}},Ns=(n,a=[0,0])=>{var o,c;const{x:u,y:s}=zr(n)?n.internals.positionAbsolute:Xi(n,a);return{x:u,y:s,x2:u+(((o=n.measured)==null?void 0:o.width)??n.width??n.initialWidth??0),y2:s+(((c=n.measured)==null?void 0:c.height)??n.height??n.initialHeight??0)}},Zh=(n,a)=>_s(Es(kr(n),kr(a))),Gi=(n,a)=>{const u=Math.max(0,Math.min(n.x+n.width,a.x+a.width)-Math.max(n.x,a.x)),s=Math.max(0,Math.min(n.y+n.height,a.y+a.height)-Math.max(n.y,a.y));return Math.ceil(u*s)},Kh=n=>En(n.width)&&En(n.height)&&En(n.x)&&En(n.y),En=n=>!isNaN(n)&&isFinite(n),iw=(n,a)=>{},Zi=(n,a=[1,1])=>({x:a[0]*Math.round(n.x/a[0]),y:a[1]*Math.round(n.y/a[1])}),Ki=({x:n,y:a},[u,s,o],c=!1,f=[1,1])=>{const h={x:(n-u)/o,y:(a-s)/o};return c?Zi(h,f):h},Cs=({x:n,y:a},[u,s,o])=>({x:n*o+u,y:a*o+s});function Ha(n,a){if(typeof n=="number")return Math.floor((a-a/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const u=parseFloat(n);if(!Number.isNaN(u))return Math.floor(u)}if(typeof n=="string"&&n.endsWith("%")){const u=parseFloat(n);if(!Number.isNaN(u))return Math.floor(a*u*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function uw(n,a,u){if(typeof n=="string"||typeof n=="number"){const s=Ha(n,u),o=Ha(n,a);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof n=="object"){const s=Ha(n.top??n.y??0,u),o=Ha(n.bottom??n.y??0,u),c=Ha(n.left??n.x??0,a),f=Ha(n.right??n.x??0,a);return{top:s,right:f,bottom:o,left:c,x:c+f,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function sw(n,a,u,s,o,c){const{x:f,y:h}=Cs(n,[a,u,s]),{x:g,y:m}=Cs({x:n.x+n.width,y:n.y+n.height},[a,u,s]),y=o-g,b=c-m;return{left:Math.floor(f),top:Math.floor(h),right:Math.floor(y),bottom:Math.floor(b)}}const Ms=(n,a,u,s,o,c)=>{const f=uw(c,a,u),h=(a-f.x)/n.width,g=(u-f.y)/n.height,m=Math.min(h,g),y=ka(m,s,o),b=n.x+n.width/2,p=n.y+n.height/2,x=a/2-b*y,w=u/2-p*y,E=sw(n,x,w,y,a,u),N={left:Math.min(E.left-f.left,0),top:Math.min(E.top-f.top,0),right:Math.min(E.right-f.right,0),bottom:Math.min(E.bottom-f.bottom,0)};return{x:x-N.left+N.right,y:w-N.top+N.bottom,zoom:y}},Qi=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function La(n){return n!=null&&n!=="parent"}function Kn(n){var a,u;return{width:((a=n.measured)==null?void 0:a.width)??n.width??n.initialWidth??0,height:((u=n.measured)==null?void 0:u.height)??n.height??n.initialHeight??0}}function Qh(n){var a,u;return(((a=n.measured)==null?void 0:a.width)??n.width??n.initialWidth)!==void 0&&(((u=n.measured)==null?void 0:u.height)??n.height??n.initialHeight)!==void 0}function Jh(n,a={width:0,height:0},u,s,o){const c={...n},f=s.get(u);if(f){const h=f.origin||o;c.x+=f.internals.positionAbsolute.x-(a.width??0)*h[0],c.y+=f.internals.positionAbsolute.y-(a.height??0)*h[1]}return c}function Wh(n,a){if(n.size!==a.size)return!1;for(const u of n)if(!a.has(u))return!1;return!0}function ow(){let n,a;return{promise:new Promise((s,o)=>{n=s,a=o}),resolve:n,reject:a}}function rw(n){return{...Hh,...n||{}}}function Ji(n,{snapGrid:a=[0,0],snapToGrid:u=!1,transform:s,containerBounds:o}){const{x:c,y:f}=_n(n),h=Ki({x:c-((o==null?void 0:o.left)??0),y:f-((o==null?void 0:o.top)??0)},s),{x:g,y:m}=u?Zi(h,a):h;return{xSnapped:g,ySnapped:m,...h}}const Rr=n=>({width:n.offsetWidth,height:n.offsetHeight}),Fh=n=>{var a;return((a=n==null?void 0:n.getRootNode)==null?void 0:a.call(n))||(window==null?void 0:window.document)},cw=["INPUT","SELECT","TEXTAREA"];function Ih(n){var s,o;const a=((o=(s=n.composedPath)==null?void 0:s.call(n))==null?void 0:o[0])||n.target;return(a==null?void 0:a.nodeType)!==1?!1:cw.includes(a.nodeName)||a.hasAttribute("contenteditable")||!!a.closest(".nokey")}const Ph=n=>"clientX"in n,_n=(n,a)=>{var c,f;const u=Ph(n),s=u?n.clientX:(c=n.touches)==null?void 0:c[0].clientX,o=u?n.clientY:(f=n.touches)==null?void 0:f[0].clientY;return{x:s-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)}},eg=(n,a,u,s,o)=>{const c=a.querySelectorAll(`.${n}`);return!c||!c.length?null:Array.from(c).map(f=>{const h=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),type:n,nodeId:o,position:f.getAttribute("data-handlepos"),x:(h.left-u.left)/s,y:(h.top-u.top)/s,...Rr(f)}})};function tg({sourceX:n,sourceY:a,targetX:u,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:h}){const g=n*.125+o*.375+f*.375+u*.125,m=a*.125+c*.375+h*.375+s*.125,y=Math.abs(g-n),b=Math.abs(m-a);return[g,m,y,b]}function Ts(n,a){return n>=0?.5*n:a*25*Math.sqrt(-n)}function ng({pos:n,x1:a,y1:u,x2:s,y2:o,c}){switch(n){case ve.Left:return[a-Ts(a-s,c),u];case ve.Right:return[a+Ts(s-a,c),u];case ve.Top:return[a,u-Ts(u-o,c)];case ve.Bottom:return[a,u+Ts(o-u,c)]}}function Hr({sourceX:n,sourceY:a,sourcePosition:u=ve.Bottom,targetX:s,targetY:o,targetPosition:c=ve.Top,curvature:f=.25}){const[h,g]=ng({pos:u,x1:n,y1:a,x2:s,y2:o,c:f}),[m,y]=ng({pos:c,x1:s,y1:o,x2:n,y2:a,c:f}),[b,p,x,w]=tg({sourceX:n,sourceY:a,targetX:s,targetY:o,sourceControlX:h,sourceControlY:g,targetControlX:m,targetControlY:y});return[`M${n},${a} C${h},${g} ${m},${y} ${s},${o}`,b,p,x,w]}function lg({sourceX:n,sourceY:a,targetX:u,targetY:s}){const o=Math.abs(u-n)/2,c=u<n?u+o:u-o,f=Math.abs(s-a)/2,h=s<a?s+f:s-f;return[c,h,o,f]}function fw({sourceNode:n,targetNode:a,selected:u=!1,zIndex:s,elevateOnSelect:o=!1}){if(s!==void 0)return s;const c=o&&u?1e3:0,f=Math.max(n.parentId||o&&n.selected?n.internals.z:0,a.parentId||o&&a.selected?a.internals.z:0);return c+f}function dw({sourceNode:n,targetNode:a,width:u,height:s,transform:o}){const c=Es(Ns(n),Ns(a));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const f={x:-o[0]/o[2],y:-o[1]/o[2],width:u/o[2],height:s/o[2]};return Gi(f,_s(c))>0}const hw=({source:n,sourceHandle:a,target:u,targetHandle:s})=>`xy-edge__${n}${a||""}-${u}${s||""}`,gw=(n,a)=>a.some(u=>u.source===n.source&&u.target===n.target&&(u.sourceHandle===n.sourceHandle||!u.sourceHandle&&!n.sourceHandle)&&(u.targetHandle===n.targetHandle||!u.targetHandle&&!n.targetHandle)),ag=(n,a)=>{if(!n.source||!n.target)return a;let u;return Vh(n)?u={...n}:u={...n,id:hw(n)},gw(u,a)?a:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,a.concat(u))};function ig({sourceX:n,sourceY:a,targetX:u,targetY:s}){const[o,c,f,h]=lg({sourceX:n,sourceY:a,targetX:u,targetY:s});return[`M ${n},${a}L ${u},${s}`,o,c,f,h]}const ug={[ve.Left]:{x:-1,y:0},[ve.Right]:{x:1,y:0},[ve.Top]:{x:0,y:-1},[ve.Bottom]:{x:0,y:1}},mw=({source:n,sourcePosition:a=ve.Bottom,target:u})=>a===ve.Left||a===ve.Right?n.x<u.x?{x:1,y:0}:{x:-1,y:0}:n.y<u.y?{x:0,y:1}:{x:0,y:-1},sg=(n,a)=>Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2));function pw({source:n,sourcePosition:a=ve.Bottom,target:u,targetPosition:s=ve.Top,center:o,offset:c,stepPosition:f}){const h=ug[a],g=ug[s],m={x:n.x+h.x*c,y:n.y+h.y*c},y={x:u.x+g.x*c,y:u.y+g.y*c},b=mw({source:m,sourcePosition:a,target:y}),p=b.x!==0?"x":"y",x=b[p];let w=[],E,N;const M={x:0,y:0},O={x:0,y:0},[,,_,C]=lg({sourceX:n.x,sourceY:n.y,targetX:u.x,targetY:u.y});if(h[p]*g[p]===-1){p==="x"?(E=o.x??m.x+(y.x-m.x)*f,N=o.y??(m.y+y.y)/2):(E=o.x??(m.x+y.x)/2,N=o.y??m.y+(y.y-m.y)*f);const H=[{x:E,y:m.y},{x:E,y:y.y}],U=[{x:m.x,y:N},{x:y.x,y:N}];h[p]===x?w=p==="x"?H:U:w=p==="x"?U:H}else{const H=[{x:m.x,y:y.y}],U=[{x:y.x,y:m.y}];if(p==="x"?w=h.x===x?U:H:w=h.y===x?H:U,a===s){const V=Math.abs(n[p]-u[p]);if(V<=c){const Y=Math.min(c-1,c-V);h[p]===x?M[p]=(m[p]>n[p]?-1:1)*Y:O[p]=(y[p]>u[p]?-1:1)*Y}}if(a!==s){const V=p==="x"?"y":"x",Y=h[p]===g[V],j=m[V]>y[V],B=m[V]<y[V];(h[p]===1&&(!Y&&j||Y&&B)||h[p]!==1&&(!Y&&B||Y&&j))&&(w=p==="x"?H:U)}const Q={x:m.x+M.x,y:m.y+M.y},q={x:y.x+O.x,y:y.y+O.y},te=Math.max(Math.abs(Q.x-w[0].x),Math.abs(q.x-w[0].x)),J=Math.max(Math.abs(Q.y-w[0].y),Math.abs(q.y-w[0].y));te>=J?(E=(Q.x+q.x)/2,N=w[0].y):(E=w[0].x,N=(Q.y+q.y)/2)}return[[n,{x:m.x+M.x,y:m.y+M.y},...w,{x:y.x+O.x,y:y.y+O.y},u],E,N,_,C]}function yw(n,a,u,s){const o=Math.min(sg(n,a)/2,sg(a,u)/2,s),{x:c,y:f}=a;if(n.x===c&&c===u.x||n.y===f&&f===u.y)return`L${c} ${f}`;if(n.y===f){const m=n.x<u.x?-1:1,y=n.y<u.y?1:-1;return`L ${c+o*m},${f}Q ${c},${f} ${c},${f+o*y}`}const h=n.x<u.x?1:-1,g=n.y<u.y?-1:1;return`L ${c},${f+o*g}Q ${c},${f} ${c+o*h},${f}`}function Lr({sourceX:n,sourceY:a,sourcePosition:u=ve.Bottom,targetX:s,targetY:o,targetPosition:c=ve.Top,borderRadius:f=5,centerX:h,centerY:g,offset:m=20,stepPosition:y=.5}){const[b,p,x,w,E]=pw({source:{x:n,y:a},sourcePosition:u,target:{x:s,y:o},targetPosition:c,center:{x:h,y:g},offset:m,stepPosition:y});return[b.reduce((M,O,_)=>{let C="";return _>0&&_<b.length-1?C=yw(b[_-1],O,b[_+1],f):C=`${_===0?"M":"L"}${O.x} ${O.y}`,M+=C,M},""),p,x,w,E]}function og(n){var a;return n&&!!(n.internals.handleBounds||(a=n.handles)!=null&&a.length)&&!!(n.measured.width||n.width||n.initialWidth)}function vw(n){var b;const{sourceNode:a,targetNode:u}=n;if(!og(a)||!og(u))return null;const s=a.internals.handleBounds||rg(a.handles),o=u.internals.handleBounds||rg(u.handles),c=cg((s==null?void 0:s.source)??[],n.sourceHandle),f=cg(n.connectionMode===Da.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),n.targetHandle);if(!c||!f)return(b=n.onError)==null||b.call(n,"008",Hn.error008(c?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const h=(c==null?void 0:c.position)||ve.Bottom,g=(f==null?void 0:f.position)||ve.Top,m=Wi(a,c,h),y=Wi(u,f,g);return{sourceX:m.x,sourceY:m.y,targetX:y.x,targetY:y.y,sourcePosition:h,targetPosition:g}}function rg(n){if(!n)return null;const a=[],u=[];for(const s of n)s.width=s.width??1,s.height=s.height??1,s.type==="source"?a.push(s):s.type==="target"&&u.push(s);return{source:a,target:u}}function Wi(n,a,u=ve.Left,s=!1){const o=((a==null?void 0:a.x)??0)+n.internals.positionAbsolute.x,c=((a==null?void 0:a.y)??0)+n.internals.positionAbsolute.y,{width:f,height:h}=a??Kn(n);if(s)return{x:o+f/2,y:c+h/2};switch((a==null?void 0:a.position)??u){case ve.Top:return{x:o+f/2,y:c};case ve.Right:return{x:o+f,y:c+h/2};case ve.Bottom:return{x:o+f/2,y:c+h};case ve.Left:return{x:o,y:c+h/2}}}function cg(n,a){return n&&(a?n.find(u=>u.id===a):n[0])||null}function Ur(n,a){return n?typeof n=="string"?n:`${a?`${a}__`:""}${Object.keys(n).sort().map(s=>`${s}=${n[s]}`).join("&")}`:""}function bw(n,{id:a,defaultColor:u,defaultMarkerStart:s,defaultMarkerEnd:o}){const c=new Set;return n.reduce((f,h)=>([h.markerStart||s,h.markerEnd||o].forEach(g=>{if(g&&typeof g=="object"){const m=Ur(g,a);c.has(m)||(f.push({id:m,color:g.color||u,...g}),c.add(m))}}),f),[]).sort((f,h)=>f.id.localeCompare(h.id))}const Br={nodeOrigin:[0,0],nodeExtent:Yi,elevateNodesOnSelect:!0,defaults:{}},xw={...Br,checkEquality:!0};function Vr(n,a){const u={...n};for(const s in a)a[s]!==void 0&&(u[s]=a[s]);return u}function ww(n,a,u){const s=Vr(Br,u);for(const o of n.values())if(o.parentId)qr(o,n,a,s);else{const c=Xi(o,s.nodeOrigin),f=La(o.extent)?o.extent:s.nodeExtent,h=la(c,f,Kn(o));o.internals.positionAbsolute=h}}function Sw(n,a){if(!n.handles)return n.measured?a==null?void 0:a.internals.handleBounds:void 0;const u=[],s=[];for(const o of n.handles){const c={id:o.id,width:o.width??1,height:o.height??1,nodeId:n.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?u.push(c):o.type==="target"&&s.push(c)}return{source:u,target:s}}function Yr(n,a,u,s){var g,m;const o=Vr(xw,s);let c=n.length>0;const f=new Map(a),h=o!=null&&o.elevateNodesOnSelect?1e3:0;a.clear(),u.clear();for(const y of n){let b=f.get(y.id);if(o.checkEquality&&y===(b==null?void 0:b.internals.userNode))a.set(y.id,b);else{const p=Xi(y,o.nodeOrigin),x=La(y.extent)?y.extent:o.nodeExtent,w=la(p,x,Kn(y));b={...o.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(m=y.measured)==null?void 0:m.height},internals:{positionAbsolute:w,handleBounds:Sw(y,b),z:fg(y,h),userNode:y}},a.set(y.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(c=!1),y.parentId&&qr(b,a,u,s)}return c}function Ew(n,a){if(!n.parentId)return;const u=a.get(n.parentId);u?u.set(n.id,n):a.set(n.parentId,new Map([[n.id,n]]))}function qr(n,a,u,s){const{elevateNodesOnSelect:o,nodeOrigin:c,nodeExtent:f}=Vr(Br,s),h=n.parentId,g=a.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ew(n,u);const m=o?1e3:0,{x:y,y:b,z:p}=_w(n,g,c,f,m),{positionAbsolute:x}=n.internals,w=y!==x.x||b!==x.y;(w||p!==n.internals.z)&&a.set(n.id,{...n,internals:{...n.internals,positionAbsolute:w?{x:y,y:b}:x,z:p}})}function fg(n,a){return(En(n.zIndex)?n.zIndex:0)+(n.selected?a:0)}function _w(n,a,u,s,o){const{x:c,y:f}=a.internals.positionAbsolute,h=Kn(n),g=Xi(n,u),m=La(n.extent)?la(g,n.extent,h):g;let y=la({x:c+m.x,y:f+m.y},s,h);n.extent==="parent"&&(y=Xh(y,h,a));const b=fg(n,o),p=a.internals.z??0;return{x:y.x,y:y.y,z:p>=b?p+1:b}}function Xr(n,a,u,s=[0,0]){var f;const o=[],c=new Map;for(const h of n){const g=a.get(h.parentId);if(!g)continue;const m=((f=c.get(h.parentId))==null?void 0:f.expandedRect)??Ra(g),y=Zh(m,h.rect);c.set(h.parentId,{expandedRect:y,parent:g})}return c.size>0&&c.forEach(({expandedRect:h,parent:g},m)=>{var _;const y=g.internals.positionAbsolute,b=Kn(g),p=g.origin??s,x=h.x<y.x?Math.round(Math.abs(y.x-h.x)):0,w=h.y<y.y?Math.round(Math.abs(y.y-h.y)):0,E=Math.max(b.width,Math.round(h.width)),N=Math.max(b.height,Math.round(h.height)),M=(E-b.width)*p[0],O=(N-b.height)*p[1];(x>0||w>0||M||O)&&(o.push({id:m,type:"position",position:{x:g.position.x-x+M,y:g.position.y-w+O}}),(_=u.get(m))==null||_.forEach(C=>{n.some(k=>k.id===C.id)||o.push({id:C.id,type:"position",position:{x:C.position.x+x,y:C.position.y+w}})})),(b.width<h.width||b.height<h.height||x||w)&&o.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:E+(x?p[0]*x-M:0),height:N+(w?p[1]*w-O:0)}})}),o}function Nw(n,a,u,s,o,c){const f=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const g=[],m=window.getComputedStyle(f),{m22:y}=new window.DOMMatrixReadOnly(m.transform),b=[];for(const p of n.values()){const x=a.get(p.id);if(!x)continue;if(x.hidden){a.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),h=!0;continue}const w=Rr(p.nodeElement),E=x.measured.width!==w.width||x.measured.height!==w.height;if(!!(w.width&&w.height&&(E||!x.internals.handleBounds||p.force))){const M=p.nodeElement.getBoundingClientRect(),O=La(x.extent)?x.extent:c;let{positionAbsolute:_}=x.internals;x.parentId&&x.extent==="parent"?_=Xh(_,w,a.get(x.parentId)):O&&(_=la(_,O,w));const C={...x,measured:w,internals:{...x.internals,positionAbsolute:_,handleBounds:{source:eg("source",p.nodeElement,M,y,x.id),target:eg("target",p.nodeElement,M,y,x.id)}}};a.set(x.id,C),x.parentId&&qr(C,a,u,{nodeOrigin:o}),h=!0,E&&(g.push({id:x.id,type:"dimensions",dimensions:w}),x.expandParent&&x.parentId&&b.push({id:x.id,parentId:x.parentId,rect:Ra(C,o)}))}}if(b.length>0){const p=Xr(b,a,u,o);g.push(...p)}return{changes:g,updatedInternals:h}}async function Cw({delta:n,panZoom:a,transform:u,translateExtent:s,width:o,height:c}){if(!a||!n.x&&!n.y)return Promise.resolve(!1);const f=await a.setViewportConstrained({x:u[0]+n.x,y:u[1]+n.y,zoom:u[2]},[[0,0],[o,c]],s),h=!!f&&(f.x!==u[0]||f.y!==u[1]||f.k!==u[2]);return Promise.resolve(h)}function dg(n,a,u,s,o,c){let f=o;const h=s.get(f)||new Map;s.set(f,h.set(u,a)),f=`${o}-${n}`;const g=s.get(f)||new Map;if(s.set(f,g.set(u,a)),c){f=`${o}-${n}-${c}`;const m=s.get(f)||new Map;s.set(f,m.set(u,a))}}function hg(n,a,u){n.clear(),a.clear();for(const s of u){const{source:o,target:c,sourceHandle:f=null,targetHandle:h=null}=s,g={edgeId:s.id,source:o,target:c,sourceHandle:f,targetHandle:h},m=`${o}-${f}--${c}-${h}`,y=`${c}-${h}--${o}-${f}`;dg("source",g,y,n,o,f),dg("target",g,m,n,c,h),a.set(s.id,s)}}function gg(n,a){if(!n.parentId)return!1;const u=a.get(n.parentId);return u?u.selected?!0:gg(u,a):!1}function mg(n,a,u){var o;let s=n;do{if((o=s==null?void 0:s.matches)!=null&&o.call(s,a))return!0;if(s===u)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function Mw(n,a,u,s){const o=new Map;for(const[c,f]of n)if((f.selected||f.id===s)&&(!f.parentId||!gg(f,n))&&(f.draggable||a&&typeof f.draggable>"u")){const h=n.get(c);h&&o.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:u.x-h.internals.positionAbsolute.x,y:u.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 o}function $r({nodeId:n,dragItems:a,nodeLookup:u,dragging:s=!0}){var f,h,g;const o=[];for(const[m,y]of a){const b=(f=u.get(m))==null?void 0:f.internals.userNode;b&&o.push({...b,position:y.position,dragging:s})}if(!n)return[o[0],o];const c=(h=u.get(n))==null?void 0:h.internals.userNode;return[c?{...c,position:((g=a.get(n))==null?void 0:g.position)||c.position,dragging:s}:o[0],o]}function Tw({dragItems:n,snapGrid:a,x:u,y:s}){const o=n.values().next().value;if(!o)return null;const c={x:u-o.distance.x,y:s-o.distance.y},f=Zi(c,a);return{x:f.x-c.x,y:f.y-c.y}}function Aw({onNodeMouseDown:n,getStoreItems:a,onDragStart:u,onDrag:s,onDragStop:o}){let c={x:null,y:null},f=0,h=new Map,g=!1,m={x:0,y:0},y=null,b=!1,p=null,x=!1,w=!1,E=null;function N({noDragClassName:O,handleSelector:_,domNode:C,isSelectable:k,nodeId:H,nodeClickDistance:U=0}){p=Ft(C);function Q({x:V,y:Y}){const{nodeLookup:j,nodeExtent:B,snapGrid:z,snapToGrid:L,nodeOrigin:G,onNodeDrag:X,onSelectionDrag:A,onError:$,updateNodePositions:F}=a();c={x:V,y:Y};let le=!1;const ee=h.size>1,de=ee&&B?kr($i(h)):null,fe=ee&&L?Tw({dragItems:h,snapGrid:z,x:V,y:Y}):null;for(const[he,ie]of h){if(!j.has(he))continue;let ge={x:V-ie.distance.x,y:Y-ie.distance.y};L&&(ge=fe?{x:Math.round(ge.x+fe.x),y:Math.round(ge.y+fe.y)}:Zi(ge,z));let me=null;if(ee&&B&&!ie.extent&&de){const{positionAbsolute:pe}=ie.internals,we=pe.x-de.x+B[0][0],Ae=pe.x+ie.measured.width-de.x2+B[1][0],je=pe.y-de.y+B[0][1],Ne=pe.y+ie.measured.height-de.y2+B[1][1];me=[[we,je],[Ae,Ne]]}const{position:be,positionAbsolute:xe}=qh({nodeId:he,nextPosition:ge,nodeLookup:j,nodeExtent:me||B,nodeOrigin:G,onError:$});le=le||ie.position.x!==be.x||ie.position.y!==be.y,ie.position=be,ie.internals.positionAbsolute=xe}if(w=w||le,!!le&&(F(h,!0),E&&(s||X||!H&&A))){const[he,ie]=$r({nodeId:H,dragItems:h,nodeLookup:j});s==null||s(E,h,he,ie),X==null||X(E,he,ie),H||A==null||A(E,ie)}}async function q(){if(!y)return;const{transform:V,panBy:Y,autoPanSpeed:j,autoPanOnNodeDrag:B}=a();if(!B){g=!1,cancelAnimationFrame(f);return}const[z,L]=Gh(m,y,j);(z!==0||L!==0)&&(c.x=(c.x??0)-z/V[2],c.y=(c.y??0)-L/V[2],await Y({x:z,y:L})&&Q(c)),f=requestAnimationFrame(q)}function te(V){var ee;const{nodeLookup:Y,multiSelectionActive:j,nodesDraggable:B,transform:z,snapGrid:L,snapToGrid:G,selectNodesOnDrag:X,onNodeDragStart:A,onSelectionDragStart:$,unselectNodesAndEdges:F}=a();b=!0,(!X||!k)&&!j&&H&&((ee=Y.get(H))!=null&&ee.selected||F()),k&&X&&H&&(n==null||n(H));const le=Ji(V.sourceEvent,{transform:z,snapGrid:L,snapToGrid:G,containerBounds:y});if(c=le,h=Mw(Y,B,le,H),h.size>0&&(u||A||!H&&$)){const[de,fe]=$r({nodeId:H,dragItems:h,nodeLookup:Y});u==null||u(V.sourceEvent,h,de,fe),A==null||A(V.sourceEvent,de,fe),H||$==null||$(V.sourceEvent,fe)}}const J=ah().clickDistance(U).on("start",V=>{const{domNode:Y,nodeDragThreshold:j,transform:B,snapGrid:z,snapToGrid:L}=a();y=(Y==null?void 0:Y.getBoundingClientRect())||null,x=!1,w=!1,E=V.sourceEvent,j===0&&te(V),c=Ji(V.sourceEvent,{transform:B,snapGrid:z,snapToGrid:L,containerBounds:y}),m=_n(V.sourceEvent,y)}).on("drag",V=>{const{autoPanOnNodeDrag:Y,transform:j,snapGrid:B,snapToGrid:z,nodeDragThreshold:L,nodeLookup:G}=a(),X=Ji(V.sourceEvent,{transform:j,snapGrid:B,snapToGrid:z,containerBounds:y});if(E=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||H&&!G.has(H))&&(x=!0),!x){if(!g&&Y&&b&&(g=!0,q()),!b){const A=_n(V.sourceEvent,y),$=A.x-m.x,F=A.y-m.y;Math.sqrt($*$+F*F)>L&&te(V)}(c.x!==X.xSnapped||c.y!==X.ySnapped)&&h&&b&&(m=_n(V.sourceEvent,y),Q(X))}}).on("end",V=>{if(!(!b||x)&&(g=!1,b=!1,cancelAnimationFrame(f),h.size>0)){const{nodeLookup:Y,updateNodePositions:j,onNodeDragStop:B,onSelectionDragStop:z}=a();if(w&&(j(h,!1),w=!1),o||B||!H&&z){const[L,G]=$r({nodeId:H,dragItems:h,nodeLookup:Y,dragging:!1});o==null||o(V.sourceEvent,h,L,G),B==null||B(V.sourceEvent,L,G),H||z==null||z(V.sourceEvent,G)}}}).filter(V=>{const Y=V.target;return!V.button&&(!O||!mg(Y,`.${O}`,C))&&(!_||mg(Y,_,C))});p.call(J)}function M(){p==null||p.on(".drag",null)}return{update:N,destroy:M}}function jw(n,a,u){const s=[],o={x:n.x-u,y:n.y-u,width:u*2,height:u*2};for(const c of a.values())Gi(o,Ra(c))>0&&s.push(c);return s}const Ow=250;function zw(n,a,u,s){var h,g;let o=[],c=1/0;const f=jw(n,u,a+Ow);for(const m of f){const y=[...((h=m.internals.handleBounds)==null?void 0:h.source)??[],...((g=m.internals.handleBounds)==null?void 0:g.target)??[]];for(const b of y){if(s.nodeId===b.nodeId&&s.type===b.type&&s.id===b.id)continue;const{x:p,y:x}=Wi(m,b,b.position,!0),w=Math.sqrt(Math.pow(p-n.x,2)+Math.pow(x-n.y,2));w>a||(w<c?(o=[{...b,x:p,y:x}],c=w):w===c&&o.push({...b,x:p,y:x}))}}if(!o.length)return null;if(o.length>1){const m=s.type==="source"?"target":"source";return o.find(y=>y.type===m)??o[0]}return o[0]}function pg(n,a,u,s,o,c=!1){var m,y,b;const f=s.get(n);if(!f)return null;const h=o==="strict"?(m=f.internals.handleBounds)==null?void 0:m[a]:[...((y=f.internals.handleBounds)==null?void 0:y.source)??[],...((b=f.internals.handleBounds)==null?void 0:b.target)??[]],g=(u?h==null?void 0:h.find(p=>p.id===u):h==null?void 0:h[0])??null;return g&&c?{...g,...Wi(f,g,g.position,!0)}:g}function yg(n,a){return n||(a!=null&&a.classList.contains("target")?"target":a!=null&&a.classList.contains("source")?"source":null)}function Dw(n,a){let u=null;return a?u=!0:n&&!a&&(u=!1),u}const vg=()=>!0;function kw(n,{connectionMode:a,connectionRadius:u,handleId:s,nodeId:o,edgeUpdaterType:c,isTarget:f,domNode:h,nodeLookup:g,lib:m,autoPanOnConnect:y,flowId:b,panBy:p,cancelConnection:x,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:M=vg,onReconnectEnd:O,updateConnection:_,getTransform:C,getFromHandle:k,autoPanSpeed:H,dragThreshold:U=1,handleDomNode:Q}){const q=Fh(n.target);let te=0,J;const{x:V,y:Y}=_n(n),j=yg(c,Q),B=h==null?void 0:h.getBoundingClientRect();let z=!1;if(!B||!j)return;const L=pg(o,j,s,g,a);if(!L)return;let G=_n(n,B),X=!1,A=null,$=!1,F=null;function le(){if(!y||!B)return;const[be,xe]=Gh(G,B,H);p({x:be,y:xe}),te=requestAnimationFrame(le)}const ee={...L,nodeId:o,type:j,position:L.position},de=g.get(o);let he={inProgress:!0,isValid:null,from:Wi(de,ee,ve.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:de,to:G,toHandle:null,toPosition:Uh[ee.position],toNode:null};function ie(){z=!0,_(he),w==null||w(n,{nodeId:o,handleId:s,handleType:j})}U===0&&ie();function ge(be){if(!z){const{x:Ae,y:je}=_n(be),Ne=Ae-V,Le=je-Y;if(!(Ne*Ne+Le*Le>U*U))return;ie()}if(!k()||!ee){me(be);return}const xe=C();G=_n(be,B),J=zw(Ki(G,xe,!1,[1,1]),u,g,ee),X||(le(),X=!0);const pe=bg(be,{handle:J,connectionMode:a,fromNodeId:o,fromHandleId:s,fromType:f?"target":"source",isValidConnection:M,doc:q,lib:m,flowId:b,nodeLookup:g});F=pe.handleDomNode,A=pe.connection,$=Dw(!!J,pe.isValid);const we={...he,isValid:$,to:pe.toHandle&&$?Cs({x:pe.toHandle.x,y:pe.toHandle.y},xe):G,toHandle:pe.toHandle,toPosition:$&&pe.toHandle?pe.toHandle.position:Uh[ee.position],toNode:pe.toHandle?g.get(pe.toHandle.nodeId):null};$&&J&&he.toHandle&&we.toHandle&&he.toHandle.type===we.toHandle.type&&he.toHandle.nodeId===we.toHandle.nodeId&&he.toHandle.id===we.toHandle.id&&he.to.x===we.to.x&&he.to.y===we.to.y||(_(we),he=we)}function me(be){if(!("touches"in be&&be.touches.length>0)){if(z){(J||F)&&A&&$&&(E==null||E(A));const{inProgress:xe,...pe}=he,we={...pe,toPosition:he.toHandle?he.toPosition:null};N==null||N(be,we),c&&(O==null||O(be,we))}x(),cancelAnimationFrame(te),X=!1,$=!1,A=null,F=null,q.removeEventListener("mousemove",ge),q.removeEventListener("mouseup",me),q.removeEventListener("touchmove",ge),q.removeEventListener("touchend",me)}}q.addEventListener("mousemove",ge),q.addEventListener("mouseup",me),q.addEventListener("touchmove",ge),q.addEventListener("touchend",me)}function bg(n,{handle:a,connectionMode:u,fromNodeId:s,fromHandleId:o,fromType:c,doc:f,lib:h,flowId:g,isValidConnection:m=vg,nodeLookup:y}){const b=c==="target",p=a?f.querySelector(`.${h}-flow__handle[data-id="${g}-${a==null?void 0:a.nodeId}-${a==null?void 0:a.id}-${a==null?void 0:a.type}"]`):null,{x,y:w}=_n(n),E=f.elementFromPoint(x,w),N=E!=null&&E.classList.contains(`${h}-flow__handle`)?E:p,M={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const O=yg(void 0,N),_=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),k=N.classList.contains("connectable"),H=N.classList.contains("connectableend");if(!_||!O)return M;const U={source:b?_:s,sourceHandle:b?C:o,target:b?s:_,targetHandle:b?o:C};M.connection=U;const q=k&&H&&(u===Da.Strict?b&&O==="source"||!b&&O==="target":_!==s||C!==o);M.isValid=q&&m(U),M.toHandle=pg(_,O,C,y,u,!0)}return M}const Gr={onPointerDown:kw,isValid:bg};function Rw({domNode:n,panZoom:a,getTransform:u,getViewScale:s}){const o=Ft(n);function c({translateExtent:h,width:g,height:m,zoomStep:y=1,pannable:b=!0,zoomable:p=!0,inversePan:x=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!a)return;const C=u(),k=_.sourceEvent.ctrlKey&&Qi()?10:1,H=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*y,U=C[2]*Math.pow(2,H*k);a.scaleTo(U)};let E=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(E=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},M=_=>{const C=u();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!a)return;const k=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],H=[k[0]-E[0],k[1]-E[1]];E=k;const U=s()*Math.max(C[2],Math.log(C[2]))*(x?-1:1),Q={x:C[0]-H[0]*U,y:C[1]-H[1]*U},q=[[0,0],[g,m]];a.setViewportConstrained({x:Q.x,y:Q.y,zoom:C[2]},q,h)},O=kh().on("start",N).on("zoom",b?M:null).on("zoom.wheel",p?w:null);o.call(O,{})}function f(){o.on("zoom",null)}return{update:c,destroy:f,pointer:xn}}const Hw=(n,a)=>n.x!==a.x||n.y!==a.y||n.zoom!==a.k,As=n=>({x:n.x,y:n.y,zoom:n.k}),Zr=({x:n,y:a,zoom:u})=>ws.translate(n,a).scale(u),Ua=(n,a)=>n.target.closest(`.${a}`),xg=(n,a)=>a===2&&Array.isArray(n)&&n.includes(2),Lw=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,Kr=(n,a=0,u=Lw,s=()=>{})=>{const o=typeof a=="number"&&a>0;return o||s(),o?n.transition().duration(a).ease(u).on("end",s):n},wg=n=>{const a=n.ctrlKey&&Qi()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*a};function Uw({zoomPanValues:n,noWheelClassName:a,d3Selection:u,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:f,onPanZoomStart:h,onPanZoom:g,onPanZoomEnd:m}){return y=>{if(Ua(y,a))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const b=u.property("__zoom").k||1;if(y.ctrlKey&&f){const N=xn(y),M=wg(y),O=b*Math.pow(2,M);s.scaleTo(u,O,N,y);return}const p=y.deltaMode===1?20:1;let x=o===na.Vertical?0:y.deltaX*p,w=o===na.Horizontal?0:y.deltaY*p;!Qi()&&y.shiftKey&&o!==na.Vertical&&(x=y.deltaY*p,w=0),s.translateBy(u,-(x/b)*c,-(w/b)*c,{internal:!0});const E=As(u.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling||(n.isPanScrolling=!0,h==null||h(y,E)),n.isPanScrolling&&(g==null||g(y,E),n.panScrollTimeout=setTimeout(()=>{m==null||m(y,E),n.isPanScrolling=!1},150))}}function Bw({noWheelClassName:n,preventScrolling:a,d3ZoomHandler:u}){return function(s,o){const c=s.type==="wheel",f=!a&&c&&!s.ctrlKey,h=Ua(s,n);if(s.ctrlKey&&c&&h&&s.preventDefault(),f||h)return null;s.preventDefault(),u.call(this,s,o)}}function Vw({zoomPanValues:n,onDraggingChange:a,onPanZoomStart:u}){return s=>{var c,f,h;if((c=s.sourceEvent)!=null&&c.internal)return;const o=As(s.transform);n.mouseButton=((f=s.sourceEvent)==null?void 0:f.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=o,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&a(!0),u&&(u==null||u(s.sourceEvent,o))}}function Yw({zoomPanValues:n,panOnDrag:a,onPaneContextMenu:u,onTransformChange:s,onPanZoom:o}){return c=>{var f,h;n.usedRightMouseButton=!!(u&&xg(a,n.mouseButton??0)),(f=c.sourceEvent)!=null&&f.sync||s([c.transform.x,c.transform.y,c.transform.k]),o&&!((h=c.sourceEvent)!=null&&h.internal)&&(o==null||o(c.sourceEvent,As(c.transform)))}}function qw({zoomPanValues:n,panOnDrag:a,panOnScroll:u,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:c}){return f=>{var h;if(!((h=f.sourceEvent)!=null&&h.internal)&&(n.isZoomingOrPanning=!1,c&&xg(a,n.mouseButton??0)&&!n.usedRightMouseButton&&f.sourceEvent&&c(f.sourceEvent),n.usedRightMouseButton=!1,s(!1),o&&Hw(n.prevViewport,f.transform))){const g=As(f.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{o==null||o(f.sourceEvent,g)},u?150:0)}}}function Xw({zoomActivationKeyPressed:n,zoomOnScroll:a,zoomOnPinch:u,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:f,noWheelClassName:h,noPanClassName:g,lib:m,connectionInProgress:y}){return b=>{var N;const p=n||a,x=u&&b.ctrlKey,w=b.type==="wheel";if(b.button===1&&b.type==="mousedown"&&(Ua(b,`${m}-flow__node`)||Ua(b,`${m}-flow__edge`)))return!0;if(!s&&!p&&!o&&!c&&!u||f||y&&!w||Ua(b,h)&&w||Ua(b,g)&&(!w||o&&w&&!n)||!u&&b.ctrlKey&&w)return!1;if(!u&&b.type==="touchstart"&&((N=b.touches)==null?void 0:N.length)>1)return b.preventDefault(),!1;if(!p&&!o&&!x&&w||!s&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(s)&&!s.includes(b.button)&&b.type==="mousedown")return!1;const E=Array.isArray(s)&&s.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||w)&&E}}function $w({domNode:n,minZoom:a,maxZoom:u,paneClickDistance:s,translateExtent:o,viewport:c,onPanZoom:f,onPanZoomStart:h,onPanZoomEnd:g,onDraggingChange:m}){const y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},b=n.getBoundingClientRect(),p=kh().clickDistance(!En(s)||s<0?0:s).scaleExtent([a,u]).translateExtent(o),x=Ft(n).call(p);_({x:c.x,y:c.y,zoom:ka(c.zoom,a,u)},[[0,0],[b.width,b.height]],o);const w=x.on("wheel.zoom"),E=x.on("dblclick.zoom");p.wheelDelta(wg);function N(V,Y){return x?new Promise(j=>{p==null||p.interpolate((Y==null?void 0:Y.interpolate)==="linear"?Ri:fs).transform(Kr(x,Y==null?void 0:Y.duration,Y==null?void 0:Y.ease,()=>j(!0)),V)}):Promise.resolve(!1)}function M({noWheelClassName:V,noPanClassName:Y,onPaneContextMenu:j,userSelectionActive:B,panOnScroll:z,panOnDrag:L,panOnScrollMode:G,panOnScrollSpeed:X,preventScrolling:A,zoomOnPinch:$,zoomOnScroll:F,zoomOnDoubleClick:le,zoomActivationKeyPressed:ee,lib:de,onTransformChange:fe,connectionInProgress:he}){B&&!y.isZoomingOrPanning&&O();const ge=z&&!ee&&!B?Uw({zoomPanValues:y,noWheelClassName:V,d3Selection:x,d3Zoom:p,panOnScrollMode:G,panOnScrollSpeed:X,zoomOnPinch:$,onPanZoomStart:h,onPanZoom:f,onPanZoomEnd:g}):Bw({noWheelClassName:V,preventScrolling:A,d3ZoomHandler:w});if(x.on("wheel.zoom",ge,{passive:!1}),!B){const be=Vw({zoomPanValues:y,onDraggingChange:m,onPanZoomStart:h});p.on("start",be);const xe=Yw({zoomPanValues:y,panOnDrag:L,onPaneContextMenu:!!j,onPanZoom:f,onTransformChange:fe});p.on("zoom",xe);const pe=qw({zoomPanValues:y,panOnDrag:L,panOnScroll:z,onPaneContextMenu:j,onPanZoomEnd:g,onDraggingChange:m});p.on("end",pe)}const me=Xw({zoomActivationKeyPressed:ee,panOnDrag:L,zoomOnScroll:F,panOnScroll:z,zoomOnDoubleClick:le,zoomOnPinch:$,userSelectionActive:B,noPanClassName:Y,noWheelClassName:V,lib:de,connectionInProgress:he});p.filter(me),le?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function O(){p.on("zoom",null)}async function _(V,Y,j){const B=Zr(V),z=p==null?void 0:p.constrain()(B,Y,j);return z&&await N(z),new Promise(L=>L(z))}async function C(V,Y){const j=Zr(V);return await N(j,Y),new Promise(B=>B(j))}function k(V){if(x){const Y=Zr(V),j=x.property("__zoom");(j.k!==V.zoom||j.x!==V.x||j.y!==V.y)&&(p==null||p.transform(x,Y,null,{sync:!0}))}}function H(){const V=x?zh(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function U(V,Y){return x?new Promise(j=>{p==null||p.interpolate((Y==null?void 0:Y.interpolate)==="linear"?Ri:fs).scaleTo(Kr(x,Y==null?void 0:Y.duration,Y==null?void 0:Y.ease,()=>j(!0)),V)}):Promise.resolve(!1)}function Q(V,Y){return x?new Promise(j=>{p==null||p.interpolate((Y==null?void 0:Y.interpolate)==="linear"?Ri:fs).scaleBy(Kr(x,Y==null?void 0:Y.duration,Y==null?void 0:Y.ease,()=>j(!0)),V)}):Promise.resolve(!1)}function q(V){p==null||p.scaleExtent(V)}function te(V){p==null||p.translateExtent(V)}function J(V){const Y=!En(V)||V<0?0:V;p==null||p.clickDistance(Y)}return{update:M,destroy:O,setViewport:C,setViewportConstrained:_,getViewport:H,scaleTo:U,scaleBy:Q,setScaleExtent:q,setTranslateExtent:te,syncViewport:k,setClickDistance:J}}var aa;(function(n){n.Line="line",n.Handle="handle"})(aa||(aa={}));const Gw=["top-left","top-right","bottom-left","bottom-right"],Zw=["top","right","bottom","left"];function Kw({width:n,prevWidth:a,height:u,prevHeight:s,affectsX:o,affectsY:c}){const f=n-a,h=u-s,g=[f>0?1:f<0?-1:0,h>0?1:h<0?-1:0];return f&&o&&(g[0]=g[0]*-1),h&&c&&(g[1]=g[1]*-1),g}function Qw(n){const a=n.includes("right")||n.includes("left"),u=n.includes("bottom")||n.includes("top"),s=n.includes("left"),o=n.includes("top");return{isHorizontal:a,isVertical:u,affectsX:s,affectsY:o}}function yl(n,a){return Math.max(0,a-n)}function vl(n,a){return Math.max(0,n-a)}function js(n,a,u){return Math.max(0,a-n,n-u)}function Sg(n,a){return n?!a:a}function Jw(n,a,u,s,o,c,f,h){let{affectsX:g,affectsY:m}=a;const{isHorizontal:y,isVertical:b}=a,p=y&&b,{xSnapped:x,ySnapped:w}=u,{minWidth:E,maxWidth:N,minHeight:M,maxHeight:O}=s,{x:_,y:C,width:k,height:H,aspectRatio:U}=n;let Q=Math.floor(y?x-n.pointerX:0),q=Math.floor(b?w-n.pointerY:0);const te=k+(g?-Q:Q),J=H+(m?-q:q),V=-c[0]*k,Y=-c[1]*H;let j=js(te,E,N),B=js(J,M,O);if(f){let G=0,X=0;g&&Q<0?G=yl(_+Q+V,f[0][0]):!g&&Q>0&&(G=vl(_+te+V,f[1][0])),m&&q<0?X=yl(C+q+Y,f[0][1]):!m&&q>0&&(X=vl(C+J+Y,f[1][1])),j=Math.max(j,G),B=Math.max(B,X)}if(h){let G=0,X=0;g&&Q>0?G=vl(_+Q,h[0][0]):!g&&Q<0&&(G=yl(_+te,h[1][0])),m&&q>0?X=vl(C+q,h[0][1]):!m&&q<0&&(X=yl(C+J,h[1][1])),j=Math.max(j,G),B=Math.max(B,X)}if(o){if(y){const G=js(te/U,M,O)*U;if(j=Math.max(j,G),f){let X=0;!g&&!m||g&&!m&&p?X=vl(C+Y+te/U,f[1][1])*U:X=yl(C+Y+(g?Q:-Q)/U,f[0][1])*U,j=Math.max(j,X)}if(h){let X=0;!g&&!m||g&&!m&&p?X=yl(C+te/U,h[1][1])*U:X=vl(C+(g?Q:-Q)/U,h[0][1])*U,j=Math.max(j,X)}}if(b){const G=js(J*U,E,N)/U;if(B=Math.max(B,G),f){let X=0;!g&&!m||m&&!g&&p?X=vl(_+J*U+V,f[1][0])/U:X=yl(_+(m?q:-q)*U+V,f[0][0])/U,B=Math.max(B,X)}if(h){let X=0;!g&&!m||m&&!g&&p?X=yl(_+J*U,h[1][0])/U:X=vl(_+(m?q:-q)*U,h[0][0])/U,B=Math.max(B,X)}}}q=q+(q<0?B:-B),Q=Q+(Q<0?j:-j),o&&(p?te>J*U?q=(Sg(g,m)?-Q:Q)/U:Q=(Sg(g,m)?-q:q)*U:y?(q=Q/U,m=g):(Q=q*U,g=m));const z=g?_+Q:_,L=m?C+q:C;return{width:k+(g?-Q:Q),height:H+(m?-q:q),x:c[0]*Q*(g?-1:1)+z,y:c[1]*q*(m?-1:1)+L}}const Eg={width:0,height:0,x:0,y:0},Ww={...Eg,pointerX:0,pointerY:0,aspectRatio:1};function Fw(n){return[[0,0],[n.measured.width,n.measured.height]]}function Iw(n,a,u){const s=a.position.x+n.position.x,o=a.position.y+n.position.y,c=n.measured.width??0,f=n.measured.height??0,h=u[0]*c,g=u[1]*f;return[[s-h,o-g],[s+c-h,o+f-g]]}function Pw({domNode:n,nodeId:a,getStoreItems:u,onChange:s,onEnd:o}){const c=Ft(n);function f({controlPosition:g,boundaries:m,keepAspectRatio:y,resizeDirection:b,onResizeStart:p,onResize:x,onResizeEnd:w,shouldResize:E}){let N={...Eg},M={...Ww};const O=Qw(g);let _,C=null,k=[],H,U,Q,q=!1;const te=ah().on("start",J=>{const{nodeLookup:V,transform:Y,snapGrid:j,snapToGrid:B,nodeOrigin:z,paneDomNode:L}=u();if(_=V.get(a),!_)return;C=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:G,ySnapped:X}=Ji(J.sourceEvent,{transform:Y,snapGrid:j,snapToGrid:B,containerBounds:C});N={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},M={...N,pointerX:G,pointerY:X,aspectRatio:N.width/N.height},H=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(H=V.get(_.parentId),U=H&&_.extent==="parent"?Fw(H):void 0),k=[],Q=void 0;for(const[A,$]of V)if($.parentId===a&&(k.push({id:A,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const F=Iw($,_,$.origin??z);Q?Q=[[Math.min(F[0][0],Q[0][0]),Math.min(F[0][1],Q[0][1])],[Math.max(F[1][0],Q[1][0]),Math.max(F[1][1],Q[1][1])]]:Q=F}p==null||p(J,{...N})}).on("drag",J=>{const{transform:V,snapGrid:Y,snapToGrid:j,nodeOrigin:B}=u(),z=Ji(J.sourceEvent,{transform:V,snapGrid:Y,snapToGrid:j,containerBounds:C}),L=[];if(!_)return;const{x:G,y:X,width:A,height:$}=N,F={},le=_.origin??B,{width:ee,height:de,x:fe,y:he}=Jw(M,O,z,m,y,le,U,Q),ie=ee!==A,ge=de!==$,me=fe!==G&&ie,be=he!==X&≥if(!me&&!be&&!ie&&!ge)return;if((me||be||le[0]===1||le[1]===1)&&(F.x=me?fe:N.x,F.y=be?he:N.y,N.x=F.x,N.y=F.y,k.length>0)){const Ae=fe-G,je=he-X;for(const Ne of k)Ne.position={x:Ne.position.x-Ae+le[0]*(ee-A),y:Ne.position.y-je+le[1]*(de-$)},L.push(Ne)}if((ie||ge)&&(F.width=ie&&(!b||b==="horizontal")?ee:N.width,F.height=ge&&(!b||b==="vertical")?de:N.height,N.width=F.width,N.height=F.height),H&&_.expandParent){const Ae=le[0]*(F.width??0);F.x&&F.x<Ae&&(N.x=Ae,M.x=M.x-(F.x-Ae));const je=le[1]*(F.height??0);F.y&&F.y<je&&(N.y=je,M.y=M.y-(F.y-je))}const xe=Kw({width:N.width,prevWidth:A,height:N.height,prevHeight:$,affectsX:O.affectsX,affectsY:O.affectsY}),pe={...N,direction:xe};(E==null?void 0:E(J,pe))!==!1&&(q=!0,x==null||x(J,pe),s(F,L))}).on("end",J=>{q&&(w==null||w(J,{...N}),o==null||o({...N}),q=!1)});c.call(te)}function h(){c.on(".drag",null)}return{update:f,destroy:h}}var Qr={exports:{}},Jr={},Wr={exports:{}},Fr={};/**
|
|
50
|
-
* @license React
|
|
51
|
-
* use-sync-external-store-shim.production.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var _g;function eS(){if(_g)return Fr;_g=1;var n=Mi();function a(b,p){return b===p&&(b!==0||1/b===1/p)||b!==b&&p!==p}var u=typeof Object.is=="function"?Object.is:a,s=n.useState,o=n.useEffect,c=n.useLayoutEffect,f=n.useDebugValue;function h(b,p){var x=p(),w=s({inst:{value:x,getSnapshot:p}}),E=w[0].inst,N=w[1];return c(function(){E.value=x,E.getSnapshot=p,g(E)&&N({inst:E})},[b,x,p]),o(function(){return g(E)&&N({inst:E}),b(function(){g(E)&&N({inst:E})})},[b]),f(x),x}function g(b){var p=b.getSnapshot;b=b.value;try{var x=p();return!u(b,x)}catch{return!0}}function m(b,p){return p()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return Fr.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:y,Fr}var Ng;function tS(){return Ng||(Ng=1,Wr.exports=eS()),Wr.exports}/**
|
|
58
|
-
* @license React
|
|
59
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/var Cg;function nS(){if(Cg)return Jr;Cg=1;var n=Mi(),a=tS();function u(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var s=typeof Object.is=="function"?Object.is:u,o=a.useSyncExternalStore,c=n.useRef,f=n.useEffect,h=n.useMemo,g=n.useDebugValue;return Jr.useSyncExternalStoreWithSelector=function(m,y,b,p,x){var w=c(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=h(function(){function M(H){if(!O){if(O=!0,_=H,H=p(H),x!==void 0&&E.hasValue){var U=E.value;if(x(U,H))return C=U}return C=H}if(U=C,s(_,H))return U;var Q=p(H);return x!==void 0&&x(U,Q)?(_=H,U):(_=H,C=Q)}var O=!1,_,C,k=b===void 0?null:b;return[function(){return M(y())},k===null?void 0:function(){return M(k())}]},[y,b,p,x]);var N=o(m,w[0],w[1]);return f(function(){E.hasValue=!0,E.value=N},[N]),g(N),N},Jr}var Mg;function lS(){return Mg||(Mg=1,Qr.exports=nS()),Qr.exports}var aS=lS();const iS=Ci(aS),uS={},Tg=n=>{let a;const u=new Set,s=(y,b)=>{const p=typeof y=="function"?y(a):y;if(!Object.is(p,a)){const x=a;a=b??(typeof p!="object"||p===null)?p:Object.assign({},a,p),u.forEach(w=>w(a,x))}},o=()=>a,g={setState:s,getState:o,getInitialState:()=>m,subscribe:y=>(u.add(y),()=>u.delete(y)),destroy:()=>{(uS?"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."),u.clear()}},m=a=n(s,o,g);return g},sS=n=>n?Tg(n):Tg,{useDebugValue:oS}=ur,{useSyncExternalStoreWithSelector:rS}=iS,cS=n=>n;function Ag(n,a=cS,u){const s=rS(n.subscribe,n.getState,n.getServerState||n.getInitialState,a,u);return oS(s),s}const jg=(n,a)=>{const u=sS(n),s=(o,c=a)=>Ag(u,o,c);return Object.assign(s,u),s},fS=(n,a)=>n?jg(n,a):jg;function Fe(n,a){if(Object.is(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;if(n instanceof Map&&a instanceof Map){if(n.size!==a.size)return!1;for(const[s,o]of n)if(!Object.is(o,a.get(s)))return!1;return!0}if(n instanceof Set&&a instanceof Set){if(n.size!==a.size)return!1;for(const s of n)if(!a.has(s))return!1;return!0}const u=Object.keys(n);if(u.length!==Object.keys(a).length)return!1;for(const s of u)if(!Object.prototype.hasOwnProperty.call(a,s)||!Object.is(n[s],a[s]))return!1;return!0}var Fi=Hd();const Os=D.createContext(null),dS=Os.Provider,Og=Hn.error001();function Re(n,a){const u=D.useContext(Os);if(u===null)throw new Error(Og);return Ag(u,n,a)}function Ie(){const n=D.useContext(Os);if(n===null)throw new Error(Og);return D.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const zg={display:"none"},hS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Dg="react-flow__node-desc",kg="react-flow__edge-desc",gS="react-flow__aria-live",mS=n=>n.ariaLiveMessage,pS=n=>n.ariaLabelConfig;function yS({rfId:n}){const a=Re(mS);return v.jsx("div",{id:`${gS}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:hS,children:a})}function vS({rfId:n,disableKeyboardA11y:a}){const u=Re(pS);return v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${Dg}-${n}`,style:zg,children:a?u["node.a11yDescription.default"]:u["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${kg}-${n}`,style:zg,children:u["edge.a11yDescription.default"]}),!a&&v.jsx(yS,{rfId:n})]})}const bl=D.forwardRef(({position:n="top-left",children:a,className:u,style:s,...o},c)=>{const f=`${n}`.split("-");return v.jsx("div",{className:ct(["react-flow__panel",u,...f]),style:s,ref:c,...o,children:a})});bl.displayName="Panel";function bS({proOptions:n,position:a="bottom-right"}){return n!=null&&n.hideAttribution?null:v.jsx(bl,{position:a,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const xS=n=>{const a=[],u=[];for(const[,s]of n.nodeLookup)s.selected&&a.push(s.internals.userNode);for(const[,s]of n.edgeLookup)s.selected&&u.push(s);return{selectedNodes:a,selectedEdges:u}},zs=n=>n.id;function wS(n,a){return Fe(n.selectedNodes.map(zs),a.selectedNodes.map(zs))&&Fe(n.selectedEdges.map(zs),a.selectedEdges.map(zs))}function SS({onSelectionChange:n}){const a=Ie(),{selectedNodes:u,selectedEdges:s}=Re(xS,wS);return D.useEffect(()=>{const o={nodes:u,edges:s};n==null||n(o),a.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[u,s,n]),null}const ES=n=>!!n.onSelectionChangeHandlers;function _S({onSelectionChange:n}){const a=Re(ES);return n||a?v.jsx(SS,{onSelectionChange:n}):null}const Rg=[0,0],NS={x:0,y:0,zoom:1},Hg=[...["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","paneClickDistance","ariaLabelConfig"],"rfId"],CS=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,setPaneClickDistance:n.setPaneClickDistance}),Lg={translateExtent:Yi,nodeOrigin:Rg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function MS(n){const{setNodes:a,setEdges:u,setMinZoom:s,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:f,reset:h,setDefaultNodesAndEdges:g,setPaneClickDistance:m}=Re(CS,Fe),y=Ie();D.useEffect(()=>(g(n.defaultNodes,n.defaultEdges),()=>{b.current=Lg,h()}),[]);const b=D.useRef(Lg);return D.useEffect(()=>{for(const p of Hg){const x=n[p],w=b.current[p];x!==w&&(typeof n[p]>"u"||(p==="nodes"?a(x):p==="edges"?u(x):p==="minZoom"?s(x):p==="maxZoom"?o(x):p==="translateExtent"?c(x):p==="nodeExtent"?f(x):p==="paneClickDistance"?m(x):p==="ariaLabelConfig"?y.setState({ariaLabelConfig:rw(x)}):p==="fitView"?y.setState({fitViewQueued:x}):p==="fitViewOptions"?y.setState({fitViewOptions:x}):y.setState({[p]:x})))}b.current=n},Hg.map(p=>n[p])),null}function Ug(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function TS(n){var s;const[a,u]=D.useState(n==="system"?null:n);return D.useEffect(()=>{if(n!=="system"){u(n);return}const o=Ug(),c=()=>u(o!=null&&o.matches?"dark":"light");return c(),o==null||o.addEventListener("change",c),()=>{o==null||o.removeEventListener("change",c)}},[n]),a!==null?a:(s=Ug())!=null&&s.matches?"dark":"light"}const Bg=typeof document<"u"?document:null;function Ii(n=null,a={target:Bg,actInsideInputWithModifier:!0}){const[u,s]=D.useState(!1),o=D.useRef(!1),c=D.useRef(new Set([])),[f,h]=D.useMemo(()=>{if(n!==null){const m=(Array.isArray(n)?n:[n]).filter(b=>typeof b=="string").map(b=>b.replace("+",`
|
|
66
|
-
`).replace(`
|
|
67
|
-
|
|
68
|
-
`,`
|
|
69
|
-
+`).split(`
|
|
70
|
-
`)),y=m.reduce((b,p)=>b.concat(...p),[]);return[m,y]}return[[],[]]},[n]);return D.useEffect(()=>{const g=(a==null?void 0:a.target)??Bg,m=(a==null?void 0:a.actInsideInputWithModifier)??!0;if(n!==null){const y=x=>{var N,M;if(o.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!o.current||o.current&&!m)&&Ih(x))return!1;const E=Yg(x.code,h);if(c.current.add(x[E]),Vg(f,c.current,!1)){const O=((M=(N=x.composedPath)==null?void 0:N.call(x))==null?void 0:M[0])||x.target,_=(O==null?void 0:O.nodeName)==="BUTTON"||(O==null?void 0:O.nodeName)==="A";a.preventDefault!==!1&&(o.current||!_)&&x.preventDefault(),s(!0)}},b=x=>{const w=Yg(x.code,h);Vg(f,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(x[w]),x.key==="Meta"&&c.current.clear(),o.current=!1},p=()=>{c.current.clear(),s(!1)};return g==null||g.addEventListener("keydown",y),g==null||g.addEventListener("keyup",b),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{g==null||g.removeEventListener("keydown",y),g==null||g.removeEventListener("keyup",b),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[n,s]),u}function Vg(n,a,u){return n.filter(s=>u||s.length===a.size).some(s=>s.every(o=>a.has(o)))}function Yg(n,a){return a.includes(n)?"code":"key"}const AS=()=>{const n=Ie();return D.useMemo(()=>({zoomIn:a=>{const{panZoom:u}=n.getState();return u?u.scaleBy(1.2,{duration:a==null?void 0:a.duration}):Promise.resolve(!1)},zoomOut:a=>{const{panZoom:u}=n.getState();return u?u.scaleBy(1/1.2,{duration:a==null?void 0:a.duration}):Promise.resolve(!1)},zoomTo:(a,u)=>{const{panZoom:s}=n.getState();return s?s.scaleTo(a,{duration:u==null?void 0:u.duration}):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(a,u)=>{const{transform:[s,o,c],panZoom:f}=n.getState();return f?(await f.setViewport({x:a.x??s,y:a.y??o,zoom:a.zoom??c},u),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[a,u,s]=n.getState().transform;return{x:a,y:u,zoom:s}},setCenter:async(a,u,s)=>n.getState().setCenter(a,u,s),fitBounds:async(a,u)=>{const{width:s,height:o,minZoom:c,maxZoom:f,panZoom:h}=n.getState(),g=Ms(a,s,o,c,f,(u==null?void 0:u.padding)??.1);return h?(await h.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)):Promise.resolve(!1)},screenToFlowPosition:(a,u={})=>{const{transform:s,snapGrid:o,snapToGrid:c,domNode:f}=n.getState();if(!f)return a;const{x:h,y:g}=f.getBoundingClientRect(),m={x:a.x-h,y:a.y-g},y=u.snapGrid??o,b=u.snapToGrid??c;return Ki(m,s,b,y)},flowToScreenPosition:a=>{const{transform:u,domNode:s}=n.getState();if(!s)return a;const{x:o,y:c}=s.getBoundingClientRect(),f=Cs(a,u);return{x:f.x+o,y:f.y+c}}}),[])};function qg(n,a){const u=[],s=new Map,o=[];for(const c of n)if(c.type==="add"){o.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const f=s.get(c.id);f?f.push(c):s.set(c.id,[c])}for(const c of a){const f=s.get(c.id);if(!f){u.push(c);continue}if(f[0].type==="remove")continue;if(f[0].type==="replace"){u.push({...f[0].item});continue}const h={...c};for(const g of f)jS(g,h);u.push(h)}return o.length&&o.forEach(c=>{c.index!==void 0?u.splice(c.index,0,{...c.item}):u.push({...c.item})}),u}function jS(n,a){switch(n.type){case"select":{a.selected=n.selected;break}case"position":{typeof n.position<"u"&&(a.position=n.position),typeof n.dragging<"u"&&(a.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(a.measured??(a.measured={}),a.measured.width=n.dimensions.width,a.measured.height=n.dimensions.height,n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(a.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(a.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(a.resizing=n.resizing);break}}}function Xg(n,a){return qg(n,a)}function $g(n,a){return qg(n,a)}function ia(n,a){return{id:n,type:"select",selected:a}}function Ba(n,a=new Set,u=!1){const s=[];for(const[o,c]of n){const f=a.has(o);!(c.selected===void 0&&!f)&&c.selected!==f&&(u&&(c.selected=f),s.push(ia(c.id,f)))}return s}function Gg({items:n=[],lookup:a}){var o;const u=[],s=new Map(n.map(c=>[c.id,c]));for(const[c,f]of n.entries()){const h=a.get(f.id),g=((o=h==null?void 0:h.internals)==null?void 0:o.userNode)??h;g!==void 0&&g!==f&&u.push({id:f.id,item:f,type:"replace"}),g===void 0&&u.push({item:f,type:"add",index:c})}for(const[c]of a)s.get(c)===void 0&&u.push({id:c,type:"remove"});return u}function Zg(n){return{id:n.id,type:"remove"}}const Kg=n=>ew(n),OS=n=>Vh(n);function Qg(n){return D.forwardRef(n)}const zS=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Jg(n){const[a,u]=D.useState(BigInt(0)),[s]=D.useState(()=>DS(()=>u(o=>o+BigInt(1))));return zS(()=>{const o=s.get();o.length&&(n(o),s.reset())},[a]),s}function DS(n){let a=[];return{get:()=>a,reset:()=>{a=[]},push:u=>{a.push(u),n()}}}const Wg=D.createContext(null);function kS({children:n}){const a=Ie(),u=D.useCallback(h=>{const{nodes:g=[],setNodes:m,hasDefaultNodes:y,onNodesChange:b,nodeLookup:p,fitViewQueued:x}=a.getState();let w=g;for(const N of h)w=typeof N=="function"?N(w):N;const E=Gg({items:w,lookup:p});y&&m(w),E.length>0?b==null||b(E):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:M,setNodes:O}=a.getState();N&&O(M)})},[]),s=Jg(u),o=D.useCallback(h=>{const{edges:g=[],setEdges:m,hasDefaultEdges:y,onEdgesChange:b,edgeLookup:p}=a.getState();let x=g;for(const w of h)x=typeof w=="function"?w(x):w;y?m(x):b&&b(Gg({items:x,lookup:p}))},[]),c=Jg(o),f=D.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return v.jsx(Wg.Provider,{value:f,children:n})}function RS(){const n=D.useContext(Wg);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const HS=n=>!!n.panZoom;function Va(){const n=AS(),a=Ie(),u=RS(),s=Re(HS),o=D.useMemo(()=>{const c=b=>a.getState().nodeLookup.get(b),f=b=>{u.nodeQueue.push(b)},h=b=>{u.edgeQueue.push(b)},g=b=>{var M,O;const{nodeLookup:p,nodeOrigin:x}=a.getState(),w=Kg(b)?b:p.get(b.id),E=w.parentId?Jh(w.position,w.measured,w.parentId,p,x):w.position,N={...w,position:E,width:((M=w.measured)==null?void 0:M.width)??w.width,height:((O=w.measured)==null?void 0:O.height)??w.height};return Ra(N)},m=(b,p,x={replace:!1})=>{f(w=>w.map(E=>{if(E.id===b){const N=typeof p=="function"?p(E):p;return x.replace&&Kg(N)?N:{...E,...N}}return E}))},y=(b,p,x={replace:!1})=>{h(w=>w.map(E=>{if(E.id===b){const N=typeof p=="function"?p(E):p;return x.replace&&OS(N)?N:{...E,...N}}return E}))};return{getNodes:()=>a.getState().nodes.map(b=>({...b})),getNode:b=>{var p;return(p=c(b))==null?void 0:p.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:b=[]}=a.getState();return b.map(p=>({...p}))},getEdge:b=>a.getState().edgeLookup.get(b),setNodes:f,setEdges:h,addNodes:b=>{const p=Array.isArray(b)?b:[b];u.nodeQueue.push(x=>[...x,...p])},addEdges:b=>{const p=Array.isArray(b)?b:[b];u.edgeQueue.push(x=>[...x,...p])},toObject:()=>{const{nodes:b=[],edges:p=[],transform:x}=a.getState(),[w,E,N]=x;return{nodes:b.map(M=>({...M})),edges:p.map(M=>({...M})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:b=[],edges:p=[]})=>{const{nodes:x,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:M,triggerEdgeChanges:O,onDelete:_,onBeforeDelete:C}=a.getState(),{nodes:k,edges:H}=await aw({nodesToRemove:b,edgesToRemove:p,nodes:x,edges:w,onBeforeDelete:C}),U=H.length>0,Q=k.length>0;if(U){const q=H.map(Zg);N==null||N(H),O(q)}if(Q){const q=k.map(Zg);E==null||E(k),M(q)}return(Q||U)&&(_==null||_({nodes:k,edges:H})),{deletedNodes:k,deletedEdges:H}},getIntersectingNodes:(b,p=!0,x)=>{const w=Kh(b),E=w?b:g(b),N=x!==void 0;return E?(x||a.getState().nodes).filter(M=>{const O=a.getState().nodeLookup.get(M.id);if(O&&!w&&(M.id===b.id||!O.internals.positionAbsolute))return!1;const _=Ra(N?M:O),C=Gi(_,E);return p&&C>0||C>=_.width*_.height||C>=E.width*E.height}):[]},isNodeIntersecting:(b,p,x=!0)=>{const E=Kh(b)?b:g(b);if(!E)return!1;const N=Gi(E,p);return x&&N>0||N>=p.width*p.height||N>=E.width*E.height},updateNode:m,updateNodeData:(b,p,x={replace:!1})=>{m(b,w=>{const E=typeof p=="function"?p(w):p;return x.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},x)},updateEdge:y,updateEdgeData:(b,p,x={replace:!1})=>{y(b,w=>{const E=typeof p=="function"?p(w):p;return x.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},x)},getNodesBounds:b=>{const{nodeLookup:p,nodeOrigin:x}=a.getState();return Yh(b,{nodeLookup:p,nodeOrigin:x})},getHandleConnections:({type:b,id:p,nodeId:x})=>{var w;return Array.from(((w=a.getState().connectionLookup.get(`${x}-${b}${p?`-${p}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:b,handleId:p,nodeId:x})=>{var w;return Array.from(((w=a.getState().connectionLookup.get(`${x}${b?p?`-${b}-${p}`:`-${b}`:""}`))==null?void 0:w.values())??[])},fitView:async b=>{const p=a.getState().fitViewResolver??ow();return a.setState({fitViewQueued:!0,fitViewOptions:b,fitViewResolver:p}),u.nodeQueue.push(x=>[...x]),p.promise}}},[]);return D.useMemo(()=>({...o,...n,viewportInitialized:s}),[s])}const Fg=n=>n.selected,LS=typeof window<"u"?window:void 0;function US({deleteKeyCode:n,multiSelectionKeyCode:a}){const u=Ie(),{deleteElements:s}=Va(),o=Ii(n,{actInsideInputWithModifier:!1}),c=Ii(a,{target:LS});D.useEffect(()=>{if(o){const{edges:f,nodes:h}=u.getState();s({nodes:h.filter(Fg),edges:f.filter(Fg)}),u.setState({nodesSelectionActive:!1})}},[o]),D.useEffect(()=>{u.setState({multiSelectionActive:c})},[c])}function BS(n){const a=Ie();D.useEffect(()=>{const u=()=>{var o,c,f,h;if(!n.current||!(((c=(o=n.current).checkVisibility)==null?void 0:c.call(o))??!0))return!1;const s=Rr(n.current);(s.height===0||s.width===0)&&((h=(f=a.getState()).onError)==null||h.call(f,"004",Hn.error004())),a.setState({width:s.width||500,height:s.height||500})};if(n.current){u(),window.addEventListener("resize",u);const s=new ResizeObserver(()=>u());return s.observe(n.current),()=>{window.removeEventListener("resize",u),s&&n.current&&s.unobserve(n.current)}}},[])}const Ds={position:"absolute",width:"100%",height:"100%",top:0,left:0},VS=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function YS({onPaneContextMenu:n,zoomOnScroll:a=!0,zoomOnPinch:u=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=na.Free,zoomOnDoubleClick:f=!0,panOnDrag:h=!0,defaultViewport:g,translateExtent:m,minZoom:y,maxZoom:b,zoomActivationKeyCode:p,preventScrolling:x=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:M,isControlledViewport:O,paneClickDistance:_}){const C=Ie(),k=D.useRef(null),{userSelectionActive:H,lib:U,connectionInProgress:Q}=Re(VS,Fe),q=Ii(p),te=D.useRef();BS(k);const J=D.useCallback(V=>{M==null||M({x:V[0],y:V[1],zoom:V[2]}),O||C.setState({transform:V})},[M,O]);return D.useEffect(()=>{if(k.current){te.current=$w({domNode:k.current,minZoom:y,maxZoom:b,translateExtent:m,viewport:g,paneClickDistance:_,onDraggingChange:B=>C.setState({paneDragging:B}),onPanZoomStart:(B,z)=>{const{onViewportChangeStart:L,onMoveStart:G}=C.getState();G==null||G(B,z),L==null||L(z)},onPanZoom:(B,z)=>{const{onViewportChange:L,onMove:G}=C.getState();G==null||G(B,z),L==null||L(z)},onPanZoomEnd:(B,z)=>{const{onViewportChangeEnd:L,onMoveEnd:G}=C.getState();G==null||G(B,z),L==null||L(z)}});const{x:V,y:Y,zoom:j}=te.current.getViewport();return C.setState({panZoom:te.current,transform:[V,Y,j],domNode:k.current.closest(".react-flow")}),()=>{var B;(B=te.current)==null||B.destroy()}}},[]),D.useEffect(()=>{var V;(V=te.current)==null||V.update({onPaneContextMenu:n,zoomOnScroll:a,zoomOnPinch:u,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:f,panOnDrag:h,zoomActivationKeyPressed:q,preventScrolling:x,noPanClassName:N,userSelectionActive:H,noWheelClassName:E,lib:U,onTransformChange:J,connectionInProgress:Q})},[n,a,u,s,o,c,f,h,q,x,N,H,E,U,J,Q]),v.jsx("div",{className:"react-flow__renderer",ref:k,style:Ds,children:w})}const qS=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function XS(){const{userSelectionActive:n,userSelectionRect:a}=Re(qS,Fe);return n&&a?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:a.width,height:a.height,transform:`translate(${a.x}px, ${a.y}px)`}}):null}const Ir=(n,a)=>u=>{u.target===a.current&&(n==null||n(u))},$S=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function GS({isSelecting:n,selectionKeyPressed:a,selectionMode:u=qi.Full,panOnDrag:s,selectionOnDrag:o,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:g,onPaneScroll:m,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:p,children:x}){const w=Ie(),{userSelectionActive:E,elementsSelectable:N,dragging:M,connectionInProgress:O}=Re($S,Fe),_=N&&(n||E),C=D.useRef(null),k=D.useRef(),H=D.useRef(new Set),U=D.useRef(new Set),Q=D.useRef(!1),q=D.useRef(!1),te=L=>{if(Q.current||O){Q.current=!1;return}h==null||h(L),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},J=L=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){L.preventDefault();return}g==null||g(L)},V=m?L=>m(L):void 0,Y=L=>{var F,le;const{resetSelectedElements:G,domNode:X}=w.getState();if(k.current=X==null?void 0:X.getBoundingClientRect(),!N||!n||L.button!==0||L.target!==C.current||!k.current)return;(le=(F=L.target)==null?void 0:F.setPointerCapture)==null||le.call(F,L.pointerId),q.current=!0,Q.current=!1;const{x:A,y:$}=_n(L.nativeEvent,k.current);G(),w.setState({userSelectionRect:{width:0,height:0,startX:A,startY:$,x:A,y:$}}),c==null||c(L)},j=L=>{const{userSelectionRect:G,transform:X,nodeLookup:A,edgeLookup:$,connectionLookup:F,triggerNodeChanges:le,triggerEdgeChanges:ee,defaultEdgeOptions:de}=w.getState();if(!k.current||!G)return;Q.current=!0;const{x:fe,y:he}=_n(L.nativeEvent,k.current),{startX:ie,startY:ge}=G,me={startX:ie,startY:ge,x:fe<ie?fe:ie,y:he<ge?he:ge,width:Math.abs(fe-ie),height:Math.abs(he-ge)},be=H.current,xe=U.current;H.current=new Set(Dr(A,me,X,u===qi.Partial,!0).map(we=>we.id)),U.current=new Set;const pe=(de==null?void 0:de.selectable)??!0;for(const we of H.current){const Ae=F.get(we);if(Ae)for(const{edgeId:je}of Ae.values()){const Ne=$.get(je);Ne&&(Ne.selectable??pe)&&U.current.add(je)}}if(!Wh(be,H.current)){const we=Ba(A,H.current,!0);le(we)}if(!Wh(xe,U.current)){const we=Ba($,U.current);ee(we)}w.setState({userSelectionRect:me,userSelectionActive:!0,nodesSelectionActive:!1})},B=L=>{var X,A;if(L.button!==0||!q.current)return;(A=(X=L.target)==null?void 0:X.releasePointerCapture)==null||A.call(X,L.pointerId);const{userSelectionRect:G}=w.getState();!E&&G&&L.target===C.current&&(te==null||te(L)),w.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:H.current.size>0}),f==null||f(L),(a||o)&&(Q.current=!1),q.current=!1},z=s===!0||Array.isArray(s)&&s.includes(0);return v.jsxs("div",{className:ct(["react-flow__pane",{draggable:z,dragging:M,selection:n}]),onClick:_?void 0:Ir(te,C),onContextMenu:Ir(J,C),onWheel:Ir(V,C),onPointerEnter:_?void 0:y,onPointerDown:_?Y:b,onPointerMove:_?j:b,onPointerUp:_?B:void 0,onPointerLeave:p,ref:C,style:Ds,children:[x,v.jsx(XS,{})]})}function Pr({id:n,store:a,unselect:u=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:f,nodeLookup:h,onError:g}=a.getState(),m=h.get(n);if(!m){g==null||g("012",Hn.error012(n));return}a.setState({nodesSelectionActive:!1}),m.selected?(u||m.selected&&f)&&(c({nodes:[m],edges:[]}),requestAnimationFrame(()=>{var y;return(y=s==null?void 0:s.current)==null?void 0:y.blur()})):o([n])}function Ig({nodeRef:n,disabled:a=!1,noDragClassName:u,handleSelector:s,nodeId:o,isSelectable:c,nodeClickDistance:f}){const h=Ie(),[g,m]=D.useState(!1),y=D.useRef();return D.useEffect(()=>{y.current=Aw({getStoreItems:()=>h.getState(),onNodeMouseDown:b=>{Pr({id:b,store:h,nodeRef:n})},onDragStart:()=>{m(!0)},onDragStop:()=>{m(!1)}})},[]),D.useEffect(()=>{var b,p;if(a)(b=y.current)==null||b.destroy();else if(n.current)return(p=y.current)==null||p.update({noDragClassName:u,handleSelector:s,domNode:n.current,isSelectable:c,nodeId:o,nodeClickDistance:f}),()=>{var x;(x=y.current)==null||x.destroy()}},[u,s,a,c,n,o]),g}const ZS=n=>a=>a.selected&&(a.draggable||n&&typeof a.draggable>"u");function Pg(){const n=Ie();return D.useCallback(u=>{const{nodeExtent:s,snapToGrid:o,snapGrid:c,nodesDraggable:f,onError:h,updateNodePositions:g,nodeLookup:m,nodeOrigin:y}=n.getState(),b=new Map,p=ZS(f),x=o?c[0]:5,w=o?c[1]:5,E=u.direction.x*x*u.factor,N=u.direction.y*w*u.factor;for(const[,M]of m){if(!p(M))continue;let O={x:M.internals.positionAbsolute.x+E,y:M.internals.positionAbsolute.y+N};o&&(O=Zi(O,c));const{position:_,positionAbsolute:C}=qh({nodeId:M.id,nextPosition:O,nodeLookup:m,nodeExtent:s,nodeOrigin:y,onError:h});M.position=_,M.internals.positionAbsolute=C,b.set(M.id,M)}g(b)},[])}const ec=D.createContext(null),KS=ec.Provider;ec.Consumer;const em=()=>D.useContext(ec),QS=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),JS=(n,a,u)=>s=>{const{connectionClickStartHandle:o,connectionMode:c,connection:f}=s,{fromHandle:h,toHandle:g,isValid:m}=f,y=(g==null?void 0:g.nodeId)===n&&(g==null?void 0:g.id)===a&&(g==null?void 0:g.type)===u;return{connectingFrom:(h==null?void 0:h.nodeId)===n&&(h==null?void 0:h.id)===a&&(h==null?void 0:h.type)===u,connectingTo:y,clickConnecting:(o==null?void 0:o.nodeId)===n&&(o==null?void 0:o.id)===a&&(o==null?void 0:o.type)===u,isPossibleEndHandle:c===Da.Strict?(h==null?void 0:h.type)!==u:n!==(h==null?void 0:h.nodeId)||a!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!o,valid:y&&m}};function WS({type:n="source",position:a=ve.Top,isValidConnection:u,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:f,onConnect:h,children:g,className:m,onMouseDown:y,onTouchStart:b,...p},x){var B,z;const w=f||null,E=n==="target",N=Ie(),M=em(),{connectOnClick:O,noPanClassName:_,rfId:C}=Re(QS,Fe),{connectingFrom:k,connectingTo:H,clickConnecting:U,isPossibleEndHandle:Q,connectionInProcess:q,clickConnectionInProcess:te,valid:J}=Re(JS(M,w,n),Fe);M||(z=(B=N.getState()).onError)==null||z.call(B,"010",Hn.error010());const V=L=>{const{defaultEdgeOptions:G,onConnect:X,hasDefaultEdges:A}=N.getState(),$={...G,...L};if(A){const{edges:F,setEdges:le}=N.getState();le(ag($,F))}X==null||X($),h==null||h($)},Y=L=>{if(!M)return;const G=Ph(L.nativeEvent);if(o&&(G&&L.button===0||!G)){const X=N.getState();Gr.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:X.autoPanOnConnect,connectionMode:X.connectionMode,connectionRadius:X.connectionRadius,domNode:X.domNode,nodeLookup:X.nodeLookup,lib:X.lib,isTarget:E,handleId:w,nodeId:M,flowId:X.rfId,panBy:X.panBy,cancelConnection:X.cancelConnection,onConnectStart:X.onConnectStart,onConnectEnd:X.onConnectEnd,updateConnection:X.updateConnection,onConnect:V,isValidConnection:u||X.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:X.autoPanSpeed,dragThreshold:X.connectionDragThreshold})}G?y==null||y(L):b==null||b(L)},j=L=>{const{onClickConnectStart:G,onClickConnectEnd:X,connectionClickStartHandle:A,connectionMode:$,isValidConnection:F,lib:le,rfId:ee,nodeLookup:de,connection:fe}=N.getState();if(!M||!A&&!o)return;if(!A){G==null||G(L.nativeEvent,{nodeId:M,handleId:w,handleType:n}),N.setState({connectionClickStartHandle:{nodeId:M,type:n,id:w}});return}const he=Fh(L.target),ie=u||F,{connection:ge,isValid:me}=Gr.isValid(L.nativeEvent,{handle:{nodeId:M,id:w,type:n},connectionMode:$,fromNodeId:A.nodeId,fromHandleId:A.id||null,fromType:A.type,isValidConnection:ie,flowId:ee,doc:he,lib:le,nodeLookup:de});me&&ge&&V(ge);const be=structuredClone(fe);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,X==null||X(L,be),N.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":w,"data-nodeid":M,"data-handlepos":a,"data-id":`${C}-${M}-${w}-${n}`,className:ct(["react-flow__handle",`react-flow__handle-${a}`,"nodrag",_,m,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:c,clickconnecting:U,connectingfrom:k,connectingto:H,valid:J,connectionindicator:s&&(!q||Q)&&(q||te?c:o)}]),onMouseDown:Y,onTouchStart:Y,onClick:O?j:void 0,ref:x,...p,children:g})}const xl=D.memo(Qg(WS));function FS({data:n,isConnectable:a,sourcePosition:u=ve.Bottom}){return v.jsxs(v.Fragment,{children:[n==null?void 0:n.label,v.jsx(xl,{type:"source",position:u,isConnectable:a})]})}function IS({data:n,isConnectable:a,targetPosition:u=ve.Top,sourcePosition:s=ve.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(xl,{type:"target",position:u,isConnectable:a}),n==null?void 0:n.label,v.jsx(xl,{type:"source",position:s,isConnectable:a})]})}function PS(){return null}function eE({data:n,isConnectable:a,targetPosition:u=ve.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(xl,{type:"target",position:u,isConnectable:a}),n==null?void 0:n.label]})}const ks={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},tm={input:FS,default:IS,output:eE,group:PS};function tE(n){var a,u,s,o;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((a=n.style)==null?void 0:a.width),height:n.height??n.initialHeight??((u=n.style)==null?void 0:u.height)}:{width:n.width??((s=n.style)==null?void 0:s.width),height:n.height??((o=n.style)==null?void 0:o.height)}}const nE=n=>{const{width:a,height:u,x:s,y:o}=$i(n.nodeLookup,{filter:c=>!!c.selected});return{width:En(a)?a:null,height:En(u)?u:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${s}px,${o}px)`}};function lE({onSelectionContextMenu:n,noPanClassName:a,disableKeyboardA11y:u}){const s=Ie(),{width:o,height:c,transformString:f,userSelectionActive:h}=Re(nE,Fe),g=Pg(),m=D.useRef(null);if(D.useEffect(()=>{var p;u||(p=m.current)==null||p.focus({preventScroll:!0})},[u]),Ig({nodeRef:m}),h||!o||!c)return null;const y=n?p=>{const x=s.getState().nodes.filter(w=>w.selected);n(p,x)}:void 0,b=p=>{Object.prototype.hasOwnProperty.call(ks,p.key)&&(p.preventDefault(),g({direction:ks[p.key],factor:p.shiftKey?4:1}))};return v.jsx("div",{className:ct(["react-flow__nodesselection","react-flow__container",a]),style:{transform:f},children:v.jsx("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:u?void 0:-1,onKeyDown:u?void 0:b,style:{width:o,height:c}})})}const nm=typeof window<"u"?window:void 0,aE=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function lm({children:n,onPaneClick:a,onPaneMouseEnter:u,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:f,paneClickDistance:h,deleteKeyCode:g,selectionKeyCode:m,selectionOnDrag:y,selectionMode:b,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:M,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:C,panOnScrollSpeed:k,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:Q,defaultViewport:q,translateExtent:te,minZoom:J,maxZoom:V,preventScrolling:Y,onSelectionContextMenu:j,noWheelClassName:B,noPanClassName:z,disableKeyboardA11y:L,onViewportChange:G,isControlledViewport:X}){const{nodesSelectionActive:A,userSelectionActive:$}=Re(aE),F=Ii(m,{target:nm}),le=Ii(E,{target:nm}),ee=le||Q,de=le||C,fe=y&&ee!==!0,he=F||$||fe;return US({deleteKeyCode:g,multiSelectionKeyCode:w}),v.jsx(YS,{onPaneContextMenu:c,elementsSelectable:M,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:k,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:!F&&ee,defaultViewport:q,translateExtent:te,minZoom:J,maxZoom:V,zoomActivationKeyCode:N,preventScrolling:Y,noWheelClassName:B,noPanClassName:z,onViewportChange:G,isControlledViewport:X,paneClickDistance:h,children:v.jsxs(GS,{onSelectionStart:p,onSelectionEnd:x,onPaneClick:a,onPaneMouseEnter:u,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:f,panOnDrag:ee,isSelecting:!!he,selectionMode:b,selectionKeyPressed:F,selectionOnDrag:fe,children:[n,A&&v.jsx(lE,{onSelectionContextMenu:j,noPanClassName:z,disableKeyboardA11y:L})]})})}lm.displayName="FlowRenderer";const iE=D.memo(lm),uE=n=>a=>n?Dr(a.nodeLookup,{x:0,y:0,width:a.width,height:a.height},a.transform,!0).map(u=>u.id):Array.from(a.nodeLookup.keys());function sE(n){return Re(D.useCallback(uE(n),[n]),Fe)}const oE=n=>n.updateNodeInternals;function rE(){const n=Re(oE),[a]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(u=>{const s=new Map;u.forEach(o=>{const c=o.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:o.target,force:!0})}),n(s)}));return D.useEffect(()=>()=>{a==null||a.disconnect()},[a]),a}function cE({node:n,nodeType:a,hasDimensions:u,resizeObserver:s}){const o=Ie(),c=D.useRef(null),f=D.useRef(null),h=D.useRef(n.sourcePosition),g=D.useRef(n.targetPosition),m=D.useRef(a),y=u&&!!n.internals.handleBounds;return D.useEffect(()=>{c.current&&!n.hidden&&(!y||f.current!==c.current)&&(f.current&&(s==null||s.unobserve(f.current)),s==null||s.observe(c.current),f.current=c.current)},[y,n.hidden]),D.useEffect(()=>()=>{f.current&&(s==null||s.unobserve(f.current),f.current=null)},[]),D.useEffect(()=>{if(c.current){const b=m.current!==a,p=h.current!==n.sourcePosition,x=g.current!==n.targetPosition;(b||p||x)&&(m.current=a,h.current=n.sourcePosition,g.current=n.targetPosition,o.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:c.current,force:!0}]])))}},[n.id,a,n.sourcePosition,n.targetPosition]),c}function fE({id:n,onClick:a,onMouseEnter:u,onMouseMove:s,onMouseLeave:o,onContextMenu:c,onDoubleClick:f,nodesDraggable:h,elementsSelectable:g,nodesConnectable:m,nodesFocusable:y,resizeObserver:b,noDragClassName:p,noPanClassName:x,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:M,onError:O}){const{node:_,internals:C,isParent:k}=Re(ie=>{const ge=ie.nodeLookup.get(n),me=ie.parentLookup.has(n);return{node:ge,internals:ge.internals,isParent:me}},Fe);let H=_.type||"default",U=(N==null?void 0:N[H])||tm[H];U===void 0&&(O==null||O("003",Hn.error003(H)),H="default",U=(N==null?void 0:N.default)||tm.default);const Q=!!(_.draggable||h&&typeof _.draggable>"u"),q=!!(_.selectable||g&&typeof _.selectable>"u"),te=!!(_.connectable||m&&typeof _.connectable>"u"),J=!!(_.focusable||y&&typeof _.focusable>"u"),V=Ie(),Y=Qh(_),j=cE({node:_,nodeType:H,hasDimensions:Y,resizeObserver:b}),B=Ig({nodeRef:j,disabled:_.hidden||!Q,noDragClassName:p,handleSelector:_.dragHandle,nodeId:n,isSelectable:q,nodeClickDistance:M}),z=Pg();if(_.hidden)return null;const L=Kn(_),G=tE(_),X=q||Q||a||u||s||o,A=u?ie=>u(ie,{...C.userNode}):void 0,$=s?ie=>s(ie,{...C.userNode}):void 0,F=o?ie=>o(ie,{...C.userNode}):void 0,le=c?ie=>c(ie,{...C.userNode}):void 0,ee=f?ie=>f(ie,{...C.userNode}):void 0,de=ie=>{const{selectNodesOnDrag:ge,nodeDragThreshold:me}=V.getState();q&&(!ge||!Q||me>0)&&Pr({id:n,store:V,nodeRef:j}),a&&a(ie,{...C.userNode})},fe=ie=>{if(!(Ih(ie.nativeEvent)||w)){if(Rh.includes(ie.key)&&q){const ge=ie.key==="Escape";Pr({id:n,store:V,unselect:ge,nodeRef:j})}else if(Q&&_.selected&&Object.prototype.hasOwnProperty.call(ks,ie.key)){ie.preventDefault();const{ariaLabelConfig:ge}=V.getState();V.setState({ariaLiveMessage:ge["node.a11yDescription.ariaLiveMessage"]({direction:ie.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),z({direction:ks[ie.key],factor:ie.shiftKey?4:1})}}},he=()=>{var we;if(w||!((we=j.current)!=null&&we.matches(":focus-visible")))return;const{transform:ie,width:ge,height:me,autoPanOnNodeFocus:be,setCenter:xe}=V.getState();if(!be)return;Dr(new Map([[n,_]]),{x:0,y:0,width:ge,height:me},ie,!0).length>0||xe(_.position.x+L.width/2,_.position.y+L.height/2,{zoom:ie[2]})};return v.jsx("div",{className:ct(["react-flow__node",`react-flow__node-${H}`,{[x]:Q},_.className,{selected:_.selected,selectable:q,parent:k,draggable:Q,dragging:B}]),ref:j,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:Y?"visible":"hidden",..._.style,...G},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:A,onMouseMove:$,onMouseLeave:F,onContextMenu:le,onClick:de,onDoubleClick:ee,onKeyDown:J?fe:void 0,tabIndex:J?0:void 0,onFocus:J?he:void 0,role:_.ariaRole??(J?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${Dg}-${E}`,"aria-label":_.ariaLabel,..._.domAttributes,children:v.jsx(KS,{value:n,children:v.jsx(U,{id:n,data:_.data,type:H,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:_.selected??!1,selectable:q,draggable:Q,deletable:_.deletable??!0,isConnectable:te,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:B,dragHandle:_.dragHandle,zIndex:C.z,parentId:_.parentId,...L})})})}const dE=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function am(n){const{nodesDraggable:a,nodesConnectable:u,nodesFocusable:s,elementsSelectable:o,onError:c}=Re(dE,Fe),f=sE(n.onlyRenderVisibleElements),h=rE();return v.jsx("div",{className:"react-flow__nodes",style:Ds,children:f.map(g=>v.jsx(fE,{id:g,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:h,nodesDraggable:a,nodesConnectable:u,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:n.nodeClickDistance,onError:c},g))})}am.displayName="NodeRenderer";const hE=D.memo(am);function gE(n){return Re(D.useCallback(u=>{if(!n)return u.edges.map(o=>o.id);const s=[];if(u.width&&u.height)for(const o of u.edges){const c=u.nodeLookup.get(o.source),f=u.nodeLookup.get(o.target);c&&f&&dw({sourceNode:c,targetNode:f,width:u.width,height:u.height,transform:u.transform})&&s.push(o.id)}return s},[n]),Fe)}const mE=({color:n="none",strokeWidth:a=1})=>{const u={strokeWidth:a,...n&&{stroke:n}};return v.jsx("polyline",{className:"arrow",style:u,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},pE=({color:n="none",strokeWidth:a=1})=>{const u={strokeWidth:a,...n&&{stroke:n,fill:n}};return v.jsx("polyline",{className:"arrowclosed",style:u,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},im={[Ss.Arrow]:mE,[Ss.ArrowClosed]:pE};function yE(n){const a=Ie();return D.useMemo(()=>{var o,c;return Object.prototype.hasOwnProperty.call(im,n)?im[n]:((c=(o=a.getState()).onError)==null||c.call(o,"009",Hn.error009(n)),null)},[n])}const vE=({id:n,type:a,color:u,width:s=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:f,orient:h="auto-start-reverse"})=>{const g=yE(a);return g?v.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:v.jsx(g,{color:u,strokeWidth:f})}):null},um=({defaultColor:n,rfId:a})=>{const u=Re(c=>c.edges),s=Re(c=>c.defaultEdgeOptions),o=D.useMemo(()=>bw(u,{id:a,defaultColor:n,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[u,s,a,n]);return o.length?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:o.map(c=>v.jsx(vE,{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};um.displayName="MarkerDefinitions";var bE=D.memo(um);function sm({x:n,y:a,label:u,labelStyle:s,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:f=[2,4],labelBgBorderRadius:h=2,children:g,className:m,...y}){const[b,p]=D.useState({x:1,y:0,width:0,height:0}),x=ct(["react-flow__edge-textwrapper",m]),w=D.useRef(null);return D.useEffect(()=>{if(w.current){const E=w.current.getBBox();p({x:E.x,y:E.y,width:E.width,height:E.height})}},[u]),u?v.jsxs("g",{transform:`translate(${n-b.width/2} ${a-b.height/2})`,className:x,visibility:b.width?"visible":"hidden",...y,children:[o&&v.jsx("rect",{width:b.width+2*f[0],x:-f[0],y:-f[1],height:b.height+2*f[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),v.jsx("text",{className:"react-flow__edge-text",y:b.height/2,dy:"0.3em",ref:w,style:s,children:u}),g]}):null}sm.displayName="EdgeText";const xE=D.memo(sm);function Rs({path:n,labelX:a,labelY:u,label:s,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:g,interactionWidth:m=20,...y}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...y,d:n,fill:"none",className:ct(["react-flow__edge-path",y.className])}),m?v.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}):null,s&&En(a)&&En(u)?v.jsx(xE,{x:a,y:u,label:s,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:g}):null]})}function om({pos:n,x1:a,y1:u,x2:s,y2:o}){return n===ve.Left||n===ve.Right?[.5*(a+s),u]:[a,.5*(u+o)]}function rm({sourceX:n,sourceY:a,sourcePosition:u=ve.Bottom,targetX:s,targetY:o,targetPosition:c=ve.Top}){const[f,h]=om({pos:u,x1:n,y1:a,x2:s,y2:o}),[g,m]=om({pos:c,x1:s,y1:o,x2:n,y2:a}),[y,b,p,x]=tg({sourceX:n,sourceY:a,targetX:s,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:g,targetControlY:m});return[`M${n},${a} C${f},${h} ${g},${m} ${s},${o}`,y,b,p,x]}function cm(n){return D.memo(({id:a,sourceX:u,sourceY:s,targetX:o,targetY:c,sourcePosition:f,targetPosition:h,label:g,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:N,interactionWidth:M})=>{const[O,_,C]=rm({sourceX:u,sourceY:s,sourcePosition:f,targetX:o,targetY:c,targetPosition:h}),k=n.isInternal?void 0:a;return v.jsx(Rs,{id:k,path:O,labelX:_,labelY:C,label:g,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:N,interactionWidth:M})})}const wE=cm({isInternal:!1}),fm=cm({isInternal:!0});wE.displayName="SimpleBezierEdge",fm.displayName="SimpleBezierEdgeInternal";function dm(n){return D.memo(({id:a,sourceX:u,sourceY:s,targetX:o,targetY:c,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:p,sourcePosition:x=ve.Bottom,targetPosition:w=ve.Top,markerEnd:E,markerStart:N,pathOptions:M,interactionWidth:O})=>{const[_,C,k]=Lr({sourceX:u,sourceY:s,sourcePosition:x,targetX:o,targetY:c,targetPosition:w,borderRadius:M==null?void 0:M.borderRadius,offset:M==null?void 0:M.offset,stepPosition:M==null?void 0:M.stepPosition}),H=n.isInternal?void 0:a;return v.jsx(Rs,{id:H,path:_,labelX:C,labelY:k,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:p,markerEnd:E,markerStart:N,interactionWidth:O})})}const hm=dm({isInternal:!1}),gm=dm({isInternal:!0});hm.displayName="SmoothStepEdge",gm.displayName="SmoothStepEdgeInternal";function mm(n){return D.memo(({id:a,...u})=>{var o;const s=n.isInternal?void 0:a;return v.jsx(hm,{...u,id:s,pathOptions:D.useMemo(()=>{var c;return{borderRadius:0,offset:(c=u.pathOptions)==null?void 0:c.offset}},[(o=u.pathOptions)==null?void 0:o.offset])})})}const SE=mm({isInternal:!1}),pm=mm({isInternal:!0});SE.displayName="StepEdge",pm.displayName="StepEdgeInternal";function ym(n){return D.memo(({id:a,sourceX:u,sourceY:s,targetX:o,targetY:c,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:p,markerEnd:x,markerStart:w,interactionWidth:E})=>{const[N,M,O]=ig({sourceX:u,sourceY:s,targetX:o,targetY:c}),_=n.isInternal?void 0:a;return v.jsx(Rs,{id:_,path:N,labelX:M,labelY:O,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:p,markerEnd:x,markerStart:w,interactionWidth:E})})}const EE=ym({isInternal:!1}),vm=ym({isInternal:!0});EE.displayName="StraightEdge",vm.displayName="StraightEdgeInternal";function bm(n){return D.memo(({id:a,sourceX:u,sourceY:s,targetX:o,targetY:c,sourcePosition:f=ve.Bottom,targetPosition:h=ve.Top,label:g,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:N,pathOptions:M,interactionWidth:O})=>{const[_,C,k]=Hr({sourceX:u,sourceY:s,sourcePosition:f,targetX:o,targetY:c,targetPosition:h,curvature:M==null?void 0:M.curvature}),H=n.isInternal?void 0:a;return v.jsx(Rs,{id:H,path:_,labelX:C,labelY:k,label:g,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:N,interactionWidth:O})})}const _E=bm({isInternal:!1}),xm=bm({isInternal:!0});_E.displayName="BezierEdge",xm.displayName="BezierEdgeInternal";const wm={default:xm,straight:vm,step:pm,smoothstep:gm,simplebezier:fm},Sm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},NE=(n,a,u)=>u===ve.Left?n-a:u===ve.Right?n+a:n,CE=(n,a,u)=>u===ve.Top?n-a:u===ve.Bottom?n+a:n,Em="react-flow__edgeupdater";function _m({position:n,centerX:a,centerY:u,radius:s=10,onMouseDown:o,onMouseEnter:c,onMouseOut:f,type:h}){return v.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:f,className:ct([Em,`${Em}-${h}`]),cx:NE(a,s,n),cy:CE(u,s,n),r:s,stroke:"transparent",fill:"transparent"})}function ME({isReconnectable:n,reconnectRadius:a,edge:u,sourceX:s,sourceY:o,targetX:c,targetY:f,sourcePosition:h,targetPosition:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,setReconnecting:p,setUpdateHover:x}){const w=Ie(),E=(C,k)=>{if(C.button!==0)return;const{autoPanOnConnect:H,domNode:U,isValidConnection:Q,connectionMode:q,connectionRadius:te,lib:J,onConnectStart:V,onConnectEnd:Y,cancelConnection:j,nodeLookup:B,rfId:z,panBy:L,updateConnection:G}=w.getState(),X=k.type==="target",A=(le,ee)=>{p(!1),b==null||b(le,u,k.type,ee)},$=le=>m==null?void 0:m(u,le),F=(le,ee)=>{p(!0),y==null||y(C,u,k.type),V==null||V(le,ee)};Gr.onPointerDown(C.nativeEvent,{autoPanOnConnect:H,connectionMode:q,connectionRadius:te,domNode:U,handleId:k.id,nodeId:k.nodeId,nodeLookup:B,isTarget:X,edgeUpdaterType:k.type,lib:J,flowId:z,cancelConnection:j,panBy:L,isValidConnection:Q,onConnect:$,onConnectStart:F,onConnectEnd:Y,onReconnectEnd:A,updateConnection:G,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>E(C,{nodeId:u.target,id:u.targetHandle??null,type:"target"}),M=C=>E(C,{nodeId:u.source,id:u.sourceHandle??null,type:"source"}),O=()=>x(!0),_=()=>x(!1);return v.jsxs(v.Fragment,{children:[(n===!0||n==="source")&&v.jsx(_m,{position:h,centerX:s,centerY:o,radius:a,onMouseDown:N,onMouseEnter:O,onMouseOut:_,type:"source"}),(n===!0||n==="target")&&v.jsx(_m,{position:g,centerX:c,centerY:f,radius:a,onMouseDown:M,onMouseEnter:O,onMouseOut:_,type:"target"})]})}function TE({id:n,edgesFocusable:a,edgesReconnectable:u,elementsSelectable:s,onClick:o,onDoubleClick:c,onContextMenu:f,onMouseEnter:h,onMouseMove:g,onMouseLeave:m,reconnectRadius:y,onReconnect:b,onReconnectStart:p,onReconnectEnd:x,rfId:w,edgeTypes:E,noPanClassName:N,onError:M,disableKeyboardA11y:O}){let _=Re(xe=>xe.edgeLookup.get(n));const C=Re(xe=>xe.defaultEdgeOptions);_=C?{...C,..._}:_;let k=_.type||"default",H=(E==null?void 0:E[k])||wm[k];H===void 0&&(M==null||M("011",Hn.error011(k)),k="default",H=(E==null?void 0:E.default)||wm.default);const U=!!(_.focusable||a&&typeof _.focusable>"u"),Q=typeof b<"u"&&(_.reconnectable||u&&typeof _.reconnectable>"u"),q=!!(_.selectable||s&&typeof _.selectable>"u"),te=D.useRef(null),[J,V]=D.useState(!1),[Y,j]=D.useState(!1),B=Ie(),{zIndex:z,sourceX:L,sourceY:G,targetX:X,targetY:A,sourcePosition:$,targetPosition:F}=Re(D.useCallback(xe=>{const pe=xe.nodeLookup.get(_.source),we=xe.nodeLookup.get(_.target);if(!pe||!we)return{zIndex:_.zIndex,...Sm};const Ae=vw({id:n,sourceNode:pe,targetNode:we,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:xe.connectionMode,onError:M});return{zIndex:fw({selected:_.selected,zIndex:_.zIndex,sourceNode:pe,targetNode:we,elevateOnSelect:xe.elevateEdgesOnSelect}),...Ae||Sm}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),Fe),le=D.useMemo(()=>_.markerStart?`url('#${Ur(_.markerStart,w)}')`:void 0,[_.markerStart,w]),ee=D.useMemo(()=>_.markerEnd?`url('#${Ur(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||L===null||G===null||X===null||A===null)return null;const de=xe=>{var je;const{addSelectedEdges:pe,unselectNodesAndEdges:we,multiSelectionActive:Ae}=B.getState();q&&(B.setState({nodesSelectionActive:!1}),_.selected&&Ae?(we({nodes:[],edges:[_]}),(je=te.current)==null||je.blur()):pe([n])),o&&o(xe,_)},fe=c?xe=>{c(xe,{..._})}:void 0,he=f?xe=>{f(xe,{..._})}:void 0,ie=h?xe=>{h(xe,{..._})}:void 0,ge=g?xe=>{g(xe,{..._})}:void 0,me=m?xe=>{m(xe,{..._})}:void 0,be=xe=>{var pe;if(!O&&Rh.includes(xe.key)&&q){const{unselectNodesAndEdges:we,addSelectedEdges:Ae}=B.getState();xe.key==="Escape"?((pe=te.current)==null||pe.blur(),we({edges:[_]})):Ae([n])}};return v.jsx("svg",{style:{zIndex:z},children:v.jsxs("g",{className:ct(["react-flow__edge",`react-flow__edge-${k}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!q&&!o,updating:J,selectable:q}]),onClick:de,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ie,onMouseMove:ge,onMouseLeave:me,onKeyDown:U?be:void 0,tabIndex:U?0:void 0,role:_.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":U?`${kg}-${w}`:void 0,ref:te,..._.domAttributes,children:[!Y&&v.jsx(H,{id:n,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:q,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:L,sourceY:G,targetX:X,targetY:A,sourcePosition:$,targetPosition:F,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:le,markerEnd:ee,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),Q&&v.jsx(ME,{edge:_,isReconnectable:Q,reconnectRadius:y,onReconnect:b,onReconnectStart:p,onReconnectEnd:x,sourceX:L,sourceY:G,targetX:X,targetY:A,sourcePosition:$,targetPosition:F,setUpdateHover:V,setReconnecting:j})]})})}const AE=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Nm({defaultMarkerColor:n,onlyRenderVisibleElements:a,rfId:u,edgeTypes:s,noPanClassName:o,onReconnect:c,onEdgeContextMenu:f,onEdgeMouseEnter:h,onEdgeMouseMove:g,onEdgeMouseLeave:m,onEdgeClick:y,reconnectRadius:b,onEdgeDoubleClick:p,onReconnectStart:x,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:M,elementsSelectable:O,onError:_}=Re(AE,Fe),C=gE(a);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(bE,{defaultColor:n,rfId:u}),C.map(k=>v.jsx(TE,{id:k,edgesFocusable:N,edgesReconnectable:M,elementsSelectable:O,noPanClassName:o,onReconnect:c,onContextMenu:f,onMouseEnter:h,onMouseMove:g,onMouseLeave:m,onClick:y,reconnectRadius:b,onDoubleClick:p,onReconnectStart:x,onReconnectEnd:w,rfId:u,onError:_,edgeTypes:s,disableKeyboardA11y:E},k))]})}Nm.displayName="EdgeRenderer";const jE=D.memo(Nm),OE=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function zE({children:n}){const a=Re(OE);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:a},children:n})}function DE(n){const a=Va(),u=D.useRef(!1);D.useEffect(()=>{!u.current&&a.viewportInitialized&&n&&(setTimeout(()=>n(a),1),u.current=!0)},[n,a.viewportInitialized])}const kE=n=>{var a;return(a=n.panZoom)==null?void 0:a.syncViewport};function RE(n){const a=Re(kE),u=Ie();return D.useEffect(()=>{n&&(a==null||a(n),u.setState({transform:[n.x,n.y,n.zoom]}))},[n,a]),null}function HE(n){return n.connection.inProgress?{...n.connection,to:Ki(n.connection.to,n.transform)}:{...n.connection}}function LE(n){return HE}function UE(n){const a=LE();return Re(a,Fe)}const BE=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function VE({containerStyle:n,style:a,type:u,component:s}){const{nodesConnectable:o,width:c,height:f,isValid:h,inProgress:g}=Re(BE,Fe);return!(c&&o&&g)?null:v.jsx("svg",{style:n,width:c,height:f,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:ct(["react-flow__connection",Bh(h)]),children:v.jsx(Cm,{style:a,type:u,CustomComponent:s,isValid:h})})})}const Cm=({style:n,type:a=pl.Bezier,CustomComponent:u,isValid:s})=>{const{inProgress:o,from:c,fromNode:f,fromHandle:h,fromPosition:g,to:m,toNode:y,toHandle:b,toPosition:p}=UE();if(!o)return;if(u)return v.jsx(u,{connectionLineType:a,connectionLineStyle:n,fromNode:f,fromHandle:h,fromX:c.x,fromY:c.y,toX:m.x,toY:m.y,fromPosition:g,toPosition:p,connectionStatus:Bh(s),toNode:y,toHandle:b});let x="";const w={sourceX:c.x,sourceY:c.y,sourcePosition:g,targetX:m.x,targetY:m.y,targetPosition:p};switch(a){case pl.Bezier:[x]=Hr(w);break;case pl.SimpleBezier:[x]=rm(w);break;case pl.Step:[x]=Lr({...w,borderRadius:0});break;case pl.SmoothStep:[x]=Lr(w);break;default:[x]=ig(w)}return v.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:n})};Cm.displayName="ConnectionLine";const YE={};function Mm(n=YE){D.useRef(n),Ie(),D.useEffect(()=>{},[n])}function qE(){Ie(),D.useRef(!1),D.useEffect(()=>{},[])}function Tm({nodeTypes:n,edgeTypes:a,onInit:u,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:g,onNodeMouseLeave:m,onNodeContextMenu:y,onSelectionContextMenu:b,onSelectionStart:p,onSelectionEnd:x,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:M,selectionKeyCode:O,selectionOnDrag:_,selectionMode:C,multiSelectionKeyCode:k,panActivationKeyCode:H,zoomActivationKeyCode:U,deleteKeyCode:Q,onlyRenderVisibleElements:q,elementsSelectable:te,defaultViewport:J,translateExtent:V,minZoom:Y,maxZoom:j,preventScrolling:B,defaultMarkerColor:z,zoomOnScroll:L,zoomOnPinch:G,panOnScroll:X,panOnScrollSpeed:A,panOnScrollMode:$,zoomOnDoubleClick:F,panOnDrag:le,onPaneClick:ee,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ie,onPaneContextMenu:ge,paneClickDistance:me,nodeClickDistance:be,onEdgeContextMenu:xe,onEdgeMouseEnter:pe,onEdgeMouseMove:we,onEdgeMouseLeave:Ae,reconnectRadius:je,onReconnect:Ne,onReconnectStart:Le,onReconnectEnd:Ut,noDragClassName:Ze,noWheelClassName:Dt,noPanClassName:sn,disableKeyboardA11y:st,nodeExtent:St,rfId:on,viewport:ft,onViewportChange:rn}){return Mm(n),Mm(a),qE(),DE(u),RE(ft),v.jsx(iE,{onPaneClick:ee,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:ge,onPaneScroll:ie,paneClickDistance:me,deleteKeyCode:Q,selectionKeyCode:O,selectionOnDrag:_,selectionMode:C,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:k,panActivationKeyCode:H,zoomActivationKeyCode:U,elementsSelectable:te,zoomOnScroll:L,zoomOnPinch:G,zoomOnDoubleClick:F,panOnScroll:X,panOnScrollSpeed:A,panOnScrollMode:$,panOnDrag:le,defaultViewport:J,translateExtent:V,minZoom:Y,maxZoom:j,onSelectionContextMenu:b,preventScrolling:B,noDragClassName:Ze,noWheelClassName:Dt,noPanClassName:sn,disableKeyboardA11y:st,onViewportChange:rn,isControlledViewport:!!ft,children:v.jsxs(zE,{children:[v.jsx(jE,{edgeTypes:a,onEdgeClick:o,onEdgeDoubleClick:f,onReconnect:Ne,onReconnectStart:Le,onReconnectEnd:Ut,onlyRenderVisibleElements:q,onEdgeContextMenu:xe,onEdgeMouseEnter:pe,onEdgeMouseMove:we,onEdgeMouseLeave:Ae,reconnectRadius:je,defaultMarkerColor:z,noPanClassName:sn,disableKeyboardA11y:st,rfId:on}),v.jsx(VE,{style:E,type:w,component:N,containerStyle:M}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(hE,{nodeTypes:n,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:g,onNodeMouseLeave:m,onNodeContextMenu:y,nodeClickDistance:be,onlyRenderVisibleElements:q,noPanClassName:sn,noDragClassName:Ze,disableKeyboardA11y:st,nodeExtent:St,rfId:on}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}Tm.displayName="GraphView";const XE=D.memo(Tm),Am=({nodes:n,edges:a,defaultNodes:u,defaultEdges:s,width:o,height:c,fitView:f,fitViewOptions:h,minZoom:g=.5,maxZoom:m=2,nodeOrigin:y,nodeExtent:b}={})=>{const p=new Map,x=new Map,w=new Map,E=new Map,N=s??a??[],M=u??n??[],O=y??[0,0],_=b??Yi;hg(w,E,N);const C=Yr(M,p,x,{nodeOrigin:O,nodeExtent:_,elevateNodesOnSelect:!1});let k=[0,0,1];if(f&&o&&c){const H=$i(p,{filter:te=>!!((te.width||te.initialWidth)&&(te.height||te.initialHeight))}),{x:U,y:Q,zoom:q}=Ms(H,o,c,g,m,(h==null?void 0:h.padding)??.1);k=[U,Q,q]}return{rfId:"1",width:o??0,height:c??0,transform:k,nodes:M,nodesInitialized:C,nodeLookup:p,parentLookup:x,edges:N,edgeLookup:E,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:u!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:g,maxZoom:m,translateExtent:Yi,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Da.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:O,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:f??!1,fitViewOptions:h,fitViewResolver:null,connection:{...Lh},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:iw,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Hh}},$E=({nodes:n,edges:a,defaultNodes:u,defaultEdges:s,width:o,height:c,fitView:f,fitViewOptions:h,minZoom:g,maxZoom:m,nodeOrigin:y,nodeExtent:b})=>fS((p,x)=>{async function w(){const{nodeLookup:E,panZoom:N,fitViewOptions:M,fitViewResolver:O,width:_,height:C,minZoom:k,maxZoom:H}=x();N&&(await lw({nodes:E,width:_,height:C,panZoom:N,minZoom:k,maxZoom:H},M),O==null||O.resolve(!0),p({fitViewResolver:null}))}return{...Am({nodes:n,edges:a,width:o,height:c,fitView:f,fitViewOptions:h,minZoom:g,maxZoom:m,nodeOrigin:y,nodeExtent:b,defaultNodes:u,defaultEdges:s}),setNodes:E=>{const{nodeLookup:N,parentLookup:M,nodeOrigin:O,elevateNodesOnSelect:_,fitViewQueued:C}=x(),k=Yr(E,N,M,{nodeOrigin:O,nodeExtent:b,elevateNodesOnSelect:_,checkEquality:!0});C&&k?(w(),p({nodes:E,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):p({nodes:E,nodesInitialized:k})},setEdges:E=>{const{connectionLookup:N,edgeLookup:M}=x();hg(N,M,E),p({edges:E})},setDefaultNodesAndEdges:(E,N)=>{if(E){const{setNodes:M}=x();M(E),p({hasDefaultNodes:!0})}if(N){const{setEdges:M}=x();M(N),p({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:N,nodeLookup:M,parentLookup:O,domNode:_,nodeOrigin:C,nodeExtent:k,debug:H,fitViewQueued:U}=x(),{changes:Q,updatedInternals:q}=Nw(E,M,O,_,C,k);q&&(ww(M,O,{nodeOrigin:C,nodeExtent:k}),U?(w(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(Q==null?void 0:Q.length)>0&&(H&&console.log("React Flow: trigger node changes",Q),N==null||N(Q)))},updateNodePositions:(E,N=!1)=>{const M=[],O=[],{nodeLookup:_,triggerNodeChanges:C}=x();for(const[k,H]of E){const U=_.get(k),Q=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(H!=null&&H.position)),q={id:k,type:"position",position:Q?{x:Math.max(0,H.position.x),y:Math.max(0,H.position.y)}:H.position,dragging:N};Q&&U.parentId&&M.push({id:k,parentId:U.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),O.push(q)}if(M.length>0){const{parentLookup:k,nodeOrigin:H}=x(),U=Xr(M,_,k,H);O.push(...U)}C(O)},triggerNodeChanges:E=>{const{onNodesChange:N,setNodes:M,nodes:O,hasDefaultNodes:_,debug:C}=x();if(E!=null&&E.length){if(_){const k=Xg(E,O);M(k)}C&&console.log("React Flow: trigger node changes",E),N==null||N(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:N,setEdges:M,edges:O,hasDefaultEdges:_,debug:C}=x();if(E!=null&&E.length){if(_){const k=$g(E,O);M(k)}C&&console.log("React Flow: trigger edge changes",E),N==null||N(E)}},addSelectedNodes:E=>{const{multiSelectionActive:N,edgeLookup:M,nodeLookup:O,triggerNodeChanges:_,triggerEdgeChanges:C}=x();if(N){const k=E.map(H=>ia(H,!0));_(k);return}_(Ba(O,new Set([...E]),!0)),C(Ba(M))},addSelectedEdges:E=>{const{multiSelectionActive:N,edgeLookup:M,nodeLookup:O,triggerNodeChanges:_,triggerEdgeChanges:C}=x();if(N){const k=E.map(H=>ia(H,!0));C(k);return}C(Ba(M,new Set([...E]))),_(Ba(O,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:N}={})=>{const{edges:M,nodes:O,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:k}=x(),H=E||O,U=N||M,Q=H.map(te=>{const J=_.get(te.id);return J&&(J.selected=!1),ia(te.id,!1)}),q=U.map(te=>ia(te.id,!1));C(Q),k(q)},setMinZoom:E=>{const{panZoom:N,maxZoom:M}=x();N==null||N.setScaleExtent([E,M]),p({minZoom:E})},setMaxZoom:E=>{const{panZoom:N,minZoom:M}=x();N==null||N.setScaleExtent([M,E]),p({maxZoom:E})},setTranslateExtent:E=>{var N;(N=x().panZoom)==null||N.setTranslateExtent(E),p({translateExtent:E})},setPaneClickDistance:E=>{var N;(N=x().panZoom)==null||N.setClickDistance(E)},resetSelectedElements:()=>{const{edges:E,nodes:N,triggerNodeChanges:M,triggerEdgeChanges:O,elementsSelectable:_}=x();if(!_)return;const C=N.reduce((H,U)=>U.selected?[...H,ia(U.id,!1)]:H,[]),k=E.reduce((H,U)=>U.selected?[...H,ia(U.id,!1)]:H,[]);M(C),O(k)},setNodeExtent:E=>{const{nodes:N,nodeLookup:M,parentLookup:O,nodeOrigin:_,elevateNodesOnSelect:C,nodeExtent:k}=x();E[0][0]===k[0][0]&&E[0][1]===k[0][1]&&E[1][0]===k[1][0]&&E[1][1]===k[1][1]||(Yr(N,M,O,{nodeOrigin:_,nodeExtent:E,elevateNodesOnSelect:C,checkEquality:!1}),p({nodeExtent:E}))},panBy:E=>{const{transform:N,width:M,height:O,panZoom:_,translateExtent:C}=x();return Cw({delta:E,panZoom:_,transform:N,translateExtent:C,width:M,height:O})},setCenter:async(E,N,M)=>{const{width:O,height:_,maxZoom:C,panZoom:k}=x();if(!k)return Promise.resolve(!1);const H=typeof(M==null?void 0:M.zoom)<"u"?M.zoom:C;return await k.setViewport({x:O/2-E*H,y:_/2-N*H,zoom:H},{duration:M==null?void 0:M.duration,ease:M==null?void 0:M.ease,interpolate:M==null?void 0:M.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...Lh}})},updateConnection:E=>{p({connection:E})},reset:()=>p({...Am()})}},Object.is);function tc({initialNodes:n,initialEdges:a,defaultNodes:u,defaultEdges:s,initialWidth:o,initialHeight:c,initialMinZoom:f,initialMaxZoom:h,initialFitViewOptions:g,fitView:m,nodeOrigin:y,nodeExtent:b,children:p}){const[x]=D.useState(()=>$E({nodes:n,edges:a,defaultNodes:u,defaultEdges:s,width:o,height:c,fitView:m,minZoom:f,maxZoom:h,fitViewOptions:g,nodeOrigin:y,nodeExtent:b}));return v.jsx(dS,{value:x,children:v.jsx(kS,{children:p})})}function GE({children:n,nodes:a,edges:u,defaultNodes:s,defaultEdges:o,width:c,height:f,fitView:h,fitViewOptions:g,minZoom:m,maxZoom:y,nodeOrigin:b,nodeExtent:p}){return D.useContext(Os)?v.jsx(v.Fragment,{children:n}):v.jsx(tc,{initialNodes:a,initialEdges:u,defaultNodes:s,defaultEdges:o,initialWidth:c,initialHeight:f,fitView:h,initialFitViewOptions:g,initialMinZoom:m,initialMaxZoom:y,nodeOrigin:b,nodeExtent:p,children:n})}const ZE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function KE({nodes:n,edges:a,defaultNodes:u,defaultEdges:s,className:o,nodeTypes:c,edgeTypes:f,onNodeClick:h,onEdgeClick:g,onInit:m,onMove:y,onMoveStart:b,onMoveEnd:p,onConnect:x,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:M,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:k,onNodeDoubleClick:H,onNodeDragStart:U,onNodeDrag:Q,onNodeDragStop:q,onNodesDelete:te,onEdgesDelete:J,onDelete:V,onSelectionChange:Y,onSelectionDragStart:j,onSelectionDrag:B,onSelectionDragStop:z,onSelectionContextMenu:L,onSelectionStart:G,onSelectionEnd:X,onBeforeDelete:A,connectionMode:$,connectionLineType:F=pl.Bezier,connectionLineStyle:le,connectionLineComponent:ee,connectionLineContainerStyle:de,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ie=!1,selectionMode:ge=qi.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:be=Qi()?"Meta":"Control",zoomActivationKeyCode:xe=Qi()?"Meta":"Control",snapToGrid:pe,snapGrid:we,onlyRenderVisibleElements:Ae=!1,selectNodesOnDrag:je,nodesDraggable:Ne,autoPanOnNodeFocus:Le,nodesConnectable:Ut,nodesFocusable:Ze,nodeOrigin:Dt=Rg,edgesFocusable:sn,edgesReconnectable:st,elementsSelectable:St=!0,defaultViewport:on=NS,minZoom:ft=.5,maxZoom:rn=2,translateExtent:Et=Yi,preventScrolling:El=!0,nodeExtent:Ln,defaultMarkerColor:Jn="#b1b1b7",zoomOnScroll:$t=!0,zoomOnPinch:kt=!0,panOnScroll:ot=!1,panOnScrollSpeed:_l=.5,panOnScrollMode:Gt=na.Free,zoomOnDoubleClick:vt=!0,panOnDrag:Nl=!0,onPaneClick:Oe,onPaneMouseEnter:tt,onPaneMouseMove:dt,onPaneMouseLeave:bt,onPaneScroll:Ye,onPaneContextMenu:Pt,paneClickDistance:Zt=0,nodeClickDistance:Wn=0,children:Cn,onReconnect:Cl,onReconnectStart:oe,onReconnectEnd:ce,onEdgeContextMenu:se,onEdgeDoubleClick:Me,onEdgeMouseEnter:Je,onEdgeMouseMove:We,onEdgeMouseLeave:nt,reconnectRadius:ht=10,onNodesChange:Bt,onEdgesChange:_t,noDragClassName:Rt="nodrag",noWheelClassName:Ml="nowheel",noPanClassName:$a="nopan",fitView:Zs,fitViewOptions:Ks,connectOnClick:Qs,attributionPosition:oa,proOptions:lu,defaultEdgeOptions:Fn,elevateNodesOnSelect:Tl,elevateEdgesOnSelect:ra,disableKeyboardA11y:In=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:Js,autoPanSpeed:Ws,connectionRadius:Pn,isValidConnection:Al,onError:Mn,style:Nc,id:au,nodeDragThreshold:Fs,connectionDragThreshold:Cc,viewport:Ga,onViewportChange:Za,width:Tn,height:Kt,colorMode:Is="light",debug:Mc,onScroll:el,ariaLabelConfig:Ps,...Ka},Tc){const Ht=au||"1",iu=TS(Is),eo=D.useCallback(Qa=>{Qa.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),el==null||el(Qa)},[el]);return v.jsx("div",{"data-testid":"rf__wrapper",...Ka,onScroll:eo,style:{...Nc,...ZE},ref:Tc,className:ct(["react-flow",o,iu]),id:au,role:"application",children:v.jsxs(GE,{nodes:n,edges:a,width:Tn,height:Kt,fitView:Zs,fitViewOptions:Ks,minZoom:ft,maxZoom:rn,nodeOrigin:Dt,nodeExtent:Ln,children:[v.jsx(XE,{onInit:m,onNodeClick:h,onEdgeClick:g,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:k,onNodeDoubleClick:H,nodeTypes:c,edgeTypes:f,connectionLineType:F,connectionLineStyle:le,connectionLineComponent:ee,connectionLineContainerStyle:de,selectionKeyCode:he,selectionOnDrag:ie,selectionMode:ge,deleteKeyCode:fe,multiSelectionKeyCode:be,panActivationKeyCode:me,zoomActivationKeyCode:xe,onlyRenderVisibleElements:Ae,defaultViewport:on,translateExtent:Et,minZoom:ft,maxZoom:rn,preventScrolling:El,zoomOnScroll:$t,zoomOnPinch:kt,zoomOnDoubleClick:vt,panOnScroll:ot,panOnScrollSpeed:_l,panOnScrollMode:Gt,panOnDrag:Nl,onPaneClick:Oe,onPaneMouseEnter:tt,onPaneMouseMove:dt,onPaneMouseLeave:bt,onPaneScroll:Ye,onPaneContextMenu:Pt,paneClickDistance:Zt,nodeClickDistance:Wn,onSelectionContextMenu:L,onSelectionStart:G,onSelectionEnd:X,onReconnect:Cl,onReconnectStart:oe,onReconnectEnd:ce,onEdgeContextMenu:se,onEdgeDoubleClick:Me,onEdgeMouseEnter:Je,onEdgeMouseMove:We,onEdgeMouseLeave:nt,reconnectRadius:ht,defaultMarkerColor:Jn,noDragClassName:Rt,noWheelClassName:Ml,noPanClassName:$a,rfId:Ht,disableKeyboardA11y:In,nodeExtent:Ln,viewport:Ga,onViewportChange:Za}),v.jsx(MS,{nodes:n,edges:a,defaultNodes:u,defaultEdges:s,onConnect:x,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:M,nodesDraggable:Ne,autoPanOnNodeFocus:Le,nodesConnectable:Ut,nodesFocusable:Ze,edgesFocusable:sn,edgesReconnectable:st,elementsSelectable:St,elevateNodesOnSelect:Tl,elevateEdgesOnSelect:ra,minZoom:ft,maxZoom:rn,nodeExtent:Ln,onNodesChange:Bt,onEdgesChange:_t,snapToGrid:pe,snapGrid:we,connectionMode:$,translateExtent:Et,connectOnClick:Qs,defaultEdgeOptions:Fn,fitView:Zs,fitViewOptions:Ks,onNodesDelete:te,onEdgesDelete:J,onDelete:V,onNodeDragStart:U,onNodeDrag:Q,onNodeDragStop:q,onSelectionDrag:B,onSelectionDragStart:j,onSelectionDragStop:z,onMove:y,onMoveStart:b,onMoveEnd:p,noPanClassName:$a,nodeOrigin:Dt,rfId:Ht,autoPanOnConnect:gt,autoPanOnNodeDrag:Js,autoPanSpeed:Ws,onError:Mn,connectionRadius:Pn,isValidConnection:Al,selectNodesOnDrag:je,nodeDragThreshold:Fs,connectionDragThreshold:Cc,onBeforeDelete:A,paneClickDistance:Zt,debug:Mc,ariaLabelConfig:Ps}),v.jsx(_S,{onSelectionChange:Y}),Cn,v.jsx(bS,{proOptions:lu,position:oa}),v.jsx(vS,{rfId:Ht,disableKeyboardA11y:In})]})})}var jm=Qg(KE);function Om(n){const[a,u]=D.useState(n),s=D.useCallback(o=>u(c=>Xg(o,c)),[]);return[a,u,s]}function zm(n){const[a,u]=D.useState(n),s=D.useCallback(o=>u(c=>$g(o,c)),[]);return[a,u,s]}function Dm(n){return Re(D.useCallback(u=>u.nodeLookup.get(n),[n]),Fe)}function QE({dimensions:n,lineWidth:a,variant:u,className:s}){return v.jsx("path",{strokeWidth:a,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:ct(["react-flow__background-pattern",u,s])})}function JE({radius:n,className:a}){return v.jsx("circle",{cx:n,cy:n,r:n,className:ct(["react-flow__background-pattern","dots",a])})}var wl;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(wl||(wl={}));const WE={[wl.Dots]:1,[wl.Lines]:1,[wl.Cross]:6},FE=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function km({id:n,variant:a=wl.Dots,gap:u=20,size:s,lineWidth:o=1,offset:c=0,color:f,bgColor:h,style:g,className:m,patternClassName:y}){const b=D.useRef(null),{transform:p,patternId:x}=Re(FE,Fe),w=s||WE[a],E=a===wl.Dots,N=a===wl.Cross,M=Array.isArray(u)?u:[u,u],O=[M[0]*p[2]||1,M[1]*p[2]||1],_=w*p[2],C=Array.isArray(c)?c:[c,c],k=N?[_,_]:O,H=[C[0]*p[2]||1+k[0]/2,C[1]*p[2]||1+k[1]/2],U=`${x}${n||""}`;return v.jsxs("svg",{className:ct(["react-flow__background",m]),style:{...g,...Ds,"--xy-background-color-props":h,"--xy-background-pattern-color-props":f},ref:b,"data-testid":"rf__background",children:[v.jsx("pattern",{id:U,x:p[0]%O[0],y:p[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${H[0]},-${H[1]})`,children:E?v.jsx(JE,{radius:_/2,className:y}):v.jsx(QE,{dimensions:k,lineWidth:o,variant:a,className:y})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}km.displayName="Background";const IE=D.memo(km);function PE(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function e_(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function t_(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 n_(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 l_(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 Sl({children:n,className:a,...u}){return v.jsx("button",{type:"button",className:ct(["react-flow__controls-button",a]),...u,children:n})}const a_=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Rm({style:n,showZoom:a=!0,showFitView:u=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:f,onFitView:h,onInteractiveChange:g,className:m,children:y,position:b="bottom-left",orientation:p="vertical","aria-label":x}){const w=Ie(),{isInteractive:E,minZoomReached:N,maxZoomReached:M,ariaLabelConfig:O}=Re(a_,Fe),{zoomIn:_,zoomOut:C,fitView:k}=Va(),H=()=>{_(),c==null||c()},U=()=>{C(),f==null||f()},Q=()=>{k(o),h==null||h()},q=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),g==null||g(!E)},te=p==="horizontal"?"horizontal":"vertical";return v.jsxs(bl,{className:ct(["react-flow__controls",te,m]),position:b,style:n,"data-testid":"rf__controls","aria-label":x??O["controls.ariaLabel"],children:[a&&v.jsxs(v.Fragment,{children:[v.jsx(Sl,{onClick:H,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:M,children:v.jsx(PE,{})}),v.jsx(Sl,{onClick:U,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(e_,{})})]}),u&&v.jsx(Sl,{className:"react-flow__controls-fitview",onClick:Q,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:v.jsx(t_,{})}),s&&v.jsx(Sl,{className:"react-flow__controls-interactive",onClick:q,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:E?v.jsx(l_,{}):v.jsx(n_,{})}),y]})}Rm.displayName="Controls";const Hm=D.memo(Rm);function i_({id:n,x:a,y:u,width:s,height:o,style:c,color:f,strokeColor:h,strokeWidth:g,className:m,borderRadius:y,shapeRendering:b,selected:p,onClick:x}){const{background:w,backgroundColor:E}=c||{},N=f||w||E;return v.jsx("rect",{className:ct(["react-flow__minimap-node",{selected:p},m]),x:a,y:u,rx:y,ry:y,width:s,height:o,style:{fill:N,stroke:h,strokeWidth:g},shapeRendering:b,onClick:x?M=>x(M,n):void 0})}const u_=D.memo(i_),s_=n=>n.nodes.map(a=>a.id),nc=n=>n instanceof Function?n:()=>n;function o_({nodeStrokeColor:n,nodeColor:a,nodeClassName:u="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:c=u_,onClick:f}){const h=Re(s_,Fe),g=nc(a),m=nc(n),y=nc(u),b=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:h.map(p=>v.jsx(c_,{id:p,nodeColorFunc:g,nodeStrokeColorFunc:m,nodeClassNameFunc:y,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:c,onClick:f,shapeRendering:b},p))})}function r_({id:n,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:f,NodeComponent:h,onClick:g}){const{node:m,x:y,y:b,width:p,height:x}=Re(w=>{const{internals:E}=w.nodeLookup.get(n),N=E.userNode,{x:M,y:O}=E.positionAbsolute,{width:_,height:C}=Kn(N);return{node:N,x:M,y:O,width:_,height:C}},Fe);return!m||m.hidden||!Qh(m)?null:v.jsx(h,{x:y,y:b,width:p,height:x,style:m.style,selected:!!m.selected,className:s(m),color:a(m),borderRadius:o,strokeColor:u(m),strokeWidth:c,shapeRendering:f,onClick:g,id:m.id})}const c_=D.memo(r_);var f_=D.memo(o_);const d_=200,h_=150,g_=n=>!n.hidden,m_=n=>{const a={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:a,boundingRect:n.nodeLookup.size>0?Zh($i(n.nodeLookup,{filter:g_}),a):a,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},p_="react-flow__minimap-desc";function Lm({style:n,className:a,nodeStrokeColor:u,nodeColor:s,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:f,nodeComponent:h,bgColor:g,maskColor:m,maskStrokeColor:y,maskStrokeWidth:b,position:p="bottom-right",onClick:x,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:M,inversePan:O,zoomStep:_=1,offsetScale:C=5}){const k=Ie(),H=D.useRef(null),{boundingRect:U,viewBB:Q,rfId:q,panZoom:te,translateExtent:J,flowWidth:V,flowHeight:Y,ariaLabelConfig:j}=Re(m_,Fe),B=(n==null?void 0:n.width)??d_,z=(n==null?void 0:n.height)??h_,L=U.width/B,G=U.height/z,X=Math.max(L,G),A=X*B,$=X*z,F=C*X,le=U.x-(A-U.width)/2-F,ee=U.y-($-U.height)/2-F,de=A+F*2,fe=$+F*2,he=`${p_}-${q}`,ie=D.useRef(0),ge=D.useRef();ie.current=X,D.useEffect(()=>{if(H.current&&te)return ge.current=Rw({domNode:H.current,panZoom:te,getTransform:()=>k.getState().transform,getViewScale:()=>ie.current}),()=>{var pe;(pe=ge.current)==null||pe.destroy()}},[te]),D.useEffect(()=>{var pe;(pe=ge.current)==null||pe.update({translateExtent:J,width:V,height:Y,inversePan:O,pannable:E,zoomStep:_,zoomable:N})},[E,N,O,_,J,V,Y]);const me=x?pe=>{var je;const[we,Ae]=((je=ge.current)==null?void 0:je.pointer(pe))||[0,0];x(pe,{x:we,y:Ae})}:void 0,be=w?D.useCallback((pe,we)=>{const Ae=k.getState().nodeLookup.get(we).internals.userNode;w(pe,Ae)},[]):void 0,xe=M??j["minimap.ariaLabel"];return v.jsx(bl,{position:p,style:{...n,"--xy-minimap-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof b=="number"?b*X:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-node-stroke-width-props":typeof f=="number"?f:void 0},className:ct(["react-flow__minimap",a]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:B,height:z,viewBox:`${le} ${ee} ${de} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:H,onClick:me,children:[xe&&v.jsx("title",{id:he,children:xe}),v.jsx(f_,{onClick:be,nodeColor:s,nodeStrokeColor:u,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:f,nodeComponent:h}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${le-F},${ee-F}h${de+F*2}v${fe+F*2}h${-de-F*2}z
|
|
71
|
-
M${Q.x},${Q.y}h${Q.width}v${Q.height}h${-Q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Lm.displayName="MiniMap",D.memo(Lm);const y_=n=>a=>n?`${Math.max(1/a.transform[2],1)}`:void 0,v_={[aa.Line]:"right",[aa.Handle]:"bottom-right"};function b_({nodeId:n,position:a,variant:u=aa.Handle,className:s,style:o=void 0,children:c,color:f,minWidth:h=10,minHeight:g=10,maxWidth:m=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:b=!1,resizeDirection:p,autoScale:x=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:M}){const O=em(),_=typeof n=="string"?n:O,C=Ie(),k=D.useRef(null),H=u===aa.Handle,U=Re(D.useCallback(y_(H&&x),[H,x]),Fe),Q=D.useRef(null),q=a??v_[u];D.useEffect(()=>{if(!(!k.current||!_))return Q.current||(Q.current=Pw({domNode:k.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:J,transform:V,snapGrid:Y,snapToGrid:j,nodeOrigin:B,domNode:z}=C.getState();return{nodeLookup:J,transform:V,snapGrid:Y,snapToGrid:j,nodeOrigin:B,paneDomNode:z}},onChange:(J,V)=>{const{triggerNodeChanges:Y,nodeLookup:j,parentLookup:B,nodeOrigin:z}=C.getState(),L=[],G={x:J.x,y:J.y},X=j.get(_);if(X&&X.expandParent&&X.parentId){const A=X.origin??z,$=J.width??X.measured.width??0,F=J.height??X.measured.height??0,le={id:X.id,parentId:X.parentId,rect:{width:$,height:F,...Jh({x:J.x??X.position.x,y:J.y??X.position.y},{width:$,height:F},X.parentId,j,A)}},ee=Xr([le],j,B,z);L.push(...ee),G.x=J.x?Math.max(A[0]*$,J.x):void 0,G.y=J.y?Math.max(A[1]*F,J.y):void 0}if(G.x!==void 0&&G.y!==void 0){const A={id:_,type:"position",position:{...G}};L.push(A)}if(J.width!==void 0&&J.height!==void 0){const $={id:_,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:J.width,height:J.height}};L.push($)}for(const A of V){const $={...A,type:"position"};L.push($)}Y(L)},onEnd:({width:J,height:V})=>{const Y={id:_,type:"dimensions",resizing:!1,dimensions:{width:J,height:V}};C.getState().triggerNodeChanges([Y])}})),Q.current.update({controlPosition:q,boundaries:{minWidth:h,minHeight:g,maxWidth:m,maxHeight:y},keepAspectRatio:b,resizeDirection:p,onResizeStart:E,onResize:N,onResizeEnd:M,shouldResize:w}),()=>{var J;(J=Q.current)==null||J.destroy()}},[q,h,g,m,y,b,E,N,M,w]);const te=q.split("-");return v.jsx("div",{className:ct(["react-flow__resize-control","nodrag",...te,u,s]),ref:k,style:{...o,scale:U,...f&&{[H?"backgroundColor":"borderColor"]:f}},children:c})}const Um=D.memo(b_);function lc({nodeId:n,isVisible:a=!0,handleClassName:u,handleStyle:s,lineClassName:o,lineStyle:c,color:f,minWidth:h=10,minHeight:g=10,maxWidth:m=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:b=!1,autoScale:p=!0,shouldResize:x,onResizeStart:w,onResize:E,onResizeEnd:N}){return a?v.jsxs(v.Fragment,{children:[Zw.map(M=>v.jsx(Um,{className:o,style:c,nodeId:n,position:M,variant:aa.Line,color:f,minWidth:h,minHeight:g,maxWidth:m,maxHeight:y,onResizeStart:w,keepAspectRatio:b,autoScale:p,shouldResize:x,onResize:E,onResizeEnd:N},M)),Gw.map(M=>v.jsx(Um,{className:u,style:s,nodeId:n,position:M,color:f,minWidth:h,minHeight:g,maxWidth:m,maxHeight:y,onResizeStart:w,keepAspectRatio:b,autoScale:p,shouldResize:x,onResize:E,onResizeEnd:N},M))]}):null}function x_(n,a){var u={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&a.indexOf(s)<0&&(u[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(n);o<s.length;o++)a.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(n,s[o])&&(u[s[o]]=n[s[o]]);return u}function ac(n,a,u,s){function o(c){return c instanceof u?c:new u(function(f){f(c)})}return new(u||(u=Promise))(function(c,f){function h(y){try{m(s.next(y))}catch(b){f(b)}}function g(y){try{m(s.throw(y))}catch(b){f(b)}}function m(y){y.done?c(y.value):o(y.value).then(h,g)}m((s=s.apply(n,a||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;const Bm=({data:n,selected:a})=>v.jsx(v.Fragment,{children:n.data?v.jsxs(v.Fragment,{children:[v.jsx(lc,{isVisible:a,keepAspectRatio:!0}),v.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",overflow:"hidden"},children:v.jsx("img",{src:n.data,style:{maxWidth:"100%",maxHeight:"100%"}})})]}):v.jsx("span",{children:"No Image"})});/**
|
|
72
|
-
* @license lucide-react v0.544.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const w_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S_=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,u,s)=>s?s.toUpperCase():u.toLowerCase()),Vm=n=>{const a=S_(n);return a.charAt(0).toUpperCase()+a.slice(1)},Ym=(...n)=>n.filter((a,u,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===u).join(" ").trim(),E_=n=>{for(const a in n)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
|
|
77
|
-
* @license lucide-react v0.544.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/var __={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
82
|
-
* @license lucide-react v0.544.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const N_=D.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:u=2,absoluteStrokeWidth:s,className:o="",children:c,iconNode:f,...h},g)=>D.createElement("svg",{ref:g,...__,width:a,height:a,stroke:n,strokeWidth:s?Number(u)*24/Number(a):u,className:Ym("lucide",o),...!c&&!E_(h)&&{"aria-hidden":"true"},...h},[...f.map(([m,y])=>D.createElement(m,y)),...Array.isArray(c)?c:[c]]));/**
|
|
87
|
-
* @license lucide-react v0.544.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const $e=(n,a)=>{const u=D.forwardRef(({className:s,...o},c)=>D.createElement(N_,{ref:c,iconNode:a,className:Ym(`lucide-${w_(Vm(n))}`,`lucide-${n}`,s),...o}));return u.displayName=Vm(n),u};/**
|
|
92
|
-
* @license lucide-react v0.544.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const C_=$e("align-center-horizontal",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]]);/**
|
|
97
|
-
* @license lucide-react v0.544.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const M_=$e("align-center-vertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]]);/**
|
|
102
|
-
* @license lucide-react v0.544.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const T_=$e("align-end-horizontal",[["rect",{width:"6",height:"16",x:"4",y:"2",rx:"2",key:"z5wdxg"}],["rect",{width:"6",height:"9",x:"14",y:"9",rx:"2",key:"um7a8w"}],["path",{d:"M22 22H2",key:"19qnx5"}]]);/**
|
|
107
|
-
* @license lucide-react v0.544.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const A_=$e("align-horizontal-distribute-center",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M17 22v-5",key:"4b6g73"}],["path",{d:"M17 7V2",key:"hnrr36"}],["path",{d:"M7 22v-3",key:"1r4jpn"}],["path",{d:"M7 5V2",key:"liy1u9"}]]);/**
|
|
112
|
-
* @license lucide-react v0.544.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const j_=$e("align-end-vertical",[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]]);/**
|
|
117
|
-
* @license lucide-react v0.544.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const O_=$e("align-start-horizontal",[["rect",{width:"6",height:"16",x:"4",y:"6",rx:"2",key:"1n4dg1"}],["rect",{width:"6",height:"9",x:"14",y:"6",rx:"2",key:"17khns"}],["path",{d:"M22 2H2",key:"fhrpnj"}]]);/**
|
|
122
|
-
* @license lucide-react v0.544.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const z_=$e("align-vertical-distribute-center",[["path",{d:"M22 17h-3",key:"1lwga1"}],["path",{d:"M22 7h-5",key:"o2endc"}],["path",{d:"M5 17H2",key:"1gx9xc"}],["path",{d:"M7 7H2",key:"6bq26l"}],["rect",{x:"5",y:"14",width:"14",height:"6",rx:"2",key:"1qrzuf"}],["rect",{x:"7",y:"4",width:"10",height:"6",rx:"2",key:"we8e9z"}]]);/**
|
|
127
|
-
* @license lucide-react v0.544.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const D_=$e("align-start-vertical",[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}]]);/**
|
|
132
|
-
* @license lucide-react v0.544.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const k_=$e("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);/**
|
|
137
|
-
* @license lucide-react v0.544.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const ic=$e("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
142
|
-
* @license lucide-react v0.544.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const R_=$e("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
147
|
-
* @license lucide-react v0.544.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const H_=$e("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);/**
|
|
152
|
-
* @license lucide-react v0.544.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const L_=$e("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
157
|
-
* @license lucide-react v0.544.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const U_=$e("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
162
|
-
* @license lucide-react v0.544.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const B_=$e("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
167
|
-
* @license lucide-react v0.544.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const qm=$e("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
172
|
-
* @license lucide-react v0.544.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const V_=$e("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);/**
|
|
177
|
-
* @license lucide-react v0.544.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const Pi=$e("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
182
|
-
* @license lucide-react v0.544.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const Y_=$e("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
|
|
187
|
-
* @license lucide-react v0.544.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const q_=$e("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
192
|
-
* @license lucide-react v0.544.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const Xm=$e("ruler-dimension-line",[["path",{d:"M12 15v-3.014",key:"aw6ppf"}],["path",{d:"M16 15v-3.014",key:"9e0vc7"}],["path",{d:"M20 6H4",key:"1lfz86"}],["path",{d:"M20 8V4",key:"1l2g47"}],["path",{d:"M4 8V4",key:"sppxzt"}],["path",{d:"M8 15v-3.014",key:"when08"}],["rect",{x:"3",y:"12",width:"18",height:"7",rx:"1",key:"1ucwdz"}]]);/**
|
|
197
|
-
* @license lucide-react v0.544.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const Hs=$e("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
202
|
-
* @license lucide-react v0.544.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const X_=$e("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
207
|
-
* @license lucide-react v0.544.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const $_=$e("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
212
|
-
* @license lucide-react v0.544.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const Ya=$e("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
|
|
217
|
-
* @license lucide-react v0.544.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const G_=$e("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
|
|
222
|
-
* @license lucide-react v0.544.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const ua=$e("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$m=n=>{var{data:a,selected:u,isConnectable:s}=n;return x_(n,["data","selected","isConnectable"]),v.jsxs(v.Fragment,{children:[s&&v.jsx(lc,{isVisible:u}),v.jsx(R_,{className:"icon"}),v.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:v.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:a.label||"Untitled"})}),a.summary&&v.jsx("div",{style:{fontSize:"12px",color:"#4b5563",marginTop:"4px"},children:a.summary}),["Bottom","Top","Left","Right"].map(o=>v.jsx(xl,{type:"source",position:ve[o],style:{visibility:s?"visible":"hidden"},id:o.toLowerCase(),isConnectable:!0},`${o}-source`)),["Bottom","Top","Left","Right"].map(o=>v.jsx(xl,{type:"target",position:ve[o],style:{visibility:s?"visible":"hidden"},id:o.toLowerCase(),isConnectable:!0},`${o}-target`))]})},Gm=({data:n})=>v.jsx(v.Fragment,{children:v.jsx("div",{style:{fontSize:n.fontSize||32,color:n.color||"#e5e7eb",fontWeight:"bold",transform:`rotate(${n.rotation||0}deg)`},children:n.text||"No Text"})}),uc=n=>v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",className:n.className,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("path",{d:"M11.051 7.616a1 1 0 0 1 1.909.024l.737 1.452a1 1 0 0 0 .737.535l1.634.256a1 1 0 0 1 .588 1.806l-1.172 1.168a1 1 0 0 0-.282.866l.259 1.613a1 1 0 0 1-1.541 1.134l-1.465-.75a1 1 0 0 0-.912 0l-1.465.75a1 1 0 0 1-1.539-1.133l.258-1.613a1 1 0 0 0-.282-.867l-1.156-1.152a1 1 0 0 1 .572-1.822l1.633-.256a1 1 0 0 0 .737-.535z"})]}),Zm=({data:n,selected:a,isConnectable:u})=>v.jsxs(v.Fragment,{children:[u&&v.jsx(lc,{isVisible:a}),n.state==="mastered"&&v.jsx(uc,{className:"icon"}),v.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:v.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:n.label||"Untitled"})}),n.summary&&v.jsx("div",{style:{fontSize:"12px",color:"#4b5563",marginTop:"4px"},children:n.summary}),["Bottom","Top","Left","Right"].map(s=>v.jsx(xl,{type:"source",style:{visibility:u?"visible":"hidden"},position:ve[s],id:s.toLowerCase(),isConnectable:!0},`${s}-source`)),["Bottom","Top","Left","Right"].map(s=>v.jsx(xl,{type:"target",style:{visibility:u?"visible":"hidden"},position:ve[s],id:s.toLowerCase(),isConnectable:!0},`${s}-target`))]});function Km(n,a){const{width:u,height:s}=n.measured,o=n.internals.positionAbsolute,c=a.internals.positionAbsolute,f=u/2,h=s/2,g=o.x+f,m=o.y+h,y=c.x+a.measured.width/2,b=c.y+a.measured.height/2,p=(y-g)/(2*f)-(b-m)/(2*h),x=(y-g)/(2*f)+(b-m)/(2*h),w=1/(Math.abs(p)+Math.abs(x)),E=w*p,N=w*x,M=f*(E+N)+g,O=h*(-E+N)+m;return{x:M,y:O}}function Qm(n,a){const u=Object.assign(Object.assign({},n.internals.positionAbsolute),n),s=Math.round(u.x),o=Math.round(u.y),c=Math.round(a.x),f=Math.round(a.y);return c<=s+1?ve.Left:c>=s+u.measured.width-1?ve.Right:f<=o+1?ve.Top:f>=u.y+u.measured.height-1?ve.Bottom:ve.Top}function Z_(n,a){const u=Km(n,a),s=Km(a,n),o=Qm(n,u),c=Qm(a,s);return{sx:u.x,sy:u.y,tx:s.x,ty:s.y,sourcePos:o,targetPos:c}}const Jm=n=>{if(typeof n!="string")return n||{};try{return JSON.parse(n)}catch(a){return console.error("Failed to parse roadmap data:",a),{settings:{title:"New Roadmap"},version:1}}};function K_(n){return typeof n=="string"&&(n.includes("youtube.com/watch?v=")||n.includes("youtu.be/"))}function Q_(n){return n.includes("youtube.com/watch?v=")?`https://www.youtube-nocookie.com/embed/${n.split("v=")[1].split("&")[0]}`:n.includes("youtu.be/")?`https://www.youtube-nocookie.com/embed/${n.split("youtu.be/")[1].split("?")[0]}`:n}function J_(n){return n.endsWith(".webm")?"video/webm":(n.endsWith(".mp4"),"video/mp4")}const W_=({url:n,title:a})=>{if(K_(n)){const u=Q_(n);return v.jsx("div",{className:"video-container",style:{position:"relative",paddingBottom:"56.25%",height:0,overflow:"hidden",marginBottom:16},children:v.jsx("iframe",{src:u,title:a||"YouTube video",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})})}else{const u=J_(n);return v.jsxs("video",{controls:!0,style:{width:"100%",maxHeight:"400px",marginBottom:16},children:[v.jsx("source",{src:n,type:u}),"Your browser does not support the video tag."]})}},Wm={en:{nodes:"Nodes",addTask:"Add Task",addTopic:"Add Topic",addImage:"Add Image",addText:"Add Text",settings:"Settings",debug:"Debug",enableDebugMode:"Enable Debug Mode",showCompletionNeedsEdges:"Show Completion Needs Edges",showCompletionOptionalEdges:"Show Completion Optional Edges",showUnlockAfterEdges:"Show Unlock After Edges",preview:"Preview",save:"Save",download:"Download",open:"Open",exportAsSVG:"Export as SVG",undo:"Undo",redo:"Redo",reset:"Reset",help:"Help",unsavedChanges:"Unsaved Changes (Click to save or press Ctrl+S)",keyboardShortcuts:"Keyboard Shortcuts",action:"Action",shortcut:"Shortcut",close:"Close",shortcuts:{save:"Save",undo:"Undo",redo:"Redo",addTaskNode:"Add Task Node",addTopicNode:"Add Topic Node",addImageNode:"Add Image Node",addTextNode:"Add Text Node",deleteNodeEdge:"Delete Node/Edge",togglePreviewMode:"Toggle Preview Mode",toggleDebugMode:"Toggle Debug Mode",selectMultipleNodes:"Select Multiple Nodes",showHelp:"Show Help"},editTask:"Edit Task",editTopic:"Edit Topic",editImage:"Edit Image",editText:"Edit Text",backgroundSettings:"Background Settings",editEdge:"Edit Edge",nodeColor:"Node Color",label:"Label",labelRequired:"Label *",summary:"Summary",description:"Description",duration:"Duration",videoURL:"Video URL",resources:"Resources",addResource:"Add Resource",unlockPassword:"Unlock Password",unlockDate:"Unlock Date",unlockAfter:"Unlock After",completionNeeds:"Completion Needs",completionOptional:"Completion Optional",backgroundColor:"Background Color",text:"Text",fontSize:"Font Size",color:"Color",image:"Image",width:"Width",height:"Height",rotation:"Rotation",opacity:"Opacity",edgeColor:"Color",edgeWidth:"Width",edgeType:"Type",animated:"Animated",placeholderNodeLabel:"Node label",placeholderShortSummary:"Short summary",placeholderDetailedDescription:"Detailed description",placeholderVideoURL:"YouTube or video URL",placeholderLabel:"Label",placeholderURL:"URL",placeholderOptionalPassword:"Optional password",placeholderBackgroundText:"Background Text",selectNode:"Select node...",deleteNode:"Delete Node",saveChanges:"Save Changes",deleteEdge:"Delete Edge",openFileWarning:"Opening a file will replace your current map. Continue?",failedToLoadFile:"Failed to load the file. Please make sure it is a valid roadmap JSON file.",failedToExportSVG:"Failed to export SVG: ",blue:"Blue",yellow:"Yellow",lila:"Lila",pink:"Pink",teal:"Teal",red:"Red",black:"Black",white:"White",newTask:"New task",newTopic:"New topic",backgroundTextDefault:"Background Text",noText:"No Text",untitled:"Untitled",alignLeftHorizontal:"Align Left Horizontal",alignCenterHorizontal:"Align Center Horizontal",alignRightHorizontal:"Align Right Horizontal",alignTopVertical:"Align Top Vertical",alignCenterVertical:"Align Center Vertical",alignBottomVertical:"Align Bottom Vertical",distributeHorizontally:"Distribute Horizontally",distributeVertically:"Distribute Vertically",default:"Default",straight:"Straight",step:"Step",smoothstep:"Smooth Step",floating:"Floating",resourcesLabel:"Resources:",unlockConditionsMessage:"Complete the following nodes first to unlock this one:",completionNeedsMessage:"The following nodes need to be completed or mastered before this one is completed:",locked:"Locked",markAsStarted:"Mark as Started",markAsCompleted:"Mark as Completed",completedLabel:"Completed",mastered:"Mastered",completedTitle:"Completed",masteredTitle:"Mastered",finishNeedsToComplete:"Finish needs to complete",finishOptionalToMaster:"Finish optional to master",languageLabel:"Language",languageEnglish:"English",languageGerman:"German"},de:{nodes:"Knoten",addTask:"Aufgabe hinzufügen",addTopic:"Thema hinzufügen",addImage:"Bild hinzufügen",addText:"Text hinzufügen",settings:"Einstellungen",debug:"Debug",enableDebugMode:"Debug-Modus aktivieren",showCompletionNeedsEdges:"Abschluss-Benötigte Kanten anzeigen",showCompletionOptionalEdges:"Abschluss-Optionale Kanten anzeigen",showUnlockAfterEdges:"Entsperr-Nach Kanten anzeigen",preview:"Vorschau",save:"Speichern",download:"Herunterladen",open:"Öffnen",exportAsSVG:"Als SVG exportieren",undo:"Rückgängig",redo:"Wiederholen",reset:"Zurücksetzen",help:"Hilfe",unsavedChanges:"Ungespeicherte Änderungen (Klicken zum Speichern oder Strg+S drücken)",keyboardShortcuts:"Tastaturkürzel",action:"Aktion",shortcut:"Tastenkombination",close:"Schließen",shortcuts:{save:"Speichern",undo:"Rückgängig",redo:"Wiederholen",addTaskNode:"Aufgaben-Knoten hinzufügen",addTopicNode:"Themen-Knoten hinzufügen",addImageNode:"Bild-Knoten hinzufügen",addTextNode:"Text-Knoten hinzufügen",deleteNodeEdge:"Knoten/Kante löschen",togglePreviewMode:"Vorschau-Modus umschalten",toggleDebugMode:"Debug-Modus umschalten",selectMultipleNodes:"Mehrere Knoten auswählen",showHelp:"Hilfe anzeigen"},editTask:"Aufgabe bearbeiten",editTopic:"Thema bearbeiten",editImage:"Bild bearbeiten",editText:"Text bearbeiten",backgroundSettings:"Hintergrund-Einstellungen",editEdge:"Kante bearbeiten",nodeColor:"Knotenfarbe",label:"Bezeichnung",labelRequired:"Bezeichnung *",summary:"Zusammenfassung",description:"Beschreibung",duration:"Dauer",videoURL:"Video-URL",resources:"Ressourcen",addResource:"Ressource hinzufügen",unlockPassword:"Entsperr-Passwort",unlockDate:"Entsperr-Datum",unlockAfter:"Entsperren nach",completionNeeds:"Abschluss benötigt",completionOptional:"Abschluss optional",backgroundColor:"Hintergrundfarbe",text:"Text",fontSize:"Schriftgröße",color:"Farbe",image:"Bild",width:"Breite",height:"Höhe",rotation:"Drehung",opacity:"Deckkraft",edgeColor:"Farbe",edgeWidth:"Breite",edgeType:"Typ",animated:"Animiert",placeholderNodeLabel:"Knotenbezeichnung",placeholderShortSummary:"Kurze Zusammenfassung",placeholderDetailedDescription:"Detaillierte Beschreibung",placeholderVideoURL:"YouTube oder Video-URL",placeholderLabel:"Bezeichnung",placeholderURL:"URL",placeholderOptionalPassword:"Optionales Passwort",placeholderBackgroundText:"Hintergrundtext",selectNode:"Knoten auswählen...",deleteNode:"Knoten löschen",saveChanges:"Änderungen speichern",deleteEdge:"Kante löschen",openFileWarning:"Das Öffnen einer Datei ersetzt Ihre aktuelle Karte. Fortfahren?",failedToLoadFile:"Datei konnte nicht geladen werden. Bitte stellen Sie sicher, dass es sich um eine gültige Roadmap-JSON-Datei handelt.",failedToExportSVG:"SVG-Export fehlgeschlagen: ",blue:"Blau",yellow:"Gelb",lila:"Lila",pink:"Rosa",teal:"Türkis",red:"Rot",black:"Schwarz",white:"Weiß",newTask:"Neue Aufgabe",newTopic:"Neues Thema",backgroundTextDefault:"Hintergrundtext",noText:"Kein Text",untitled:"Ohne Titel",alignLeftHorizontal:"Horizontal links ausrichten",alignCenterHorizontal:"Horizontal zentrieren",alignRightHorizontal:"Horizontal rechts ausrichten",alignTopVertical:"Vertikal oben ausrichten",alignCenterVertical:"Vertikal zentrieren",alignBottomVertical:"Vertikal unten ausrichten",distributeHorizontally:"Horizontal verteilen",distributeVertically:"Vertikal verteilen",default:"Standard",straight:"Gerade",step:"Stufe",smoothstep:"Weiche Stufe",floating:"Schwebend",resourcesLabel:"Ressourcen:",unlockConditionsMessage:"Vervollständige zuerst die folgenden Knoten, um diesen freizuschalten:",completionNeedsMessage:"Die folgenden Knoten müssen abgeschlossen oder gemeistert werden, bevor dieser abgeschlossen ist:",locked:"Gesperrt",markAsStarted:"Als begonnen markieren",markAsCompleted:"Als abgeschlossen markieren",completedLabel:"Abgeschlossen",mastered:"Gemeistert",completedTitle:"Abgeschlossen",masteredTitle:"Gemeistert",finishNeedsToComplete:"Benötigtes abschließen",finishOptionalToMaster:"Optionale zum Meistern abschließen",languageLabel:"Sprache",languageEnglish:"Englisch",languageGerman:"Deutsch"}};function Nn(n="en"){return Wm[n]||Wm.en}function F_(n,a){var u,s;const o=[];return!((s=(u=n.data)===null||u===void 0?void 0:u.unlock)===null||s===void 0)&&s.after&&n.data.unlock.after.forEach(c=>{var f,h;const g=a.find(m=>m.id===c);g&&((f=g.data)===null||f===void 0?void 0:f.state)!=="completed"&&((h=g.data)===null||h===void 0?void 0:h.state)!=="mastered"&&o.push(g)}),o}function I_(n,a){var u,s;const o=[];return!((s=(u=n.data)===null||u===void 0?void 0:u.completion)===null||s===void 0)&&s.needs&&n.data.completion.needs.forEach(c=>{var f,h;const g=a.find(m=>m.id===c);g&&((f=g.data)===null||f===void 0?void 0:f.state)!=="completed"&&((h=g.data)===null||h===void 0?void 0:h.state)!=="mastered"&&o.push(g)}),o}function P_(n,a){var u,s;const o=[];return!((s=(u=n.data)===null||u===void 0?void 0:u.completion)===null||s===void 0)&&s.optional&&n.data.completion.optional.forEach(c=>{var f,h;const g=a.find(m=>m.id===c);g&&((f=g.data)===null||f===void 0?void 0:f.state)!=="completed"&&((h=g.data)===null||h===void 0?void 0:h.state)!=="mastered"&&o.push(g)}),o}function eN({open:n,onClose:a,onUpdate:u,node:s,nodes:o,onNodeClick:c,language:f="en"}){var h,g,m,y,b,p,x,w,E,N,M,O,_,C;const k=Nn(f);if(!n)return null;const H=((h=s.data)===null||h===void 0?void 0:h.state)==="locked"||!1,U=((g=s.data)===null||g===void 0?void 0:g.state)==="unlocked"||!1,Q=((m=s.data)===null||m===void 0?void 0:m.state)==="completed"||!1,q=((y=s.data)===null||y===void 0?void 0:y.state)==="started"||!1,te=((b=s.data)===null||b===void 0?void 0:b.state)==="mastered"||!1,J=F_(s,o),V=I_(s,o),Y=P_(s,o),j=B=>()=>{s.type==="topic"||H||u(Object.assign(Object.assign({},s),{data:Object.assign(Object.assign({},s.data),{state:B})}))};return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"drawer-overlay",onClick:a}),v.jsxs("aside",{className:"drawer",children:[v.jsxs("header",{className:"drawer-header",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"drawer-title",children:(p=s.data)===null||p===void 0?void 0:p.label}),((x=s.data)===null||x===void 0?void 0:x.duration)&&v.jsx("div",{style:{fontSize:16,color:"#6b7280",marginTop:4},children:s.data.duration})]}),v.jsx("button",{className:"close-button",onClick:a,"aria-label":"Close",children:v.jsx(ua,{size:20})})]}),v.jsxs("div",{className:"drawer-content",children:[((w=s.data)===null||w===void 0?void 0:w.description)&&v.jsx("div",{className:"drawer-description",style:{marginBottom:16},children:(E=s.data)===null||E===void 0?void 0:E.description}),((N=s.data)===null||N===void 0?void 0:N.video)&&v.jsx("div",{className:"drawer-video",style:{marginBottom:16},children:v.jsx(W_,{url:(M=s.data)===null||M===void 0?void 0:M.video})}),((O=s.data)===null||O===void 0?void 0:O.resources)&&((_=s.data)===null||_===void 0?void 0:_.resources.length)>0&&v.jsxs("div",{className:"drawer-resources",style:{marginBottom:16},children:[v.jsx("div",{style:{fontWeight:600,marginBottom:8},children:k.resourcesLabel}),v.jsx("ul",{children:(C=s.data)===null||C===void 0?void 0:C.resources.map(B=>v.jsx("li",{children:v.jsx("a",{href:B.url,target:"_blank",rel:"noopener noreferrer",children:B.label})},B.url))})]}),J.length>0&&v.jsxs("div",{className:"drawer-unlock-conditions",style:{marginBottom:16},children:[v.jsx("div",{style:{fontWeight:600,marginBottom:8},children:k.unlockConditionsMessage}),v.jsx("ul",{children:J.map(B=>{var z,L;return v.jsx("li",{children:v.jsxs("button",{className:"link-button",onClick:()=>{c(null,B,!0)},children:[((z=B.data)===null||z===void 0?void 0:z.label)||B.id," - ",(L=B.data)===null||L===void 0?void 0:L.state]})},B.id)})})]}),!H&&V.length>0&&v.jsxs("div",{className:"drawer-completion-needs",style:{marginBottom:16},children:[v.jsx("div",{style:{fontWeight:600,marginBottom:8},children:k.completionNeedsMessage}),v.jsx("ul",{children:V.map(B=>{var z,L;return v.jsx("li",{children:v.jsxs("button",{className:"link-button",onClick:()=>{c(null,B,!0)},children:[((z=B.data)===null||z===void 0?void 0:z.label)||B.id," - ",(L=B.data)===null||L===void 0?void 0:L.state]})},B.id)})})]})]}),v.jsx("div",{className:"drawer-footer",children:s.type==="topic"?v.jsxs(v.Fragment,{children:[!H&&V.length>0&&v.jsx("button",{className:"drawer-button needs",disabled:!0,children:k.finishNeedsToComplete}),!H&&V.length===0&&Y.length>0&&v.jsx("button",{className:"drawer-button optional",disabled:!0,children:k.finishOptionalToMaster}),!H&&V.length===0&&Y.length===0&&v.jsxs("button",{className:"drawer-button completed",disabled:!0,children:[v.jsx(ic,{})," ",k.mastered]}),H&&v.jsxs("button",{className:"drawer-button locked",children:[v.jsx(qm,{})," ",k.locked]})]}):v.jsxs(v.Fragment,{children:[H&&v.jsxs("button",{className:"drawer-button locked",children:[v.jsx(qm,{})," ",k.locked]}),U&&v.jsx("button",{className:"drawer-button unlocked",onClick:j("started"),children:k.markAsStarted}),q&&v.jsx("button",{className:"drawer-button started",onClick:j("completed"),children:k.markAsCompleted}),Q&&v.jsxs("button",{className:"drawer-button completed",disabled:!0,children:[v.jsx(ic,{})," ",k.completedLabel]}),te&&v.jsxs("button",{className:"drawer-button mastered",disabled:!0,children:[v.jsx(uc,{})," ",k.mastered]})]})})]})]})}const tN=({completed:n,mastered:a,total:u,language:s="en"})=>{const o=Nn(s),c=u>0?n/u*100:0;return v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"completed-counter",title:o.completedTitle,style:{display:"flex",alignItems:"center",gap:"4px"},children:[v.jsx(ic,{}),n," / ",u]}),v.jsxs("div",{className:"progress-bar-container",children:[v.jsxs("span",{className:"progress-value",children:[c.toFixed(0),"%"]}),v.jsx("div",{className:"progress-bar-fill",style:{width:`${c}%`}})]}),v.jsxs("span",{className:"mastered-counter",title:o.masteredTitle,style:{display:"flex",alignItems:"center",gap:"4px"},children:[v.jsx(uc,{}),a]})]})},nN={topic:Zm,task:$m,image:Bm,text:Gm},lN=n=>{const a={};return n.forEach(u=>{var s;!((s=u.data)===null||s===void 0)&&s.state&&(a[u.id]=u.data.state)}),a},sc=n=>n==="completed"||n==="mastered",Fm=n=>{var a,u,s,o,c,f,h,g,m,y,b,p,x,w,E,N,M;for(let O=0;O<2;O++){const _=lN(n);for(const C of n){if(C.data.state=((a=C.data)===null||a===void 0?void 0:a.state)||"locked",!((s=(u=C.data)===null||u===void 0?void 0:u.unlock)===null||s===void 0)&&s.after&&(C.data.unlock.after.every(H=>sc(_[H]))?C.data.state==="locked"&&(C.data.state="unlocked"):C.data.state="locked"),!((c=(o=C.data)===null||o===void 0?void 0:o.unlock)===null||c===void 0)&&c.date){const k=new Date(C.data.unlock.date);new Date>=k?C.data.state==="locked"&&(C.data.state="unlocked"):C.data.state="locked"}if(!(!((h=(f=C.data)===null||f===void 0?void 0:f.unlock)===null||h===void 0)&&h.after)&&!(!((m=(g=C.data)===null||g===void 0?void 0:g.unlock)===null||m===void 0)&&m.date)&&C.data.state==="locked"&&(C.data.state="unlocked"),C.type=="topic"){if(!((b=(y=C.data)===null||y===void 0?void 0:y.completion)===null||b===void 0)&&b.needs){const k=C.data.completion.needs.every(H=>sc(_[H]));C.data.state==="unlocked"&&k&&(C.data.state="completed")}else!(!((x=(p=C.data)===null||p===void 0?void 0:p.completion)===null||x===void 0)&&x.needs)&&C.data.state==="unlocked"&&(C.data.state="completed");if(!((E=(w=C.data)===null||w===void 0?void 0:w.completion)===null||E===void 0)&&E.optional){const k=C.data.completion.optional.every(H=>sc(_[H]));C.data.state==="completed"&&k&&(C.data.state="mastered")}else!(!((M=(N=C.data)===null||N===void 0?void 0:N.completion)===null||M===void 0)&&M.optional)&&C.data.state==="completed"&&(C.data.state="mastered")}}}return n},oc=n=>n.type==="task"||n.type==="topic",aN=n=>{let a=0,u=0,s=0;return n.forEach(o=>{var c,f;(o.type==="task"||o.type==="topic")&&(s++,((c=o.data)===null||c===void 0?void 0:c.state)==="completed"?a++:((f=o.data)===null||f===void 0?void 0:f.state)==="mastered"&&(a++,u++))}),{completed:a,mastered:u,total:s}};function Im({roadmapData:n,onChange:a,language:u="en",initialState:s}){var o;const[c,f,h]=Om([]),[g,m,y]=zm([]),[b,p]=D.useState(null),[x,w]=D.useState(!1),[E,N]=D.useState(),{fitView:M,getViewport:O,setViewport:_}=Va(),C=(E==null?void 0:E.language)||u,{completed:k,mastered:H,total:U}=aN(c),Q=Jm(n);D.useEffect(()=>{function Y(){return ac(this,void 0,void 0,function*(){const j=Array.isArray(Q==null?void 0:Q.nodes)?Q.nodes:[],B=Array.isArray(Q==null?void 0:Q.edges)?Q.edges:[];N((Q==null?void 0:Q.settings)||{});let z=j.map(L=>{var G,X;return Object.assign(Object.assign({},L),{draggable:!1,connectable:!1,selectable:oc(L),focusable:oc(L),data:Object.assign(Object.assign({},L.data),{state:(X=(G=s==null?void 0:s.nodes)===null||G===void 0?void 0:G[L.id])===null||X===void 0?void 0:X.state})})});z=Fm(z),_({x:(s==null?void 0:s.x)||0,y:(s==null?void 0:s.y)||0,zoom:(s==null?void 0:s.zoom)||1}),m(B),f(z)})}Y()},[n,s]);const q=D.useCallback((Y,j,B=!1)=>{oc(j)&&(p(j),w(!0),B&&M({nodes:[j],duration:150}))},[M]),te=D.useCallback(()=>{w(!1),p(null)},[]),J=D.useCallback(Y=>{f(j=>{let B=j.map(z=>z.id===Y.id?Y:z);return B=Fm(B),B}),p(Y)},[f]);D.useEffect(()=>{const Y=O(),j={nodes:{},x:Y.x,y:Y.y,zoom:Y.zoom};if(c.forEach(B=>{B.data.state&&B.type==="task"&&(j.nodes[B.id]={state:B.data.state})}),a)a(j);else{const B=document.querySelector("hyperbook-learningmap");B&&B.dispatchEvent(new CustomEvent("change",{detail:j}))}},[c]);const V={animated:!1,style:{stroke:"#94a3b8",strokeWidth:2},type:"default"};return v.jsxs("div",{className:"editor-canvas",style:{backgroundColor:((o=E==null?void 0:E.background)===null||o===void 0?void 0:o.color)||"#ffffff"},children:[v.jsxs(jm,{nodes:c.map(Y=>{var j,B;const z=[];return!((j=Y.data)===null||j===void 0)&&j.color&&z.push(Y.data.color),z.push((B=Y.data)===null||B===void 0?void 0:B.state),Object.assign(Object.assign({},Y),{selected:(b==null?void 0:b.id)===Y.id,className:z.join(" ")})}),edges:g,onEdgesChange:y,onNodeClick:q,onNodesChange:h,nodeTypes:nN,fitView:!0,proOptions:{hideAttribution:!0},defaultEdgeOptions:V,nodesDraggable:!1,nodesConnectable:!1,children:[(E==null?void 0:E.title)&&v.jsx(bl,{position:"bottom-right",children:v.jsx("div",{className:"map-title",children:E.title})}),v.jsx(bl,{position:"top-center",className:"progress-panel",children:v.jsx(tN,{completed:k,total:U,mastered:H,language:C})}),v.jsx(Hm,{showInteractive:!1})]}),v.jsx(eN,{node:b,open:x,onClose:te,onUpdate:J,nodes:c,onNodeClick:q,language:C})]})}function iN({roadmapData:n,language:a,onChange:u,initialState:s}){return v.jsx("div",{className:"hyperbook-learningmap-container",children:v.jsx(tc,{children:v.jsx(Im,{language:a,roadmapData:n,onChange:u,initialState:s})})})}function uN(n,a){if(n.match(/^[a-z]+:\/\//i))return n;if(n.match(/^\/\//))return window.location.protocol+n;if(n.match(/^[a-z]+:/i))return n;const u=document.implementation.createHTMLDocument(),s=u.createElement("base"),o=u.createElement("a");return u.head.appendChild(s),u.body.appendChild(o),a&&(s.href=a),o.href=n,o.href}const sN=(()=>{let n=0;const a=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(n+=1,`u${a()}${n}`)})();function Qn(n){const a=[];for(let u=0,s=n.length;u<s;u++)a.push(n[u]);return a}function Ls(n,a){const s=(n.ownerDocument.defaultView||window).getComputedStyle(n).getPropertyValue(a);return s?parseFloat(s.replace("px","")):0}function oN(n){const a=Ls(n,"border-left-width"),u=Ls(n,"border-right-width");return n.clientWidth+a+u}function rN(n){const a=Ls(n,"border-top-width"),u=Ls(n,"border-bottom-width");return n.clientHeight+a+u}function cN(n,a={}){const u=a.width||oN(n),s=a.height||rN(n);return{width:u,height:s}}function rc(n){return new Promise((a,u)=>{const s=new Image;s.decode=()=>a(s),s.onload=()=>a(s),s.onerror=u,s.crossOrigin="anonymous",s.decoding="async",s.src=n})}async function fN(n){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(n)).then(encodeURIComponent).then(a=>`data:image/svg+xml;charset=utf-8,${a}`)}async function dN(n,a,u){const s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),c=document.createElementNS(s,"foreignObject");return o.setAttribute("width",`${a}`),o.setAttribute("height",`${u}`),o.setAttribute("viewBox",`0 0 ${a} ${u}`),c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("externalResourcesRequired","true"),o.appendChild(c),c.appendChild(n),fN(o)}const Xt=(n,a)=>{if(n instanceof a)return!0;const u=Object.getPrototypeOf(n);return u===null?!1:u.constructor.name===a.name||Xt(u,a)};function hN(n){const a=n.getPropertyValue("content");return`${n.cssText} content: '${a.replace(/'|"/g,"")}';`}function gN(n){return Qn(n).map(a=>{const u=n.getPropertyValue(a),s=n.getPropertyPriority(a);return`${a}: ${u}${s?" !important":""};`}).join(" ")}function mN(n,a,u){const s=`.${n}:${a}`,o=u.cssText?hN(u):gN(u);return document.createTextNode(`${s}{${o}}`)}function Pm(n,a,u){const s=window.getComputedStyle(n,u),o=s.getPropertyValue("content");if(o===""||o==="none")return;const c=sN();try{a.className=`${a.className} ${c}`}catch{return}const f=document.createElement("style");f.appendChild(mN(c,u,s)),a.appendChild(f)}function pN(n,a){Pm(n,a,":before"),Pm(n,a,":after")}const ep="application/font-woff",tp="image/jpeg",yN={woff:ep,woff2:ep,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tp,jpeg:tp,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function vN(n){const a=/\.([^./]*?)$/g.exec(n);return a?a[1]:""}function cc(n){const a=vN(n).toLowerCase();return yN[a]||""}function bN(n){return n.split(/,/)[1]}function fc(n){return n.search(/^(data:)/)!==-1}function xN(n,a){return`data:${a};base64,${n}`}async function np(n,a,u){const s=await fetch(n,a);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const o=await s.blob();return new Promise((c,f)=>{const h=new FileReader;h.onerror=f,h.onloadend=()=>{try{c(u({res:s,result:h.result}))}catch(g){f(g)}},h.readAsDataURL(o)})}const dc={};function wN(n,a,u){let s=n.replace(/\?.*/,"");return u&&(s=n),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),a?`[${a}]${s}`:s}async function hc(n,a,u){const s=wN(n,a,u.includeQueryParams);if(dc[s]!=null)return dc[s];u.cacheBust&&(n+=(/\?/.test(n)?"&":"?")+new Date().getTime());let o;try{const c=await np(n,u.fetchRequestInit,({res:f,result:h})=>(a||(a=f.headers.get("Content-Type")||""),bN(h)));o=xN(c,a)}catch(c){o=u.imagePlaceholder||"";let f=`Failed to fetch resource: ${n}`;c&&(f=typeof c=="string"?c:c.message),f&&console.warn(f)}return dc[s]=o,o}async function SN(n){const a=n.toDataURL();return a==="data:,"?n.cloneNode(!1):rc(a)}async function EN(n,a){if(n.currentSrc){const c=document.createElement("canvas"),f=c.getContext("2d");c.width=n.clientWidth,c.height=n.clientHeight,f==null||f.drawImage(n,0,0,c.width,c.height);const h=c.toDataURL();return rc(h)}const u=n.poster,s=cc(u),o=await hc(u,s,a);return rc(o)}async function _N(n){var a;try{if(!((a=n==null?void 0:n.contentDocument)===null||a===void 0)&&a.body)return await Us(n.contentDocument.body,{},!0)}catch{}return n.cloneNode(!1)}async function NN(n,a){return Xt(n,HTMLCanvasElement)?SN(n):Xt(n,HTMLVideoElement)?EN(n,a):Xt(n,HTMLIFrameElement)?_N(n):n.cloneNode(!1)}const CN=n=>n.tagName!=null&&n.tagName.toUpperCase()==="SLOT";async function MN(n,a,u){var s,o;let c=[];return CN(n)&&n.assignedNodes?c=Qn(n.assignedNodes()):Xt(n,HTMLIFrameElement)&&(!((s=n.contentDocument)===null||s===void 0)&&s.body)?c=Qn(n.contentDocument.body.childNodes):c=Qn(((o=n.shadowRoot)!==null&&o!==void 0?o:n).childNodes),c.length===0||Xt(n,HTMLVideoElement)||await c.reduce((f,h)=>f.then(()=>Us(h,u)).then(g=>{g&&a.appendChild(g)}),Promise.resolve()),a}function TN(n,a){const u=a.style;if(!u)return;const s=window.getComputedStyle(n);s.cssText?(u.cssText=s.cssText,u.transformOrigin=s.transformOrigin):Qn(s).forEach(o=>{let c=s.getPropertyValue(o);o==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Xt(n,HTMLIFrameElement)&&o==="display"&&c==="inline"&&(c="block"),o==="d"&&a.getAttribute("d")&&(c=`path(${a.getAttribute("d")})`),u.setProperty(o,c,s.getPropertyPriority(o))})}function AN(n,a){Xt(n,HTMLTextAreaElement)&&(a.innerHTML=n.value),Xt(n,HTMLInputElement)&&a.setAttribute("value",n.value)}function jN(n,a){if(Xt(n,HTMLSelectElement)){const u=a,s=Array.from(u.children).find(o=>n.value===o.getAttribute("value"));s&&s.setAttribute("selected","")}}function ON(n,a){return Xt(a,Element)&&(TN(n,a),pN(n,a),AN(n,a),jN(n,a)),a}async function zN(n,a){const u=n.querySelectorAll?n.querySelectorAll("use"):[];if(u.length===0)return n;const s={};for(let c=0;c<u.length;c++){const h=u[c].getAttribute("xlink:href");if(h){const g=n.querySelector(h),m=document.querySelector(h);!g&&m&&!s[h]&&(s[h]=await Us(m,a,!0))}}const o=Object.values(s);if(o.length){const c="http://www.w3.org/1999/xhtml",f=document.createElementNS(c,"svg");f.setAttribute("xmlns",c),f.style.position="absolute",f.style.width="0",f.style.height="0",f.style.overflow="hidden",f.style.display="none";const h=document.createElementNS(c,"defs");f.appendChild(h);for(let g=0;g<o.length;g++)h.appendChild(o[g]);n.appendChild(f)}return n}async function Us(n,a,u){return!u&&a.filter&&!a.filter(n)?null:Promise.resolve(n).then(s=>NN(s,a)).then(s=>MN(n,s,a)).then(s=>ON(n,s)).then(s=>zN(s,a))}const lp=/url\((['"]?)([^'"]+?)\1\)/g,DN=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,kN=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function RN(n){const a=n.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${a})(['"]?\\))`,"g")}function HN(n){const a=[];return n.replace(lp,(u,s,o)=>(a.push(o),u)),a.filter(u=>!fc(u))}async function LN(n,a,u,s,o){try{const c=u?uN(a,u):a,f=cc(a);let h;return o||(h=await hc(c,f,s)),n.replace(RN(a),`$1${h}$3`)}catch{}return n}function UN(n,{preferredFontFormat:a}){return a?n.replace(kN,u=>{for(;;){const[s,,o]=DN.exec(u)||[];if(!o)return"";if(o===a)return`src: ${s};`}}):n}function ap(n){return n.search(lp)!==-1}async function ip(n,a,u){if(!ap(n))return n;const s=UN(n,u);return HN(s).reduce((c,f)=>c.then(h=>LN(h,f,a,u)),Promise.resolve(s))}async function Bs(n,a,u){var s;const o=(s=a.style)===null||s===void 0?void 0:s.getPropertyValue(n);if(o){const c=await ip(o,null,u);return a.style.setProperty(n,c,a.style.getPropertyPriority(n)),!0}return!1}async function BN(n,a){await Bs("background",n,a)||await Bs("background-image",n,a),await Bs("mask",n,a)||await Bs("mask-image",n,a)}async function VN(n,a){const u=Xt(n,HTMLImageElement);if(!(u&&!fc(n.src))&&!(Xt(n,SVGImageElement)&&!fc(n.href.baseVal)))return;const s=u?n.src:n.href.baseVal,o=await hc(s,cc(s),a);await new Promise((c,f)=>{n.onload=c,n.onerror=f;const h=n;h.decode&&(h.decode=c),h.loading==="lazy"&&(h.loading="eager"),u?(n.srcset="",n.src=o):n.href.baseVal=o})}async function YN(n,a){const s=Qn(n.childNodes).map(o=>up(o,a));await Promise.all(s).then(()=>n)}async function up(n,a){Xt(n,Element)&&(await BN(n,a),await VN(n,a),await YN(n,a))}function qN(n,a){const{style:u}=n;a.backgroundColor&&(u.backgroundColor=a.backgroundColor),a.width&&(u.width=`${a.width}px`),a.height&&(u.height=`${a.height}px`);const s=a.style;return s!=null&&Object.keys(s).forEach(o=>{u[o]=s[o]}),n}const sp={};async function op(n){let a=sp[n];if(a!=null)return a;const s=await(await fetch(n)).text();return a={url:n,cssText:s},sp[n]=a,a}async function rp(n,a){let u=n.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,c=(u.match(/url\([^)]+\)/g)||[]).map(async f=>{let h=f.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,n.url).href),np(h,a.fetchRequestInit,({result:g})=>(u=u.replace(f,`url(${g})`),[f,g]))});return Promise.all(c).then(()=>u)}function cp(n){if(n==null)return[];const a=[],u=/(\/\*[\s\S]*?\*\/)/gi;let s=n.replace(u,"");const o=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const g=o.exec(s);if(g===null)break;a.push(g[0])}s=s.replace(o,"");const c=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,f="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(f,"gi");for(;;){let g=c.exec(s);if(g===null){if(g=h.exec(s),g===null)break;c.lastIndex=h.lastIndex}else h.lastIndex=c.lastIndex;a.push(g[0])}return a}async function XN(n,a){const u=[],s=[];return n.forEach(o=>{if("cssRules"in o)try{Qn(o.cssRules||[]).forEach((c,f)=>{if(c.type===CSSRule.IMPORT_RULE){let h=f+1;const g=c.href,m=op(g).then(y=>rp(y,a)).then(y=>cp(y).forEach(b=>{try{o.insertRule(b,b.startsWith("@import")?h+=1:o.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:b,error:p})}})).catch(y=>{console.error("Error loading remote css",y.toString())});s.push(m)}})}catch(c){const f=n.find(h=>h.href==null)||document.styleSheets[0];o.href!=null&&s.push(op(o.href).then(h=>rp(h,a)).then(h=>cp(h).forEach(g=>{f.insertRule(g,o.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(n.forEach(o=>{if("cssRules"in o)try{Qn(o.cssRules||[]).forEach(c=>{u.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${o.href}`,c)}}),u))}function $N(n){return n.filter(a=>a.type===CSSRule.FONT_FACE_RULE).filter(a=>ap(a.style.getPropertyValue("src")))}async function GN(n,a){if(n.ownerDocument==null)throw new Error("Provided element is not within a Document");const u=Qn(n.ownerDocument.styleSheets),s=await XN(u,a);return $N(s)}async function ZN(n,a){const u=await GN(n,a);return(await Promise.all(u.map(o=>{const c=o.parentStyleSheet?o.parentStyleSheet.href:null;return ip(o.cssText,c,a)}))).join(`
|
|
227
|
-
`)}async function KN(n,a){const u=a.fontEmbedCSS!=null?a.fontEmbedCSS:a.skipFonts?null:await ZN(n,a);if(u){const s=document.createElement("style"),o=document.createTextNode(u);s.appendChild(o),n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s)}}async function QN(n,a={}){const{width:u,height:s}=cN(n,a),o=await Us(n,a,!0);return await KN(o,a),await up(o,a),qN(o,a),await dN(o,u,s)}function fp({localNode:n,handleFieldChange:a,handleResourceChange:u,addResource:s,removeResource:o,handleUnlockAfterChange:c,addUnlockAfter:f,removeUnlockAfter:h,renderNodeSelect:g,handleCompletionNeedsChange:m,addCompletionNeed:y,removeCompletionNeed:b,handleCompletionOptionalChange:p,addCompletionOptional:x,removeCompletionOptional:w,language:E="en"}){var N,M,O,_,C,k,H;const U=Nn(E),Q=[{value:"blue",label:U.blue,className:"react-flow__node-topic blue"},{value:"yellow",label:U.yellow,className:"react-flow__node-topic yellow"},{value:"lila",label:U.lila,className:"react-flow__node-topic lila"},{value:"pink",label:U.pink,className:"react-flow__node-topic pink"},{value:"teal",label:U.teal,className:"react-flow__node-topic teal"},{value:"red",label:U.red,className:"react-flow__node-topic red"},{value:"black",label:U.black,className:"react-flow__node-topic black"},{value:"white",label:U.white,className:"react-flow__node-topic white"}];let q="blue";n.type==="topic"&&(q="yellow");const te=((N=n.data)===null||N===void 0?void 0:N.color)||q;return v.jsxs("div",{className:"drawer-content",children:[v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.nodeColor}),v.jsx("div",{style:{display:"flex",gap:12,marginTop:8},children:Q.map(J=>v.jsx("button",{type:"button","aria-label":J.label,onClick:()=>a("color",J.value),className:J.className,style:{width:28,height:28,borderRadius:6,cursor:"pointer",fontWeight:"bold",boxSizing:"border-box",display:"inline-block",padding:0},children:te===J.value?"X":""},J.value))})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.labelRequired}),v.jsx("input",{type:"text",value:((M=n.data)===null||M===void 0?void 0:M.label)||"",onChange:J=>a("label",J.target.value),placeholder:U.placeholderNodeLabel})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.summary}),v.jsx("input",{type:"text",value:n.data.summary||"",onChange:J=>a("summary",J.target.value),placeholder:U.placeholderShortSummary})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.description}),v.jsx("textarea",{value:n.data.description||"",onChange:J=>a("description",J.target.value),placeholder:U.placeholderDetailedDescription,rows:4})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.duration}),v.jsx("input",{type:"text",value:n.data.duration||"",onChange:J=>a("duration",J.target.value),placeholder:"e.g., 30 min"})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.videoURL}),v.jsx("input",{type:"text",value:n.data.video||"",onChange:J=>a("video",J.target.value),placeholder:U.placeholderVideoURL})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.resources}),(n.data.resources||[]).map((J,V)=>v.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[v.jsx("input",{type:"text",value:J.label||"",onChange:Y=>u(V,"label",Y.target.value),placeholder:U.placeholderLabel,style:{flex:1}}),v.jsx("input",{type:"text",value:J.url||"",onChange:Y=>u(V,"url",Y.target.value),placeholder:U.placeholderURL,style:{flex:2}}),v.jsx("button",{onClick:()=>o(V),className:"icon-button",children:v.jsx(Ya,{size:16})})]},V)),v.jsxs("button",{onClick:s,className:"secondary-button",children:[v.jsx(Pi,{size:16})," ",U.addResource]})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.unlockPassword}),v.jsx("input",{type:"text",value:((O=n.data.unlock)===null||O===void 0?void 0:O.password)||"",onChange:J=>a("unlock",Object.assign(Object.assign({},n.data.unlock||{}),{password:J.target.value})),placeholder:U.placeholderOptionalPassword})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.unlockDate}),v.jsx("input",{type:"date",value:((_=n.data.unlock)===null||_===void 0?void 0:_.date)||"",onChange:J=>a("unlock",Object.assign(Object.assign({},n.data.unlock||{}),{date:J.target.value}))})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.unlockAfter}),(((C=n.data.unlock)===null||C===void 0?void 0:C.after)||[]).map((J,V)=>v.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[g(J,Y=>c(V,Y)),v.jsx("button",{onClick:()=>h(V),className:"icon-button",children:v.jsx(Ya,{size:16})})]},V)),v.jsxs("button",{onClick:f,className:"secondary-button",children:[v.jsx(Pi,{size:16})," ",U.unlockAfter]})]}),n.type==="topic"&&v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.completionNeeds}),(((k=n.data.completion)===null||k===void 0?void 0:k.needs)||[]).map((J,V)=>v.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[g(J,Y=>m(V,Y)),v.jsx("button",{onClick:()=>b(V),className:"icon-button",children:v.jsx(Ya,{size:16})})]},V)),v.jsxs("button",{onClick:y,className:"secondary-button",children:[v.jsx(Pi,{size:16})," ",U.completionNeeds]})]}),n.type==="topic"&&v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:U.completionOptional}),(((H=n.data.completion)===null||H===void 0?void 0:H.optional)||[]).map((J,V)=>v.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[g(J,Y=>p(V,Y)),v.jsx("button",{onClick:()=>w(V),className:"icon-button",children:v.jsx(Ya,{size:16})})]},V)),v.jsxs("button",{onClick:x,className:"secondary-button",children:[v.jsx(Pi,{size:16})," ",U.completionOptional]})]})]})}function JN(n){return v.jsx(fp,Object.assign({},n))}function WN({localNode:n,handleFieldChange:a,language:u="en"}){const s=Nn(u),o=c=>ac(this,void 0,void 0,function*(){var f;const h=(f=c.target.files)===null||f===void 0?void 0:f[0];if(!h)return;const g=new FileReader;g.onload=()=>{typeof g.result=="string"&&a("data",g.result)},g.readAsDataURL(h)});return v.jsxs("div",{className:"drawer-content",children:[v.jsxs("div",{className:"form-group",children:[v.jsxs("label",{children:[s.image," (JPG, PNG, SVG)"]}),v.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/svg+xml",onChange:o})]}),n.data.data&&v.jsxs("div",{style:{marginTop:16},children:[v.jsx("label",{children:"Preview:"}),v.jsx("div",{children:v.jsx("img",{src:n.data.data,alt:"Preview",style:{maxWidth:"100%",maxHeight:200}})})]})]})}const gc=({value:n,onChange:a,label:u})=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[u&&v.jsx("label",{style:{marginRight:8},children:u}),v.jsx("input",{type:"color",value:n,onChange:s=>a(s.target.value),style:{width:32,height:32,border:"none",background:"none",padding:0}}),v.jsx("input",{type:"text",value:n,onChange:s=>a(s.target.value),placeholder:"#e5e7eb",style:{width:100}})]});function FN({value:n,onChange:a}){return v.jsxs("div",{className:"form-group",children:[v.jsxs("label",{children:["Rotation (degrees): ",n,"°"]}),v.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[v.jsx("input",{type:"range",min:0,max:360,value:n,onChange:u=>a(Number(u.target.value)),style:{flex:1}}),v.jsx("input",{type:"number",min:0,max:360,value:n,onChange:u=>{let s=Number(u.target.value);isNaN(s)&&(s=0),s<0&&(s=0),s>360&&(s=360),a(s)},style:{width:100}})]})]})}function IN({localNode:n,handleFieldChange:a,language:u="en"}){const s=Nn(u);return v.jsxs("div",{className:"drawer-content",children:[v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:s.text}),v.jsx("input",{type:"text",value:n.data.text||"",onChange:o=>a("text",o.target.value),placeholder:s.placeholderBackgroundText})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:s.fontSize}),v.jsx("input",{type:"number",value:n.data.fontSize||32,onChange:o=>a("fontSize",Number(o.target.value))})]}),v.jsx("div",{className:"form-group",children:v.jsx(gc,{label:s.color,value:n.data.color||"#e5e7eb",onChange:o=>a("color",o)})}),v.jsx(FN,{value:n.data.rotation||0,onChange:o=>a("rotation",o)})]})}const PN=({node:n,isOpen:a,onClose:u,onUpdate:s,onDelete:o,language:c="en"})=>{const f=Nn(c),[h,g]=D.useState(n),{getNodes:m}=Va(),y=m();if(D.useEffect(()=>{g(n)},[n]),!a||!n||!h)return null;const b=y.filter(V=>V.id!==n.id&&V.type==="task"||V.type==="topic"),p=(V,Y)=>v.jsxs("select",{value:V,onChange:j=>Y(j.target.value),children:[v.jsx("option",{value:"",children:f.selectNode}),b.map(j=>v.jsx("option",{value:j.id,children:j.data.label||j.id},j.id))]}),x=(V,Y)=>{var j;if(!h)return;const B=[...((j=h.data.completion)===null||j===void 0?void 0:j.needs)||[]];B[V]=Y,U("completion",Object.assign(Object.assign({},h.data.completion||{}),{needs:B}))},w=()=>{var V;if(!h)return;const Y=[...((V=h.data.completion)===null||V===void 0?void 0:V.needs)||[],""];U("completion",Object.assign(Object.assign({},h.data.completion||{}),{needs:Y}))},E=V=>{var Y;if(!h)return;const j=(((Y=h.data.completion)===null||Y===void 0?void 0:Y.needs)||[]).filter((B,z)=>z!==V);U("completion",Object.assign(Object.assign({},h.data.completion||{}),{needs:j}))},N=(V,Y)=>{var j;if(!h)return;const B=[...((j=h.data.completion)===null||j===void 0?void 0:j.optional)||[]];B[V]=Y,U("completion",Object.assign(Object.assign({},h.data.completion||{}),{optional:B}))},M=()=>{var V;if(!h)return;const Y=[...((V=h.data.completion)===null||V===void 0?void 0:V.optional)||[],""];U("completion",Object.assign(Object.assign({},h.data.completion||{}),{optional:Y}))},O=V=>{var Y;if(!h)return;const j=(((Y=h.data.completion)===null||Y===void 0?void 0:Y.optional)||[]).filter((B,z)=>z!==V);U("completion",Object.assign(Object.assign({},h.data.completion||{}),{optional:j}))},_=(V,Y)=>{var j;if(!h)return;const B=[...((j=h.data.unlock)===null||j===void 0?void 0:j.after)||[]];B[V]=Y,U("unlock",Object.assign(Object.assign({},h.data.unlock||{}),{after:B}))},C=()=>{var V;if(!h)return;const Y=[...((V=h.data.unlock)===null||V===void 0?void 0:V.after)||[],""];U("unlock",Object.assign(Object.assign({},h.data.unlock||{}),{after:Y}))},k=V=>{var Y;if(!h)return;const j=(((Y=h.data.unlock)===null||Y===void 0?void 0:Y.after)||[]).filter((B,z)=>z!==V);U("unlock",Object.assign(Object.assign({},h.data.unlock||{}),{after:j}))},H=()=>{h&&(s(h),u())},U=(V,Y)=>{g(j=>Object.assign(Object.assign({},j),{data:Object.assign(Object.assign({},j.data),{[V]:Y})}))},Q=(V,Y,j)=>{if(!h)return;const B=[...h.data.resources||[]];B[V]=Object.assign(Object.assign({},B[V]),{[Y]:j}),U("resources",B)},q=()=>{if(!h)return;const V=[...h.data.resources||[],{label:"",url:""}];U("resources",V)},te=V=>{if(!h)return;const Y=(h.data.resources||[]).filter((j,B)=>B!==V);U("resources",Y)};let J;return h.type==="task"?J=v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.editTask}),v.jsx("button",{onClick:u,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsx(fp,{localNode:h,handleFieldChange:U,handleResourceChange:Q,addResource:q,removeResource:te,handleUnlockAfterChange:_,addUnlockAfter:C,removeUnlockAfter:k,renderNodeSelect:p,handleCompletionNeedsChange:x,addCompletionNeed:w,removeCompletionNeed:E,handleCompletionOptionalChange:N,addCompletionOptional:M,removeCompletionOptional:O,language:c})]}):h.type==="topic"?J=v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.editTopic}),v.jsx("button",{onClick:u,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsx(JN,{localNode:h,handleFieldChange:U,handleResourceChange:Q,addResource:q,removeResource:te,handleUnlockAfterChange:_,addUnlockAfter:C,removeUnlockAfter:k,renderNodeSelect:p,handleCompletionNeedsChange:x,addCompletionNeed:w,removeCompletionNeed:E,handleCompletionOptionalChange:N,addCompletionOptional:M,removeCompletionOptional:O,language:c})]}):h.type==="image"?J=v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.editImage}),v.jsx("button",{onClick:u,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsx(WN,{localNode:h,handleFieldChange:U,language:c})]}):h.type==="text"&&(J=v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.editText}),v.jsx("button",{onClick:u,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsx(IN,{localNode:h,handleFieldChange:U,language:c})]})),v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"drawer-overlay",onClick:u}),v.jsxs("div",{className:"drawer",children:[J,v.jsxs("div",{className:"drawer-footer",children:[v.jsxs("button",{onClick:o,className:"danger-button",children:[v.jsx(Ya,{size:16})," ",f.deleteNode]}),v.jsxs("button",{onClick:H,className:"primary-button",children:[v.jsx(Hs,{size:16})," ",f.saveChanges]})]})]})]})};function eC({localEdge:n,handleFieldChange:a,language:u="en"}){var s;const o=Nn(u);return v.jsxs("div",{className:"drawer-content",children:[v.jsx("div",{className:"form-group",children:v.jsx(gc,{label:o.edgeColor,value:((s=n.style)===null||s===void 0?void 0:s.stroke)||"#222222",onChange:c=>a("color",c)})}),v.jsx("div",{className:"form-group",children:v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:!!n.animated,onChange:c=>a("animated",c.target.checked)}),o.animated]})}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:o.edgeType}),v.jsxs("select",{value:n.type||"default",onChange:c=>a("type",c.target.value),children:[v.jsx("option",{value:"default",children:o.default}),v.jsx("option",{value:"straight",children:o.straight}),v.jsx("option",{value:"step",children:o.step}),v.jsx("option",{value:"smoothstep",children:o.smoothstep}),v.jsx("option",{value:"simplebezier",children:"Simple Bezier"})]})]})]})}const tC=({edge:n,isOpen:a,onClose:u,onUpdate:s,onDelete:o,language:c="en"})=>{const f=Nn(c);return!n||!a?null:v.jsxs("div",{children:[v.jsx("div",{className:"drawer-overlay",onClick:u}),v.jsxs("div",{className:"drawer",children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.editEdge}),v.jsx("button",{onClick:u,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsx(eC,{localEdge:n,handleFieldChange:(h,g)=>{let m=Object.assign({},n);h==="color"?m=Object.assign(Object.assign({},m),{style:Object.assign(Object.assign({},m.style),{stroke:g})}):h==="animated"?m=Object.assign(Object.assign({},m),{animated:g}):h==="type"&&(m=Object.assign(Object.assign({},m),{type:g})),s(m)},language:c}),v.jsxs("div",{className:"drawer-footer",children:[v.jsxs("button",{onClick:o,className:"danger-button",children:[v.jsx(Ya,{size:16})," ",f.deleteEdge]}),v.jsxs("button",{onClick:u,className:"primary-button",children:[v.jsx(Hs,{size:16})," ",f.saveChanges]})]})]})]})},nC=({isOpen:n,onClose:a,settings:u,onUpdate:s,language:o="en"})=>{var c;const f=Nn(o),[h,g]=D.useState(u);if(D.useEffect(()=>{g(u)},[u]),!n)return null;const m=()=>{s(h),a()};return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"drawer-overlay",onClick:a}),v.jsxs("div",{className:"drawer",children:[v.jsxs("div",{className:"drawer-header",children:[v.jsx("h2",{className:"drawer-title",children:f.backgroundSettings}),v.jsx("button",{onClick:a,className:"close-button",children:v.jsx(ua,{size:20})})]}),v.jsxs("div",{className:"drawer-content",children:[v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:f.labelRequired}),v.jsx("input",{type:"text",value:(h==null?void 0:h.title)||"",onChange:y=>g(b=>Object.assign(Object.assign({},b),{title:y.target.value})),placeholder:f.placeholderNodeLabel})]}),v.jsxs("div",{className:"form-group",children:[v.jsx("label",{children:f.languageLabel}),v.jsxs("select",{value:(h==null?void 0:h.language)||"en",onChange:y=>g(b=>Object.assign(Object.assign({},b),{language:y.target.value})),children:[v.jsx("option",{value:"en",children:f.languageEnglish}),v.jsx("option",{value:"de",children:f.languageGerman})]})]}),v.jsx("div",{className:"form-group",children:v.jsx(gc,{label:f.backgroundColor,value:((c=h==null?void 0:h.background)===null||c===void 0?void 0:c.color)||"#ffffff",onChange:y=>g(b=>Object.assign(Object.assign({},b),{background:Object.assign(Object.assign({},b.background),{color:y})}))})})]}),v.jsx("div",{className:"drawer-footer",children:v.jsxs("button",{onClick:m,className:"primary-button",children:[v.jsx(Hs,{size:16})," ",f.saveChanges]})})]})]})},lC=({id:n,source:a,target:u,markerEnd:s,style:o})=>{const c=Dm(a),f=Dm(u);if(!c||!f)return null;const{sx:h,sy:g,tx:m,ty:y,sourcePos:b,targetPos:p}=Z_(c,f),[x]=Hr({sourceX:h,sourceY:g,sourcePosition:b,targetPosition:p,targetX:m,targetY:y});return v.jsx("path",{id:n,className:"react-flow__edge-path",d:x,markerEnd:s,style:o})},mc=n=>!!n&&n[0]==="o",pc=Fi.unstable_batchedUpdates,eu=(n,a)=>n===!0||!!(n&&n[a]),It=(n,a)=>typeof n=="function"?n(a):n,dp="_szhsinMenu",aC=n=>n[dp],iC=(n,a)=>Object.defineProperty(a,dp,{value:n}),tu=(n,a)=>(a&&Object.keys(a).forEach(u=>{const s=n[u],o=a[u];typeof o=="function"&&s?n[u]=(...c)=>{o(...c),s(...c)}:n[u]=o}),n),uC=n=>{if(typeof n!="string")return{top:0,right:0,bottom:0,left:0};const a=n.trim().split(/\s+/,4).map(parseFloat),u=isNaN(a[0])?0:a[0],s=isNaN(a[1])?u:a[1];return{top:u,right:s,bottom:isNaN(a[2])?u:a[2],left:isNaN(a[3])?s:a[3]}},yc=n=>{for(;n;){if(n=n.parentNode,!n||n===document.body||!n.parentNode)return;const{overflow:a,overflowX:u,overflowY:s}=getComputedStyle(n);if(/auto|scroll|overlay|hidden/.test(a+s+u))return n}};function vc(n,a){return{"aria-disabled":n||void 0,tabIndex:a?0:-1}}function hp(n,a){for(let u=0;u<n.length;u++)if(n[u]===a)return u;return-1}const sa=({block:n,element:a,modifiers:u,className:s})=>D.useMemo(()=>{const o=a?`${n}__${a}`:n;let c=o;u&&Object.keys(u).forEach(h=>{const g=u[h];g&&(c+=` ${o}--${g===!0?h:`${h}-${g}`}`)});let f=typeof s=="function"?s(u):s;return typeof f=="string"&&(f=f.trim(),f&&(c+=` ${f}`)),c},[n,a,u,s]),sC="szh-menu-container",qa="szh-menu",oC="szh-menu-button",rC="arrow",gp="item",cC="submenu",mp=D.createContext(),bc=D.createContext({}),xc=D.createContext({}),pp=D.createContext({}),fC=D.createContext({}),Vs=D.createContext({}),zt=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),ut=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),nu=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),Xa=Object.freeze({FIRST:"first",LAST:"last"}),dC=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),yp="absolute",vp="none",bp="menuitem",wc={preventScroll:!0},xp=iC("MenuButton",D.forwardRef(function({className:a,isOpen:u,disabled:s,children:o,...c},f){const h=D.useMemo(()=>({open:u}),[u]);return v.jsx("button",{"aria-haspopup":!0,"aria-expanded":u,"aria-disabled":s||void 0,type:"button",disabled:s,...c,ref:f,className:sa({block:oC,modifiers:h,className:a}),children:o})})),hC=({className:n,containerRef:a,containerProps:u,children:s,isOpen:o,theming:c,transition:f,onClose:h})=>{const g=eu(f,"item"),m=({key:b})=>{switch(b){case zt.ESC:It(h,{key:b,reason:nu.CANCEL});break}},y=b=>{o&&!b.currentTarget.contains(b.relatedTarget)&&It(h,{reason:nu.BLUR})};return v.jsx("div",{...tu({onKeyDown:m,onBlur:y},u),className:sa({block:sC,modifiers:D.useMemo(()=>({theme:c,itemTransition:g}),[c,g]),className:n}),style:{position:"absolute",...u==null?void 0:u.style},ref:a,children:s})},gC=()=>{let n,a=0;return{toggle:u=>{u?a++:a--,a=Math.max(a,0)},on:(u,s,o)=>{a?n||(n=setTimeout(()=>{n=0,s()},u)):o==null||o()},off:()=>{n&&(clearTimeout(n),n=0)}}},mC=n=>{const[a,u]=D.useState(),o=D.useRef({items:[],hoverIndex:-1,sorted:!1}).current,c=D.useCallback((h,g)=>{const{items:m}=o;if(!h)o.items=[];else if(g)m.push(h);else{const y=m.indexOf(h);y>-1&&(m.splice(y,1),h.contains(document.activeElement)&&(n.current.focus(wc),u()))}o.hoverIndex=-1,o.sorted=!1},[o,n]),f=D.useCallback((h,g,m)=>{const{items:y,hoverIndex:b}=o,p=()=>{if(o.sorted)return;const E=n.current.querySelectorAll(".szh-menu__item");y.sort((N,M)=>hp(E,N)-hp(E,M)),o.sorted=!0};let x=-1,w;switch(h){case ut.RESET:break;case ut.SET:w=g;break;case ut.UNSET:w=E=>E===g?void 0:E;break;case ut.FIRST:p(),x=0,w=y[x];break;case ut.LAST:p(),x=y.length-1,w=y[x];break;case ut.SET_INDEX:p(),x=m,w=y[x];break;case ut.INCREASE:p(),x=b,x<0&&(x=y.indexOf(g)),x++,x>=y.length&&(x=0),w=y[x];break;case ut.DECREASE:p(),x=b,x<0&&(x=y.indexOf(g)),x--,x<0&&(x=y.length-1),w=y[x];break}w||(x=-1),u(w),o.hoverIndex=x},[n,o]);return{hoverItem:a,dispatch:f,updateItems:c}},wp=(n,a)=>Math.round(n)===a?n:a,pC=n=>{const a=n.getBoundingClientRect();return a.width=wp(a.width,n.offsetWidth),a.height=wp(a.height,n.offsetHeight),a},yC=(n,a,u,s)=>{const o=pC(a),c=n.getBoundingClientRect(),f=u===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:u.getBoundingClientRect(),h=uC(s),g=w=>w+c.left-f.left-h.left,m=w=>w+c.left+o.width-f.right+h.right,y=w=>w+c.top-f.top-h.top,b=w=>w+c.top+o.height-f.bottom+h.bottom;return{menuRect:o,containerRect:c,getLeftOverflow:g,getRightOverflow:m,getTopOverflow:y,getBottomOverflow:b,confineHorizontally:w=>{let E=g(w);if(E<0)w-=E;else{const N=m(w);N>0&&(w-=N,E=g(w),E<0&&(w-=E))}return w},confineVertically:w=>{let E=y(w);if(E<0)w-=E;else{const N=b(w);N>0&&(w-=N,E=y(w),E<0&&(w-=E))}return w}}},vC=({arrowRef:n,menuY:a,anchorRect:u,containerRect:s,menuRect:o})=>{let c=u.top-s.top-a+u.height/2;const f=n.current.offsetHeight*1.25;return c=Math.max(f,c),c=Math.min(c,o.height-f),c},bC=({anchorRect:n,containerRect:a,menuRect:u,placeLeftorRightY:s,placeLeftX:o,placeRightX:c,getLeftOverflow:f,getRightOverflow:h,confineHorizontally:g,confineVertically:m,arrowRef:y,arrow:b,direction:p,position:x})=>{let w=p,E=s;x!=="initial"&&(E=m(E),x==="anchor"&&(E=Math.min(E,n.bottom-a.top),E=Math.max(E,n.top-a.top-u.height)));let N,M,O;return w==="left"?(N=o,x!=="initial"&&(M=f(N),M<0&&(O=h(c),(O<=0||-M>O)&&(N=c,w="right")))):(N=c,x!=="initial"&&(O=h(N),O>0&&(M=f(o),(M>=0||-M<O)&&(N=o,w="left")))),x==="auto"&&(N=g(N)),{arrowY:b?vC({menuY:E,arrowRef:y,anchorRect:n,containerRect:a,menuRect:u}):void 0,x:N,y:E,computedDirection:w}},xC=({arrowRef:n,menuX:a,anchorRect:u,containerRect:s,menuRect:o})=>{let c=u.left-s.left-a+u.width/2;const f=n.current.offsetWidth*1.25;return c=Math.max(f,c),c=Math.min(c,o.width-f),c},wC=({anchorRect:n,containerRect:a,menuRect:u,placeToporBottomX:s,placeTopY:o,placeBottomY:c,getTopOverflow:f,getBottomOverflow:h,confineHorizontally:g,confineVertically:m,arrowRef:y,arrow:b,direction:p,position:x})=>{let w=p==="top"?"top":"bottom",E=s;x!=="initial"&&(E=g(E),x==="anchor"&&(E=Math.min(E,n.right-a.left),E=Math.max(E,n.left-a.left-u.width)));let N,M,O;return w==="top"?(N=o,x!=="initial"&&(M=f(N),M<0&&(O=h(c),(O<=0||-M>O)&&(N=c,w="bottom")))):(N=c,x!=="initial"&&(O=h(N),O>0&&(M=f(o),(M>=0||-M<O)&&(N=o,w="top")))),x==="auto"&&(N=m(N)),{arrowX:b?xC({menuX:E,arrowRef:y,anchorRect:n,containerRect:a,menuRect:u}):void 0,x:E,y:N,computedDirection:w}},SC=({arrow:n,align:a,direction:u,gap:s,shift:o,position:c,anchorRect:f,arrowRef:h,positionHelpers:g})=>{const{menuRect:m,containerRect:y}=g,b=u==="left"||u==="right";let p=b?s:o,x=b?o:s;if(n){const k=h.current;b?p+=k.offsetWidth:x+=k.offsetHeight}const w=f.left-y.left-m.width-p,E=f.right-y.left+p,N=f.top-y.top-m.height-x,M=f.bottom-y.top+x;let O,_;a==="end"?(O=f.right-y.left-m.width,_=f.bottom-y.top-m.height):a==="center"?(O=f.left-y.left-(m.width-f.width)/2,_=f.top-y.top-(m.height-f.height)/2):(O=f.left-y.left,_=f.top-y.top),O+=p,_+=x;const C={...g,anchorRect:f,placeLeftX:w,placeRightX:E,placeLeftorRightY:_,placeTopY:N,placeBottomY:M,placeToporBottomX:O,arrowRef:h,arrow:n,direction:u,position:c};switch(u){case"left":case"right":return bC(C);case"top":case"bottom":default:return wC(C)}},Ys=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function Sp(n,a){typeof n=="function"?n(a):n.current=a}const qs=(n,a)=>D.useMemo(()=>n?a?u=>{Sp(n,u),Sp(a,u)}:n:a,[n,a]),Ep=-9999,_p=({ariaLabel:n,menuClassName:a,menuStyle:u,arrow:s,arrowProps:o={},anchorPoint:c,anchorRef:f,containerRef:h,containerProps:g,externalRef:m,parentScrollingRef:y,align:b="start",direction:p="bottom",position:x="auto",overflow:w="visible",setDownOverflow:E,repositionFlag:N,captureFocus:M=!0,state:O,endTransition:_,isDisabled:C,menuItemFocus:k,gap:H=0,shift:U=0,children:Q,onClose:q,focusProps:te,...J})=>{const[V,Y]=D.useState({x:Ep,y:Ep}),[j,B]=D.useState({}),[z,L]=D.useState(),[G,X]=D.useState(p),[A]=D.useState(gC),[$,F]=D.useReducer(Oe=>Oe+1,1),{transition:le,boundingBoxRef:ee,boundingBoxPadding:de,rootMenuRef:fe,rootAnchorRef:he,scrollNodesRef:ie,reposition:ge,viewScroll:me,submenuCloseDelay:be}=D.useContext(Vs),{submenuCtx:xe,reposSubmenu:pe=N}=D.useContext(xc),we=D.useRef(),Ae=D.useRef(),je=D.useRef(!1),{hoverItem:Ne,dispatch:Le,updateItems:Ut}=mC(we),Ze=mc(O),Dt=eu(le,"open"),sn=eu(le,"close"),st=ie.current,St=Oe=>{switch(Oe.key){case zt.HOME:Le(ut.FIRST);break;case zt.END:Le(ut.LAST);break;case zt.UP:Le(ut.DECREASE,Ne);break;case zt.DOWN:Le(ut.INCREASE,Ne);break;case zt.SPACE:Oe.target&&Oe.target.className.indexOf(qa)!==-1&&Oe.preventDefault();return;default:return}Oe.preventDefault(),Oe.stopPropagation()},on=()=>{O==="closing"&&L(),It(_)},ft=Oe=>{Oe.stopPropagation(),A.on(be,()=>{Le(ut.RESET),we.current.focus(wc)})},rn=Oe=>{Oe.target===Oe.currentTarget&&A.off()},Et=D.useCallback(Oe=>{var se;const tt=we.current,dt=h.current;if(!tt||!dt)return;const bt=f?(se=f.current)==null?void 0:se.getBoundingClientRect():c?{left:c.x,right:c.x,top:c.y,bottom:c.y,width:0,height:0}:null;if(!bt)return;st.menu||(st.menu=(ee?ee.current:yc(fe.current))||window);const Ye=yC(dt,tt,st.menu,de);let{arrowX:Pt,arrowY:Zt,x:Wn,y:Cn,computedDirection:Cl}=SC({arrow:s,align:b,direction:p,gap:H,shift:U,position:x,anchorRect:bt,arrowRef:Ae,positionHelpers:Ye});const{menuRect:oe}=Ye,ce=oe.height;if(!Oe&&w!=="visible"){const{getTopOverflow:Me,getBottomOverflow:Je}=Ye;let We,nt;const ht=Je(Cn);if(ht>0)We=ce-ht,nt=ht;else{const Bt=Me(Cn);Bt<0&&(We=ce+Bt,nt=0-Bt,We>=0&&(Cn-=Bt))}We>=0&&L({height:We,overflowAmt:nt})}s&&B({x:Pt,y:Zt}),Y({x:Wn,y:Cn}),X(Cl)},[s,b,de,p,H,U,x,w,c,f,h,ee,fe,st]);Ys(()=>{Ze&&(Et(),je.current&&F()),je.current=Ze},[Ze,Et,pe]),Ys(()=>{z&&!E&&(we.current.scrollTop=0)},[z,E]),Ys(()=>Ut,[Ut]),D.useEffect(()=>{let{menu:Oe}=st;if(!Ze||!Oe)return;if(Oe=Oe.addEventListener?Oe:window,!st.anchors){st.anchors=[];let Ye=yc(he&&he.current);for(;Ye&&Ye!==Oe;)st.anchors.push(Ye),Ye=yc(Ye)}let tt=me;if(st.anchors.length&&tt==="initial"&&(tt="auto"),tt==="initial")return;const dt=()=>{tt==="auto"?pc(()=>Et(!0)):It(q,{reason:nu.SCROLL})},bt=st.anchors.concat(me!=="initial"?Oe:[]);return bt.forEach(Ye=>Ye.addEventListener("scroll",dt)),()=>bt.forEach(Ye=>Ye.removeEventListener("scroll",dt))},[he,st,Ze,q,me,Et]);const El=!!z&&z.overflowAmt>0;D.useEffect(()=>{if(El||!Ze||!y)return;const Oe=()=>pc(Et),tt=y.current;return tt.addEventListener("scroll",Oe),()=>tt.removeEventListener("scroll",Oe)},[Ze,El,y,Et]),D.useEffect(()=>{if(!Ze||typeof ResizeObserver!="function"||ge==="initial")return;const Oe=[],tt=new ResizeObserver(Ye=>Ye.forEach(({target:Pt})=>{Oe.indexOf(Pt)<0?Oe.push(Pt):Fi.flushSync(()=>{Et(),F()})})),dt={box:"border-box"};tt.observe(we.current,dt);const bt=f==null?void 0:f.current;return bt&&tt.observe(bt,dt),()=>tt.disconnect()},[Ze,ge,f,Et]),D.useEffect(()=>{if(!Ze){Le(ut.RESET),sn||L();return}const{position:Oe,alwaysUpdate:tt}=k||{},dt=()=>{Oe===Xa.FIRST?Le(ut.FIRST):Oe===Xa.LAST?Le(ut.LAST):Oe>=-1&&Le(ut.SET_INDEX,void 0,Oe)};if(tt)dt();else if(M){const bt=setTimeout(()=>{const Ye=we.current;Ye&&!Ye.contains(document.activeElement)&&(Ye.focus(wc),dt())},Dt?170:100);return()=>clearTimeout(bt)}},[Ze,Dt,sn,M,k,Le]);const Ln=D.useMemo(()=>({isParentOpen:Ze,submenuCtx:A,dispatch:Le,updateItems:Ut}),[Ze,A,Le,Ut]);let Jn,$t;z&&(E?$t=z.overflowAmt:Jn=z.height);const kt=D.useMemo(()=>({reposSubmenu:$,submenuCtx:A,overflow:w,overflowAmt:$t,parentMenuRef:we,parentDir:G}),[$,A,w,$t,G]),ot=Jn>=0?{maxHeight:Jn,overflow:w}:void 0,_l=D.useMemo(()=>({state:O,align:b,dir:G}),[O,b,G]),Gt=D.useMemo(()=>({dir:G}),[G]),vt=sa({block:qa,element:rC,modifiers:Gt,className:o.className}),Nl=v.jsxs("ul",{role:"menu","aria-label":n,...vc(C),...tu({onPointerEnter:xe==null?void 0:xe.off,onPointerMove:ft,onPointerLeave:rn,onKeyDown:St,onAnimationEnd:on},J),ref:qs(m,we),className:sa({block:qa,modifiers:_l,className:a}),style:{...u,...ot,margin:0,display:O==="closed"?"none":void 0,position:yp,left:V.x,top:V.y},children:[s&&v.jsx("li",{"aria-hidden":!0,...o,className:vt,style:{display:"block",position:yp,left:j.x,top:j.y,...o.style},ref:Ae}),v.jsx(xc.Provider,{value:kt,children:v.jsx(bc.Provider,{value:Ln,children:v.jsx(mp.Provider,{value:Ne,children:It(Q,_l)})})})]});return g?v.jsx(hC,{...g,isOpen:Ze,children:Nl}):Nl},EC=D.forwardRef(function({"aria-label":a,className:u,containerProps:s,initialMounted:o,unmountOnClose:c,transition:f,transitionTimeout:h,boundingBoxRef:g,boundingBoxPadding:m,reposition:y="auto",submenuOpenDelay:b=300,submenuCloseDelay:p=150,viewScroll:x="initial",portal:w,theming:E,onItemClick:N,...M},O){const _=D.useRef(null),C=D.useRef({}),{anchorRef:k,state:H,onClose:U}=M,Q=D.useMemo(()=>({initialMounted:o,unmountOnClose:c,transition:f,transitionTimeout:h,boundingBoxRef:g,boundingBoxPadding:m,rootMenuRef:_,rootAnchorRef:k,scrollNodesRef:C,reposition:y,viewScroll:x,submenuOpenDelay:b,submenuCloseDelay:p}),[o,c,f,h,k,g,m,y,x,b,p]),q=D.useMemo(()=>({handleClick(J,V){J.stopPropagation||It(N,J);let Y=J.keepOpen;Y===void 0&&(Y=V&&J.key===zt.SPACE),Y||It(U,{value:J.value,key:J.key,reason:nu.CLICK})},handleClose(J){It(U,{key:J,reason:nu.CLICK})}}),[N,U]);if(!H)return null;const te=v.jsx(Vs.Provider,{value:Q,children:v.jsx(pp.Provider,{value:q,children:v.jsx(_p,{...M,ariaLabel:a||"Menu",externalRef:O,containerRef:_,containerProps:{className:u,containerRef:_,containerProps:s,theming:E,transition:f,onClose:U}})})});return w===!0&&typeof document<"u"?Fi.createPortal(te,document.body):w?w.target?Fi.createPortal(te,w.target):w.stablePosition?null:te:te}),Sc=0,Ec=1,Xs=2,$s=3,Gs=4,_C=5,Np=6,NC=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Cp=n=>({_s:n,status:NC[n],isEnter:n<$s,isMounted:n!==Np,isResolved:n===Xs||n>Gs}),_c=n=>n?Np:_C,CC=(n,a)=>{switch(n){case Ec:case Sc:return Xs;case Gs:case $s:return _c(a)}},MC=n=>typeof n=="object"?[n.enter,n.exit]:[n,n],TC=(n,a)=>setTimeout(()=>{isNaN(document.body.offsetTop)||n(a+1)},0),Mp=(n,a,u,s,o)=>{clearTimeout(s.current);const c=Cp(n);a(c),u.current=c,o&&o({current:c})},AC=({enter:n=!0,exit:a=!0,preEnter:u,preExit:s,timeout:o,initialEntered:c,mountOnEnter:f,unmountOnExit:h,onStateChange:g}={})=>{const[m,y]=D.useState(()=>Cp(c?Xs:_c(f))),b=D.useRef(m),p=D.useRef(),[x,w]=MC(o),E=D.useCallback(()=>{const M=CC(b.current._s,h);M&&Mp(M,y,b,p,g)},[g,h]),N=D.useCallback(M=>{const O=C=>{switch(Mp(C,y,b,p,g),C){case Ec:x>=0&&(p.current=setTimeout(E,x));break;case Gs:w>=0&&(p.current=setTimeout(E,w));break;case Sc:case $s:p.current=TC(O,C);break}},_=b.current.isEnter;typeof M!="boolean"&&(M=!_),M?!_&&O(n?u?Sc:Ec:Xs):_&&O(a?s?$s:Gs:_c(h))},[E,g,n,a,u,s,x,w,h]);return[m,N,E]},jC=({initialOpen:n,initialMounted:a,unmountOnClose:u,transition:s,transitionTimeout:o=500,onMenuChange:c}={})=>{const f=eu(s,"open"),h=eu(s,"close"),[{status:g},m,y]=AC({initialEntered:n,mountOnEnter:!a,unmountOnExit:u,timeout:o,enter:f,exit:h,onStateChange:D.useCallback(({current:{isEnter:b,isResolved:p}})=>{!c||b&&f&&p||!b&&h&&p||c({open:b})},[c,f,h])});return[{state:dC[g],endTransition:y},m]},Tp=n=>{const[a,u]=jC(n),[s,o]=D.useState(),c=(f,h)=>{o({position:f,alwaysUpdate:h}),u(!0)};return[{menuItemFocus:s,...a},u,c]},OC=(n,a)=>{const[u]=D.useState({});return{onMouseDown:()=>{u.v=n&&n!=="closed"},onClick:s=>u.v?u.v=!1:a(!0,s)}},zC=parseInt(D.version)<19,Ap=D.forwardRef(function({"aria-label":a,captureFocus:u,initialOpen:s,menuButton:o,instanceRef:c,onMenuChange:f,...h},g){const[m,y,b]=Tp({...h,onMenuChange:f}),{state:p}=m,x=mc(p),w=D.useRef(null),E=OC(p,(k,H)=>b(H.detail?void 0:Xa.FIRST)),N=D.useCallback(k=>{y(!1),k.key&&w.current.focus()},[y]),M=k=>{switch(k.key){case zt.UP:b(Xa.LAST);break;case zt.DOWN:b(Xa.FIRST);break;default:return}k.preventDefault()},O=It(o,{open:x});if(!O||!O.type)throw new Error("Menu requires a menuButton prop.");const _={...tu({onKeyDown:M,...E},O.props),ref:qs(zC?O.ref:O.props.ref,w)};aC(O.type)==="MenuButton"&&(_.isOpen=x);const C=D.cloneElement(O,_);return D.useImperativeHandle(c,()=>({openMenu:b,closeMenu:()=>y(!1)})),v.jsxs(D.Fragment,{children:[C,v.jsx(EC,{...h,...m,"aria-label":a||(typeof O.props.children=="string"?O.props.children:"Menu"),anchorRef:w,ref:g,onClose:N})]})}),jp=(n,a)=>{const u=D.memo(a),s=D.forwardRef((o,c)=>{const f=D.useRef(null);return v.jsx(u,{...o,itemRef:f,externalRef:c,isHovering:D.useContext(mp)===f.current})});return s.displayName=`WithHovering(${n})`,s},Op=n=>{const[a,u]=D.useState(!1);return D.useEffect(()=>{!n&&u(!1)},[n]),[a,()=>!a&&u(!0),()=>u(!1)]},zp=(n,a,u)=>{Ys(()=>{if(n)return;const s=a.current;return u(s,!0),()=>{u(s)}},[n,a,u])},DC=jp("SubMenu",function({"aria-label":a,className:u,disabled:s,direction:o,label:c,openTrigger:f,onMenuChange:h,isHovering:g,instanceRef:m,itemRef:y,captureFocus:b,repositionFlag:p,itemProps:x={},portal:w=!1,...E}){const N=D.useContext(Vs),{rootMenuRef:M,submenuOpenDelay:O,submenuCloseDelay:_}=N,{parentMenuRef:C,parentDir:k,overflow:H}=D.useContext(xc),{isParentOpen:U,submenuCtx:Q,dispatch:q,updateItems:te}=D.useContext(bc),J=w||H!=="visible",[V,Y,j]=Tp({...N,onMenuChange:h}),[B,z,L]=Op(g),{state:G}=V,X=!!s,A=mc(G),$=D.useRef(null),[F]=D.useState({v:0}),le=()=>{Q.off(),F.v&&(clearTimeout(F.v),F.v=0)},ee=(...Ne)=>{le(),de(),!X&&j(...Ne)},de=()=>!g&&!X&&q(ut.SET,y.current),fe=Ne=>{de(),f||(F.v=setTimeout(()=>pc(ee),Math.max(Ne,0)))},he=Ne=>{X||(Ne.stopPropagation(),z(),!(F.v||A)&&Q.on(_,()=>fe(O-_),()=>fe(O)))},ie=()=>{L(),le(),A||q(ut.UNSET,y.current)},ge=Ne=>{if(g)switch(Ne.key){case zt.ENTER:Ne.preventDefault();case zt.SPACE:case zt.RIGHT:f!=="none"&&ee(Xa.FIRST)}},me=Ne=>{let Le=!1;switch(Ne.key){case zt.LEFT:A&&(y.current.focus(),Y(!1),Le=!0);break;case zt.RIGHT:A||(Le=!0);break}Le&&(Ne.preventDefault(),Ne.stopPropagation())};zp(X,y,te),D.useEffect(()=>Q.toggle(A),[Q,A]),D.useEffect(()=>()=>{clearTimeout(F.v),Q.toggle(!1)},[F,Q]),D.useEffect(()=>{g&&U?y.current.focus():Y(!1)},[g,U,Y,y]),D.useImperativeHandle(m,()=>({openMenu:(...Ne)=>{U&&ee(...Ne)},closeMenu:()=>{A&&(y.current.focus(),Y(!1))}}));const be=D.useMemo(()=>({open:A,hover:B||g,disabled:X,submenu:!0}),[A,g,X,B]),{ref:xe,className:pe,...we}=x,Ae=tu({onPointerEnter:Q.off,onPointerMove:he,onPointerLeave:ie,onKeyDown:ge,onClick:()=>f!=="none"&&ee()},we),je=()=>{const Ne=v.jsx(_p,{...E,...V,ariaLabel:a||(typeof c=="string"?c:"Submenu"),anchorRef:y,containerRef:J?M:$,direction:o||(k==="right"||k==="left"?k:"right"),parentScrollingRef:J&&C,isDisabled:X}),Le=M.current;return J&&Le?Fi.createPortal(Ne,Le):Ne};return v.jsxs("li",{className:sa({block:qa,element:cC,className:u}),style:{position:"relative"},role:vp,ref:$,onKeyDown:me,children:[v.jsx("div",{role:bp,"aria-haspopup":!0,"aria-expanded":A,...vc(X,g),...Ae,ref:qs(xe,y),className:sa({block:qa,element:gp,modifiers:be,className:pe}),children:D.useMemo(()=>It(c,be),[c,be])}),G&&je()]})}),kC=(n,a,u,s)=>{const[o,c,f]=Op(u),{submenuCloseDelay:h}=D.useContext(Vs),{isParentOpen:g,submenuCtx:m,dispatch:y,updateItems:b}=D.useContext(bc),p=()=>{!u&&!s&&y(ut.SET,n.current)},x=()=>{!s&&y(ut.UNSET,n.current)},w=M=>{u&&!M.currentTarget.contains(M.relatedTarget)&&x()},E=M=>{s||(M.stopPropagation(),c(),m.on(h,p,p))},N=(M,O)=>{f(),m.off(),!O&&x()};return zp(s,n,b),D.useEffect(()=>{u&&g&&a.current&&a.current.focus()},[a,u,g]),{mouseOver:o,setHover:p,onBlur:w,onPointerMove:E,onPointerLeave:N}},un=jp("MenuItem",function({className:a,value:u,href:s,type:o,checked:c,disabled:f,children:h,onClick:g,isHovering:m,itemRef:y,externalRef:b,...p}){const x=!!f,{mouseOver:w,setHover:E,...N}=kC(y,y,m,x),M=D.useContext(pp),O=D.useContext(fC),_=o==="radio",C=o==="checkbox",k=!!s&&!x&&!_&&!C,H=_?O.value===u:C?!!c:!1,U=V=>{if(x){V.stopPropagation(),V.preventDefault();return}const Y={value:u,syntheticEvent:V};V.key!==void 0&&(Y.key=V.key),C&&(Y.checked=!H),_&&(Y.name=O.name),It(g,Y),_&&It(O.onRadioChange,Y),M.handleClick(Y,C||_)},Q=V=>{if(m)switch(V.key){case zt.ENTER:V.preventDefault();case zt.SPACE:k?y.current.click():U(V)}},q=D.useMemo(()=>({type:o,disabled:x,hover:w||m,checked:H,anchor:k}),[o,x,w,m,H,k]),te=tu({...N,onPointerDown:E,onKeyDown:Q,onClick:U},p),J={role:_?"menuitemradio":C?"menuitemcheckbox":bp,"aria-checked":_||C?H:void 0,...vc(x,m),...te,ref:qs(b,y),className:sa({block:qa,element:gp,modifiers:q,className:a}),children:D.useMemo(()=>It(h,q),[h,q])};return k?v.jsx("li",{role:vp,children:v.jsx("a",{href:s,...J})}):v.jsx("li",{...J})}),RC=({saved:n,debugMode:a,previewMode:u,showCompletionNeeds:s,showCompletionOptional:o,showUnlockAfter:c,onTogglePreviewMode:f,onToggleDebugMode:h,onSetShowCompletionNeeds:g,onSetShowCompletionOptional:m,onSetShowUnlockAfter:y,onAddNewNode:b,onOpenSettingsDrawer:p,onSave:x,onDownlad:w,onOpen:E,onExportSVG:N,language:M="en"})=>{const O=Nn(M);return v.jsxs("div",{className:"editor-toolbar",children:[v.jsxs("div",{className:"toolbar-group",children:[v.jsxs(Ap,{menuButton:v.jsxs(xp,{disabled:u,className:"toolbar-button",children:[v.jsx(Pi,{size:16})," ",v.jsx("span",{className:"toolbar-label",children:O.nodes})]}),children:[v.jsx(un,{onClick:()=>b("task"),children:O.addTask}),v.jsx(un,{onClick:()=>b("topic"),children:O.addTopic}),v.jsx(un,{onClick:()=>b("image"),children:O.addImage}),v.jsx(un,{onClick:()=>b("text"),children:O.addText})]}),v.jsxs("button",{disabled:u,onClick:p,className:"toolbar-button",children:[v.jsx(X_,{size:16})," ",v.jsx("span",{className:"toolbar-label",children:O.settings})]})]}),v.jsx("div",{className:"toolbar-group",children:v.jsxs(Ap,{menuButton:v.jsx(xp,{className:"toolbar-button",children:v.jsx(V_,{})}),children:[v.jsxs(DC,{className:`${a?"active":""}`,label:v.jsxs(v.Fragment,{children:[v.jsx(k_,{size:16})," ",v.jsx("span",{children:O.debug})]}),children:[v.jsx(un,{type:"checkbox",checked:a,onClick:h,children:O.enableDebugMode}),v.jsx(un,{type:"checkbox",checked:s,onClick:_=>{var C;return g((C=_.checked)!==null&&C!==void 0?C:!1)},disabled:!a,children:O.showCompletionNeedsEdges}),v.jsx(un,{type:"checkbox",checked:o,onClick:_=>{var C;return m((C=_.checked)!==null&&C!==void 0?C:!1)},disabled:!a,children:O.showCompletionOptionalEdges}),v.jsx(un,{type:"checkbox",checked:c,onClick:_=>{var C;return y((C=_.checked)!==null&&C!==void 0?C:!1)},disabled:!a,children:O.showUnlockAfterEdges})]}),v.jsxs(un,{onClick:f,className:`${u?"active":""}`,children:[v.jsx(L_,{size:16})," ",v.jsx("span",{children:O.preview})]}),v.jsxs(un,{onClick:x,className:n?"":"active",disabled:n,children:[v.jsx(Hs,{size:16})," ",v.jsxs("span",{children:[O.save,n?"":"*"]})]}),v.jsxs(un,{onClick:w,children:[v.jsx(H_,{size:16})," ",v.jsx("span",{children:O.download})]}),v.jsxs(un,{onClick:E,children:[v.jsx(U_,{size:16})," ",v.jsx("span",{children:O.open})]}),!1]})})]})},Dp=n=>new Error(`NoPayloadError: ${n} requires a payload.`),HC=n=>new Error(`Mutation behavior must be one of: mergePastReversed, mergePast, keepFuture, or destroyFuture. Not: ${n}`),LC=(n,a)=>{if(!n)return a;let u=[...a];if(u.length<=n)return a;const s=u.length-n;return s===1?u.shift():u.splice(0,s),u},UC=(n,a)=>{const{past:u,present:s,future:o}=n,{payload:c,behavior:f,historyLimit:h,ignoreIdenticalMutations:g,cloneState:m,ignoreAction:y}=a;if(!c||c===void 0)throw Dp("mutate");if(y)return{past:u,present:c,future:o};let b=[...u];h!=="infinium"&&h!=="infinity"&&(b=LC(h,u));const p=JSON.stringify(c)===JSON.stringify(s);if(g&&p)return m?Object.assign({},n):n;const x=[...o],w={mergePastReversed:{past:[...b,...x.reverse(),s],present:c,future:[]},mergePast:{past:[...b,...o,s],present:c,future:[]},destroyFuture:{past:[...b,s],present:c,future:[]},keepFuture:{past:[...b,s],present:c,future:o}};if(typeof f>"u")return w.mergePastReversed;if(!w.hasOwnProperty(f))throw HC(f);return w[f]},BC=(n,a)=>{const{past:u,present:s,future:o}=n,c=()=>{if(u.length===0)return n;const p=u[u.length-1];return{past:u.slice(0,u.length-1),present:p,future:[s,...o]}},f=()=>{if(o.length===0)return n;const p=o[0],x=o.slice(1);return{past:[...u,s],present:p,future:x}},h=p=>(p.payload=typeof p.payload=="function"?p.payload(s):p.payload,p);return{undo:c,redo:f,update:()=>UC(n,h(a)),reset:()=>{const{payload:p}=a;return{past:[],present:p||n.present,future:[]}},resetInitialState:()=>{const{payload:p}=a;if(!p)throw Dp("resetInitialState");let x=[...u];return x[0]=p,{past:[...x],present:s,future:[...o]}}}[a.type]()},VC={past:[],present:null,future:[]},kp={behavior:"mergePastReversed",historyLimit:100,ignoreIdenticalMutations:!0,cloneState:!1},YC=n=>Object.assign(Object.assign({},kp),n),qC=(n,a=kp)=>{const[u,s]=D.useReducer(BC,Object.assign(Object.assign({},VC),{present:n})),o=u.past.length!==0,c=u.future.length!==0,f=D.useCallback(()=>{o&&s({type:"undo"})},[o]),h=D.useCallback(()=>{c&&s({type:"redo"})},[c]),g=D.useCallback((x=n)=>s({type:"reset",payload:x}),[]),m=D.useCallback(x=>s({type:"resetInitialState",payload:x}),[]),y=D.useCallback((x,w,E)=>s(Object.assign({type:"update",payload:x,behavior:w,ignoreAction:E},YC(a))),[]),b=D.useCallback((x,w=a.behavior,E=!1)=>y(x,w,E),[u]),p=(x,w=a.behavior,E=!1)=>{y(x,w,E)};return[u.present,b,{past:u.past,future:u.future,undo:f,canUndo:o,redo:h,canRedo:c,reset:g,resetInitialState:m,static_setState:p}]},XC=({nodes:n,onUpdate:a})=>{const u=()=>{if(n.length<2)return;const p=Math.min(...n.map(w=>w.position.x)),x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{x:p})}));a(x)},s=()=>{if(n.length<2)return;const p=n.reduce((w,E)=>w+E.position.x+(E.width||E.measured.width)/2,0)/n.length,x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{x:p-(w.width||w.measured.width)/2})}));a(x)},o=()=>{if(n.length<2)return;const p=Math.max(...n.map(w=>w.position.x+(w.width||0))),x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{x:p-(w.width||w.measured.width)})}));a(x)},c=()=>{if(n.length<2)return;const p=Math.min(...n.map(w=>w.position.y)),x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{y:p})}));a(x)},f=()=>{if(n.length<2)return;const p=n.reduce((w,E)=>w+E.position.y+(E.height||E.measured.height)/2,0)/n.length,x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{y:p-(w.height||w.measured.height)/2})}));a(x)},h=()=>{if(n.length<2)return;const p=Math.max(...n.map(w=>w.position.y+(w.height||0))),x=n.map(w=>Object.assign(Object.assign({},w),{position:Object.assign(Object.assign({},w.position),{y:p-(w.height||w.measured.height)})}));a(x)},g=()=>{if(n.length<3)return;const p=[...n].sort((C,k)=>C.position.y-k.position.y),x=p[0].position.y,w=p.reduce((C,k)=>C+(k.height||k.measured.height),0),N=p[p.length-1].position.y-x+(p[p.length-1].height||p[p.length-1].measured.height)-w,M=p.length>1?N/(p.length-1):0;let O=x;const _=p.map((C,k)=>{const H=Object.assign(Object.assign({},C),{position:Object.assign(Object.assign({},C.position),{y:O})});return O+=(C.height||C.measured.height)+M,H});a(_)},m=()=>{if(n.length<3)return;const p=[...n].sort((C,k)=>C.position.x-k.position.x),x=p[0].position.x,w=p.reduce((C,k)=>C+(k.width||k.measured.width),0),N=p[p.length-1].position.x-x+(p[p.length-1].width||p[p.length-1].measured.width)-w,M=p.length>1?N/(p.length-1):0;let O=x;const _=p.map((C,k)=>{const H=Object.assign(Object.assign({},C),{position:Object.assign(Object.assign({},C.position),{x:O})});return O+=(C.width||C.measured.width)+M,H});a(_)},y=()=>{if(n.length<2)return;const p=Math.max(...n.map(w=>w.width||w.measured.width)),x=n.map(w=>Object.assign(Object.assign({},w),{width:p}));a(x)},b=()=>{if(n.length<2)return;const p=Math.max(...n.map(w=>w.height||w.measured.height)),x=n.map(w=>Object.assign(Object.assign({},w),{height:p}));a(x)};return v.jsxs(bl,{position:"bottom-center",className:"multi-node-panel",children:[v.jsx("button",{title:"Align Left Horizontal",onClick:c,children:v.jsx(O_,{})}),v.jsx("button",{title:"Align Center Horizontal",onClick:f,children:v.jsx(C_,{})}),v.jsx("button",{title:"Align Right Horizontal",onClick:h,children:v.jsx(T_,{})}),v.jsx("button",{title:"Align Top Vertical",onClick:u,children:v.jsx(D_,{})}),v.jsx("button",{title:"Align Center Vertical",onClick:s,children:v.jsx(M_,{})}),v.jsx("button",{title:"Align Bottom Vertical",onClick:o,children:v.jsx(j_,{})}),n.length>2&&v.jsx("button",{title:"Distribute Vertical",onClick:g,children:v.jsx(z_,{})}),n.length>2&&v.jsx("button",{title:"Distribute Horizontal",onClick:m,children:v.jsx(A_,{})}),v.jsx("button",{title:"Same Width",onClick:y,children:v.jsx(Xm,{})}),v.jsx("button",{title:"Same Height",onClick:b,children:v.jsx(Xm,{style:{transform:"rotate(90deg)"}})})]})},$C={topic:Zm,task:$m,image:Bm,text:Gm},GC={floating:lC};function ZC({roadmapData:n,language:a="en",onChange:u}){var s;const{screenToFlowPosition:o}=Va(),[c,f,{undo:h,redo:g,canUndo:m,canRedo:y,reset:b,resetInitialState:p}]=qC({settings:{},version:1}),[x,w]=D.useState(!0),[E,N]=D.useState(!1),[M,O]=D.useState(!1),[_,C]=D.useState(!1),[k,H,U]=Om([]),[Q,q,te]=zm([]),[J,V]=D.useState({background:{color:"#ffffff"}}),Y=(J==null?void 0:J.language)||a,j=Nn(Y),B=[{action:j.shortcuts.save,shortcut:"Ctrl+S"},{action:j.shortcuts.undo,shortcut:"Ctrl+Z"},{action:j.shortcuts.redo,shortcut:"Ctrl+Y or Ctrl+Shift+Z"},{action:j.shortcuts.addTaskNode,shortcut:"Ctrl+A"},{action:j.shortcuts.addTopicNode,shortcut:"Ctrl+O"},{action:j.shortcuts.addImageNode,shortcut:"Ctrl+I"},{action:j.shortcuts.addTextNode,shortcut:"Ctrl+X"},{action:j.shortcuts.deleteNodeEdge,shortcut:"Delete"},{action:j.shortcuts.togglePreviewMode,shortcut:"Ctrl+P"},{action:j.shortcuts.toggleDebugMode,shortcut:"Ctrl+D"},{action:j.shortcuts.selectMultipleNodes,shortcut:"Ctrl+Click or Shift+Drag"},{action:j.shortcuts.showHelp,shortcut:"Ctrl+? or Help Button"}],[z,L]=D.useState(!1),[G]=D.useState("light"),[X,A]=D.useState(null),[$,F]=D.useState([]),[le,ee]=D.useState(!1),[de,fe]=D.useState(!1),[he,ie]=D.useState(1),[ge,me]=D.useState(!0),[be,xe]=D.useState(!0),[pe,we]=D.useState(!0),[Ae,je]=D.useState(null),[Ne,Le]=D.useState(!1),[Ut,Ze]=D.useState(!1);D.useEffect(()=>{const oe=Jm(n);Dt(oe),p(oe)},[n]);const Dt=D.useCallback(oe=>{const ce=Array.isArray(oe==null?void 0:oe.nodes)?oe.nodes:[],se=Array.isArray(oe==null?void 0:oe.edges)?oe.edges:[];V((oe==null?void 0:oe.settings)||{background:{color:"#ffffff"}});const Me=ce.map(Je=>Object.assign(Object.assign({},Je),{draggable:!0,data:Object.assign({},Je.data)}));if(q(se),H(Me),ce.length>0){const Je=Math.max(...ce.map(We=>parseInt(We.id.replace(/\D/g,""),10)).filter(We=>!isNaN(We)));ie(Je+1)}},[H,q,V]);D.useEffect(()=>{E&&(N(!1),Dt(c))},[c,E,Dt]),D.useEffect(()=>{const oe=Q.filter(ce=>!ce.id.startsWith("debug-"));_&&(k.forEach(ce=>{var se,Me,Je,We;ge&&ce.type==="topic"&&(!((Me=(se=ce.data)===null||se===void 0?void 0:se.completion)===null||Me===void 0)&&Me.needs)&&ce.data.completion.needs.forEach(nt=>{const ht=`debug-edge-${nt}-to-${ce.id}`;oe.push({id:ht,target:nt,source:ce.id,animated:!0,style:{stroke:"#f97316",strokeWidth:2,strokeDasharray:"5,5"},type:"floating"})}),be&&(!((We=(Je=ce.data)===null||Je===void 0?void 0:Je.completion)===null||We===void 0)&&We.optional)&&ce.data.completion.optional.forEach(nt=>{const ht=`debug-edge-optional-${nt}-to-${ce.id}`;oe.push({id:ht,target:nt,source:ce.id,animated:!0,style:{stroke:"#eab308",strokeWidth:2,strokeDasharray:"5,5"},type:"floating"})})}),k.forEach(ce=>{var se;pe&&(!((se=ce.data.unlock)===null||se===void 0)&&se.after)&&ce.data.unlock.after.forEach(Me=>{const Je=`debug-edge-${Me}-to-${ce.id}`;oe.push({id:Je,target:Me,source:ce.id,animated:!0,style:{stroke:"#10b981",strokeWidth:2,strokeDasharray:"5,5"},type:"floating"})})})),q(oe)},[k,q,_,ge,be,pe]);const sn=D.useCallback((oe,ce)=>{A(ce.id),ee(!0)},[]),st=D.useCallback((oe,ce)=>{je(ce),Le(!0)},[]),St=D.useCallback(oe=>{q(ce=>ag(oe,ce)),w(!1)},[q,w]),on=D.useCallback(()=>{C(oe=>!oe)},[C]),ft=D.useCallback(()=>{ee(!1),A(null),Le(!1),je(null),fe(!1)},[]),rn=D.useCallback(oe=>{H(ce=>ce.map(se=>se.id===oe.id?oe:se)),w(!1)},[H,w]),Et=D.useCallback(oe=>{H(ce=>ce.map(se=>{const Me=oe.find(Je=>Je.id===se.id);return Me||se})),w(!1)},[H,w]),El=D.useCallback(oe=>{q(ce=>ce.map(se=>se.id===oe.id?Object.assign(Object.assign({},se),oe):se)),je(oe),w(!1)},[q,je,w]),Ln=D.useCallback(()=>{Ae&&(q(oe=>oe.filter(ce=>ce.id!==Ae.id)),w(!1),ft())},[Ae,q,ft]),Jn=D.useCallback(()=>{X&&(H(oe=>oe.filter(ce=>ce.id!==X)),q(oe=>oe.filter(ce=>ce.source!==X&&ce.target!==X)),w(!1),ft())},[X,H,q,ft,w]),$t=D.useCallback(oe=>{const ce=o({x:window.innerWidth/2,y:window.innerHeight/2});if(oe==="task"){const se={id:`node${he}`,type:oe,position:ce,data:{label:j.newTask,summary:"",description:""}};H(Me=>[...Me,se]),ie(Me=>Me+1)}else if(oe==="topic"){const se={id:`node${he}`,type:oe,position:ce,data:{label:j.newTopic,summary:"",description:""}};H(Me=>[...Me,se]),ie(Me=>Me+1)}else if(oe==="image"){const se={id:`background-node${he}`,type:oe,zIndex:-2,position:ce,data:{src:""}};H(Me=>[...Me,se]),ie(Me=>Me+1)}else if(oe==="text"){const se={id:`background-node${he}`,type:oe,position:ce,zIndex:-1,data:{text:j.backgroundTextDefault,fontSize:32,color:"#e5e7eb"}};H(Me=>[...Me,se]),ie(Me=>Me+1)}w(!1)},[he,o,H,w,j]),kt=D.useCallback(()=>{const oe={nodes:k.map(ce=>({id:ce.id,type:ce.type,position:ce.position,width:ce.width,height:ce.height,zIndex:ce.zIndex,data:ce.data})),edges:Q.filter(ce=>!ce.id.startsWith("debug-")).map(ce=>({id:ce.id,source:ce.source,target:ce.target,sourceHandle:ce.sourceHandle,targetHandle:ce.targetHandle,animated:ce.animated,type:ce.type,style:ce.style})),settings:J,version:1};if(f(oe),w(!0),u){u(oe);return}else{const ce=document.querySelector("hyperbook-learningmap-editor");ce&&ce.dispatchEvent(new CustomEvent("change",{detail:oe}))}},[k,Q,J]),ot=D.useCallback(()=>{kt(),O(oe=>{const ce=!oe;return ce&&(C(!1),ft()),ce})},[O,kt]),_l=D.useCallback(()=>{var oe;const ce="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(c,null,2)),se=document.createElement("a");se.setAttribute("href",ce),se.setAttribute("download",`${(oe=c.settings.title)!==null&&oe!==void 0?oe:new Date().toString()}.learningmap.json`),document.body.appendChild(se),se.click(),se.remove()},[c]),Gt={animated:!1,style:{stroke:"#94a3b8",strokeWidth:2},type:"default"},vt=D.useCallback(()=>ac(this,void 0,void 0,function*(){var oe;const ce=Yh(k),se=ce.width,Me=ce.height;let Je=Ms(ce,se,Me,.1,5);const We=document.querySelector(".react-flow__viewport");We&&QN(We,{backgroundColor:((oe=J==null?void 0:J.background)===null||oe===void 0?void 0:oe.color)||"#ffffff",width:se,height:Me,style:{transform:`translate(${Je.x/2}px, ${Je.y/2}px) scale(${Je.zoom})`,width:`${se}px`,height:`${Me}px`}}).then(nt=>{const ht=document.createElement("a");ht.setAttribute("href",nt),ht.setAttribute("download","roadmap.svg"),document.body.appendChild(ht),ht.click(),ht.remove()}).catch(nt=>{alert(j.failedToExportSVG+nt.message)})}),[k,c,j]),Nl=D.useCallback(()=>{const oe=document.createElement("input");oe.type="file",oe.accept=".json,application/json",oe.onchange=ce=>{const se=ce.target.files[0];if(!se||!window.confirm(j.openFileWarning))return;const Me=new FileReader;Me.onload=Je=>{var We;try{const nt=(We=Je.target)===null||We===void 0?void 0:We.result;if(typeof nt=="string"){const ht=JSON.parse(nt);f(ht),Dt(ht)}}catch{alert(j.failedToLoadFile)}},Me.readAsText(se)},oe.click()},[f,N,j]),Oe=D.useCallback(()=>fe(!0),[]),tt=D.useCallback(oe=>me(oe),[]),dt=D.useCallback(oe=>xe(oe),[]),bt=D.useCallback(oe=>we(oe),[]),Ye=D.useCallback(oe=>{w(!1),U(oe)},[U,w]),Pt=D.useCallback(oe=>{w(!1),te(oe)},[te,w]),Zt=D.useCallback(()=>{m&&(h(),N(!0))},[m,h]),Wn=D.useCallback(()=>{y&&(g(),N(!0))},[y,g]),Cn=D.useCallback(()=>{b(),N(!0)},[b]),Cl=D.useCallback(({nodes:oe})=>{oe.length>1?F(oe.map(ce=>ce.id)):F([])},[F]);return D.useEffect(()=>{const oe=se=>{se.key==="Shift"&&Ze(!0),(se.ctrlKey||se.metaKey)&&se.key==="s"&&!se.shiftKey&&(se.preventDefault(),kt()),(se.ctrlKey||se.metaKey)&&se.key==="z"&&!se.shiftKey&&(se.preventDefault(),Zt()),(se.ctrlKey||se.metaKey)&&(se.key==="y"||se.shiftKey&&se.key==="Z")&&(se.preventDefault(),Wn()),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="a"&&!se.shiftKey&&(se.preventDefault(),$t("task")),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="o"&&!se.shiftKey&&(se.preventDefault(),$t("topic")),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="i"&&!se.shiftKey&&(se.preventDefault(),$t("image")),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="x"&&!se.shiftKey&&(se.preventDefault(),$t("text")),(se.ctrlKey||se.metaKey)&&(se.key==="?"||se.shiftKey&&se.key==="/")&&(se.preventDefault(),L(Me=>!Me)),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="p"&&!se.shiftKey&&(se.preventDefault(),ot()),(se.ctrlKey||se.metaKey)&&se.key.toLowerCase()==="d"&&!se.shiftKey&&(se.preventDefault(),on()),z&&se.key==="Escape"&&L(!1)},ce=se=>{se.key==="Shift"&&Ze(!1)};return window.addEventListener("keydown",oe),window.addEventListener("keyup",ce),()=>{window.removeEventListener("keydown",oe),window.removeEventListener("keyup",ce)}},[kt,Zt,Wn,$t,z,L,ot,on]),v.jsxs(v.Fragment,{children:[v.jsx(RC,{saved:x,debugMode:_,previewMode:M,showCompletionNeeds:ge,showCompletionOptional:be,showUnlockAfter:pe,onToggleDebugMode:on,onTogglePreviewMode:ot,onSetShowCompletionNeeds:tt,onSetShowCompletionOptional:dt,onSetShowUnlockAfter:bt,onAddNewNode:$t,onOpenSettingsDrawer:Oe,onSave:kt,onDownlad:_l,onOpen:Nl,onExportSVG:vt,language:Y}),M&&v.jsx(Im,{roadmapData:c,language:Y}),!M&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"editor-canvas",style:{backgroundColor:((s=J==null?void 0:J.background)===null||s===void 0?void 0:s.color)||"#ffffff"},children:v.jsxs(jm,{nodes:k.map(oe=>{var ce;const se=[];return!((ce=oe.data)===null||ce===void 0)&&ce.color&&se.push(oe.data.color),Object.assign(Object.assign({},oe),{className:se.join(" ")})}),edges:Q,onEdgesChange:Pt,onNodeDoubleClick:sn,onEdgeDoubleClick:st,onNodesChange:Ye,onConnect:St,onSelectionChange:Cl,nodeTypes:$C,selectionOnDrag:!1,edgeTypes:GC,fitView:!0,snapToGrid:!Ut,proOptions:{hideAttribution:!0},defaultEdgeOptions:Gt,nodesDraggable:!0,elevateNodesOnSelect:!1,nodesConnectable:!0,colorMode:G,children:[v.jsx(IE,{}),v.jsxs(Hm,{children:[v.jsx(Sl,{title:j.undo,disabled:!m,onClick:Zt,children:v.jsx(G_,{})}),v.jsx(Sl,{title:j.redo,disabled:!y,onClick:Wn,children:v.jsx(Y_,{})}),v.jsx(Sl,{title:j.reset,onClick:Cn,children:v.jsx(q_,{})}),v.jsx(Sl,{title:j.help,onClick:()=>L(!0),children:v.jsx(B_,{})})]}),!x&&v.jsx(bl,{position:"top-right",title:j.unsavedChanges,onClick:()=>{kt()},children:v.jsx($_,{size:32,color:"red"})}),$.length>1&&v.jsx(XC,{nodes:k.filter(oe=>$.includes(oe.id)),onUpdate:Et})]})}),v.jsx(PN,{node:k.find(oe=>oe.id===X),isOpen:le,onClose:ft,onUpdate:rn,onDelete:Jn,language:Y}),v.jsx(tC,{edge:Ae,isOpen:Ne,onClose:ft,onUpdate:El,onDelete:Ln,language:Y}),v.jsx(nC,{isOpen:de,onClose:ft,settings:J,onUpdate:V,language:Y}),v.jsxs("dialog",{className:"help",open:z,onClose:()=>L(!1),children:[v.jsx("h2",{children:j.keyboardShortcuts}),v.jsxs("table",{children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{children:j.action}),v.jsx("th",{children:j.shortcut})]})}),v.jsx("tbody",{children:B.map(oe=>v.jsxs("tr",{children:[v.jsx("td",{children:oe.action}),v.jsx("td",{children:oe.shortcut})]},oe.action))})]}),v.jsx("button",{className:"primary-button",onClick:()=>L(!1),children:j.close})]})]})]})}function KC({roadmapData:n,language:a,onChange:u}){return v.jsx("div",{className:"hyperbook-learningmap-container",children:v.jsx(tc,{children:v.jsx(ZC,{language:a,roadmapData:n,onChange:u})})})}const QC=Bd(iN,{props:{roadmapData:"string",language:"string",onChange:"function",initialState:"json"},events:{change:!0}});customElements.define("hyperbook-learningmap",QC);const JC=Bd(KC,{props:{roadmapData:"string",language:"string",onChange:"function"},events:{change:!0}});customElements.define("hyperbook-learningmap-editor",JC)});
|