ocwatch 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +6 -0
  2. package/package.json +1 -1
  3. package/src/client/dist/assets/index-BIu7r5_5.css +1 -0
  4. package/src/client/dist/assets/index-CzAaOuyw.js +50 -0
  5. package/src/client/dist/index.html +2 -2
  6. package/src/server/__tests__/helpers/testDb.ts +220 -0
  7. package/src/server/index.ts +20 -5
  8. package/src/server/logic/activityLogic.ts +260 -0
  9. package/src/server/logic/index.ts +2 -0
  10. package/src/server/logic/sessionLogic.ts +107 -0
  11. package/src/server/routes/parts.ts +9 -7
  12. package/src/server/routes/poll.ts +34 -45
  13. package/src/server/routes/projects.ts +4 -4
  14. package/src/server/routes/sessions.ts +107 -68
  15. package/src/server/routes/sse.ts +10 -4
  16. package/src/server/services/parsing.ts +211 -0
  17. package/src/server/services/pollService.ts +292 -114
  18. package/src/server/services/sessionService.ts +178 -106
  19. package/src/server/storage/db.ts +71 -0
  20. package/src/server/storage/index.ts +22 -0
  21. package/src/server/storage/queries.ts +325 -0
  22. package/src/server/utils/projectResolver.ts +2 -2
  23. package/src/server/utils/sessionStatus.ts +4 -70
  24. package/src/server/watcher.ts +187 -82
  25. package/src/shared/constants.ts +1 -0
  26. package/src/shared/types/index.ts +39 -5
  27. package/src/shared/utils/formatTime.ts +3 -1
  28. package/src/client/dist/assets/index-27vUxwIP.css +0 -1
  29. package/src/client/dist/assets/index-B1aj6-ff.js +0 -41
  30. package/src/server/storage/messageParser.ts +0 -169
  31. package/src/server/storage/partParser.ts +0 -532
  32. package/src/server/storage/sessionParser.ts +0 -180
  33. package/src/shared/utils/burstGrouping.ts +0 -99
@@ -0,0 +1,50 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function a(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=a(l);fetch(l.href,u)}})();function u1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pd={exports:{}},Vo={};var by;function FE(){if(by)return Vo;by=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(o,l,u){var c=null;if(u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),"key"in l){u={};for(var d in l)d!=="key"&&(u[d]=l[d])}else u=l;return l=u.ref,{$$typeof:t,type:o,key:c,ref:l!==void 0?l:null,props:u}}return Vo.Fragment=n,Vo.jsx=a,Vo.jsxs=a,Vo}var Sy;function JE(){return Sy||(Sy=1,pd.exports=FE()),pd.exports}var w=JE(),gd={exports:{}},bt={};var wy;function WE(){if(wy)return bt;wy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function E(j,Y,W){this.props=j,this.context=Y,this.refs=A,this.updater=W||S}E.prototype.isReactComponent={},E.prototype.setState=function(j,Y){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,Y,"setState")},E.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function _(){}_.prototype=E.prototype;function N(j,Y,W){this.props=j,this.context=Y,this.refs=A,this.updater=W||S}var M=N.prototype=new _;M.constructor=N,T(M,E.prototype),M.isPureReactComponent=!0;var z=Array.isArray;function V(){}var O={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function X(j,Y,W){var et=W.ref;return{$$typeof:t,type:j,key:Y,ref:et!==void 0?et:null,props:W}}function st(j,Y){return X(j.type,Y,j.props)}function P(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function F(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(W){return Y[W]})}var it=/\/+/g;function L(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?F(""+j.key):Y.toString(36)}function $(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(V,V):(j.status="pending",j.then(function(Y){j.status==="pending"&&(j.status="fulfilled",j.value=Y)},function(Y){j.status==="pending"&&(j.status="rejected",j.reason=Y)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function D(j,Y,W,et,rt){var ut=typeof j;(ut==="undefined"||ut==="boolean")&&(j=null);var ct=!1;if(j===null)ct=!0;else switch(ut){case"bigint":case"string":case"number":ct=!0;break;case"object":switch(j.$$typeof){case t:case n:ct=!0;break;case g:return ct=j._init,D(ct(j._payload),Y,W,et,rt)}}if(ct)return rt=rt(j),ct=et===""?"."+L(j,0):et,z(rt)?(W="",ct!=null&&(W=ct.replace(it,"$&/")+"/"),D(rt,Y,W,"",function(Et){return Et})):rt!=null&&(P(rt)&&(rt=st(rt,W+(rt.key==null||j&&j.key===rt.key?"":(""+rt.key).replace(it,"$&/")+"/")+ct)),Y.push(rt)),1;ct=0;var lt=et===""?".":et+":";if(z(j))for(var ft=0;ft<j.length;ft++)et=j[ft],ut=lt+L(et,ft),ct+=D(et,Y,W,ut,rt);else if(ft=x(j),typeof ft=="function")for(j=ft.call(j),ft=0;!(et=j.next()).done;)et=et.value,ut=lt+L(et,ft++),ct+=D(et,Y,W,ut,rt);else if(ut==="object"){if(typeof j.then=="function")return D($(j),Y,W,et,rt);throw Y=String(j),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ct}function H(j,Y,W){if(j==null)return j;var et=[],rt=0;return D(j,et,"","",function(ut){return Y.call(W,ut,rt++)}),et}function U(j){if(j._status===-1){var Y=j._result;Y=Y(),Y.then(function(W){(j._status===0||j._status===-1)&&(j._status=1,j._result=W)},function(W){(j._status===0||j._status===-1)&&(j._status=2,j._result=W)}),j._status===-1&&(j._status=0,j._result=Y)}if(j._status===1)return j._result.default;throw j._result}var Z=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},tt={map:H,forEach:function(j,Y,W){H(j,function(){Y.apply(this,arguments)},W)},count:function(j){var Y=0;return H(j,function(){Y++}),Y},toArray:function(j){return H(j,function(Y){return Y})||[]},only:function(j){if(!P(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return bt.Activity=y,bt.Children=tt,bt.Component=E,bt.Fragment=a,bt.Profiler=l,bt.PureComponent=N,bt.StrictMode=o,bt.Suspense=p,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,bt.__COMPILER_RUNTIME={__proto__:null,c:function(j){return O.H.useMemoCache(j)}},bt.cache=function(j){return function(){return j.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(j,Y,W){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var et=T({},j.props),rt=j.key;if(Y!=null)for(ut in Y.key!==void 0&&(rt=""+Y.key),Y)!k.call(Y,ut)||ut==="key"||ut==="__self"||ut==="__source"||ut==="ref"&&Y.ref===void 0||(et[ut]=Y[ut]);var ut=arguments.length-2;if(ut===1)et.children=W;else if(1<ut){for(var ct=Array(ut),lt=0;lt<ut;lt++)ct[lt]=arguments[lt+2];et.children=ct}return X(j.type,rt,et)},bt.createContext=function(j){return j={$$typeof:c,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:u,_context:j},j},bt.createElement=function(j,Y,W){var et,rt={},ut=null;if(Y!=null)for(et in Y.key!==void 0&&(ut=""+Y.key),Y)k.call(Y,et)&&et!=="key"&&et!=="__self"&&et!=="__source"&&(rt[et]=Y[et]);var ct=arguments.length-2;if(ct===1)rt.children=W;else if(1<ct){for(var lt=Array(ct),ft=0;ft<ct;ft++)lt[ft]=arguments[ft+2];rt.children=lt}if(j&&j.defaultProps)for(et in ct=j.defaultProps,ct)rt[et]===void 0&&(rt[et]=ct[et]);return X(j,ut,rt)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(j){return{$$typeof:d,render:j}},bt.isValidElement=P,bt.lazy=function(j){return{$$typeof:g,_payload:{_status:-1,_result:j},_init:U}},bt.memo=function(j,Y){return{$$typeof:h,type:j,compare:Y===void 0?null:Y}},bt.startTransition=function(j){var Y=O.T,W={};O.T=W;try{var et=j(),rt=O.S;rt!==null&&rt(W,et),typeof et=="object"&&et!==null&&typeof et.then=="function"&&et.then(V,Z)}catch(ut){Z(ut)}finally{Y!==null&&W.types!==null&&(Y.types=W.types),O.T=Y}},bt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},bt.use=function(j){return O.H.use(j)},bt.useActionState=function(j,Y,W){return O.H.useActionState(j,Y,W)},bt.useCallback=function(j,Y){return O.H.useCallback(j,Y)},bt.useContext=function(j){return O.H.useContext(j)},bt.useDebugValue=function(){},bt.useDeferredValue=function(j,Y){return O.H.useDeferredValue(j,Y)},bt.useEffect=function(j,Y){return O.H.useEffect(j,Y)},bt.useEffectEvent=function(j){return O.H.useEffectEvent(j)},bt.useId=function(){return O.H.useId()},bt.useImperativeHandle=function(j,Y,W){return O.H.useImperativeHandle(j,Y,W)},bt.useInsertionEffect=function(j,Y){return O.H.useInsertionEffect(j,Y)},bt.useLayoutEffect=function(j,Y){return O.H.useLayoutEffect(j,Y)},bt.useMemo=function(j,Y){return O.H.useMemo(j,Y)},bt.useOptimistic=function(j,Y){return O.H.useOptimistic(j,Y)},bt.useReducer=function(j,Y,W){return O.H.useReducer(j,Y,W)},bt.useRef=function(j){return O.H.useRef(j)},bt.useState=function(j){return O.H.useState(j)},bt.useSyncExternalStore=function(j,Y,W){return O.H.useSyncExternalStore(j,Y,W)},bt.useTransition=function(){return O.H.useTransition()},bt.version="19.2.4",bt}var Ey;function hr(){return Ey||(Ey=1,gd.exports=WE()),gd.exports}var R=hr();const As=u1(R);var yd={exports:{}},Lo={},vd={exports:{}},xd={};var Ty;function tT(){return Ty||(Ty=1,(function(t){function n(D,H){var U=D.length;D.push(H);t:for(;0<U;){var Z=U-1>>>1,tt=D[Z];if(0<l(tt,H))D[Z]=H,D[U]=tt,U=Z;else break t}}function a(D){return D.length===0?null:D[0]}function o(D){if(D.length===0)return null;var H=D[0],U=D.pop();if(U!==H){D[0]=U;t:for(var Z=0,tt=D.length,j=tt>>>1;Z<j;){var Y=2*(Z+1)-1,W=D[Y],et=Y+1,rt=D[et];if(0>l(W,U))et<tt&&0>l(rt,W)?(D[Z]=rt,D[et]=U,Z=et):(D[Z]=W,D[Y]=U,Z=Y);else if(et<tt&&0>l(rt,U))D[Z]=rt,D[et]=U,Z=et;else break t}}return H}function l(D,H){var U=D.sortIndex-H.sortIndex;return U!==0?U:D.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var p=[],h=[],g=1,y=null,v=3,x=!1,S=!1,T=!1,A=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(D){for(var H=a(h);H!==null;){if(H.callback===null)o(h);else if(H.startTime<=D)o(h),H.sortIndex=H.expirationTime,n(p,H);else break;H=a(h)}}function z(D){if(T=!1,M(D),!S)if(a(p)!==null)S=!0,V||(V=!0,F());else{var H=a(h);H!==null&&$(z,H.startTime-D)}}var V=!1,O=-1,k=5,X=-1;function st(){return A?!0:!(t.unstable_now()-X<k)}function P(){if(A=!1,V){var D=t.unstable_now();X=D;var H=!0;try{t:{S=!1,T&&(T=!1,_(O),O=-1),x=!0;var U=v;try{e:{for(M(D),y=a(p);y!==null&&!(y.expirationTime>D&&st());){var Z=y.callback;if(typeof Z=="function"){y.callback=null,v=y.priorityLevel;var tt=Z(y.expirationTime<=D);if(D=t.unstable_now(),typeof tt=="function"){y.callback=tt,M(D),H=!0;break e}y===a(p)&&o(p),M(D)}else o(p);y=a(p)}if(y!==null)H=!0;else{var j=a(h);j!==null&&$(z,j.startTime-D),H=!1}}break t}finally{y=null,v=U,x=!1}H=void 0}}finally{H?F():V=!1}}}var F;if(typeof N=="function")F=function(){N(P)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,L=it.port2;it.port1.onmessage=P,F=function(){L.postMessage(null)}}else F=function(){E(P,0)};function $(D,H){O=E(function(){D(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(D){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var U=v;v=H;try{return D()}finally{v=U}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(D,H){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var U=v;v=D;try{return H()}finally{v=U}},t.unstable_scheduleCallback=function(D,H,U){var Z=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?Z+U:Z):U=Z,D){case 1:var tt=-1;break;case 2:tt=250;break;case 5:tt=1073741823;break;case 4:tt=1e4;break;default:tt=5e3}return tt=U+tt,D={id:g++,callback:H,priorityLevel:D,startTime:U,expirationTime:tt,sortIndex:-1},U>Z?(D.sortIndex=U,n(h,D),a(p)===null&&D===a(h)&&(T?(_(O),O=-1):T=!0,$(z,U-Z))):(D.sortIndex=tt,n(p,D),S||x||(S=!0,V||(V=!0,F()))),D},t.unstable_shouldYield=st,t.unstable_wrapCallback=function(D){var H=v;return function(){var U=v;v=H;try{return D.apply(this,arguments)}finally{v=U}}}})(xd)),xd}var Ay;function eT(){return Ay||(Ay=1,vd.exports=tT()),vd.exports}var bd={exports:{}},Se={};var Ny;function nT(){if(Ny)return Se;Ny=1;var t=hr();function n(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(p,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:p,containerInfo:h,implementation:g}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Se.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Se.createPortal=function(p,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return u(p,h,null,g)},Se.flushSync=function(p){var h=c.T,g=o.p;try{if(c.T=null,o.p=2,p)return p()}finally{c.T=h,o.p=g,o.d.f()}},Se.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},Se.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},Se.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):g==="script"&&o.d.X(p,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Se.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},Se.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin);o.d.L(p,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Se.preloadModule=function(p,h){if(typeof p=="string")if(h){var g=d(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},Se.requestFormReset=function(p){o.d.r(p)},Se.unstable_batchedUpdates=function(p,h){return p(h)},Se.useFormState=function(p,h,g){return c.H.useFormState(p,h,g)},Se.useFormStatus=function(){return c.H.useHostTransitionStatus()},Se.version="19.2.4",Se}var My;function c1(){if(My)return bd.exports;My=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),bd.exports=nT(),bd.exports}var _y;function iT(){if(_y)return Lo;_y=1;var t=eT(),n=hr(),a=c1();function o(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var i=e,s=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(s=i.return),e=i.return;while(e)}return i.tag===3?s:null}function c(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function d(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(o(188))}function h(e){var i=e.alternate;if(!i){if(i=u(e),i===null)throw Error(o(188));return i!==e?null:e}for(var s=e,r=i;;){var f=s.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){s=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===s)return p(f),e;if(m===r)return p(f),i;m=m.sibling}throw Error(o(188))}if(s.return!==r.return)s=f,r=m;else{for(var b=!1,C=f.child;C;){if(C===s){b=!0,s=f,r=m;break}if(C===r){b=!0,r=f,s=m;break}C=C.sibling}if(!b){for(C=m.child;C;){if(C===s){b=!0,s=m,r=f;break}if(C===r){b=!0,r=m,s=f;break}C=C.sibling}if(!b)throw Error(o(189))}}if(s.alternate!==r)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:i}function g(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=g(e),i!==null)return i;e=e.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),st=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var it=Symbol.for("react.client.reference");function L(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===it?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case E:return"Profiler";case A:return"StrictMode";case z:return"Suspense";case V:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case N:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case M:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return i=e.displayName||null,i!==null?i:L(e.type)||"Memo";case k:i=e._payload,e=e._init;try{return L(e(i))}catch{}}return null}var $=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},Z=[],tt=-1;function j(e){return{current:e}}function Y(e){0>tt||(e.current=Z[tt],Z[tt]=null,tt--)}function W(e,i){tt++,Z[tt]=e.current,e.current=i}var et=j(null),rt=j(null),ut=j(null),ct=j(null);function lt(e,i){switch(W(ut,i),W(rt,e),W(et,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?X0(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=X0(i),e=G0(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(et),W(et,e)}function ft(){Y(et),Y(rt),Y(ut)}function Et(e){e.memoizedState!==null&&W(ct,e);var i=et.current,s=G0(i,e.type);i!==s&&(W(rt,e),W(et,s))}function St(e){rt.current===e&&(Y(et),Y(rt)),ct.current===e&&(Y(ct),Ro._currentValue=U)}var yt,xt;function Mt(e){if(yt===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);yt=i&&i[1]||"",xt=-1<s.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+yt+e+xt}var Bt=!1;function Vt(e,i){if(!e||Bt)return"";Bt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ot=function(){throw Error()};if(Object.defineProperty(ot.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ot,[])}catch(J){var Q=J}Reflect.construct(e,[],ot)}else{try{ot.call()}catch(J){Q=J}e.call(ot.prototype)}}else{try{throw Error()}catch(J){Q=J}(ot=e())&&typeof ot.catch=="function"&&ot.catch(function(){})}}catch(J){if(J&&Q&&typeof J.stack=="string")return[J.stack,Q.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=r.DetermineComponentFrameRoot(),b=m[0],C=m[1];if(b&&C){var B=b.split(`
4
+ `),K=C.split(`
5
+ `);for(f=r=0;r<B.length&&!B[r].includes("DetermineComponentFrameRoot");)r++;for(;f<K.length&&!K[f].includes("DetermineComponentFrameRoot");)f++;if(r===B.length||f===K.length)for(r=B.length-1,f=K.length-1;1<=r&&0<=f&&B[r]!==K[f];)f--;for(;1<=r&&0<=f;r--,f--)if(B[r]!==K[f]){if(r!==1||f!==1)do if(r--,f--,0>f||B[r]!==K[f]){var nt=`
6
+ `+B[r].replace(" at new "," at ");return e.displayName&&nt.includes("<anonymous>")&&(nt=nt.replace("<anonymous>",e.displayName)),nt}while(1<=r&&0<=f);break}}}finally{Bt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Mt(s):""}function de(e,i){switch(e.tag){case 26:case 27:case 5:return Mt(e.type);case 16:return Mt("Lazy");case 13:return e.child!==i&&i!==null?Mt("Suspense Fallback"):Mt("Suspense");case 19:return Mt("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return Mt("Activity");default:return""}}function rn(e){try{var i="",s=null;do i+=de(e,s),s=e,e=e.return;while(e);return i}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var ke=Object.prototype.hasOwnProperty,ln=t.unstable_scheduleCallback,jn=t.unstable_cancelCallback,$i=t.unstable_shouldYield,Zi=t.unstable_requestPaint,me=t.unstable_now,Ca=t.unstable_getCurrentPriorityLevel,zn=t.unstable_ImmediatePriority,ri=t.unstable_UserBlockingPriority,Pi=t.unstable_NormalPriority,Fu=t.unstable_LowPriority,Da=t.unstable_IdlePriority,Ju=t.log,Wu=t.unstable_setDisableYieldValue,Ii=null,Ee=null;function bn(e){if(typeof Ju=="function"&&Wu(e),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(Ii,e)}catch{}}var Te=Math.clz32?Math.clz32:nc,tc=Math.log,ec=Math.LN2;function nc(e){return e>>>=0,e===0?32:31-(tc(e)/ec|0)|0}var Ra=256,ja=262144,za=4194304;function On(e){var i=e&42;if(i!==0)return i;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:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;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 Oa(e,i,s){var r=e.pendingLanes;if(r===0)return 0;var f=0,m=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var C=r&134217727;return C!==0?(r=C&~m,r!==0?f=On(r):(b&=C,b!==0?f=On(b):s||(s=C&~e,s!==0&&(f=On(s))))):(C=r&~m,C!==0?f=On(C):b!==0?f=On(b):s||(s=r&~e,s!==0&&(f=On(s)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,s=i&-i,m>=s||m===32&&(s&4194048)!==0)?i:f}function Ki(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ic(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+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 Mr(){var e=za;return za<<=1,(za&62914560)===0&&(za=4194304),e}function Ys(e){for(var i=[],s=0;31>s;s++)i.push(e);return i}function Qi(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ac(e,i,s,r,f,m){var b=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var C=e.entanglements,B=e.expirationTimes,K=e.hiddenUpdates;for(s=b&~s;0<s;){var nt=31-Te(s),ot=1<<nt;C[nt]=0,B[nt]=-1;var Q=K[nt];if(Q!==null)for(K[nt]=null,nt=0;nt<Q.length;nt++){var J=Q[nt];J!==null&&(J.lane&=-536870913)}s&=~ot}r!==0&&_r(e,r,0),m!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=m&~(b&~i))}function _r(e,i,s){e.pendingLanes|=i,e.suspendedLanes&=~i;var r=31-Te(i);e.entangledLanes|=i,e.entanglements[r]=e.entanglements[r]|1073741824|s&261930}function Cr(e,i){var s=e.entangledLanes|=i;for(e=e.entanglements;s;){var r=31-Te(s),f=1<<r;f&i|e[r]&i&&(e[r]|=i),s&=~f}}function Dr(e,i){var s=i&-i;return s=(s&42)!==0?1:qs(s),(s&(e.suspendedLanes|i))!==0?0:s}function qs(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:hy(e.type))}function jr(e,i){var s=H.p;try{return H.p=e,i()}finally{H.p=s}}var Sn=Math.random().toString(36).slice(2),ue="__reactFiber$"+Sn,be="__reactProps$"+Sn,Vn="__reactContainer$"+Sn,Va="__reactEvents$"+Sn,zr="__reactListeners$"+Sn,sc="__reactHandles$"+Sn,Or="__reactResources$"+Sn,Fi="__reactMarker$"+Sn;function Gs(e){delete e[ue],delete e[be],delete e[Va],delete e[zr],delete e[sc]}function li(e){var i=e[ue];if(i)return i;for(var s=e.parentNode;s;){if(i=s[Vn]||s[ue]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(e=F0(e);e!==null;){if(s=e[ue])return s;e=F0(e)}return i}e=s,s=e.parentNode}return null}function ui(e){if(e=e[ue]||e[Vn]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function ci(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(o(33))}function fi(e){var i=e[Or];return i||(i=e[Or]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ne(e){e[Fi]=!0}var Vr=new Set,Lr={};function Ln(e,i){di(e,i),di(e+"Capture",i)}function di(e,i){for(Lr[e]=i,e=0;e<i.length;e++)Vr.add(i[e])}var oc=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]*$"),$s={},Hr={};function rc(e){return ke.call(Hr,e)?!0:ke.call($s,e)?!1:oc.test(e)?Hr[e]=!0:($s[e]=!0,!1)}function La(e,i,s){if(rc(i))if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+s)}}function Ha(e,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+s)}}function un(e,i,s,r){if(r===null)e.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(i,s,""+r)}}function De(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Br(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function lc(e,i,s){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,m=r.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){s=""+b,m.call(this,b)}}),Object.defineProperty(e,i,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(b){s=""+b},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Ba(e){if(!e._valueTracker){var i=Br(e)?"checked":"value";e._valueTracker=lc(e,i,""+e[i])}}function kr(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var s=i.getValue(),r="";return e&&(r=Br(e)?e.checked?"true":"false":e.value),e=r,e!==s?(i.setValue(e),!0):!1}function Ji(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 uc=/[\n"\\]/g;function Re(e){return e.replace(uc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Wi(e,i,s,r,f,m,b,C){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),i!=null?b==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+De(i)):e.value!==""+De(i)&&(e.value=""+De(i)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),i!=null?Zs(e,b,De(i)):s!=null?Zs(e,b,De(s)):r!=null&&e.removeAttribute("value"),f==null&&m!=null&&(e.defaultChecked=!!m),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+De(C):e.removeAttribute("name")}function Ur(e,i,s,r,f,m,b,C){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),i!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){Ba(e);return}s=s!=null?""+De(s):"",i=i!=null?""+De(i):s,C||i===e.value||(e.value=i),e.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=C?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Ba(e)}function Zs(e,i,s){i==="number"&&Ji(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Hn(e,i,s,r){if(e=e.options,i){i={};for(var f=0;f<s.length;f++)i["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=i.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&r&&(e[s].defaultSelected=!0)}else{for(s=""+De(s),i=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,r&&(e[f].defaultSelected=!0);return}i!==null||e[f].disabled||(i=e[f])}i!==null&&(i.selected=!0)}}function Bm(e,i,s){if(i!=null&&(i=""+De(i),i!==e.value&&(e.value=i),s==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=s!=null?""+De(s):""}function km(e,i,s,r){if(i==null){if(r!=null){if(s!=null)throw Error(o(92));if($(r)){if(1<r.length)throw Error(o(93));r=r[0]}s=r}s==null&&(s=""),i=s}s=De(i),e.defaultValue=s,r=e.textContent,r===s&&r!==""&&r!==null&&(e.value=r),Ba(e)}function ka(e,i){if(i){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=i;return}}e.textContent=i}var Zw=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 Um(e,i,s){var r=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?r?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":r?e.setProperty(i,s):typeof s!="number"||s===0||Zw.has(i)?i==="float"?e.cssFloat=s:e[i]=(""+s).trim():e[i]=s+"px"}function Ym(e,i,s){if(i!=null&&typeof i!="object")throw Error(o(62));if(e=e.style,s!=null){for(var r in s)!s.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&s[f]!==r&&Um(e,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Um(e,m,i[m])}function cc(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 Pw=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"]]),Iw=/^[\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 Yr(e){return Iw.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Bn(){}var fc=null;function dc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,Ya=null;function qm(e){var i=ui(e);if(i&&(e=i.stateNode)){var s=e[be]||null;t:switch(e=i.stateNode,i.type){case"input":if(Wi(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Re(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var r=s[i];if(r!==e&&r.form===e.form){var f=r[be]||null;if(!f)throw Error(o(90));Wi(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<s.length;i++)r=s[i],r.form===e.form&&kr(r)}break t;case"textarea":Bm(e,s.value,s.defaultValue);break t;case"select":i=s.value,i!=null&&Hn(e,!!s.multiple,i,!1)}}}var hc=!1;function Xm(e,i,s){if(hc)return e(i,s);hc=!0;try{var r=e(i);return r}finally{if(hc=!1,(Ua!==null||Ya!==null)&&(_l(),Ua&&(i=Ua,e=Ya,Ya=Ua=null,qm(i),e)))for(i=0;i<e.length;i++)qm(e[i])}}function Ps(e,i){var s=e.stateNode;if(s===null)return null;var r=s[be]||null;if(r===null)return null;s=r[i];t:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break t;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,i,typeof s));return s}var kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mc=!1;if(kn)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){mc=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{mc=!1}var hi=null,pc=null,qr=null;function Gm(){if(qr)return qr;var e,i=pc,s=i.length,r,f="value"in hi?hi.value:hi.textContent,m=f.length;for(e=0;e<s&&i[e]===f[e];e++);var b=s-e;for(r=1;r<=b&&i[s-r]===f[m-r];r++);return qr=f.slice(e,1<r?1-r:void 0)}function Xr(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Gr(){return!0}function $m(){return!1}function je(e){function i(s,r,f,m,b){this._reactName=s,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var C in e)e.hasOwnProperty(C)&&(s=e[C],this[C]=s?s(m):m[C]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Gr:$m,this.isPropagationStopped=$m,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Gr)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Gr)},persist:function(){},isPersistent:Gr}),i}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$r=je(ta),Ks=y({},ta,{view:0,detail:0}),Kw=je(Ks),gc,yc,Qs,Zr=y({},Ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xc,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!==Qs&&(Qs&&e.type==="mousemove"?(gc=e.screenX-Qs.screenX,yc=e.screenY-Qs.screenY):yc=gc=0,Qs=e),gc)},movementY:function(e){return"movementY"in e?e.movementY:yc}}),Zm=je(Zr),Qw=y({},Zr,{dataTransfer:0}),Fw=je(Qw),Jw=y({},Ks,{relatedTarget:0}),vc=je(Jw),Ww=y({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),t2=je(Ww),e2=y({},ta,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),n2=je(e2),i2=y({},ta,{data:0}),Pm=je(i2),a2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s2={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"},o2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r2(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=o2[e])?!!i[e]:!1}function xc(){return r2}var l2=y({},Ks,{key:function(e){if(e.key){var i=a2[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=Xr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?s2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xc,charCode:function(e){return e.type==="keypress"?Xr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),u2=je(l2),c2=y({},Zr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Im=je(c2),f2=y({},Ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xc}),d2=je(f2),h2=y({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),m2=je(h2),p2=y({},Zr,{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}),g2=je(p2),y2=y({},ta,{newState:0,oldState:0}),v2=je(y2),x2=[9,13,27,32],bc=kn&&"CompositionEvent"in window,Fs=null;kn&&"documentMode"in document&&(Fs=document.documentMode);var b2=kn&&"TextEvent"in window&&!Fs,Km=kn&&(!bc||Fs&&8<Fs&&11>=Fs),Qm=" ",Fm=!1;function Jm(e,i){switch(e){case"keyup":return x2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qa=!1;function S2(e,i){switch(e){case"compositionend":return Wm(i);case"keypress":return i.which!==32?null:(Fm=!0,Qm);case"textInput":return e=i.data,e===Qm&&Fm?null:e;default:return null}}function w2(e,i){if(qa)return e==="compositionend"||!bc&&Jm(e,i)?(e=Gm(),qr=pc=hi=null,qa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Km&&i.locale!=="ko"?null:i.data;default:return null}}var E2={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 tp(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!E2[e.type]:i==="textarea"}function ep(e,i,s,r){Ua?Ya?Ya.push(r):Ya=[r]:Ua=r,i=Vl(i,"onChange"),0<i.length&&(s=new $r("onChange","change",null,s,r),e.push({event:s,listeners:i}))}var Js=null,Ws=null;function T2(e){H0(e,0)}function Pr(e){var i=ci(e);if(kr(i))return e}function np(e,i){if(e==="change")return i}var ip=!1;if(kn){var Sc;if(kn){var wc="oninput"in document;if(!wc){var ap=document.createElement("div");ap.setAttribute("oninput","return;"),wc=typeof ap.oninput=="function"}Sc=wc}else Sc=!1;ip=Sc&&(!document.documentMode||9<document.documentMode)}function sp(){Js&&(Js.detachEvent("onpropertychange",op),Ws=Js=null)}function op(e){if(e.propertyName==="value"&&Pr(Ws)){var i=[];ep(i,Ws,e,dc(e)),Xm(T2,i)}}function A2(e,i,s){e==="focusin"?(sp(),Js=i,Ws=s,Js.attachEvent("onpropertychange",op)):e==="focusout"&&sp()}function N2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pr(Ws)}function M2(e,i){if(e==="click")return Pr(i)}function _2(e,i){if(e==="input"||e==="change")return Pr(i)}function C2(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Ue=typeof Object.is=="function"?Object.is:C2;function to(e,i){if(Ue(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var s=Object.keys(e),r=Object.keys(i);if(s.length!==r.length)return!1;for(r=0;r<s.length;r++){var f=s[r];if(!ke.call(i,f)||!Ue(e[f],i[f]))return!1}return!0}function rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lp(e,i){var s=rp(e);e=0;for(var r;s;){if(s.nodeType===3){if(r=e+s.textContent.length,e<=i&&r>=i)return{node:s,offset:i-e};e=r}t:{for(;s;){if(s.nextSibling){s=s.nextSibling;break t}s=s.parentNode}s=void 0}s=rp(s)}}function up(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?up(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function cp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Ji(e.document);i instanceof e.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)e=i.contentWindow;else break;i=Ji(e.document)}return i}function Ec(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var D2=kn&&"documentMode"in document&&11>=document.documentMode,Xa=null,Tc=null,eo=null,Ac=!1;function fp(e,i,s){var r=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ac||Xa==null||Xa!==Ji(r)||(r=Xa,"selectionStart"in r&&Ec(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),eo&&to(eo,r)||(eo=r,r=Vl(Tc,"onSelect"),0<r.length&&(i=new $r("onSelect","select",null,i,s),e.push({event:i,listeners:r}),i.target=Xa)))}function ea(e,i){var s={};return s[e.toLowerCase()]=i.toLowerCase(),s["Webkit"+e]="webkit"+i,s["Moz"+e]="moz"+i,s}var Ga={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Nc={},dp={};kn&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete Ga.animationend.animation,delete Ga.animationiteration.animation,delete Ga.animationstart.animation),"TransitionEvent"in window||delete Ga.transitionend.transition);function na(e){if(Nc[e])return Nc[e];if(!Ga[e])return e;var i=Ga[e],s;for(s in i)if(i.hasOwnProperty(s)&&s in dp)return Nc[e]=i[s];return e}var hp=na("animationend"),mp=na("animationiteration"),pp=na("animationstart"),R2=na("transitionrun"),j2=na("transitionstart"),z2=na("transitioncancel"),gp=na("transitionend"),yp=new Map,Mc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Mc.push("scrollEnd");function cn(e,i){yp.set(e,i),Ln(i,[e])}var Ir=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ke=[],$a=0,_c=0;function Kr(){for(var e=$a,i=_c=$a=0;i<e;){var s=Ke[i];Ke[i++]=null;var r=Ke[i];Ke[i++]=null;var f=Ke[i];Ke[i++]=null;var m=Ke[i];if(Ke[i++]=null,r!==null&&f!==null){var b=r.pending;b===null?f.next=f:(f.next=b.next,b.next=f),r.pending=f}m!==0&&vp(s,f,m)}}function Qr(e,i,s,r){Ke[$a++]=e,Ke[$a++]=i,Ke[$a++]=s,Ke[$a++]=r,_c|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Cc(e,i,s,r){return Qr(e,i,s,r),Fr(e)}function ia(e,i){return Qr(e,null,null,i),Fr(e)}function vp(e,i,s){e.lanes|=s;var r=e.alternate;r!==null&&(r.lanes|=s);for(var f=!1,m=e.return;m!==null;)m.childLanes|=s,r=m.alternate,r!==null&&(r.childLanes|=s),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(f=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,f&&i!==null&&(f=31-Te(s),e=m.hiddenUpdates,r=e[f],r===null?e[f]=[i]:r.push(i),i.lane=s|536870912),m):null}function Fr(e){if(50<To)throw To=0,kf=null,Error(o(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var Za={};function O2(e,i,s,r){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,i,s,r){return new O2(e,i,s,r)}function Dc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Un(e,i){var s=e.alternate;return s===null?(s=Ye(e.tag,i,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=i,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,i=e.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function xp(e,i){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,i=s.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Jr(e,i,s,r,f,m){var b=0;if(r=e,typeof e=="function")Dc(e)&&(b=1);else if(typeof e=="string")b=kE(e,s,et.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case X:return e=Ye(31,s,i,f),e.elementType=X,e.lanes=m,e;case T:return aa(s.children,f,m,i);case A:b=8,f|=24;break;case E:return e=Ye(12,s,i,f|2),e.elementType=E,e.lanes=m,e;case z:return e=Ye(13,s,i,f),e.elementType=z,e.lanes=m,e;case V:return e=Ye(19,s,i,f),e.elementType=V,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:b=10;break t;case _:b=9;break t;case M:b=11;break t;case O:b=14;break t;case k:b=16,r=null;break t}b=29,s=Error(o(130,e===null?"null":typeof e,"")),r=null}return i=Ye(b,s,i,f),i.elementType=e,i.type=r,i.lanes=m,i}function aa(e,i,s,r){return e=Ye(7,e,r,i),e.lanes=s,e}function Rc(e,i,s){return e=Ye(6,e,null,i),e.lanes=s,e}function bp(e){var i=Ye(18,null,null,0);return i.stateNode=e,i}function jc(e,i,s){return i=Ye(4,e.children!==null?e.children:[],e.key,i),i.lanes=s,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Sp=new WeakMap;function Qe(e,i){if(typeof e=="object"&&e!==null){var s=Sp.get(e);return s!==void 0?s:(i={value:e,source:i,stack:rn(i)},Sp.set(e,i),i)}return{value:e,source:i,stack:rn(i)}}var Pa=[],Ia=0,Wr=null,no=0,Fe=[],Je=0,mi=null,wn=1,En="";function Yn(e,i){Pa[Ia++]=no,Pa[Ia++]=Wr,Wr=e,no=i}function wp(e,i,s){Fe[Je++]=wn,Fe[Je++]=En,Fe[Je++]=mi,mi=e;var r=wn;e=En;var f=32-Te(r)-1;r&=~(1<<f),s+=1;var m=32-Te(i)+f;if(30<m){var b=f-f%5;m=(r&(1<<b)-1).toString(32),r>>=b,f-=b,wn=1<<32-Te(i)+f|s<<f|r,En=m+e}else wn=1<<m|s<<f|r,En=e}function zc(e){e.return!==null&&(Yn(e,1),wp(e,1,0))}function Oc(e){for(;e===Wr;)Wr=Pa[--Ia],Pa[Ia]=null,no=Pa[--Ia],Pa[Ia]=null;for(;e===mi;)mi=Fe[--Je],Fe[Je]=null,En=Fe[--Je],Fe[Je]=null,wn=Fe[--Je],Fe[Je]=null}function Ep(e,i){Fe[Je++]=wn,Fe[Je++]=En,Fe[Je++]=mi,wn=i.id,En=i.overflow,mi=e}var pe=null,$t=null,Dt=!1,pi=null,We=!1,Vc=Error(o(519));function gi(e){var i=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw io(Qe(i,e)),Vc}function Tp(e){var i=e.stateNode,s=e.type,r=e.memoizedProps;switch(i[ue]=e,i[be]=r,s){case"dialog":Nt("cancel",i),Nt("close",i);break;case"iframe":case"object":case"embed":Nt("load",i);break;case"video":case"audio":for(s=0;s<No.length;s++)Nt(No[s],i);break;case"source":Nt("error",i);break;case"img":case"image":case"link":Nt("error",i),Nt("load",i);break;case"details":Nt("toggle",i);break;case"input":Nt("invalid",i),Ur(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Nt("invalid",i);break;case"textarea":Nt("invalid",i),km(i,r.value,r.defaultValue,r.children)}s=r.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||r.suppressHydrationWarning===!0||Y0(i.textContent,s)?(r.popover!=null&&(Nt("beforetoggle",i),Nt("toggle",i)),r.onScroll!=null&&Nt("scroll",i),r.onScrollEnd!=null&&Nt("scrollend",i),r.onClick!=null&&(i.onclick=Bn),i=!0):i=!1,i||gi(e,!0)}function Ap(e){for(pe=e.return;pe;)switch(pe.tag){case 5:case 31:case 13:We=!1;return;case 27:case 3:We=!0;return;default:pe=pe.return}}function Ka(e){if(e!==pe)return!1;if(!Dt)return Ap(e),Dt=!0,!1;var i=e.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||td(e.type,e.memoizedProps)),s=!s),s&&$t&&gi(e),Ap(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));$t=Q0(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));$t=Q0(e)}else i===27?(i=$t,Di(e.type)?(e=sd,sd=null,$t=e):$t=i):$t=pe?en(e.stateNode.nextSibling):null;return!0}function sa(){$t=pe=null,Dt=!1}function Lc(){var e=pi;return e!==null&&(Le===null?Le=e:Le.push.apply(Le,e),pi=null),e}function io(e){pi===null?pi=[e]:pi.push(e)}var Hc=j(null),oa=null,qn=null;function yi(e,i,s){W(Hc,i._currentValue),i._currentValue=s}function Xn(e){e._currentValue=Hc.current,Y(Hc)}function Bc(e,i,s){for(;e!==null;){var r=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),e===s)break;e=e.return}}function kc(e,i,s,r){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;t:for(;m!==null;){var C=m;m=f;for(var B=0;B<i.length;B++)if(C.context===i[B]){m.lanes|=s,C=m.alternate,C!==null&&(C.lanes|=s),Bc(m.return,s,e),r||(b=null);break t}m=C.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(o(341));b.lanes|=s,m=b.alternate,m!==null&&(m.lanes|=s),Bc(b,s,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Qa(e,i,s,r){e=null;for(var f=i,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var C=f.type;Ue(f.pendingProps.value,b.value)||(e!==null?e.push(C):e=[C])}}else if(f===ct.current){if(b=f.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Ro):e=[Ro])}f=f.return}e!==null&&kc(i,e,s,r),i.flags|=262144}function tl(e){for(e=e.firstContext;e!==null;){if(!Ue(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){oa=e,qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ge(e){return Np(oa,e)}function el(e,i){return oa===null&&ra(e),Np(e,i)}function Np(e,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},qn===null){if(e===null)throw Error(o(308));qn=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else qn=qn.next=i;return s}var V2=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(s,r){e.push(r)}};this.abort=function(){i.aborted=!0,e.forEach(function(s){return s()})}},L2=t.unstable_scheduleCallback,H2=t.unstable_NormalPriority,ie={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uc(){return{controller:new V2,data:new Map,refCount:0}}function ao(e){e.refCount--,e.refCount===0&&L2(H2,function(){e.controller.abort()})}var so=null,Yc=0,Fa=0,Ja=null;function B2(e,i){if(so===null){var s=so=[];Yc=0,Fa=$f(),Ja={status:"pending",value:void 0,then:function(r){s.push(r)}}}return Yc++,i.then(Mp,Mp),i}function Mp(){if(--Yc===0&&so!==null){Ja!==null&&(Ja.status="fulfilled");var e=so;so=null,Fa=0,Ja=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function k2(e,i){var s=[],r={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<s.length;f++)(0,s[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),r}var _p=D.S;D.S=function(e,i){f0=me(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&B2(e,i),_p!==null&&_p(e,i)};var la=j(null);function qc(){var e=la.current;return e!==null?e:qt.pooledCache}function nl(e,i){i===null?W(la,la.current):W(la,i.pool)}function Cp(){var e=qc();return e===null?null:{parent:ie._currentValue,pool:e}}var Wa=Error(o(460)),Xc=Error(o(474)),il=Error(o(542)),al={then:function(){}};function Dp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Rp(e,i,s){switch(s=e[s],s===void 0?e.push(i):s!==i&&(i.then(Bn,Bn),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,zp(e),e;default:if(typeof i.status=="string")i.then(Bn,Bn);else{if(e=qt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=i,e.status="pending",e.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,zp(e),e}throw ca=i,Wa}}function ua(e){try{var i=e._init;return i(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ca=s,Wa):s}}var ca=null;function jp(){if(ca===null)throw Error(o(459));var e=ca;return ca=null,e}function zp(e){if(e===Wa||e===il)throw Error(o(483))}var ts=null,oo=0;function sl(e){var i=oo;return oo+=1,ts===null&&(ts=[]),Rp(ts,e,i)}function ro(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function ol(e,i){throw i.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(i),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function Op(e){function i(G,q){if(e){var I=G.deletions;I===null?(G.deletions=[q],G.flags|=16):I.push(q)}}function s(G,q){if(!e)return null;for(;q!==null;)i(G,q),q=q.sibling;return null}function r(G){for(var q=new Map;G!==null;)G.key!==null?q.set(G.key,G):q.set(G.index,G),G=G.sibling;return q}function f(G,q){return G=Un(G,q),G.index=0,G.sibling=null,G}function m(G,q,I){return G.index=I,e?(I=G.alternate,I!==null?(I=I.index,I<q?(G.flags|=67108866,q):I):(G.flags|=67108866,q)):(G.flags|=1048576,q)}function b(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function C(G,q,I,at){return q===null||q.tag!==6?(q=Rc(I,G.mode,at),q.return=G,q):(q=f(q,I),q.return=G,q)}function B(G,q,I,at){var gt=I.type;return gt===T?nt(G,q,I.props.children,at,I.key):q!==null&&(q.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===k&&ua(gt)===q.type)?(q=f(q,I.props),ro(q,I),q.return=G,q):(q=Jr(I.type,I.key,I.props,null,G.mode,at),ro(q,I),q.return=G,q)}function K(G,q,I,at){return q===null||q.tag!==4||q.stateNode.containerInfo!==I.containerInfo||q.stateNode.implementation!==I.implementation?(q=jc(I,G.mode,at),q.return=G,q):(q=f(q,I.children||[]),q.return=G,q)}function nt(G,q,I,at,gt){return q===null||q.tag!==7?(q=aa(I,G.mode,at,gt),q.return=G,q):(q=f(q,I),q.return=G,q)}function ot(G,q,I){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Rc(""+q,G.mode,I),q.return=G,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return I=Jr(q.type,q.key,q.props,null,G.mode,I),ro(I,q),I.return=G,I;case S:return q=jc(q,G.mode,I),q.return=G,q;case k:return q=ua(q),ot(G,q,I)}if($(q)||F(q))return q=aa(q,G.mode,I,null),q.return=G,q;if(typeof q.then=="function")return ot(G,sl(q),I);if(q.$$typeof===N)return ot(G,el(G,q),I);ol(G,q)}return null}function Q(G,q,I,at){var gt=q!==null?q.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return gt!==null?null:C(G,q,""+I,at);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case x:return I.key===gt?B(G,q,I,at):null;case S:return I.key===gt?K(G,q,I,at):null;case k:return I=ua(I),Q(G,q,I,at)}if($(I)||F(I))return gt!==null?null:nt(G,q,I,at,null);if(typeof I.then=="function")return Q(G,q,sl(I),at);if(I.$$typeof===N)return Q(G,q,el(G,I),at);ol(G,I)}return null}function J(G,q,I,at,gt){if(typeof at=="string"&&at!==""||typeof at=="number"||typeof at=="bigint")return G=G.get(I)||null,C(q,G,""+at,gt);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case x:return G=G.get(at.key===null?I:at.key)||null,B(q,G,at,gt);case S:return G=G.get(at.key===null?I:at.key)||null,K(q,G,at,gt);case k:return at=ua(at),J(G,q,I,at,gt)}if($(at)||F(at))return G=G.get(I)||null,nt(q,G,at,gt,null);if(typeof at.then=="function")return J(G,q,I,sl(at),gt);if(at.$$typeof===N)return J(G,q,I,el(q,at),gt);ol(q,at)}return null}function dt(G,q,I,at){for(var gt=null,jt=null,mt=q,Tt=q=0,Ct=null;mt!==null&&Tt<I.length;Tt++){mt.index>Tt?(Ct=mt,mt=null):Ct=mt.sibling;var zt=Q(G,mt,I[Tt],at);if(zt===null){mt===null&&(mt=Ct);break}e&&mt&&zt.alternate===null&&i(G,mt),q=m(zt,q,Tt),jt===null?gt=zt:jt.sibling=zt,jt=zt,mt=Ct}if(Tt===I.length)return s(G,mt),Dt&&Yn(G,Tt),gt;if(mt===null){for(;Tt<I.length;Tt++)mt=ot(G,I[Tt],at),mt!==null&&(q=m(mt,q,Tt),jt===null?gt=mt:jt.sibling=mt,jt=mt);return Dt&&Yn(G,Tt),gt}for(mt=r(mt);Tt<I.length;Tt++)Ct=J(mt,G,Tt,I[Tt],at),Ct!==null&&(e&&Ct.alternate!==null&&mt.delete(Ct.key===null?Tt:Ct.key),q=m(Ct,q,Tt),jt===null?gt=Ct:jt.sibling=Ct,jt=Ct);return e&&mt.forEach(function(Vi){return i(G,Vi)}),Dt&&Yn(G,Tt),gt}function vt(G,q,I,at){if(I==null)throw Error(o(151));for(var gt=null,jt=null,mt=q,Tt=q=0,Ct=null,zt=I.next();mt!==null&&!zt.done;Tt++,zt=I.next()){mt.index>Tt?(Ct=mt,mt=null):Ct=mt.sibling;var Vi=Q(G,mt,zt.value,at);if(Vi===null){mt===null&&(mt=Ct);break}e&&mt&&Vi.alternate===null&&i(G,mt),q=m(Vi,q,Tt),jt===null?gt=Vi:jt.sibling=Vi,jt=Vi,mt=Ct}if(zt.done)return s(G,mt),Dt&&Yn(G,Tt),gt;if(mt===null){for(;!zt.done;Tt++,zt=I.next())zt=ot(G,zt.value,at),zt!==null&&(q=m(zt,q,Tt),jt===null?gt=zt:jt.sibling=zt,jt=zt);return Dt&&Yn(G,Tt),gt}for(mt=r(mt);!zt.done;Tt++,zt=I.next())zt=J(mt,G,Tt,zt.value,at),zt!==null&&(e&&zt.alternate!==null&&mt.delete(zt.key===null?Tt:zt.key),q=m(zt,q,Tt),jt===null?gt=zt:jt.sibling=zt,jt=zt);return e&&mt.forEach(function(QE){return i(G,QE)}),Dt&&Yn(G,Tt),gt}function Yt(G,q,I,at){if(typeof I=="object"&&I!==null&&I.type===T&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case x:t:{for(var gt=I.key;q!==null;){if(q.key===gt){if(gt=I.type,gt===T){if(q.tag===7){s(G,q.sibling),at=f(q,I.props.children),at.return=G,G=at;break t}}else if(q.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===k&&ua(gt)===q.type){s(G,q.sibling),at=f(q,I.props),ro(at,I),at.return=G,G=at;break t}s(G,q);break}else i(G,q);q=q.sibling}I.type===T?(at=aa(I.props.children,G.mode,at,I.key),at.return=G,G=at):(at=Jr(I.type,I.key,I.props,null,G.mode,at),ro(at,I),at.return=G,G=at)}return b(G);case S:t:{for(gt=I.key;q!==null;){if(q.key===gt)if(q.tag===4&&q.stateNode.containerInfo===I.containerInfo&&q.stateNode.implementation===I.implementation){s(G,q.sibling),at=f(q,I.children||[]),at.return=G,G=at;break t}else{s(G,q);break}else i(G,q);q=q.sibling}at=jc(I,G.mode,at),at.return=G,G=at}return b(G);case k:return I=ua(I),Yt(G,q,I,at)}if($(I))return dt(G,q,I,at);if(F(I)){if(gt=F(I),typeof gt!="function")throw Error(o(150));return I=gt.call(I),vt(G,q,I,at)}if(typeof I.then=="function")return Yt(G,q,sl(I),at);if(I.$$typeof===N)return Yt(G,q,el(G,I),at);ol(G,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,q!==null&&q.tag===6?(s(G,q.sibling),at=f(q,I),at.return=G,G=at):(s(G,q),at=Rc(I,G.mode,at),at.return=G,G=at),b(G)):s(G,q)}return function(G,q,I,at){try{oo=0;var gt=Yt(G,q,I,at);return ts=null,gt}catch(mt){if(mt===Wa||mt===il)throw mt;var jt=Ye(29,mt,null,G.mode);return jt.lanes=at,jt.return=G,jt}}}var fa=Op(!0),Vp=Op(!1),vi=!1;function Gc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bi(e,i,s){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ot&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=Fr(e),vp(e,null,s),i}return Qr(e,r,i,s),Fr(e)}function lo(e,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Cr(e,s)}}function Zc(e,i){var s=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,s===r)){var f=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var b={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,s=s.next}while(s!==null);m===null?f=m=i:m=m.next=i}else f=m=i;s={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=i:e.next=i,s.lastBaseUpdate=i}var Pc=!1;function uo(){if(Pc){var e=Ja;if(e!==null)throw e}}function co(e,i,s,r){Pc=!1;var f=e.updateQueue;vi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var B=C,K=B.next;B.next=null,b===null?m=K:b.next=K,b=B;var nt=e.alternate;nt!==null&&(nt=nt.updateQueue,C=nt.lastBaseUpdate,C!==b&&(C===null?nt.firstBaseUpdate=K:C.next=K,nt.lastBaseUpdate=B))}if(m!==null){var ot=f.baseState;b=0,nt=K=B=null,C=m;do{var Q=C.lane&-536870913,J=Q!==C.lane;if(J?(_t&Q)===Q:(r&Q)===Q){Q!==0&&Q===Fa&&(Pc=!0),nt!==null&&(nt=nt.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});t:{var dt=e,vt=C;Q=i;var Yt=s;switch(vt.tag){case 1:if(dt=vt.payload,typeof dt=="function"){ot=dt.call(Yt,ot,Q);break t}ot=dt;break t;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=vt.payload,Q=typeof dt=="function"?dt.call(Yt,ot,Q):dt,Q==null)break t;ot=y({},ot,Q);break t;case 2:vi=!0}}Q=C.callback,Q!==null&&(e.flags|=64,J&&(e.flags|=8192),J=f.callbacks,J===null?f.callbacks=[Q]:J.push(Q))}else J={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},nt===null?(K=nt=J,B=ot):nt=nt.next=J,b|=Q;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;J=C,C=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);nt===null&&(B=ot),f.baseState=B,f.firstBaseUpdate=K,f.lastBaseUpdate=nt,m===null&&(f.shared.lanes=0),Ai|=b,e.lanes=b,e.memoizedState=ot}}function Lp(e,i){if(typeof e!="function")throw Error(o(191,e));e.call(i)}function Hp(e,i){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Lp(s[e],i)}var es=j(null),rl=j(0);function Bp(e,i){e=Jn,W(rl,e),W(es,i),Jn=e|i.baseLanes}function Ic(){W(rl,Jn),W(es,es.current)}function Kc(){Jn=rl.current,Y(es),Y(rl)}var qe=j(null),tn=null;function Si(e){var i=e.alternate;W(te,te.current&1),W(qe,e),tn===null&&(i===null||es.current!==null||i.memoizedState!==null)&&(tn=e)}function Qc(e){W(te,te.current),W(qe,e),tn===null&&(tn=e)}function kp(e){e.tag===22?(W(te,te.current),W(qe,e),tn===null&&(tn=e)):wi()}function wi(){W(te,te.current),W(qe,qe.current)}function Xe(e){Y(qe),tn===e&&(tn=null),Y(te)}var te=j(0);function ll(e){for(var i=e;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||id(s)||ad(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Gn=0,wt=null,kt=null,ae=null,ul=!1,ns=!1,da=!1,cl=0,fo=0,is=null,U2=0;function Ft(){throw Error(o(321))}function Fc(e,i){if(i===null)return!1;for(var s=0;s<i.length&&s<e.length;s++)if(!Ue(e[s],i[s]))return!1;return!0}function Jc(e,i,s,r,f,m){return Gn=m,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,D.H=e===null||e.memoizedState===null?wg:mf,da=!1,m=s(r,f),da=!1,ns&&(m=Yp(i,s,r,f)),Up(e),m}function Up(e){D.H=po;var i=kt!==null&&kt.next!==null;if(Gn=0,ae=kt=wt=null,ul=!1,fo=0,is=null,i)throw Error(o(300));e===null||se||(e=e.dependencies,e!==null&&tl(e)&&(se=!0))}function Yp(e,i,s,r){wt=e;var f=0;do{if(ns&&(is=null),fo=0,ns=!1,25<=f)throw Error(o(301));if(f+=1,ae=kt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}D.H=Eg,m=i(s,r)}while(ns);return m}function Y2(){var e=D.H,i=e.useState()[0];return i=typeof i.then=="function"?ho(i):i,e=e.useState()[0],(kt!==null?kt.memoizedState:null)!==e&&(wt.flags|=1024),i}function Wc(){var e=cl!==0;return cl=0,e}function tf(e,i,s){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~s}function ef(e){if(ul){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}ul=!1}Gn=0,ae=kt=wt=null,ns=!1,fo=cl=0,is=null}function Ae(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ae===null?wt.memoizedState=ae=e:ae=ae.next=e,ae}function ee(){if(kt===null){var e=wt.alternate;e=e!==null?e.memoizedState:null}else e=kt.next;var i=ae===null?wt.memoizedState:ae.next;if(i!==null)ae=i,kt=e;else{if(e===null)throw wt.alternate===null?Error(o(467)):Error(o(310));kt=e,e={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},ae===null?wt.memoizedState=ae=e:ae=ae.next=e}return ae}function fl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(e){var i=fo;return fo+=1,is===null&&(is=[]),e=Rp(is,e,i),i=wt,(ae===null?i.memoizedState:ae.next)===null&&(i=i.alternate,D.H=i===null||i.memoizedState===null?wg:mf),e}function dl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ho(e);if(e.$$typeof===N)return ge(e)}throw Error(o(438,String(e)))}function nf(e){var i=null,s=wt.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var r=wt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=fl(),wt.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(e),r=0;r<e;r++)s[r]=st;return i.index++,s}function $n(e,i){return typeof i=="function"?i(e):i}function hl(e){var i=ee();return af(i,kt,e)}function af(e,i,s){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=s;var f=e.baseQueue,m=r.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}i.baseQueue=f=m,r.pending=null}if(m=e.baseState,f===null)e.memoizedState=m;else{i=f.next;var C=b=null,B=null,K=i,nt=!1;do{var ot=K.lane&-536870913;if(ot!==K.lane?(_t&ot)===ot:(Gn&ot)===ot){var Q=K.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ot===Fa&&(nt=!0);else if((Gn&Q)===Q){K=K.next,Q===Fa&&(nt=!0);continue}else ot={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},B===null?(C=B=ot,b=m):B=B.next=ot,wt.lanes|=Q,Ai|=Q;ot=K.action,da&&s(m,ot),m=K.hasEagerState?K.eagerState:s(m,ot)}else Q={lane:ot,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},B===null?(C=B=Q,b=m):B=B.next=Q,wt.lanes|=ot,Ai|=ot;K=K.next}while(K!==null&&K!==i);if(B===null?b=m:B.next=C,!Ue(m,e.memoizedState)&&(se=!0,nt&&(s=Ja,s!==null)))throw s;e.memoizedState=m,e.baseState=b,e.baseQueue=B,r.lastRenderedState=m}return f===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function sf(e){var i=ee(),s=i.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var r=s.dispatch,f=s.pending,m=i.memoizedState;if(f!==null){s.pending=null;var b=f=f.next;do m=e(m,b.action),b=b.next;while(b!==f);Ue(m,i.memoizedState)||(se=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),s.lastRenderedState=m}return[m,r]}function qp(e,i,s){var r=wt,f=ee(),m=Dt;if(m){if(s===void 0)throw Error(o(407));s=s()}else s=i();var b=!Ue((kt||f).memoizedState,s);if(b&&(f.memoizedState=s,se=!0),f=f.queue,lf($p.bind(null,r,f,e),[e]),f.getSnapshot!==i||b||ae!==null&&ae.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Gp.bind(null,r,f,s,i),null),qt===null)throw Error(o(349));m||(Gn&127)!==0||Xp(r,i,s)}return s}function Xp(e,i,s){e.flags|=16384,e={getSnapshot:i,value:s},i=wt.updateQueue,i===null?(i=fl(),wt.updateQueue=i,i.stores=[e]):(s=i.stores,s===null?i.stores=[e]:s.push(e))}function Gp(e,i,s,r){i.value=s,i.getSnapshot=r,Zp(i)&&Pp(e)}function $p(e,i,s){return s(function(){Zp(i)&&Pp(e)})}function Zp(e){var i=e.getSnapshot;e=e.value;try{var s=i();return!Ue(e,s)}catch{return!0}}function Pp(e){var i=ia(e,2);i!==null&&He(i,e,2)}function of(e){var i=Ae();if(typeof e=="function"){var s=e;if(e=s(),da){bn(!0);try{s()}finally{bn(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:e},i}function Ip(e,i,s,r){return e.baseState=s,af(e,kt,typeof r=="function"?r:$n)}function q2(e,i,s,r,f){if(gl(e))throw Error(o(485));if(e=i.action,e!==null){var m={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};D.T!==null?s(!0):m.isTransition=!1,r(m),s=i.pending,s===null?(m.next=i.pending=m,Kp(i,m)):(m.next=s.next,i.pending=s.next=m)}}function Kp(e,i){var s=i.action,r=i.payload,f=e.state;if(i.isTransition){var m=D.T,b={};D.T=b;try{var C=s(f,r),B=D.S;B!==null&&B(b,C),Qp(e,i,C)}catch(K){rf(e,i,K)}finally{m!==null&&b.types!==null&&(m.types=b.types),D.T=m}}else try{m=s(f,r),Qp(e,i,m)}catch(K){rf(e,i,K)}}function Qp(e,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(r){Fp(e,i,r)},function(r){return rf(e,i,r)}):Fp(e,i,s)}function Fp(e,i,s){i.status="fulfilled",i.value=s,Jp(i),e.state=s,i=e.pending,i!==null&&(s=i.next,s===i?e.pending=null:(s=s.next,i.next=s,Kp(e,s)))}function rf(e,i,s){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=s,Jp(i),i=i.next;while(i!==r)}e.action=null}function Jp(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Wp(e,i){return i}function tg(e,i){if(Dt){var s=qt.formState;if(s!==null){t:{var r=wt;if(Dt){if($t){e:{for(var f=$t,m=We;f.nodeType!==8;){if(!m){f=null;break e}if(f=en(f.nextSibling),f===null){f=null;break e}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){$t=en(f.nextSibling),r=f.data==="F!";break t}}gi(r)}r=!1}r&&(i=s[0])}}return s=Ae(),s.memoizedState=s.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wp,lastRenderedState:i},s.queue=r,s=xg.bind(null,wt,r),r.dispatch=s,r=of(!1),m=hf.bind(null,wt,!1,r.queue),r=Ae(),f={state:i,dispatch:null,action:e,pending:null},r.queue=f,s=q2.bind(null,wt,f,m,s),f.dispatch=s,r.memoizedState=e,[i,s,!1]}function eg(e){var i=ee();return ng(i,kt,e)}function ng(e,i,s){if(i=af(e,i,Wp)[0],e=hl($n)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=ho(i)}catch(b){throw b===Wa?il:b}else r=i;i=ee();var f=i.queue,m=f.dispatch;return s!==i.memoizedState&&(wt.flags|=2048,as(9,{destroy:void 0},X2.bind(null,f,s),null)),[r,m,e]}function X2(e,i){e.action=i}function ig(e){var i=ee(),s=kt;if(s!==null)return ng(i,s,e);ee(),i=i.memoizedState,s=ee();var r=s.queue.dispatch;return s.memoizedState=e,[i,r,!1]}function as(e,i,s,r){return e={tag:e,create:s,deps:r,inst:i,next:null},i=wt.updateQueue,i===null&&(i=fl(),wt.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=e.next=e:(r=s.next,s.next=e,e.next=r,i.lastEffect=e),e}function ag(){return ee().memoizedState}function ml(e,i,s,r){var f=Ae();wt.flags|=e,f.memoizedState=as(1|i,{destroy:void 0},s,r===void 0?null:r)}function pl(e,i,s,r){var f=ee();r=r===void 0?null:r;var m=f.memoizedState.inst;kt!==null&&r!==null&&Fc(r,kt.memoizedState.deps)?f.memoizedState=as(i,m,s,r):(wt.flags|=e,f.memoizedState=as(1|i,m,s,r))}function sg(e,i){ml(8390656,8,e,i)}function lf(e,i){pl(2048,8,e,i)}function G2(e){wt.flags|=4;var i=wt.updateQueue;if(i===null)i=fl(),wt.updateQueue=i,i.events=[e];else{var s=i.events;s===null?i.events=[e]:s.push(e)}}function og(e){var i=ee().memoizedState;return G2({ref:i,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}function rg(e,i){return pl(4,2,e,i)}function lg(e,i){return pl(4,4,e,i)}function ug(e,i){if(typeof i=="function"){e=e();var s=i(e);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function cg(e,i,s){s=s!=null?s.concat([e]):null,pl(4,4,ug.bind(null,i,e),s)}function uf(){}function fg(e,i){var s=ee();i=i===void 0?null:i;var r=s.memoizedState;return i!==null&&Fc(i,r[1])?r[0]:(s.memoizedState=[e,i],e)}function dg(e,i){var s=ee();i=i===void 0?null:i;var r=s.memoizedState;if(i!==null&&Fc(i,r[1]))return r[0];if(r=e(),da){bn(!0);try{e()}finally{bn(!1)}}return s.memoizedState=[r,i],r}function cf(e,i,s){return s===void 0||(Gn&1073741824)!==0&&(_t&261930)===0?e.memoizedState=i:(e.memoizedState=s,e=h0(),wt.lanes|=e,Ai|=e,s)}function hg(e,i,s,r){return Ue(s,i)?s:es.current!==null?(e=cf(e,s,r),Ue(e,i)||(se=!0),e):(Gn&42)===0||(Gn&1073741824)!==0&&(_t&261930)===0?(se=!0,e.memoizedState=s):(e=h0(),wt.lanes|=e,Ai|=e,i)}function mg(e,i,s,r,f){var m=H.p;H.p=m!==0&&8>m?m:8;var b=D.T,C={};D.T=C,hf(e,!1,i,s);try{var B=f(),K=D.S;if(K!==null&&K(C,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var nt=k2(B,r);mo(e,i,nt,Ze(e))}else mo(e,i,r,Ze(e))}catch(ot){mo(e,i,{then:function(){},status:"rejected",reason:ot},Ze())}finally{H.p=m,b!==null&&C.types!==null&&(b.types=C.types),D.T=b}}function $2(){}function ff(e,i,s,r){if(e.tag!==5)throw Error(o(476));var f=pg(e).queue;mg(e,f,i,U,s===null?$2:function(){return gg(e),s(r)})}function pg(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:U},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:s},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function gg(e){var i=pg(e);i.next===null&&(i=e.alternate.memoizedState),mo(e,i.next.queue,{},Ze())}function df(){return ge(Ro)}function yg(){return ee().memoizedState}function vg(){return ee().memoizedState}function Z2(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var s=Ze();e=xi(s);var r=bi(i,e,s);r!==null&&(He(r,i,s),lo(r,i,s)),i={cache:Uc()},e.payload=i;return}i=i.return}}function P2(e,i,s){var r=Ze();s={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},gl(e)?bg(i,s):(s=Cc(e,i,s,r),s!==null&&(He(s,e,r),Sg(s,i,r)))}function xg(e,i,s){var r=Ze();mo(e,i,s,r)}function mo(e,i,s,r){var f={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(gl(e))bg(i,f);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var b=i.lastRenderedState,C=m(b,s);if(f.hasEagerState=!0,f.eagerState=C,Ue(C,b))return Qr(e,i,f,0),qt===null&&Kr(),!1}catch{}if(s=Cc(e,i,f,r),s!==null)return He(s,e,r),Sg(s,i,r),!0}return!1}function hf(e,i,s,r){if(r={lane:2,revertLane:$f(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gl(e)){if(i)throw Error(o(479))}else i=Cc(e,s,r,2),i!==null&&He(i,e,2)}function gl(e){var i=e.alternate;return e===wt||i!==null&&i===wt}function bg(e,i){ns=ul=!0;var s=e.pending;s===null?i.next=i:(i.next=s.next,s.next=i),e.pending=i}function Sg(e,i,s){if((s&4194048)!==0){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Cr(e,s)}}var po={readContext:ge,use:dl,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};po.useEffectEvent=Ft;var wg={readContext:ge,use:dl,useCallback:function(e,i){return Ae().memoizedState=[e,i===void 0?null:i],e},useContext:ge,useEffect:sg,useImperativeHandle:function(e,i,s){s=s!=null?s.concat([e]):null,ml(4194308,4,ug.bind(null,i,e),s)},useLayoutEffect:function(e,i){return ml(4194308,4,e,i)},useInsertionEffect:function(e,i){ml(4,2,e,i)},useMemo:function(e,i){var s=Ae();i=i===void 0?null:i;var r=e();if(da){bn(!0);try{e()}finally{bn(!1)}}return s.memoizedState=[r,i],r},useReducer:function(e,i,s){var r=Ae();if(s!==void 0){var f=s(i);if(da){bn(!0);try{s(i)}finally{bn(!1)}}}else f=i;return r.memoizedState=r.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},r.queue=e,e=e.dispatch=P2.bind(null,wt,e),[r.memoizedState,e]},useRef:function(e){var i=Ae();return e={current:e},i.memoizedState=e},useState:function(e){e=of(e);var i=e.queue,s=xg.bind(null,wt,i);return i.dispatch=s,[e.memoizedState,s]},useDebugValue:uf,useDeferredValue:function(e,i){var s=Ae();return cf(s,e,i)},useTransition:function(){var e=of(!1);return e=mg.bind(null,wt,e.queue,!0,!1),Ae().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,s){var r=wt,f=Ae();if(Dt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=i(),qt===null)throw Error(o(349));(_t&127)!==0||Xp(r,i,s)}f.memoizedState=s;var m={value:s,getSnapshot:i};return f.queue=m,sg($p.bind(null,r,m,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Gp.bind(null,r,m,s,i),null),s},useId:function(){var e=Ae(),i=qt.identifierPrefix;if(Dt){var s=En,r=wn;s=(r&~(1<<32-Te(r)-1)).toString(32)+s,i="_"+i+"R_"+s,s=cl++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=U2++,i="_"+i+"r_"+s.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:df,useFormState:tg,useActionState:tg,useOptimistic:function(e){var i=Ae();i.memoizedState=i.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=hf.bind(null,wt,!0,s),s.dispatch=i,[e,i]},useMemoCache:nf,useCacheRefresh:function(){return Ae().memoizedState=Z2.bind(null,wt)},useEffectEvent:function(e){var i=Ae(),s={impl:e};return i.memoizedState=s,function(){if((Ot&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},mf={readContext:ge,use:dl,useCallback:fg,useContext:ge,useEffect:lf,useImperativeHandle:cg,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:dg,useReducer:hl,useRef:ag,useState:function(){return hl($n)},useDebugValue:uf,useDeferredValue:function(e,i){var s=ee();return hg(s,kt.memoizedState,e,i)},useTransition:function(){var e=hl($n)[0],i=ee().memoizedState;return[typeof e=="boolean"?e:ho(e),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:df,useFormState:eg,useActionState:eg,useOptimistic:function(e,i){var s=ee();return Ip(s,kt,e,i)},useMemoCache:nf,useCacheRefresh:vg};mf.useEffectEvent=og;var Eg={readContext:ge,use:dl,useCallback:fg,useContext:ge,useEffect:lf,useImperativeHandle:cg,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:dg,useReducer:sf,useRef:ag,useState:function(){return sf($n)},useDebugValue:uf,useDeferredValue:function(e,i){var s=ee();return kt===null?cf(s,e,i):hg(s,kt.memoizedState,e,i)},useTransition:function(){var e=sf($n)[0],i=ee().memoizedState;return[typeof e=="boolean"?e:ho(e),i]},useSyncExternalStore:qp,useId:yg,useHostTransitionStatus:df,useFormState:ig,useActionState:ig,useOptimistic:function(e,i){var s=ee();return kt!==null?Ip(s,kt,e,i):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:nf,useCacheRefresh:vg};Eg.useEffectEvent=og;function pf(e,i,s,r){i=e.memoizedState,s=s(r,i),s=s==null?i:y({},i,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var gf={enqueueSetState:function(e,i,s){e=e._reactInternals;var r=Ze(),f=xi(r);f.payload=i,s!=null&&(f.callback=s),i=bi(e,f,r),i!==null&&(He(i,e,r),lo(i,e,r))},enqueueReplaceState:function(e,i,s){e=e._reactInternals;var r=Ze(),f=xi(r);f.tag=1,f.payload=i,s!=null&&(f.callback=s),i=bi(e,f,r),i!==null&&(He(i,e,r),lo(i,e,r))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var s=Ze(),r=xi(s);r.tag=2,i!=null&&(r.callback=i),i=bi(e,r,s),i!==null&&(He(i,e,s),lo(i,e,s))}};function Tg(e,i,s,r,f,m,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,m,b):i.prototype&&i.prototype.isPureReactComponent?!to(s,r)||!to(f,m):!0}function Ag(e,i,s,r){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,r),i.state!==e&&gf.enqueueReplaceState(i,i.state,null)}function ha(e,i){var s=i;if("ref"in i){s={};for(var r in i)r!=="ref"&&(s[r]=i[r])}if(e=e.defaultProps){s===i&&(s=y({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function Ng(e){Ir(e)}function Mg(e){console.error(e)}function _g(e){Ir(e)}function yl(e,i){try{var s=e.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Cg(e,i,s){try{var r=e.onCaughtError;r(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function yf(e,i,s){return s=xi(s),s.tag=3,s.payload={element:null},s.callback=function(){yl(e,i)},s}function Dg(e){return e=xi(e),e.tag=3,e}function Rg(e,i,s,r){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;e.payload=function(){return f(m)},e.callback=function(){Cg(i,s,r)}}var b=s.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Cg(i,s,r),typeof f!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var C=r.stack;this.componentDidCatch(r.value,{componentStack:C!==null?C:""})})}function I2(e,i,s,r,f){if(s.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=s.alternate,i!==null&&Qa(i,s,f,!0),s=qe.current,s!==null){switch(s.tag){case 31:case 13:return tn===null?Cl():s.alternate===null&&Jt===0&&(Jt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,r===al?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([r]):i.add(r),qf(e,r,f)),!1;case 22:return s.flags|=65536,r===al?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([r]):s.add(r)),qf(e,r,f)),!1}throw Error(o(435,s.tag))}return qf(e,r,f),Cl(),!1}if(Dt)return i=qe.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==Vc&&(e=Error(o(422),{cause:r}),io(Qe(e,s)))):(r!==Vc&&(i=Error(o(423),{cause:r}),io(Qe(i,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,r=Qe(r,s),f=yf(e.stateNode,r,f),Zc(e,f),Jt!==4&&(Jt=2)),!1;var m=Error(o(520),{cause:r});if(m=Qe(m,s),Eo===null?Eo=[m]:Eo.push(m),Jt!==4&&(Jt=2),i===null)return!0;r=Qe(r,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=yf(s.stateNode,r,e),Zc(s,e),!1;case 1:if(i=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ni===null||!Ni.has(m))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Dg(f),Rg(f,e,s,r),Zc(s,f),!1}s=s.return}while(s!==null);return!1}var vf=Error(o(461)),se=!1;function ye(e,i,s,r){i.child=e===null?Vp(i,null,s,r):fa(i,e.child,s,r)}function jg(e,i,s,r,f){s=s.render;var m=i.ref;if("ref"in r){var b={};for(var C in r)C!=="ref"&&(b[C]=r[C])}else b=r;return ra(i),r=Jc(e,i,s,b,m,f),C=Wc(),e!==null&&!se?(tf(e,i,f),Zn(e,i,f)):(Dt&&C&&zc(i),i.flags|=1,ye(e,i,r,f),i.child)}function zg(e,i,s,r,f){if(e===null){var m=s.type;return typeof m=="function"&&!Dc(m)&&m.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=m,Og(e,i,m,r,f)):(e=Jr(s.type,null,r,i,i.mode,f),e.ref=i.ref,e.return=i,i.child=e)}if(m=e.child,!Nf(e,f)){var b=m.memoizedProps;if(s=s.compare,s=s!==null?s:to,s(b,r)&&e.ref===i.ref)return Zn(e,i,f)}return i.flags|=1,e=Un(m,r),e.ref=i.ref,e.return=i,i.child=e}function Og(e,i,s,r,f){if(e!==null){var m=e.memoizedProps;if(to(m,r)&&e.ref===i.ref)if(se=!1,i.pendingProps=r=m,Nf(e,f))(e.flags&131072)!==0&&(se=!0);else return i.lanes=e.lanes,Zn(e,i,f)}return xf(e,i,s,r,f)}function Vg(e,i,s,r){var f=r.children,m=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,e!==null){for(r=i.child=e.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~m}else r=0,i.child=null;return Lg(e,i,m,s,r)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&nl(i,m!==null?m.cachePool:null),m!==null?Bp(i,m):Ic(),kp(i);else return r=i.lanes=536870912,Lg(e,i,m!==null?m.baseLanes|s:s,s,r)}else m!==null?(nl(i,m.cachePool),Bp(i,m),wi(),i.memoizedState=null):(e!==null&&nl(i,null),Ic(),wi());return ye(e,i,f,s),i.child}function go(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Lg(e,i,s,r,f){var m=qc();return m=m===null?null:{parent:ie._currentValue,pool:m},i.memoizedState={baseLanes:s,cachePool:m},e!==null&&nl(i,null),Ic(),kp(i),e!==null&&Qa(e,i,r,!0),i.childLanes=f,null}function vl(e,i){return i=bl({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function Hg(e,i,s){return fa(i,e.child,null,s),e=vl(i,i.pendingProps),e.flags|=2,Xe(i),i.memoizedState=null,e}function K2(e,i,s){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Dt){if(r.mode==="hidden")return e=vl(i,r),i.lanes=536870912,go(null,e);if(Qc(i),(e=$t)?(e=K0(e,We),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:mi!==null?{id:wn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},s=bp(e),s.return=i,i.child=s,pe=i,$t=null)):e=null,e===null)throw gi(i);return i.lanes=536870912,null}return vl(i,r)}var m=e.memoizedState;if(m!==null){var b=m.dehydrated;if(Qc(i),f)if(i.flags&256)i.flags&=-257,i=Hg(e,i,s);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(o(558));else if(se||Qa(e,i,s,!1),f=(s&e.childLanes)!==0,se||f){if(r=qt,r!==null&&(b=Dr(r,s),b!==0&&b!==m.retryLane))throw m.retryLane=b,ia(e,b),He(r,e,b),vf;Cl(),i=Hg(e,i,s)}else e=m.treeContext,$t=en(b.nextSibling),pe=i,Dt=!0,pi=null,We=!1,e!==null&&Ep(i,e),i=vl(i,r),i.flags|=4096;return i}return e=Un(e.child,{mode:r.mode,children:r.children}),e.ref=i.ref,i.child=e,e.return=i,e}function xl(e,i){var s=i.ref;if(s===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(i.flags|=4194816)}}function xf(e,i,s,r,f){return ra(i),s=Jc(e,i,s,r,void 0,f),r=Wc(),e!==null&&!se?(tf(e,i,f),Zn(e,i,f)):(Dt&&r&&zc(i),i.flags|=1,ye(e,i,s,f),i.child)}function Bg(e,i,s,r,f,m){return ra(i),i.updateQueue=null,s=Yp(i,r,s,f),Up(e),r=Wc(),e!==null&&!se?(tf(e,i,m),Zn(e,i,m)):(Dt&&r&&zc(i),i.flags|=1,ye(e,i,s,m),i.child)}function kg(e,i,s,r,f){if(ra(i),i.stateNode===null){var m=Za,b=s.contextType;typeof b=="object"&&b!==null&&(m=ge(b)),m=new s(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=gf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},Gc(i),b=s.contextType,m.context=typeof b=="object"&&b!==null?ge(b):Za,m.state=i.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(pf(i,s,b,r),m.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&gf.enqueueReplaceState(m,m.state,null),co(i,r,m,f),uo(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(e===null){m=i.stateNode;var C=i.memoizedProps,B=ha(s,C);m.props=B;var K=m.context,nt=s.contextType;b=Za,typeof nt=="object"&&nt!==null&&(b=ge(nt));var ot=s.getDerivedStateFromProps;nt=typeof ot=="function"||typeof m.getSnapshotBeforeUpdate=="function",C=i.pendingProps!==C,nt||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C||K!==b)&&Ag(i,m,r,b),vi=!1;var Q=i.memoizedState;m.state=Q,co(i,r,m,f),uo(),K=i.memoizedState,C||Q!==K||vi?(typeof ot=="function"&&(pf(i,s,ot,r),K=i.memoizedState),(B=vi||Tg(i,s,B,r,Q,K,b))?(nt||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(i.flags|=4194308)):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=K),m.props=r,m.state=K,m.context=b,r=B):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,$c(e,i),b=i.memoizedProps,nt=ha(s,b),m.props=nt,ot=i.pendingProps,Q=m.context,K=s.contextType,B=Za,typeof K=="object"&&K!==null&&(B=ge(K)),C=s.getDerivedStateFromProps,(K=typeof C=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==ot||Q!==B)&&Ag(i,m,r,B),vi=!1,Q=i.memoizedState,m.state=Q,co(i,r,m,f),uo();var J=i.memoizedState;b!==ot||Q!==J||vi||e!==null&&e.dependencies!==null&&tl(e.dependencies)?(typeof C=="function"&&(pf(i,s,C,r),J=i.memoizedState),(nt=vi||Tg(i,s,nt,r,Q,J,B)||e!==null&&e.dependencies!==null&&tl(e.dependencies))?(K||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,J,B),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,J,B)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=J),m.props=r,m.state=J,m.context=B,r=nt):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(i.flags|=1024),r=!1)}return m=r,xl(e,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,s=r&&typeof s.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,e!==null&&r?(i.child=fa(i,e.child,null,f),i.child=fa(i,null,s,f)):ye(e,i,s,f),i.memoizedState=m.state,e=i.child):e=Zn(e,i,f),e}function Ug(e,i,s,r){return sa(),i.flags|=256,ye(e,i,s,r),i.child}var bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sf(e){return{baseLanes:e,cachePool:Cp()}}function wf(e,i,s){return e=e!==null?e.childLanes&~s:0,i&&(e|=$e),e}function Yg(e,i,s){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,b;if((b=m)||(b=e!==null&&e.memoizedState===null?!1:(te.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,e===null){if(Dt){if(f?Si(i):wi(),(e=$t)?(e=K0(e,We),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:mi!==null?{id:wn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},s=bp(e),s.return=i,i.child=s,pe=i,$t=null)):e=null,e===null)throw gi(i);return ad(e)?i.lanes=32:i.lanes=536870912,null}var C=r.children;return r=r.fallback,f?(wi(),f=i.mode,C=bl({mode:"hidden",children:C},f),r=aa(r,f,s,null),C.return=i,r.return=i,C.sibling=r,i.child=C,r=i.child,r.memoizedState=Sf(s),r.childLanes=wf(e,b,s),i.memoizedState=bf,go(null,r)):(Si(i),Ef(i,C))}var B=e.memoizedState;if(B!==null&&(C=B.dehydrated,C!==null)){if(m)i.flags&256?(Si(i),i.flags&=-257,i=Tf(e,i,s)):i.memoizedState!==null?(wi(),i.child=e.child,i.flags|=128,i=null):(wi(),C=r.fallback,f=i.mode,r=bl({mode:"visible",children:r.children},f),C=aa(C,f,s,null),C.flags|=2,r.return=i,C.return=i,r.sibling=C,i.child=r,fa(i,e.child,null,s),r=i.child,r.memoizedState=Sf(s),r.childLanes=wf(e,b,s),i.memoizedState=bf,i=go(null,r));else if(Si(i),ad(C)){if(b=C.nextSibling&&C.nextSibling.dataset,b)var K=b.dgst;b=K,r=Error(o(419)),r.stack="",r.digest=b,io({value:r,source:null,stack:null}),i=Tf(e,i,s)}else if(se||Qa(e,i,s,!1),b=(s&e.childLanes)!==0,se||b){if(b=qt,b!==null&&(r=Dr(b,s),r!==0&&r!==B.retryLane))throw B.retryLane=r,ia(e,r),He(b,e,r),vf;id(C)||Cl(),i=Tf(e,i,s)}else id(C)?(i.flags|=192,i.child=e.child,i=null):(e=B.treeContext,$t=en(C.nextSibling),pe=i,Dt=!0,pi=null,We=!1,e!==null&&Ep(i,e),i=Ef(i,r.children),i.flags|=4096);return i}return f?(wi(),C=r.fallback,f=i.mode,B=e.child,K=B.sibling,r=Un(B,{mode:"hidden",children:r.children}),r.subtreeFlags=B.subtreeFlags&65011712,K!==null?C=Un(K,C):(C=aa(C,f,s,null),C.flags|=2),C.return=i,r.return=i,r.sibling=C,i.child=r,go(null,r),r=i.child,C=e.child.memoizedState,C===null?C=Sf(s):(f=C.cachePool,f!==null?(B=ie._currentValue,f=f.parent!==B?{parent:B,pool:B}:f):f=Cp(),C={baseLanes:C.baseLanes|s,cachePool:f}),r.memoizedState=C,r.childLanes=wf(e,b,s),i.memoizedState=bf,go(e.child,r)):(Si(i),s=e.child,e=s.sibling,s=Un(s,{mode:"visible",children:r.children}),s.return=i,s.sibling=null,e!==null&&(b=i.deletions,b===null?(i.deletions=[e],i.flags|=16):b.push(e)),i.child=s,i.memoizedState=null,s)}function Ef(e,i){return i=bl({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function bl(e,i){return e=Ye(22,e,null,i),e.lanes=0,e}function Tf(e,i,s){return fa(i,e.child,null,s),e=Ef(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function qg(e,i,s){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i),Bc(e.return,i,s)}function Af(e,i,s,r,f,m){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:s,tailMode:f,treeForkCount:m}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=s,b.tailMode=f,b.treeForkCount=m)}function Xg(e,i,s){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var b=te.current,C=(b&2)!==0;if(C?(b=b&1|2,i.flags|=128):b&=1,W(te,b),ye(e,i,r,s),r=Dt?no:0,!C&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qg(e,s,i);else if(e.tag===19)qg(e,s,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break t;for(;e.sibling===null;){if(e.return===null||e.return===i)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=i.child,f=null;s!==null;)e=s.alternate,e!==null&&ll(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=i.child,i.child=null):(f=s.sibling,s.sibling=null),Af(i,!1,f,s,m,r);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=i.child,i.child=null;f!==null;){if(e=f.alternate,e!==null&&ll(e)===null){i.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}Af(i,!0,s,null,m,r);break;case"together":Af(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Zn(e,i,s){if(e!==null&&(i.dependencies=e.dependencies),Ai|=i.lanes,(s&i.childLanes)===0)if(e!==null){if(Qa(e,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(o(153));if(i.child!==null){for(e=i.child,s=Un(e,e.pendingProps),i.child=s,s.return=i;e.sibling!==null;)e=e.sibling,s=s.sibling=Un(e,e.pendingProps),s.return=i;s.sibling=null}return i.child}function Nf(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&tl(e)))}function Q2(e,i,s){switch(i.tag){case 3:lt(i,i.stateNode.containerInfo),yi(i,ie,e.memoizedState.cache),sa();break;case 27:case 5:Et(i);break;case 4:lt(i,i.stateNode.containerInfo);break;case 10:yi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Qc(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(Si(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Yg(e,i,s):(Si(i),e=Zn(e,i,s),e!==null?e.sibling:null);Si(i);break;case 19:var f=(e.flags&128)!==0;if(r=(s&i.childLanes)!==0,r||(Qa(e,i,s,!1),r=(s&i.childLanes)!==0),f){if(r)return Xg(e,i,s);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),W(te,te.current),r)break;return null;case 22:return i.lanes=0,Vg(e,i,s,i.pendingProps);case 24:yi(i,ie,e.memoizedState.cache)}return Zn(e,i,s)}function Gg(e,i,s){if(e!==null)if(e.memoizedProps!==i.pendingProps)se=!0;else{if(!Nf(e,s)&&(i.flags&128)===0)return se=!1,Q2(e,i,s);se=(e.flags&131072)!==0}else se=!1,Dt&&(i.flags&1048576)!==0&&wp(i,no,i.index);switch(i.lanes=0,i.tag){case 16:t:{var r=i.pendingProps;if(e=ua(i.elementType),i.type=e,typeof e=="function")Dc(e)?(r=ha(e,r),i.tag=1,i=kg(null,i,e,r,s)):(i.tag=0,i=xf(null,i,e,r,s));else{if(e!=null){var f=e.$$typeof;if(f===M){i.tag=11,i=jg(null,i,e,r,s);break t}else if(f===O){i.tag=14,i=zg(null,i,e,r,s);break t}}throw i=L(e)||e,Error(o(306,i,""))}}return i;case 0:return xf(e,i,i.type,i.pendingProps,s);case 1:return r=i.type,f=ha(r,i.pendingProps),kg(e,i,r,f,s);case 3:t:{if(lt(i,i.stateNode.containerInfo),e===null)throw Error(o(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,$c(e,i),co(i,r,null,s);var b=i.memoizedState;if(r=b.cache,yi(i,ie,r),r!==m.cache&&kc(i,[ie],s,!0),uo(),r=b.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=Ug(e,i,r,s);break t}else if(r!==f){f=Qe(Error(o(424)),i),io(f),i=Ug(e,i,r,s);break t}else for(e=i.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,$t=en(e.firstChild),pe=i,Dt=!0,pi=null,We=!0,s=Vp(i,null,r,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(sa(),r===f){i=Zn(e,i,s);break t}ye(e,i,r,s)}i=i.child}return i;case 26:return xl(e,i),e===null?(s=ey(i.type,null,i.pendingProps,null))?i.memoizedState=s:Dt||(s=i.type,e=i.pendingProps,r=Ll(ut.current).createElement(s),r[ue]=i,r[be]=e,ve(r,s,e),ne(r),i.stateNode=r):i.memoizedState=ey(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return Et(i),e===null&&Dt&&(r=i.stateNode=J0(i.type,i.pendingProps,ut.current),pe=i,We=!0,f=$t,Di(i.type)?(sd=f,$t=en(r.firstChild)):$t=f),ye(e,i,i.pendingProps.children,s),xl(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Dt&&((f=r=$t)&&(r=NE(r,i.type,i.pendingProps,We),r!==null?(i.stateNode=r,pe=i,$t=en(r.firstChild),We=!1,f=!0):f=!1),f||gi(i)),Et(i),f=i.type,m=i.pendingProps,b=e!==null?e.memoizedProps:null,r=m.children,td(f,m)?r=null:b!==null&&td(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=Jc(e,i,Y2,null,null,s),Ro._currentValue=f),xl(e,i),ye(e,i,r,s),i.child;case 6:return e===null&&Dt&&((e=s=$t)&&(s=ME(s,i.pendingProps,We),s!==null?(i.stateNode=s,pe=i,$t=null,e=!0):e=!1),e||gi(i)),null;case 13:return Yg(e,i,s);case 4:return lt(i,i.stateNode.containerInfo),r=i.pendingProps,e===null?i.child=fa(i,null,r,s):ye(e,i,r,s),i.child;case 11:return jg(e,i,i.type,i.pendingProps,s);case 7:return ye(e,i,i.pendingProps,s),i.child;case 8:return ye(e,i,i.pendingProps.children,s),i.child;case 12:return ye(e,i,i.pendingProps.children,s),i.child;case 10:return r=i.pendingProps,yi(i,i.type,r.value),ye(e,i,r.children,s),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,ra(i),f=ge(f),r=r(f),i.flags|=1,ye(e,i,r,s),i.child;case 14:return zg(e,i,i.type,i.pendingProps,s);case 15:return Og(e,i,i.type,i.pendingProps,s);case 19:return Xg(e,i,s);case 31:return K2(e,i,s);case 22:return Vg(e,i,s,i.pendingProps);case 24:return ra(i),r=ge(ie),e===null?(f=qc(),f===null&&(f=qt,m=Uc(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=s),f=m),i.memoizedState={parent:r,cache:f},Gc(i),yi(i,ie,f)):((e.lanes&s)!==0&&($c(e,i),co(i,null,null,s),uo()),f=e.memoizedState,m=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),yi(i,ie,r)):(r=m.cache,yi(i,ie,r),r!==f.cache&&kc(i,[ie],s,!0))),ye(e,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(o(156,i.tag))}function Pn(e){e.flags|=4}function Mf(e,i,s,r,f){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(y0())e.flags|=8192;else throw ca=al,Xc}else e.flags&=-16777217}function $g(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!oy(i))if(y0())e.flags|=8192;else throw ca=al,Xc}function Sl(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Mr():536870912,e.lanes|=i,ls|=i)}function yo(e,i){if(!Dt)switch(e.tailMode){case"hidden":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Zt(e){var i=e.alternate!==null&&e.alternate.child===e.child,s=0,r=0;if(i)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=r,e.childLanes=s,i}function F2(e,i,s){var r=i.pendingProps;switch(Oc(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(i),null;case 1:return Zt(i),null;case 3:return s=i.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Xn(ie),ft(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ka(i)?Pn(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Lc())),Zt(i),null;case 26:var f=i.type,m=i.memoizedState;return e===null?(Pn(i),m!==null?(Zt(i),$g(i,m)):(Zt(i),Mf(i,f,null,r,s))):m?m!==e.memoizedState?(Pn(i),Zt(i),$g(i,m)):(Zt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==r&&Pn(i),Zt(i),Mf(i,f,e,r,s)),null;case 27:if(St(i),s=ut.current,f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Pn(i);else{if(!r){if(i.stateNode===null)throw Error(o(166));return Zt(i),null}e=et.current,Ka(i)?Tp(i):(e=J0(f,r,s),i.stateNode=e,Pn(i))}return Zt(i),null;case 5:if(St(i),f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Pn(i);else{if(!r){if(i.stateNode===null)throw Error(o(166));return Zt(i),null}if(m=et.current,Ka(i))Tp(i);else{var b=Ll(ut.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?b.createElement(f,{is:r.is}):b.createElement(f)}}m[ue]=i,m[be]=r;t:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break t;for(;b.sibling===null;){if(b.return===null||b.return===i)break t;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=m;t:switch(ve(m,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}r&&Pn(i)}}return Zt(i),Mf(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,s),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==r&&Pn(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(o(166));if(e=ut.current,Ka(i)){if(e=i.stateNode,s=i.memoizedProps,r=null,f=pe,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}e[ue]=i,e=!!(e.nodeValue===s||r!==null&&r.suppressHydrationWarning===!0||Y0(e.nodeValue,s)),e||gi(i,!0)}else e=Ll(e).createTextNode(r),e[ue]=i,i.stateNode=e}return Zt(i),null;case 31:if(s=i.memoizedState,e===null||e.memoizedState!==null){if(r=Ka(i),s!==null){if(e===null){if(!r)throw Error(o(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ue]=i}else sa(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),e=!1}else s=Lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return i.flags&256?(Xe(i),i):(Xe(i),null);if((i.flags&128)!==0)throw Error(o(558))}return Zt(i),null;case 13:if(r=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Ka(i),r!==null&&r.dehydrated!==null){if(e===null){if(!f)throw Error(o(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[ue]=i}else sa(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),f=!1}else f=Lc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Xe(i),i):(Xe(i),null)}return Xe(i),(i.flags&128)!==0?(i.lanes=s,i):(s=r!==null,e=e!==null&&e.memoizedState!==null,s&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048)),s!==e&&s&&(i.child.flags|=8192),Sl(i,i.updateQueue),Zt(i),null);case 4:return ft(),e===null&&Kf(i.stateNode.containerInfo),Zt(i),null;case 10:return Xn(i.type),Zt(i),null;case 19:if(Y(te),r=i.memoizedState,r===null)return Zt(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)yo(r,!1);else{if(Jt!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(m=ll(e),m!==null){for(i.flags|=128,yo(r,!1),e=m.updateQueue,i.updateQueue=e,Sl(i,e),i.subtreeFlags=0,e=s,s=i.child;s!==null;)xp(s,e),s=s.sibling;return W(te,te.current&1|2),Dt&&Yn(i,r.treeForkCount),i.child}e=e.sibling}r.tail!==null&&me()>Nl&&(i.flags|=128,f=!0,yo(r,!1),i.lanes=4194304)}else{if(!f)if(e=ll(m),e!==null){if(i.flags|=128,f=!0,e=e.updateQueue,i.updateQueue=e,Sl(i,e),yo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!Dt)return Zt(i),null}else 2*me()-r.renderingStartTime>Nl&&s!==536870912&&(i.flags|=128,f=!0,yo(r,!1),i.lanes=4194304);r.isBackwards?(m.sibling=i.child,i.child=m):(e=r.last,e!==null?e.sibling=m:i.child=m,r.last=m)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=me(),e.sibling=null,s=te.current,W(te,f?s&1|2:s&1),Dt&&Yn(i,r.treeForkCount),e):(Zt(i),null);case 22:case 23:return Xe(i),Kc(),r=i.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(s&536870912)!==0&&(i.flags&128)===0&&(Zt(i),i.subtreeFlags&6&&(i.flags|=8192)):Zt(i),s=i.updateQueue,s!==null&&Sl(i,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(i.flags|=2048),e!==null&&Y(la),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Xn(ie),Zt(i),null;case 25:return null;case 30:return null}throw Error(o(156,i.tag))}function J2(e,i){switch(Oc(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Xn(ie),ft(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return St(i),null;case 31:if(i.memoizedState!==null){if(Xe(i),i.alternate===null)throw Error(o(340));sa()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Xe(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(o(340));sa()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return Y(te),null;case 4:return ft(),null;case 10:return Xn(i.type),null;case 22:case 23:return Xe(i),Kc(),e!==null&&Y(la),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Xn(ie),null;case 25:return null;default:return null}}function Zg(e,i){switch(Oc(i),i.tag){case 3:Xn(ie),ft();break;case 26:case 27:case 5:St(i);break;case 4:ft();break;case 31:i.memoizedState!==null&&Xe(i);break;case 13:Xe(i);break;case 19:Y(te);break;case 10:Xn(i.type);break;case 22:case 23:Xe(i),Kc(),e!==null&&Y(la);break;case 24:Xn(ie)}}function vo(e,i){try{var s=i.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var f=r.next;s=f;do{if((s.tag&e)===e){r=void 0;var m=s.create,b=s.inst;r=m(),b.destroy=r}s=s.next}while(s!==f)}}catch(C){Ht(i,i.return,C)}}function Ei(e,i,s){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&e)===e){var b=r.inst,C=b.destroy;if(C!==void 0){b.destroy=void 0,f=i;var B=s,K=C;try{K()}catch(nt){Ht(f,B,nt)}}}r=r.next}while(r!==m)}}catch(nt){Ht(i,i.return,nt)}}function Pg(e){var i=e.updateQueue;if(i!==null){var s=e.stateNode;try{Hp(i,s)}catch(r){Ht(e,e.return,r)}}}function Ig(e,i,s){s.props=ha(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(r){Ht(e,i,r)}}function xo(e,i){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof s=="function"?e.refCleanup=s(r):s.current=r}}catch(f){Ht(e,i,f)}}function Tn(e,i){var s=e.ref,r=e.refCleanup;if(s!==null)if(typeof r=="function")try{r()}catch(f){Ht(e,i,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Ht(e,i,f)}else s.current=null}function Kg(e){var i=e.type,s=e.memoizedProps,r=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&r.focus();break t;case"img":s.src?r.src=s.src:s.srcSet&&(r.srcset=s.srcSet)}}catch(f){Ht(e,e.return,f)}}function _f(e,i,s){try{var r=e.stateNode;bE(r,e.type,s,i),r[be]=i}catch(f){Ht(e,e.return,f)}}function Qg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Di(e.type)||e.tag===4}function Cf(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Qg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Di(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Df(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(e),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Bn));else if(r!==4&&(r===27&&Di(e.type)&&(s=e.stateNode,i=null),e=e.child,e!==null))for(Df(e,i,s),e=e.sibling;e!==null;)Df(e,i,s),e=e.sibling}function wl(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?s.insertBefore(e,i):s.appendChild(e);else if(r!==4&&(r===27&&Di(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(wl(e,i,s),e=e.sibling;e!==null;)wl(e,i,s),e=e.sibling}function Fg(e){var i=e.stateNode,s=e.memoizedProps;try{for(var r=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);ve(i,r,s),i[ue]=e,i[be]=s}catch(m){Ht(e,e.return,m)}}var In=!1,oe=!1,Rf=!1,Jg=typeof WeakSet=="function"?WeakSet:Set,he=null;function W2(e,i){if(e=e.containerInfo,Jf=Xl,e=cp(e),Ec(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else t:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break t}var b=0,C=-1,B=-1,K=0,nt=0,ot=e,Q=null;e:for(;;){for(var J;ot!==s||f!==0&&ot.nodeType!==3||(C=b+f),ot!==m||r!==0&&ot.nodeType!==3||(B=b+r),ot.nodeType===3&&(b+=ot.nodeValue.length),(J=ot.firstChild)!==null;)Q=ot,ot=J;for(;;){if(ot===e)break e;if(Q===s&&++K===f&&(C=b),Q===m&&++nt===r&&(B=b),(J=ot.nextSibling)!==null)break;ot=Q,Q=ot.parentNode}ot=J}s=C===-1||B===-1?null:{start:C,end:B}}else s=null}s=s||{start:0,end:0}}else s=null;for(Wf={focusedElem:e,selectionRange:s},Xl=!1,he=i;he!==null;)if(i=he,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,he=e;else for(;he!==null;){switch(i=he,m=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,s=i,f=m.memoizedProps,m=m.memoizedState,r=s.stateNode;try{var dt=ha(s.type,f);e=r.getSnapshotBeforeUpdate(dt,m),r.__reactInternalSnapshotBeforeUpdate=e}catch(vt){Ht(s,s.return,vt)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,s=e.nodeType,s===9)nd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=i.sibling,e!==null){e.return=i.return,he=e;break}he=i.return}}function Wg(e,i,s){var r=s.flags;switch(s.tag){case 0:case 11:case 15:Qn(e,s),r&4&&vo(5,s);break;case 1:if(Qn(e,s),r&4)if(e=s.stateNode,i===null)try{e.componentDidMount()}catch(b){Ht(s,s.return,b)}else{var f=ha(s.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(f,i,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ht(s,s.return,b)}}r&64&&Pg(s),r&512&&xo(s,s.return);break;case 3:if(Qn(e,s),r&64&&(e=s.updateQueue,e!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Hp(e,i)}catch(b){Ht(s,s.return,b)}}break;case 27:i===null&&r&4&&Fg(s);case 26:case 5:Qn(e,s),i===null&&r&4&&Kg(s),r&512&&xo(s,s.return);break;case 12:Qn(e,s);break;case 31:Qn(e,s),r&4&&n0(e,s);break;case 13:Qn(e,s),r&4&&i0(e,s),r&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=lE.bind(null,s),_E(e,s))));break;case 22:if(r=s.memoizedState!==null||In,!r){i=i!==null&&i.memoizedState!==null||oe,f=In;var m=oe;In=r,(oe=i)&&!m?Fn(e,s,(s.subtreeFlags&8772)!==0):Qn(e,s),In=f,oe=m}break;case 30:break;default:Qn(e,s)}}function t0(e){var i=e.alternate;i!==null&&(e.alternate=null,t0(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&Gs(i)),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 Pt=null,ze=!1;function Kn(e,i,s){for(s=s.child;s!==null;)e0(e,i,s),s=s.sibling}function e0(e,i,s){if(Ee&&typeof Ee.onCommitFiberUnmount=="function")try{Ee.onCommitFiberUnmount(Ii,s)}catch{}switch(s.tag){case 26:oe||Tn(s,i),Kn(e,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:oe||Tn(s,i);var r=Pt,f=ze;Di(s.type)&&(Pt=s.stateNode,ze=!1),Kn(e,i,s),_o(s.stateNode),Pt=r,ze=f;break;case 5:oe||Tn(s,i);case 6:if(r=Pt,f=ze,Pt=null,Kn(e,i,s),Pt=r,ze=f,Pt!==null)if(ze)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(s.stateNode)}catch(m){Ht(s,i,m)}else try{Pt.removeChild(s.stateNode)}catch(m){Ht(s,i,m)}break;case 18:Pt!==null&&(ze?(e=Pt,P0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),gs(e)):P0(Pt,s.stateNode));break;case 4:r=Pt,f=ze,Pt=s.stateNode.containerInfo,ze=!0,Kn(e,i,s),Pt=r,ze=f;break;case 0:case 11:case 14:case 15:Ei(2,s,i),oe||Ei(4,s,i),Kn(e,i,s);break;case 1:oe||(Tn(s,i),r=s.stateNode,typeof r.componentWillUnmount=="function"&&Ig(s,i,r)),Kn(e,i,s);break;case 21:Kn(e,i,s);break;case 22:oe=(r=oe)||s.memoizedState!==null,Kn(e,i,s),oe=r;break;default:Kn(e,i,s)}}function n0(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gs(e)}catch(s){Ht(i,i.return,s)}}}function i0(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gs(e)}catch(s){Ht(i,i.return,s)}}function tE(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Jg),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Jg),i;default:throw Error(o(435,e.tag))}}function El(e,i){var s=tE(e);i.forEach(function(r){if(!s.has(r)){s.add(r);var f=uE.bind(null,e,r);r.then(f,f)}})}function Oe(e,i){var s=i.deletions;if(s!==null)for(var r=0;r<s.length;r++){var f=s[r],m=e,b=i,C=b;t:for(;C!==null;){switch(C.tag){case 27:if(Di(C.type)){Pt=C.stateNode,ze=!1;break t}break;case 5:Pt=C.stateNode,ze=!1;break t;case 3:case 4:Pt=C.stateNode.containerInfo,ze=!0;break t}C=C.return}if(Pt===null)throw Error(o(160));e0(m,b,f),Pt=null,ze=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)a0(i,e),i=i.sibling}var fn=null;function a0(e,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Oe(i,e),Ve(e),r&4&&(Ei(3,e,e.return),vo(3,e),Ei(5,e,e.return));break;case 1:Oe(i,e),Ve(e),r&512&&(oe||s===null||Tn(s,s.return)),r&64&&In&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?r:s.concat(r))));break;case 26:var f=fn;if(Oe(i,e),Ve(e),r&512&&(oe||s===null||Tn(s,s.return)),r&4){var m=s!==null?s.memoizedState:null;if(r=e.memoizedState,s===null)if(r===null)if(e.stateNode===null){t:{r=e.type,s=e.memoizedProps,f=f.ownerDocument||f;e:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Fi]||m[ue]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),ve(m,r,s),m[ue]=e,ne(m),r=m;break t;case"link":var b=ay("link","href",f).get(r+(s.href||""));if(b){for(var C=0;C<b.length;C++)if(m=b[C],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){b.splice(C,1);break e}}m=f.createElement(r),ve(m,r,s),f.head.appendChild(m);break;case"meta":if(b=ay("meta","content",f).get(r+(s.content||""))){for(C=0;C<b.length;C++)if(m=b[C],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){b.splice(C,1);break e}}m=f.createElement(r),ve(m,r,s),f.head.appendChild(m);break;default:throw Error(o(468,r))}m[ue]=e,ne(m),r=m}e.stateNode=r}else sy(f,e.type,e.stateNode);else e.stateNode=iy(f,r,e.memoizedProps);else m!==r?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,r===null?sy(f,e.type,e.stateNode):iy(f,r,e.memoizedProps)):r===null&&e.stateNode!==null&&_f(e,e.memoizedProps,s.memoizedProps)}break;case 27:Oe(i,e),Ve(e),r&512&&(oe||s===null||Tn(s,s.return)),s!==null&&r&4&&_f(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Oe(i,e),Ve(e),r&512&&(oe||s===null||Tn(s,s.return)),e.flags&32){f=e.stateNode;try{ka(f,"")}catch(dt){Ht(e,e.return,dt)}}r&4&&e.stateNode!=null&&(f=e.memoizedProps,_f(e,f,s!==null?s.memoizedProps:f)),r&1024&&(Rf=!0);break;case 6:if(Oe(i,e),Ve(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,s=e.stateNode;try{s.nodeValue=r}catch(dt){Ht(e,e.return,dt)}}break;case 3:if(kl=null,f=fn,fn=Hl(i.containerInfo),Oe(i,e),fn=f,Ve(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{gs(i.containerInfo)}catch(dt){Ht(e,e.return,dt)}Rf&&(Rf=!1,s0(e));break;case 4:r=fn,fn=Hl(e.stateNode.containerInfo),Oe(i,e),Ve(e),fn=r;break;case 12:Oe(i,e),Ve(e);break;case 31:Oe(i,e),Ve(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 13:Oe(i,e),Ve(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Al=me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 22:f=e.memoizedState!==null;var B=s!==null&&s.memoizedState!==null,K=In,nt=oe;if(In=K||f,oe=nt||B,Oe(i,e),oe=nt,In=K,Ve(e),r&8192)t:for(i=e.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(s===null||B||In||oe||ma(e)),s=null,i=e;;){if(i.tag===5||i.tag===26){if(s===null){B=s=i;try{if(m=B.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{C=B.stateNode;var ot=B.memoizedProps.style,Q=ot!=null&&ot.hasOwnProperty("display")?ot.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(dt){Ht(B,B.return,dt)}}}else if(i.tag===6){if(s===null){B=i;try{B.stateNode.nodeValue=f?"":B.memoizedProps}catch(dt){Ht(B,B.return,dt)}}}else if(i.tag===18){if(s===null){B=i;try{var J=B.stateNode;f?I0(J,!0):I0(B.stateNode,!1)}catch(dt){Ht(B,B.return,dt)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=e.updateQueue,r!==null&&(s=r.retryQueue,s!==null&&(r.retryQueue=null,El(e,s))));break;case 19:Oe(i,e),Ve(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,El(e,r)));break;case 30:break;case 21:break;default:Oe(i,e),Ve(e)}}function Ve(e){var i=e.flags;if(i&2){try{for(var s,r=e.return;r!==null;){if(Qg(r)){s=r;break}r=r.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var f=s.stateNode,m=Cf(e);wl(e,m,f);break;case 5:var b=s.stateNode;s.flags&32&&(ka(b,""),s.flags&=-33);var C=Cf(e);wl(e,C,b);break;case 3:case 4:var B=s.stateNode.containerInfo,K=Cf(e);Df(e,K,B);break;default:throw Error(o(161))}}catch(nt){Ht(e,e.return,nt)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function s0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;s0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Qn(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Wg(e,i.alternate,i),i=i.sibling}function ma(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:Ei(4,i,i.return),ma(i);break;case 1:Tn(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ig(i,i.return,s),ma(i);break;case 27:_o(i.stateNode);case 26:case 5:Tn(i,i.return),ma(i);break;case 22:i.memoizedState===null&&ma(i);break;case 30:ma(i);break;default:ma(i)}e=e.sibling}}function Fn(e,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=e,m=i,b=m.flags;switch(m.tag){case 0:case 11:case 15:Fn(f,m,s),vo(4,m);break;case 1:if(Fn(f,m,s),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(K){Ht(r,r.return,K)}if(r=m,f=r.updateQueue,f!==null){var C=r.stateNode;try{var B=f.shared.hiddenCallbacks;if(B!==null)for(f.shared.hiddenCallbacks=null,f=0;f<B.length;f++)Lp(B[f],C)}catch(K){Ht(r,r.return,K)}}s&&b&64&&Pg(m),xo(m,m.return);break;case 27:Fg(m);case 26:case 5:Fn(f,m,s),s&&r===null&&b&4&&Kg(m),xo(m,m.return);break;case 12:Fn(f,m,s);break;case 31:Fn(f,m,s),s&&b&4&&n0(f,m);break;case 13:Fn(f,m,s),s&&b&4&&i0(f,m);break;case 22:m.memoizedState===null&&Fn(f,m,s),xo(m,m.return);break;case 30:break;default:Fn(f,m,s)}i=i.sibling}}function jf(e,i){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&ao(s))}function zf(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ao(e))}function dn(e,i,s,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)o0(e,i,s,r),i=i.sibling}function o0(e,i,s,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:dn(e,i,s,r),f&2048&&vo(9,i);break;case 1:dn(e,i,s,r);break;case 3:dn(e,i,s,r),f&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ao(e)));break;case 12:if(f&2048){dn(e,i,s,r),e=i.stateNode;try{var m=i.memoizedProps,b=m.id,C=m.onPostCommit;typeof C=="function"&&C(b,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){Ht(i,i.return,B)}}else dn(e,i,s,r);break;case 31:dn(e,i,s,r);break;case 13:dn(e,i,s,r);break;case 23:break;case 22:m=i.stateNode,b=i.alternate,i.memoizedState!==null?m._visibility&2?dn(e,i,s,r):bo(e,i):m._visibility&2?dn(e,i,s,r):(m._visibility|=2,ss(e,i,s,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&jf(b,i);break;case 24:dn(e,i,s,r),f&2048&&zf(i.alternate,i);break;default:dn(e,i,s,r)}}function ss(e,i,s,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=e,b=i,C=s,B=r,K=b.flags;switch(b.tag){case 0:case 11:case 15:ss(m,b,C,B,f),vo(8,b);break;case 23:break;case 22:var nt=b.stateNode;b.memoizedState!==null?nt._visibility&2?ss(m,b,C,B,f):bo(m,b):(nt._visibility|=2,ss(m,b,C,B,f)),f&&K&2048&&jf(b.alternate,b);break;case 24:ss(m,b,C,B,f),f&&K&2048&&zf(b.alternate,b);break;default:ss(m,b,C,B,f)}i=i.sibling}}function bo(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=e,r=i,f=r.flags;switch(r.tag){case 22:bo(s,r),f&2048&&jf(r.alternate,r);break;case 24:bo(s,r),f&2048&&zf(r.alternate,r);break;default:bo(s,r)}i=i.sibling}}var So=8192;function os(e,i,s){if(e.subtreeFlags&So)for(e=e.child;e!==null;)r0(e,i,s),e=e.sibling}function r0(e,i,s){switch(e.tag){case 26:os(e,i,s),e.flags&So&&e.memoizedState!==null&&UE(s,fn,e.memoizedState,e.memoizedProps);break;case 5:os(e,i,s);break;case 3:case 4:var r=fn;fn=Hl(e.stateNode.containerInfo),os(e,i,s),fn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=So,So=16777216,os(e,i,s),So=r):os(e,i,s));break;default:os(e,i,s)}}function l0(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function wo(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];he=r,c0(r,e)}l0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)u0(e),e=e.sibling}function u0(e){switch(e.tag){case 0:case 11:case 15:wo(e),e.flags&2048&&Ei(9,e,e.return);break;case 3:wo(e);break;case 12:wo(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,Tl(e)):wo(e);break;default:wo(e)}}function Tl(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];he=r,c0(r,e)}l0(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:Ei(8,i,i.return),Tl(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Tl(i));break;default:Tl(i)}e=e.sibling}}function c0(e,i){for(;he!==null;){var s=he;switch(s.tag){case 0:case 11:case 15:Ei(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var r=s.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ao(s.memoizedState.cache)}if(r=s.child,r!==null)r.return=s,he=r;else t:for(s=e;he!==null;){r=he;var f=r.sibling,m=r.return;if(t0(r),r===s){he=null;break t}if(f!==null){f.return=m,he=f;break t}he=m}}}var eE={getCacheForType:function(e){var i=ge(ie),s=i.data.get(e);return s===void 0&&(s=e(),i.data.set(e,s)),s},cacheSignal:function(){return ge(ie).controller.signal}},nE=typeof WeakMap=="function"?WeakMap:Map,Ot=0,qt=null,At=null,_t=0,Lt=0,Ge=null,Ti=!1,rs=!1,Of=!1,Jn=0,Jt=0,Ai=0,pa=0,Vf=0,$e=0,ls=0,Eo=null,Le=null,Lf=!1,Al=0,f0=0,Nl=1/0,Ml=null,Ni=null,ce=0,Mi=null,us=null,Wn=0,Hf=0,Bf=null,d0=null,To=0,kf=null;function Ze(){return(Ot&2)!==0&&_t!==0?_t&-_t:D.T!==null?$f():Rr()}function h0(){if($e===0)if((_t&536870912)===0||Dt){var e=ja;ja<<=1,(ja&3932160)===0&&(ja=262144),$e=e}else $e=536870912;return e=qe.current,e!==null&&(e.flags|=32),$e}function He(e,i,s){(e===qt&&(Lt===2||Lt===9)||e.cancelPendingCommit!==null)&&(cs(e,0),_i(e,_t,$e,!1)),Qi(e,s),((Ot&2)===0||e!==qt)&&(e===qt&&((Ot&2)===0&&(pa|=s),Jt===4&&_i(e,_t,$e,!1)),An(e))}function m0(e,i,s){if((Ot&6)!==0)throw Error(o(327));var r=!s&&(i&127)===0&&(i&e.expiredLanes)===0||Ki(e,i),f=r?sE(e,i):Yf(e,i,!0),m=r;do{if(f===0){rs&&!r&&_i(e,i,0,!1);break}else{if(s=e.current.alternate,m&&!iE(s)){f=Yf(e,i,!1),m=!1;continue}if(f===2){if(m=i,e.errorRecoveryDisabledLanes&m)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;t:{var C=e;f=Eo;var B=C.current.memoizedState.isDehydrated;if(B&&(cs(C,b).flags|=256),b=Yf(C,b,!1),b!==2){if(Of&&!B){C.errorRecoveryDisabledLanes|=m,pa|=m,f=4;break t}m=Le,Le=f,m!==null&&(Le===null?Le=m:Le.push.apply(Le,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){cs(e,0),_i(e,i,0,!0);break}t:{switch(r=e,m=f,m){case 0:case 1:throw Error(o(345));case 4:if((i&4194048)!==i)break;case 6:_i(r,i,$e,!Ti);break t;case 2:Le=null;break;case 3:case 5:break;default:throw Error(o(329))}if((i&62914560)===i&&(f=Al+300-me(),10<f)){if(_i(r,i,$e,!Ti),Oa(r,0,!0)!==0)break t;Wn=i,r.timeoutHandle=$0(p0.bind(null,r,s,Le,Ml,Lf,i,$e,pa,ls,Ti,m,"Throttled",-0,0),f);break t}p0(r,s,Le,Ml,Lf,i,$e,pa,ls,Ti,m,null,-0,0)}}break}while(!0);An(e)}function p0(e,i,s,r,f,m,b,C,B,K,nt,ot,Q,J){if(e.timeoutHandle=-1,ot=i.subtreeFlags,ot&8192||(ot&16785408)===16785408){ot={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bn},r0(i,m,ot);var dt=(m&62914560)===m?Al-me():(m&4194048)===m?f0-me():0;if(dt=YE(ot,dt),dt!==null){Wn=m,e.cancelPendingCommit=dt(E0.bind(null,e,i,m,s,r,f,b,C,B,nt,ot,null,Q,J)),_i(e,m,b,!K);return}}E0(e,i,m,s,r,f,b,C,B)}function iE(e){for(var i=e;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var r=0;r<s.length;r++){var f=s[r],m=f.getSnapshot;f=f.value;try{if(!Ue(m(),f))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function _i(e,i,s,r){i&=~Vf,i&=~pa,e.suspendedLanes|=i,e.pingedLanes&=~i,r&&(e.warmLanes|=i),r=e.expirationTimes;for(var f=i;0<f;){var m=31-Te(f),b=1<<m;r[m]=-1,f&=~b}s!==0&&_r(e,s,i)}function _l(){return(Ot&6)===0?(Ao(0),!1):!0}function Uf(){if(At!==null){if(Lt===0)var e=At.return;else e=At,qn=oa=null,ef(e),ts=null,oo=0,e=At;for(;e!==null;)Zg(e.alternate,e),e=e.return;At=null}}function cs(e,i){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,EE(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Wn=0,Uf(),qt=e,At=s=Un(e.current,null),_t=i,Lt=0,Ge=null,Ti=!1,rs=Ki(e,i),Of=!1,ls=$e=Vf=pa=Ai=Jt=0,Le=Eo=null,Lf=!1,(i&8)!==0&&(i|=i&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=i;0<r;){var f=31-Te(r),m=1<<f;i|=e[f],r&=~m}return Jn=i,Kr(),s}function g0(e,i){wt=null,D.H=po,i===Wa||i===il?(i=jp(),Lt=3):i===Xc?(i=jp(),Lt=4):Lt=i===vf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ge=i,At===null&&(Jt=1,yl(e,Qe(i,e.current)))}function y0(){var e=qe.current;return e===null?!0:(_t&4194048)===_t?tn===null:(_t&62914560)===_t||(_t&536870912)!==0?e===tn:!1}function v0(){var e=D.H;return D.H=po,e===null?po:e}function x0(){var e=D.A;return D.A=eE,e}function Cl(){Jt=4,Ti||(_t&4194048)!==_t&&qe.current!==null||(rs=!0),(Ai&134217727)===0&&(pa&134217727)===0||qt===null||_i(qt,_t,$e,!1)}function Yf(e,i,s){var r=Ot;Ot|=2;var f=v0(),m=x0();(qt!==e||_t!==i)&&(Ml=null,cs(e,i)),i=!1;var b=Jt;t:do try{if(Lt!==0&&At!==null){var C=At,B=Ge;switch(Lt){case 8:Uf(),b=6;break t;case 3:case 2:case 9:case 6:qe.current===null&&(i=!0);var K=Lt;if(Lt=0,Ge=null,fs(e,C,B,K),s&&rs){b=0;break t}break;default:K=Lt,Lt=0,Ge=null,fs(e,C,B,K)}}aE(),b=Jt;break}catch(nt){g0(e,nt)}while(!0);return i&&e.shellSuspendCounter++,qn=oa=null,Ot=r,D.H=f,D.A=m,At===null&&(qt=null,_t=0,Kr()),b}function aE(){for(;At!==null;)b0(At)}function sE(e,i){var s=Ot;Ot|=2;var r=v0(),f=x0();qt!==e||_t!==i?(Ml=null,Nl=me()+500,cs(e,i)):rs=Ki(e,i);t:do try{if(Lt!==0&&At!==null){i=At;var m=Ge;e:switch(Lt){case 1:Lt=0,Ge=null,fs(e,i,m,1);break;case 2:case 9:if(Dp(m)){Lt=0,Ge=null,S0(i);break}i=function(){Lt!==2&&Lt!==9||qt!==e||(Lt=7),An(e)},m.then(i,i);break t;case 3:Lt=7;break t;case 4:Lt=5;break t;case 7:Dp(m)?(Lt=0,Ge=null,S0(i)):(Lt=0,Ge=null,fs(e,i,m,7));break;case 5:var b=null;switch(At.tag){case 26:b=At.memoizedState;case 5:case 27:var C=At;if(b?oy(b):C.stateNode.complete){Lt=0,Ge=null;var B=C.sibling;if(B!==null)At=B;else{var K=C.return;K!==null?(At=K,Dl(K)):At=null}break e}}Lt=0,Ge=null,fs(e,i,m,5);break;case 6:Lt=0,Ge=null,fs(e,i,m,6);break;case 8:Uf(),Jt=6;break t;default:throw Error(o(462))}}oE();break}catch(nt){g0(e,nt)}while(!0);return qn=oa=null,D.H=r,D.A=f,Ot=s,At!==null?0:(qt=null,_t=0,Kr(),Jt)}function oE(){for(;At!==null&&!$i();)b0(At)}function b0(e){var i=Gg(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,i===null?Dl(e):At=i}function S0(e){var i=e,s=i.alternate;switch(i.tag){case 15:case 0:i=Bg(s,i,i.pendingProps,i.type,void 0,_t);break;case 11:i=Bg(s,i,i.pendingProps,i.type.render,i.ref,_t);break;case 5:ef(i);default:Zg(s,i),i=At=xp(i,Jn),i=Gg(s,i,Jn)}e.memoizedProps=e.pendingProps,i===null?Dl(e):At=i}function fs(e,i,s,r){qn=oa=null,ef(i),ts=null,oo=0;var f=i.return;try{if(I2(e,f,i,s,_t)){Jt=1,yl(e,Qe(s,e.current)),At=null;return}}catch(m){if(f!==null)throw At=f,m;Jt=1,yl(e,Qe(s,e.current)),At=null;return}i.flags&32768?(Dt||r===1?e=!0:rs||(_t&536870912)!==0?e=!1:(Ti=e=!0,(r===2||r===9||r===3||r===6)&&(r=qe.current,r!==null&&r.tag===13&&(r.flags|=16384))),w0(i,e)):Dl(i)}function Dl(e){var i=e;do{if((i.flags&32768)!==0){w0(i,Ti);return}e=i.return;var s=F2(i.alternate,i,Jn);if(s!==null){At=s;return}if(i=i.sibling,i!==null){At=i;return}At=i=e}while(i!==null);Jt===0&&(Jt=5)}function w0(e,i){do{var s=J2(e.alternate,e);if(s!==null){s.flags&=32767,At=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(e=e.sibling,e!==null)){At=e;return}At=e=s}while(e!==null);Jt=6,At=null}function E0(e,i,s,r,f,m,b,C,B){e.cancelPendingCommit=null;do Rl();while(ce!==0);if((Ot&6)!==0)throw Error(o(327));if(i!==null){if(i===e.current)throw Error(o(177));if(m=i.lanes|i.childLanes,m|=_c,ac(e,s,m,b,C,B),e===qt&&(At=qt=null,_t=0),us=i,Mi=e,Wn=s,Hf=m,Bf=f,d0=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,cE(Pi,function(){return _0(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=D.T,D.T=null,f=H.p,H.p=2,b=Ot,Ot|=4;try{W2(e,i,s)}finally{Ot=b,H.p=f,D.T=r}}ce=1,T0(),A0(),N0()}}function T0(){if(ce===1){ce=0;var e=Mi,i=us,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=D.T,D.T=null;var r=H.p;H.p=2;var f=Ot;Ot|=4;try{a0(i,e);var m=Wf,b=cp(e.containerInfo),C=m.focusedElem,B=m.selectionRange;if(b!==C&&C&&C.ownerDocument&&up(C.ownerDocument.documentElement,C)){if(B!==null&&Ec(C)){var K=B.start,nt=B.end;if(nt===void 0&&(nt=K),"selectionStart"in C)C.selectionStart=K,C.selectionEnd=Math.min(nt,C.value.length);else{var ot=C.ownerDocument||document,Q=ot&&ot.defaultView||window;if(Q.getSelection){var J=Q.getSelection(),dt=C.textContent.length,vt=Math.min(B.start,dt),Yt=B.end===void 0?vt:Math.min(B.end,dt);!J.extend&&vt>Yt&&(b=Yt,Yt=vt,vt=b);var G=lp(C,vt),q=lp(C,Yt);if(G&&q&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==q.node||J.focusOffset!==q.offset)){var I=ot.createRange();I.setStart(G.node,G.offset),J.removeAllRanges(),vt>Yt?(J.addRange(I),J.extend(q.node,q.offset)):(I.setEnd(q.node,q.offset),J.addRange(I))}}}}for(ot=[],J=C;J=J.parentNode;)J.nodeType===1&&ot.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ot.length;C++){var at=ot[C];at.element.scrollLeft=at.left,at.element.scrollTop=at.top}}Xl=!!Jf,Wf=Jf=null}finally{Ot=f,H.p=r,D.T=s}}e.current=i,ce=2}}function A0(){if(ce===2){ce=0;var e=Mi,i=us,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=D.T,D.T=null;var r=H.p;H.p=2;var f=Ot;Ot|=4;try{Wg(e,i.alternate,i)}finally{Ot=f,H.p=r,D.T=s}}ce=3}}function N0(){if(ce===4||ce===3){ce=0,Zi();var e=Mi,i=us,s=Wn,r=d0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?ce=5:(ce=0,us=Mi=null,M0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ni=null),Xs(s),i=i.stateNode,Ee&&typeof Ee.onCommitFiberRoot=="function")try{Ee.onCommitFiberRoot(Ii,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=D.T,f=H.p,H.p=2,D.T=null;try{for(var m=e.onRecoverableError,b=0;b<r.length;b++){var C=r[b];m(C.value,{componentStack:C.stack})}}finally{D.T=i,H.p=f}}(Wn&3)!==0&&Rl(),An(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===kf?To++:(To=0,kf=e):To=0,Ao(0)}}function M0(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,ao(i)))}function Rl(){return T0(),A0(),N0(),_0()}function _0(){if(ce!==5)return!1;var e=Mi,i=Hf;Hf=0;var s=Xs(Wn),r=D.T,f=H.p;try{H.p=32>s?32:s,D.T=null,s=Bf,Bf=null;var m=Mi,b=Wn;if(ce=0,us=Mi=null,Wn=0,(Ot&6)!==0)throw Error(o(331));var C=Ot;if(Ot|=4,u0(m.current),o0(m,m.current,b,s),Ot=C,Ao(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(Ii,m)}catch{}return!0}finally{H.p=f,D.T=r,M0(e,i)}}function C0(e,i,s){i=Qe(s,i),i=yf(e.stateNode,i,2),e=bi(e,i,2),e!==null&&(Qi(e,2),An(e))}function Ht(e,i,s){if(e.tag===3)C0(e,e,s);else for(;i!==null;){if(i.tag===3){C0(i,e,s);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ni===null||!Ni.has(r))){e=Qe(s,e),s=Dg(2),r=bi(i,s,2),r!==null&&(Rg(s,r,i,e),Qi(r,2),An(r));break}}i=i.return}}function qf(e,i,s){var r=e.pingCache;if(r===null){r=e.pingCache=new nE;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(s)||(Of=!0,f.add(s),e=rE.bind(null,e,i,s),i.then(e,e))}function rE(e,i,s){var r=e.pingCache;r!==null&&r.delete(i),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,qt===e&&(_t&s)===s&&(Jt===4||Jt===3&&(_t&62914560)===_t&&300>me()-Al?(Ot&2)===0&&cs(e,0):Vf|=s,ls===_t&&(ls=0)),An(e)}function D0(e,i){i===0&&(i=Mr()),e=ia(e,i),e!==null&&(Qi(e,i),An(e))}function lE(e){var i=e.memoizedState,s=0;i!==null&&(s=i.retryLane),D0(e,s)}function uE(e,i){var s=0;switch(e.tag){case 31:case 13:var r=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(i),D0(e,s)}function cE(e,i){return ln(e,i)}var jl=null,ds=null,Xf=!1,zl=!1,Gf=!1,Ci=0;function An(e){e!==ds&&e.next===null&&(ds===null?jl=ds=e:ds=ds.next=e),zl=!0,Xf||(Xf=!0,dE())}function Ao(e,i){if(!Gf&&zl){Gf=!0;do for(var s=!1,r=jl;r!==null;){if(e!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var b=r.suspendedLanes,C=r.pingedLanes;m=(1<<31-Te(42|e)+1)-1,m&=f&~(b&~C),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,O0(r,m))}else m=_t,m=Oa(r,r===qt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||Ki(r,m)||(s=!0,O0(r,m));r=r.next}while(s);Gf=!1}}function fE(){R0()}function R0(){zl=Xf=!1;var e=0;Ci!==0&&wE()&&(e=Ci);for(var i=me(),s=null,r=jl;r!==null;){var f=r.next,m=j0(r,i);m===0?(r.next=null,s===null?jl=f:s.next=f,f===null&&(ds=s)):(s=r,(e!==0||(m&3)!==0)&&(zl=!0)),r=f}ce!==0&&ce!==5||Ao(e),Ci!==0&&(Ci=0)}function j0(e,i){for(var s=e.suspendedLanes,r=e.pingedLanes,f=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var b=31-Te(m),C=1<<b,B=f[b];B===-1?((C&s)===0||(C&r)!==0)&&(f[b]=ic(C,i)):B<=i&&(e.expiredLanes|=C),m&=~C}if(i=qt,s=_t,s=Oa(e,e===i?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,s===0||e===i&&(Lt===2||Lt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&jn(r),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Ki(e,s)){if(i=s&-s,i===e.callbackPriority)return i;switch(r!==null&&jn(r),Xs(s)){case 2:case 8:s=ri;break;case 32:s=Pi;break;case 268435456:s=Da;break;default:s=Pi}return r=z0.bind(null,e),s=ln(s,r),e.callbackPriority=i,e.callbackNode=s,i}return r!==null&&r!==null&&jn(r),e.callbackPriority=2,e.callbackNode=null,2}function z0(e,i){if(ce!==0&&ce!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Rl()&&e.callbackNode!==s)return null;var r=_t;return r=Oa(e,e===qt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(m0(e,r,i),j0(e,me()),e.callbackNode!=null&&e.callbackNode===s?z0.bind(null,e):null)}function O0(e,i){if(Rl())return null;m0(e,i,!0)}function dE(){TE(function(){(Ot&6)!==0?ln(zn,fE):R0()})}function $f(){if(Ci===0){var e=Fa;e===0&&(e=Ra,Ra<<=1,(Ra&261888)===0&&(Ra=256)),Ci=e}return Ci}function V0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yr(""+e)}function L0(e,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,e.id&&s.setAttribute("form",e.id),i.parentNode.insertBefore(s,i),e=new FormData(e),s.parentNode.removeChild(s),e}function hE(e,i,s,r,f){if(i==="submit"&&s&&s.stateNode===f){var m=V0((f[be]||null).action),b=r.submitter;b&&(i=(i=b[be]||null)?V0(i.formAction):b.getAttribute("formAction"),i!==null&&(m=i,b=null));var C=new $r("action","action",null,r,f);e.push({event:C,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ci!==0){var B=b?L0(f,b):new FormData(f);ff(s,{pending:!0,data:B,method:f.method,action:m},null,B)}}else typeof m=="function"&&(C.preventDefault(),B=b?L0(f,b):new FormData(f),ff(s,{pending:!0,data:B,method:f.method,action:m},m,B))},currentTarget:f}]})}}for(var Zf=0;Zf<Mc.length;Zf++){var Pf=Mc[Zf],mE=Pf.toLowerCase(),pE=Pf[0].toUpperCase()+Pf.slice(1);cn(mE,"on"+pE)}cn(hp,"onAnimationEnd"),cn(mp,"onAnimationIteration"),cn(pp,"onAnimationStart"),cn("dblclick","onDoubleClick"),cn("focusin","onFocus"),cn("focusout","onBlur"),cn(R2,"onTransitionRun"),cn(j2,"onTransitionStart"),cn(z2,"onTransitionCancel"),cn(gp,"onTransitionEnd"),di("onMouseEnter",["mouseout","mouseover"]),di("onMouseLeave",["mouseout","mouseover"]),di("onPointerEnter",["pointerout","pointerover"]),di("onPointerLeave",["pointerout","pointerover"]),Ln("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ln("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ln("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ln("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ln("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var No="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(" "),gE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(No));function H0(e,i){i=(i&4)!==0;for(var s=0;s<e.length;s++){var r=e[s],f=r.event;r=r.listeners;t:{var m=void 0;if(i)for(var b=r.length-1;0<=b;b--){var C=r[b],B=C.instance,K=C.currentTarget;if(C=C.listener,B!==m&&f.isPropagationStopped())break t;m=C,f.currentTarget=K;try{m(f)}catch(nt){Ir(nt)}f.currentTarget=null,m=B}else for(b=0;b<r.length;b++){if(C=r[b],B=C.instance,K=C.currentTarget,C=C.listener,B!==m&&f.isPropagationStopped())break t;m=C,f.currentTarget=K;try{m(f)}catch(nt){Ir(nt)}f.currentTarget=null,m=B}}}}function Nt(e,i){var s=i[Va];s===void 0&&(s=i[Va]=new Set);var r=e+"__bubble";s.has(r)||(B0(i,e,2,!1),s.add(r))}function If(e,i,s){var r=0;i&&(r|=4),B0(s,e,r,i)}var Ol="_reactListening"+Math.random().toString(36).slice(2);function Kf(e){if(!e[Ol]){e[Ol]=!0,Vr.forEach(function(s){s!=="selectionchange"&&(gE.has(s)||If(s,!1,e),If(s,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[Ol]||(i[Ol]=!0,If("selectionchange",!1,i))}}function B0(e,i,s,r){switch(hy(i)){case 2:var f=GE;break;case 8:f=$E;break;default:f=cd}s=f.bind(null,i,s,e),f=void 0,!mc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?e.addEventListener(i,s,{capture:!0,passive:f}):e.addEventListener(i,s,!0):f!==void 0?e.addEventListener(i,s,{passive:f}):e.addEventListener(i,s,!1)}function Qf(e,i,s,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)t:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var C=r.stateNode.containerInfo;if(C===f)break;if(b===4)for(b=r.return;b!==null;){var B=b.tag;if((B===3||B===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;C!==null;){if(b=li(C),b===null)return;if(B=b.tag,B===5||B===6||B===26||B===27){r=m=b;continue t}C=C.parentNode}}r=r.return}Xm(function(){var K=m,nt=dc(s),ot=[];t:{var Q=yp.get(e);if(Q!==void 0){var J=$r,dt=e;switch(e){case"keypress":if(Xr(s)===0)break t;case"keydown":case"keyup":J=u2;break;case"focusin":dt="focus",J=vc;break;case"focusout":dt="blur",J=vc;break;case"beforeblur":case"afterblur":J=vc;break;case"click":if(s.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Fw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=d2;break;case hp:case mp:case pp:J=t2;break;case gp:J=m2;break;case"scroll":case"scrollend":J=Kw;break;case"wheel":J=g2;break;case"copy":case"cut":case"paste":J=n2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Im;break;case"toggle":case"beforetoggle":J=v2}var vt=(i&4)!==0,Yt=!vt&&(e==="scroll"||e==="scrollend"),G=vt?Q!==null?Q+"Capture":null:Q;vt=[];for(var q=K,I;q!==null;){var at=q;if(I=at.stateNode,at=at.tag,at!==5&&at!==26&&at!==27||I===null||G===null||(at=Ps(q,G),at!=null&&vt.push(Mo(q,at,I))),Yt)break;q=q.return}0<vt.length&&(Q=new J(Q,dt,null,s,nt),ot.push({event:Q,listeners:vt}))}}if((i&7)===0){t:{if(Q=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",Q&&s!==fc&&(dt=s.relatedTarget||s.fromElement)&&(li(dt)||dt[Vn]))break t;if((J||Q)&&(Q=nt.window===nt?nt:(Q=nt.ownerDocument)?Q.defaultView||Q.parentWindow:window,J?(dt=s.relatedTarget||s.toElement,J=K,dt=dt?li(dt):null,dt!==null&&(Yt=u(dt),vt=dt.tag,dt!==Yt||vt!==5&&vt!==27&&vt!==6)&&(dt=null)):(J=null,dt=K),J!==dt)){if(vt=Zm,at="onMouseLeave",G="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(vt=Im,at="onPointerLeave",G="onPointerEnter",q="pointer"),Yt=J==null?Q:ci(J),I=dt==null?Q:ci(dt),Q=new vt(at,q+"leave",J,s,nt),Q.target=Yt,Q.relatedTarget=I,at=null,li(nt)===K&&(vt=new vt(G,q+"enter",dt,s,nt),vt.target=I,vt.relatedTarget=Yt,at=vt),Yt=at,J&&dt)e:{for(vt=yE,G=J,q=dt,I=0,at=G;at;at=vt(at))I++;at=0;for(var gt=q;gt;gt=vt(gt))at++;for(;0<I-at;)G=vt(G),I--;for(;0<at-I;)q=vt(q),at--;for(;I--;){if(G===q||q!==null&&G===q.alternate){vt=G;break e}G=vt(G),q=vt(q)}vt=null}else vt=null;J!==null&&k0(ot,Q,J,vt,!1),dt!==null&&Yt!==null&&k0(ot,Yt,dt,vt,!0)}}t:{if(Q=K?ci(K):window,J=Q.nodeName&&Q.nodeName.toLowerCase(),J==="select"||J==="input"&&Q.type==="file")var jt=np;else if(tp(Q))if(ip)jt=_2;else{jt=N2;var mt=A2}else J=Q.nodeName,!J||J.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&cc(K.elementType)&&(jt=np):jt=M2;if(jt&&(jt=jt(e,K))){ep(ot,jt,s,nt);break t}mt&&mt(e,Q,K),e==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&Zs(Q,"number",Q.value)}switch(mt=K?ci(K):window,e){case"focusin":(tp(mt)||mt.contentEditable==="true")&&(Xa=mt,Tc=K,eo=null);break;case"focusout":eo=Tc=Xa=null;break;case"mousedown":Ac=!0;break;case"contextmenu":case"mouseup":case"dragend":Ac=!1,fp(ot,s,nt);break;case"selectionchange":if(D2)break;case"keydown":case"keyup":fp(ot,s,nt)}var Tt;if(bc)t:{switch(e){case"compositionstart":var Ct="onCompositionStart";break t;case"compositionend":Ct="onCompositionEnd";break t;case"compositionupdate":Ct="onCompositionUpdate";break t}Ct=void 0}else qa?Jm(e,s)&&(Ct="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ct="onCompositionStart");Ct&&(Km&&s.locale!=="ko"&&(qa||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&qa&&(Tt=Gm()):(hi=nt,pc="value"in hi?hi.value:hi.textContent,qa=!0)),mt=Vl(K,Ct),0<mt.length&&(Ct=new Pm(Ct,e,null,s,nt),ot.push({event:Ct,listeners:mt}),Tt?Ct.data=Tt:(Tt=Wm(s),Tt!==null&&(Ct.data=Tt)))),(Tt=b2?S2(e,s):w2(e,s))&&(Ct=Vl(K,"onBeforeInput"),0<Ct.length&&(mt=new Pm("onBeforeInput","beforeinput",null,s,nt),ot.push({event:mt,listeners:Ct}),mt.data=Tt)),hE(ot,e,K,s,nt)}H0(ot,i)})}function Mo(e,i,s){return{instance:e,listener:i,currentTarget:s}}function Vl(e,i){for(var s=i+"Capture",r=[];e!==null;){var f=e,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Ps(e,s),f!=null&&r.unshift(Mo(e,f,m)),f=Ps(e,i),f!=null&&r.push(Mo(e,f,m))),e.tag===3)return r;e=e.return}return[]}function yE(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function k0(e,i,s,r,f){for(var m=i._reactName,b=[];s!==null&&s!==r;){var C=s,B=C.alternate,K=C.stateNode;if(C=C.tag,B!==null&&B===r)break;C!==5&&C!==26&&C!==27||K===null||(B=K,f?(K=Ps(s,m),K!=null&&b.unshift(Mo(s,K,B))):f||(K=Ps(s,m),K!=null&&b.push(Mo(s,K,B)))),s=s.return}b.length!==0&&e.push({event:i,listeners:b})}var vE=/\r\n?/g,xE=/\u0000|\uFFFD/g;function U0(e){return(typeof e=="string"?e:""+e).replace(vE,`
9
+ `).replace(xE,"")}function Y0(e,i){return i=U0(i),U0(e)===i}function Ut(e,i,s,r,f,m){switch(s){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ka(e,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ka(e,""+r);break;case"className":Ha(e,"class",r);break;case"tabIndex":Ha(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ha(e,s,r);break;case"style":Ym(e,r,m);break;case"data":if(i!=="object"){Ha(e,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||s!=="href")){e.removeAttribute(s);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Yr(""+r),e.setAttribute(s,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(s,"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 m=="function"&&(s==="formAction"?(i!=="input"&&Ut(e,i,"name",f.name,f,null),Ut(e,i,"formEncType",f.formEncType,f,null),Ut(e,i,"formMethod",f.formMethod,f,null),Ut(e,i,"formTarget",f.formTarget,f,null)):(Ut(e,i,"encType",f.encType,f,null),Ut(e,i,"method",f.method,f,null),Ut(e,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Yr(""+r),e.setAttribute(s,r);break;case"onClick":r!=null&&(e.onclick=Bn);break;case"onScroll":r!=null&&Nt("scroll",e);break;case"onScrollEnd":r!=null&&Nt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}s=Yr(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""+r):e.removeAttribute(s);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":r===!0?e.setAttribute(s,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,r):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(s,r):e.removeAttribute(s);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(s):e.setAttribute(s,r);break;case"popover":Nt("beforetoggle",e),Nt("toggle",e),La(e,"popover",r);break;case"xlinkActuate":un(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":un(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":un(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":un(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":un(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":un(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":un(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":La(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Pw.get(s)||s,La(e,s,r))}}function Ff(e,i,s,r,f,m){switch(s){case"style":Ym(e,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof r=="string"?ka(e,r):(typeof r=="number"||typeof r=="bigint")&&ka(e,""+r);break;case"onScroll":r!=null&&Nt("scroll",e);break;case"onScrollEnd":r!=null&&Nt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lr.hasOwnProperty(s))t:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),i=s.slice(2,f?s.length-7:void 0),m=e[be]||null,m=m!=null?m[s]:null,typeof m=="function"&&e.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(i,r,f);break t}s in e?e[s]=r:r===!0?e.setAttribute(s,""):La(e,s,r)}}}function ve(e,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",e),Nt("load",e);var r=!1,f=!1,m;for(m in s)if(s.hasOwnProperty(m)){var b=s[m];if(b!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,i));default:Ut(e,i,m,b,s,null)}}f&&Ut(e,i,"srcSet",s.srcSet,s,null),r&&Ut(e,i,"src",s.src,s,null);return;case"input":Nt("invalid",e);var C=m=b=f=null,B=null,K=null;for(r in s)if(s.hasOwnProperty(r)){var nt=s[r];if(nt!=null)switch(r){case"name":f=nt;break;case"type":b=nt;break;case"checked":B=nt;break;case"defaultChecked":K=nt;break;case"value":m=nt;break;case"defaultValue":C=nt;break;case"children":case"dangerouslySetInnerHTML":if(nt!=null)throw Error(o(137,i));break;default:Ut(e,i,r,nt,s,null)}}Ur(e,m,C,B,K,b,f,!1);return;case"select":Nt("invalid",e),r=b=m=null;for(f in s)if(s.hasOwnProperty(f)&&(C=s[f],C!=null))switch(f){case"value":m=C;break;case"defaultValue":b=C;break;case"multiple":r=C;default:Ut(e,i,f,C,s,null)}i=m,s=b,e.multiple=!!r,i!=null?Hn(e,!!r,i,!1):s!=null&&Hn(e,!!r,s,!0);return;case"textarea":Nt("invalid",e),m=f=r=null;for(b in s)if(s.hasOwnProperty(b)&&(C=s[b],C!=null))switch(b){case"value":r=C;break;case"defaultValue":f=C;break;case"children":m=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(o(91));break;default:Ut(e,i,b,C,s,null)}km(e,r,f,m);return;case"option":for(B in s)s.hasOwnProperty(B)&&(r=s[B],r!=null)&&(B==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ut(e,i,B,r,s,null));return;case"dialog":Nt("beforetoggle",e),Nt("toggle",e),Nt("cancel",e),Nt("close",e);break;case"iframe":case"object":Nt("load",e);break;case"video":case"audio":for(r=0;r<No.length;r++)Nt(No[r],e);break;case"image":Nt("error",e),Nt("load",e);break;case"details":Nt("toggle",e);break;case"embed":case"source":case"link":Nt("error",e),Nt("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 s)if(s.hasOwnProperty(K)&&(r=s[K],r!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,i));default:Ut(e,i,K,r,s,null)}return;default:if(cc(i)){for(nt in s)s.hasOwnProperty(nt)&&(r=s[nt],r!==void 0&&Ff(e,i,nt,r,s,void 0));return}}for(C in s)s.hasOwnProperty(C)&&(r=s[C],r!=null&&Ut(e,i,C,r,s,null))}function bE(e,i,s,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,C=null,B=null,K=null,nt=null;for(J in s){var ot=s[J];if(s.hasOwnProperty(J)&&ot!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":B=ot;default:r.hasOwnProperty(J)||Ut(e,i,J,null,r,ot)}}for(var Q in r){var J=r[Q];if(ot=s[Q],r.hasOwnProperty(Q)&&(J!=null||ot!=null))switch(Q){case"type":m=J;break;case"name":f=J;break;case"checked":K=J;break;case"defaultChecked":nt=J;break;case"value":b=J;break;case"defaultValue":C=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,i));break;default:J!==ot&&Ut(e,i,Q,J,r,ot)}}Wi(e,b,C,B,K,nt,m,f);return;case"select":J=b=C=Q=null;for(m in s)if(B=s[m],s.hasOwnProperty(m)&&B!=null)switch(m){case"value":break;case"multiple":J=B;default:r.hasOwnProperty(m)||Ut(e,i,m,null,r,B)}for(f in r)if(m=r[f],B=s[f],r.hasOwnProperty(f)&&(m!=null||B!=null))switch(f){case"value":Q=m;break;case"defaultValue":C=m;break;case"multiple":b=m;default:m!==B&&Ut(e,i,f,m,r,B)}i=C,s=b,r=J,Q!=null?Hn(e,!!s,Q,!1):!!r!=!!s&&(i!=null?Hn(e,!!s,i,!0):Hn(e,!!s,s?[]:"",!1));return;case"textarea":J=Q=null;for(C in s)if(f=s[C],s.hasOwnProperty(C)&&f!=null&&!r.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Ut(e,i,C,null,r,f)}for(b in r)if(f=r[b],m=s[b],r.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":Q=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==m&&Ut(e,i,b,f,r,m)}Bm(e,Q,J);return;case"option":for(var dt in s)Q=s[dt],s.hasOwnProperty(dt)&&Q!=null&&!r.hasOwnProperty(dt)&&(dt==="selected"?e.selected=!1:Ut(e,i,dt,null,r,Q));for(B in r)Q=r[B],J=s[B],r.hasOwnProperty(B)&&Q!==J&&(Q!=null||J!=null)&&(B==="selected"?e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":Ut(e,i,B,Q,r,J));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 vt in s)Q=s[vt],s.hasOwnProperty(vt)&&Q!=null&&!r.hasOwnProperty(vt)&&Ut(e,i,vt,null,r,Q);for(K in r)if(Q=r[K],J=s[K],r.hasOwnProperty(K)&&Q!==J&&(Q!=null||J!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,i));break;default:Ut(e,i,K,Q,r,J)}return;default:if(cc(i)){for(var Yt in s)Q=s[Yt],s.hasOwnProperty(Yt)&&Q!==void 0&&!r.hasOwnProperty(Yt)&&Ff(e,i,Yt,void 0,r,Q);for(nt in r)Q=r[nt],J=s[nt],!r.hasOwnProperty(nt)||Q===J||Q===void 0&&J===void 0||Ff(e,i,nt,Q,r,J);return}}for(var G in s)Q=s[G],s.hasOwnProperty(G)&&Q!=null&&!r.hasOwnProperty(G)&&Ut(e,i,G,null,r,Q);for(ot in r)Q=r[ot],J=s[ot],!r.hasOwnProperty(ot)||Q===J||Q==null&&J==null||Ut(e,i,ot,Q,r,J)}function q0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SE(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,s=performance.getEntriesByType("resource"),r=0;r<s.length;r++){var f=s[r],m=f.transferSize,b=f.initiatorType,C=f.duration;if(m&&C&&q0(b)){for(b=0,C=f.responseEnd,r+=1;r<s.length;r++){var B=s[r],K=B.startTime;if(K>C)break;var nt=B.transferSize,ot=B.initiatorType;nt&&q0(ot)&&(B=B.responseEnd,b+=nt*(B<C?1:(C-K)/(B-K)))}if(--r,i+=8*(m+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Jf=null,Wf=null;function Ll(e){return e.nodeType===9?e:e.ownerDocument}function X0(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 G0(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function td(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ed=null;function wE(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var $0=typeof setTimeout=="function"?setTimeout:void 0,EE=typeof clearTimeout=="function"?clearTimeout:void 0,Z0=typeof Promise=="function"?Promise:void 0,TE=typeof queueMicrotask=="function"?queueMicrotask:typeof Z0<"u"?function(e){return Z0.resolve(null).then(e).catch(AE)}:$0;function AE(e){setTimeout(function(){throw e})}function Di(e){return e==="head"}function P0(e,i){var s=i,r=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(r===0){e.removeChild(f),gs(i);return}r--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")r++;else if(s==="html")_o(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,_o(s);for(var m=s.firstChild;m;){var b=m.nextSibling,C=m.nodeName;m[Fi]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=b}}else s==="body"&&_o(e.ownerDocument.body);s=f}while(s);gs(i)}function I0(e,i){var s=e;e=0;do{var r=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),r&&r.nodeType===8)if(s=r.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=r}while(s)}function nd(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":nd(s),Gs(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function NE(e,i,s,r){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Fi])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=en(e.nextSibling),e===null)break}return null}function ME(e,i,s){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=en(e.nextSibling),e===null))return null;return e}function K0(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=en(e.nextSibling),e===null))return null;return e}function id(e){return e.data==="$?"||e.data==="$~"}function ad(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _E(e,i){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||s.readyState!=="loading")i();else{var r=function(){i(),s.removeEventListener("DOMContentLoaded",r)};s.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function en(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var sd=null;function Q0(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(i===0)return en(e.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}e=e.nextSibling}return null}function F0(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return e;i--}else s!=="/$"&&s!=="/&"||i++}e=e.previousSibling}return null}function J0(e,i,s){switch(i=Ll(s),e){case"html":if(e=i.documentElement,!e)throw Error(o(452));return e;case"head":if(e=i.head,!e)throw Error(o(453));return e;case"body":if(e=i.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function _o(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);Gs(e)}var nn=new Map,W0=new Set;function Hl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ti=H.d;H.d={f:CE,r:DE,D:RE,C:jE,L:zE,m:OE,X:LE,S:VE,M:HE};function CE(){var e=ti.f(),i=_l();return e||i}function DE(e){var i=ui(e);i!==null&&i.tag===5&&i.type==="form"?gg(i):ti.r(e)}var hs=typeof document>"u"?null:document;function ty(e,i,s){var r=hs;if(r&&typeof i=="string"&&i){var f=Re(i);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),W0.has(f)||(W0.add(f),e={rel:e,crossOrigin:s,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),ve(i,"link",e),ne(i),r.head.appendChild(i)))}}function RE(e){ti.D(e),ty("dns-prefetch",e,null)}function jE(e,i){ti.C(e,i),ty("preconnect",e,i)}function zE(e,i,s){ti.L(e,i,s);var r=hs;if(r&&e&&i){var f='link[rel="preload"][as="'+Re(i)+'"]';i==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+Re(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+Re(s.imageSizes)+'"]')):f+='[href="'+Re(e)+'"]';var m=f;switch(i){case"style":m=ms(e);break;case"script":m=ps(e)}nn.has(m)||(e=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:e,as:i},s),nn.set(m,e),r.querySelector(f)!==null||i==="style"&&r.querySelector(Co(m))||i==="script"&&r.querySelector(Do(m))||(i=r.createElement("link"),ve(i,"link",e),ne(i),r.head.appendChild(i)))}}function OE(e,i){ti.m(e,i);var s=hs;if(s&&e){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Re(r)+'"][href="'+Re(e)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ps(e)}if(!nn.has(m)&&(e=y({rel:"modulepreload",href:e},i),nn.set(m,e),s.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Do(m)))return}r=s.createElement("link"),ve(r,"link",e),ne(r),s.head.appendChild(r)}}}function VE(e,i,s){ti.S(e,i,s);var r=hs;if(r&&e){var f=fi(r).hoistableStyles,m=ms(e);i=i||"default";var b=f.get(m);if(!b){var C={loading:0,preload:null};if(b=r.querySelector(Co(m)))C.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":i},s),(s=nn.get(m))&&od(e,s);var B=b=r.createElement("link");ne(B),ve(B,"link",e),B._p=new Promise(function(K,nt){B.onload=K,B.onerror=nt}),B.addEventListener("load",function(){C.loading|=1}),B.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Bl(b,i,r)}b={type:"stylesheet",instance:b,count:1,state:C},f.set(m,b)}}}function LE(e,i){ti.X(e,i);var s=hs;if(s&&e){var r=fi(s).hoistableScripts,f=ps(e),m=r.get(f);m||(m=s.querySelector(Do(f)),m||(e=y({src:e,async:!0},i),(i=nn.get(f))&&rd(e,i),m=s.createElement("script"),ne(m),ve(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function HE(e,i){ti.M(e,i);var s=hs;if(s&&e){var r=fi(s).hoistableScripts,f=ps(e),m=r.get(f);m||(m=s.querySelector(Do(f)),m||(e=y({src:e,async:!0,type:"module"},i),(i=nn.get(f))&&rd(e,i),m=s.createElement("script"),ne(m),ve(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function ey(e,i,s,r){var f=(f=ut.current)?Hl(f):null;if(!f)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ms(s.href),s=fi(f).hoistableStyles,r=s.get(i),r||(r={type:"style",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=ms(s.href);var m=fi(f).hoistableStyles,b=m.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,b),(m=f.querySelector(Co(e)))&&!m._p&&(b.instance=m,b.state.loading=5),nn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},nn.set(e,s),m||BE(f,e,s,b.state))),i&&r===null)throw Error(o(528,""));return b}if(i&&r!==null)throw Error(o(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ps(s),s=fi(f).hoistableScripts,r=s.get(i),r||(r={type:"script",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ms(e){return'href="'+Re(e)+'"'}function Co(e){return'link[rel="stylesheet"]['+e+"]"}function ny(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function BE(e,i,s,r){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=e.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),ve(i,"link",s),ne(i),e.head.appendChild(i))}function ps(e){return'[src="'+Re(e)+'"]'}function Do(e){return"script[async]"+e}function iy(e,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var r=e.querySelector('style[data-href~="'+Re(s.href)+'"]');if(r)return i.instance=r,ne(r),r;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ne(r),ve(r,"style",f),Bl(r,s.precedence,e),i.instance=r;case"stylesheet":f=ms(s.href);var m=e.querySelector(Co(f));if(m)return i.state.loading|=4,i.instance=m,ne(m),m;r=ny(s),(f=nn.get(f))&&od(r,f),m=(e.ownerDocument||e).createElement("link"),ne(m);var b=m;return b._p=new Promise(function(C,B){b.onload=C,b.onerror=B}),ve(m,"link",r),i.state.loading|=4,Bl(m,s.precedence,e),i.instance=m;case"script":return m=ps(s.src),(f=e.querySelector(Do(m)))?(i.instance=f,ne(f),f):(r=s,(f=nn.get(m))&&(r=y({},s),rd(r,f)),e=e.ownerDocument||e,f=e.createElement("script"),ne(f),ve(f,"link",r),e.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(o(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,Bl(r,s.precedence,e));return i.instance}function Bl(e,i,s){for(var r=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,m=f,b=0;b<r.length;b++){var C=r[b];if(C.dataset.precedence===i)m=C;else if(m!==f)break}m?m.parentNode.insertBefore(e,m.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(e,i.firstChild))}function od(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function rd(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var kl=null;function ay(e,i,s){if(kl===null){var r=new Map,f=kl=new Map;f.set(s,r)}else f=kl,r=f.get(s),r||(r=new Map,f.set(s,r));if(r.has(e))return r;for(r.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var m=s[f];if(!(m[Fi]||m[ue]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(i)||"";b=e+b;var C=r.get(b);C?C.push(m):r.set(b,[m])}}return r}function sy(e,i,s){e=e.ownerDocument||e,e.head.insertBefore(s,i==="title"?e.querySelector("head > title"):null)}function kE(e,i,s){if(s===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(e=i.disabled,typeof i.precedence=="string"&&e==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function UE(e,i,s,r){if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=ms(r.href),m=i.querySelector(Co(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Ul.bind(e),i.then(e,e)),s.state.loading|=4,s.instance=m,ne(m);return}m=i.ownerDocument||i,r=ny(r),(f=nn.get(f))&&od(r,f),m=m.createElement("link"),ne(m);var b=m;b._p=new Promise(function(C,B){b.onload=C,b.onerror=B}),ve(m,"link",r),s.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ul.bind(e),i.addEventListener("load",s),i.addEventListener("error",s))}}var ld=0;function YE(e,i){return e.stylesheets&&e.count===0&&ql(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var r=setTimeout(function(){if(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+i);0<e.imgBytes&&ld===0&&(ld=62500*SE());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ql(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>ld?50:800)+i);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function Ul(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ql(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yl=null;function ql(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yl=new Map,i.forEach(qE,e),Yl=null,Ul.call(e))}function qE(e,i){if(!(i.state.loading&4)){var s=Yl.get(e);if(s)var r=s.get(null);else{s=new Map,Yl.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(s.set(b.dataset.precedence,b),r=b)}r&&s.set(null,r)}f=i.instance,b=f.getAttribute("data-precedence"),m=s.get(b)||r,m===r&&s.set(null,f),s.set(b,f),this.count++,r=Ul.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),m?m.parentNode.insertBefore(f,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),i.state.loading|=4}}var Ro={$$typeof:N,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function XE(e,i,s,r,f,m,b,C,B){this.tag=1,this.containerInfo=e,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=Ys(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ys(0),this.hiddenUpdates=Ys(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function ry(e,i,s,r,f,m,b,C,B,K,nt,ot){return e=new XE(e,i,s,b,B,K,nt,ot,C),i=1,m===!0&&(i|=24),m=Ye(3,null,null,i),e.current=m,m.stateNode=e,i=Uc(),i.refCount++,e.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:s,cache:i},Gc(m),e}function ly(e){return e?(e=Za,e):Za}function uy(e,i,s,r,f,m){f=ly(f),r.context===null?r.context=f:r.pendingContext=f,r=xi(i),r.payload={element:s},m=m===void 0?null:m,m!==null&&(r.callback=m),s=bi(e,r,i),s!==null&&(He(s,e,i),lo(s,e,i))}function cy(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<i?s:i}}function ud(e,i){cy(e,i),(e=e.alternate)&&cy(e,i)}function fy(e){if(e.tag===13||e.tag===31){var i=ia(e,67108864);i!==null&&He(i,e,67108864),ud(e,67108864)}}function dy(e){if(e.tag===13||e.tag===31){var i=Ze();i=qs(i);var s=ia(e,i);s!==null&&He(s,e,i),ud(e,i)}}var Xl=!0;function GE(e,i,s,r){var f=D.T;D.T=null;var m=H.p;try{H.p=2,cd(e,i,s,r)}finally{H.p=m,D.T=f}}function $E(e,i,s,r){var f=D.T;D.T=null;var m=H.p;try{H.p=8,cd(e,i,s,r)}finally{H.p=m,D.T=f}}function cd(e,i,s,r){if(Xl){var f=fd(r);if(f===null)Qf(e,i,r,Gl,s),my(e,r);else if(PE(f,e,i,s,r))r.stopPropagation();else if(my(e,r),i&4&&-1<ZE.indexOf(e)){for(;f!==null;){var m=ui(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=On(m.pendingLanes);if(b!==0){var C=m;for(C.pendingLanes|=2,C.entangledLanes|=2;b;){var B=1<<31-Te(b);C.entanglements[1]|=B,b&=~B}An(m),(Ot&6)===0&&(Nl=me()+500,Ao(0))}}break;case 31:case 13:C=ia(m,2),C!==null&&He(C,m,2),_l(),ud(m,2)}if(m=fd(r),m===null&&Qf(e,i,r,Gl,s),m===f)break;f=m}f!==null&&r.stopPropagation()}else Qf(e,i,r,null,s)}}function fd(e){return e=dc(e),dd(e)}var Gl=null;function dd(e){if(Gl=null,e=li(e),e!==null){var i=u(e);if(i===null)e=null;else{var s=i.tag;if(s===13){if(e=c(i),e!==null)return e;e=null}else if(s===31){if(e=d(i),e!==null)return e;e=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Gl=e,null}function hy(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(Ca()){case zn:return 2;case ri:return 8;case Pi:case Fu:return 32;case Da:return 268435456;default:return 32}default:return 32}}var hd=!1,Ri=null,ji=null,zi=null,jo=new Map,zo=new Map,Oi=[],ZE="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 my(e,i){switch(e){case"focusin":case"focusout":Ri=null;break;case"dragenter":case"dragleave":ji=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":jo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":zo.delete(i.pointerId)}}function Oo(e,i,s,r,f,m){return e===null||e.nativeEvent!==m?(e={blockedOn:i,domEventName:s,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=ui(i),i!==null&&fy(i)),e):(e.eventSystemFlags|=r,i=e.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),e)}function PE(e,i,s,r,f){switch(i){case"focusin":return Ri=Oo(Ri,e,i,s,r,f),!0;case"dragenter":return ji=Oo(ji,e,i,s,r,f),!0;case"mouseover":return zi=Oo(zi,e,i,s,r,f),!0;case"pointerover":var m=f.pointerId;return jo.set(m,Oo(jo.get(m)||null,e,i,s,r,f)),!0;case"gotpointercapture":return m=f.pointerId,zo.set(m,Oo(zo.get(m)||null,e,i,s,r,f)),!0}return!1}function py(e){var i=li(e.target);if(i!==null){var s=u(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){e.blockedOn=i,jr(e.priority,function(){dy(s)});return}}else if(i===31){if(i=d(s),i!==null){e.blockedOn=i,jr(e.priority,function(){dy(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $l(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var s=fd(e.nativeEvent);if(s===null){s=e.nativeEvent;var r=new s.constructor(s.type,s);fc=r,s.target.dispatchEvent(r),fc=null}else return i=ui(s),i!==null&&fy(i),e.blockedOn=s,!1;i.shift()}return!0}function gy(e,i,s){$l(e)&&s.delete(i)}function IE(){hd=!1,Ri!==null&&$l(Ri)&&(Ri=null),ji!==null&&$l(ji)&&(ji=null),zi!==null&&$l(zi)&&(zi=null),jo.forEach(gy),zo.forEach(gy)}function Zl(e,i){e.blockedOn===i&&(e.blockedOn=null,hd||(hd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,IE)))}var Pl=null;function yy(e){Pl!==e&&(Pl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pl===e&&(Pl=null);for(var i=0;i<e.length;i+=3){var s=e[i],r=e[i+1],f=e[i+2];if(typeof r!="function"){if(dd(r||s)===null)continue;break}var m=ui(s);m!==null&&(e.splice(i,3),i-=3,ff(m,{pending:!0,data:f,method:s.method,action:r},r,f))}}))}function gs(e){function i(B){return Zl(B,e)}Ri!==null&&Zl(Ri,e),ji!==null&&Zl(ji,e),zi!==null&&Zl(zi,e),jo.forEach(i),zo.forEach(i);for(var s=0;s<Oi.length;s++){var r=Oi[s];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Oi.length&&(s=Oi[0],s.blockedOn===null);)py(s),s.blockedOn===null&&Oi.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(r=0;r<s.length;r+=3){var f=s[r],m=s[r+1],b=f[be]||null;if(typeof m=="function")b||yy(s);else if(b){var C=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[be]||null)C=b.formAction;else if(dd(f)!==null)continue}else C=b.action;typeof C=="function"?s[r+1]=C:(s.splice(r,3),r-=3),yy(s)}}}function vy(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(s,20)}function s(){if(!r&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function md(e){this._internalRoot=e}Il.prototype.render=md.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(o(409));var s=i.current,r=Ze();uy(s,r,e,i,null,null)},Il.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;uy(e.current,2,null,e,null,null),_l(),i[Vn]=null}};function Il(e){this._internalRoot=e}Il.prototype.unstable_scheduleHydration=function(e){if(e){var i=Rr();e={blockedOn:null,target:e,priority:i};for(var s=0;s<Oi.length&&i!==0&&i<Oi[s].priority;s++);Oi.splice(s,0,e),s===0&&py(e)}};var xy=n.version;if(xy!=="19.2.4")throw Error(o(527,xy,"19.2.4"));H.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(i),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var KE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kl.isDisabled&&Kl.supportsFiber)try{Ii=Kl.inject(KE),Ee=Kl}catch{}}return Lo.createRoot=function(e,i){if(!l(e))throw Error(o(299));var s=!1,r="",f=Ng,m=Mg,b=_g;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=ry(e,1,!1,null,null,s,r,null,f,m,b,vy),e[Vn]=i.current,Kf(e),new md(i)},Lo.hydrateRoot=function(e,i,s){if(!l(e))throw Error(o(299));var r=!1,f="",m=Ng,b=Mg,C=_g,B=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(C=s.onRecoverableError),s.formState!==void 0&&(B=s.formState)),i=ry(e,1,!0,i,s??null,r,f,B,m,b,C,vy),i.context=ly(null),s=i.current,r=Ze(),r=qs(r),f=xi(r),f.callback=null,bi(s,f,r),s=r,i.current.lanes=s,Qi(i,s),An(i),e[Vn]=i.current,Kf(e),new Il(i)},Lo.version="19.2.4",Lo}var Cy;function aT(){if(Cy)return yd.exports;Cy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),yd.exports=iT(),yd.exports}var sT=aT();const f1=(...t)=>t.filter((n,a,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===a).join(" ").trim();const oT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rT=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,o)=>o?o.toUpperCase():a.toLowerCase());const Dy=t=>{const n=rT(t);return n.charAt(0).toUpperCase()+n.slice(1)};var lT={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"};const uT=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const cT=R.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:c,...d},p)=>R.createElement("svg",{ref:p,...lT,width:n,height:n,stroke:t,strokeWidth:o?Number(a)*24/Number(n):a,className:f1("lucide",l),...!u&&!uT(d)&&{"aria-hidden":"true"},...d},[...c.map(([h,g])=>R.createElement(h,g)),...Array.isArray(u)?u:[u]]));const Gt=(t,n)=>{const a=R.forwardRef(({className:o,...l},u)=>R.createElement(cT,{ref:u,iconNode:n,className:f1(`lucide-${oT(Dy(t))}`,`lucide-${t}`,o),...l}));return a.displayName=Dy(t),a};const fT=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Jd=Gt("activity",fT);const dT=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],hT=Gt("arrow-down-right",dT);const mT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],pT=Gt("bell-off",mT);const gT=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ry=Gt("bell",gT);const yT=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],vT=Gt("box",yT);const xT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Bh=Gt("check",xT);const bT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Fo=Gt("chevron-down",bT);const ST=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],d1=Gt("chevron-up",ST);const wT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],h1=Gt("circle-alert",wT);const ET=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Wd=Gt("circle",ET);const TT=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],m1=Gt("clock",TT);const AT=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],jy=Gt("coins",AT);const NT=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],MT=Gt("file-pen",NT);const _T=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],CT=Gt("folder",_T);const DT=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],RT=Gt("inbox",DT);const jT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],zT=Gt("layout-dashboard",jT);const OT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],p1=Gt("loader-circle",OT);const VT=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],g1=Gt("message-circle-question-mark",VT);const LT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],HT=Gt("refresh-cw",LT);const BT=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],kT=Gt("sparkles",BT);const UT=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],YT=Gt("square-check-big",UT);const qT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],XT=Gt("square",qT);const GT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$T=Gt("terminal",GT);const ZT=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],PT=Gt("wifi-off",ZT);const IT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],KT=Gt("x",IT);const QT=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],FT=Gt("zap",QT),JT=50234,kh=R.createContext({});function Uh(t){const n=R.useRef(null);return n.current===null&&(n.current=t()),n.current}const y1=typeof window<"u",v1=y1?R.useLayoutEffect:R.useEffect,Hu=R.createContext(null);function Yh(t,n){t.indexOf(n)===-1&&t.push(n)}function qh(t,n){const a=t.indexOf(n);a>-1&&t.splice(a,1)}const Cn=(t,n,a)=>a>n?n:a<t?t:a;let Xh=()=>{};const ai={},x1=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function b1(t){return typeof t=="object"&&t!==null}const S1=t=>/^0[^.\s]+$/u.test(t);function Gh(t){let n;return()=>(n===void 0&&(n=t()),n)}const on=t=>t,WT=(t,n)=>a=>n(t(a)),mr=(...t)=>t.reduce(WT),Jo=(t,n,a)=>{const o=n-t;return o===0?1:(a-t)/o};class $h{constructor(){this.subscriptions=[]}add(n){return Yh(this.subscriptions,n),()=>qh(this.subscriptions,n)}notify(n,a,o){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](n,a,o);else for(let u=0;u<l;u++){const c=this.subscriptions[u];c&&c(n,a,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ii=t=>t*1e3,sn=t=>t/1e3;function w1(t,n){return n?t*(1e3/n):0}const E1=(t,n,a)=>(((1-3*a+3*n)*t+(3*a-6*n))*t+3*n)*t,tA=1e-7,eA=12;function nA(t,n,a,o,l){let u,c,d=0;do c=n+(a-n)/2,u=E1(c,o,l)-t,u>0?a=c:n=c;while(Math.abs(u)>tA&&++d<eA);return c}function pr(t,n,a,o){if(t===n&&a===o)return on;const l=u=>nA(u,0,1,t,a);return u=>u===0||u===1?u:E1(l(u),n,o)}const T1=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,A1=t=>n=>1-t(1-n),N1=pr(.33,1.53,.69,.99),Zh=A1(N1),M1=T1(Zh),_1=t=>(t*=2)<1?.5*Zh(t):.5*(2-Math.pow(2,-10*(t-1))),Ph=t=>1-Math.sin(Math.acos(t)),C1=A1(Ph),D1=T1(Ph),iA=pr(.42,0,1,1),aA=pr(0,0,.58,1),R1=pr(.42,0,.58,1),sA=t=>Array.isArray(t)&&typeof t[0]!="number",j1=t=>Array.isArray(t)&&typeof t[0]=="number",oA={linear:on,easeIn:iA,easeInOut:R1,easeOut:aA,circIn:Ph,circInOut:D1,circOut:C1,backIn:Zh,backInOut:M1,backOut:N1,anticipate:_1},rA=t=>typeof t=="string",zy=t=>{if(j1(t)){Xh(t.length===4);const[n,a,o,l]=t;return pr(n,a,o,l)}else if(rA(t))return oA[t];return t},Ql=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function lA(t,n){let a=new Set,o=new Set,l=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){c.has(g)&&(h.schedule(g),t()),g(d)}const h={schedule:(g,y=!1,v=!1)=>{const S=v&&l?a:o;return y&&c.add(g),S.has(g)||S.add(g),g},cancel:g=>{o.delete(g),c.delete(g)},process:g=>{if(d=g,l){u=!0;return}l=!0,[a,o]=[o,a],a.forEach(p),a.clear(),l=!1,u&&(u=!1,h.process(g))}};return h}const uA=40;function z1(t,n){let a=!1,o=!0;const l={delta:0,timestamp:0,isProcessing:!1},u=()=>a=!0,c=Ql.reduce((N,M)=>(N[M]=lA(u),N),{}),{setup:d,read:p,resolveKeyframes:h,preUpdate:g,update:y,preRender:v,render:x,postRender:S}=c,T=()=>{const N=ai.useManualTiming?l.timestamp:performance.now();a=!1,ai.useManualTiming||(l.delta=o?1e3/60:Math.max(Math.min(N-l.timestamp,uA),1)),l.timestamp=N,l.isProcessing=!0,d.process(l),p.process(l),h.process(l),g.process(l),y.process(l),v.process(l),x.process(l),S.process(l),l.isProcessing=!1,a&&n&&(o=!1,t(T))},A=()=>{a=!0,o=!0,l.isProcessing||t(T)};return{schedule:Ql.reduce((N,M)=>{const z=c[M];return N[M]=(V,O=!1,k=!1)=>(a||A(),z.schedule(V,O,k)),N},{}),cancel:N=>{for(let M=0;M<Ql.length;M++)c[Ql[M]].cancel(N)},state:l,steps:c}}const{schedule:Xt,cancel:qi,state:xe,steps:Sd}=z1(typeof requestAnimationFrame<"u"?requestAnimationFrame:on,!0);let uu;function cA(){uu=void 0}const Me={now:()=>(uu===void 0&&Me.set(xe.isProcessing||ai.useManualTiming?xe.timestamp:performance.now()),uu),set:t=>{uu=t,queueMicrotask(cA)}},O1=t=>n=>typeof n=="string"&&n.startsWith(t),V1=O1("--"),fA=O1("var(--"),Ih=t=>fA(t)?dA.test(t.split("/*")[0].trim()):!1,dA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Oy(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Bs={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Wo={...Bs,transform:t=>Cn(0,1,t)},Fl={...Bs,default:1},Go=t=>Math.round(t*1e5)/1e5,Kh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hA(t){return t==null}const mA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qh=(t,n)=>a=>!!(typeof a=="string"&&mA.test(a)&&a.startsWith(t)||n&&!hA(a)&&Object.prototype.hasOwnProperty.call(a,n)),L1=(t,n,a)=>o=>{if(typeof o!="string")return o;const[l,u,c,d]=o.match(Kh);return{[t]:parseFloat(l),[n]:parseFloat(u),[a]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},pA=t=>Cn(0,255,t),wd={...Bs,transform:t=>Math.round(pA(t))},xa={test:Qh("rgb","red"),parse:L1("red","green","blue"),transform:({red:t,green:n,blue:a,alpha:o=1})=>"rgba("+wd.transform(t)+", "+wd.transform(n)+", "+wd.transform(a)+", "+Go(Wo.transform(o))+")"};function gA(t){let n="",a="",o="",l="";return t.length>5?(n=t.substring(1,3),a=t.substring(3,5),o=t.substring(5,7),l=t.substring(7,9)):(n=t.substring(1,2),a=t.substring(2,3),o=t.substring(3,4),l=t.substring(4,5),n+=n,a+=a,o+=o,l+=l),{red:parseInt(n,16),green:parseInt(a,16),blue:parseInt(o,16),alpha:l?parseInt(l,16)/255:1}}const th={test:Qh("#"),parse:gA,transform:xa.transform},gr=t=>({test:n=>typeof n=="string"&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),Bi=gr("deg"),Mn=gr("%"),ht=gr("px"),yA=gr("vh"),vA=gr("vw"),Vy={...Mn,parse:t=>Mn.parse(t)/100,transform:t=>Mn.transform(t*100)},vs={test:Qh("hsl","hue"),parse:L1("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:a,alpha:o=1})=>"hsla("+Math.round(t)+", "+Mn.transform(Go(n))+", "+Mn.transform(Go(a))+", "+Go(Wo.transform(o))+")"},re={test:t=>xa.test(t)||th.test(t)||vs.test(t),parse:t=>xa.test(t)?xa.parse(t):vs.test(t)?vs.parse(t):th.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?xa.transform(t):vs.transform(t),getAnimatableNone:t=>{const n=re.parse(t);return n.alpha=0,re.transform(n)}},xA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function bA(t){return isNaN(t)&&typeof t=="string"&&(t.match(Kh)?.length||0)+(t.match(xA)?.length||0)>0}const H1="number",B1="color",SA="var",wA="var(",Ly="${}",EA=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tr(t){const n=t.toString(),a=[],o={color:[],number:[],var:[]},l=[];let u=0;const d=n.replace(EA,p=>(re.test(p)?(o.color.push(u),l.push(B1),a.push(re.parse(p))):p.startsWith(wA)?(o.var.push(u),l.push(SA),a.push(p)):(o.number.push(u),l.push(H1),a.push(parseFloat(p))),++u,Ly)).split(Ly);return{values:a,split:d,indexes:o,types:l}}function k1(t){return tr(t).values}function U1(t){const{split:n,types:a}=tr(t),o=n.length;return l=>{let u="";for(let c=0;c<o;c++)if(u+=n[c],l[c]!==void 0){const d=a[c];d===H1?u+=Go(l[c]):d===B1?u+=re.transform(l[c]):u+=l[c]}return u}}const TA=t=>typeof t=="number"?0:re.test(t)?re.getAnimatableNone(t):t;function AA(t){const n=k1(t);return U1(t)(n.map(TA))}const Xi={test:bA,parse:k1,createTransformer:U1,getAnimatableNone:AA};function Ed(t,n,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?t+(n-t)*6*a:a<1/2?n:a<2/3?t+(n-t)*(2/3-a)*6:t}function NA({hue:t,saturation:n,lightness:a,alpha:o}){t/=360,n/=100,a/=100;let l=0,u=0,c=0;if(!n)l=u=c=a;else{const d=a<.5?a*(1+n):a+n-a*n,p=2*a-d;l=Ed(p,d,t+1/3),u=Ed(p,d,t),c=Ed(p,d,t-1/3)}return{red:Math.round(l*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:o}}function xu(t,n){return a=>a>0?n:t}const Qt=(t,n,a)=>t+(n-t)*a,Td=(t,n,a)=>{const o=t*t,l=a*(n*n-o)+o;return l<0?0:Math.sqrt(l)},MA=[th,xa,vs],_A=t=>MA.find(n=>n.test(t));function Hy(t){const n=_A(t);if(!n)return!1;let a=n.parse(t);return n===vs&&(a=NA(a)),a}const By=(t,n)=>{const a=Hy(t),o=Hy(n);if(!a||!o)return xu(t,n);const l={...a};return u=>(l.red=Td(a.red,o.red,u),l.green=Td(a.green,o.green,u),l.blue=Td(a.blue,o.blue,u),l.alpha=Qt(a.alpha,o.alpha,u),xa.transform(l))},eh=new Set(["none","hidden"]);function CA(t,n){return eh.has(t)?a=>a<=0?t:n:a=>a>=1?n:t}function DA(t,n){return a=>Qt(t,n,a)}function Fh(t){return typeof t=="number"?DA:typeof t=="string"?Ih(t)?xu:re.test(t)?By:zA:Array.isArray(t)?Y1:typeof t=="object"?re.test(t)?By:RA:xu}function Y1(t,n){const a=[...t],o=a.length,l=t.map((u,c)=>Fh(u)(u,n[c]));return u=>{for(let c=0;c<o;c++)a[c]=l[c](u);return a}}function RA(t,n){const a={...t,...n},o={};for(const l in a)t[l]!==void 0&&n[l]!==void 0&&(o[l]=Fh(t[l])(t[l],n[l]));return l=>{for(const u in o)a[u]=o[u](l);return a}}function jA(t,n){const a=[],o={color:0,var:0,number:0};for(let l=0;l<n.values.length;l++){const u=n.types[l],c=t.indexes[u][o[u]],d=t.values[c]??0;a[l]=d,o[u]++}return a}const zA=(t,n)=>{const a=Xi.createTransformer(n),o=tr(t),l=tr(n);return o.indexes.var.length===l.indexes.var.length&&o.indexes.color.length===l.indexes.color.length&&o.indexes.number.length>=l.indexes.number.length?eh.has(t)&&!l.values.length||eh.has(n)&&!o.values.length?CA(t,n):mr(Y1(jA(o,l),l.values),a):xu(t,n)};function q1(t,n,a){return typeof t=="number"&&typeof n=="number"&&typeof a=="number"?Qt(t,n,a):Fh(t)(t,n)}const OA=t=>{const n=({timestamp:a})=>t(a);return{start:(a=!0)=>Xt.update(n,a),stop:()=>qi(n),now:()=>xe.isProcessing?xe.timestamp:Me.now()}},X1=(t,n,a=10)=>{let o="";const l=Math.max(Math.round(n/a),2);for(let u=0;u<l;u++)o+=Math.round(t(u/(l-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`},bu=2e4;function Jh(t){let n=0;const a=50;let o=t.next(n);for(;!o.done&&n<bu;)n+=a,o=t.next(n);return n>=bu?1/0:n}function VA(t,n=100,a){const o=a({...t,keyframes:[0,n]}),l=Math.min(Jh(o),bu);return{type:"keyframes",ease:u=>o.next(l*u).value/n,duration:sn(l)}}const LA=5;function G1(t,n,a){const o=Math.max(n-LA,0);return w1(a-t(o),n-o)}const Wt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ad=.001;function HA({duration:t=Wt.duration,bounce:n=Wt.bounce,velocity:a=Wt.velocity,mass:o=Wt.mass}){let l,u,c=1-n;c=Cn(Wt.minDamping,Wt.maxDamping,c),t=Cn(Wt.minDuration,Wt.maxDuration,sn(t)),c<1?(l=h=>{const g=h*c,y=g*t,v=g-a,x=nh(h,c),S=Math.exp(-y);return Ad-v/x*S},u=h=>{const y=h*c*t,v=y*a+a,x=Math.pow(c,2)*Math.pow(h,2)*t,S=Math.exp(-y),T=nh(Math.pow(h,2),c);return(-l(h)+Ad>0?-1:1)*((v-x)*S)/T}):(l=h=>{const g=Math.exp(-h*t),y=(h-a)*t+1;return-Ad+g*y},u=h=>{const g=Math.exp(-h*t),y=(a-h)*(t*t);return g*y});const d=5/t,p=kA(l,u,d);if(t=ii(t),isNaN(p))return{stiffness:Wt.stiffness,damping:Wt.damping,duration:t};{const h=Math.pow(p,2)*o;return{stiffness:h,damping:c*2*Math.sqrt(o*h),duration:t}}}const BA=12;function kA(t,n,a){let o=a;for(let l=1;l<BA;l++)o=o-t(o)/n(o);return o}function nh(t,n){return t*Math.sqrt(1-n*n)}const UA=["duration","bounce"],YA=["stiffness","damping","mass"];function ky(t,n){return n.some(a=>t[a]!==void 0)}function qA(t){let n={velocity:Wt.velocity,stiffness:Wt.stiffness,damping:Wt.damping,mass:Wt.mass,isResolvedFromDuration:!1,...t};if(!ky(t,YA)&&ky(t,UA))if(t.visualDuration){const a=t.visualDuration,o=2*Math.PI/(a*1.2),l=o*o,u=2*Cn(.05,1,1-(t.bounce||0))*Math.sqrt(l);n={...n,mass:Wt.mass,stiffness:l,damping:u}}else{const a=HA(t);n={...n,...a,mass:Wt.mass},n.isResolvedFromDuration=!0}return n}function Su(t=Wt.visualDuration,n=Wt.bounce){const a=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:o,restDelta:l}=a;const u=a.keyframes[0],c=a.keyframes[a.keyframes.length-1],d={done:!1,value:u},{stiffness:p,damping:h,mass:g,duration:y,velocity:v,isResolvedFromDuration:x}=qA({...a,velocity:-sn(a.velocity||0)}),S=v||0,T=h/(2*Math.sqrt(p*g)),A=c-u,E=sn(Math.sqrt(p/g)),_=Math.abs(A)<5;o||(o=_?Wt.restSpeed.granular:Wt.restSpeed.default),l||(l=_?Wt.restDelta.granular:Wt.restDelta.default);let N;if(T<1){const z=nh(E,T);N=V=>{const O=Math.exp(-T*E*V);return c-O*((S+T*E*A)/z*Math.sin(z*V)+A*Math.cos(z*V))}}else if(T===1)N=z=>c-Math.exp(-E*z)*(A+(S+E*A)*z);else{const z=E*Math.sqrt(T*T-1);N=V=>{const O=Math.exp(-T*E*V),k=Math.min(z*V,300);return c-O*((S+T*E*A)*Math.sinh(k)+z*A*Math.cosh(k))/z}}const M={calculatedDuration:x&&y||null,next:z=>{const V=N(z);if(x)d.done=z>=y;else{let O=z===0?S:0;T<1&&(O=z===0?ii(S):G1(N,z,V));const k=Math.abs(O)<=o,X=Math.abs(c-V)<=l;d.done=k&&X}return d.value=d.done?c:V,d},toString:()=>{const z=Math.min(Jh(M),bu),V=X1(O=>M.next(z*O).value,z,30);return z+"ms "+V},toTransition:()=>{}};return M}Su.applyToOptions=t=>{const n=VA(t,100,Su);return t.ease=n.ease,t.duration=ii(n.duration),t.type="keyframes",t};function ih({keyframes:t,velocity:n=0,power:a=.8,timeConstant:o=325,bounceDamping:l=10,bounceStiffness:u=500,modifyTarget:c,min:d,max:p,restDelta:h=.5,restSpeed:g}){const y=t[0],v={done:!1,value:y},x=k=>d!==void 0&&k<d||p!==void 0&&k>p,S=k=>d===void 0?p:p===void 0||Math.abs(d-k)<Math.abs(p-k)?d:p;let T=a*n;const A=y+T,E=c===void 0?A:c(A);E!==A&&(T=E-y);const _=k=>-T*Math.exp(-k/o),N=k=>E+_(k),M=k=>{const X=_(k),st=N(k);v.done=Math.abs(X)<=h,v.value=v.done?E:st};let z,V;const O=k=>{x(v.value)&&(z=k,V=Su({keyframes:[v.value,S(v.value)],velocity:G1(N,k,v.value),damping:l,stiffness:u,restDelta:h,restSpeed:g}))};return O(0),{calculatedDuration:null,next:k=>{let X=!1;return!V&&z===void 0&&(X=!0,M(k),O(k)),z!==void 0&&k>=z?V.next(k-z):(!X&&M(k),v)}}}function XA(t,n,a){const o=[],l=a||ai.mix||q1,u=t.length-1;for(let c=0;c<u;c++){let d=l(t[c],t[c+1]);if(n){const p=Array.isArray(n)?n[c]||on:n;d=mr(p,d)}o.push(d)}return o}function GA(t,n,{clamp:a=!0,ease:o,mixer:l}={}){const u=t.length;if(Xh(u===n.length),u===1)return()=>n[0];if(u===2&&n[0]===n[1])return()=>n[1];const c=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),n=[...n].reverse());const d=XA(n,o,l),p=d.length,h=g=>{if(c&&g<t[0])return n[0];let y=0;if(p>1)for(;y<t.length-2&&!(g<t[y+1]);y++);const v=Jo(t[y],t[y+1],g);return d[y](v)};return a?g=>h(Cn(t[0],t[u-1],g)):h}function $A(t,n){const a=t[t.length-1];for(let o=1;o<=n;o++){const l=Jo(0,n,o);t.push(Qt(a,1,l))}}function ZA(t){const n=[0];return $A(n,t.length-1),n}function PA(t,n){return t.map(a=>a*n)}function IA(t,n){return t.map(()=>n||R1).splice(0,t.length-1)}function $o({duration:t=300,keyframes:n,times:a,ease:o="easeInOut"}){const l=sA(o)?o.map(zy):zy(o),u={done:!1,value:n[0]},c=PA(a&&a.length===n.length?a:ZA(n),t),d=GA(c,n,{ease:Array.isArray(l)?l:IA(n,l)});return{calculatedDuration:t,next:p=>(u.value=d(p),u.done=p>=t,u)}}const KA=t=>t!==null;function Wh(t,{repeat:n,repeatType:a="loop"},o,l=1){const u=t.filter(KA),d=l<0||n&&a!=="loop"&&n%2===1?0:u.length-1;return!d||o===void 0?u[d]:o}const QA={decay:ih,inertia:ih,tween:$o,keyframes:$o,spring:Su};function $1(t){typeof t.type=="string"&&(t.type=QA[t.type])}class tm{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(n=>{this.resolve=n})}notifyFinished(){this.resolve()}then(n,a){return this.finished.then(n,a)}}const FA=t=>t/100;class em extends tm{constructor(n){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==Me.now()&&this.tick(Me.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=n,this.initAnimation(),this.play(),n.autoplay===!1&&this.pause()}initAnimation(){const{options:n}=this;$1(n);const{type:a=$o,repeat:o=0,repeatDelay:l=0,repeatType:u,velocity:c=0}=n;let{keyframes:d}=n;const p=a||$o;p!==$o&&typeof d[0]!="number"&&(this.mixKeyframes=mr(FA,q1(d[0],d[1])),d=[0,100]);const h=p({...n,keyframes:d});u==="mirror"&&(this.mirroredGenerator=p({...n,keyframes:[...d].reverse(),velocity:-c})),h.calculatedDuration===null&&(h.calculatedDuration=Jh(h));const{calculatedDuration:g}=h;this.calculatedDuration=g,this.resolvedDuration=g+l,this.totalDuration=this.resolvedDuration*(o+1)-l,this.generator=h}updateTime(n){const a=Math.round(n-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(n,a=!1){const{generator:o,totalDuration:l,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:p}=this;if(this.startTime===null)return o.next(0);const{delay:h=0,keyframes:g,repeat:y,repeatType:v,repeatDelay:x,type:S,onUpdate:T,finalKeyframe:A}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-l/this.speed,this.startTime)),a?this.currentTime=n:this.updateTime(n);const E=this.currentTime-h*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?E<0:E>l;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let N=this.currentTime,M=o;if(y){const k=Math.min(this.currentTime,l)/d;let X=Math.floor(k),st=k%1;!st&&k>=1&&(st=1),st===1&&X--,X=Math.min(X,y+1),X%2&&(v==="reverse"?(st=1-st,x&&(st-=x/d)):v==="mirror"&&(M=c)),N=Cn(0,1,st)*d}const z=_?{done:!1,value:g[0]}:M.next(N);u&&(z.value=u(z.value));let{done:V}=z;!_&&p!==null&&(V=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return O&&S!==ih&&(z.value=Wh(g,this.options,A,this.speed)),T&&T(z.value),O&&this.finish(),z}then(n,a){return this.finished.then(n,a)}get duration(){return sn(this.calculatedDuration)}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+sn(n)}get time(){return sn(this.currentTime)}set time(n){n=ii(n),this.currentTime=n,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(n){this.updateTime(Me.now());const a=this.playbackSpeed!==n;this.playbackSpeed=n,a&&(this.time=sn(this.currentTime))}play(){if(this.isStopped)return;const{driver:n=OA,startTime:a}=this.options;this.driver||(this.driver=n(l=>this.tick(l))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=a??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Me.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}attachTimeline(n){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),n.observe(this)}}function JA(t){for(let n=1;n<t.length;n++)t[n]??(t[n]=t[n-1])}const ba=t=>t*180/Math.PI,ah=t=>{const n=ba(Math.atan2(t[1],t[0]));return sh(n)},WA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ah,rotateZ:ah,skewX:t=>ba(Math.atan(t[1])),skewY:t=>ba(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},sh=t=>(t=t%360,t<0&&(t+=360),t),Uy=ah,Yy=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),qy=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),tN={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yy,scaleY:qy,scale:t=>(Yy(t)+qy(t))/2,rotateX:t=>sh(ba(Math.atan2(t[6],t[5]))),rotateY:t=>sh(ba(Math.atan2(-t[2],t[0]))),rotateZ:Uy,rotate:Uy,skewX:t=>ba(Math.atan(t[4])),skewY:t=>ba(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function oh(t){return t.includes("scale")?1:0}function rh(t,n){if(!t||t==="none")return oh(n);const a=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,l;if(a)o=tN,l=a;else{const d=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=WA,l=d}if(!l)return oh(n);const u=o[n],c=l[1].split(",").map(nN);return typeof u=="function"?u(c):c[u]}const eN=(t,n)=>{const{transform:a="none"}=getComputedStyle(t);return rh(a,n)};function nN(t){return parseFloat(t.trim())}const ks=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Us=new Set(ks),Xy=t=>t===Bs||t===ht,iN=new Set(["x","y","z"]),aN=ks.filter(t=>!iN.has(t));function sN(t){const n=[];return aN.forEach(a=>{const o=t.getValue(a);o!==void 0&&(n.push([a,o.get()]),o.set(a.startsWith("scale")?1:0))}),n}const Ui={width:({x:t},{paddingLeft:n="0",paddingRight:a="0"})=>t.max-t.min-parseFloat(n)-parseFloat(a),height:({y:t},{paddingTop:n="0",paddingBottom:a="0"})=>t.max-t.min-parseFloat(n)-parseFloat(a),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:(t,{transform:n})=>rh(n,"x"),y:(t,{transform:n})=>rh(n,"y")};Ui.translateX=Ui.x;Ui.translateY=Ui.y;const wa=new Set;let lh=!1,uh=!1,ch=!1;function Z1(){if(uh){const t=Array.from(wa).filter(o=>o.needsMeasurement),n=new Set(t.map(o=>o.element)),a=new Map;n.forEach(o=>{const l=sN(o);l.length&&(a.set(o,l),o.render())}),t.forEach(o=>o.measureInitialState()),n.forEach(o=>{o.render();const l=a.get(o);l&&l.forEach(([u,c])=>{o.getValue(u)?.set(c)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}uh=!1,lh=!1,wa.forEach(t=>t.complete(ch)),wa.clear()}function P1(){wa.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(uh=!0)})}function oN(){ch=!0,P1(),Z1(),ch=!1}class nm{constructor(n,a,o,l,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...n],this.onComplete=a,this.name=o,this.motionValue=l,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(wa.add(this),lh||(lh=!0,Xt.read(P1),Xt.resolveKeyframes(Z1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:a,element:o,motionValue:l}=this;if(n[0]===null){const u=l?.get(),c=n[n.length-1];if(u!==void 0)n[0]=u;else if(o&&a){const d=o.readValue(a,c);d!=null&&(n[0]=d)}n[0]===void 0&&(n[0]=c),l&&u===void 0&&l.set(n[0])}JA(n)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(n=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,n),wa.delete(this)}cancel(){this.state==="scheduled"&&(wa.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rN=t=>t.startsWith("--");function lN(t,n,a){rN(n)?t.style.setProperty(n,a):t.style[n]=a}const uN=Gh(()=>window.ScrollTimeline!==void 0),cN={};function fN(t,n){const a=Gh(t);return()=>cN[n]??a()}const I1=fN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Uo=([t,n,a,o])=>`cubic-bezier(${t}, ${n}, ${a}, ${o})`,Gy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Uo([0,.65,.55,1]),circOut:Uo([.55,0,1,.45]),backIn:Uo([.31,.01,.66,-.59]),backOut:Uo([.33,1.53,.69,.99])};function K1(t,n){if(t)return typeof t=="function"?I1()?X1(t,n):"ease-out":j1(t)?Uo(t):Array.isArray(t)?t.map(a=>K1(a,n)||Gy.easeOut):Gy[t]}function dN(t,n,a,{delay:o=0,duration:l=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:p}={},h=void 0){const g={[n]:a};p&&(g.offset=p);const y=K1(d,l);Array.isArray(y)&&(g.easing=y);const v={delay:o,duration:l,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return h&&(v.pseudoElement=h),t.animate(g,v)}function Q1(t){return typeof t=="function"&&"applyToOptions"in t}function hN({type:t,...n}){return Q1(t)&&I1()?t.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}class mN extends tm{constructor(n){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!n)return;const{element:a,name:o,keyframes:l,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:p}=n;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=n,Xh(typeof n.type!="string");const h=hN(n);this.animation=dN(a,o,l,h,u),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const g=Wh(l,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):lN(a,o,g),this.animation.cancel()}p?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:n}=this;n==="idle"||n==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const n=this.options?.element;!this.isPseudoElement&&n?.isConnected&&this.animation.commitStyles?.()}get duration(){const n=this.animation.effect?.getComputedTiming?.().duration||0;return sn(Number(n))}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+sn(n)}get time(){return sn(Number(this.animation.currentTime)||0)}set time(n){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ii(n)}get speed(){return this.animation.playbackRate}set speed(n){n<0&&(this.finishedTime=null),this.animation.playbackRate=n}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(n){this.manualStartTime=this.animation.startTime=n}attachTimeline({timeline:n,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,n&&uN()?(this.animation.timeline=n,on):a(this)}}const F1={anticipate:_1,backInOut:M1,circInOut:D1};function pN(t){return t in F1}function gN(t){typeof t.ease=="string"&&pN(t.ease)&&(t.ease=F1[t.ease])}const Nd=10;class yN extends mN{constructor(n){gN(n),$1(n),super(n),n.startTime!==void 0&&(this.startTime=n.startTime),this.options=n}updateMotionValue(n){const{motionValue:a,onUpdate:o,onComplete:l,element:u,...c}=this.options;if(!a)return;if(n!==void 0){a.set(n);return}const d=new em({...c,autoplay:!1}),p=Math.max(Nd,Me.now()-this.startTime),h=Cn(0,Nd,p-Nd);a.setWithVelocity(d.sample(Math.max(0,p-h)).value,d.sample(p).value,h),d.stop()}}const $y=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Xi.test(t)||t==="0")&&!t.startsWith("url("));function vN(t){const n=t[0];if(t.length===1)return!0;for(let a=0;a<t.length;a++)if(t[a]!==n)return!0}function xN(t,n,a,o){const l=t[0];if(l===null)return!1;if(n==="display"||n==="visibility")return!0;const u=t[t.length-1],c=$y(l,n),d=$y(u,n);return!c||!d?!1:vN(t)||(a==="spring"||Q1(a))&&o}function fh(t){t.duration=0,t.type="keyframes"}const bN=new Set(["opacity","clipPath","filter","transform"]),SN=Gh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wN(t){const{motionValue:n,name:a,repeatDelay:o,repeatType:l,damping:u,type:c}=t;if(!(n?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:h}=n.owner.getProps();return SN()&&a&&bN.has(a)&&(a!=="transform"||!h)&&!p&&!o&&l!=="mirror"&&u!==0&&c!=="inertia"}const EN=40;class TN extends tm{constructor({autoplay:n=!0,delay:a=0,type:o="keyframes",repeat:l=0,repeatDelay:u=0,repeatType:c="loop",keyframes:d,name:p,motionValue:h,element:g,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Me.now();const v={autoplay:n,delay:a,type:o,repeat:l,repeatDelay:u,repeatType:c,name:p,motionValue:h,element:g,...y},x=g?.KeyframeResolver||nm;this.keyframeResolver=new x(d,(S,T,A)=>this.onKeyframesResolved(S,T,v,!A),p,h,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(n,a,o,l){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:p,isHandoff:h,onUpdate:g}=o;this.resolvedAt=Me.now(),xN(n,u,c,d)||((ai.instantAnimations||!p)&&g?.(Wh(n,o,a)),n[0]=n[n.length-1],fh(o),o.repeat=0);const v={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>EN?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...o,keyframes:n},x=!h&&wN(v),S=v.motionValue?.owner?.current,T=x?new yN({...v,element:S}):new em(v);T.finished.then(()=>{this.notifyFinished()}).catch(on),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(n,a){return this.finished.finally(n).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),oN()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(n){this.animation.time=n}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(n){this.animation.speed=n}get startTime(){return this.animation.startTime}attachTimeline(n){return this._animation?this.stopTimeline=this.animation.attachTimeline(n):this.pendingTimeline=n,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function J1(t,n,a,o=0,l=1){const u=Array.from(t).sort((h,g)=>h.sortNodePosition(g)).indexOf(n),c=t.size,d=(c-1)*o;return typeof a=="function"?a(u,c):l===1?u*o:d-u*o}const AN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function NN(t){const n=AN.exec(t);if(!n)return[,];const[,a,o,l]=n;return[`--${a??o}`,l]}function W1(t,n,a=1){const[o,l]=NN(t);if(!o)return;const u=window.getComputedStyle(n).getPropertyValue(o);if(u){const c=u.trim();return x1(c)?parseFloat(c):c}return Ih(l)?W1(l,n,a+1):l}const MN={type:"spring",stiffness:500,damping:25,restSpeed:10},_N=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),CN={type:"keyframes",duration:.8},DN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RN=(t,{keyframes:n})=>n.length>2?CN:Us.has(t)?t.startsWith("scale")?_N(n[1]):MN:DN,jN=t=>t!==null;function zN(t,{repeat:n,repeatType:a="loop"},o){const l=t.filter(jN),u=n&&a!=="loop"&&n%2===1?0:l.length-1;return l[u]}function im(t,n){return t?.[n]??t?.default??t}function ON({when:t,delay:n,delayChildren:a,staggerChildren:o,staggerDirection:l,repeat:u,repeatType:c,repeatDelay:d,from:p,elapsed:h,...g}){return!!Object.keys(g).length}const am=(t,n,a,o={},l,u)=>c=>{const d=im(o,t)||{},p=d.delay||o.delay||0;let{elapsed:h=0}=o;h=h-ii(p);const g={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:n.getVelocity(),...d,delay:-h,onUpdate:v=>{n.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:t,motionValue:n,element:u?void 0:l};ON(d)||Object.assign(g,RN(t,g)),g.duration&&(g.duration=ii(g.duration)),g.repeatDelay&&(g.repeatDelay=ii(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(fh(g),g.delay===0&&(y=!0)),(ai.instantAnimations||ai.skipAnimations||l?.shouldSkipAnimations)&&(y=!0,fh(g),g.delay=0),g.allowFlatten=!d.type&&!d.ease,y&&!u&&n.get()!==void 0){const v=zN(g.keyframes,d);if(v!==void 0){Xt.update(()=>{g.onUpdate(v),g.onComplete()});return}}return d.isSync?new em(g):new TN(g)};function Zy(t){const n=[{},{}];return t?.values.forEach((a,o)=>{n[0][o]=a.get(),n[1][o]=a.getVelocity()}),n}function sm(t,n,a,o){if(typeof n=="function"){const[l,u]=Zy(o);n=n(a!==void 0?a:t.custom,l,u)}if(typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"){const[l,u]=Zy(o);n=n(a!==void 0?a:t.custom,l,u)}return n}function Ns(t,n,a){const o=t.getProps();return sm(o,n,a!==void 0?a:o.custom,t)}const tb=new Set(["width","height","top","left","right","bottom",...ks]),Py=30,VN=t=>!isNaN(parseFloat(t));class LN{constructor(n,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const l=Me.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(n),this.owner=a.owner}setCurrent(n){this.current=n,this.updatedAt=Me.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=VN(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,a){this.events[n]||(this.events[n]=new $h);const o=this.events[n].add(a);return n==="change"?()=>{o(),Xt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,a){this.passiveEffect=n,this.stopPassiveEffect=a}set(n){this.passiveEffect?this.passiveEffect(n,this.updateAndNotify):this.updateAndNotify(n)}setWithVelocity(n,a,o){this.set(a),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-o}jump(n,a=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(n){this.dependents||(this.dependents=new Set),this.dependents.add(n)}removeDependent(n){this.dependents&&this.dependents.delete(n)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>Py)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,Py);return w1(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(n){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=n(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cs(t,n){return new LN(t,n)}const dh=t=>Array.isArray(t);function HN(t,n,a){t.hasValue(n)?t.getValue(n).set(a):t.addValue(n,Cs(a))}function BN(t){return dh(t)?t[t.length-1]||0:t}function kN(t,n){const a=Ns(t,n);let{transitionEnd:o={},transition:l={},...u}=a||{};u={...u,...o};for(const c in u){const d=BN(u[c]);HN(t,c,d)}}const we=t=>!!(t&&t.getVelocity);function UN(t){return!!(we(t)&&t.add)}function hh(t,n){const a=t.getValue("willChange");if(UN(a))return a.add(n);if(!a&&ai.WillChange){const o=new ai.WillChange("auto");t.addValue("willChange",o),o.add(n)}}function om(t){return t.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}const YN="framerAppearId",eb="data-"+om(YN);function nb(t){return t.props[eb]}function qN({protectedKeys:t,needsAnimating:n},a){const o=t.hasOwnProperty(a)&&n[a]!==!0;return n[a]=!1,o}function ib(t,n,{delay:a=0,transitionOverride:o,type:l}={}){let{transition:u=t.getDefaultTransition(),transitionEnd:c,...d}=n;const p=u?.reduceMotion;o&&(u=o);const h=[],g=l&&t.animationState&&t.animationState.getState()[l];for(const y in d){const v=t.getValue(y,t.latestValues[y]??null),x=d[y];if(x===void 0||g&&qN(g,y))continue;const S={delay:a,...im(u||{},y)},T=v.get();if(T!==void 0&&!v.isAnimating&&!Array.isArray(x)&&x===T&&!S.velocity)continue;let A=!1;if(window.MotionHandoffAnimation){const N=nb(t);if(N){const M=window.MotionHandoffAnimation(N,y,Xt);M!==null&&(S.startTime=M,A=!0)}}hh(t,y);const E=p??t.shouldReduceMotion;v.start(am(y,v,x,E&&tb.has(y)?{type:!1}:S,t,A));const _=v.animation;_&&h.push(_)}return c&&Promise.all(h).then(()=>{Xt.update(()=>{c&&kN(t,c)})}),h}function mh(t,n,a={}){const o=Ns(t,n,a.type==="exit"?t.presenceContext?.custom:void 0);let{transition:l=t.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(l=a.transitionOverride);const u=o?()=>Promise.all(ib(t,o,a)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(p=0)=>{const{delayChildren:h=0,staggerChildren:g,staggerDirection:y}=l;return XN(t,n,p,h,g,y,a)}:()=>Promise.resolve(),{when:d}=l;if(d){const[p,h]=d==="beforeChildren"?[u,c]:[c,u];return p().then(()=>h())}else return Promise.all([u(),c(a.delay)])}function XN(t,n,a=0,o=0,l=0,u=1,c){const d=[];for(const p of t.variantChildren)p.notify("AnimationStart",n),d.push(mh(p,n,{...c,delay:a+(typeof o=="function"?0:o)+J1(t.variantChildren,p,o,l,u)}).then(()=>p.notify("AnimationComplete",n)));return Promise.all(d)}function GN(t,n,a={}){t.notify("AnimationStart",n);let o;if(Array.isArray(n)){const l=n.map(u=>mh(t,u,a));o=Promise.all(l)}else if(typeof n=="string")o=mh(t,n,a);else{const l=typeof n=="function"?Ns(t,n,a.custom):n;o=Promise.all(ib(t,l,a))}return o.then(()=>{t.notify("AnimationComplete",n)})}const $N={test:t=>t==="auto",parse:t=>t},ab=t=>n=>n.test(t),sb=[Bs,ht,Mn,Bi,vA,yA,$N],Iy=t=>sb.find(ab(t));function ZN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||S1(t):!0}const PN=new Set(["brightness","contrast","saturate","opacity"]);function IN(t){const[n,a]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[o]=a.match(Kh)||[];if(!o)return t;const l=a.replace(o,"");let u=PN.has(n)?1:0;return o!==a&&(u*=100),n+"("+u+l+")"}const KN=/\b([a-z-]*)\(.*?\)/gu,ph={...Xi,getAnimatableNone:t=>{const n=t.match(KN);return n?n.map(IN).join(" "):t}},Ky={...Bs,transform:Math.round},QN={rotate:Bi,rotateX:Bi,rotateY:Bi,rotateZ:Bi,scale:Fl,scaleX:Fl,scaleY:Fl,scaleZ:Fl,skew:Bi,skewX:Bi,skewY:Bi,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:Wo,originX:Vy,originY:Vy,originZ:ht},rm={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,top:ht,right:ht,bottom:ht,left:ht,inset:ht,insetBlock:ht,insetBlockStart:ht,insetBlockEnd:ht,insetInline:ht,insetInlineStart:ht,insetInlineEnd:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,paddingBlock:ht,paddingBlockStart:ht,paddingBlockEnd:ht,paddingInline:ht,paddingInlineStart:ht,paddingInlineEnd:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,marginBlock:ht,marginBlockStart:ht,marginBlockEnd:ht,marginInline:ht,marginInlineStart:ht,marginInlineEnd:ht,fontSize:ht,backgroundPositionX:ht,backgroundPositionY:ht,...QN,zIndex:Ky,fillOpacity:Wo,strokeOpacity:Wo,numOctaves:Ky},FN={...rm,color:re,backgroundColor:re,outlineColor:re,fill:re,stroke:re,borderColor:re,borderTopColor:re,borderRightColor:re,borderBottomColor:re,borderLeftColor:re,filter:ph,WebkitFilter:ph},ob=t=>FN[t];function rb(t,n){let a=ob(t);return a!==ph&&(a=Xi),a.getAnimatableNone?a.getAnimatableNone(n):void 0}const JN=new Set(["auto","none","0"]);function WN(t,n,a){let o=0,l;for(;o<t.length&&!l;){const u=t[o];typeof u=="string"&&!JN.has(u)&&tr(u).values.length&&(l=t[o]),o++}if(l&&a)for(const u of n)t[u]=rb(a,l)}class tM extends nm{constructor(n,a,o,l,u){super(n,a,o,l,u,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:a,name:o}=this;if(!a||!a.current)return;super.readKeyframes();for(let g=0;g<n.length;g++){let y=n[g];if(typeof y=="string"&&(y=y.trim(),Ih(y))){const v=W1(y,a.current);v!==void 0&&(n[g]=v),g===n.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!tb.has(o)||n.length!==2)return;const[l,u]=n,c=Iy(l),d=Iy(u),p=Oy(l),h=Oy(u);if(p!==h&&Ui[o]){this.needsMeasurement=!0;return}if(c!==d)if(Xy(c)&&Xy(d))for(let g=0;g<n.length;g++){const y=n[g];typeof y=="string"&&(n[g]=parseFloat(y))}else Ui[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:a}=this,o=[];for(let l=0;l<n.length;l++)(n[l]===null||ZN(n[l]))&&o.push(l);o.length&&WN(n,o,a)}measureInitialState(){const{element:n,unresolvedKeyframes:a,name:o}=this;if(!n||!n.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ui[o](n.measureViewportBox(),window.getComputedStyle(n.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&n.getValue(o,l).jump(l,!1)}measureEndState(){const{element:n,name:a,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const l=n.getValue(a);l&&l.jump(this.measuredOrigin,!1);const u=o.length-1,c=o[u];o[u]=Ui[a](n.measureViewportBox(),window.getComputedStyle(n.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,p])=>{n.getValue(d).set(p)}),this.resolveNoneKeyframes()}}function eM(t,n,a){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let o=document;const l=a?.[t]??o.querySelectorAll(t);return l?Array.from(l):[]}return Array.from(t).filter(o=>o!=null)}const lb=(t,n)=>n&&typeof t=="number"?n.transform(t):t;function gh(t){return b1(t)&&"offsetHeight"in t}const{schedule:lm}=z1(queueMicrotask,!1),mn={x:!1,y:!1};function ub(){return mn.x||mn.y}function nM(t){return t==="x"||t==="y"?mn[t]?null:(mn[t]=!0,()=>{mn[t]=!1}):mn.x||mn.y?null:(mn.x=mn.y=!0,()=>{mn.x=mn.y=!1})}function cb(t,n){const a=eM(t),o=new AbortController,l={passive:!0,...n,signal:o.signal};return[a,l,()=>o.abort()]}function Qy(t){return!(t.pointerType==="touch"||ub())}function iM(t,n,a={}){const[o,l,u]=cb(t,a),c=d=>{if(!Qy(d))return;const{target:p}=d,h=n(p,d);if(typeof h!="function"||!p)return;const g=y=>{Qy(y)&&(h(y),p.removeEventListener("pointerleave",g))};p.addEventListener("pointerleave",g,l)};return o.forEach(d=>{d.addEventListener("pointerenter",c,l)}),u}const fb=(t,n)=>n?t===n?!0:fb(t,n.parentElement):!1,um=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,aM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sM(t){return aM.has(t.tagName)||t.isContentEditable===!0}const oM=new Set(["INPUT","SELECT","TEXTAREA"]);function rM(t){return oM.has(t.tagName)||t.isContentEditable===!0}const cu=new WeakSet;function Fy(t){return n=>{n.key==="Enter"&&t(n)}}function Md(t,n){t.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const lM=(t,n)=>{const a=t.currentTarget;if(!a)return;const o=Fy(()=>{if(cu.has(a))return;Md(a,"down");const l=Fy(()=>{Md(a,"up")}),u=()=>Md(a,"cancel");a.addEventListener("keyup",l,n),a.addEventListener("blur",u,n)});a.addEventListener("keydown",o,n),a.addEventListener("blur",()=>a.removeEventListener("keydown",o),n)};function Jy(t){return um(t)&&!ub()}function uM(t,n,a={}){const[o,l,u]=cb(t,a),c=d=>{const p=d.currentTarget;if(!Jy(d))return;cu.add(p);const h=n(p,d),g=(x,S)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),cu.has(p)&&cu.delete(p),Jy(x)&&typeof h=="function"&&h(x,{success:S})},y=x=>{g(x,p===window||p===document||a.useGlobalTarget||fb(p,x.target))},v=x=>{g(x,!1)};window.addEventListener("pointerup",y,l),window.addEventListener("pointercancel",v,l)};return o.forEach(d=>{(a.useGlobalTarget?window:d).addEventListener("pointerdown",c,l),gh(d)&&(d.addEventListener("focus",h=>lM(h,l)),!sM(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function db(t){return b1(t)&&"ownerSVGElement"in t}function cM(t){return db(t)&&t.tagName==="svg"}const fM=[...sb,re,Xi],dM=t=>fM.find(ab(t)),Wy=()=>({translate:0,scale:1,origin:0,originPoint:0}),xs=()=>({x:Wy(),y:Wy()}),tv=()=>({min:0,max:0}),fe=()=>({x:tv(),y:tv()}),yh={current:null},hb={current:!1},hM=typeof window<"u";function mM(){if(hb.current=!0,!!hM)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>yh.current=t.matches;t.addEventListener("change",n),n()}else yh.current=!1}const pM=new WeakMap;function Bu(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function er(t){return typeof t=="string"||Array.isArray(t)}const cm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fm=["initial",...cm];function ku(t){return Bu(t.animate)||fm.some(n=>er(t[n]))}function mb(t){return!!(ku(t)||t.variants)}function gM(t,n,a){for(const o in n){const l=n[o],u=a[o];if(we(l))t.addValue(o,l);else if(we(u))t.addValue(o,Cs(l,{owner:t}));else if(u!==l)if(t.hasValue(o)){const c=t.getValue(o);c.liveStyle===!0?c.jump(l):c.hasAnimated||c.set(l)}else{const c=t.getStaticValue(o);t.addValue(o,Cs(c!==void 0?c:l,{owner:t}))}}for(const o in a)n[o]===void 0&&t.removeValue(o);return n}const ev=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let wu={};function pb(t){wu=t}function yM(){return wu}class vM{scrapeMotionValuesFromProps(n,a,o){return{}}constructor({parent:n,props:a,presenceContext:o,reducedMotionConfig:l,skipAnimations:u,blockInitialAnimation:c,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=nm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=Me.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Xt.render(this.render,!1,!0))};const{latestValues:h,renderState:g}=d;this.latestValues=h,this.baseTarget={...h},this.initialValues=a.initial?{...h}:{},this.renderState=g,this.parent=n,this.props=a,this.presenceContext=o,this.depth=n?n.depth+1:0,this.reducedMotionConfig=l,this.skipAnimationsConfig=u,this.options=p,this.blockInitialAnimation=!!c,this.isControllingVariants=ku(a),this.isVariantNode=mb(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:y,...v}=this.scrapeMotionValuesFromProps(a,{},this);for(const x in v){const S=v[x];h[x]!==void 0&&we(S)&&S.set(h[x])}}mount(n){this.current=n,pM.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,o)=>this.bindToMotionValue(o,a)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hb.current||mM(),this.shouldReduceMotion=yh.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const a=this.features[n];a&&(a.unmount(),a.isMounted=!1)}this.current=null}addChild(n){this.children.add(n),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(n)}removeChild(n){this.children.delete(n),this.enteringChildren&&this.enteringChildren.delete(n)}bindToMotionValue(n,a){this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)();const o=Us.has(n);o&&this.onBindTransform&&this.onBindTransform();const l=a.on("change",c=>{this.latestValues[n]=c,this.props.onUpdate&&Xt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;typeof window<"u"&&window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,n,a)),this.valueSubscriptions.set(n,()=>{l(),u&&u(),a.owner&&a.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in wu){const a=wu[n];if(!a)continue;const{isEnabled:o,Feature:l}=a;if(!this.features[n]&&l&&o(this.props)&&(this.features[n]=new l(this)),this.features[n]){const u=this.features[n];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,a){this.latestValues[n]=a}update(n,a){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let o=0;o<ev.length;o++){const l=ev[o];this.propEventSubscriptions[l]&&(this.propEventSubscriptions[l](),delete this.propEventSubscriptions[l]);const u="on"+l,c=n[u];c&&(this.propEventSubscriptions[l]=this.on(l,c))}this.prevMotionValues=gM(this,this.scrapeMotionValuesFromProps(n,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(n){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(n),()=>a.variantChildren.delete(n)}addValue(n,a){const o=this.values.get(n);a!==o&&(o&&this.removeValue(n),this.bindToMotionValue(n,a),this.values.set(n,a),this.latestValues[n]=a.get())}removeValue(n){this.values.delete(n);const a=this.valueSubscriptions.get(n);a&&(a(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,a){if(this.props.values&&this.props.values[n])return this.props.values[n];let o=this.values.get(n);return o===void 0&&a!==void 0&&(o=Cs(a===null?void 0:a,{owner:this}),this.addValue(n,o)),o}readValue(n,a){let o=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:this.getBaseTargetFromProps(this.props,n)??this.readValueFromInstance(this.current,n,this.options);return o!=null&&(typeof o=="string"&&(x1(o)||S1(o))?o=parseFloat(o):!dM(o)&&Xi.test(a)&&(o=rb(n,a)),this.setBaseTarget(n,we(o)?o.get():o)),we(o)?o.get():o}setBaseTarget(n,a){this.baseTarget[n]=a}getBaseTarget(n){const{initial:a}=this.props;let o;if(typeof a=="string"||typeof a=="object"){const u=sm(this.props,a,this.presenceContext?.custom);u&&(o=u[n])}if(a&&o!==void 0)return o;const l=this.getBaseTargetFromProps(this.props,n);return l!==void 0&&!we(l)?l:this.initialValues[n]!==void 0&&o===void 0?void 0:this.baseTarget[n]}on(n,a){return this.events[n]||(this.events[n]=new $h),this.events[n].add(a)}notify(n,...a){this.events[n]&&this.events[n].notify(...a)}scheduleRenderMicrotask(){lm.render(this.render)}}class gb extends vM{constructor(){super(...arguments),this.KeyframeResolver=tM}sortInstanceNodePosition(n,a){return n.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(n,a){const o=n.style;return o?o[a]:void 0}removeValueFromRenderState(n,{vars:a,style:o}){delete a[n],delete o[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;we(n)&&(this.childSubscription=n.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}class Gi{constructor(n){this.isMounted=!1,this.node=n}update(){}}function yb({top:t,left:n,right:a,bottom:o}){return{x:{min:n,max:a},y:{min:t,max:o}}}function xM({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function bM(t,n){if(!n)return t;const a=n({x:t.left,y:t.top}),o=n({x:t.right,y:t.bottom});return{top:a.y,left:a.x,bottom:o.y,right:o.x}}function _d(t){return t===void 0||t===1}function vh({scale:t,scaleX:n,scaleY:a}){return!_d(t)||!_d(n)||!_d(a)}function ya(t){return vh(t)||vb(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function vb(t){return nv(t.x)||nv(t.y)}function nv(t){return t&&t!=="0%"}function Eu(t,n,a){const o=t-a,l=n*o;return a+l}function iv(t,n,a,o,l){return l!==void 0&&(t=Eu(t,l,o)),Eu(t,a,o)+n}function xh(t,n=0,a=1,o,l){t.min=iv(t.min,n,a,o,l),t.max=iv(t.max,n,a,o,l)}function xb(t,{x:n,y:a}){xh(t.x,n.translate,n.scale,n.originPoint),xh(t.y,a.translate,a.scale,a.originPoint)}const av=.999999999999,sv=1.0000000000001;function SM(t,n,a,o=!1){const l=a.length;if(!l)return;n.x=n.y=1;let u,c;for(let d=0;d<l;d++){u=a[d],c=u.projectionDelta;const{visualElement:p}=u.options;p&&p.props.style&&p.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ss(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(n.x*=c.x.scale,n.y*=c.y.scale,xb(t,c)),o&&ya(u.latestValues)&&Ss(t,u.latestValues))}n.x<sv&&n.x>av&&(n.x=1),n.y<sv&&n.y>av&&(n.y=1)}function bs(t,n){t.min=t.min+n,t.max=t.max+n}function ov(t,n,a,o,l=.5){const u=Qt(t.min,t.max,l);xh(t,n,a,u,o)}function Ss(t,n){ov(t.x,n.x,n.scaleX,n.scale,n.originX),ov(t.y,n.y,n.scaleY,n.scale,n.originY)}function bb(t,n){return yb(bM(t.getBoundingClientRect(),n))}function wM(t,n,a){const o=bb(t,a),{scroll:l}=n;return l&&(bs(o.x,l.offset.x),bs(o.y,l.offset.y)),o}const EM={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},TM=ks.length;function AM(t,n,a){let o="",l=!0;for(let u=0;u<TM;u++){const c=ks[u],d=t[c];if(d===void 0)continue;let p=!0;if(typeof d=="number")p=d===(c.startsWith("scale")?1:0);else{const h=parseFloat(d);p=c.startsWith("scale")?h===1:h===0}if(!p||a){const h=lb(d,rm[c]);if(!p){l=!1;const g=EM[c]||c;o+=`${g}(${h}) `}a&&(n[c]=h)}}return o=o.trim(),a?o=a(n,l?"":o):l&&(o="none"),o}function dm(t,n,a){const{style:o,vars:l,transformOrigin:u}=t;let c=!1,d=!1;for(const p in n){const h=n[p];if(Us.has(p)){c=!0;continue}else if(V1(p)){l[p]=h;continue}else{const g=lb(h,rm[p]);p.startsWith("origin")?(d=!0,u[p]=g):o[p]=g}}if(n.transform||(c||a?o.transform=AM(n,t.transform,a):o.transform&&(o.transform="none")),d){const{originX:p="50%",originY:h="50%",originZ:g=0}=u;o.transformOrigin=`${p} ${h} ${g}`}}function Sb(t,{style:n,vars:a},o,l){const u=t.style;let c;for(c in n)u[c]=n[c];l?.applyProjectionStyles(u,o);for(c in a)u.setProperty(c,a[c])}function rv(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const Ho={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(ht.test(t))t=parseFloat(t);else return t;const a=rv(t,n.target.x),o=rv(t,n.target.y);return`${a}% ${o}%`}},NM={correct:(t,{treeScale:n,projectionDelta:a})=>{const o=t,l=Xi.parse(t);if(l.length>5)return o;const u=Xi.createTransformer(t),c=typeof l[0]!="number"?1:0,d=a.x.scale*n.x,p=a.y.scale*n.y;l[0+c]/=d,l[1+c]/=p;const h=Qt(d,p,.5);return typeof l[2+c]=="number"&&(l[2+c]/=h),typeof l[3+c]=="number"&&(l[3+c]/=h),u(l)}},bh={borderRadius:{...Ho,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ho,borderTopRightRadius:Ho,borderBottomLeftRadius:Ho,borderBottomRightRadius:Ho,boxShadow:NM};function wb(t,{layout:n,layoutId:a}){return Us.has(t)||t.startsWith("origin")||(n||a!==void 0)&&(!!bh[t]||t==="opacity")}function hm(t,n,a){const o=t.style,l=n?.style,u={};if(!o)return u;for(const c in o)(we(o[c])||l&&we(l[c])||wb(c,t)||a?.getValue(c)?.liveStyle!==void 0)&&(u[c]=o[c]);return u}function MM(t){return window.getComputedStyle(t)}class _M extends gb{constructor(){super(...arguments),this.type="html",this.renderInstance=Sb}readValueFromInstance(n,a){if(Us.has(a))return this.projection?.isProjecting?oh(a):eN(n,a);{const o=MM(n),l=(V1(a)?o.getPropertyValue(a):o[a])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(n,{transformPagePoint:a}){return bb(n,a)}build(n,a,o){dm(n,a,o.transformTemplate)}scrapeMotionValuesFromProps(n,a,o){return hm(n,a,o)}}const CM={offset:"stroke-dashoffset",array:"stroke-dasharray"},DM={offset:"strokeDashoffset",array:"strokeDasharray"};function RM(t,n,a=1,o=0,l=!0){t.pathLength=1;const u=l?CM:DM;t[u.offset]=`${-o}`,t[u.array]=`${n} ${a}`}const jM=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Eb(t,{attrX:n,attrY:a,attrScale:o,pathLength:l,pathSpacing:u=1,pathOffset:c=0,...d},p,h,g){if(dm(t,d,h),p){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:y,style:v}=t;y.transform&&(v.transform=y.transform,delete y.transform),(v.transform||y.transformOrigin)&&(v.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),v.transform&&(v.transformBox=g?.transformBox??"fill-box",delete y.transformBox);for(const x of jM)y[x]!==void 0&&(v[x]=y[x],delete y[x]);n!==void 0&&(y.x=n),a!==void 0&&(y.y=a),o!==void 0&&(y.scale=o),l!==void 0&&RM(y,l,u,c,!1)}const Tb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Ab=t=>typeof t=="string"&&t.toLowerCase()==="svg";function zM(t,n,a,o){Sb(t,n,void 0,o);for(const l in n.attrs)t.setAttribute(Tb.has(l)?l:om(l),n.attrs[l])}function Nb(t,n,a){const o=hm(t,n,a);for(const l in t)if(we(t[l])||we(n[l])){const u=ks.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;o[u]=t[l]}return o}class OM extends gb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fe}getBaseTargetFromProps(n,a){return n[a]}readValueFromInstance(n,a){if(Us.has(a)){const o=ob(a);return o&&o.default||0}return a=Tb.has(a)?a:om(a),n.getAttribute(a)}scrapeMotionValuesFromProps(n,a,o){return Nb(n,a,o)}build(n,a,o){Eb(n,a,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(n,a,o,l){zM(n,a,o,l)}mount(n){this.isSVGTag=Ab(n.tagName),super.mount(n)}}const VM=fm.length;function Mb(t){if(!t)return;if(!t.isControllingVariants){const a=t.parent?Mb(t.parent)||{}:{};return t.props.initial!==void 0&&(a.initial=t.props.initial),a}const n={};for(let a=0;a<VM;a++){const o=fm[a],l=t.props[o];(er(l)||l===!1)&&(n[o]=l)}return n}function _b(t,n){if(!Array.isArray(n))return!1;const a=n.length;if(a!==t.length)return!1;for(let o=0;o<a;o++)if(n[o]!==t[o])return!1;return!0}const LM=[...cm].reverse(),HM=cm.length;function BM(t){return n=>Promise.all(n.map(({animation:a,options:o})=>GN(t,a,o)))}function kM(t){let n=BM(t),a=lv(),o=!0;const l=p=>(h,g)=>{const y=Ns(t,g,p==="exit"?t.presenceContext?.custom:void 0);if(y){const{transition:v,transitionEnd:x,...S}=y;h={...h,...S,...x}}return h};function u(p){n=p(t)}function c(p){const{props:h}=t,g=Mb(t.parent)||{},y=[],v=new Set;let x={},S=1/0;for(let A=0;A<HM;A++){const E=LM[A],_=a[E],N=h[E]!==void 0?h[E]:g[E],M=er(N),z=E===p?_.isActive:null;z===!1&&(S=A);let V=N===g[E]&&N!==h[E]&&M;if(V&&o&&t.manuallyAnimateOnMount&&(V=!1),_.protectedKeys={...x},!_.isActive&&z===null||!N&&!_.prevProp||Bu(N)||typeof N=="boolean")continue;const O=UM(_.prevProp,N);let k=O||E===p&&_.isActive&&!V&&M||A>S&&M,X=!1;const st=Array.isArray(N)?N:[N];let P=st.reduce(l(E),{});z===!1&&(P={});const{prevResolvedValues:F={}}=_,it={...F,...P},L=H=>{k=!0,v.has(H)&&(X=!0,v.delete(H)),_.needsAnimating[H]=!0;const U=t.getValue(H);U&&(U.liveStyle=!1)};for(const H in it){const U=P[H],Z=F[H];if(x.hasOwnProperty(H))continue;let tt=!1;dh(U)&&dh(Z)?tt=!_b(U,Z):tt=U!==Z,tt?U!=null?L(H):v.add(H):U!==void 0&&v.has(H)?L(H):_.protectedKeys[H]=!0}_.prevProp=N,_.prevResolvedValues=P,_.isActive&&(x={...x,...P}),o&&t.blockInitialAnimation&&(k=!1);const $=V&&O;k&&(!$||X)&&y.push(...st.map(H=>{const U={type:E};if(typeof H=="string"&&o&&!$&&t.manuallyAnimateOnMount&&t.parent){const{parent:Z}=t,tt=Ns(Z,H);if(Z.enteringChildren&&tt){const{delayChildren:j}=tt.transition||{};U.delay=J1(Z.enteringChildren,t,j)}}return{animation:H,options:U}}))}if(v.size){const A={};if(typeof h.initial!="boolean"){const E=Ns(t,Array.isArray(h.initial)?h.initial[0]:h.initial);E&&E.transition&&(A.transition=E.transition)}v.forEach(E=>{const _=t.getBaseTarget(E),N=t.getValue(E);N&&(N.liveStyle=!0),A[E]=_??null}),y.push({animation:A})}let T=!!y.length;return o&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(T=!1),o=!1,T?n(y):Promise.resolve()}function d(p,h){if(a[p].isActive===h)return Promise.resolve();t.variantChildren?.forEach(y=>y.animationState?.setActive(p,h)),a[p].isActive=h;const g=c(p);for(const y in a)a[y].protectedKeys={};return g}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>a,reset:()=>{a=lv()}}}function UM(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!_b(n,t):!1}function ga(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lv(){return{animate:ga(!0),whileInView:ga(),whileHover:ga(),whileTap:ga(),whileDrag:ga(),whileFocus:ga(),exit:ga()}}function uv(t,n){t.min=n.min,t.max=n.max}function hn(t,n){uv(t.x,n.x),uv(t.y,n.y)}function cv(t,n){t.translate=n.translate,t.scale=n.scale,t.originPoint=n.originPoint,t.origin=n.origin}const Cb=1e-4,YM=1-Cb,qM=1+Cb,Db=.01,XM=0-Db,GM=0+Db;function _e(t){return t.max-t.min}function $M(t,n,a){return Math.abs(t-n)<=a}function fv(t,n,a,o=.5){t.origin=o,t.originPoint=Qt(n.min,n.max,t.origin),t.scale=_e(a)/_e(n),t.translate=Qt(a.min,a.max,t.origin)-t.originPoint,(t.scale>=YM&&t.scale<=qM||isNaN(t.scale))&&(t.scale=1),(t.translate>=XM&&t.translate<=GM||isNaN(t.translate))&&(t.translate=0)}function Zo(t,n,a,o){fv(t.x,n.x,a.x,o?o.originX:void 0),fv(t.y,n.y,a.y,o?o.originY:void 0)}function dv(t,n,a){t.min=a.min+n.min,t.max=t.min+_e(n)}function ZM(t,n,a){dv(t.x,n.x,a.x),dv(t.y,n.y,a.y)}function hv(t,n,a){t.min=n.min-a.min,t.max=t.min+_e(n)}function Tu(t,n,a){hv(t.x,n.x,a.x),hv(t.y,n.y,a.y)}function mv(t,n,a,o,l){return t-=n,t=Eu(t,1/a,o),l!==void 0&&(t=Eu(t,1/l,o)),t}function PM(t,n=0,a=1,o=.5,l,u=t,c=t){if(Mn.test(n)&&(n=parseFloat(n),n=Qt(c.min,c.max,n/100)-c.min),typeof n!="number")return;let d=Qt(u.min,u.max,o);t===u&&(d-=n),t.min=mv(t.min,n,a,d,l),t.max=mv(t.max,n,a,d,l)}function pv(t,n,[a,o,l],u,c){PM(t,n[a],n[o],n[l],n.scale,u,c)}const IM=["x","scaleX","originX"],KM=["y","scaleY","originY"];function gv(t,n,a,o){pv(t.x,n,IM,a?a.x:void 0,o?o.x:void 0),pv(t.y,n,KM,a?a.y:void 0,o?o.y:void 0)}function yv(t){return t.translate===0&&t.scale===1}function Rb(t){return yv(t.x)&&yv(t.y)}function vv(t,n){return t.min===n.min&&t.max===n.max}function QM(t,n){return vv(t.x,n.x)&&vv(t.y,n.y)}function xv(t,n){return Math.round(t.min)===Math.round(n.min)&&Math.round(t.max)===Math.round(n.max)}function jb(t,n){return xv(t.x,n.x)&&xv(t.y,n.y)}function bv(t){return _e(t.x)/_e(t.y)}function Sv(t,n){return t.translate===n.translate&&t.scale===n.scale&&t.originPoint===n.originPoint}function an(t){return[t("x"),t("y")]}function FM(t,n,a){let o="";const l=t.x.translate/n.x,u=t.y.translate/n.y,c=a?.z||0;if((l||u||c)&&(o=`translate3d(${l}px, ${u}px, ${c}px) `),(n.x!==1||n.y!==1)&&(o+=`scale(${1/n.x}, ${1/n.y}) `),a){const{transformPerspective:h,rotate:g,rotateX:y,rotateY:v,skewX:x,skewY:S}=a;h&&(o=`perspective(${h}px) ${o}`),g&&(o+=`rotate(${g}deg) `),y&&(o+=`rotateX(${y}deg) `),v&&(o+=`rotateY(${v}deg) `),x&&(o+=`skewX(${x}deg) `),S&&(o+=`skewY(${S}deg) `)}const d=t.x.scale*n.x,p=t.y.scale*n.y;return(d!==1||p!==1)&&(o+=`scale(${d}, ${p})`),o||"none"}const zb=["TopLeft","TopRight","BottomLeft","BottomRight"],JM=zb.length,wv=t=>typeof t=="string"?parseFloat(t):t,Ev=t=>typeof t=="number"||ht.test(t);function WM(t,n,a,o,l,u){l?(t.opacity=Qt(0,a.opacity??1,t_(o)),t.opacityExit=Qt(n.opacity??1,0,e_(o))):u&&(t.opacity=Qt(n.opacity??1,a.opacity??1,o));for(let c=0;c<JM;c++){const d=`border${zb[c]}Radius`;let p=Tv(n,d),h=Tv(a,d);if(p===void 0&&h===void 0)continue;p||(p=0),h||(h=0),p===0||h===0||Ev(p)===Ev(h)?(t[d]=Math.max(Qt(wv(p),wv(h),o),0),(Mn.test(h)||Mn.test(p))&&(t[d]+="%")):t[d]=h}(n.rotate||a.rotate)&&(t.rotate=Qt(n.rotate||0,a.rotate||0,o))}function Tv(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const t_=Ob(0,.5,C1),e_=Ob(.5,.95,on);function Ob(t,n,a){return o=>o<t?0:o>n?1:a(Jo(t,n,o))}function n_(t,n,a){const o=we(t)?t:Cs(t);return o.start(am("",o,n,a)),o.animation}function nr(t,n,a,o={passive:!0}){return t.addEventListener(n,a,o),()=>t.removeEventListener(n,a)}const i_=(t,n)=>t.depth-n.depth;class a_{constructor(){this.children=[],this.isDirty=!1}add(n){Yh(this.children,n),this.isDirty=!0}remove(n){qh(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(i_),this.isDirty=!1,this.children.forEach(n)}}function s_(t,n){const a=Me.now(),o=({timestamp:l})=>{const u=l-a;u>=n&&(qi(o),t(u-n))};return Xt.setup(o,!0),()=>qi(o)}function fu(t){return we(t)?t.get():t}class o_{constructor(){this.members=[]}add(n){Yh(this.members,n),n.scheduleRender()}remove(n){if(qh(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(n){const a=this.members.findIndex(l=>n===l);if(a===0)return!1;let o;for(let l=a;l>=0;l--){const u=this.members[l];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(n,a){const o=this.lead;if(n!==o&&(this.prevLead=o,this.lead=n,n.show(),o)){o.instance&&o.scheduleRender(),n.scheduleRender();const l=o.options.layoutDependency,u=n.options.layoutDependency;l!==void 0&&u!==void 0&&l===u||(n.resumeFrom=o,a&&(n.resumeFrom.preserveOpacity=!0),o.snapshot&&(n.snapshot=o.snapshot,n.snapshot.latestValues=o.animationValues||o.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0));const{crossfade:d}=n.options;d===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:a,resumingFrom:o}=n;a.onExitComplete&&a.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const du={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Cd=["","X","Y","Z"],r_=1e3;let l_=0;function Dd(t,n,a,o){const{latestValues:l}=n;l[t]&&(a[t]=l[t],n.setStaticValue(t,0),o&&(o[t]=0))}function Vb(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:n}=t.options;if(!n)return;const a=nb(n);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:l,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(a,"transform",Xt,!(l||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&Vb(o)}function Lb({attachResizeListener:t,defaultParent:n,measureScroll:a,checkIsScrollRoot:o,resetTransform:l}){return class{constructor(c={},d=n?.()){this.id=l_++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(f_),this.nodes.forEach(p_),this.nodes.forEach(g_),this.nodes.forEach(d_)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new a_)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new $h),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const p=this.eventHandlers.get(c);p&&p.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=db(c)&&!cM(c),this.instance=c;const{layoutId:d,layout:p,visualElement:h}=this.options;if(h&&!h.current&&h.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(p||d)&&(this.isLayoutDirty=!0),t){let g,y=0;const v=()=>this.root.updateBlockedByResize=!1;Xt.read(()=>{y=window.innerWidth}),t(c,()=>{const x=window.innerWidth;x!==y&&(y=x,this.root.updateBlockedByResize=!0,g&&g(),g=s_(v,250),du.hasAnimatedSinceResize&&(du.hasAnimatedSinceResize=!1,this.nodes.forEach(Mv)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||p)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||S_,{onLayoutAnimationStart:T,onLayoutAnimationComplete:A}=h.getProps(),E=!this.targetLayout||!jb(this.targetLayout,x),_=!y&&v;if(this.options.layoutRoot||this.resumeFrom||_||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...im(S,"layout"),onPlay:T,onComplete:A};(h.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(g,_)}else y||Mv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(y_),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:d,layout:p}=this.options;if(d===void 0&&!p)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Av);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Nv);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(m_),this.nodes.forEach(u_),this.nodes.forEach(c_)):this.nodes.forEach(Nv),this.clearAllSnapshots();const d=Me.now();xe.delta=Cn(0,1e3/60,d-xe.timestamp),xe.timestamp=d,xe.isProcessing=!0,Sd.update.process(xe),Sd.preRender.process(xe),Sd.render.process(xe),xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(h_),this.sharedNodes.forEach(v_)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Xt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Xt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_e(this.snapshot.measuredBox.x)&&!_e(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p<this.path.length;p++)this.path[p].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=fe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const p=o(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:p,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!l)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Rb(this.projectionDelta),p=this.getTransformTemplate(),h=p?p(this.latestValues,""):void 0,g=h!==this.prevTransformTemplateValue;c&&this.instance&&(d||ya(this.latestValues)||g)&&(l(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let p=this.removeElementScroll(d);return c&&(p=this.removeTransform(p)),w_(p),{animationId:this.root.animationId,measuredBox:d,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return fe();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(E_))){const{scroll:h}=this.root;h&&(bs(d.x,h.offset.x),bs(d.y,h.offset.y))}return d}removeElementScroll(c){const d=fe();if(hn(d,c),this.scroll?.wasRoot)return d;for(let p=0;p<this.path.length;p++){const h=this.path[p],{scroll:g,options:y}=h;h!==this.root&&g&&y.layoutScroll&&(g.wasRoot&&hn(d,c),bs(d.x,g.offset.x),bs(d.y,g.offset.y))}return d}applyTransform(c,d=!1){const p=fe();hn(p,c);for(let h=0;h<this.path.length;h++){const g=this.path[h];!d&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ss(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),ya(g.latestValues)&&Ss(p,g.latestValues)}return ya(this.latestValues)&&Ss(p,this.latestValues),p}removeTransform(c){const d=fe();hn(d,c);for(let p=0;p<this.path.length;p++){const h=this.path[p];if(!h.instance||!ya(h.latestValues))continue;vh(h.latestValues)&&h.updateSnapshot();const g=fe(),y=h.measurePageBox();hn(g,y),gv(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,g)}return ya(this.latestValues)&&gv(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==d;if(!(c||p&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:y}=this.options;if(!this.layout||!(g||y))return;this.resolvedRelativeTargetAt=xe.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fe(),this.targetWithTransforms=fe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):hn(this.target,this.layout.layoutBox),xb(this.target,this.targetDelta)):hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||vh(this.parent.latestValues)||vb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,d,p){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fe(),this.relativeTargetOrigin=fe(),Tu(this.relativeTargetOrigin,d,p),hn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let p=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(p=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===xe.timestamp&&(p=!1),p)return;const{layout:h,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||g))return;hn(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,v=this.treeScale.y;SM(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=fe());const{target:x}=c;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cv(this.prevProjectionDelta.x,this.projectionDelta.x),cv(this.prevProjectionDelta.y,this.projectionDelta.y)),Zo(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==v||!Sv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Sv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xs(),this.projectionDelta=xs(),this.projectionDeltaWithTransform=xs()}setAnimationOrigin(c,d=!1){const p=this.snapshot,h=p?p.latestValues:{},g={...this.latestValues},y=xs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=fe(),x=p?p.source:void 0,S=this.layout?this.layout.source:void 0,T=x!==S,A=this.getStack(),E=!A||A.members.length<=1,_=!!(T&&!E&&this.options.crossfade===!0&&!this.path.some(b_));this.animationProgress=0;let N;this.mixTargetDelta=M=>{const z=M/1e3;_v(y.x,c.x,z),_v(y.y,c.y,z),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tu(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),x_(this.relativeTarget,this.relativeTargetOrigin,v,z),N&&QM(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=fe()),hn(N,this.relativeTarget)),T&&(this.animationValues=g,WM(g,h,this.latestValues,z,_,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xt.update(()=>{du.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Cs(0)),this.currentAnimation=n_(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(r_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:p,layout:h,latestValues:g}=c;if(!(!d||!p||!h)){if(this!==c&&this.layout&&h&&Hb(this.options.animationType,this.layout.layoutBox,h.layoutBox)){p=this.target||fe();const y=_e(this.layout.layoutBox.x);p.x.min=c.target.x.min,p.x.max=p.x.min+y;const v=_e(this.layout.layoutBox.y);p.y.min=c.target.y.min,p.y.max=p.y.min+v}hn(d,p),Ss(d,g),Zo(this.projectionDeltaWithTransform,this.layoutCorrected,d,g)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new o_),this.sharedNodes.get(c).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:p}={}){const h=this.getStack();h&&h.promote(this,p),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:p}=c;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(d=!0),!d)return;const h={};p.z&&Dd("z",c,h,this.animationValues);for(let g=0;g<Cd.length;g++)Dd(`rotate${Cd[g]}`,c,h,this.animationValues),Dd(`skew${Cd[g]}`,c,h,this.animationValues);c.render();for(const g in h)c.setStaticValue(g,h[g]),this.animationValues&&(this.animationValues[g]=h[g]);c.scheduleRender()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const p=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=fu(d?.pointerEvents)||"",c.transform=p?p(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=fu(d?.pointerEvents)||""),this.hasProjected&&!ya(this.latestValues)&&(c.transform=p?p({},""):"none",this.hasProjected=!1);return}c.visibility="";const g=h.animationValues||h.latestValues;this.applyTransformsToTarget();let y=FM(this.projectionDeltaWithTransform,this.treeScale,g);p&&(y=p(g,y)),c.transform=y;const{x:v,y:x}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${x.origin*100}% 0`,h.animationValues?c.opacity=h===this?g.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:c.opacity=h===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const S in bh){if(g[S]===void 0)continue;const{correct:T,applyTo:A,isCSSVariable:E}=bh[S],_=y==="none"?g[S]:T(g[S],h);if(A){const N=A.length;for(let M=0;M<N;M++)c[A[M]]=_}else E?this.options.visualElement.renderState.vars[S]=_:c[S]=_}this.options.layoutId&&(c.pointerEvents=h===this?fu(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Av),this.root.sharedNodes.clear()}}}function u_(t){t.updateLayout()}function c_(t){const n=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:o}=t.layout,{animationType:l}=t.options,u=n.source!==t.layout.source;l==="size"?an(g=>{const y=u?n.measuredBox[g]:n.layoutBox[g],v=_e(y);y.min=a[g].min,y.max=y.min+v}):Hb(l,n.layoutBox,a)&&an(g=>{const y=u?n.measuredBox[g]:n.layoutBox[g],v=_e(a[g]);y.max=y.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[g].max=t.relativeTarget[g].min+v)});const c=xs();Zo(c,a,n.layoutBox);const d=xs();u?Zo(d,t.applyTransform(o,!0),n.measuredBox):Zo(d,a,n.layoutBox);const p=!Rb(c);let h=!1;if(!t.resumeFrom){const g=t.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:v}=g;if(y&&v){const x=fe();Tu(x,n.layoutBox,y.layoutBox);const S=fe();Tu(S,a,v.layoutBox),jb(x,S)||(h=!0),g.options.layoutRoot&&(t.relativeTarget=S,t.relativeTargetOrigin=x,t.relativeParent=g)}}}t.notifyListeners("didUpdate",{layout:a,snapshot:n,delta:d,layoutDelta:c,hasLayoutChanged:p,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:a}=t.options;a&&a()}t.options.transition=void 0}function f_(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function d_(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function h_(t){t.clearSnapshot()}function Av(t){t.clearMeasurements()}function Nv(t){t.isLayoutDirty=!1}function m_(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function Mv(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function p_(t){t.resolveTargetDelta()}function g_(t){t.calcProjection()}function y_(t){t.resetSkewAndRotation()}function v_(t){t.removeLeadSnapshot()}function _v(t,n,a){t.translate=Qt(n.translate,0,a),t.scale=Qt(n.scale,1,a),t.origin=n.origin,t.originPoint=n.originPoint}function Cv(t,n,a,o){t.min=Qt(n.min,a.min,o),t.max=Qt(n.max,a.max,o)}function x_(t,n,a,o){Cv(t.x,n.x,a.x,o),Cv(t.y,n.y,a.y,o)}function b_(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const S_={duration:.45,ease:[.4,0,.1,1]},Dv=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Rv=Dv("applewebkit/")&&!Dv("chrome/")?Math.round:on;function jv(t){t.min=Rv(t.min),t.max=Rv(t.max)}function w_(t){jv(t.x),jv(t.y)}function Hb(t,n,a){return t==="position"||t==="preserve-aspect"&&!$M(bv(n),bv(a),.2)}function E_(t){return t!==t.root&&t.scroll?.wasRoot}const T_=Lb({attachResizeListener:(t,n)=>nr(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Rd={current:void 0},Bb=Lb({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Rd.current){const t=new T_({});t.mount(window),t.setOptions({layoutScroll:!0}),Rd.current=t}return Rd.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),mm=R.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function zv(t,n){if(typeof t=="function")return t(n);t!=null&&(t.current=n)}function A_(...t){return n=>{let a=!1;const o=t.map(l=>{const u=zv(l,n);return!a&&typeof u=="function"&&(a=!0),u});if(a)return()=>{for(let l=0;l<o.length;l++){const u=o[l];typeof u=="function"?u():zv(t[l],null)}}}}function N_(...t){return R.useCallback(A_(...t),t)}class M_ extends R.Component{getSnapshotBeforeUpdate(n){const a=this.props.childRef.current;if(a&&n.isPresent&&!this.props.isPresent){const o=a.offsetParent,l=gh(o)&&o.offsetWidth||0,u=gh(o)&&o.offsetHeight||0,c=this.props.sizeRef.current;c.height=a.offsetHeight||0,c.width=a.offsetWidth||0,c.top=a.offsetTop,c.left=a.offsetLeft,c.right=l-c.width-c.left,c.bottom=u-c.height-c.top}return null}componentDidUpdate(){}render(){return this.props.children}}function __({children:t,isPresent:n,anchorX:a,anchorY:o,root:l}){const u=R.useId(),c=R.useRef(null),d=R.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:p}=R.useContext(mm),h=t.props?.ref??t?.ref,g=N_(c,h);return R.useInsertionEffect(()=>{const{width:y,height:v,top:x,left:S,right:T,bottom:A}=d.current;if(n||!c.current||!y||!v)return;const E=a==="left"?`left: ${S}`:`right: ${T}`,_=o==="bottom"?`bottom: ${A}`:`top: ${x}`;c.current.dataset.motionPopId=u;const N=document.createElement("style");p&&(N.nonce=p);const M=l??document.head;return M.appendChild(N),N.sheet&&N.sheet.insertRule(`
10
+ [data-motion-pop-id="${u}"] {
11
+ position: absolute !important;
12
+ width: ${y}px !important;
13
+ height: ${v}px !important;
14
+ ${E}px !important;
15
+ ${_}px !important;
16
+ }
17
+ `),()=>{M.contains(N)&&M.removeChild(N)}},[n]),w.jsx(M_,{isPresent:n,childRef:c,sizeRef:d,children:R.cloneElement(t,{ref:g})})}const C_=({children:t,initial:n,isPresent:a,onExitComplete:o,custom:l,presenceAffectsLayout:u,mode:c,anchorX:d,anchorY:p,root:h})=>{const g=Uh(D_),y=R.useId();let v=!0,x=R.useMemo(()=>(v=!1,{id:y,initial:n,isPresent:a,custom:l,onExitComplete:S=>{g.set(S,!0);for(const T of g.values())if(!T)return;o&&o()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[a,g,o]);return u&&v&&(x={...x}),R.useMemo(()=>{g.forEach((S,T)=>g.set(T,!1))},[a]),R.useEffect(()=>{!a&&!g.size&&o&&o()},[a]),c==="popLayout"&&(t=w.jsx(__,{isPresent:a,anchorX:d,anchorY:p,root:h,children:t})),w.jsx(Hu.Provider,{value:x,children:t})};function D_(){return new Map}function kb(t=!0){const n=R.useContext(Hu);if(n===null)return[!0,null];const{isPresent:a,onExitComplete:o,register:l}=n,u=R.useId();R.useEffect(()=>{if(t)return l(u)},[t]);const c=R.useCallback(()=>t&&o&&o(u),[u,o,t]);return!a&&o?[!1,c]:[!0]}const Jl=t=>t.key||"";function Ov(t){const n=[];return R.Children.forEach(t,a=>{R.isValidElement(a)&&n.push(a)}),n}const R_=({children:t,custom:n,initial:a=!0,onExitComplete:o,presenceAffectsLayout:l=!0,mode:u="sync",propagate:c=!1,anchorX:d="left",anchorY:p="top",root:h})=>{const[g,y]=kb(c),v=R.useMemo(()=>Ov(t),[t]),x=c&&!g?[]:v.map(Jl),S=R.useRef(!0),T=R.useRef(v),A=Uh(()=>new Map),E=R.useRef(new Set),[_,N]=R.useState(v),[M,z]=R.useState(v);v1(()=>{S.current=!1,T.current=v;for(let k=0;k<M.length;k++){const X=Jl(M[k]);x.includes(X)?(A.delete(X),E.current.delete(X)):A.get(X)!==!0&&A.set(X,!1)}},[M,x.length,x.join("-")]);const V=[];if(v!==_){let k=[...v];for(let X=0;X<M.length;X++){const st=M[X],P=Jl(st);x.includes(P)||(k.splice(X,0,st),V.push(st))}return u==="wait"&&V.length&&(k=V),z(Ov(k)),N(v),null}const{forceRender:O}=R.useContext(kh);return w.jsx(w.Fragment,{children:M.map(k=>{const X=Jl(k),st=c&&!g?!1:v===M||x.includes(X),P=()=>{if(E.current.has(X))return;if(E.current.add(X),A.has(X))A.set(X,!0);else return;let F=!0;A.forEach(it=>{it||(F=!1)}),F&&(O?.(),z(T.current),c&&y?.(),o&&o())};return w.jsx(C_,{isPresent:st,initial:!S.current||a?void 0:!1,custom:n,presenceAffectsLayout:l,mode:u,root:h,onExitComplete:st?void 0:P,anchorX:d,anchorY:p,children:k},X)})})},Ub=R.createContext({strict:!1}),Vv={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Lv=!1;function j_(){if(Lv)return;const t={};for(const n in Vv)t[n]={isEnabled:a=>Vv[n].some(o=>!!a[o])};pb(t),Lv=!0}function Yb(){return j_(),yM()}function z_(t){const n=Yb();for(const a in t)n[a]={...n[a],...t[a]};pb(n)}const O_=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Au(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||O_.has(t)}let qb=t=>!Au(t);function V_(t){typeof t=="function"&&(qb=n=>n.startsWith("on")?!Au(n):t(n))}try{V_(require("@emotion/is-prop-valid").default)}catch{}function L_(t,n,a){const o={};for(const l in t)l==="values"&&typeof t.values=="object"||(qb(l)||a===!0&&Au(l)||!n&&!Au(l)||t.draggable&&l.startsWith("onDrag"))&&(o[l]=t[l]);return o}const Uu=R.createContext({});function H_(t,n){if(ku(t)){const{initial:a,animate:o}=t;return{initial:a===!1||er(a)?a:void 0,animate:er(o)?o:void 0}}return t.inherit!==!1?n:{}}function B_(t){const{initial:n,animate:a}=H_(t,R.useContext(Uu));return R.useMemo(()=>({initial:n,animate:a}),[Hv(n),Hv(a)])}function Hv(t){return Array.isArray(t)?t.join(" "):t}const pm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xb(t,n,a){for(const o in n)!we(n[o])&&!wb(o,a)&&(t[o]=n[o])}function k_({transformTemplate:t},n){return R.useMemo(()=>{const a=pm();return dm(a,n,t),Object.assign({},a.vars,a.style)},[n])}function U_(t,n){const a=t.style||{},o={};return Xb(o,a,t),Object.assign(o,k_(t,n)),o}function Y_(t,n){const a={},o=U_(t,n);return t.drag&&t.dragListener!==!1&&(a.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(a.tabIndex=0),a.style=o,a}const Gb=()=>({...pm(),attrs:{}});function q_(t,n,a,o){const l=R.useMemo(()=>{const u=Gb();return Eb(u,n,Ab(o),t.transformTemplate,t.style),{...u.attrs,style:{...u.style}}},[n]);if(t.style){const u={};Xb(u,t.style,t),l.style={...u,...l.style}}return l}const X_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gm(t){return typeof t!="string"||t.includes("-")?!1:!!(X_.indexOf(t)>-1||/[A-Z]/u.test(t))}function G_(t,n,a,{latestValues:o},l,u=!1,c){const p=(c??gm(t)?q_:Y_)(n,o,l,t),h=L_(n,typeof t=="string",u),g=t!==R.Fragment?{...h,...p,ref:a}:{},{children:y}=n,v=R.useMemo(()=>we(y)?y.get():y,[y]);return R.createElement(t,{...g,children:v})}function $_({scrapeMotionValuesFromProps:t,createRenderState:n},a,o,l){return{latestValues:Z_(a,o,l,t),renderState:n()}}function Z_(t,n,a,o){const l={},u=o(t,{});for(const v in u)l[v]=fu(u[v]);let{initial:c,animate:d}=t;const p=ku(t),h=mb(t);n&&h&&!p&&t.inherit!==!1&&(c===void 0&&(c=n.initial),d===void 0&&(d=n.animate));let g=a?a.initial===!1:!1;g=g||c===!1;const y=g?d:c;if(y&&typeof y!="boolean"&&!Bu(y)){const v=Array.isArray(y)?y:[y];for(let x=0;x<v.length;x++){const S=sm(t,v[x]);if(S){const{transitionEnd:T,transition:A,...E}=S;for(const _ in E){let N=E[_];if(Array.isArray(N)){const M=g?N.length-1:0;N=N[M]}N!==null&&(l[_]=N)}for(const _ in T)l[_]=T[_]}}}return l}const $b=t=>(n,a)=>{const o=R.useContext(Uu),l=R.useContext(Hu),u=()=>$_(t,n,o,l);return a?u():Uh(u)},P_=$b({scrapeMotionValuesFromProps:hm,createRenderState:pm}),I_=$b({scrapeMotionValuesFromProps:Nb,createRenderState:Gb}),K_=Symbol.for("motionComponentSymbol");function Q_(t,n,a){const o=R.useRef(a);R.useInsertionEffect(()=>{o.current=a});const l=R.useRef(null);return R.useCallback(u=>{u&&t.onMount?.(u),n&&(u?n.mount(u):n.unmount());const c=o.current;if(typeof c=="function")if(u){const d=c(u);typeof d=="function"&&(l.current=d)}else l.current?(l.current(),l.current=null):c(u);else c&&(c.current=u)},[n])}const Zb=R.createContext({});function Yo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function F_(t,n,a,o,l,u){const{visualElement:c}=R.useContext(Uu),d=R.useContext(Ub),p=R.useContext(Hu),h=R.useContext(mm),g=h.reducedMotion,y=h.skipAnimations,v=R.useRef(null),x=R.useRef(!1);o=o||d.renderer,!v.current&&o&&(v.current=o(t,{visualState:n,parent:c,props:a,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:g,skipAnimations:y,isSVG:u}),x.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const S=v.current,T=R.useContext(Zb);S&&!S.projection&&l&&(S.type==="html"||S.type==="svg")&&J_(v.current,a,l,T);const A=R.useRef(!1);R.useInsertionEffect(()=>{S&&A.current&&S.update(a,p)});const E=a[eb],_=R.useRef(!!E&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return v1(()=>{x.current=!0,S&&(A.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),_.current&&S.animationState&&S.animationState.animateChanges())}),R.useEffect(()=>{S&&(!_.current&&S.animationState&&S.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),_.current=!1),S.enteringChildren=void 0)}),S}function J_(t,n,a,o){const{layoutId:l,layout:u,drag:c,dragConstraints:d,layoutScroll:p,layoutRoot:h,layoutCrossfade:g}=n;t.projection=new a(t.latestValues,n["data-framer-portal-id"]?void 0:Pb(t.parent)),t.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&Yo(d),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,crossfade:g,layoutScroll:p,layoutRoot:h})}function Pb(t){if(t)return t.options.allowProjection!==!1?t.projection:Pb(t.parent)}function jd(t,{forwardMotionProps:n=!1,type:a}={},o,l){o&&z_(o);const u=a?a==="svg":gm(t),c=u?I_:P_;function d(h,g){let y;const v={...R.useContext(mm),...h,layoutId:W_(h)},{isStatic:x}=v,S=B_(h),T=c(h,x);if(!x&&y1){tC();const A=eC(v);y=A.MeasureLayout,S.visualElement=F_(t,T,v,l,A.ProjectionNode,u)}return w.jsxs(Uu.Provider,{value:S,children:[y&&S.visualElement?w.jsx(y,{visualElement:S.visualElement,...v}):null,G_(t,h,Q_(T,S.visualElement,g),T,x,n,u)]})}d.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const p=R.forwardRef(d);return p[K_]=t,p}function W_({layoutId:t}){const n=R.useContext(kh).id;return n&&t!==void 0?n+"-"+t:t}function tC(t,n){R.useContext(Ub).strict}function eC(t){const n=Yb(),{drag:a,layout:o}=n;if(!a&&!o)return{};const l={...a,...o};return{MeasureLayout:a?.isEnabled(t)||o?.isEnabled(t)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}function nC(t,n){if(typeof Proxy>"u")return jd;const a=new Map,o=(u,c)=>jd(u,c,t,n),l=(u,c)=>o(u,c);return new Proxy(l,{get:(u,c)=>c==="create"?o:(a.has(c)||a.set(c,jd(c,void 0,t,n)),a.get(c))})}const iC=(t,n)=>n.isSVG??gm(t)?new OM(n):new _M(n,{allowProjection:t!==R.Fragment});class aC extends Gi{constructor(n){super(n),n.animationState||(n.animationState=kM(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();Bu(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:a}=this.node.prevProps||{};n!==a&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let sC=0;class oC extends Gi{constructor(){super(...arguments),this.id=sC++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:a}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===o)return;const l=this.node.animationState.setActive("exit",!n);a&&!n&&l.then(()=>{a(this.id)})}mount(){const{register:n,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),n&&(this.unmount=n(this.id))}unmount(){}}const rC={animation:{Feature:aC},exit:{Feature:oC}};function yr(t){return{point:{x:t.pageX,y:t.pageY}}}const lC=t=>n=>um(n)&&t(n,yr(n));function Po(t,n,a,o){return nr(t,n,lC(a),o)}const Ib=({current:t})=>t?t.ownerDocument.defaultView:null,Bv=(t,n)=>Math.abs(t-n);function uC(t,n){const a=Bv(t.x,n.x),o=Bv(t.y,n.y);return Math.sqrt(a**2+o**2)}const kv=new Set(["auto","scroll"]);class Kb{constructor(n,a,{transformPagePoint:o,contextWindow:l=window,dragSnapToOrigin:u=!1,distanceThreshold:c=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Od(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,T=uC(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!T)return;const{point:A}=x,{timestamp:E}=xe;this.history.push({...A,timestamp:E});const{onStart:_,onMove:N}=this.handlers;S||(_&&_(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,x)},this.handlePointerMove=(x,S)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=zd(S,this.transformPagePoint),Xt.update(this.updatePoint,!0)},this.handlePointerUp=(x,S)=>{this.end();const{onEnd:T,onSessionEnd:A,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Od(x.type==="pointercancel"?this.lastMoveEventInfo:zd(S,this.transformPagePoint),this.history);this.startEvent&&T&&T(x,_),A&&A(x,_)},!um(n))return;this.dragSnapToOrigin=u,this.handlers=a,this.transformPagePoint=o,this.distanceThreshold=c,this.contextWindow=l||window;const p=yr(n),h=zd(p,this.transformPagePoint),{point:g}=h,{timestamp:y}=xe;this.history=[{...g,timestamp:y}];const{onSessionStart:v}=a;v&&v(n,Od(h,this.history)),this.removeListeners=mr(Po(this.contextWindow,"pointermove",this.handlePointerMove),Po(this.contextWindow,"pointerup",this.handlePointerUp),Po(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(n){let a=n.parentElement;for(;a;){const o=getComputedStyle(a);(kv.has(o.overflowX)||kv.has(o.overflowY))&&this.scrollPositions.set(a,{x:a.scrollLeft,y:a.scrollTop}),a=a.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(n){const a=this.scrollPositions.get(n);if(!a)return;const o=n===window,l=o?{x:window.scrollX,y:window.scrollY}:{x:n.scrollLeft,y:n.scrollTop},u={x:l.x-a.x,y:l.y-a.y};u.x===0&&u.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=u.x,this.lastMoveEventInfo.point.y+=u.y):this.history.length>0&&(this.history[0].x-=u.x,this.history[0].y-=u.y),this.scrollPositions.set(n,l),Xt.update(this.updatePoint,!0))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qi(this.updatePoint)}}function zd(t,n){return n?{point:n(t.point)}:t}function Uv(t,n){return{x:t.x-n.x,y:t.y-n.y}}function Od({point:t},n){return{point:t,delta:Uv(t,Qb(n)),offset:Uv(t,cC(n)),velocity:fC(n,.1)}}function cC(t){return t[0]}function Qb(t){return t[t.length-1]}function fC(t,n){if(t.length<2)return{x:0,y:0};let a=t.length-1,o=null;const l=Qb(t);for(;a>=0&&(o=t[a],!(l.timestamp-o.timestamp>ii(n)));)a--;if(!o)return{x:0,y:0};const u=sn(l.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const c={x:(l.x-o.x)/u,y:(l.y-o.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function dC(t,{min:n,max:a},o){return n!==void 0&&t<n?t=o?Qt(n,t,o.min):Math.max(t,n):a!==void 0&&t>a&&(t=o?Qt(a,t,o.max):Math.min(t,a)),t}function Yv(t,n,a){return{min:n!==void 0?t.min+n:void 0,max:a!==void 0?t.max+a-(t.max-t.min):void 0}}function hC(t,{top:n,left:a,bottom:o,right:l}){return{x:Yv(t.x,a,l),y:Yv(t.y,n,o)}}function qv(t,n){let a=n.min-t.min,o=n.max-t.max;return n.max-n.min<t.max-t.min&&([a,o]=[o,a]),{min:a,max:o}}function mC(t,n){return{x:qv(t.x,n.x),y:qv(t.y,n.y)}}function pC(t,n){let a=.5;const o=_e(t),l=_e(n);return l>o?a=Jo(n.min,n.max-o,t.min):o>l&&(a=Jo(t.min,t.max-l,n.min)),Cn(0,1,a)}function gC(t,n){const a={};return n.min!==void 0&&(a.min=n.min-t.min),n.max!==void 0&&(a.max=n.max-t.min),a}const Sh=.35;function yC(t=Sh){return t===!1?t=0:t===!0&&(t=Sh),{x:Xv(t,"left","right"),y:Xv(t,"top","bottom")}}function Xv(t,n,a){return{min:Gv(t,n),max:Gv(t,a)}}function Gv(t,n){return typeof t=="number"?t:t[n]||0}const vC=new WeakMap;class xC{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=n}start(n,{snapToCursor:a=!1,distanceThreshold:o}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const u=y=>{a?(this.stopAnimation(),this.snapToCursor(yr(y).point)):this.pauseAnimation()},c=(y,v)=>{this.stopAnimation();const{drag:x,dragPropagation:S,onDragStart:T}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=nM(x),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),an(E=>{let _=this.getAxisMotionValue(E).get()||0;if(Mn.test(_)){const{projection:N}=this.visualElement;if(N&&N.layout){const M=N.layout.layoutBox[E];M&&(_=_e(M)*(parseFloat(_)/100))}}this.originPoint[E]=_}),T&&Xt.update(()=>T(y,v),!1,!0),hh(this.visualElement,"transform");const{animationState:A}=this.visualElement;A&&A.setActive("whileDrag",!0)},d=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:T,onDrag:A}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:E}=v;if(S&&this.currentDirection===null){this.currentDirection=bC(E),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),A&&Xt.update(()=>A(y,v),!1,!0)},p=(y,v)=>{this.latestPointerEvent=y,this.latestPanInfo=v,this.stop(y,v),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>an(y=>this.getAnimationState(y)==="paused"&&this.getAxisMotionValue(y).animation?.play()),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Kb(n,{onSessionStart:u,onStart:c,onMove:d,onSessionEnd:p,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:o,contextWindow:Ib(this.visualElement),element:this.visualElement.current})}stop(n,a){const o=n||this.latestPointerEvent,l=a||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!l||!o)return;const{velocity:c}=l;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Xt.postRender(()=>d(o,l))}cancel(){this.isDragging=!1;const{projection:n,animationState:a}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(n,a,o){const{drag:l}=this.getProps();if(!o||!Wl(n,l,this.currentDirection))return;const u=this.getAxisMotionValue(n);let c=this.originPoint[n]+o[n];this.constraints&&this.constraints[n]&&(c=dC(c,this.constraints[n],this.elastic[n])),u.set(c)}resolveConstraints(){const{dragConstraints:n,dragElastic:a}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,l=this.constraints;n&&Yo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=hC(o.layoutBox,n):this.constraints=!1,this.elastic=yC(a),l!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&an(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=gC(o.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:a}=this.getProps();if(!n||!Yo(n))return!1;const o=n.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const u=wM(o,l.root,this.visualElement.getTransformPagePoint());let c=mC(l.layout.layoutBox,u);if(a){const d=a(xM(c));this.hasMutatedConstraints=!!d,d&&(c=yb(d))}return c}startAnimation(n){const{drag:a,dragMomentum:o,dragElastic:l,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),p=this.constraints||{},h=an(g=>{if(!Wl(g,a,this.currentDirection))return;let y=p&&p[g]||{};c&&(y={min:0,max:0});const v=l?200:1e6,x=l?40:1e7,S={type:"inertia",velocity:o?n[g]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(h).then(d)}startAxisValueAnimation(n,a){const o=this.getAxisMotionValue(n);return hh(this.visualElement,n),o.start(am(n,o,0,a,this.visualElement,!1))}stopAnimation(){an(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){an(n=>this.getAxisMotionValue(n).animation?.pause())}getAnimationState(n){return this.getAxisMotionValue(n).animation?.state}getAxisMotionValue(n){const a=`_drag${n.toUpperCase()}`,o=this.visualElement.getProps(),l=o[a];return l||this.visualElement.getValue(n,(o.initial?o.initial[n]:void 0)||0)}snapToCursor(n){an(a=>{const{drag:o}=this.getProps();if(!Wl(a,o,this.currentDirection))return;const{projection:l}=this.visualElement,u=this.getAxisMotionValue(a);if(l&&l.layout){const{min:c,max:d}=l.layout.layoutBox[a],p=u.get()||0;u.set(n[a]-Qt(c,d,.5)+p)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:a}=this.getProps(),{projection:o}=this.visualElement;if(!Yo(a)||!o||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};an(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const p=d.get();l[c]=pC({min:p,max:p},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),an(c=>{if(!Wl(c,n,null))return;const d=this.getAxisMotionValue(c),{min:p,max:h}=this.constraints[c];d.set(Qt(p,h,l[c]))})}addListeners(){if(!this.visualElement.current)return;vC.set(this.visualElement,this);const n=this.visualElement.current,a=Po(n,"pointerdown",p=>{const{drag:h,dragListener:g=!0}=this.getProps(),y=p.target,v=y!==n&&rM(y);h&&g&&!v&&this.start(p)}),o=()=>{const{dragConstraints:p}=this.getProps();Yo(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:l}=this.visualElement,u=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),Xt.read(o);const c=nr(window,"resize",()=>this.scalePositionWithinConstraints()),d=l.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:h})=>{this.isDragging&&h&&(an(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=p[g].translate,y.set(y.get()+p[g].translate))}),this.visualElement.render())}));return()=>{c(),a(),u(),d&&d()}}getProps(){const n=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:o=!1,dragPropagation:l=!1,dragConstraints:u=!1,dragElastic:c=Sh,dragMomentum:d=!0}=n;return{...n,drag:a,dragDirectionLock:o,dragPropagation:l,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function Wl(t,n,a){return(n===!0||n===t)&&(a===null||a===t)}function bC(t,n=10){let a=null;return Math.abs(t.y)>n?a="y":Math.abs(t.x)>n&&(a="x"),a}class SC extends Gi{constructor(n){super(n),this.removeGroupControls=on,this.removeListeners=on,this.controls=new xC(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||on}update(){const{dragControls:n}=this.node.getProps(),{dragControls:a}=this.node.prevProps||{};n!==a&&(this.removeGroupControls(),n&&(this.removeGroupControls=n.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Vd=t=>(n,a)=>{t&&Xt.update(()=>t(n,a),!1,!0)};class wC extends Gi{constructor(){super(...arguments),this.removePointerDownListener=on}onPointerDown(n){this.session=new Kb(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ib(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:a,onPan:o,onPanEnd:l}=this.node.getProps();return{onSessionStart:Vd(n),onStart:Vd(a),onMove:Vd(o),onEnd:(u,c)=>{delete this.session,l&&Xt.postRender(()=>l(u,c))}}}mount(){this.removePointerDownListener=Po(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ld=!1;class EC extends R.Component{componentDidMount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:o,layoutId:l}=this.props,{projection:u}=n;u&&(a.group&&a.group.add(u),o&&o.register&&l&&o.register(u),Ld&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),du.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:a,visualElement:o,drag:l,isPresent:u}=this.props,{projection:c}=o;return c&&(c.isPresent=u,n.layoutDependency!==a&&c.setOptions({...c.options,layoutDependency:a}),Ld=!0,l||n.layoutDependency!==a||a===void 0||n.isPresent!==u?c.willUpdate():this.safeToRemove(),n.isPresent!==u&&(u?c.promote():c.relegate()||Xt.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),lm.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:o}=this.props,{projection:l}=n;Ld=!0,l&&(l.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(l),o&&o.deregister&&o.deregister(l))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function Fb(t){const[n,a]=kb(),o=R.useContext(kh);return w.jsx(EC,{...t,layoutGroup:o,switchLayoutGroup:R.useContext(Zb),isPresent:n,safeToRemove:a})}const TC={pan:{Feature:wC},drag:{Feature:SC,ProjectionNode:Bb,MeasureLayout:Fb}};function $v(t,n,a){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",a==="Start");const l="onHover"+a,u=o[l];u&&Xt.postRender(()=>u(n,yr(n)))}class AC extends Gi{mount(){const{current:n}=this.node;n&&(this.unmount=iM(n,(a,o)=>($v(this.node,o,"Start"),l=>$v(this.node,l,"End"))))}unmount(){}}class NC extends Gi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=mr(nr(this.node.current,"focus",()=>this.onFocus()),nr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zv(t,n,a){const{props:o}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",a==="Start");const l="onTap"+(a==="End"?"":a),u=o[l];u&&Xt.postRender(()=>u(n,yr(n)))}class MC extends Gi{mount(){const{current:n}=this.node;n&&(this.unmount=uM(n,(a,o)=>(Zv(this.node,o,"Start"),(l,{success:u})=>Zv(this.node,l,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wh=new WeakMap,Hd=new WeakMap,_C=t=>{const n=wh.get(t.target);n&&n(t)},CC=t=>{t.forEach(_C)};function DC({root:t,...n}){const a=t||document;Hd.has(a)||Hd.set(a,{});const o=Hd.get(a),l=JSON.stringify(n);return o[l]||(o[l]=new IntersectionObserver(CC,{root:t,...n})),o[l]}function RC(t,n,a){const o=DC(n);return wh.set(t,a),o.observe(t),()=>{wh.delete(t),o.unobserve(t)}}const jC={some:0,all:1};class zC extends Gi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:a,margin:o,amount:l="some",once:u}=n,c={root:a?a.current:void 0,rootMargin:o,threshold:typeof l=="number"?l:jC[l]},d=p=>{const{isIntersecting:h}=p;if(this.isInView===h||(this.isInView=h,u&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),v=h?g:y;v&&v(p)};return RC(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:a}=this.node;["amount","margin","root"].some(OC(n,a))&&this.startObserver()}unmount(){}}function OC({viewport:t={}},{viewport:n={}}={}){return a=>t[a]!==n[a]}const VC={inView:{Feature:zC},tap:{Feature:MC},focus:{Feature:NC},hover:{Feature:AC}},LC={layout:{ProjectionNode:Bb,MeasureLayout:Fb}},HC={...rC,...VC,...TC,...LC},BC=nC(HC,iC);function ir(t){const n=t?.toLowerCase()||"";return n.includes("sisyphus")?"#3b82f6":n.includes("prometheus")?"#a855f7":n.includes("explore")||n.includes("librarian")?"#22c55e":n.includes("oracle")?"#f59e0b":n.includes("build")?"#06b6d4":"#6b7280"}function kC(t){return(typeof t=="string"?new Date(t):t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Eh(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}k`:t.toString()}function UC(t,n){const a=new Date(t).getTime(),o=new Date(n).getTime(),l=Math.max(0,o-a),u=Math.floor(l/6e4);if(u<1)return"<1m";if(u<60)return`${u}m`;const c=Math.floor(u/60),d=u%60;return d===0?`${c}h`:`${c}h ${d}m`}function Jb(t){const n=t.toLowerCase(),a=n.match(/(opus|sonnet|haiku)-(\d+)(?:-(\d+))?(?:-\d{8})?/);if(a){const[,c,d,p]=a;return p&&p.length<=2?`${c}-${d}.${p}`:`${c}-${d}`}if(n.includes("opus"))return"opus";if(n.includes("sonnet"))return"sonnet";if(n.includes("haiku"))return"haiku";if(n.includes("gpt-5"))return"gpt-5";if(n.includes("gpt-4o"))return"gpt-4o";if(n.includes("gpt-4"))return"gpt-4";if(n.includes("gemini-3"))return"gemini-3";if(n.includes("gemini-2"))return"gemini-2";if(n.includes("gemini"))return"gemini";if(n.includes("codex"))return"codex";if(n.includes("grok")){const c=n.match(/grok[\w-]*/);return(c?c[0]:"grok").replace(/-\d{8}$/,"")}const o=t.split("/"),u=o[o.length-1].replace(/-\d{8}$/,"");return u.length>16?`${u.slice(0,15)}…`:u}const YC=R.memo(function({entries:n}){const[a,o]=R.useState(!1),[l,u]=R.useState(!0),c=R.useRef(null),d=R.useRef(null);d.current===null&&(d.current=new Set(n.map(S=>S.id)));const[p,h]=R.useState(0);R.useEffect(()=>{const S=d.current;let T=0;for(const A of n)S.has(A.id)||(S.add(A.id),T++);S.size>2e3&&(d.current=new Set(n.map(A=>A.id))),T>0&&(h(a?0:A=>A+T),l&&c.current&&requestAnimationFrame(()=>{c.current?.scrollTo({top:c.current.scrollHeight,behavior:"smooth"})}))},[n,a,l]);const g=()=>{if(!c.current)return;const{scrollTop:S,scrollHeight:T,clientHeight:A}=c.current,E=Math.abs(T-S-A)<50;u(E)},y=()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight,u(!0))},v=()=>{const S=!a;o(S),S&&h(0)},x=R.useMemo(()=>{const S=new Set;return n.forEach(T=>{T.type==="agent-spawn"&&S.add(T.spawnedAgentName),S.add(T.agentName)}),S.size},[n]);return w.jsxs("div",{className:"border-t border-border bg-surface flex flex-col shrink-0 overflow-hidden",children:[w.jsxs("button",{type:"button",onClick:v,className:"h-10 px-4 flex items-center justify-between w-full hover:bg-white/[0.02] transition-colors","aria-expanded":a,"aria-label":"Toggle activity stream",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsxs("div",{className:"flex items-center gap-2 text-text-secondary",children:[w.jsx(Jd,{className:"w-4 h-4"}),w.jsx("span",{className:"text-sm font-medium",children:"Activity"})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-white/5 text-xs font-mono text-text-secondary",children:n.length}),p>0&&!a&&w.jsxs("span",{className:"px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-xs font-medium animate-pulse",children:["+",p," new"]})]})]}),w.jsxs("div",{className:"flex items-center gap-4",children:[!a&&n.length>0&&w.jsxs("span",{className:"text-xs text-text-secondary",children:[n.length," events · ",x," agents"]}),a?w.jsx(Fo,{className:"w-4 h-4 text-text-secondary"}):w.jsx(d1,{className:"w-4 h-4 text-text-secondary"})]})]}),w.jsx(R_,{children:a&&w.jsxs("div",{className:"relative h-48 max-h-[30vh]",children:[w.jsx("div",{ref:c,onScroll:g,className:"h-full overflow-y-auto overflow-x-hidden bg-[#0d1117]",role:"log","aria-live":"polite",children:n.length===0?w.jsxs("div",{className:"flex flex-col items-center justify-center text-text-secondary opacity-50 p-8 h-full",children:[w.jsx(Jd,{className:"w-8 h-8 mb-2"}),w.jsx("span",{className:"text-sm",children:"No activity yet"})]}):n.map(S=>w.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 text-sm border-b border-border/30 hover:bg-white/[0.02] transition-colors",children:[w.jsx("span",{className:"font-mono text-xs text-gray-600 w-16 shrink-0",children:kC(S.timestamp)}),S.type==="agent-spawn"?w.jsxs(w.Fragment,{children:[w.jsx(hT,{className:"w-4 h-4 text-accent shrink-0"}),w.jsxs("span",{className:"truncate",children:[w.jsx("span",{className:"text-text-secondary",children:"Spawned "}),w.jsx("span",{style:{color:ir(S.spawnedAgentName)},className:"font-medium",children:S.spawnedAgentName}),w.jsxs("span",{className:"text-gray-600 text-xs ml-2",children:["from ",S.agentName]})]})]}):w.jsxs(w.Fragment,{children:[S.status==="completed"?w.jsx(Bh,{className:"w-4 h-4 text-green-500 shrink-0"}):w.jsx(KT,{className:"w-4 h-4 text-red-500 shrink-0"}),w.jsxs("span",{className:"truncate",children:[w.jsx("span",{style:{color:ir(S.agentName)},className:"font-medium",children:S.agentName}),w.jsx("span",{className:"text-text-secondary ml-2",children:"completed"}),S.durationMs!=null&&w.jsxs("span",{className:"ml-2 text-xs text-gray-600 font-mono",children:[Math.round(S.durationMs/1e3),"s"]})]})]})]},S.id))}),!l&&n.length>0&&w.jsx("button",{type:"button",onClick:y,className:"absolute bottom-4 right-4 p-2 rounded-full bg-accent text-white shadow-lg hover:bg-accent/90 transition-colors z-10",children:w.jsx(Fo,{className:"w-4 h-4"})})]})})]})});function qC(t){if(!t)return"";const n=typeof t=="string"?new Date(t):t;if(isNaN(n.getTime()))return"";const o=Date.now()-n.getTime(),l=Math.floor(o/6e4),u=Math.floor(l/60);if(l<1)return"<1m";if(l<60)return`${l}m`;if(u<24)return`${u}h`;const c=Math.floor(u/24);return c<7?`${c}d`:n.toLocaleDateString()}function Pv(t){const n=new Date(t),o=Math.max(0,Math.floor((new Date().getTime()-n.getTime())/1e3));return o<60?"just now":o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:`${Math.floor(o/86400)}d ago`}function Wb({icon:t,title:n,description:a,action:o}){return w.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center",children:[w.jsx("div",{className:"p-4 bg-surface rounded-full border border-border mb-4",children:w.jsx(t,{className:"w-12 h-12 text-text-secondary"})}),w.jsx("h3",{className:"text-xl font-semibold mb-2",children:n}),w.jsx("p",{className:"text-text-secondary max-w-md mb-6",children:a}),o&&w.jsx("button",{onClick:o.onClick,className:"px-4 py-2 bg-accent text-white rounded-lg hover:bg-accent/90 transition-colors",children:o.label})]})}function XC(t={}){const{interval:n=2e3,enabled:a=!0,apiUrl:o="/api/poll",maxRetries:l=5,projectId:u}=t,c=(()=>{const A=new URLSearchParams;u&&A.set("projectId",u);const E=A.toString();return E?`${o}?${E}`:o})(),[d,p]=R.useState({data:null,loading:!0,error:null,lastUpdate:0,isReconnecting:!1,failedAttempts:0}),h=R.useRef(null),g=R.useRef(null),y=R.useRef(null),v=u??"",x=R.useRef(v),S=R.useRef(0);R.useEffect(()=>{x.current!==v&&(x.current=v,h.current=null,g.current&&(g.current.abort(),g.current=null),y.current&&(clearTimeout(y.current),y.current=null),S.current=0,p(A=>({...A,loading:!0,error:null,failedAttempts:0})))},[v]);const T=R.useCallback(async()=>{const A=x.current;g.current&&g.current.abort();const E=new AbortController;g.current=E;try{const _={};h.current&&(_["If-None-Match"]=h.current);const N=await fetch(c,{headers:_,signal:E.signal});if(x.current!==A)return;if(N.status===304){p(V=>({...V,loading:!1,lastUpdate:Date.now(),isReconnecting:!1,failedAttempts:0})),S.current=0;return}if(!N.ok)throw new Error(`HTTP ${N.status}: ${N.statusText}`);const M=N.headers.get("ETag");M&&(h.current=M);const z=await N.json();if(x.current!==A)return;p({data:z,loading:!1,error:null,lastUpdate:Date.now(),isReconnecting:!1,failedAttempts:0}),S.current=0}catch(_){if(_ instanceof Error&&_.name==="AbortError"||x.current!==A)return;const N=S.current+1;S.current=N;const M=N<l;if(p(z=>({...z,loading:!1,error:_ instanceof Error?_:new Error("Unknown error"),isReconnecting:M,failedAttempts:N})),M){const z=Math.min(1e3*Math.pow(2,N-1),1e4);y.current=setTimeout(()=>{T()},z)}}},[c,l]);return R.useEffect(()=>{if(!a)return;T();const A=setInterval(T,n);return()=>{clearInterval(A),g.current&&g.current.abort(),y.current&&clearTimeout(y.current)}},[a,n,T]),d}function GC(t={}){const{enabled:n=!0,apiUrl:a="/api/sse",pollingInterval:o=2e3,projectId:l}=t,[u,c]=R.useState(!1),[d,p]=R.useState({data:null,loading:!0,error:null,lastUpdate:0,isReconnecting:!1,failedAttempts:0}),h=R.useRef(null),g=R.useRef(null),y=R.useRef(null),v=l??"",x=R.useRef(v),S=R.useRef(Date.now()),T=XC({enabled:n&&u,interval:o,apiUrl:"/api/poll",projectId:l}),A=R.useCallback(async()=>{const E=new URLSearchParams;l&&E.set("projectId",l);const _=E.toString(),N=_?`/api/poll?${_}`:"/api/poll";try{const M=await fetch(N);if(!M.ok)throw new Error(`HTTP ${M.status}`);const z=await M.json();x.current===v&&p(V=>({...V,data:z,loading:!1,lastUpdate:Date.now(),error:null}))}catch(M){console.error("Failed to fetch data:",M)}},[l,v]);return R.useEffect(()=>{x.current!==v&&(x.current=v,p(E=>({...E,loading:!0})))},[v]),R.useEffect(()=>{const E=()=>{document.visibilityState==="visible"&&n&&(p(N=>({...N,isReconnecting:!0})),c(!1))},_=()=>{n&&(p(N=>({...N,isReconnecting:!0})),c(!1))};return document.addEventListener("visibilitychange",E),window.addEventListener("online",_),()=>{document.removeEventListener("visibilitychange",E),window.removeEventListener("online",_)}},[n]),R.useEffect(()=>{if(!n||!u){g.current&&(clearTimeout(g.current),g.current=null);return}const E=Math.min(3e4,2e3*Math.max(1,d.failedAttempts));return g.current=setTimeout(()=>{p(_=>({..._,isReconnecting:!0})),c(!1)},E),()=>{g.current&&(clearTimeout(g.current),g.current=null)}},[n,u,d.failedAttempts]),R.useEffect(()=>{if(!n||u){y.current&&(y.current.close(),y.current=null);return}A();const E=new URLSearchParams;l&&E.set("projectId",l);const _=E.toString(),N=_?`${a}?${_}`:a,M=new EventSource(N);y.current=M;const z=()=>{S.current=Date.now(),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{A()},100)};M.addEventListener("connected",()=>{p(O=>({...O,error:null,isReconnecting:!1,failedAttempts:0}))}),M.addEventListener("session-update",z),M.addEventListener("message-update",z),M.addEventListener("part-update",z),M.addEventListener("plan-update",z),M.addEventListener("heartbeat",()=>{}),M.onerror=()=>{M.close(),y.current=null,p(O=>({...O,error:new Error("SSE Connection Failed"),isReconnecting:!0,failedAttempts:O.failedAttempts+1})),c(!0)};const V=setInterval(()=>{Date.now()-S.current>45e3&&(M.close(),y.current=null,p(k=>({...k,error:new Error("SSE Connection Stale"),isReconnecting:!0,failedAttempts:k.failedAttempts+1})),c(!0))},1e4);return()=>{clearInterval(V),h.current&&clearTimeout(h.current),g.current&&(clearTimeout(g.current),g.current=null),M.close(),y.current===M&&(y.current=null)}},[n,u,a,l,A]),u?T:d}function $C(t,n,a=[]){const[o,l]=R.useState(()=>typeof Notification>"u"?"denied":Notification.permission),u=R.useRef(null),c=R.useRef(new Map),d=R.useRef(n),p=async()=>{if(o!=="default")return o;if(typeof Notification>"u")return"denied";try{const h=await Notification.requestPermission();return l(h),h}catch{try{await new Promise(h=>{Notification.requestPermission(g=>{h(g)})}).then(h=>(l(h),h))}catch{return"denied"}return"denied"}};return R.useEffect(()=>{const h=[...t.map(x=>({id:x.id,activityType:x.activityType,agent:x.agent||null})),...a.map(x=>({id:x.id,activityType:x.activityType,parentID:x.parentID,agent:x.agent||null}))];if(d.current===!0&&n===!1){u.current=h,d.current=n;return}if(d.current=n,u.current===null){u.current=h;return}if(o!=="granted"){u.current=h;return}const g=new Map;for(const x of u.current)g.set(x.id,x);const y=new Map;for(const x of h)y.set(x.id,x);const v=Date.now();for(const[x,S]of y.entries()){const T=g.get(x);if(!T)continue;const A=c.current.get(x);A&&v-A<1e4||S.activityType==="waiting-user"&&T.activityType!=="waiting-user"&&(new Notification("🔔 Input needed",{body:`${S.agent||"Agent"} is waiting for your response`,tag:`ocwatch-waiting-${x}`,requireInteraction:!1}),c.current.set(x,v))}u.current=h},[t,a,n,o]),{permission:o,requestPermission:p,enabled:o==="granted"}}const tS=R.createContext(void 0);function ZC({children:t,apiUrl:n,pollingInterval:a}){const[o,l]=R.useState(null),[u,c]=R.useState([]),[d,p]=R.useState(null),[h,g]=R.useState([]),[y,v]=R.useState(null),[x,S]=R.useState(!1),T=As.useRef(!1),A=As.useCallback(it=>{T.current=!0,p(it)},[]),E=As.useRef(d);R.useEffect(()=>{E.current!==d&&(E.current=d,setTimeout(()=>l(null),0))},[d]);const{data:_,loading:N,error:M,lastUpdate:z,isReconnecting:V}=GC({apiUrl:n,pollingInterval:a,projectId:d});R.useEffect(()=>{if(!o){v(null);return}const it=n||"";let L=!1;const $=y?.session.id!==o;return $&&S(!0),fetch(`${it}/api/sessions/${o}`).then(D=>{if(!D.ok)throw new Error(`HTTP ${D.status}`);return D.json()}).then(D=>{L||v(D)}).catch(D=>{L||(console.warn("Failed to fetch session detail:",D),$&&v(null))}).finally(()=>{L||S(!1)}),()=>{L=!0}},[o,n,z]);const O=y?.activity??[],k=y?.messages??[],X=y?.stats??null,{permission:st,requestPermission:P}=$C(_?.sessions||[],V,O);R.useEffect(()=>{const it=n||"";let L=!1;return(async()=>{const[D,H]=await Promise.allSettled([fetch(`${it}/api/projects`).then(ut=>ut.ok?ut.json():[]),fetch(`${it}/api/health`).then(ut=>ut.ok?ut.json():{})]);if(L)return;const U=D.status==="fulfilled"?D.value:[],Z=H.status==="fulfilled"?H.value:{};if(g(U),T.current)return;const tt=new Set(U.map(ut=>ut.id)),j=new URLSearchParams(window.location.search).get("project"),Y=Z.defaultProjectId,W=U.length>0?U[0].id:null,rt=[j,Y,W].find(ut=>ut!=null&&tt.has(ut))??null;rt&&p(rt)})(),()=>{L=!0}},[n]),R.useEffect(()=>{if(!d)return;const it=new URLSearchParams(window.location.search);it.set("project",d);const L=it.toString();window.history.replaceState({},"",`?${L}`)},[d]),R.useEffect(()=>{const L=(_?.sessions||[]).some($=>$.activityType==="waiting-user");document.title=L?"⚡ Input needed — OCWatch":"OCWatch"},[_?.sessions]);const F=R.useMemo(()=>({sessions:_?.sessions||[],sessionDetail:y,sessionDetailLoading:x,planProgress:_?.planProgress||null,planName:_?.planName,sessionStats:X,messages:k,activitySessions:O,selectedSessionId:o,projects:h,selectedProjectId:d,loading:N,error:M,lastUpdate:z,isReconnecting:V,agentFilter:u,notificationPermission:st,requestNotificationPermission:P,setSelectedSessionId:l,setSelectedProjectId:A,setAgentFilter:c}),[_,y,x,X,k,O,o,h,d,N,M,z,V,u,st,P,A]);return w.jsx(tS.Provider,{value:F,children:t})}function vr(){const t=R.useContext(tS);if(t===void 0)throw new Error("useAppContext must be used within AppProvider");return t}const eS=As.memo(({status:t,color:n})=>t==="working"?w.jsxs("div",{className:"relative w-2 h-2 flex-shrink-0",children:[w.jsx("div",{className:"absolute inset-0 rounded-full opacity-75 animate-ping",style:{backgroundColor:n}}),w.jsx("div",{className:"relative w-2 h-2 rounded-full",style:{backgroundColor:n}})]}):t==="idle"?w.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse flex-shrink-0 bg-success"}):t==="completed"?w.jsx("div",{className:"w-2 h-2 rounded-full bg-border flex-shrink-0"}):w.jsx("div",{className:"w-2 h-2 rounded-full bg-background flex-shrink-0"})),PC=()=>{const{sessions:t,selectedSessionId:n,activitySessions:a}=vr(),o=R.useMemo(()=>t.find(c=>c.id===n),[t,n]),l=R.useMemo(()=>{if(n)return null;let c=0,d=0,p=0,h=0;return t.forEach(g=>{g.status==="working"?c++:g.status==="idle"?d++:g.status==="waiting"?p++:h++}),{working:c,idle:d,waiting:p,completed:h}},[t,n]),u=R.useMemo(()=>!n||!o?null:{agentCount:a.filter(d=>d.id===n||d.parentID===n).length,duration:UC(o.createdAt,o.updatedAt),model:o.modelID?Jb(o.modelID):"—",color:ir(o.agent)},[n,o,a]);return n?w.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-surface rounded-md border border-border","data-testid":"scope-snapshot",children:[w.jsx("div",{className:"flex justify-between items-center gap-2",children:w.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[w.jsx(eS,{status:o?.status,color:u?.color||"#6b7280"}),w.jsx("span",{className:"text-xs font-medium text-text-primary truncate",children:o?.title||"Untitled Session"})]})}),w.jsxs("div",{className:"flex justify-between items-center text-[10px] text-text-secondary",children:[w.jsxs("div",{className:"flex items-center gap-2 min-w-0 font-mono",children:[w.jsx("span",{children:u?.duration}),w.jsx("span",{children:"·"}),w.jsx("span",{className:"truncate",children:u?.model})]}),u&&u.agentCount>0&&w.jsxs("span",{className:"font-mono bg-background px-1.5 rounded-sm",children:[u.agentCount," agent",u.agentCount!==1?"s":""]})]})]}):w.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-surface rounded-md border border-border","data-testid":"scope-snapshot",children:[w.jsxs("div",{className:"flex justify-between items-center",children:[w.jsx("span",{className:"text-xs font-medium text-text-primary",children:"All sessions"}),w.jsx("span",{className:"text-xs font-mono text-text-secondary bg-background px-1.5 rounded-sm",children:t.length})]}),w.jsx("div",{className:"flex gap-2 text-[10px] font-mono",children:l&&w.jsxs(w.Fragment,{children:[l.working>0&&w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"text-accent",children:[l.working," working"]}),w.jsx("span",{className:"text-text-secondary",children:"·"})]}),l.idle>0&&w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"text-success",children:[l.idle," idle"]}),w.jsx("span",{className:"text-text-secondary",children:"·"})]}),l.waiting>0&&w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"text-warning",children:[l.waiting," waiting"]}),w.jsx("span",{className:"text-text-secondary",children:"·"})]}),w.jsxs("span",{className:"text-text-secondary",children:[l.completed," done"]})]})})]})},IC=()=>{const{activitySessions:t,selectedSessionId:n}=vr(),{displayAgents:a,overflowCount:o,isSessionMode:l}=R.useMemo(()=>{let u=[];const c=!!n;c?u=t.filter(p=>p.id===n||p.parentID===n):u=t.filter(p=>p.status==="working"||p.status==="idle");const d=[...u].sort((p,h)=>{const g=p.status==="working"?2:p.status==="idle"?1:0,y=h.status==="working"?2:h.status==="idle"?1:0;return g!==y?y-g:(h.tokens||0)-(p.tokens||0)});return c?{displayAgents:d.slice(0,5),overflowCount:Math.max(0,d.length-5),isSessionMode:!0}:{displayAgents:d,overflowCount:0,isSessionMode:!1}},[t,n]);return a.length===0?w.jsx("div",{className:"p-3 bg-surface rounded-md border border-border text-xs text-text-secondary text-center","data-testid":"active-agents-empty",children:"No active agents"}):w.jsxs("div",{className:"p-3 bg-surface rounded-md border border-border","data-testid":"active-agents",children:[w.jsx("div",{className:"flex flex-col gap-1.5 max-h-[200px] overflow-y-auto",children:a.map(u=>w.jsx(KC,{session:u},u.id))}),l&&o>0&&w.jsxs("div",{className:"text-[10px] text-text-secondary text-center mt-1.5 pt-1.5 border-t border-border/50",children:["+",o," more agents"]})]})},KC=As.memo(({session:t})=>{const n=ir(t.agent);return w.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[w.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[w.jsx(eS,{status:t.status,color:n}),w.jsx("span",{className:"font-medium text-text-primary truncate flex-1 min-w-0",title:t.agent,children:t.agent}),w.jsx("span",{className:"text-[10px] text-text-secondary truncate max-w-[80px]",title:t.modelID,children:t.modelID?Jb(t.modelID):"—"})]}),w.jsx("span",{className:"font-mono text-text-secondary whitespace-nowrap ml-1",children:Eh(t.tokens||0)})]})}),QC=()=>{const{planProgress:t,planName:n}=vr(),[a,o]=R.useState(!1);if(!t)return w.jsx("div",{className:"p-3 bg-surface rounded-md border border-border text-xs text-text-secondary text-center","data-testid":"sidebar-plan-empty",children:"No plan"});const{completed:l,total:u,progress:c,tasks:d}=t,p=d.find(g=>!g.completed),h=Math.min(100,Math.max(0,c));return w.jsxs("div",{className:"flex flex-col gap-2 bg-surface rounded-md border border-border","data-testid":"sidebar-plan-progress",children:[w.jsxs("button",{type:"button",onClick:()=>o(g=>!g),className:"flex flex-col gap-2 p-3 w-full text-left cursor-pointer hover:bg-white/[0.02] transition-colors rounded-md",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("span",{className:"text-[10px] text-text-secondary uppercase tracking-wider font-semibold truncate",title:n,children:n||"Plan"}),a?w.jsx(d1,{className:"w-3 h-3 text-text-secondary"}):w.jsx(Fo,{className:"w-3 h-3 text-text-secondary"})]}),w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("div",{className:"flex-1 h-2 bg-background rounded-full overflow-hidden",children:w.jsx("div",{className:"h-full bg-accent transition-all duration-500 ease-out",style:{width:`${h}%`}})}),w.jsxs("span",{className:"text-xs font-mono text-text-secondary whitespace-nowrap",children:[l,"/",u," tasks"]})]}),!a&&p&&w.jsxs("div",{className:"flex flex-col gap-0.5",children:[w.jsx("span",{className:"text-[10px] text-text-secondary uppercase tracking-wider font-semibold",children:"Current"}),w.jsx("span",{className:"text-xs text-text-primary truncate",title:p.description,children:p.description})]}),!a&&!p&&l===u&&w.jsx("div",{className:"text-xs text-success",children:"All tasks completed"})]}),a&&w.jsx("div",{className:"flex flex-col gap-1 px-3 pb-3 max-h-64 overflow-y-auto",children:d.map(g=>w.jsxs("div",{className:"flex items-start gap-1.5 text-[11px] leading-tight",children:[g.completed?w.jsx(YT,{className:"w-3 h-3 text-accent mt-0.5 shrink-0"}):w.jsx(XT,{className:"w-3 h-3 text-text-secondary mt-0.5 shrink-0"}),w.jsx("span",{className:g.completed?"text-text-secondary line-through":"text-text-primary",children:g.description})]},g.description))})]})};function Iv(t){const n=Math.floor((Date.now()-t)/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m`}const FC=()=>{const{lastUpdate:t,isReconnecting:n,error:a}=vr(),[o,l]=R.useState(()=>Iv(t));R.useEffect(()=>{const d=setInterval(()=>{l(Iv(t))},1e3);return()=>clearInterval(d)},[t]);let u="bg-green-500",c="Connected";return a?(u="bg-red-500",c="Error"):n&&(u="bg-amber-500",c="Reconnecting"),w.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface border-t border-border text-[10px] text-text-secondary mt-auto","data-testid":"system-health",children:[w.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${u}`}),w.jsx("span",{children:c}),w.jsx("span",{children:"·"}),w.jsx("span",{children:"2s poll"}),w.jsx("span",{children:"·"}),w.jsxs("span",{children:["Updated ",o," ago"]})]})},JC=({status:t,activityType:n})=>t==="working"?w.jsx(p1,{className:"w-4 h-4 text-accent animate-spin","data-testid":"session-status-working"}):t==="idle"?w.jsx(Wd,{className:"w-4 h-4 text-success animate-pulse","data-testid":"session-status-idle"}):t==="waiting"?n==="waiting-user"?w.jsx(g1,{className:"w-4 h-4 text-warning animate-waiting-user-icon","data-testid":"session-status-waiting-user"}):w.jsx(Wd,{className:"w-4 h-4 text-text-secondary","data-testid":"session-status-waiting"}):w.jsx(Bh,{className:"w-4 h-4 text-text-secondary","data-testid":"session-status-completed"}),WC=({sessions:t,selectedId:n,onSelect:a,projects:o=[],selectedProjectId:l=null,onProjectSelect:u=()=>{}})=>{const[c,d]=R.useState(!1),h=[...l?t.filter(v=>v.projectID===l):t].sort((v,x)=>{const S=new Date(x.updatedAt).getTime()-new Date(v.updatedAt).getTime();return S!==0?S:v.id.localeCompare(x.id)}),g=o.find(v=>v.id===l),y=g?.directory.split("/").pop()||"Projects";return w.jsxs("div",{className:"w-[280px] h-full bg-surface border-r border-border flex flex-col","data-testid":"session-list",children:[w.jsxs("div",{className:"p-4 border-b border-border",children:[w.jsxs("div",{className:"relative mb-3",children:[w.jsxs("button",{type:"button",onClick:()=>d(!c),"data-testid":"project-dropdown-button",title:g?.directory||"Projects",className:"w-full flex items-center justify-between gap-2 px-3 py-2 bg-background border border-border rounded hover:bg-surface transition-colors text-text-primary text-sm",children:[w.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[w.jsx(CT,{className:"w-4 h-4 text-accent shrink-0"}),w.jsx("span",{className:"truncate",children:y})]}),w.jsx(Fo,{className:`w-4 h-4 shrink-0 transition-transform ${c?"rotate-180":""}`})]}),c&&w.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded shadow-lg z-10 max-h-[320px] overflow-y-auto","data-testid":"project-dropdown-menu",children:o.map(v=>w.jsxs("button",{type:"button",onClick:()=>{u(v.id),d(!1)},"data-testid":`project-option-${v.id}`,title:v.directory,className:`w-full text-left pl-3 pr-3 py-2 text-sm transition-colors flex items-center justify-between border-l-2 ${l===v.id?"bg-accent/10 text-accent border-l-accent":"text-text-primary hover:bg-background border-l-transparent"}`,children:[w.jsx("span",{className:"truncate",children:v.directory.split("/").pop()}),w.jsx("span",{className:"text-xs text-text-secondary ml-2 shrink-0",children:Pv(v.lastActivityAt)})]},v.id))})]}),w.jsx("h2",{className:"text-text-primary font-semibold text-lg",children:"Sessions"})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",role:"listbox","aria-label":"Sessions",tabIndex:0,"aria-activedescendant":n||void 0,children:h.length===0?w.jsx(Wb,{icon:RT,title:"No Sessions",description:"No sessions found in this project"}):h.map(v=>{const x=v.id===n,S=v.status||"completed",T=v.activityType;let A="border-l-transparent";return x||S==="working"?A="border-l-accent":S==="idle"?A="border-l-success":S==="waiting"&&T==="waiting-user"?A="border-l-transparent animate-attention":S==="completed"&&(A="border-l-transparent"),w.jsxs("button",{type:"button","data-testid":`session-item-${v.id}`,onClick:()=>a(v.id),role:"option","aria-selected":x,className:`w-full text-left p-3 border-b border-border hover:bg-background transition-colors flex flex-col gap-1 group border-l-2
18
+ ${A}
19
+ ${x?"bg-background":""}
20
+ `,children:[w.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w.jsx("div",{className:"shrink-0 mt-0.5",children:w.jsx(JC,{status:S,activityType:T})}),w.jsx("h3",{className:`font-medium truncate text-sm flex-1 ${x?"text-accent":"text-text-primary"}`,children:v.title||"Untitled Session"}),w.jsx("span",{className:"text-xs text-text-secondary shrink-0",children:Pv(v.updatedAt)})]}),w.jsxs("div",{className:"flex items-center gap-2 pl-6 w-full min-w-0",children:[w.jsx("span",{className:`text-xs truncate flex-1 min-w-0 ${T==="waiting-user"?"text-warning font-medium":"text-text-secondary"}`,title:v.currentAction||"",children:T==="waiting-user"&&(!v.currentAction||v.currentAction==="question")?"⚡ Needs your input":v.currentAction||"No active task"}),v.agent&&w.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-surface border border-border text-text-secondary shrink-0",children:v.agent})]})]},v.id)})}),w.jsxs("div",{className:"border-t border-border overflow-y-auto p-3 space-y-3 max-h-[45%] shrink-0",children:[w.jsx(PC,{}),w.jsx(IC,{}),w.jsx(QC,{})]}),w.jsx(FC,{})]})};function le(t){if(typeof t=="string"||typeof t=="number")return""+t;let n="";if(Array.isArray(t))for(let a=0,o;a<t.length;a++)(o=le(t[a]))!==""&&(n+=(n&&" ")+o);else for(let a in t)t[a]&&(n+=(n&&" ")+a);return n}var t3={value:()=>{}};function xr(){for(var t=0,n=arguments.length,a={},o;t<n;++t){if(!(o=arguments[t]+"")||o in a||/[\s.]/.test(o))throw new Error("illegal type: "+o);a[o]=[]}return new hu(a)}function hu(t){this._=t}function e3(t,n){return t.trim().split(/^|\s+/).map(function(a){var o="",l=a.indexOf(".");if(l>=0&&(o=a.slice(l+1),a=a.slice(0,l)),a&&!n.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:o}})}hu.prototype=xr.prototype={constructor:hu,on:function(t,n){var a=this._,o=e3(t+"",a),l,u=-1,c=o.length;if(arguments.length<2){for(;++u<c;)if((l=(t=o[u]).type)&&(l=n3(a[l],t.name)))return l;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++u<c;)if(l=(t=o[u]).type)a[l]=Kv(a[l],t.name,n);else if(n==null)for(l in a)a[l]=Kv(a[l],t.name,null);return this},copy:function(){var t={},n=this._;for(var a in n)t[a]=n[a].slice();return new hu(t)},call:function(t,n){if((l=arguments.length-2)>0)for(var a=new Array(l),o=0,l,u;o<l;++o)a[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],o=0,l=u.length;o<l;++o)u[o].value.apply(n,a)},apply:function(t,n,a){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],l=0,u=o.length;l<u;++l)o[l].value.apply(n,a)}};function n3(t,n){for(var a=0,o=t.length,l;a<o;++a)if((l=t[a]).name===n)return l.value}function Kv(t,n,a){for(var o=0,l=t.length;o<l;++o)if(t[o].name===n){t[o]=t3,t=t.slice(0,o).concat(t.slice(o+1));break}return a!=null&&t.push({name:n,value:a}),t}var Th="http://www.w3.org/1999/xhtml";const Qv={svg:"http://www.w3.org/2000/svg",xhtml:Th,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yu(t){var n=t+="",a=n.indexOf(":");return a>=0&&(n=t.slice(0,a))!=="xmlns"&&(t=t.slice(a+1)),Qv.hasOwnProperty(n)?{space:Qv[n],local:t}:t}function i3(t){return function(){var n=this.ownerDocument,a=this.namespaceURI;return a===Th&&n.documentElement.namespaceURI===Th?n.createElement(t):n.createElementNS(a,t)}}function a3(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function nS(t){var n=Yu(t);return(n.local?a3:i3)(n)}function s3(){}function ym(t){return t==null?s3:function(){return this.querySelector(t)}}function o3(t){typeof t!="function"&&(t=ym(t));for(var n=this._groups,a=n.length,o=new Array(a),l=0;l<a;++l)for(var u=n[l],c=u.length,d=o[l]=new Array(c),p,h,g=0;g<c;++g)(p=u[g])&&(h=t.call(p,p.__data__,g,u))&&("__data__"in p&&(h.__data__=p.__data__),d[g]=h);return new Ie(o,this._parents)}function r3(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function l3(){return[]}function iS(t){return t==null?l3:function(){return this.querySelectorAll(t)}}function u3(t){return function(){return r3(t.apply(this,arguments))}}function c3(t){typeof t=="function"?t=u3(t):t=iS(t);for(var n=this._groups,a=n.length,o=[],l=[],u=0;u<a;++u)for(var c=n[u],d=c.length,p,h=0;h<d;++h)(p=c[h])&&(o.push(t.call(p,p.__data__,h,c)),l.push(p));return new Ie(o,l)}function aS(t){return function(){return this.matches(t)}}function sS(t){return function(n){return n.matches(t)}}var f3=Array.prototype.find;function d3(t){return function(){return f3.call(this.children,t)}}function h3(){return this.firstElementChild}function m3(t){return this.select(t==null?h3:d3(typeof t=="function"?t:sS(t)))}var p3=Array.prototype.filter;function g3(){return Array.from(this.children)}function y3(t){return function(){return p3.call(this.children,t)}}function v3(t){return this.selectAll(t==null?g3:y3(typeof t=="function"?t:sS(t)))}function x3(t){typeof t!="function"&&(t=aS(t));for(var n=this._groups,a=n.length,o=new Array(a),l=0;l<a;++l)for(var u=n[l],c=u.length,d=o[l]=[],p,h=0;h<c;++h)(p=u[h])&&t.call(p,p.__data__,h,u)&&d.push(p);return new Ie(o,this._parents)}function oS(t){return new Array(t.length)}function b3(){return new Ie(this._enter||this._groups.map(oS),this._parents)}function Nu(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Nu.prototype={constructor:Nu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function S3(t){return function(){return t}}function w3(t,n,a,o,l,u){for(var c=0,d,p=n.length,h=u.length;c<h;++c)(d=n[c])?(d.__data__=u[c],o[c]=d):a[c]=new Nu(t,u[c]);for(;c<p;++c)(d=n[c])&&(l[c]=d)}function E3(t,n,a,o,l,u,c){var d,p,h=new Map,g=n.length,y=u.length,v=new Array(g),x;for(d=0;d<g;++d)(p=n[d])&&(v[d]=x=c.call(p,p.__data__,d,n)+"",h.has(x)?l[d]=p:h.set(x,p));for(d=0;d<y;++d)x=c.call(t,u[d],d,u)+"",(p=h.get(x))?(o[d]=p,p.__data__=u[d],h.delete(x)):a[d]=new Nu(t,u[d]);for(d=0;d<g;++d)(p=n[d])&&h.get(v[d])===p&&(l[d]=p)}function T3(t){return t.__data__}function A3(t,n){if(!arguments.length)return Array.from(this,T3);var a=n?E3:w3,o=this._parents,l=this._groups;typeof t!="function"&&(t=S3(t));for(var u=l.length,c=new Array(u),d=new Array(u),p=new Array(u),h=0;h<u;++h){var g=o[h],y=l[h],v=y.length,x=N3(t.call(g,g&&g.__data__,h,o)),S=x.length,T=d[h]=new Array(S),A=c[h]=new Array(S),E=p[h]=new Array(v);a(g,y,T,A,E,x,n);for(var _=0,N=0,M,z;_<S;++_)if(M=T[_]){for(_>=N&&(N=_+1);!(z=A[N])&&++N<S;);M._next=z||null}}return c=new Ie(c,o),c._enter=d,c._exit=p,c}function N3(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function M3(){return new Ie(this._exit||this._groups.map(oS),this._parents)}function _3(t,n,a){var o=this.enter(),l=this,u=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),n!=null&&(l=n(l),l&&(l=l.selection())),a==null?u.remove():a(u),o&&l?o.merge(l).order():l}function C3(t){for(var n=t.selection?t.selection():t,a=this._groups,o=n._groups,l=a.length,u=o.length,c=Math.min(l,u),d=new Array(l),p=0;p<c;++p)for(var h=a[p],g=o[p],y=h.length,v=d[p]=new Array(y),x,S=0;S<y;++S)(x=h[S]||g[S])&&(v[S]=x);for(;p<l;++p)d[p]=a[p];return new Ie(d,this._parents)}function D3(){for(var t=this._groups,n=-1,a=t.length;++n<a;)for(var o=t[n],l=o.length-1,u=o[l],c;--l>=0;)(c=o[l])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function R3(t){t||(t=j3);function n(y,v){return y&&v?t(y.__data__,v.__data__):!y-!v}for(var a=this._groups,o=a.length,l=new Array(o),u=0;u<o;++u){for(var c=a[u],d=c.length,p=l[u]=new Array(d),h,g=0;g<d;++g)(h=c[g])&&(p[g]=h);p.sort(n)}return new Ie(l,this._parents).order()}function j3(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function z3(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function O3(){return Array.from(this)}function V3(){for(var t=this._groups,n=0,a=t.length;n<a;++n)for(var o=t[n],l=0,u=o.length;l<u;++l){var c=o[l];if(c)return c}return null}function L3(){let t=0;for(const n of this)++t;return t}function H3(){return!this.node()}function B3(t){for(var n=this._groups,a=0,o=n.length;a<o;++a)for(var l=n[a],u=0,c=l.length,d;u<c;++u)(d=l[u])&&t.call(d,d.__data__,u,l);return this}function k3(t){return function(){this.removeAttribute(t)}}function U3(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Y3(t,n){return function(){this.setAttribute(t,n)}}function q3(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function X3(t,n){return function(){var a=n.apply(this,arguments);a==null?this.removeAttribute(t):this.setAttribute(t,a)}}function G3(t,n){return function(){var a=n.apply(this,arguments);a==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,a)}}function $3(t,n){var a=Yu(t);if(arguments.length<2){var o=this.node();return a.local?o.getAttributeNS(a.space,a.local):o.getAttribute(a)}return this.each((n==null?a.local?U3:k3:typeof n=="function"?a.local?G3:X3:a.local?q3:Y3)(a,n))}function rS(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Z3(t){return function(){this.style.removeProperty(t)}}function P3(t,n,a){return function(){this.style.setProperty(t,n,a)}}function I3(t,n,a){return function(){var o=n.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,a)}}function K3(t,n,a){return arguments.length>1?this.each((n==null?Z3:typeof n=="function"?I3:P3)(t,n,a??"")):Ds(this.node(),t)}function Ds(t,n){return t.style.getPropertyValue(n)||rS(t).getComputedStyle(t,null).getPropertyValue(n)}function Q3(t){return function(){delete this[t]}}function F3(t,n){return function(){this[t]=n}}function J3(t,n){return function(){var a=n.apply(this,arguments);a==null?delete this[t]:this[t]=a}}function W3(t,n){return arguments.length>1?this.each((n==null?Q3:typeof n=="function"?J3:F3)(t,n)):this.node()[t]}function lS(t){return t.trim().split(/^|\s+/)}function vm(t){return t.classList||new uS(t)}function uS(t){this._node=t,this._names=lS(t.getAttribute("class")||"")}uS.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function cS(t,n){for(var a=vm(t),o=-1,l=n.length;++o<l;)a.add(n[o])}function fS(t,n){for(var a=vm(t),o=-1,l=n.length;++o<l;)a.remove(n[o])}function tD(t){return function(){cS(this,t)}}function eD(t){return function(){fS(this,t)}}function nD(t,n){return function(){(n.apply(this,arguments)?cS:fS)(this,t)}}function iD(t,n){var a=lS(t+"");if(arguments.length<2){for(var o=vm(this.node()),l=-1,u=a.length;++l<u;)if(!o.contains(a[l]))return!1;return!0}return this.each((typeof n=="function"?nD:n?tD:eD)(a,n))}function aD(){this.textContent=""}function sD(t){return function(){this.textContent=t}}function oD(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function rD(t){return arguments.length?this.each(t==null?aD:(typeof t=="function"?oD:sD)(t)):this.node().textContent}function lD(){this.innerHTML=""}function uD(t){return function(){this.innerHTML=t}}function cD(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function fD(t){return arguments.length?this.each(t==null?lD:(typeof t=="function"?cD:uD)(t)):this.node().innerHTML}function dD(){this.nextSibling&&this.parentNode.appendChild(this)}function hD(){return this.each(dD)}function mD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pD(){return this.each(mD)}function gD(t){var n=typeof t=="function"?t:nS(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function yD(){return null}function vD(t,n){var a=typeof t=="function"?t:nS(t),o=n==null?yD:typeof n=="function"?n:ym(n);return this.select(function(){return this.insertBefore(a.apply(this,arguments),o.apply(this,arguments)||null)})}function xD(){var t=this.parentNode;t&&t.removeChild(this)}function bD(){return this.each(xD)}function SD(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function wD(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ED(t){return this.select(t?wD:SD)}function TD(t){return arguments.length?this.property("__data__",t):this.node().__data__}function AD(t){return function(n){t.call(this,n,this.__data__)}}function ND(t){return t.trim().split(/^|\s+/).map(function(n){var a="",o=n.indexOf(".");return o>=0&&(a=n.slice(o+1),n=n.slice(0,o)),{type:n,name:a}})}function MD(t){return function(){var n=this.__on;if(n){for(var a=0,o=-1,l=n.length,u;a<l;++a)u=n[a],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):n[++o]=u;++o?n.length=o:delete this.__on}}}function _D(t,n,a){return function(){var o=this.__on,l,u=AD(n);if(o){for(var c=0,d=o.length;c<d;++c)if((l=o[c]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=u,l.options=a),l.value=n;return}}this.addEventListener(t.type,u,a),l={type:t.type,name:t.name,value:n,listener:u,options:a},o?o.push(l):this.__on=[l]}}function CD(t,n,a){var o=ND(t+""),l,u=o.length,c;if(arguments.length<2){var d=this.node().__on;if(d){for(var p=0,h=d.length,g;p<h;++p)for(l=0,g=d[p];l<u;++l)if((c=o[l]).type===g.type&&c.name===g.name)return g.value}return}for(d=n?_D:MD,l=0;l<u;++l)this.each(d(o[l],n,a));return this}function dS(t,n,a){var o=rS(t),l=o.CustomEvent;typeof l=="function"?l=new l(n,a):(l=o.document.createEvent("Event"),a?(l.initEvent(n,a.bubbles,a.cancelable),l.detail=a.detail):l.initEvent(n,!1,!1)),t.dispatchEvent(l)}function DD(t,n){return function(){return dS(this,t,n)}}function RD(t,n){return function(){return dS(this,t,n.apply(this,arguments))}}function jD(t,n){return this.each((typeof n=="function"?RD:DD)(t,n))}function*zD(){for(var t=this._groups,n=0,a=t.length;n<a;++n)for(var o=t[n],l=0,u=o.length,c;l<u;++l)(c=o[l])&&(yield c)}var hS=[null];function Ie(t,n){this._groups=t,this._parents=n}function br(){return new Ie([[document.documentElement]],hS)}function OD(){return this}Ie.prototype=br.prototype={constructor:Ie,select:o3,selectAll:c3,selectChild:m3,selectChildren:v3,filter:x3,data:A3,enter:b3,exit:M3,join:_3,merge:C3,selection:OD,order:D3,sort:R3,call:z3,nodes:O3,node:V3,size:L3,empty:H3,each:B3,attr:$3,style:K3,property:W3,classed:iD,text:rD,html:fD,raise:hD,lower:pD,append:gD,insert:vD,remove:bD,clone:ED,datum:TD,on:CD,dispatch:jD,[Symbol.iterator]:zD};function Pe(t){return typeof t=="string"?new Ie([[document.querySelector(t)]],[document.documentElement]):new Ie([[t]],hS)}function VD(t){let n;for(;n=t.sourceEvent;)t=n;return t}function pn(t,n){if(t=VD(t),n===void 0&&(n=t.currentTarget),n){var a=n.ownerSVGElement||n;if(a.createSVGPoint){var o=a.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(n.getScreenCTM().inverse()),[o.x,o.y]}if(n.getBoundingClientRect){var l=n.getBoundingClientRect();return[t.clientX-l.left-n.clientLeft,t.clientY-l.top-n.clientTop]}}return[t.pageX,t.pageY]}const LD={passive:!1},ar={capture:!0,passive:!1};function Bd(t){t.stopImmediatePropagation()}function Ms(t){t.preventDefault(),t.stopImmediatePropagation()}function mS(t){var n=t.document.documentElement,a=Pe(t).on("dragstart.drag",Ms,ar);"onselectstart"in n?a.on("selectstart.drag",Ms,ar):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function pS(t,n){var a=t.document.documentElement,o=Pe(t).on("dragstart.drag",null);n&&(o.on("click.drag",Ms,ar),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in a?o.on("selectstart.drag",null):(a.style.MozUserSelect=a.__noselect,delete a.__noselect)}const tu=t=>()=>t;function Ah(t,{sourceEvent:n,subject:a,target:o,identifier:l,active:u,x:c,y:d,dx:p,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:a,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Ah.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function HD(t){return!t.ctrlKey&&!t.button}function BD(){return this.parentNode}function kD(t,n){return n??{x:t.x,y:t.y}}function UD(){return navigator.maxTouchPoints||"ontouchstart"in this}function gS(){var t=HD,n=BD,a=kD,o=UD,l={},u=xr("start","drag","end"),c=0,d,p,h,g,y=0;function v(M){M.on("mousedown.drag",x).filter(o).on("touchstart.drag",A).on("touchmove.drag",E,LD).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(M,z){if(!(g||!t.call(this,M,z))){var V=N(this,n.call(this,M,z),M,z,"mouse");V&&(Pe(M.view).on("mousemove.drag",S,ar).on("mouseup.drag",T,ar),mS(M.view),Bd(M),h=!1,d=M.clientX,p=M.clientY,V("start",M))}}function S(M){if(Ms(M),!h){var z=M.clientX-d,V=M.clientY-p;h=z*z+V*V>y}l.mouse("drag",M)}function T(M){Pe(M.view).on("mousemove.drag mouseup.drag",null),pS(M.view,h),Ms(M),l.mouse("end",M)}function A(M,z){if(t.call(this,M,z)){var V=M.changedTouches,O=n.call(this,M,z),k=V.length,X,st;for(X=0;X<k;++X)(st=N(this,O,M,z,V[X].identifier,V[X]))&&(Bd(M),st("start",M,V[X]))}}function E(M){var z=M.changedTouches,V=z.length,O,k;for(O=0;O<V;++O)(k=l[z[O].identifier])&&(Ms(M),k("drag",M,z[O]))}function _(M){var z=M.changedTouches,V=z.length,O,k;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),O=0;O<V;++O)(k=l[z[O].identifier])&&(Bd(M),k("end",M,z[O]))}function N(M,z,V,O,k,X){var st=u.copy(),P=pn(X||V,z),F,it,L;if((L=a.call(M,new Ah("beforestart",{sourceEvent:V,target:v,identifier:k,active:c,x:P[0],y:P[1],dx:0,dy:0,dispatch:st}),O))!=null)return F=L.x-P[0]||0,it=L.y-P[1]||0,function $(D,H,U){var Z=P,tt;switch(D){case"start":l[k]=$,tt=c++;break;case"end":delete l[k],--c;case"drag":P=pn(U||H,z),tt=c;break}st.call(D,M,new Ah(D,{sourceEvent:H,subject:L,target:v,identifier:k,active:tt,x:P[0]+F,y:P[1]+it,dx:P[0]-Z[0],dy:P[1]-Z[1],dispatch:st}),O)}}return v.filter=function(M){return arguments.length?(t=typeof M=="function"?M:tu(!!M),v):t},v.container=function(M){return arguments.length?(n=typeof M=="function"?M:tu(M),v):n},v.subject=function(M){return arguments.length?(a=typeof M=="function"?M:tu(M),v):a},v.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:tu(!!M),v):o},v.on=function(){var M=u.on.apply(u,arguments);return M===u?v:M},v.clickDistance=function(M){return arguments.length?(y=(M=+M)*M,v):Math.sqrt(y)},v}function xm(t,n,a){t.prototype=n.prototype=a,a.constructor=t}function yS(t,n){var a=Object.create(t.prototype);for(var o in n)a[o]=n[o];return a}function Sr(){}var sr=.7,Mu=1/sr,_s="\\s*([+-]?\\d+)\\s*",or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",YD=/^#([0-9a-f]{3,8})$/,qD=new RegExp(`^rgb\\(${_s},${_s},${_s}\\)$`),XD=new RegExp(`^rgb\\(${_n},${_n},${_n}\\)$`),GD=new RegExp(`^rgba\\(${_s},${_s},${_s},${or}\\)$`),$D=new RegExp(`^rgba\\(${_n},${_n},${_n},${or}\\)$`),ZD=new RegExp(`^hsl\\(${or},${_n},${_n}\\)$`),PD=new RegExp(`^hsla\\(${or},${_n},${_n},${or}\\)$`),Fv={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};xm(Sr,Aa,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Jv,formatHex:Jv,formatHex8:ID,formatHsl:KD,formatRgb:Wv,toString:Wv});function Jv(){return this.rgb().formatHex()}function ID(){return this.rgb().formatHex8()}function KD(){return vS(this).formatHsl()}function Wv(){return this.rgb().formatRgb()}function Aa(t){var n,a;return t=(t+"").trim().toLowerCase(),(n=YD.exec(t))?(a=n[1].length,n=parseInt(n[1],16),a===6?tx(n):a===3?new Be(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):a===8?eu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):a===4?eu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=qD.exec(t))?new Be(n[1],n[2],n[3],1):(n=XD.exec(t))?new Be(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=GD.exec(t))?eu(n[1],n[2],n[3],n[4]):(n=$D.exec(t))?eu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ZD.exec(t))?ix(n[1],n[2]/100,n[3]/100,1):(n=PD.exec(t))?ix(n[1],n[2]/100,n[3]/100,n[4]):Fv.hasOwnProperty(t)?tx(Fv[t]):t==="transparent"?new Be(NaN,NaN,NaN,0):null}function tx(t){return new Be(t>>16&255,t>>8&255,t&255,1)}function eu(t,n,a,o){return o<=0&&(t=n=a=NaN),new Be(t,n,a,o)}function QD(t){return t instanceof Sr||(t=Aa(t)),t?(t=t.rgb(),new Be(t.r,t.g,t.b,t.opacity)):new Be}function Nh(t,n,a,o){return arguments.length===1?QD(t):new Be(t,n,a,o??1)}function Be(t,n,a,o){this.r=+t,this.g=+n,this.b=+a,this.opacity=+o}xm(Be,Nh,yS(Sr,{brighter(t){return t=t==null?Mu:Math.pow(Mu,t),new Be(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?sr:Math.pow(sr,t),new Be(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Be(Ea(this.r),Ea(this.g),Ea(this.b),_u(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:ex,formatHex:ex,formatHex8:FD,formatRgb:nx,toString:nx}));function ex(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function FD(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function nx(){const t=_u(this.opacity);return`${t===1?"rgb(":"rgba("}${Ea(this.r)}, ${Ea(this.g)}, ${Ea(this.b)}${t===1?")":`, ${t})`}`}function _u(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ea(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Sa(t){return t=Ea(t),(t<16?"0":"")+t.toString(16)}function ix(t,n,a,o){return o<=0?t=n=a=NaN:a<=0||a>=1?t=n=NaN:n<=0&&(t=NaN),new gn(t,n,a,o)}function vS(t){if(t instanceof gn)return new gn(t.h,t.s,t.l,t.opacity);if(t instanceof Sr||(t=Aa(t)),!t)return new gn;if(t instanceof gn)return t;t=t.rgb();var n=t.r/255,a=t.g/255,o=t.b/255,l=Math.min(n,a,o),u=Math.max(n,a,o),c=NaN,d=u-l,p=(u+l)/2;return d?(n===u?c=(a-o)/d+(a<o)*6:a===u?c=(o-n)/d+2:c=(n-a)/d+4,d/=p<.5?u+l:2-u-l,c*=60):d=p>0&&p<1?0:c,new gn(c,d,p,t.opacity)}function JD(t,n,a,o){return arguments.length===1?vS(t):new gn(t,n,a,o??1)}function gn(t,n,a,o){this.h=+t,this.s=+n,this.l=+a,this.opacity=+o}xm(gn,JD,yS(Sr,{brighter(t){return t=t==null?Mu:Math.pow(Mu,t),new gn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?sr:Math.pow(sr,t),new gn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,a=this.l,o=a+(a<.5?a:1-a)*n,l=2*a-o;return new Be(kd(t>=240?t-240:t+120,l,o),kd(t,l,o),kd(t<120?t+240:t-120,l,o),this.opacity)},clamp(){return new gn(ax(this.h),nu(this.s),nu(this.l),_u(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=_u(this.opacity);return`${t===1?"hsl(":"hsla("}${ax(this.h)}, ${nu(this.s)*100}%, ${nu(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ax(t){return t=(t||0)%360,t<0?t+360:t}function nu(t){return Math.max(0,Math.min(1,t||0))}function kd(t,n,a){return(t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n)*255}const bm=t=>()=>t;function WD(t,n){return function(a){return t+a*n}}function t5(t,n,a){return t=Math.pow(t,a),n=Math.pow(n,a)-t,a=1/a,function(o){return Math.pow(t+o*n,a)}}function e5(t){return(t=+t)==1?xS:function(n,a){return a-n?t5(n,a,t):bm(isNaN(n)?a:n)}}function xS(t,n){var a=n-t;return a?WD(t,a):bm(isNaN(t)?n:t)}const Cu=(function t(n){var a=e5(n);function o(l,u){var c=a((l=Nh(l)).r,(u=Nh(u)).r),d=a(l.g,u.g),p=a(l.b,u.b),h=xS(l.opacity,u.opacity);return function(g){return l.r=c(g),l.g=d(g),l.b=p(g),l.opacity=h(g),l+""}}return o.gamma=t,o})(1);function n5(t,n){n||(n=[]);var a=t?Math.min(n.length,t.length):0,o=n.slice(),l;return function(u){for(l=0;l<a;++l)o[l]=t[l]*(1-u)+n[l]*u;return o}}function i5(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function a5(t,n){var a=n?n.length:0,o=t?Math.min(a,t.length):0,l=new Array(o),u=new Array(a),c;for(c=0;c<o;++c)l[c]=Io(t[c],n[c]);for(;c<a;++c)u[c]=n[c];return function(d){for(c=0;c<o;++c)u[c]=l[c](d);return u}}function s5(t,n){var a=new Date;return t=+t,n=+n,function(o){return a.setTime(t*(1-o)+n*o),a}}function Nn(t,n){return t=+t,n=+n,function(a){return t*(1-a)+n*a}}function o5(t,n){var a={},o={},l;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(l in n)l in t?a[l]=Io(t[l],n[l]):o[l]=n[l];return function(u){for(l in a)o[l]=a[l](u);return o}}var Mh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ud=new RegExp(Mh.source,"g");function r5(t){return function(){return t}}function l5(t){return function(n){return t(n)+""}}function bS(t,n){var a=Mh.lastIndex=Ud.lastIndex=0,o,l,u,c=-1,d=[],p=[];for(t=t+"",n=n+"";(o=Mh.exec(t))&&(l=Ud.exec(n));)(u=l.index)>a&&(u=n.slice(a,u),d[c]?d[c]+=u:d[++c]=u),(o=o[0])===(l=l[0])?d[c]?d[c]+=l:d[++c]=l:(d[++c]=null,p.push({i:c,x:Nn(o,l)})),a=Ud.lastIndex;return a<n.length&&(u=n.slice(a),d[c]?d[c]+=u:d[++c]=u),d.length<2?p[0]?l5(p[0].x):r5(n):(n=p.length,function(h){for(var g=0,y;g<n;++g)d[(y=p[g]).i]=y.x(h);return d.join("")})}function Io(t,n){var a=typeof n,o;return n==null||a==="boolean"?bm(n):(a==="number"?Nn:a==="string"?(o=Aa(n))?(n=o,Cu):bS:n instanceof Aa?Cu:n instanceof Date?s5:i5(n)?n5:Array.isArray(n)?a5:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?o5:Nn)(t,n)}var sx=180/Math.PI,_h={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function SS(t,n,a,o,l,u){var c,d,p;return(c=Math.sqrt(t*t+n*n))&&(t/=c,n/=c),(p=t*a+n*o)&&(a-=t*p,o-=n*p),(d=Math.sqrt(a*a+o*o))&&(a/=d,o/=d,p/=d),t*o<n*a&&(t=-t,n=-n,p=-p,c=-c),{translateX:l,translateY:u,rotate:Math.atan2(n,t)*sx,skewX:Math.atan(p)*sx,scaleX:c,scaleY:d}}var iu;function u5(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?_h:SS(n.a,n.b,n.c,n.d,n.e,n.f)}function c5(t){return t==null||(iu||(iu=document.createElementNS("http://www.w3.org/2000/svg","g")),iu.setAttribute("transform",t),!(t=iu.transform.baseVal.consolidate()))?_h:(t=t.matrix,SS(t.a,t.b,t.c,t.d,t.e,t.f))}function wS(t,n,a,o){function l(h){return h.length?h.pop()+" ":""}function u(h,g,y,v,x,S){if(h!==y||g!==v){var T=x.push("translate(",null,n,null,a);S.push({i:T-4,x:Nn(h,y)},{i:T-2,x:Nn(g,v)})}else(y||v)&&x.push("translate("+y+n+v+a)}function c(h,g,y,v){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),v.push({i:y.push(l(y)+"rotate(",null,o)-2,x:Nn(h,g)})):g&&y.push(l(y)+"rotate("+g+o)}function d(h,g,y,v){h!==g?v.push({i:y.push(l(y)+"skewX(",null,o)-2,x:Nn(h,g)}):g&&y.push(l(y)+"skewX("+g+o)}function p(h,g,y,v,x,S){if(h!==y||g!==v){var T=x.push(l(x)+"scale(",null,",",null,")");S.push({i:T-4,x:Nn(h,y)},{i:T-2,x:Nn(g,v)})}else(y!==1||v!==1)&&x.push(l(x)+"scale("+y+","+v+")")}return function(h,g){var y=[],v=[];return h=t(h),g=t(g),u(h.translateX,h.translateY,g.translateX,g.translateY,y,v),c(h.rotate,g.rotate,y,v),d(h.skewX,g.skewX,y,v),p(h.scaleX,h.scaleY,g.scaleX,g.scaleY,y,v),h=g=null,function(x){for(var S=-1,T=v.length,A;++S<T;)y[(A=v[S]).i]=A.x(x);return y.join("")}}}var f5=wS(u5,"px, ","px)","deg)"),d5=wS(c5,", ",")",")"),h5=1e-12;function ox(t){return((t=Math.exp(t))+1/t)/2}function m5(t){return((t=Math.exp(t))-1/t)/2}function p5(t){return((t=Math.exp(2*t))-1)/(t+1)}const mu=(function t(n,a,o){function l(u,c){var d=u[0],p=u[1],h=u[2],g=c[0],y=c[1],v=c[2],x=g-d,S=y-p,T=x*x+S*S,A,E;if(T<h5)E=Math.log(v/h)/n,A=function(O){return[d+O*x,p+O*S,h*Math.exp(n*O*E)]};else{var _=Math.sqrt(T),N=(v*v-h*h+o*T)/(2*h*a*_),M=(v*v-h*h-o*T)/(2*v*a*_),z=Math.log(Math.sqrt(N*N+1)-N),V=Math.log(Math.sqrt(M*M+1)-M);E=(V-z)/n,A=function(O){var k=O*E,X=ox(z),st=h/(a*_)*(X*p5(n*k+z)-m5(z));return[d+st*x,p+st*S,h*X/ox(n*k+z)]}}return A.duration=E*1e3*n/Math.SQRT2,A}return l.rho=function(u){var c=Math.max(.001,+u),d=c*c,p=d*d;return t(c,d,p)},l})(Math.SQRT2,2,4);var Rs=0,qo=0,Bo=0,ES=1e3,Du,Xo,Ru=0,Na=0,qu=0,rr=typeof performance=="object"&&performance.now?performance:Date,TS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Sm(){return Na||(TS(g5),Na=rr.now()+qu)}function g5(){Na=0}function ju(){this._call=this._time=this._next=null}ju.prototype=wm.prototype={constructor:ju,restart:function(t,n,a){if(typeof t!="function")throw new TypeError("callback is not a function");a=(a==null?Sm():+a)+(n==null?0:+n),!this._next&&Xo!==this&&(Xo?Xo._next=this:Du=this,Xo=this),this._call=t,this._time=a,Ch()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ch())}};function wm(t,n,a){var o=new ju;return o.restart(t,n,a),o}function y5(){Sm(),++Rs;for(var t=Du,n;t;)(n=Na-t._time)>=0&&t._call.call(void 0,n),t=t._next;--Rs}function rx(){Na=(Ru=rr.now())+qu,Rs=qo=0;try{y5()}finally{Rs=0,x5(),Na=0}}function v5(){var t=rr.now(),n=t-Ru;n>ES&&(qu-=n,Ru=t)}function x5(){for(var t,n=Du,a,o=1/0;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(a=n._next,n._next=null,n=t?t._next=a:Du=a);Xo=t,Ch(o)}function Ch(t){if(!Rs){qo&&(qo=clearTimeout(qo));var n=t-Na;n>24?(t<1/0&&(qo=setTimeout(rx,t-rr.now()-qu)),Bo&&(Bo=clearInterval(Bo))):(Bo||(Ru=rr.now(),Bo=setInterval(v5,ES)),Rs=1,TS(rx))}}function lx(t,n,a){var o=new ju;return n=n==null?0:+n,o.restart(l=>{o.stop(),t(l+n)},n,a),o}var b5=xr("start","end","cancel","interrupt"),S5=[],AS=0,ux=1,Dh=2,pu=3,cx=4,Rh=5,gu=6;function Xu(t,n,a,o,l,u){var c=t.__transition;if(!c)t.__transition={};else if(a in c)return;w5(t,a,{name:n,index:o,group:l,on:b5,tween:S5,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:AS})}function Em(t,n){var a=xn(t,n);if(a.state>AS)throw new Error("too late; already scheduled");return a}function Rn(t,n){var a=xn(t,n);if(a.state>pu)throw new Error("too late; already running");return a}function xn(t,n){var a=t.__transition;if(!a||!(a=a[n]))throw new Error("transition not found");return a}function w5(t,n,a){var o=t.__transition,l;o[n]=a,a.timer=wm(u,0,a.time);function u(h){a.state=ux,a.timer.restart(c,a.delay,a.time),a.delay<=h&&c(h-a.delay)}function c(h){var g,y,v,x;if(a.state!==ux)return p();for(g in o)if(x=o[g],x.name===a.name){if(x.state===pu)return lx(c);x.state===cx?(x.state=gu,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete o[g]):+g<n&&(x.state=gu,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete o[g])}if(lx(function(){a.state===pu&&(a.state=cx,a.timer.restart(d,a.delay,a.time),d(h))}),a.state=Dh,a.on.call("start",t,t.__data__,a.index,a.group),a.state===Dh){for(a.state=pu,l=new Array(v=a.tween.length),g=0,y=-1;g<v;++g)(x=a.tween[g].value.call(t,t.__data__,a.index,a.group))&&(l[++y]=x);l.length=y+1}}function d(h){for(var g=h<a.duration?a.ease.call(null,h/a.duration):(a.timer.restart(p),a.state=Rh,1),y=-1,v=l.length;++y<v;)l[y].call(t,g);a.state===Rh&&(a.on.call("end",t,t.__data__,a.index,a.group),p())}function p(){a.state=gu,a.timer.stop(),delete o[n];for(var h in o)return;delete t.__transition}}function yu(t,n){var a=t.__transition,o,l,u=!0,c;if(a){n=n==null?null:n+"";for(c in a){if((o=a[c]).name!==n){u=!1;continue}l=o.state>Dh&&o.state<Rh,o.state=gu,o.timer.stop(),o.on.call(l?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete a[c]}u&&delete t.__transition}}function E5(t){return this.each(function(){yu(this,t)})}function T5(t,n){var a,o;return function(){var l=Rn(this,t),u=l.tween;if(u!==a){o=a=u;for(var c=0,d=o.length;c<d;++c)if(o[c].name===n){o=o.slice(),o.splice(c,1);break}}l.tween=o}}function A5(t,n,a){var o,l;if(typeof a!="function")throw new Error;return function(){var u=Rn(this,t),c=u.tween;if(c!==o){l=(o=c).slice();for(var d={name:n,value:a},p=0,h=l.length;p<h;++p)if(l[p].name===n){l[p]=d;break}p===h&&l.push(d)}u.tween=l}}function N5(t,n){var a=this._id;if(t+="",arguments.length<2){for(var o=xn(this.node(),a).tween,l=0,u=o.length,c;l<u;++l)if((c=o[l]).name===t)return c.value;return null}return this.each((n==null?T5:A5)(a,t,n))}function Tm(t,n,a){var o=t._id;return t.each(function(){var l=Rn(this,o);(l.value||(l.value={}))[n]=a.apply(this,arguments)}),function(l){return xn(l,o).value[n]}}function NS(t,n){var a;return(typeof n=="number"?Nn:n instanceof Aa?Cu:(a=Aa(n))?(n=a,Cu):bS)(t,n)}function M5(t){return function(){this.removeAttribute(t)}}function _5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function C5(t,n,a){var o,l=a+"",u;return function(){var c=this.getAttribute(t);return c===l?null:c===o?u:u=n(o=c,a)}}function D5(t,n,a){var o,l=a+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===l?null:c===o?u:u=n(o=c,a)}}function R5(t,n,a){var o,l,u;return function(){var c,d=a(this),p;return d==null?void this.removeAttribute(t):(c=this.getAttribute(t),p=d+"",c===p?null:c===o&&p===l?u:(l=p,u=n(o=c,d)))}}function j5(t,n,a){var o,l,u;return function(){var c,d=a(this),p;return d==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),p=d+"",c===p?null:c===o&&p===l?u:(l=p,u=n(o=c,d)))}}function z5(t,n){var a=Yu(t),o=a==="transform"?d5:NS;return this.attrTween(t,typeof n=="function"?(a.local?j5:R5)(a,o,Tm(this,"attr."+t,n)):n==null?(a.local?_5:M5)(a):(a.local?D5:C5)(a,o,n))}function O5(t,n){return function(a){this.setAttribute(t,n.call(this,a))}}function V5(t,n){return function(a){this.setAttributeNS(t.space,t.local,n.call(this,a))}}function L5(t,n){var a,o;function l(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&V5(t,u)),a}return l._value=n,l}function H5(t,n){var a,o;function l(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&O5(t,u)),a}return l._value=n,l}function B5(t,n){var a="attr."+t;if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;var o=Yu(t);return this.tween(a,(o.local?L5:H5)(o,n))}function k5(t,n){return function(){Em(this,t).delay=+n.apply(this,arguments)}}function U5(t,n){return n=+n,function(){Em(this,t).delay=n}}function Y5(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?k5:U5)(n,t)):xn(this.node(),n).delay}function q5(t,n){return function(){Rn(this,t).duration=+n.apply(this,arguments)}}function X5(t,n){return n=+n,function(){Rn(this,t).duration=n}}function G5(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?q5:X5)(n,t)):xn(this.node(),n).duration}function $5(t,n){if(typeof n!="function")throw new Error;return function(){Rn(this,t).ease=n}}function Z5(t){var n=this._id;return arguments.length?this.each($5(n,t)):xn(this.node(),n).ease}function P5(t,n){return function(){var a=n.apply(this,arguments);if(typeof a!="function")throw new Error;Rn(this,t).ease=a}}function I5(t){if(typeof t!="function")throw new Error;return this.each(P5(this._id,t))}function K5(t){typeof t!="function"&&(t=aS(t));for(var n=this._groups,a=n.length,o=new Array(a),l=0;l<a;++l)for(var u=n[l],c=u.length,d=o[l]=[],p,h=0;h<c;++h)(p=u[h])&&t.call(p,p.__data__,h,u)&&d.push(p);return new si(o,this._parents,this._name,this._id)}function Q5(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,a=t._groups,o=n.length,l=a.length,u=Math.min(o,l),c=new Array(o),d=0;d<u;++d)for(var p=n[d],h=a[d],g=p.length,y=c[d]=new Array(g),v,x=0;x<g;++x)(v=p[x]||h[x])&&(y[x]=v);for(;d<o;++d)c[d]=n[d];return new si(c,this._parents,this._name,this._id)}function F5(t){return(t+"").trim().split(/^|\s+/).every(function(n){var a=n.indexOf(".");return a>=0&&(n=n.slice(0,a)),!n||n==="start"})}function J5(t,n,a){var o,l,u=F5(n)?Em:Rn;return function(){var c=u(this,t),d=c.on;d!==o&&(l=(o=d).copy()).on(n,a),c.on=l}}function W5(t,n){var a=this._id;return arguments.length<2?xn(this.node(),a).on.on(t):this.each(J5(a,t,n))}function t4(t){return function(){var n=this.parentNode;for(var a in this.__transition)if(+a!==t)return;n&&n.removeChild(this)}}function e4(){return this.on("end.remove",t4(this._id))}function n4(t){var n=this._name,a=this._id;typeof t!="function"&&(t=ym(t));for(var o=this._groups,l=o.length,u=new Array(l),c=0;c<l;++c)for(var d=o[c],p=d.length,h=u[c]=new Array(p),g,y,v=0;v<p;++v)(g=d[v])&&(y=t.call(g,g.__data__,v,d))&&("__data__"in g&&(y.__data__=g.__data__),h[v]=y,Xu(h[v],n,a,v,h,xn(g,a)));return new si(u,this._parents,n,a)}function i4(t){var n=this._name,a=this._id;typeof t!="function"&&(t=iS(t));for(var o=this._groups,l=o.length,u=[],c=[],d=0;d<l;++d)for(var p=o[d],h=p.length,g,y=0;y<h;++y)if(g=p[y]){for(var v=t.call(g,g.__data__,y,p),x,S=xn(g,a),T=0,A=v.length;T<A;++T)(x=v[T])&&Xu(x,n,a,T,v,S);u.push(v),c.push(g)}return new si(u,c,n,a)}var a4=br.prototype.constructor;function s4(){return new a4(this._groups,this._parents)}function o4(t,n){var a,o,l;return function(){var u=Ds(this,t),c=(this.style.removeProperty(t),Ds(this,t));return u===c?null:u===a&&c===o?l:l=n(a=u,o=c)}}function MS(t){return function(){this.style.removeProperty(t)}}function r4(t,n,a){var o,l=a+"",u;return function(){var c=Ds(this,t);return c===l?null:c===o?u:u=n(o=c,a)}}function l4(t,n,a){var o,l,u;return function(){var c=Ds(this,t),d=a(this),p=d+"";return d==null&&(p=d=(this.style.removeProperty(t),Ds(this,t))),c===p?null:c===o&&p===l?u:(l=p,u=n(o=c,d))}}function u4(t,n){var a,o,l,u="style."+n,c="end."+u,d;return function(){var p=Rn(this,t),h=p.on,g=p.value[u]==null?d||(d=MS(n)):void 0;(h!==a||l!==g)&&(o=(a=h).copy()).on(c,l=g),p.on=o}}function c4(t,n,a){var o=(t+="")=="transform"?f5:NS;return n==null?this.styleTween(t,o4(t,o)).on("end.style."+t,MS(t)):typeof n=="function"?this.styleTween(t,l4(t,o,Tm(this,"style."+t,n))).each(u4(this._id,t)):this.styleTween(t,r4(t,o,n),a).on("end.style."+t,null)}function f4(t,n,a){return function(o){this.style.setProperty(t,n.call(this,o),a)}}function d4(t,n,a){var o,l;function u(){var c=n.apply(this,arguments);return c!==l&&(o=(l=c)&&f4(t,c,a)),o}return u._value=n,u}function h4(t,n,a){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;return this.tween(o,d4(t,n,a??""))}function m4(t){return function(){this.textContent=t}}function p4(t){return function(){var n=t(this);this.textContent=n??""}}function g4(t){return this.tween("text",typeof t=="function"?p4(Tm(this,"text",t)):m4(t==null?"":t+""))}function y4(t){return function(n){this.textContent=t.call(this,n)}}function v4(t){var n,a;function o(){var l=t.apply(this,arguments);return l!==a&&(n=(a=l)&&y4(l)),n}return o._value=t,o}function x4(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,v4(t))}function b4(){for(var t=this._name,n=this._id,a=_S(),o=this._groups,l=o.length,u=0;u<l;++u)for(var c=o[u],d=c.length,p,h=0;h<d;++h)if(p=c[h]){var g=xn(p,n);Xu(p,t,a,h,c,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new si(o,this._parents,t,a)}function S4(){var t,n,a=this,o=a._id,l=a.size();return new Promise(function(u,c){var d={value:c},p={value:function(){--l===0&&u()}};a.each(function(){var h=Rn(this,o),g=h.on;g!==t&&(n=(t=g).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(p)),h.on=n}),l===0&&u()})}var w4=0;function si(t,n,a,o){this._groups=t,this._parents=n,this._name=a,this._id=o}function _S(){return++w4}var ei=br.prototype;si.prototype={constructor:si,select:n4,selectAll:i4,selectChild:ei.selectChild,selectChildren:ei.selectChildren,filter:K5,merge:Q5,selection:s4,transition:b4,call:ei.call,nodes:ei.nodes,node:ei.node,size:ei.size,empty:ei.empty,each:ei.each,on:W5,attr:z5,attrTween:B5,style:c4,styleTween:h4,text:g4,textTween:x4,remove:e4,tween:N5,delay:Y5,duration:G5,ease:Z5,easeVarying:I5,end:S4,[Symbol.iterator]:ei[Symbol.iterator]};function E4(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var T4={time:null,delay:0,duration:250,ease:E4};function A4(t,n){for(var a;!(a=t.__transition)||!(a=a[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return a}function N4(t){var n,a;t instanceof si?(n=t._id,t=t._name):(n=_S(),(a=T4).time=Sm(),t=t==null?null:t+"");for(var o=this._groups,l=o.length,u=0;u<l;++u)for(var c=o[u],d=c.length,p,h=0;h<d;++h)(p=c[h])&&Xu(p,t,n,h,c,a||A4(p,n));return new si(o,this._parents,t,n)}br.prototype.interrupt=E5;br.prototype.transition=N4;const au=t=>()=>t;function M4(t,{sourceEvent:n,target:a,transform:o,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:l}})}function ni(t,n,a){this.k=t,this.x=n,this.y=a}ni.prototype={constructor:ni,scale:function(t){return t===1?this:new ni(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new ni(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gu=new ni(1,0,0);CS.prototype=ni.prototype;function CS(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gu;return t.__zoom}function Yd(t){t.stopImmediatePropagation()}function ko(t){t.preventDefault(),t.stopImmediatePropagation()}function _4(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function C4(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function fx(){return this.__zoom||Gu}function D4(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function R4(){return navigator.maxTouchPoints||"ontouchstart"in this}function j4(t,n,a){var o=t.invertX(n[0][0])-a[0][0],l=t.invertX(n[1][0])-a[1][0],u=t.invertY(n[0][1])-a[0][1],c=t.invertY(n[1][1])-a[1][1];return t.translate(l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function DS(){var t=_4,n=C4,a=j4,o=D4,l=R4,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],d=250,p=mu,h=xr("start","zoom","end"),g,y,v,x=500,S=150,T=0,A=10;function E(L){L.property("__zoom",fx).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",st).filter(l).on("touchstart.zoom",P).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",it).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(L,$,D,H){var U=L.selection?L.selection():L;U.property("__zoom",fx),L!==U?z(L,$,D,H):U.interrupt().each(function(){V(this,arguments).event(H).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},E.scaleBy=function(L,$,D,H){E.scaleTo(L,function(){var U=this.__zoom.k,Z=typeof $=="function"?$.apply(this,arguments):$;return U*Z},D,H)},E.scaleTo=function(L,$,D,H){E.transform(L,function(){var U=n.apply(this,arguments),Z=this.__zoom,tt=D==null?M(U):typeof D=="function"?D.apply(this,arguments):D,j=Z.invert(tt),Y=typeof $=="function"?$.apply(this,arguments):$;return a(N(_(Z,Y),tt,j),U,c)},D,H)},E.translateBy=function(L,$,D,H){E.transform(L,function(){return a(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof D=="function"?D.apply(this,arguments):D),n.apply(this,arguments),c)},null,H)},E.translateTo=function(L,$,D,H,U){E.transform(L,function(){var Z=n.apply(this,arguments),tt=this.__zoom,j=H==null?M(Z):typeof H=="function"?H.apply(this,arguments):H;return a(Gu.translate(j[0],j[1]).scale(tt.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof D=="function"?-D.apply(this,arguments):-D),Z,c)},H,U)};function _(L,$){return $=Math.max(u[0],Math.min(u[1],$)),$===L.k?L:new ni($,L.x,L.y)}function N(L,$,D){var H=$[0]-D[0]*L.k,U=$[1]-D[1]*L.k;return H===L.x&&U===L.y?L:new ni(L.k,H,U)}function M(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function z(L,$,D,H){L.on("start.zoom",function(){V(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){V(this,arguments).event(H).end()}).tween("zoom",function(){var U=this,Z=arguments,tt=V(U,Z).event(H),j=n.apply(U,Z),Y=D==null?M(j):typeof D=="function"?D.apply(U,Z):D,W=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),et=U.__zoom,rt=typeof $=="function"?$.apply(U,Z):$,ut=p(et.invert(Y).concat(W/et.k),rt.invert(Y).concat(W/rt.k));return function(ct){if(ct===1)ct=rt;else{var lt=ut(ct),ft=W/lt[2];ct=new ni(ft,Y[0]-lt[0]*ft,Y[1]-lt[1]*ft)}tt.zoom(null,ct)}})}function V(L,$,D){return!D&&L.__zooming||new O(L,$)}function O(L,$){this.that=L,this.args=$,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,$),this.taps=0}O.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,$){return this.mouse&&L!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var $=Pe(this.that).datum();h.call(L,this.that,new M4(L,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),$)}};function k(L,...$){if(!t.apply(this,arguments))return;var D=V(this,$).event(L),H=this.__zoom,U=Math.max(u[0],Math.min(u[1],H.k*Math.pow(2,o.apply(this,arguments)))),Z=pn(L);if(D.wheel)(D.mouse[0][0]!==Z[0]||D.mouse[0][1]!==Z[1])&&(D.mouse[1]=H.invert(D.mouse[0]=Z)),clearTimeout(D.wheel);else{if(H.k===U)return;D.mouse=[Z,H.invert(Z)],yu(this),D.start()}ko(L),D.wheel=setTimeout(tt,S),D.zoom("mouse",a(N(_(H,U),D.mouse[0],D.mouse[1]),D.extent,c));function tt(){D.wheel=null,D.end()}}function X(L,...$){if(v||!t.apply(this,arguments))return;var D=L.currentTarget,H=V(this,$,!0).event(L),U=Pe(L.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",W,!0),Z=pn(L,D),tt=L.clientX,j=L.clientY;mS(L.view),Yd(L),H.mouse=[Z,this.__zoom.invert(Z)],yu(this),H.start();function Y(et){if(ko(et),!H.moved){var rt=et.clientX-tt,ut=et.clientY-j;H.moved=rt*rt+ut*ut>T}H.event(et).zoom("mouse",a(N(H.that.__zoom,H.mouse[0]=pn(et,D),H.mouse[1]),H.extent,c))}function W(et){U.on("mousemove.zoom mouseup.zoom",null),pS(et.view,H.moved),ko(et),H.event(et).end()}}function st(L,...$){if(t.apply(this,arguments)){var D=this.__zoom,H=pn(L.changedTouches?L.changedTouches[0]:L,this),U=D.invert(H),Z=D.k*(L.shiftKey?.5:2),tt=a(N(_(D,Z),H,U),n.apply(this,$),c);ko(L),d>0?Pe(this).transition().duration(d).call(z,tt,H,L):Pe(this).call(E.transform,tt,H,L)}}function P(L,...$){if(t.apply(this,arguments)){var D=L.touches,H=D.length,U=V(this,$,L.changedTouches.length===H).event(L),Z,tt,j,Y;for(Yd(L),tt=0;tt<H;++tt)j=D[tt],Y=pn(j,this),Y=[Y,this.__zoom.invert(Y),j.identifier],U.touch0?!U.touch1&&U.touch0[2]!==Y[2]&&(U.touch1=Y,U.taps=0):(U.touch0=Y,Z=!0,U.taps=1+!!g);g&&(g=clearTimeout(g)),Z&&(U.taps<2&&(y=Y[0],g=setTimeout(function(){g=null},x)),yu(this),U.start())}}function F(L,...$){if(this.__zooming){var D=V(this,$).event(L),H=L.changedTouches,U=H.length,Z,tt,j,Y;for(ko(L),Z=0;Z<U;++Z)tt=H[Z],j=pn(tt,this),D.touch0&&D.touch0[2]===tt.identifier?D.touch0[0]=j:D.touch1&&D.touch1[2]===tt.identifier&&(D.touch1[0]=j);if(tt=D.that.__zoom,D.touch1){var W=D.touch0[0],et=D.touch0[1],rt=D.touch1[0],ut=D.touch1[1],ct=(ct=rt[0]-W[0])*ct+(ct=rt[1]-W[1])*ct,lt=(lt=ut[0]-et[0])*lt+(lt=ut[1]-et[1])*lt;tt=_(tt,Math.sqrt(ct/lt)),j=[(W[0]+rt[0])/2,(W[1]+rt[1])/2],Y=[(et[0]+ut[0])/2,(et[1]+ut[1])/2]}else if(D.touch0)j=D.touch0[0],Y=D.touch0[1];else return;D.zoom("touch",a(N(tt,j,Y),D.extent,c))}}function it(L,...$){if(this.__zooming){var D=V(this,$).event(L),H=L.changedTouches,U=H.length,Z,tt;for(Yd(L),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),Z=0;Z<U;++Z)tt=H[Z],D.touch0&&D.touch0[2]===tt.identifier?delete D.touch0:D.touch1&&D.touch1[2]===tt.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(tt=pn(tt,this),Math.hypot(y[0]-tt[0],y[1]-tt[1])<A)){var j=Pe(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return E.wheelDelta=function(L){return arguments.length?(o=typeof L=="function"?L:au(+L),E):o},E.filter=function(L){return arguments.length?(t=typeof L=="function"?L:au(!!L),E):t},E.touchable=function(L){return arguments.length?(l=typeof L=="function"?L:au(!!L),E):l},E.extent=function(L){return arguments.length?(n=typeof L=="function"?L:au([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),E):n},E.scaleExtent=function(L){return arguments.length?(u[0]=+L[0],u[1]=+L[1],E):[u[0],u[1]]},E.translateExtent=function(L){return arguments.length?(c[0][0]=+L[0][0],c[1][0]=+L[1][0],c[0][1]=+L[0][1],c[1][1]=+L[1][1],E):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},E.constrain=function(L){return arguments.length?(a=L,E):a},E.duration=function(L){return arguments.length?(d=+L,E):d},E.interpolate=function(L){return arguments.length?(p=L,E):p},E.on=function(){var L=h.on.apply(h,arguments);return L===h?E:L},E.clickDistance=function(L){return arguments.length?(T=(L=+L)*L,E):Math.sqrt(T)},E.tapDistance=function(L){return arguments.length?(A=+L,E):A},E}const Dn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:n,sourceHandle:a,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?a:o}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},lr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],RS=["Enter"," ","Escape"],jS={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:n,y:a})=>`Moved selected node ${t}. New position, x: ${n}, y: ${a}`,"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 js;(function(t){t.Strict="strict",t.Loose="loose"})(js||(js={}));var Ta;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ta||(Ta={}));var ur;(function(t){t.Partial="partial",t.Full="full"})(ur||(ur={}));const zS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ki;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(ki||(ki={}));var zu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(zu||(zu={}));var pt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(pt||(pt={}));const dx={[pt.Left]:pt.Right,[pt.Right]:pt.Left,[pt.Top]:pt.Bottom,[pt.Bottom]:pt.Top};function OS(t){return t===null?null:t?"valid":"invalid"}const VS=t=>"id"in t&&"source"in t&&"target"in t,z4=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Am=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),wr=(t,n=[0,0])=>{const{width:a,height:o}=oi(t),l=t.origin??n,u=a*l[0],c=o*l[1];return{x:t.position.x-u,y:t.position.y-c}},O4=(t,n={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const a=t.reduce((o,l)=>{const u=typeof l=="string";let c=!n.nodeLookup&&!u?l:void 0;n.nodeLookup&&(c=u?n.nodeLookup.get(l):Am(l)?l:n.nodeLookup.get(l.id));const d=c?Ou(c,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return $u(o,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zu(a)},Er=(t,n={})=>{let a={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(l=>{(n.filter===void 0||n.filter(l))&&(a=$u(a,Ou(l)),o=!0)}),o?Zu(a):{x:0,y:0,width:0,height:0}},Nm=(t,n,[a,o,l]=[0,0,1],u=!1,c=!1)=>{const d={...Ar(n,[a,o,l]),width:n.width/l,height:n.height/l},p=[];for(const h of t.values()){const{measured:g,selectable:y=!0,hidden:v=!1}=h;if(c&&!y||v)continue;const x=g.width??h.width??h.initialWidth??null,S=g.height??h.height??h.initialHeight??null,T=cr(d,Os(h)),A=(x??0)*(S??0),E=u&&T>0;(!h.internals.handleBounds||E||T>=A||h.dragging)&&p.push(h)}return p},V4=(t,n)=>{const a=new Set;return t.forEach(o=>{a.add(o.id)}),n.filter(o=>a.has(o.source)||a.has(o.target))};function L4(t,n){const a=new Map,o=n?.nodes?new Set(n.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&(n?.includeHiddenNodes||!l.hidden)&&(!o||o.has(l.id))&&a.set(l.id,l)}),a}async function H4({nodes:t,width:n,height:a,panZoom:o,minZoom:l,maxZoom:u},c){if(t.size===0)return Promise.resolve(!0);const d=L4(t,c),p=Er(d),h=Mm(p,n,a,c?.minZoom??l,c?.maxZoom??u,c?.padding??.1);return await o.setViewport(h,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function LS({nodeId:t,nextPosition:n,nodeLookup:a,nodeOrigin:o=[0,0],nodeExtent:l,onError:u}){const c=a.get(t),d=c.parentId?a.get(c.parentId):void 0,{x:p,y:h}=d?d.internals.positionAbsolute:{x:0,y:0},g=c.origin??o;let y=c.extent||l;if(c.extent==="parent"&&!c.expandParent)if(!d)u?.("005",Dn.error005());else{const x=d.measured.width,S=d.measured.height;x&&S&&(y=[[p,h],[p+x,h+S]])}else d&&Vs(c.extent)&&(y=[[c.extent[0][0]+p,c.extent[0][1]+h],[c.extent[1][0]+p,c.extent[1][1]+h]]);const v=Vs(y)?Ma(n,y,c.measured):n;return(c.measured.width===void 0||c.measured.height===void 0)&&u?.("015",Dn.error015()),{position:{x:v.x-p+(c.measured.width??0)*g[0],y:v.y-h+(c.measured.height??0)*g[1]},positionAbsolute:v}}async function B4({nodesToRemove:t=[],edgesToRemove:n=[],nodes:a,edges:o,onBeforeDelete:l}){const u=new Set(t.map(v=>v.id)),c=[];for(const v of a){if(v.deletable===!1)continue;const x=u.has(v.id),S=!x&&v.parentId&&c.find(T=>T.id===v.parentId);(x||S)&&c.push(v)}const d=new Set(n.map(v=>v.id)),p=o.filter(v=>v.deletable!==!1),g=V4(c,p);for(const v of p)d.has(v.id)&&!g.find(S=>S.id===v.id)&&g.push(v);if(!l)return{edges:g,nodes:c};const y=await l({nodes:c,edges:g});return typeof y=="boolean"?y?{edges:g,nodes:c}:{edges:[],nodes:[]}:y}const zs=(t,n=0,a=1)=>Math.min(Math.max(t,n),a),Ma=(t={x:0,y:0},n,a)=>({x:zs(t.x,n[0][0],n[1][0]-(a?.width??0)),y:zs(t.y,n[0][1],n[1][1]-(a?.height??0))});function HS(t,n,a){const{width:o,height:l}=oi(a),{x:u,y:c}=a.internals.positionAbsolute;return Ma(t,[[u,c],[u+o,c+l]],n)}const hx=(t,n,a)=>t<n?zs(Math.abs(t-n),1,n)/n:t>a?-zs(Math.abs(t-a),1,n)/n:0,BS=(t,n,a=15,o=40)=>{const l=hx(t.x,o,n.width-o)*a,u=hx(t.y,o,n.height-o)*a;return[l,u]},$u=(t,n)=>({x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),x2:Math.max(t.x2,n.x2),y2:Math.max(t.y2,n.y2)}),jh=({x:t,y:n,width:a,height:o})=>({x:t,y:n,x2:t+a,y2:n+o}),Zu=({x:t,y:n,x2:a,y2:o})=>({x:t,y:n,width:a-t,height:o-n}),Os=(t,n=[0,0])=>{const{x:a,y:o}=Am(t)?t.internals.positionAbsolute:wr(t,n);return{x:a,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Ou=(t,n=[0,0])=>{const{x:a,y:o}=Am(t)?t.internals.positionAbsolute:wr(t,n);return{x:a,y:o,x2:a+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},kS=(t,n)=>Zu($u(jh(t),jh(n))),cr=(t,n)=>{const a=Math.max(0,Math.min(t.x+t.width,n.x+n.width)-Math.max(t.x,n.x)),o=Math.max(0,Math.min(t.y+t.height,n.y+n.height)-Math.max(t.y,n.y));return Math.ceil(a*o)},mx=t=>yn(t.width)&&yn(t.height)&&yn(t.x)&&yn(t.y),yn=t=>!isNaN(t)&&isFinite(t),k4=(t,n)=>{},Tr=(t,n=[1,1])=>({x:n[0]*Math.round(t.x/n[0]),y:n[1]*Math.round(t.y/n[1])}),Ar=({x:t,y:n},[a,o,l],u=!1,c=[1,1])=>{const d={x:(t-a)/l,y:(n-o)/l};return u?Tr(d,c):d},Vu=({x:t,y:n},[a,o,l])=>({x:t*l+a,y:n*l+o});function ys(t,n){if(typeof t=="number")return Math.floor((n-n/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const a=parseFloat(t);if(!Number.isNaN(a))return Math.floor(a)}if(typeof t=="string"&&t.endsWith("%")){const a=parseFloat(t);if(!Number.isNaN(a))return Math.floor(n*a*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function U4(t,n,a){if(typeof t=="string"||typeof t=="number"){const o=ys(t,a),l=ys(t,n);return{top:o,right:l,bottom:o,left:l,x:l*2,y:o*2}}if(typeof t=="object"){const o=ys(t.top??t.y??0,a),l=ys(t.bottom??t.y??0,a),u=ys(t.left??t.x??0,n),c=ys(t.right??t.x??0,n);return{top:o,right:c,bottom:l,left:u,x:u+c,y:o+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Y4(t,n,a,o,l,u){const{x:c,y:d}=Vu(t,[n,a,o]),{x:p,y:h}=Vu({x:t.x+t.width,y:t.y+t.height},[n,a,o]),g=l-p,y=u-h;return{left:Math.floor(c),top:Math.floor(d),right:Math.floor(g),bottom:Math.floor(y)}}const Mm=(t,n,a,o,l,u)=>{const c=U4(u,n,a),d=(n-c.x)/t.width,p=(a-c.y)/t.height,h=Math.min(d,p),g=zs(h,o,l),y=t.x+t.width/2,v=t.y+t.height/2,x=n/2-y*g,S=a/2-v*g,T=Y4(t,x,S,g,n,a),A={left:Math.min(T.left-c.left,0),top:Math.min(T.top-c.top,0),right:Math.min(T.right-c.right,0),bottom:Math.min(T.bottom-c.bottom,0)};return{x:x-A.left+A.right,y:S-A.top+A.bottom,zoom:g}},fr=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Vs(t){return t!=null&&t!=="parent"}function oi(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function US(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function YS(t,n={width:0,height:0},a,o,l){const u={...t},c=o.get(a);if(c){const d=c.origin||l;u.x+=c.internals.positionAbsolute.x-(n.width??0)*d[0],u.y+=c.internals.positionAbsolute.y-(n.height??0)*d[1]}return u}function px(t,n){if(t.size!==n.size)return!1;for(const a of t)if(!n.has(a))return!1;return!0}function q4(){let t,n;return{promise:new Promise((o,l)=>{t=o,n=l}),resolve:t,reject:n}}function X4(t){return{...jS,...t||{}}}function Ko(t,{snapGrid:n=[0,0],snapToGrid:a=!1,transform:o,containerBounds:l}){const{x:u,y:c}=vn(t),d=Ar({x:u-(l?.left??0),y:c-(l?.top??0)},o),{x:p,y:h}=a?Tr(d,n):d;return{xSnapped:p,ySnapped:h,...d}}const _m=t=>({width:t.offsetWidth,height:t.offsetHeight}),qS=t=>t?.getRootNode?.()||window?.document,G4=["INPUT","SELECT","TEXTAREA"];function XS(t){const n=t.composedPath?.()?.[0]||t.target;return n?.nodeType!==1?!1:G4.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const GS=t=>"clientX"in t,vn=(t,n)=>{const a=GS(t),o=a?t.clientX:t.touches?.[0].clientX,l=a?t.clientY:t.touches?.[0].clientY;return{x:o-(n?.left??0),y:l-(n?.top??0)}},gx=(t,n,a,o,l)=>{const u=n.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const d=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:l,position:c.getAttribute("data-handlepos"),x:(d.left-a.left)/o,y:(d.top-a.top)/o,..._m(c)}})};function $S({sourceX:t,sourceY:n,targetX:a,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d}){const p=t*.125+l*.375+c*.375+a*.125,h=n*.125+u*.375+d*.375+o*.125,g=Math.abs(p-t),y=Math.abs(h-n);return[p,h,g,y]}function su(t,n){return t>=0?.5*t:n*25*Math.sqrt(-t)}function yx({pos:t,x1:n,y1:a,x2:o,y2:l,c:u}){switch(t){case pt.Left:return[n-su(n-o,u),a];case pt.Right:return[n+su(o-n,u),a];case pt.Top:return[n,a-su(a-l,u)];case pt.Bottom:return[n,a+su(l-a,u)]}}function Cm({sourceX:t,sourceY:n,sourcePosition:a=pt.Bottom,targetX:o,targetY:l,targetPosition:u=pt.Top,curvature:c=.25}){const[d,p]=yx({pos:a,x1:t,y1:n,x2:o,y2:l,c}),[h,g]=yx({pos:u,x1:o,y1:l,x2:t,y2:n,c}),[y,v,x,S]=$S({sourceX:t,sourceY:n,targetX:o,targetY:l,sourceControlX:d,sourceControlY:p,targetControlX:h,targetControlY:g});return[`M${t},${n} C${d},${p} ${h},${g} ${o},${l}`,y,v,x,S]}function ZS({sourceX:t,sourceY:n,targetX:a,targetY:o}){const l=Math.abs(a-t)/2,u=a<t?a+l:a-l,c=Math.abs(o-n)/2,d=o<n?o+c:o-c;return[u,d,l,c]}function $4({sourceNode:t,targetNode:n,selected:a=!1,zIndex:o=0,elevateOnSelect:l=!1,zIndexMode:u="basic"}){if(u==="manual")return o;const c=l&&a?o+1e3:o,d=Math.max(t.parentId||l&&t.selected?t.internals.z:0,n.parentId||l&&n.selected?n.internals.z:0);return c+d}function Z4({sourceNode:t,targetNode:n,width:a,height:o,transform:l}){const u=$u(Ou(t),Ou(n));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-l[0]/l[2],y:-l[1]/l[2],width:a/l[2],height:o/l[2]};return cr(c,Zu(u))>0}const P4=({source:t,sourceHandle:n,target:a,targetHandle:o})=>`xy-edge__${t}${n||""}-${a}${o||""}`,I4=(t,n)=>n.some(a=>a.source===t.source&&a.target===t.target&&(a.sourceHandle===t.sourceHandle||!a.sourceHandle&&!t.sourceHandle)&&(a.targetHandle===t.targetHandle||!a.targetHandle&&!t.targetHandle)),K4=(t,n,a={})=>{if(!t.source||!t.target)return n;const o=a.getEdgeId||P4;let l;return VS(t)?l={...t}:l={...t,id:o(t)},I4(l,n)?n:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,n.concat(l))};function PS({sourceX:t,sourceY:n,targetX:a,targetY:o}){const[l,u,c,d]=ZS({sourceX:t,sourceY:n,targetX:a,targetY:o});return[`M ${t},${n}L ${a},${o}`,l,u,c,d]}const vx={[pt.Left]:{x:-1,y:0},[pt.Right]:{x:1,y:0},[pt.Top]:{x:0,y:-1},[pt.Bottom]:{x:0,y:1}},Q4=({source:t,sourcePosition:n=pt.Bottom,target:a})=>n===pt.Left||n===pt.Right?t.x<a.x?{x:1,y:0}:{x:-1,y:0}:t.y<a.y?{x:0,y:1}:{x:0,y:-1},xx=(t,n)=>Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));function F4({source:t,sourcePosition:n=pt.Bottom,target:a,targetPosition:o=pt.Top,center:l,offset:u,stepPosition:c}){const d=vx[n],p=vx[o],h={x:t.x+d.x*u,y:t.y+d.y*u},g={x:a.x+p.x*u,y:a.y+p.y*u},y=Q4({source:h,sourcePosition:n,target:g}),v=y.x!==0?"x":"y",x=y[v];let S=[],T,A;const E={x:0,y:0},_={x:0,y:0},[,,N,M]=ZS({sourceX:t.x,sourceY:t.y,targetX:a.x,targetY:a.y});if(d[v]*p[v]===-1){v==="x"?(T=l.x??h.x+(g.x-h.x)*c,A=l.y??(h.y+g.y)/2):(T=l.x??(h.x+g.x)/2,A=l.y??h.y+(g.y-h.y)*c);const V=[{x:T,y:h.y},{x:T,y:g.y}],O=[{x:h.x,y:A},{x:g.x,y:A}];d[v]===x?S=v==="x"?V:O:S=v==="x"?O:V}else{const V=[{x:h.x,y:g.y}],O=[{x:g.x,y:h.y}];if(v==="x"?S=d.x===x?O:V:S=d.y===x?V:O,n===o){const F=Math.abs(t[v]-a[v]);if(F<=u){const it=Math.min(u-1,u-F);d[v]===x?E[v]=(h[v]>t[v]?-1:1)*it:_[v]=(g[v]>a[v]?-1:1)*it}}if(n!==o){const F=v==="x"?"y":"x",it=d[v]===p[F],L=h[F]>g[F],$=h[F]<g[F];(d[v]===1&&(!it&&L||it&&$)||d[v]!==1&&(!it&&$||it&&L))&&(S=v==="x"?V:O)}const k={x:h.x+E.x,y:h.y+E.y},X={x:g.x+_.x,y:g.y+_.y},st=Math.max(Math.abs(k.x-S[0].x),Math.abs(X.x-S[0].x)),P=Math.max(Math.abs(k.y-S[0].y),Math.abs(X.y-S[0].y));st>=P?(T=(k.x+X.x)/2,A=S[0].y):(T=S[0].x,A=(k.y+X.y)/2)}return[[t,{x:h.x+E.x,y:h.y+E.y},...S,{x:g.x+_.x,y:g.y+_.y},a],T,A,N,M]}function J4(t,n,a,o){const l=Math.min(xx(t,n)/2,xx(n,a)/2,o),{x:u,y:c}=n;if(t.x===u&&u===a.x||t.y===c&&c===a.y)return`L${u} ${c}`;if(t.y===c){const h=t.x<a.x?-1:1,g=t.y<a.y?1:-1;return`L ${u+l*h},${c}Q ${u},${c} ${u},${c+l*g}`}const d=t.x<a.x?1:-1,p=t.y<a.y?-1:1;return`L ${u},${c+l*p}Q ${u},${c} ${u+l*d},${c}`}function zh({sourceX:t,sourceY:n,sourcePosition:a=pt.Bottom,targetX:o,targetY:l,targetPosition:u=pt.Top,borderRadius:c=5,centerX:d,centerY:p,offset:h=20,stepPosition:g=.5}){const[y,v,x,S,T]=F4({source:{x:t,y:n},sourcePosition:a,target:{x:o,y:l},targetPosition:u,center:{x:d,y:p},offset:h,stepPosition:g});return[y.reduce((E,_,N)=>{let M="";return N>0&&N<y.length-1?M=J4(y[N-1],_,y[N+1],c):M=`${N===0?"M":"L"}${_.x} ${_.y}`,E+=M,E},""),v,x,S,T]}function bx(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function W4(t){const{sourceNode:n,targetNode:a}=t;if(!bx(n)||!bx(a))return null;const o=n.internals.handleBounds||Sx(n.handles),l=a.internals.handleBounds||Sx(a.handles),u=wx(o?.source??[],t.sourceHandle),c=wx(t.connectionMode===js.Strict?l?.target??[]:(l?.target??[]).concat(l?.source??[]),t.targetHandle);if(!u||!c)return t.onError?.("008",Dn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const d=u?.position||pt.Bottom,p=c?.position||pt.Top,h=_a(n,u,d),g=_a(a,c,p);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:d,targetPosition:p}}function Sx(t){if(!t)return null;const n=[],a=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?n.push(o):o.type==="target"&&a.push(o);return{source:n,target:a}}function _a(t,n,a=pt.Left,o=!1){const l=(n?.x??0)+t.internals.positionAbsolute.x,u=(n?.y??0)+t.internals.positionAbsolute.y,{width:c,height:d}=n??oi(t);if(o)return{x:l+c/2,y:u+d/2};switch(n?.position??a){case pt.Top:return{x:l+c/2,y:u};case pt.Right:return{x:l+c,y:u+d/2};case pt.Bottom:return{x:l+c/2,y:u+d};case pt.Left:return{x:l,y:u+d/2}}}function wx(t,n){return t&&(n?t.find(a=>a.id===n):t[0])||null}function Oh(t,n){return t?typeof t=="string"?t:`${n?`${n}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function tR(t,{id:n,defaultColor:a,defaultMarkerStart:o,defaultMarkerEnd:l}){const u=new Set;return t.reduce((c,d)=>([d.markerStart||o,d.markerEnd||l].forEach(p=>{if(p&&typeof p=="object"){const h=Oh(p,n);u.has(h)||(c.push({id:h,color:p.color||a,...p}),u.add(h))}}),c),[]).sort((c,d)=>c.id.localeCompare(d.id))}const IS=1e3,eR=10,Dm={nodeOrigin:[0,0],nodeExtent:lr,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nR={...Dm,checkEquality:!0};function Rm(t,n){const a={...t};for(const o in n)n[o]!==void 0&&(a[o]=n[o]);return a}function iR(t,n,a){const o=Rm(Dm,a);for(const l of t.values())if(l.parentId)zm(l,t,n,o);else{const u=wr(l,o.nodeOrigin),c=Vs(l.extent)?l.extent:o.nodeExtent,d=Ma(u,c,oi(l));l.internals.positionAbsolute=d}}function aR(t,n){if(!t.handles)return t.measured?n?.internals.handleBounds:void 0;const a=[],o=[];for(const l of t.handles){const u={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?a.push(u):l.type==="target"&&o.push(u)}return{source:a,target:o}}function jm(t){return t==="manual"}function Vh(t,n,a,o={}){const l=Rm(nR,o),u={i:0},c=new Map(n),d=l?.elevateNodesOnSelect&&!jm(l.zIndexMode)?IS:0;let p=t.length>0;n.clear(),a.clear();for(const h of t){let g=c.get(h.id);if(l.checkEquality&&h===g?.internals.userNode)n.set(h.id,g);else{const y=wr(h,l.nodeOrigin),v=Vs(h.extent)?h.extent:l.nodeExtent,x=Ma(y,v,oi(h));g={...l.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:x,handleBounds:aR(h,g),z:KS(h,d,l.zIndexMode),userNode:h}},n.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(p=!1),h.parentId&&zm(g,n,a,o,u)}return p}function sR(t,n){if(!t.parentId)return;const a=n.get(t.parentId);a?a.set(t.id,t):n.set(t.parentId,new Map([[t.id,t]]))}function zm(t,n,a,o,l){const{elevateNodesOnSelect:u,nodeOrigin:c,nodeExtent:d,zIndexMode:p}=Rm(Dm,o),h=t.parentId,g=n.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}sR(t,a),l&&!g.parentId&&g.internals.rootParentIndex===void 0&&p==="auto"&&(g.internals.rootParentIndex=++l.i,g.internals.z=g.internals.z+l.i*eR),l&&g.internals.rootParentIndex!==void 0&&(l.i=g.internals.rootParentIndex);const y=u&&!jm(p)?IS:0,{x:v,y:x,z:S}=oR(t,g,c,d,y,p),{positionAbsolute:T}=t.internals,A=v!==T.x||x!==T.y;(A||S!==t.internals.z)&&n.set(t.id,{...t,internals:{...t.internals,positionAbsolute:A?{x:v,y:x}:T,z:S}})}function KS(t,n,a){const o=yn(t.zIndex)?t.zIndex:0;return jm(a)?o:o+(t.selected?n:0)}function oR(t,n,a,o,l,u){const{x:c,y:d}=n.internals.positionAbsolute,p=oi(t),h=wr(t,a),g=Vs(t.extent)?Ma(h,t.extent,p):h;let y=Ma({x:c+g.x,y:d+g.y},o,p);t.extent==="parent"&&(y=HS(y,p,n));const v=KS(t,l,u),x=n.internals.z??0;return{x:y.x,y:y.y,z:x>=v?x+1:v}}function Om(t,n,a,o=[0,0]){const l=[],u=new Map;for(const c of t){const d=n.get(c.parentId);if(!d)continue;const p=u.get(c.parentId)?.expandedRect??Os(d),h=kS(p,c.rect);u.set(c.parentId,{expandedRect:h,parent:d})}return u.size>0&&u.forEach(({expandedRect:c,parent:d},p)=>{const h=d.internals.positionAbsolute,g=oi(d),y=d.origin??o,v=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,x=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,S=Math.max(g.width,Math.round(c.width)),T=Math.max(g.height,Math.round(c.height)),A=(S-g.width)*y[0],E=(T-g.height)*y[1];(v>0||x>0||A||E)&&(l.push({id:p,type:"position",position:{x:d.position.x-v+A,y:d.position.y-x+E}}),a.get(p)?.forEach(_=>{t.some(N=>N.id===_.id)||l.push({id:_.id,type:"position",position:{x:_.position.x+v,y:_.position.y+x}})})),(g.width<c.width||g.height<c.height||v||x)&&l.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:S+(v?y[0]*v-A:0),height:T+(x?y[1]*x-E:0)}})}),l}function rR(t,n,a,o,l,u,c){const d=o?.querySelector(".xyflow__viewport");let p=!1;if(!d)return{changes:[],updatedInternals:p};const h=[],g=window.getComputedStyle(d),{m22:y}=new window.DOMMatrixReadOnly(g.transform),v=[];for(const x of t.values()){const S=n.get(x.id);if(!S)continue;if(S.hidden){n.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),p=!0;continue}const T=_m(x.nodeElement),A=S.measured.width!==T.width||S.measured.height!==T.height;if(!!(T.width&&T.height&&(A||!S.internals.handleBounds||x.force))){const _=x.nodeElement.getBoundingClientRect(),N=Vs(S.extent)?S.extent:u;let{positionAbsolute:M}=S.internals;S.parentId&&S.extent==="parent"?M=HS(M,T,n.get(S.parentId)):N&&(M=Ma(M,N,T));const z={...S,measured:T,internals:{...S.internals,positionAbsolute:M,handleBounds:{source:gx("source",x.nodeElement,_,y,S.id),target:gx("target",x.nodeElement,_,y,S.id)}}};n.set(S.id,z),S.parentId&&zm(z,n,a,{nodeOrigin:l,zIndexMode:c}),p=!0,A&&(h.push({id:S.id,type:"dimensions",dimensions:T}),S.expandParent&&S.parentId&&v.push({id:S.id,parentId:S.parentId,rect:Os(z,l)}))}}if(v.length>0){const x=Om(v,n,a,l);h.push(...x)}return{changes:h,updatedInternals:p}}async function lR({delta:t,panZoom:n,transform:a,translateExtent:o,width:l,height:u}){if(!n||!t.x&&!t.y)return Promise.resolve(!1);const c=await n.setViewportConstrained({x:a[0]+t.x,y:a[1]+t.y,zoom:a[2]},[[0,0],[l,u]],o),d=!!c&&(c.x!==a[0]||c.y!==a[1]||c.k!==a[2]);return Promise.resolve(d)}function Ex(t,n,a,o,l,u){let c=l;const d=o.get(c)||new Map;o.set(c,d.set(a,n)),c=`${l}-${t}`;const p=o.get(c)||new Map;if(o.set(c,p.set(a,n)),u){c=`${l}-${t}-${u}`;const h=o.get(c)||new Map;o.set(c,h.set(a,n))}}function QS(t,n,a){t.clear(),n.clear();for(const o of a){const{source:l,target:u,sourceHandle:c=null,targetHandle:d=null}=o,p={edgeId:o.id,source:l,target:u,sourceHandle:c,targetHandle:d},h=`${l}-${c}--${u}-${d}`,g=`${u}-${d}--${l}-${c}`;Ex("source",p,g,t,l,c),Ex("target",p,h,t,u,d),n.set(o.id,o)}}function FS(t,n){if(!t.parentId)return!1;const a=n.get(t.parentId);return a?a.selected?!0:FS(a,n):!1}function Tx(t,n,a){let o=t;do{if(o?.matches?.(n))return!0;if(o===a)return!1;o=o?.parentElement}while(o);return!1}function uR(t,n,a,o){const l=new Map;for(const[u,c]of t)if((c.selected||c.id===o)&&(!c.parentId||!FS(c,t))&&(c.draggable||n&&typeof c.draggable>"u")){const d=t.get(u);d&&l.set(u,{id:u,position:d.position||{x:0,y:0},distance:{x:a.x-d.internals.positionAbsolute.x,y:a.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return l}function qd({nodeId:t,dragItems:n,nodeLookup:a,dragging:o=!0}){const l=[];for(const[c,d]of n){const p=a.get(c)?.internals.userNode;p&&l.push({...p,position:d.position,dragging:o})}if(!t)return[l[0],l];const u=a.get(t)?.internals.userNode;return[u?{...u,position:n.get(t)?.position||u.position,dragging:o}:l[0],l]}function cR({dragItems:t,snapGrid:n,x:a,y:o}){const l=t.values().next().value;if(!l)return null;const u={x:a-l.distance.x,y:o-l.distance.y},c=Tr(u,n);return{x:c.x-u.x,y:c.y-u.y}}function fR({onNodeMouseDown:t,getStoreItems:n,onDragStart:a,onDrag:o,onDragStop:l}){let u={x:null,y:null},c=0,d=new Map,p=!1,h={x:0,y:0},g=null,y=!1,v=null,x=!1,S=!1,T=null;function A({noDragClassName:_,handleSelector:N,domNode:M,isSelectable:z,nodeId:V,nodeClickDistance:O=0}){v=Pe(M);function k({x:F,y:it}){const{nodeLookup:L,nodeExtent:$,snapGrid:D,snapToGrid:H,nodeOrigin:U,onNodeDrag:Z,onSelectionDrag:tt,onError:j,updateNodePositions:Y}=n();u={x:F,y:it};let W=!1;const et=d.size>1,rt=et&&$?jh(Er(d)):null,ut=et&&H?cR({dragItems:d,snapGrid:D,x:F,y:it}):null;for(const[ct,lt]of d){if(!L.has(ct))continue;let ft={x:F-lt.distance.x,y:it-lt.distance.y};H&&(ft=ut?{x:Math.round(ft.x+ut.x),y:Math.round(ft.y+ut.y)}:Tr(ft,D));let Et=null;if(et&&$&&!lt.extent&&rt){const{positionAbsolute:xt}=lt.internals,Mt=xt.x-rt.x+$[0][0],Bt=xt.x+lt.measured.width-rt.x2+$[1][0],Vt=xt.y-rt.y+$[0][1],de=xt.y+lt.measured.height-rt.y2+$[1][1];Et=[[Mt,Vt],[Bt,de]]}const{position:St,positionAbsolute:yt}=LS({nodeId:ct,nextPosition:ft,nodeLookup:L,nodeExtent:Et||$,nodeOrigin:U,onError:j});W=W||lt.position.x!==St.x||lt.position.y!==St.y,lt.position=St,lt.internals.positionAbsolute=yt}if(S=S||W,!!W&&(Y(d,!0),T&&(o||Z||!V&&tt))){const[ct,lt]=qd({nodeId:V,dragItems:d,nodeLookup:L});o?.(T,d,ct,lt),Z?.(T,ct,lt),V||tt?.(T,lt)}}async function X(){if(!g)return;const{transform:F,panBy:it,autoPanSpeed:L,autoPanOnNodeDrag:$}=n();if(!$){p=!1,cancelAnimationFrame(c);return}const[D,H]=BS(h,g,L);(D!==0||H!==0)&&(u.x=(u.x??0)-D/F[2],u.y=(u.y??0)-H/F[2],await it({x:D,y:H})&&k(u)),c=requestAnimationFrame(X)}function st(F){const{nodeLookup:it,multiSelectionActive:L,nodesDraggable:$,transform:D,snapGrid:H,snapToGrid:U,selectNodesOnDrag:Z,onNodeDragStart:tt,onSelectionDragStart:j,unselectNodesAndEdges:Y}=n();y=!0,(!Z||!z)&&!L&&V&&(it.get(V)?.selected||Y()),z&&Z&&V&&t?.(V);const W=Ko(F.sourceEvent,{transform:D,snapGrid:H,snapToGrid:U,containerBounds:g});if(u=W,d=uR(it,$,W,V),d.size>0&&(a||tt||!V&&j)){const[et,rt]=qd({nodeId:V,dragItems:d,nodeLookup:it});a?.(F.sourceEvent,d,et,rt),tt?.(F.sourceEvent,et,rt),V||j?.(F.sourceEvent,rt)}}const P=gS().clickDistance(O).on("start",F=>{const{domNode:it,nodeDragThreshold:L,transform:$,snapGrid:D,snapToGrid:H}=n();g=it?.getBoundingClientRect()||null,x=!1,S=!1,T=F.sourceEvent,L===0&&st(F),u=Ko(F.sourceEvent,{transform:$,snapGrid:D,snapToGrid:H,containerBounds:g}),h=vn(F.sourceEvent,g)}).on("drag",F=>{const{autoPanOnNodeDrag:it,transform:L,snapGrid:$,snapToGrid:D,nodeDragThreshold:H,nodeLookup:U}=n(),Z=Ko(F.sourceEvent,{transform:L,snapGrid:$,snapToGrid:D,containerBounds:g});if(T=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||V&&!U.has(V))&&(x=!0),!x){if(!p&&it&&y&&(p=!0,X()),!y){const tt=vn(F.sourceEvent,g),j=tt.x-h.x,Y=tt.y-h.y;Math.sqrt(j*j+Y*Y)>H&&st(F)}(u.x!==Z.xSnapped||u.y!==Z.ySnapped)&&d&&y&&(h=vn(F.sourceEvent,g),k(Z))}}).on("end",F=>{if(!(!y||x)&&(p=!1,y=!1,cancelAnimationFrame(c),d.size>0)){const{nodeLookup:it,updateNodePositions:L,onNodeDragStop:$,onSelectionDragStop:D}=n();if(S&&(L(d,!1),S=!1),l||$||!V&&D){const[H,U]=qd({nodeId:V,dragItems:d,nodeLookup:it,dragging:!1});l?.(F.sourceEvent,d,H,U),$?.(F.sourceEvent,H,U),V||D?.(F.sourceEvent,U)}}}).filter(F=>{const it=F.target;return!F.button&&(!_||!Tx(it,`.${_}`,M))&&(!N||Tx(it,N,M))});v.call(P)}function E(){v?.on(".drag",null)}return{update:A,destroy:E}}function dR(t,n,a){const o=[],l={x:t.x-a,y:t.y-a,width:a*2,height:a*2};for(const u of n.values())cr(l,Os(u))>0&&o.push(u);return o}const hR=250;function mR(t,n,a,o){let l=[],u=1/0;const c=dR(t,a,n+hR);for(const d of c){const p=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const h of p){if(o.nodeId===h.nodeId&&o.type===h.type&&o.id===h.id)continue;const{x:g,y}=_a(d,h,h.position,!0),v=Math.sqrt(Math.pow(g-t.x,2)+Math.pow(y-t.y,2));v>n||(v<u?(l=[{...h,x:g,y}],u=v):v===u&&l.push({...h,x:g,y}))}}if(!l.length)return null;if(l.length>1){const d=o.type==="source"?"target":"source";return l.find(p=>p.type===d)??l[0]}return l[0]}function JS(t,n,a,o,l,u=!1){const c=o.get(t);if(!c)return null;const d=l==="strict"?c.internals.handleBounds?.[n]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],p=(a?d?.find(h=>h.id===a):d?.[0])??null;return p&&u?{...p,..._a(c,p,p.position,!0)}:p}function WS(t,n){return t||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function pR(t,n){let a=null;return n?a=!0:t&&!n&&(a=!1),a}const tw=()=>!0;function gR(t,{connectionMode:n,connectionRadius:a,handleId:o,nodeId:l,edgeUpdaterType:u,isTarget:c,domNode:d,nodeLookup:p,lib:h,autoPanOnConnect:g,flowId:y,panBy:v,cancelConnection:x,onConnectStart:S,onConnect:T,onConnectEnd:A,isValidConnection:E=tw,onReconnectEnd:_,updateConnection:N,getTransform:M,getFromHandle:z,autoPanSpeed:V,dragThreshold:O=1,handleDomNode:k}){const X=qS(t.target);let st=0,P;const{x:F,y:it}=vn(t),L=WS(u,k),$=d?.getBoundingClientRect();let D=!1;if(!$||!L)return;const H=JS(l,L,o,p,n);if(!H)return;let U=vn(t,$),Z=!1,tt=null,j=!1,Y=null;function W(){if(!g||!$)return;const[St,yt]=BS(U,$,V);v({x:St,y:yt}),st=requestAnimationFrame(W)}const et={...H,nodeId:l,type:L,position:H.position},rt=p.get(l);let ct={inProgress:!0,isValid:null,from:_a(rt,et,pt.Left,!0),fromHandle:et,fromPosition:et.position,fromNode:rt,to:U,toHandle:null,toPosition:dx[et.position],toNode:null,pointer:U};function lt(){D=!0,N(ct),S?.(t,{nodeId:l,handleId:o,handleType:L})}O===0&&lt();function ft(St){if(!D){const{x:de,y:rn}=vn(St),ke=de-F,ln=rn-it;if(!(ke*ke+ln*ln>O*O))return;lt()}if(!z()||!et){Et(St);return}const yt=M();U=vn(St,$),P=mR(Ar(U,yt,!1,[1,1]),a,p,et),Z||(W(),Z=!0);const xt=ew(St,{handle:P,connectionMode:n,fromNodeId:l,fromHandleId:o,fromType:c?"target":"source",isValidConnection:E,doc:X,lib:h,flowId:y,nodeLookup:p});Y=xt.handleDomNode,tt=xt.connection,j=pR(!!P,xt.isValid);const Mt=p.get(l),Bt=Mt?_a(Mt,et,pt.Left,!0):ct.from,Vt={...ct,from:Bt,isValid:j,to:xt.toHandle&&j?Vu({x:xt.toHandle.x,y:xt.toHandle.y},yt):U,toHandle:xt.toHandle,toPosition:j&&xt.toHandle?xt.toHandle.position:dx[et.position],toNode:xt.toHandle?p.get(xt.toHandle.nodeId):null,pointer:U};N(Vt),ct=Vt}function Et(St){if(!("touches"in St&&St.touches.length>0)){if(D){(P||Y)&&tt&&j&&T?.(tt);const{inProgress:yt,...xt}=ct,Mt={...xt,toPosition:ct.toHandle?ct.toPosition:null};A?.(St,Mt),u&&_?.(St,Mt)}x(),cancelAnimationFrame(st),Z=!1,j=!1,tt=null,Y=null,X.removeEventListener("mousemove",ft),X.removeEventListener("mouseup",Et),X.removeEventListener("touchmove",ft),X.removeEventListener("touchend",Et)}}X.addEventListener("mousemove",ft),X.addEventListener("mouseup",Et),X.addEventListener("touchmove",ft),X.addEventListener("touchend",Et)}function ew(t,{handle:n,connectionMode:a,fromNodeId:o,fromHandleId:l,fromType:u,doc:c,lib:d,flowId:p,isValidConnection:h=tw,nodeLookup:g}){const y=u==="target",v=n?c.querySelector(`.${d}-flow__handle[data-id="${p}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:S}=vn(t),T=c.elementFromPoint(x,S),A=T?.classList.contains(`${d}-flow__handle`)?T:v,E={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const _=WS(void 0,A),N=A.getAttribute("data-nodeid"),M=A.getAttribute("data-handleid"),z=A.classList.contains("connectable"),V=A.classList.contains("connectableend");if(!N||!_)return E;const O={source:y?N:o,sourceHandle:y?M:l,target:y?o:N,targetHandle:y?l:M};E.connection=O;const X=z&&V&&(a===js.Strict?y&&_==="source"||!y&&_==="target":N!==o||M!==l);E.isValid=X&&h(O),E.toHandle=JS(N,_,M,g,a,!0)}return E}const Lh={onPointerDown:gR,isValid:ew};function yR({domNode:t,panZoom:n,getTransform:a,getViewScale:o}){const l=Pe(t);function u({translateExtent:d,width:p,height:h,zoomStep:g=1,pannable:y=!0,zoomable:v=!0,inversePan:x=!1}){const S=N=>{if(N.sourceEvent.type!=="wheel"||!n)return;const M=a(),z=N.sourceEvent.ctrlKey&&fr()?10:1,V=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*g,O=M[2]*Math.pow(2,V*z);n.scaleTo(O)};let T=[0,0];const A=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(T=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},E=N=>{const M=a();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!n)return;const z=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],V=[z[0]-T[0],z[1]-T[1]];T=z;const O=o()*Math.max(M[2],Math.log(M[2]))*(x?-1:1),k={x:M[0]-V[0]*O,y:M[1]-V[1]*O},X=[[0,0],[p,h]];n.setViewportConstrained({x:k.x,y:k.y,zoom:M[2]},X,d)},_=DS().on("start",A).on("zoom",y?E:null).on("zoom.wheel",v?S:null);l.call(_,{})}function c(){l.on("zoom",null)}return{update:u,destroy:c,pointer:pn}}const Pu=t=>({x:t.x,y:t.y,zoom:t.k}),Xd=({x:t,y:n,zoom:a})=>Gu.translate(t,n).scale(a),ws=(t,n)=>t.target.closest(`.${n}`),nw=(t,n)=>n===2&&Array.isArray(t)&&t.includes(2),vR=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Gd=(t,n=0,a=vR,o=()=>{})=>{const l=typeof n=="number"&&n>0;return l||o(),l?t.transition().duration(n).ease(a).on("end",o):t},iw=t=>{const n=t.ctrlKey&&fr()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*n};function xR({zoomPanValues:t,noWheelClassName:n,d3Selection:a,d3Zoom:o,panOnScrollMode:l,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:d,onPanZoom:p,onPanZoomEnd:h}){return g=>{if(ws(g,n))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const y=a.property("__zoom").k||1;if(g.ctrlKey&&c){const A=pn(g),E=iw(g),_=y*Math.pow(2,E);o.scaleTo(a,_,A,g);return}const v=g.deltaMode===1?20:1;let x=l===Ta.Vertical?0:g.deltaX*v,S=l===Ta.Horizontal?0:g.deltaY*v;!fr()&&g.shiftKey&&l!==Ta.Vertical&&(x=g.deltaY*v,S=0),o.translateBy(a,-(x/y)*u,-(S/y)*u,{internal:!0});const T=Pu(a.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(p?.(g,T),t.panScrollTimeout=setTimeout(()=>{h?.(g,T),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,d?.(g,T))}}function bR({noWheelClassName:t,preventScrolling:n,d3ZoomHandler:a}){return function(o,l){const u=o.type==="wheel",c=!n&&u&&!o.ctrlKey,d=ws(o,t);if(o.ctrlKey&&u&&d&&o.preventDefault(),c||d)return null;o.preventDefault(),a.call(this,o,l)}}function SR({zoomPanValues:t,onDraggingChange:n,onPanZoomStart:a}){return o=>{if(o.sourceEvent?.internal)return;const l=Pu(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=l,o.sourceEvent?.type==="mousedown"&&n(!0),a&&a?.(o.sourceEvent,l)}}function wR({zoomPanValues:t,panOnDrag:n,onPaneContextMenu:a,onTransformChange:o,onPanZoom:l}){return u=>{t.usedRightMouseButton=!!(a&&nw(n,t.mouseButton??0)),u.sourceEvent?.sync||o([u.transform.x,u.transform.y,u.transform.k]),l&&!u.sourceEvent?.internal&&l?.(u.sourceEvent,Pu(u.transform))}}function ER({zoomPanValues:t,panOnDrag:n,panOnScroll:a,onDraggingChange:o,onPanZoomEnd:l,onPaneContextMenu:u}){return c=>{if(!c.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&nw(n,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,o(!1),l)){const d=Pu(c.transform);t.prevViewport=d,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l?.(c.sourceEvent,d)},a?150:0)}}}function TR({zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:a,panOnDrag:o,panOnScroll:l,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:d,noPanClassName:p,lib:h,connectionInProgress:g}){return y=>{const v=t||n,x=a&&y.ctrlKey,S=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(ws(y,`${h}-flow__node`)||ws(y,`${h}-flow__edge`)))return!0;if(!o&&!v&&!l&&!u&&!a||c||g&&!S||ws(y,d)&&S||ws(y,p)&&(!S||l&&S&&!t)||!a&&y.ctrlKey&&S)return!1;if(!a&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!v&&!l&&!x&&S||!o&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(o)&&!o.includes(y.button)&&y.type==="mousedown")return!1;const T=Array.isArray(o)&&o.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||S)&&T}}function AR({domNode:t,minZoom:n,maxZoom:a,translateExtent:o,viewport:l,onPanZoom:u,onPanZoomStart:c,onPanZoomEnd:d,onDraggingChange:p}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),y=DS().scaleExtent([n,a]).translateExtent(o),v=Pe(t).call(y);_({x:l.x,y:l.y,zoom:zs(l.zoom,n,a)},[[0,0],[g.width,g.height]],o);const x=v.on("wheel.zoom"),S=v.on("dblclick.zoom");y.wheelDelta(iw);function T(P,F){return v?new Promise(it=>{y?.interpolate(F?.interpolate==="linear"?Io:mu).transform(Gd(v,F?.duration,F?.ease,()=>it(!0)),P)}):Promise.resolve(!1)}function A({noWheelClassName:P,noPanClassName:F,onPaneContextMenu:it,userSelectionActive:L,panOnScroll:$,panOnDrag:D,panOnScrollMode:H,panOnScrollSpeed:U,preventScrolling:Z,zoomOnPinch:tt,zoomOnScroll:j,zoomOnDoubleClick:Y,zoomActivationKeyPressed:W,lib:et,onTransformChange:rt,connectionInProgress:ut,paneClickDistance:ct,selectionOnDrag:lt}){L&&!h.isZoomingOrPanning&&E();const ft=$&&!W&&!L;y.clickDistance(lt?1/0:!yn(ct)||ct<0?0:ct);const Et=ft?xR({zoomPanValues:h,noWheelClassName:P,d3Selection:v,d3Zoom:y,panOnScrollMode:H,panOnScrollSpeed:U,zoomOnPinch:tt,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:d}):bR({noWheelClassName:P,preventScrolling:Z,d3ZoomHandler:x});if(v.on("wheel.zoom",Et,{passive:!1}),!L){const yt=SR({zoomPanValues:h,onDraggingChange:p,onPanZoomStart:c});y.on("start",yt);const xt=wR({zoomPanValues:h,panOnDrag:D,onPaneContextMenu:!!it,onPanZoom:u,onTransformChange:rt});y.on("zoom",xt);const Mt=ER({zoomPanValues:h,panOnDrag:D,panOnScroll:$,onPaneContextMenu:it,onPanZoomEnd:d,onDraggingChange:p});y.on("end",Mt)}const St=TR({zoomActivationKeyPressed:W,panOnDrag:D,zoomOnScroll:j,panOnScroll:$,zoomOnDoubleClick:Y,zoomOnPinch:tt,userSelectionActive:L,noPanClassName:F,noWheelClassName:P,lib:et,connectionInProgress:ut});y.filter(St),Y?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function E(){y.on("zoom",null)}async function _(P,F,it){const L=Xd(P),$=y?.constrain()(L,F,it);return $&&await T($),new Promise(D=>D($))}async function N(P,F){const it=Xd(P);return await T(it,F),new Promise(L=>L(it))}function M(P){if(v){const F=Xd(P),it=v.property("__zoom");(it.k!==P.zoom||it.x!==P.x||it.y!==P.y)&&y?.transform(v,F,null,{sync:!0})}}function z(){const P=v?CS(v.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function V(P,F){return v?new Promise(it=>{y?.interpolate(F?.interpolate==="linear"?Io:mu).scaleTo(Gd(v,F?.duration,F?.ease,()=>it(!0)),P)}):Promise.resolve(!1)}function O(P,F){return v?new Promise(it=>{y?.interpolate(F?.interpolate==="linear"?Io:mu).scaleBy(Gd(v,F?.duration,F?.ease,()=>it(!0)),P)}):Promise.resolve(!1)}function k(P){y?.scaleExtent(P)}function X(P){y?.translateExtent(P)}function st(P){const F=!yn(P)||P<0?0:P;y?.clickDistance(F)}return{update:A,destroy:E,setViewport:N,setViewportConstrained:_,getViewport:z,scaleTo:V,scaleBy:O,setScaleExtent:k,setTranslateExtent:X,syncViewport:M,setClickDistance:st}}var Ls;(function(t){t.Line="line",t.Handle="handle"})(Ls||(Ls={}));function NR({width:t,prevWidth:n,height:a,prevHeight:o,affectsX:l,affectsY:u}){const c=t-n,d=a-o,p=[c>0?1:c<0?-1:0,d>0?1:d<0?-1:0];return c&&l&&(p[0]=p[0]*-1),d&&u&&(p[1]=p[1]*-1),p}function Ax(t){const n=t.includes("right")||t.includes("left"),a=t.includes("bottom")||t.includes("top"),o=t.includes("left"),l=t.includes("top");return{isHorizontal:n,isVertical:a,affectsX:o,affectsY:l}}function Li(t,n){return Math.max(0,n-t)}function Hi(t,n){return Math.max(0,t-n)}function ou(t,n,a){return Math.max(0,n-t,t-a)}function Nx(t,n){return t?!n:n}function MR(t,n,a,o,l,u,c,d){let{affectsX:p,affectsY:h}=n;const{isHorizontal:g,isVertical:y}=n,v=g&&y,{xSnapped:x,ySnapped:S}=a,{minWidth:T,maxWidth:A,minHeight:E,maxHeight:_}=o,{x:N,y:M,width:z,height:V,aspectRatio:O}=t;let k=Math.floor(g?x-t.pointerX:0),X=Math.floor(y?S-t.pointerY:0);const st=z+(p?-k:k),P=V+(h?-X:X),F=-u[0]*z,it=-u[1]*V;let L=ou(st,T,A),$=ou(P,E,_);if(c){let U=0,Z=0;p&&k<0?U=Li(N+k+F,c[0][0]):!p&&k>0&&(U=Hi(N+st+F,c[1][0])),h&&X<0?Z=Li(M+X+it,c[0][1]):!h&&X>0&&(Z=Hi(M+P+it,c[1][1])),L=Math.max(L,U),$=Math.max($,Z)}if(d){let U=0,Z=0;p&&k>0?U=Hi(N+k,d[0][0]):!p&&k<0&&(U=Li(N+st,d[1][0])),h&&X>0?Z=Hi(M+X,d[0][1]):!h&&X<0&&(Z=Li(M+P,d[1][1])),L=Math.max(L,U),$=Math.max($,Z)}if(l){if(g){const U=ou(st/O,E,_)*O;if(L=Math.max(L,U),c){let Z=0;!p&&!h||p&&!h&&v?Z=Hi(M+it+st/O,c[1][1])*O:Z=Li(M+it+(p?k:-k)/O,c[0][1])*O,L=Math.max(L,Z)}if(d){let Z=0;!p&&!h||p&&!h&&v?Z=Li(M+st/O,d[1][1])*O:Z=Hi(M+(p?k:-k)/O,d[0][1])*O,L=Math.max(L,Z)}}if(y){const U=ou(P*O,T,A)/O;if($=Math.max($,U),c){let Z=0;!p&&!h||h&&!p&&v?Z=Hi(N+P*O+F,c[1][0])/O:Z=Li(N+(h?X:-X)*O+F,c[0][0])/O,$=Math.max($,Z)}if(d){let Z=0;!p&&!h||h&&!p&&v?Z=Li(N+P*O,d[1][0])/O:Z=Hi(N+(h?X:-X)*O,d[0][0])/O,$=Math.max($,Z)}}}X=X+(X<0?$:-$),k=k+(k<0?L:-L),l&&(v?st>P*O?X=(Nx(p,h)?-k:k)/O:k=(Nx(p,h)?-X:X)*O:g?(X=k/O,h=p):(k=X*O,p=h));const D=p?N+k:N,H=h?M+X:M;return{width:z+(p?-k:k),height:V+(h?-X:X),x:u[0]*k*(p?-1:1)+D,y:u[1]*X*(h?-1:1)+H}}const aw={width:0,height:0,x:0,y:0},_R={...aw,pointerX:0,pointerY:0,aspectRatio:1};function CR(t){return[[0,0],[t.measured.width,t.measured.height]]}function DR(t,n,a){const o=n.position.x+t.position.x,l=n.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,d=a[0]*u,p=a[1]*c;return[[o-d,l-p],[o+u-d,l+c-p]]}function RR({domNode:t,nodeId:n,getStoreItems:a,onChange:o,onEnd:l}){const u=Pe(t);let c={controlDirection:Ax("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:h,boundaries:g,keepAspectRatio:y,resizeDirection:v,onResizeStart:x,onResize:S,onResizeEnd:T,shouldResize:A}){let E={...aw},_={..._R};c={boundaries:g,resizeDirection:v,keepAspectRatio:y,controlDirection:Ax(h)};let N,M=null,z=[],V,O,k,X=!1;const st=gS().on("start",P=>{const{nodeLookup:F,transform:it,snapGrid:L,snapToGrid:$,nodeOrigin:D,paneDomNode:H}=a();if(N=F.get(n),!N)return;M=H?.getBoundingClientRect()??null;const{xSnapped:U,ySnapped:Z}=Ko(P.sourceEvent,{transform:it,snapGrid:L,snapToGrid:$,containerBounds:M});E={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},_={...E,pointerX:U,pointerY:Z,aspectRatio:E.width/E.height},V=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(V=F.get(N.parentId),O=V&&N.extent==="parent"?CR(V):void 0),z=[],k=void 0;for(const[tt,j]of F)if(j.parentId===n&&(z.push({id:tt,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const Y=DR(j,N,j.origin??D);k?k=[[Math.min(Y[0][0],k[0][0]),Math.min(Y[0][1],k[0][1])],[Math.max(Y[1][0],k[1][0]),Math.max(Y[1][1],k[1][1])]]:k=Y}x?.(P,{...E})}).on("drag",P=>{const{transform:F,snapGrid:it,snapToGrid:L,nodeOrigin:$}=a(),D=Ko(P.sourceEvent,{transform:F,snapGrid:it,snapToGrid:L,containerBounds:M}),H=[];if(!N)return;const{x:U,y:Z,width:tt,height:j}=E,Y={},W=N.origin??$,{width:et,height:rt,x:ut,y:ct}=MR(_,c.controlDirection,D,c.boundaries,c.keepAspectRatio,W,O,k),lt=et!==tt,ft=rt!==j,Et=ut!==U&&lt,St=ct!==Z&&ft;if(!Et&&!St&&!lt&&!ft)return;if((Et||St||W[0]===1||W[1]===1)&&(Y.x=Et?ut:E.x,Y.y=St?ct:E.y,E.x=Y.x,E.y=Y.y,z.length>0)){const Bt=ut-U,Vt=ct-Z;for(const de of z)de.position={x:de.position.x-Bt+W[0]*(et-tt),y:de.position.y-Vt+W[1]*(rt-j)},H.push(de)}if((lt||ft)&&(Y.width=lt&&(!c.resizeDirection||c.resizeDirection==="horizontal")?et:E.width,Y.height=ft&&(!c.resizeDirection||c.resizeDirection==="vertical")?rt:E.height,E.width=Y.width,E.height=Y.height),V&&N.expandParent){const Bt=W[0]*(Y.width??0);Y.x&&Y.x<Bt&&(E.x=Bt,_.x=_.x-(Y.x-Bt));const Vt=W[1]*(Y.height??0);Y.y&&Y.y<Vt&&(E.y=Vt,_.y=_.y-(Y.y-Vt))}const yt=NR({width:E.width,prevWidth:tt,height:E.height,prevHeight:j,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),xt={...E,direction:yt};A?.(P,xt)!==!1&&(X=!0,S?.(P,xt),o(Y,H))}).on("end",P=>{X&&(T?.(P,{...E}),l?.({...E}),X=!1)});u.call(st)}function p(){u.on(".drag",null)}return{update:d,destroy:p}}var $d={exports:{}},Zd={},Pd={exports:{}},Id={};var Mx;function jR(){if(Mx)return Id;Mx=1;var t=hr();function n(y,v){return y===v&&(y!==0||1/y===1/v)||y!==y&&v!==v}var a=typeof Object.is=="function"?Object.is:n,o=t.useState,l=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function d(y,v){var x=v(),S=o({inst:{value:x,getSnapshot:v}}),T=S[0].inst,A=S[1];return u(function(){T.value=x,T.getSnapshot=v,p(T)&&A({inst:T})},[y,x,v]),l(function(){return p(T)&&A({inst:T}),y(function(){p(T)&&A({inst:T})})},[y]),c(x),x}function p(y){var v=y.getSnapshot;y=y.value;try{var x=v();return!a(y,x)}catch{return!0}}function h(y,v){return v()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return Id.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,Id}var _x;function zR(){return _x||(_x=1,Pd.exports=jR()),Pd.exports}var Cx;function OR(){if(Cx)return Zd;Cx=1;var t=hr(),n=zR();function a(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var o=typeof Object.is=="function"?Object.is:a,l=n.useSyncExternalStore,u=t.useRef,c=t.useEffect,d=t.useMemo,p=t.useDebugValue;return Zd.useSyncExternalStoreWithSelector=function(h,g,y,v,x){var S=u(null);if(S.current===null){var T={hasValue:!1,value:null};S.current=T}else T=S.current;S=d(function(){function E(V){if(!_){if(_=!0,N=V,V=v(V),x!==void 0&&T.hasValue){var O=T.value;if(x(O,V))return M=O}return M=V}if(O=M,o(N,V))return O;var k=v(V);return x!==void 0&&x(O,k)?(N=V,O):(N=V,M=k)}var _=!1,N,M,z=y===void 0?null:y;return[function(){return E(g())},z===null?void 0:function(){return E(z())}]},[g,y,v,x]);var A=l(h,S[0],S[1]);return c(function(){T.hasValue=!0,T.value=A},[A]),p(A),A},Zd}var Dx;function VR(){return Dx||(Dx=1,$d.exports=OR()),$d.exports}var LR=VR();const HR=u1(LR),BR={},Rx=t=>{let n;const a=new Set,o=(g,y)=>{const v=typeof g=="function"?g(n):g;if(!Object.is(v,n)){const x=n;n=y??(typeof v!="object"||v===null)?v:Object.assign({},n,v),a.forEach(S=>S(n,x))}},l=()=>n,p={setState:o,getState:l,getInitialState:()=>h,subscribe:g=>(a.add(g),()=>a.delete(g)),destroy:()=>{(BR?"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."),a.clear()}},h=n=t(o,l,p);return p},kR=t=>t?Rx(t):Rx,{useDebugValue:UR}=As,{useSyncExternalStoreWithSelector:YR}=HR,qR=t=>t;function sw(t,n=qR,a){const o=YR(t.subscribe,t.getState,t.getServerState||t.getInitialState,n,a);return UR(o),o}const jx=(t,n)=>{const a=kR(t),o=(l,u=n)=>sw(a,l,u);return Object.assign(o,a),o},XR=(t,n)=>t?jx(t,n):jx;function It(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[o,l]of t)if(!Object.is(l,n.get(o)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0}const a=Object.keys(t);if(a.length!==Object.keys(n).length)return!1;for(const o of a)if(!Object.prototype.hasOwnProperty.call(n,o)||!Object.is(t[o],n[o]))return!1;return!0}c1();const Iu=R.createContext(null),GR=Iu.Provider,ow=Dn.error001();function Rt(t,n){const a=R.useContext(Iu);if(a===null)throw new Error(ow);return sw(a,t,n)}function Kt(){const t=R.useContext(Iu);if(t===null)throw new Error(ow);return R.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const zx={display:"none"},$R={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rw="react-flow__node-desc",lw="react-flow__edge-desc",ZR="react-flow__aria-live",PR=t=>t.ariaLiveMessage,IR=t=>t.ariaLabelConfig;function KR({rfId:t}){const n=Rt(PR);return w.jsx("div",{id:`${ZR}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:$R,children:n})}function QR({rfId:t,disableKeyboardA11y:n}){const a=Rt(IR);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${rw}-${t}`,style:zx,children:n?a["node.a11yDescription.default"]:a["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${lw}-${t}`,style:zx,children:a["edge.a11yDescription.default"]}),!n&&w.jsx(KR,{rfId:t})]})}const Ku=R.forwardRef(({position:t="top-left",children:n,className:a,style:o,...l},u)=>{const c=`${t}`.split("-");return w.jsx("div",{className:le(["react-flow__panel",a,...c]),style:o,ref:u,...l,children:n})});Ku.displayName="Panel";function FR({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:w.jsx(Ku,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const JR=t=>{const n=[],a=[];for(const[,o]of t.nodeLookup)o.selected&&n.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&a.push(o);return{selectedNodes:n,selectedEdges:a}},ru=t=>t.id;function WR(t,n){return It(t.selectedNodes.map(ru),n.selectedNodes.map(ru))&&It(t.selectedEdges.map(ru),n.selectedEdges.map(ru))}function tj({onSelectionChange:t}){const n=Kt(),{selectedNodes:a,selectedEdges:o}=Rt(JR,WR);return R.useEffect(()=>{const l={nodes:a,edges:o};t?.(l),n.getState().onSelectionChangeHandlers.forEach(u=>u(l))},[a,o,t]),null}const ej=t=>!!t.onSelectionChangeHandlers;function nj({onSelectionChange:t}){const n=Rt(ej);return t||n?w.jsx(tj,{onSelectionChange:t}):null}const uw=[0,0],ij={x:0,y:0,zoom:1},aj=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ox=[...aj,"rfId"],sj=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Vx={translateExtent:lr,nodeOrigin:uw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function oj(t){const{setNodes:n,setEdges:a,setMinZoom:o,setMaxZoom:l,setTranslateExtent:u,setNodeExtent:c,reset:d,setDefaultNodesAndEdges:p}=Rt(sj,It),h=Kt();R.useEffect(()=>(p(t.defaultNodes,t.defaultEdges),()=>{g.current=Vx,d()}),[]);const g=R.useRef(Vx);return R.useEffect(()=>{for(const y of Ox){const v=t[y],x=g.current[y];v!==x&&(typeof t[y]>"u"||(y==="nodes"?n(v):y==="edges"?a(v):y==="minZoom"?o(v):y==="maxZoom"?l(v):y==="translateExtent"?u(v):y==="nodeExtent"?c(v):y==="ariaLabelConfig"?h.setState({ariaLabelConfig:X4(v)}):y==="fitView"?h.setState({fitViewQueued:v}):y==="fitViewOptions"?h.setState({fitViewOptions:v}):h.setState({[y]:v})))}g.current=t},Ox.map(y=>t[y])),null}function Lx(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rj(t){const[n,a]=R.useState(t==="system"?null:t);return R.useEffect(()=>{if(t!=="system"){a(t);return}const o=Lx(),l=()=>a(o?.matches?"dark":"light");return l(),o?.addEventListener("change",l),()=>{o?.removeEventListener("change",l)}},[t]),n!==null?n:Lx()?.matches?"dark":"light"}const Hx=typeof document<"u"?document:null;function dr(t=null,n={target:Hx,actInsideInputWithModifier:!0}){const[a,o]=R.useState(!1),l=R.useRef(!1),u=R.useRef(new Set([])),[c,d]=R.useMemo(()=>{if(t!==null){const h=(Array.isArray(t)?t:[t]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
21
+ `).replace(`
22
+
23
+ `,`
24
+ +`).split(`
25
+ `)),g=h.reduce((y,v)=>y.concat(...v),[]);return[h,g]}return[[],[]]},[t]);return R.useEffect(()=>{const p=n?.target??Hx,h=n?.actInsideInputWithModifier??!0;if(t!==null){const g=x=>{if(l.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!l.current||l.current&&!h)&&XS(x))return!1;const T=kx(x.code,d);if(u.current.add(x[T]),Bx(c,u.current,!1)){const A=x.composedPath?.()?.[0]||x.target,E=A?.nodeName==="BUTTON"||A?.nodeName==="A";n.preventDefault!==!1&&(l.current||!E)&&x.preventDefault(),o(!0)}},y=x=>{const S=kx(x.code,d);Bx(c,u.current,!0)?(o(!1),u.current.clear()):u.current.delete(x[S]),x.key==="Meta"&&u.current.clear(),l.current=!1},v=()=>{u.current.clear(),o(!1)};return p?.addEventListener("keydown",g),p?.addEventListener("keyup",y),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{p?.removeEventListener("keydown",g),p?.removeEventListener("keyup",y),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[t,o]),a}function Bx(t,n,a){return t.filter(o=>a||o.length===n.size).some(o=>o.every(l=>n.has(l)))}function kx(t,n){return n.includes(t)?"code":"key"}const lj=()=>{const t=Kt();return R.useMemo(()=>({zoomIn:n=>{const{panZoom:a}=t.getState();return a?a.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:a}=t.getState();return a?a.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,a)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(n,{duration:a?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(n,a)=>{const{transform:[o,l,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:n.x??o,y:n.y??l,zoom:n.zoom??u},a),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,a,o]=t.getState().transform;return{x:n,y:a,zoom:o}},setCenter:async(n,a,o)=>t.getState().setCenter(n,a,o),fitBounds:async(n,a)=>{const{width:o,height:l,minZoom:u,maxZoom:c,panZoom:d}=t.getState(),p=Mm(n,o,l,u,c,a?.padding??.1);return d?(await d.setViewport(p,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,a={})=>{const{transform:o,snapGrid:l,snapToGrid:u,domNode:c}=t.getState();if(!c)return n;const{x:d,y:p}=c.getBoundingClientRect(),h={x:n.x-d,y:n.y-p},g=a.snapGrid??l,y=a.snapToGrid??u;return Ar(h,o,y,g)},flowToScreenPosition:n=>{const{transform:a,domNode:o}=t.getState();if(!o)return n;const{x:l,y:u}=o.getBoundingClientRect(),c=Vu(n,a);return{x:c.x+l,y:c.y+u}}}),[])};function cw(t,n){const a=[],o=new Map,l=[];for(const u of t)if(u.type==="add"){l.push(u);continue}else if(u.type==="remove"||u.type==="replace")o.set(u.id,[u]);else{const c=o.get(u.id);c?c.push(u):o.set(u.id,[u])}for(const u of n){const c=o.get(u.id);if(!c){a.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){a.push({...c[0].item});continue}const d={...u};for(const p of c)uj(p,d);a.push(d)}return l.length&&l.forEach(u=>{u.index!==void 0?a.splice(u.index,0,{...u.item}):a.push({...u.item})}),a}function uj(t,n){switch(t.type){case"select":{n.selected=t.selected;break}case"position":{typeof t.position<"u"&&(n.position=t.position),typeof t.dragging<"u"&&(n.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(n.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(n.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(n.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(n.resizing=t.resizing);break}}}function fw(t,n){return cw(t,n)}function dw(t,n){return cw(t,n)}function va(t,n){return{id:t,type:"select",selected:n}}function Es(t,n=new Set,a=!1){const o=[];for(const[l,u]of t){const c=n.has(l);!(u.selected===void 0&&!c)&&u.selected!==c&&(a&&(u.selected=c),o.push(va(u.id,c)))}return o}function Ux({items:t=[],lookup:n}){const a=[],o=new Map(t.map(l=>[l.id,l]));for(const[l,u]of t.entries()){const c=n.get(u.id),d=c?.internals?.userNode??c;d!==void 0&&d!==u&&a.push({id:u.id,item:u,type:"replace"}),d===void 0&&a.push({item:u,type:"add",index:l})}for(const[l]of n)o.get(l)===void 0&&a.push({id:l,type:"remove"});return a}function Yx(t){return{id:t.id,type:"remove"}}const qx=t=>z4(t),cj=t=>VS(t);function hw(t){return R.forwardRef(t)}const fj=typeof window<"u"?R.useLayoutEffect:R.useEffect;function Xx(t){const[n,a]=R.useState(BigInt(0)),[o]=R.useState(()=>dj(()=>a(l=>l+BigInt(1))));return fj(()=>{const l=o.get();l.length&&(t(l),o.reset())},[n]),o}function dj(t){let n=[];return{get:()=>n,reset:()=>{n=[]},push:a=>{n.push(a),t()}}}const mw=R.createContext(null);function hj({children:t}){const n=Kt(),a=R.useCallback(d=>{const{nodes:p=[],setNodes:h,hasDefaultNodes:g,onNodesChange:y,nodeLookup:v,fitViewQueued:x,onNodesChangeMiddlewareMap:S}=n.getState();let T=p;for(const E of d)T=typeof E=="function"?E(T):E;let A=Ux({items:T,lookup:v});for(const E of S.values())A=E(A);g&&h(T),A.length>0?y?.(A):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:_,setNodes:N}=n.getState();E&&N(_)})},[]),o=Xx(a),l=R.useCallback(d=>{const{edges:p=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:y,edgeLookup:v}=n.getState();let x=p;for(const S of d)x=typeof S=="function"?S(x):S;g?h(x):y&&y(Ux({items:x,lookup:v}))},[]),u=Xx(l),c=R.useMemo(()=>({nodeQueue:o,edgeQueue:u}),[]);return w.jsx(mw.Provider,{value:c,children:t})}function mj(){const t=R.useContext(mw);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const pj=t=>!!t.panZoom;function Vm(){const t=lj(),n=Kt(),a=mj(),o=Rt(pj),l=R.useMemo(()=>{const u=y=>n.getState().nodeLookup.get(y),c=y=>{a.nodeQueue.push(y)},d=y=>{a.edgeQueue.push(y)},p=y=>{const{nodeLookup:v,nodeOrigin:x}=n.getState(),S=qx(y)?y:v.get(y.id),T=S.parentId?YS(S.position,S.measured,S.parentId,v,x):S.position,A={...S,position:T,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return Os(A)},h=(y,v,x={replace:!1})=>{c(S=>S.map(T=>{if(T.id===y){const A=typeof v=="function"?v(T):v;return x.replace&&qx(A)?A:{...T,...A}}return T}))},g=(y,v,x={replace:!1})=>{d(S=>S.map(T=>{if(T.id===y){const A=typeof v=="function"?v(T):v;return x.replace&&cj(A)?A:{...T,...A}}return T}))};return{getNodes:()=>n.getState().nodes.map(y=>({...y})),getNode:y=>u(y)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:y=[]}=n.getState();return y.map(v=>({...v}))},getEdge:y=>n.getState().edgeLookup.get(y),setNodes:c,setEdges:d,addNodes:y=>{const v=Array.isArray(y)?y:[y];a.nodeQueue.push(x=>[...x,...v])},addEdges:y=>{const v=Array.isArray(y)?y:[y];a.edgeQueue.push(x=>[...x,...v])},toObject:()=>{const{nodes:y=[],edges:v=[],transform:x}=n.getState(),[S,T,A]=x;return{nodes:y.map(E=>({...E})),edges:v.map(E=>({...E})),viewport:{x:S,y:T,zoom:A}}},deleteElements:async({nodes:y=[],edges:v=[]})=>{const{nodes:x,edges:S,onNodesDelete:T,onEdgesDelete:A,triggerNodeChanges:E,triggerEdgeChanges:_,onDelete:N,onBeforeDelete:M}=n.getState(),{nodes:z,edges:V}=await B4({nodesToRemove:y,edgesToRemove:v,nodes:x,edges:S,onBeforeDelete:M}),O=V.length>0,k=z.length>0;if(O){const X=V.map(Yx);A?.(V),_(X)}if(k){const X=z.map(Yx);T?.(z),E(X)}return(k||O)&&N?.({nodes:z,edges:V}),{deletedNodes:z,deletedEdges:V}},getIntersectingNodes:(y,v=!0,x)=>{const S=mx(y),T=S?y:p(y),A=x!==void 0;return T?(x||n.getState().nodes).filter(E=>{const _=n.getState().nodeLookup.get(E.id);if(_&&!S&&(E.id===y.id||!_.internals.positionAbsolute))return!1;const N=Os(A?E:_),M=cr(N,T);return v&&M>0||M>=N.width*N.height||M>=T.width*T.height}):[]},isNodeIntersecting:(y,v,x=!0)=>{const T=mx(y)?y:p(y);if(!T)return!1;const A=cr(T,v);return x&&A>0||A>=v.width*v.height||A>=T.width*T.height},updateNode:h,updateNodeData:(y,v,x={replace:!1})=>{h(y,S=>{const T=typeof v=="function"?v(S):v;return x.replace?{...S,data:T}:{...S,data:{...S.data,...T}}},x)},updateEdge:g,updateEdgeData:(y,v,x={replace:!1})=>{g(y,S=>{const T=typeof v=="function"?v(S):v;return x.replace?{...S,data:T}:{...S,data:{...S.data,...T}}},x)},getNodesBounds:y=>{const{nodeLookup:v,nodeOrigin:x}=n.getState();return O4(y,{nodeLookup:v,nodeOrigin:x})},getHandleConnections:({type:y,id:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${y}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${y?v?`-${y}-${v}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const v=n.getState().fitViewResolver??q4();return n.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:v}),a.nodeQueue.push(x=>[...x]),v.promise}}},[]);return R.useMemo(()=>({...l,...t,viewportInitialized:o}),[o])}const Gx=t=>t.selected,gj=typeof window<"u"?window:void 0;function yj({deleteKeyCode:t,multiSelectionKeyCode:n}){const a=Kt(),{deleteElements:o}=Vm(),l=dr(t,{actInsideInputWithModifier:!1}),u=dr(n,{target:gj});R.useEffect(()=>{if(l){const{edges:c,nodes:d}=a.getState();o({nodes:d.filter(Gx),edges:c.filter(Gx)}),a.setState({nodesSelectionActive:!1})}},[l]),R.useEffect(()=>{a.setState({multiSelectionActive:u})},[u])}function vj(t){const n=Kt();R.useEffect(()=>{const a=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const o=_m(t.current);(o.height===0||o.width===0)&&n.getState().onError?.("004",Dn.error004()),n.setState({width:o.width||500,height:o.height||500})};if(t.current){a(),window.addEventListener("resize",a);const o=new ResizeObserver(()=>a());return o.observe(t.current),()=>{window.removeEventListener("resize",a),o&&t.current&&o.unobserve(t.current)}}},[])}const Qu={position:"absolute",width:"100%",height:"100%",top:0,left:0},xj=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function bj({onPaneContextMenu:t,zoomOnScroll:n=!0,zoomOnPinch:a=!0,panOnScroll:o=!1,panOnScrollSpeed:l=.5,panOnScrollMode:u=Ta.Free,zoomOnDoubleClick:c=!0,panOnDrag:d=!0,defaultViewport:p,translateExtent:h,minZoom:g,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:x=!0,children:S,noWheelClassName:T,noPanClassName:A,onViewportChange:E,isControlledViewport:_,paneClickDistance:N,selectionOnDrag:M}){const z=Kt(),V=R.useRef(null),{userSelectionActive:O,lib:k,connectionInProgress:X}=Rt(xj,It),st=dr(v),P=R.useRef();vj(V);const F=R.useCallback(it=>{E?.({x:it[0],y:it[1],zoom:it[2]}),_||z.setState({transform:it})},[E,_]);return R.useEffect(()=>{if(V.current){P.current=AR({domNode:V.current,minZoom:g,maxZoom:y,translateExtent:h,viewport:p,onDraggingChange:D=>z.setState({paneDragging:D}),onPanZoomStart:(D,H)=>{const{onViewportChangeStart:U,onMoveStart:Z}=z.getState();Z?.(D,H),U?.(H)},onPanZoom:(D,H)=>{const{onViewportChange:U,onMove:Z}=z.getState();Z?.(D,H),U?.(H)},onPanZoomEnd:(D,H)=>{const{onViewportChangeEnd:U,onMoveEnd:Z}=z.getState();Z?.(D,H),U?.(H)}});const{x:it,y:L,zoom:$}=P.current.getViewport();return z.setState({panZoom:P.current,transform:[it,L,$],domNode:V.current.closest(".react-flow")}),()=>{P.current?.destroy()}}},[]),R.useEffect(()=>{P.current?.update({onPaneContextMenu:t,zoomOnScroll:n,zoomOnPinch:a,panOnScroll:o,panOnScrollSpeed:l,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:d,zoomActivationKeyPressed:st,preventScrolling:x,noPanClassName:A,userSelectionActive:O,noWheelClassName:T,lib:k,onTransformChange:F,connectionInProgress:X,selectionOnDrag:M,paneClickDistance:N})},[t,n,a,o,l,u,c,d,st,x,A,O,T,k,F,X,M,N]),w.jsx("div",{className:"react-flow__renderer",ref:V,style:Qu,children:S})}const Sj=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function wj(){const{userSelectionActive:t,userSelectionRect:n}=Rt(Sj,It);return t&&n?w.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Kd=(t,n)=>a=>{a.target===n.current&&t?.(a)},Ej=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Tj({isSelecting:t,selectionKeyPressed:n,selectionMode:a=ur.Full,panOnDrag:o,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:c,onSelectionEnd:d,onPaneClick:p,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:y,onPaneMouseMove:v,onPaneMouseLeave:x,children:S}){const T=Kt(),{userSelectionActive:A,elementsSelectable:E,dragging:_,connectionInProgress:N}=Rt(Ej,It),M=E&&(t||A),z=R.useRef(null),V=R.useRef(),O=R.useRef(new Set),k=R.useRef(new Set),X=R.useRef(!1),st=U=>{if(X.current||N){X.current=!1;return}p?.(U),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},P=U=>{if(Array.isArray(o)&&o?.includes(2)){U.preventDefault();return}h?.(U)},F=g?U=>g(U):void 0,it=U=>{X.current&&(U.stopPropagation(),X.current=!1)},L=U=>{const{domNode:Z}=T.getState();if(V.current=Z?.getBoundingClientRect(),!V.current)return;const tt=U.target===z.current;if(!tt&&!!U.target.closest(".nokey")||!t||!(u&&tt||n)||U.button!==0||!U.isPrimary)return;U.target?.setPointerCapture?.(U.pointerId),X.current=!1;const{x:W,y:et}=vn(U.nativeEvent,V.current);T.setState({userSelectionRect:{width:0,height:0,startX:W,startY:et,x:W,y:et}}),tt||(U.stopPropagation(),U.preventDefault())},$=U=>{const{userSelectionRect:Z,transform:tt,nodeLookup:j,edgeLookup:Y,connectionLookup:W,triggerNodeChanges:et,triggerEdgeChanges:rt,defaultEdgeOptions:ut,resetSelectedElements:ct}=T.getState();if(!V.current||!Z)return;const{x:lt,y:ft}=vn(U.nativeEvent,V.current),{startX:Et,startY:St}=Z;if(!X.current){const Vt=n?0:l;if(Math.hypot(lt-Et,ft-St)<=Vt)return;ct(),c?.(U)}X.current=!0;const yt={startX:Et,startY:St,x:lt<Et?lt:Et,y:ft<St?ft:St,width:Math.abs(lt-Et),height:Math.abs(ft-St)},xt=O.current,Mt=k.current;O.current=new Set(Nm(j,yt,tt,a===ur.Partial,!0).map(Vt=>Vt.id)),k.current=new Set;const Bt=ut?.selectable??!0;for(const Vt of O.current){const de=W.get(Vt);if(de)for(const{edgeId:rn}of de.values()){const ke=Y.get(rn);ke&&(ke.selectable??Bt)&&k.current.add(rn)}}if(!px(xt,O.current)){const Vt=Es(j,O.current,!0);et(Vt)}if(!px(Mt,k.current)){const Vt=Es(Y,k.current);rt(Vt)}T.setState({userSelectionRect:yt,userSelectionActive:!0,nodesSelectionActive:!1})},D=U=>{U.button===0&&(U.target?.releasePointerCapture?.(U.pointerId),!A&&U.target===z.current&&T.getState().userSelectionRect&&st?.(U),T.setState({userSelectionActive:!1,userSelectionRect:null}),X.current&&(d?.(U),T.setState({nodesSelectionActive:O.current.size>0})))},H=o===!0||Array.isArray(o)&&o.includes(0);return w.jsxs("div",{className:le(["react-flow__pane",{draggable:H,dragging:_,selection:t}]),onClick:M?void 0:Kd(st,z),onContextMenu:Kd(P,z),onWheel:Kd(F,z),onPointerEnter:M?void 0:y,onPointerMove:M?$:v,onPointerUp:M?D:void 0,onPointerDownCapture:M?L:void 0,onClickCapture:M?it:void 0,onPointerLeave:x,ref:z,style:Qu,children:[S,w.jsx(wj,{})]})}function Hh({id:t,store:n,unselect:a=!1,nodeRef:o}){const{addSelectedNodes:l,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:d,onError:p}=n.getState(),h=d.get(t);if(!h){p?.("012",Dn.error012(t));return}n.setState({nodesSelectionActive:!1}),h.selected?(a||h.selected&&c)&&(u({nodes:[h],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):l([t])}function pw({nodeRef:t,disabled:n=!1,noDragClassName:a,handleSelector:o,nodeId:l,isSelectable:u,nodeClickDistance:c}){const d=Kt(),[p,h]=R.useState(!1),g=R.useRef();return R.useEffect(()=>{g.current=fR({getStoreItems:()=>d.getState(),onNodeMouseDown:y=>{Hh({id:y,store:d,nodeRef:t})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),R.useEffect(()=>{if(n)g.current?.destroy();else if(t.current)return g.current?.update({noDragClassName:a,handleSelector:o,domNode:t.current,isSelectable:u,nodeId:l,nodeClickDistance:c}),()=>{g.current?.destroy()}},[a,o,n,u,t,l]),p}const Aj=t=>n=>n.selected&&(n.draggable||t&&typeof n.draggable>"u");function gw(){const t=Kt();return R.useCallback(a=>{const{nodeExtent:o,snapToGrid:l,snapGrid:u,nodesDraggable:c,onError:d,updateNodePositions:p,nodeLookup:h,nodeOrigin:g}=t.getState(),y=new Map,v=Aj(c),x=l?u[0]:5,S=l?u[1]:5,T=a.direction.x*x*a.factor,A=a.direction.y*S*a.factor;for(const[,E]of h){if(!v(E))continue;let _={x:E.internals.positionAbsolute.x+T,y:E.internals.positionAbsolute.y+A};l&&(_=Tr(_,u));const{position:N,positionAbsolute:M}=LS({nodeId:E.id,nextPosition:_,nodeLookup:h,nodeExtent:o,nodeOrigin:g,onError:d});E.position=N,E.internals.positionAbsolute=M,y.set(E.id,E)}p(y)},[])}const Lm=R.createContext(null),Nj=Lm.Provider;Lm.Consumer;const yw=()=>R.useContext(Lm),Mj=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),_j=(t,n,a)=>o=>{const{connectionClickStartHandle:l,connectionMode:u,connection:c}=o,{fromHandle:d,toHandle:p,isValid:h}=c,g=p?.nodeId===t&&p?.id===n&&p?.type===a;return{connectingFrom:d?.nodeId===t&&d?.id===n&&d?.type===a,connectingTo:g,clickConnecting:l?.nodeId===t&&l?.id===n&&l?.type===a,isPossibleEndHandle:u===js.Strict?d?.type!==a:t!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!l,valid:g&&h}};function Cj({type:t="source",position:n=pt.Top,isValidConnection:a,isConnectable:o=!0,isConnectableStart:l=!0,isConnectableEnd:u=!0,id:c,onConnect:d,children:p,className:h,onMouseDown:g,onTouchStart:y,...v},x){const S=c||null,T=t==="target",A=Kt(),E=yw(),{connectOnClick:_,noPanClassName:N,rfId:M}=Rt(Mj,It),{connectingFrom:z,connectingTo:V,clickConnecting:O,isPossibleEndHandle:k,connectionInProcess:X,clickConnectionInProcess:st,valid:P}=Rt(_j(E,S,t),It);E||A.getState().onError?.("010",Dn.error010());const F=$=>{const{defaultEdgeOptions:D,onConnect:H,hasDefaultEdges:U}=A.getState(),Z={...D,...$};if(U){const{edges:tt,setEdges:j}=A.getState();j(K4(Z,tt))}H?.(Z),d?.(Z)},it=$=>{if(!E)return;const D=GS($.nativeEvent);if(l&&(D&&$.button===0||!D)){const H=A.getState();Lh.onPointerDown($.nativeEvent,{handleDomNode:$.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:T,handleId:S,nodeId:E,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:H.onConnectEnd,updateConnection:H.updateConnection,onConnect:F,isValidConnection:a||H.isValidConnection,getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}D?g?.($):y?.($)},L=$=>{const{onClickConnectStart:D,onClickConnectEnd:H,connectionClickStartHandle:U,connectionMode:Z,isValidConnection:tt,lib:j,rfId:Y,nodeLookup:W,connection:et}=A.getState();if(!E||!U&&!l)return;if(!U){D?.($.nativeEvent,{nodeId:E,handleId:S,handleType:t}),A.setState({connectionClickStartHandle:{nodeId:E,type:t,id:S}});return}const rt=qS($.target),ut=a||tt,{connection:ct,isValid:lt}=Lh.isValid($.nativeEvent,{handle:{nodeId:E,id:S,type:t},connectionMode:Z,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:ut,flowId:Y,doc:rt,lib:j,nodeLookup:W});lt&&ct&&F(ct);const ft=structuredClone(et);delete ft.inProgress,ft.toPosition=ft.toHandle?ft.toHandle.position:null,H?.($,ft),A.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":S,"data-nodeid":E,"data-handlepos":n,"data-id":`${M}-${E}-${S}-${t}`,className:le(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",N,h,{source:!T,target:T,connectable:o,connectablestart:l,connectableend:u,clickconnecting:O,connectingfrom:z,connectingto:V,valid:P,connectionindicator:o&&(!X||k)&&(X||st?u:l)}]),onMouseDown:it,onTouchStart:it,onClick:_?L:void 0,ref:x,...v,children:p})}const Hs=R.memo(hw(Cj));function Dj({data:t,isConnectable:n,sourcePosition:a=pt.Bottom}){return w.jsxs(w.Fragment,{children:[t?.label,w.jsx(Hs,{type:"source",position:a,isConnectable:n})]})}function Rj({data:t,isConnectable:n,targetPosition:a=pt.Top,sourcePosition:o=pt.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(Hs,{type:"target",position:a,isConnectable:n}),t?.label,w.jsx(Hs,{type:"source",position:o,isConnectable:n})]})}function jj(){return null}function zj({data:t,isConnectable:n,targetPosition:a=pt.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(Hs,{type:"target",position:a,isConnectable:n}),t?.label]})}const Lu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$x={input:Dj,default:Rj,output:zj,group:jj};function Oj(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const Vj=t=>{const{width:n,height:a,x:o,y:l}=Er(t.nodeLookup,{filter:u=>!!u.selected});return{width:yn(n)?n:null,height:yn(a)?a:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${l}px)`}};function Lj({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:a}){const o=Kt(),{width:l,height:u,transformString:c,userSelectionActive:d}=Rt(Vj,It),p=gw(),h=R.useRef(null);if(R.useEffect(()=>{a||h.current?.focus({preventScroll:!0})},[a]),pw({nodeRef:h}),d||!l||!u)return null;const g=t?v=>{const x=o.getState().nodes.filter(S=>S.selected);t(v,x)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(Lu,v.key)&&(v.preventDefault(),p({direction:Lu[v.key],factor:v.shiftKey?4:1}))};return w.jsx("div",{className:le(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c},children:w.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:a?void 0:-1,onKeyDown:a?void 0:y,style:{width:l,height:u}})})}const Zx=typeof window<"u"?window:void 0,Hj=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function vw({children:t,onPaneClick:n,onPaneMouseEnter:a,onPaneMouseMove:o,onPaneMouseLeave:l,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:d,deleteKeyCode:p,selectionKeyCode:h,selectionOnDrag:g,selectionMode:y,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:S,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:E,zoomOnScroll:_,zoomOnPinch:N,panOnScroll:M,panOnScrollSpeed:z,panOnScrollMode:V,zoomOnDoubleClick:O,panOnDrag:k,defaultViewport:X,translateExtent:st,minZoom:P,maxZoom:F,preventScrolling:it,onSelectionContextMenu:L,noWheelClassName:$,noPanClassName:D,disableKeyboardA11y:H,onViewportChange:U,isControlledViewport:Z}){const{nodesSelectionActive:tt,userSelectionActive:j}=Rt(Hj,It),Y=dr(h,{target:Zx}),W=dr(T,{target:Zx}),et=W||k,rt=W||M,ut=g&&et!==!0,ct=Y||j||ut;return yj({deleteKeyCode:p,multiSelectionKeyCode:S}),w.jsx(bj,{onPaneContextMenu:u,elementsSelectable:E,zoomOnScroll:_,zoomOnPinch:N,panOnScroll:rt,panOnScrollSpeed:z,panOnScrollMode:V,zoomOnDoubleClick:O,panOnDrag:!Y&&et,defaultViewport:X,translateExtent:st,minZoom:P,maxZoom:F,zoomActivationKeyCode:A,preventScrolling:it,noWheelClassName:$,noPanClassName:D,onViewportChange:U,isControlledViewport:Z,paneClickDistance:d,selectionOnDrag:ut,children:w.jsxs(Tj,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:a,onPaneMouseMove:o,onPaneMouseLeave:l,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:et,isSelecting:!!ct,selectionMode:y,selectionKeyPressed:Y,paneClickDistance:d,selectionOnDrag:ut,children:[t,tt&&w.jsx(Lj,{onSelectionContextMenu:L,noPanClassName:D,disableKeyboardA11y:H})]})})}vw.displayName="FlowRenderer";const Bj=R.memo(vw),kj=t=>n=>t?Nm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(a=>a.id):Array.from(n.nodeLookup.keys());function Uj(t){return Rt(R.useCallback(kj(t),[t]),It)}const Yj=t=>t.updateNodeInternals;function qj(){const t=Rt(Yj),[n]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(a=>{const o=new Map;a.forEach(l=>{const u=l.target.getAttribute("data-id");o.set(u,{id:u,nodeElement:l.target,force:!0})}),t(o)}));return R.useEffect(()=>()=>{n?.disconnect()},[n]),n}function Xj({node:t,nodeType:n,hasDimensions:a,resizeObserver:o}){const l=Kt(),u=R.useRef(null),c=R.useRef(null),d=R.useRef(t.sourcePosition),p=R.useRef(t.targetPosition),h=R.useRef(n),g=a&&!!t.internals.handleBounds;return R.useEffect(()=>{u.current&&!t.hidden&&(!g||c.current!==u.current)&&(c.current&&o?.unobserve(c.current),o?.observe(u.current),c.current=u.current)},[g,t.hidden]),R.useEffect(()=>()=>{c.current&&(o?.unobserve(c.current),c.current=null)},[]),R.useEffect(()=>{if(u.current){const y=h.current!==n,v=d.current!==t.sourcePosition,x=p.current!==t.targetPosition;(y||v||x)&&(h.current=n,d.current=t.sourcePosition,p.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,n,t.sourcePosition,t.targetPosition]),u}function Gj({id:t,onClick:n,onMouseEnter:a,onMouseMove:o,onMouseLeave:l,onContextMenu:u,onDoubleClick:c,nodesDraggable:d,elementsSelectable:p,nodesConnectable:h,nodesFocusable:g,resizeObserver:y,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:S,rfId:T,nodeTypes:A,nodeClickDistance:E,onError:_}){const{node:N,internals:M,isParent:z}=Rt(lt=>{const ft=lt.nodeLookup.get(t),Et=lt.parentLookup.has(t);return{node:ft,internals:ft.internals,isParent:Et}},It);let V=N.type||"default",O=A?.[V]||$x[V];O===void 0&&(_?.("003",Dn.error003(V)),V="default",O=A?.default||$x.default);const k=!!(N.draggable||d&&typeof N.draggable>"u"),X=!!(N.selectable||p&&typeof N.selectable>"u"),st=!!(N.connectable||h&&typeof N.connectable>"u"),P=!!(N.focusable||g&&typeof N.focusable>"u"),F=Kt(),it=US(N),L=Xj({node:N,nodeType:V,hasDimensions:it,resizeObserver:y}),$=pw({nodeRef:L,disabled:N.hidden||!k,noDragClassName:v,handleSelector:N.dragHandle,nodeId:t,isSelectable:X,nodeClickDistance:E}),D=gw();if(N.hidden)return null;const H=oi(N),U=Oj(N),Z=X||k||n||a||o||l,tt=a?lt=>a(lt,{...M.userNode}):void 0,j=o?lt=>o(lt,{...M.userNode}):void 0,Y=l?lt=>l(lt,{...M.userNode}):void 0,W=u?lt=>u(lt,{...M.userNode}):void 0,et=c?lt=>c(lt,{...M.userNode}):void 0,rt=lt=>{const{selectNodesOnDrag:ft,nodeDragThreshold:Et}=F.getState();X&&(!ft||!k||Et>0)&&Hh({id:t,store:F,nodeRef:L}),n&&n(lt,{...M.userNode})},ut=lt=>{if(!(XS(lt.nativeEvent)||S)){if(RS.includes(lt.key)&&X){const ft=lt.key==="Escape";Hh({id:t,store:F,unselect:ft,nodeRef:L})}else if(k&&N.selected&&Object.prototype.hasOwnProperty.call(Lu,lt.key)){lt.preventDefault();const{ariaLabelConfig:ft}=F.getState();F.setState({ariaLiveMessage:ft["node.a11yDescription.ariaLiveMessage"]({direction:lt.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),D({direction:Lu[lt.key],factor:lt.shiftKey?4:1})}}},ct=()=>{if(S||!L.current?.matches(":focus-visible"))return;const{transform:lt,width:ft,height:Et,autoPanOnNodeFocus:St,setCenter:yt}=F.getState();if(!St)return;Nm(new Map([[t,N]]),{x:0,y:0,width:ft,height:Et},lt,!0).length>0||yt(N.position.x+H.width/2,N.position.y+H.height/2,{zoom:lt[2]})};return w.jsx("div",{className:le(["react-flow__node",`react-flow__node-${V}`,{[x]:k},N.className,{selected:N.selected,selectable:X,parent:z,draggable:k,dragging:$}]),ref:L,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:it?"visible":"hidden",...N.style,...U},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:tt,onMouseMove:j,onMouseLeave:Y,onContextMenu:W,onClick:rt,onDoubleClick:et,onKeyDown:P?ut:void 0,tabIndex:P?0:void 0,onFocus:P?ct:void 0,role:N.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${rw}-${T}`,"aria-label":N.ariaLabel,...N.domAttributes,children:w.jsx(Nj,{value:t,children:w.jsx(O,{id:t,data:N.data,type:V,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:N.selected??!1,selectable:X,draggable:k,deletable:N.deletable??!0,isConnectable:st,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:$,dragHandle:N.dragHandle,zIndex:M.z,parentId:N.parentId,...H})})})}var $j=R.memo(Gj);const Zj=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function xw(t){const{nodesDraggable:n,nodesConnectable:a,nodesFocusable:o,elementsSelectable:l,onError:u}=Rt(Zj,It),c=Uj(t.onlyRenderVisibleElements),d=qj();return w.jsx("div",{className:"react-flow__nodes",style:Qu,children:c.map(p=>w.jsx($j,{id:p,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:d,nodesDraggable:n,nodesConnectable:a,nodesFocusable:o,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:u},p))})}xw.displayName="NodeRenderer";const Pj=R.memo(xw);function Ij(t){return Rt(R.useCallback(a=>{if(!t)return a.edges.map(l=>l.id);const o=[];if(a.width&&a.height)for(const l of a.edges){const u=a.nodeLookup.get(l.source),c=a.nodeLookup.get(l.target);u&&c&&Z4({sourceNode:u,targetNode:c,width:a.width,height:a.height,transform:a.transform})&&o.push(l.id)}return o},[t]),It)}const Kj=({color:t="none",strokeWidth:n=1})=>{const a={strokeWidth:n,...t&&{stroke:t}};return w.jsx("polyline",{className:"arrow",style:a,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Qj=({color:t="none",strokeWidth:n=1})=>{const a={strokeWidth:n,...t&&{stroke:t,fill:t}};return w.jsx("polyline",{className:"arrowclosed",style:a,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Px={[zu.Arrow]:Kj,[zu.ArrowClosed]:Qj};function Fj(t){const n=Kt();return R.useMemo(()=>Object.prototype.hasOwnProperty.call(Px,t)?Px[t]:(n.getState().onError?.("009",Dn.error009(t)),null),[t])}const Jj=({id:t,type:n,color:a,width:o=12.5,height:l=12.5,markerUnits:u="strokeWidth",strokeWidth:c,orient:d="auto-start-reverse"})=>{const p=Fj(n);return p?w.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:d,refX:"0",refY:"0",children:w.jsx(p,{color:a,strokeWidth:c})}):null},bw=({defaultColor:t,rfId:n})=>{const a=Rt(u=>u.edges),o=Rt(u=>u.defaultEdgeOptions),l=R.useMemo(()=>tR(a,{id:n,defaultColor:t,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[a,o,n,t]);return l.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:l.map(u=>w.jsx(Jj,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};bw.displayName="MarkerDefinitions";var Wj=R.memo(bw);function Sw({x:t,y:n,label:a,labelStyle:o,labelShowBg:l=!0,labelBgStyle:u,labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:p,className:h,...g}){const[y,v]=R.useState({x:1,y:0,width:0,height:0}),x=le(["react-flow__edge-textwrapper",h]),S=R.useRef(null);return R.useEffect(()=>{if(S.current){const T=S.current.getBBox();v({x:T.x,y:T.y,width:T.width,height:T.height})}},[a]),a?w.jsxs("g",{transform:`translate(${t-y.width/2} ${n-y.height/2})`,className:x,visibility:y.width?"visible":"hidden",...g,children:[l&&w.jsx("rect",{width:y.width+2*c[0],x:-c[0],y:-c[1],height:y.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:d,ry:d}),w.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:S,style:o,children:a}),p]}):null}Sw.displayName="EdgeText";const tz=R.memo(Sw);function Nr({path:t,labelX:n,labelY:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,interactionWidth:h=20,...g}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...g,d:t,fill:"none",className:le(["react-flow__edge-path",g.className])}),h?w.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,o&&yn(n)&&yn(a)?w.jsx(tz,{x:n,y:a,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p}):null]})}function Ix({pos:t,x1:n,y1:a,x2:o,y2:l}){return t===pt.Left||t===pt.Right?[.5*(n+o),a]:[n,.5*(a+l)]}function ww({sourceX:t,sourceY:n,sourcePosition:a=pt.Bottom,targetX:o,targetY:l,targetPosition:u=pt.Top}){const[c,d]=Ix({pos:a,x1:t,y1:n,x2:o,y2:l}),[p,h]=Ix({pos:u,x1:o,y1:l,x2:t,y2:n}),[g,y,v,x]=$S({sourceX:t,sourceY:n,targetX:o,targetY:l,sourceControlX:c,sourceControlY:d,targetControlX:p,targetControlY:h});return[`M${t},${n} C${c},${d} ${p},${h} ${o},${l}`,g,y,v,x]}function Ew(t){return R.memo(({id:n,sourceX:a,sourceY:o,targetX:l,targetY:u,sourcePosition:c,targetPosition:d,label:p,labelStyle:h,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:x,style:S,markerEnd:T,markerStart:A,interactionWidth:E})=>{const[_,N,M]=ww({sourceX:a,sourceY:o,sourcePosition:c,targetX:l,targetY:u,targetPosition:d}),z=t.isInternal?void 0:n;return w.jsx(Nr,{id:z,path:_,labelX:N,labelY:M,label:p,labelStyle:h,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:x,style:S,markerEnd:T,markerStart:A,interactionWidth:E})})}const ez=Ew({isInternal:!1}),Tw=Ew({isInternal:!0});ez.displayName="SimpleBezierEdge";Tw.displayName="SimpleBezierEdgeInternal";function Aw(t){return R.memo(({id:n,sourceX:a,sourceY:o,targetX:l,targetY:u,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:v,sourcePosition:x=pt.Bottom,targetPosition:S=pt.Top,markerEnd:T,markerStart:A,pathOptions:E,interactionWidth:_})=>{const[N,M,z]=zh({sourceX:a,sourceY:o,sourcePosition:x,targetX:l,targetY:u,targetPosition:S,borderRadius:E?.borderRadius,offset:E?.offset,stepPosition:E?.stepPosition}),V=t.isInternal?void 0:n;return w.jsx(Nr,{id:V,path:N,labelX:M,labelY:z,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:T,markerStart:A,interactionWidth:_})})}const Nw=Aw({isInternal:!1}),Mw=Aw({isInternal:!0});Nw.displayName="SmoothStepEdge";Mw.displayName="SmoothStepEdgeInternal";function _w(t){return R.memo(({id:n,...a})=>{const o=t.isInternal?void 0:n;return w.jsx(Nw,{...a,id:o,pathOptions:R.useMemo(()=>({borderRadius:0,offset:a.pathOptions?.offset}),[a.pathOptions?.offset])})})}const nz=_w({isInternal:!1}),Cw=_w({isInternal:!0});nz.displayName="StepEdge";Cw.displayName="StepEdgeInternal";function Dw(t){return R.memo(({id:n,sourceX:a,sourceY:o,targetX:l,targetY:u,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:x,markerStart:S,interactionWidth:T})=>{const[A,E,_]=PS({sourceX:a,sourceY:o,targetX:l,targetY:u}),N=t.isInternal?void 0:n;return w.jsx(Nr,{id:N,path:A,labelX:E,labelY:_,label:c,labelStyle:d,labelShowBg:p,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:y,style:v,markerEnd:x,markerStart:S,interactionWidth:T})})}const iz=Dw({isInternal:!1}),Rw=Dw({isInternal:!0});iz.displayName="StraightEdge";Rw.displayName="StraightEdgeInternal";function jw(t){return R.memo(({id:n,sourceX:a,sourceY:o,targetX:l,targetY:u,sourcePosition:c=pt.Bottom,targetPosition:d=pt.Top,label:p,labelStyle:h,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:x,style:S,markerEnd:T,markerStart:A,pathOptions:E,interactionWidth:_})=>{const[N,M,z]=Cm({sourceX:a,sourceY:o,sourcePosition:c,targetX:l,targetY:u,targetPosition:d,curvature:E?.curvature}),V=t.isInternal?void 0:n;return w.jsx(Nr,{id:V,path:N,labelX:M,labelY:z,label:p,labelStyle:h,labelShowBg:g,labelBgStyle:y,labelBgPadding:v,labelBgBorderRadius:x,style:S,markerEnd:T,markerStart:A,interactionWidth:_})})}const az=jw({isInternal:!1}),zw=jw({isInternal:!0});az.displayName="BezierEdge";zw.displayName="BezierEdgeInternal";const Kx={default:zw,straight:Rw,step:Cw,smoothstep:Mw,simplebezier:Tw},Qx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},sz=(t,n,a)=>a===pt.Left?t-n:a===pt.Right?t+n:t,oz=(t,n,a)=>a===pt.Top?t-n:a===pt.Bottom?t+n:t,Fx="react-flow__edgeupdater";function Jx({position:t,centerX:n,centerY:a,radius:o=10,onMouseDown:l,onMouseEnter:u,onMouseOut:c,type:d}){return w.jsx("circle",{onMouseDown:l,onMouseEnter:u,onMouseOut:c,className:le([Fx,`${Fx}-${d}`]),cx:sz(n,o,t),cy:oz(a,o,t),r:o,stroke:"transparent",fill:"transparent"})}function rz({isReconnectable:t,reconnectRadius:n,edge:a,sourceX:o,sourceY:l,targetX:u,targetY:c,sourcePosition:d,targetPosition:p,onReconnect:h,onReconnectStart:g,onReconnectEnd:y,setReconnecting:v,setUpdateHover:x}){const S=Kt(),T=(M,z)=>{if(M.button!==0)return;const{autoPanOnConnect:V,domNode:O,isValidConnection:k,connectionMode:X,connectionRadius:st,lib:P,onConnectStart:F,onConnectEnd:it,cancelConnection:L,nodeLookup:$,rfId:D,panBy:H,updateConnection:U}=S.getState(),Z=z.type==="target",tt=(W,et)=>{v(!1),y?.(W,a,z.type,et)},j=W=>h?.(a,W),Y=(W,et)=>{v(!0),g?.(M,a,z.type),F?.(W,et)};Lh.onPointerDown(M.nativeEvent,{autoPanOnConnect:V,connectionMode:X,connectionRadius:st,domNode:O,handleId:z.id,nodeId:z.nodeId,nodeLookup:$,isTarget:Z,edgeUpdaterType:z.type,lib:P,flowId:D,cancelConnection:L,panBy:H,isValidConnection:k,onConnect:j,onConnectStart:Y,onConnectEnd:it,onReconnectEnd:tt,updateConnection:U,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},A=M=>T(M,{nodeId:a.target,id:a.targetHandle??null,type:"target"}),E=M=>T(M,{nodeId:a.source,id:a.sourceHandle??null,type:"source"}),_=()=>x(!0),N=()=>x(!1);return w.jsxs(w.Fragment,{children:[(t===!0||t==="source")&&w.jsx(Jx,{position:d,centerX:o,centerY:l,radius:n,onMouseDown:A,onMouseEnter:_,onMouseOut:N,type:"source"}),(t===!0||t==="target")&&w.jsx(Jx,{position:p,centerX:u,centerY:c,radius:n,onMouseDown:E,onMouseEnter:_,onMouseOut:N,type:"target"})]})}function lz({id:t,edgesFocusable:n,edgesReconnectable:a,elementsSelectable:o,onClick:l,onDoubleClick:u,onContextMenu:c,onMouseEnter:d,onMouseMove:p,onMouseLeave:h,reconnectRadius:g,onReconnect:y,onReconnectStart:v,onReconnectEnd:x,rfId:S,edgeTypes:T,noPanClassName:A,onError:E,disableKeyboardA11y:_}){let N=Rt(yt=>yt.edgeLookup.get(t));const M=Rt(yt=>yt.defaultEdgeOptions);N=M?{...M,...N}:N;let z=N.type||"default",V=T?.[z]||Kx[z];V===void 0&&(E?.("011",Dn.error011(z)),z="default",V=T?.default||Kx.default);const O=!!(N.focusable||n&&typeof N.focusable>"u"),k=typeof y<"u"&&(N.reconnectable||a&&typeof N.reconnectable>"u"),X=!!(N.selectable||o&&typeof N.selectable>"u"),st=R.useRef(null),[P,F]=R.useState(!1),[it,L]=R.useState(!1),$=Kt(),{zIndex:D,sourceX:H,sourceY:U,targetX:Z,targetY:tt,sourcePosition:j,targetPosition:Y}=Rt(R.useCallback(yt=>{const xt=yt.nodeLookup.get(N.source),Mt=yt.nodeLookup.get(N.target);if(!xt||!Mt)return{zIndex:N.zIndex,...Qx};const Bt=W4({id:t,sourceNode:xt,targetNode:Mt,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:yt.connectionMode,onError:E});return{zIndex:$4({selected:N.selected,zIndex:N.zIndex,sourceNode:xt,targetNode:Mt,elevateOnSelect:yt.elevateEdgesOnSelect,zIndexMode:yt.zIndexMode}),...Bt||Qx}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),It),W=R.useMemo(()=>N.markerStart?`url('#${Oh(N.markerStart,S)}')`:void 0,[N.markerStart,S]),et=R.useMemo(()=>N.markerEnd?`url('#${Oh(N.markerEnd,S)}')`:void 0,[N.markerEnd,S]);if(N.hidden||H===null||U===null||Z===null||tt===null)return null;const rt=yt=>{const{addSelectedEdges:xt,unselectNodesAndEdges:Mt,multiSelectionActive:Bt}=$.getState();X&&($.setState({nodesSelectionActive:!1}),N.selected&&Bt?(Mt({nodes:[],edges:[N]}),st.current?.blur()):xt([t])),l&&l(yt,N)},ut=u?yt=>{u(yt,{...N})}:void 0,ct=c?yt=>{c(yt,{...N})}:void 0,lt=d?yt=>{d(yt,{...N})}:void 0,ft=p?yt=>{p(yt,{...N})}:void 0,Et=h?yt=>{h(yt,{...N})}:void 0,St=yt=>{if(!_&&RS.includes(yt.key)&&X){const{unselectNodesAndEdges:xt,addSelectedEdges:Mt}=$.getState();yt.key==="Escape"?(st.current?.blur(),xt({edges:[N]})):Mt([t])}};return w.jsx("svg",{style:{zIndex:D},children:w.jsxs("g",{className:le(["react-flow__edge",`react-flow__edge-${z}`,N.className,A,{selected:N.selected,animated:N.animated,inactive:!X&&!l,updating:P,selectable:X}]),onClick:rt,onDoubleClick:ut,onContextMenu:ct,onMouseEnter:lt,onMouseMove:ft,onMouseLeave:Et,onKeyDown:O?St:void 0,tabIndex:O?0:void 0,role:N.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":O?`${lw}-${S}`:void 0,ref:st,...N.domAttributes,children:[!it&&w.jsx(V,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:X,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:H,sourceY:U,targetX:Z,targetY:tt,sourcePosition:j,targetPosition:Y,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:W,markerEnd:et,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),k&&w.jsx(rz,{edge:N,isReconnectable:k,reconnectRadius:g,onReconnect:y,onReconnectStart:v,onReconnectEnd:x,sourceX:H,sourceY:U,targetX:Z,targetY:tt,sourcePosition:j,targetPosition:Y,setUpdateHover:F,setReconnecting:L})]})})}var uz=R.memo(lz);const cz=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Ow({defaultMarkerColor:t,onlyRenderVisibleElements:n,rfId:a,edgeTypes:o,noPanClassName:l,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:d,onEdgeMouseMove:p,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:y,onEdgeDoubleClick:v,onReconnectStart:x,onReconnectEnd:S,disableKeyboardA11y:T}){const{edgesFocusable:A,edgesReconnectable:E,elementsSelectable:_,onError:N}=Rt(cz,It),M=Ij(n);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(Wj,{defaultColor:t,rfId:a}),M.map(z=>w.jsx(uz,{id:z,edgesFocusable:A,edgesReconnectable:E,elementsSelectable:_,noPanClassName:l,onReconnect:u,onContextMenu:c,onMouseEnter:d,onMouseMove:p,onMouseLeave:h,onClick:g,reconnectRadius:y,onDoubleClick:v,onReconnectStart:x,onReconnectEnd:S,rfId:a,onError:N,edgeTypes:o,disableKeyboardA11y:T},z))]})}Ow.displayName="EdgeRenderer";const fz=R.memo(Ow),dz=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function hz({children:t}){const n=Rt(dz);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:t})}function mz(t){const n=Vm(),a=R.useRef(!1);R.useEffect(()=>{!a.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),a.current=!0)},[t,n.viewportInitialized])}const pz=t=>t.panZoom?.syncViewport;function gz(t){const n=Rt(pz),a=Kt();return R.useEffect(()=>{t&&(n?.(t),a.setState({transform:[t.x,t.y,t.zoom]}))},[t,n]),null}function yz(t){return t.connection.inProgress?{...t.connection,to:Ar(t.connection.to,t.transform)}:{...t.connection}}function vz(t){return yz}function xz(t){const n=vz();return Rt(n,It)}const bz=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function Sz({containerStyle:t,style:n,type:a,component:o}){const{nodesConnectable:l,width:u,height:c,isValid:d,inProgress:p}=Rt(bz,It);return!(u&&l&&p)?null:w.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:le(["react-flow__connection",OS(d)]),children:w.jsx(Vw,{style:n,type:a,CustomComponent:o,isValid:d})})})}const Vw=({style:t,type:n=ki.Bezier,CustomComponent:a,isValid:o})=>{const{inProgress:l,from:u,fromNode:c,fromHandle:d,fromPosition:p,to:h,toNode:g,toHandle:y,toPosition:v,pointer:x}=xz();if(!l)return;if(a)return w.jsx(a,{connectionLineType:n,connectionLineStyle:t,fromNode:c,fromHandle:d,fromX:u.x,fromY:u.y,toX:h.x,toY:h.y,fromPosition:p,toPosition:v,connectionStatus:OS(o),toNode:g,toHandle:y,pointer:x});let S="";const T={sourceX:u.x,sourceY:u.y,sourcePosition:p,targetX:h.x,targetY:h.y,targetPosition:v};switch(n){case ki.Bezier:[S]=Cm(T);break;case ki.SimpleBezier:[S]=ww(T);break;case ki.Step:[S]=zh({...T,borderRadius:0});break;case ki.SmoothStep:[S]=zh(T);break;default:[S]=PS(T)}return w.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:t})};Vw.displayName="ConnectionLine";const wz={};function Wx(t=wz){R.useRef(t),Kt(),R.useEffect(()=>{},[t])}function Ez(){Kt(),R.useRef(!1),R.useEffect(()=>{},[])}function Lw({nodeTypes:t,edgeTypes:n,onInit:a,onNodeClick:o,onEdgeClick:l,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:x,connectionLineType:S,connectionLineStyle:T,connectionLineComponent:A,connectionLineContainerStyle:E,selectionKeyCode:_,selectionOnDrag:N,selectionMode:M,multiSelectionKeyCode:z,panActivationKeyCode:V,zoomActivationKeyCode:O,deleteKeyCode:k,onlyRenderVisibleElements:X,elementsSelectable:st,defaultViewport:P,translateExtent:F,minZoom:it,maxZoom:L,preventScrolling:$,defaultMarkerColor:D,zoomOnScroll:H,zoomOnPinch:U,panOnScroll:Z,panOnScrollSpeed:tt,panOnScrollMode:j,zoomOnDoubleClick:Y,panOnDrag:W,onPaneClick:et,onPaneMouseEnter:rt,onPaneMouseMove:ut,onPaneMouseLeave:ct,onPaneScroll:lt,onPaneContextMenu:ft,paneClickDistance:Et,nodeClickDistance:St,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:Mt,onEdgeMouseLeave:Bt,reconnectRadius:Vt,onReconnect:de,onReconnectStart:rn,onReconnectEnd:ke,noDragClassName:ln,noWheelClassName:jn,noPanClassName:$i,disableKeyboardA11y:Zi,nodeExtent:me,rfId:Ca,viewport:zn,onViewportChange:ri}){return Wx(t),Wx(n),Ez(),mz(a),gz(zn),w.jsx(Bj,{onPaneClick:et,onPaneMouseEnter:rt,onPaneMouseMove:ut,onPaneMouseLeave:ct,onPaneContextMenu:ft,onPaneScroll:lt,paneClickDistance:Et,deleteKeyCode:k,selectionKeyCode:_,selectionOnDrag:N,selectionMode:M,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:z,panActivationKeyCode:V,zoomActivationKeyCode:O,elementsSelectable:st,zoomOnScroll:H,zoomOnPinch:U,zoomOnDoubleClick:Y,panOnScroll:Z,panOnScrollSpeed:tt,panOnScrollMode:j,panOnDrag:W,defaultViewport:P,translateExtent:F,minZoom:it,maxZoom:L,onSelectionContextMenu:y,preventScrolling:$,noDragClassName:ln,noWheelClassName:jn,noPanClassName:$i,disableKeyboardA11y:Zi,onViewportChange:ri,isControlledViewport:!!zn,children:w.jsxs(hz,{children:[w.jsx(fz,{edgeTypes:n,onEdgeClick:l,onEdgeDoubleClick:c,onReconnect:de,onReconnectStart:rn,onReconnectEnd:ke,onlyRenderVisibleElements:X,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:Mt,onEdgeMouseLeave:Bt,reconnectRadius:Vt,defaultMarkerColor:D,noPanClassName:$i,disableKeyboardA11y:Zi,rfId:Ca}),w.jsx(Sz,{style:T,type:S,component:A,containerStyle:E}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(Pj,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:St,onlyRenderVisibleElements:X,noPanClassName:$i,noDragClassName:ln,disableKeyboardA11y:Zi,nodeExtent:me,rfId:Ca}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}Lw.displayName="GraphView";const Tz=R.memo(Lw),t1=({nodes:t,edges:n,defaultNodes:a,defaultEdges:o,width:l,height:u,fitView:c,fitViewOptions:d,minZoom:p=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:y,zIndexMode:v="basic"}={})=>{const x=new Map,S=new Map,T=new Map,A=new Map,E=o??n??[],_=a??t??[],N=g??[0,0],M=y??lr;QS(T,A,E);const z=Vh(_,x,S,{nodeOrigin:N,nodeExtent:M,zIndexMode:v});let V=[0,0,1];if(c&&l&&u){const O=Er(x,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:k,y:X,zoom:st}=Mm(O,l,u,p,h,d?.padding??.1);V=[k,X,st]}return{rfId:"1",width:l??0,height:u??0,transform:V,nodes:_,nodesInitialized:z,nodeLookup:x,parentLookup:S,edges:E,edgeLookup:A,connectionLookup:T,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:a!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:p,maxZoom:h,translateExtent:lr,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:js.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:d,fitViewResolver:null,connection:{...zS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:k4,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:jS,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Az=({nodes:t,edges:n,defaultNodes:a,defaultEdges:o,width:l,height:u,fitView:c,fitViewOptions:d,minZoom:p,maxZoom:h,nodeOrigin:g,nodeExtent:y,zIndexMode:v})=>XR((x,S)=>{async function T(){const{nodeLookup:A,panZoom:E,fitViewOptions:_,fitViewResolver:N,width:M,height:z,minZoom:V,maxZoom:O}=S();E&&(await H4({nodes:A,width:M,height:z,panZoom:E,minZoom:V,maxZoom:O},_),N?.resolve(!0),x({fitViewResolver:null}))}return{...t1({nodes:t,edges:n,width:l,height:u,fitView:c,fitViewOptions:d,minZoom:p,maxZoom:h,nodeOrigin:g,nodeExtent:y,defaultNodes:a,defaultEdges:o,zIndexMode:v}),setNodes:A=>{const{nodeLookup:E,parentLookup:_,nodeOrigin:N,elevateNodesOnSelect:M,fitViewQueued:z,zIndexMode:V}=S(),O=Vh(A,E,_,{nodeOrigin:N,nodeExtent:y,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:V});z&&O?(T(),x({nodes:A,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:A,nodesInitialized:O})},setEdges:A=>{const{connectionLookup:E,edgeLookup:_}=S();QS(E,_,A),x({edges:A})},setDefaultNodesAndEdges:(A,E)=>{if(A){const{setNodes:_}=S();_(A),x({hasDefaultNodes:!0})}if(E){const{setEdges:_}=S();_(E),x({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:E,nodeLookup:_,parentLookup:N,domNode:M,nodeOrigin:z,nodeExtent:V,debug:O,fitViewQueued:k,zIndexMode:X}=S(),{changes:st,updatedInternals:P}=rR(A,_,N,M,z,V,X);P&&(iR(_,N,{nodeOrigin:z,nodeExtent:V,zIndexMode:X}),k?(T(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),st?.length>0&&(O&&console.log("React Flow: trigger node changes",st),E?.(st)))},updateNodePositions:(A,E=!1)=>{const _=[];let N=[];const{nodeLookup:M,triggerNodeChanges:z,connection:V,updateConnection:O,onNodesChangeMiddlewareMap:k}=S();for(const[X,st]of A){const P=M.get(X),F=!!(P?.expandParent&&P?.parentId&&st?.position),it={id:X,type:"position",position:F?{x:Math.max(0,st.position.x),y:Math.max(0,st.position.y)}:st.position,dragging:E};if(P&&V.inProgress&&V.fromNode.id===P.id){const L=_a(P,V.fromHandle,pt.Left,!0);O({...V,from:L})}F&&P.parentId&&_.push({id:X,parentId:P.parentId,rect:{...st.internals.positionAbsolute,width:st.measured.width??0,height:st.measured.height??0}}),N.push(it)}if(_.length>0){const{parentLookup:X,nodeOrigin:st}=S(),P=Om(_,M,X,st);N.push(...P)}for(const X of k.values())N=X(N);z(N)},triggerNodeChanges:A=>{const{onNodesChange:E,setNodes:_,nodes:N,hasDefaultNodes:M,debug:z}=S();if(A?.length){if(M){const V=fw(A,N);_(V)}z&&console.log("React Flow: trigger node changes",A),E?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:E,setEdges:_,edges:N,hasDefaultEdges:M,debug:z}=S();if(A?.length){if(M){const V=dw(A,N);_(V)}z&&console.log("React Flow: trigger edge changes",A),E?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:E,edgeLookup:_,nodeLookup:N,triggerNodeChanges:M,triggerEdgeChanges:z}=S();if(E){const V=A.map(O=>va(O,!0));M(V);return}M(Es(N,new Set([...A]),!0)),z(Es(_))},addSelectedEdges:A=>{const{multiSelectionActive:E,edgeLookup:_,nodeLookup:N,triggerNodeChanges:M,triggerEdgeChanges:z}=S();if(E){const V=A.map(O=>va(O,!0));z(V);return}z(Es(_,new Set([...A]))),M(Es(N,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:E}={})=>{const{edges:_,nodes:N,nodeLookup:M,triggerNodeChanges:z,triggerEdgeChanges:V}=S(),O=A||N,k=E||_,X=O.map(P=>{const F=M.get(P.id);return F&&(F.selected=!1),va(P.id,!1)}),st=k.map(P=>va(P.id,!1));z(X),V(st)},setMinZoom:A=>{const{panZoom:E,maxZoom:_}=S();E?.setScaleExtent([A,_]),x({minZoom:A})},setMaxZoom:A=>{const{panZoom:E,minZoom:_}=S();E?.setScaleExtent([_,A]),x({maxZoom:A})},setTranslateExtent:A=>{S().panZoom?.setTranslateExtent(A),x({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:E,triggerNodeChanges:_,triggerEdgeChanges:N,elementsSelectable:M}=S();if(!M)return;const z=E.reduce((O,k)=>k.selected?[...O,va(k.id,!1)]:O,[]),V=A.reduce((O,k)=>k.selected?[...O,va(k.id,!1)]:O,[]);_(z),N(V)},setNodeExtent:A=>{const{nodes:E,nodeLookup:_,parentLookup:N,nodeOrigin:M,elevateNodesOnSelect:z,nodeExtent:V,zIndexMode:O}=S();A[0][0]===V[0][0]&&A[0][1]===V[0][1]&&A[1][0]===V[1][0]&&A[1][1]===V[1][1]||(Vh(E,_,N,{nodeOrigin:M,nodeExtent:A,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:O}),x({nodeExtent:A}))},panBy:A=>{const{transform:E,width:_,height:N,panZoom:M,translateExtent:z}=S();return lR({delta:A,panZoom:M,transform:E,translateExtent:z,width:_,height:N})},setCenter:async(A,E,_)=>{const{width:N,height:M,maxZoom:z,panZoom:V}=S();if(!V)return Promise.resolve(!1);const O=typeof _?.zoom<"u"?_.zoom:z;return await V.setViewport({x:N/2-A*O,y:M/2-E*O,zoom:O},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...zS}})},updateConnection:A=>{x({connection:A})},reset:()=>x({...t1()})}},Object.is);function Nz({initialNodes:t,initialEdges:n,defaultNodes:a,defaultEdges:o,initialWidth:l,initialHeight:u,initialMinZoom:c,initialMaxZoom:d,initialFitViewOptions:p,fitView:h,nodeOrigin:g,nodeExtent:y,zIndexMode:v,children:x}){const[S]=R.useState(()=>Az({nodes:t,edges:n,defaultNodes:a,defaultEdges:o,width:l,height:u,fitView:h,minZoom:c,maxZoom:d,fitViewOptions:p,nodeOrigin:g,nodeExtent:y,zIndexMode:v}));return w.jsx(GR,{value:S,children:w.jsx(hj,{children:x})})}function Mz({children:t,nodes:n,edges:a,defaultNodes:o,defaultEdges:l,width:u,height:c,fitView:d,fitViewOptions:p,minZoom:h,maxZoom:g,nodeOrigin:y,nodeExtent:v,zIndexMode:x}){return R.useContext(Iu)?w.jsx(w.Fragment,{children:t}):w.jsx(Nz,{initialNodes:n,initialEdges:a,defaultNodes:o,defaultEdges:l,initialWidth:u,initialHeight:c,fitView:d,initialFitViewOptions:p,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:y,nodeExtent:v,zIndexMode:x,children:t})}const _z={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Cz({nodes:t,edges:n,defaultNodes:a,defaultEdges:o,className:l,nodeTypes:u,edgeTypes:c,onNodeClick:d,onEdgeClick:p,onInit:h,onMove:g,onMoveStart:y,onMoveEnd:v,onConnect:x,onConnectStart:S,onConnectEnd:T,onClickConnectStart:A,onClickConnectEnd:E,onNodeMouseEnter:_,onNodeMouseMove:N,onNodeMouseLeave:M,onNodeContextMenu:z,onNodeDoubleClick:V,onNodeDragStart:O,onNodeDrag:k,onNodeDragStop:X,onNodesDelete:st,onEdgesDelete:P,onDelete:F,onSelectionChange:it,onSelectionDragStart:L,onSelectionDrag:$,onSelectionDragStop:D,onSelectionContextMenu:H,onSelectionStart:U,onSelectionEnd:Z,onBeforeDelete:tt,connectionMode:j,connectionLineType:Y=ki.Bezier,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:rt,deleteKeyCode:ut="Backspace",selectionKeyCode:ct="Shift",selectionOnDrag:lt=!1,selectionMode:ft=ur.Full,panActivationKeyCode:Et="Space",multiSelectionKeyCode:St=fr()?"Meta":"Control",zoomActivationKeyCode:yt=fr()?"Meta":"Control",snapToGrid:xt,snapGrid:Mt,onlyRenderVisibleElements:Bt=!1,selectNodesOnDrag:Vt,nodesDraggable:de,autoPanOnNodeFocus:rn,nodesConnectable:ke,nodesFocusable:ln,nodeOrigin:jn=uw,edgesFocusable:$i,edgesReconnectable:Zi,elementsSelectable:me=!0,defaultViewport:Ca=ij,minZoom:zn=.5,maxZoom:ri=2,translateExtent:Pi=lr,preventScrolling:Fu=!0,nodeExtent:Da,defaultMarkerColor:Ju="#b1b1b7",zoomOnScroll:Wu=!0,zoomOnPinch:Ii=!0,panOnScroll:Ee=!1,panOnScrollSpeed:bn=.5,panOnScrollMode:Te=Ta.Free,zoomOnDoubleClick:tc=!0,panOnDrag:ec=!0,onPaneClick:nc,onPaneMouseEnter:Ra,onPaneMouseMove:ja,onPaneMouseLeave:za,onPaneScroll:On,onPaneContextMenu:Oa,paneClickDistance:Ki=1,nodeClickDistance:ic=0,children:Mr,onReconnect:Ys,onReconnectStart:Qi,onReconnectEnd:ac,onEdgeContextMenu:_r,onEdgeDoubleClick:Cr,onEdgeMouseEnter:Dr,onEdgeMouseMove:qs,onEdgeMouseLeave:Xs,reconnectRadius:Rr=10,onNodesChange:jr,onEdgesChange:Sn,noDragClassName:ue="nodrag",noWheelClassName:be="nowheel",noPanClassName:Vn="nopan",fitView:Va,fitViewOptions:zr,connectOnClick:sc,attributionPosition:Or,proOptions:Fi,defaultEdgeOptions:Gs,elevateNodesOnSelect:li=!0,elevateEdgesOnSelect:ui=!1,disableKeyboardA11y:ci=!1,autoPanOnConnect:fi,autoPanOnNodeDrag:ne,autoPanSpeed:Vr,connectionRadius:Lr,isValidConnection:Ln,onError:di,style:oc,id:$s,nodeDragThreshold:Hr,connectionDragThreshold:rc,viewport:La,onViewportChange:Ha,width:un,height:De,colorMode:Br="light",debug:lc,onScroll:Ba,ariaLabelConfig:kr,zIndexMode:Ji="basic",...uc},Re){const Wi=$s||"1",Ur=rj(Br),Zs=R.useCallback(Hn=>{Hn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ba?.(Hn)},[Ba]);return w.jsx("div",{"data-testid":"rf__wrapper",...uc,onScroll:Zs,style:{...oc,..._z},ref:Re,className:le(["react-flow",l,Ur]),id:$s,role:"application",children:w.jsxs(Mz,{nodes:t,edges:n,width:un,height:De,fitView:Va,fitViewOptions:zr,minZoom:zn,maxZoom:ri,nodeOrigin:jn,nodeExtent:Da,zIndexMode:Ji,children:[w.jsx(Tz,{onInit:h,onNodeClick:d,onEdgeClick:p,onNodeMouseEnter:_,onNodeMouseMove:N,onNodeMouseLeave:M,onNodeContextMenu:z,onNodeDoubleClick:V,nodeTypes:u,edgeTypes:c,connectionLineType:Y,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:rt,selectionKeyCode:ct,selectionOnDrag:lt,selectionMode:ft,deleteKeyCode:ut,multiSelectionKeyCode:St,panActivationKeyCode:Et,zoomActivationKeyCode:yt,onlyRenderVisibleElements:Bt,defaultViewport:Ca,translateExtent:Pi,minZoom:zn,maxZoom:ri,preventScrolling:Fu,zoomOnScroll:Wu,zoomOnPinch:Ii,zoomOnDoubleClick:tc,panOnScroll:Ee,panOnScrollSpeed:bn,panOnScrollMode:Te,panOnDrag:ec,onPaneClick:nc,onPaneMouseEnter:Ra,onPaneMouseMove:ja,onPaneMouseLeave:za,onPaneScroll:On,onPaneContextMenu:Oa,paneClickDistance:Ki,nodeClickDistance:ic,onSelectionContextMenu:H,onSelectionStart:U,onSelectionEnd:Z,onReconnect:Ys,onReconnectStart:Qi,onReconnectEnd:ac,onEdgeContextMenu:_r,onEdgeDoubleClick:Cr,onEdgeMouseEnter:Dr,onEdgeMouseMove:qs,onEdgeMouseLeave:Xs,reconnectRadius:Rr,defaultMarkerColor:Ju,noDragClassName:ue,noWheelClassName:be,noPanClassName:Vn,rfId:Wi,disableKeyboardA11y:ci,nodeExtent:Da,viewport:La,onViewportChange:Ha}),w.jsx(oj,{nodes:t,edges:n,defaultNodes:a,defaultEdges:o,onConnect:x,onConnectStart:S,onConnectEnd:T,onClickConnectStart:A,onClickConnectEnd:E,nodesDraggable:de,autoPanOnNodeFocus:rn,nodesConnectable:ke,nodesFocusable:ln,edgesFocusable:$i,edgesReconnectable:Zi,elementsSelectable:me,elevateNodesOnSelect:li,elevateEdgesOnSelect:ui,minZoom:zn,maxZoom:ri,nodeExtent:Da,onNodesChange:jr,onEdgesChange:Sn,snapToGrid:xt,snapGrid:Mt,connectionMode:j,translateExtent:Pi,connectOnClick:sc,defaultEdgeOptions:Gs,fitView:Va,fitViewOptions:zr,onNodesDelete:st,onEdgesDelete:P,onDelete:F,onNodeDragStart:O,onNodeDrag:k,onNodeDragStop:X,onSelectionDrag:$,onSelectionDragStart:L,onSelectionDragStop:D,onMove:g,onMoveStart:y,onMoveEnd:v,noPanClassName:Vn,nodeOrigin:jn,rfId:Wi,autoPanOnConnect:fi,autoPanOnNodeDrag:ne,autoPanSpeed:Vr,onError:di,connectionRadius:Lr,isValidConnection:Ln,selectNodesOnDrag:Vt,nodeDragThreshold:Hr,connectionDragThreshold:rc,onBeforeDelete:tt,debug:lc,ariaLabelConfig:kr,zIndexMode:Ji}),w.jsx(nj,{onSelectionChange:it}),Mr,w.jsx(FR,{proOptions:Fi,position:Or}),w.jsx(QR,{rfId:Wi,disableKeyboardA11y:ci})]})})}var Dz=hw(Cz);function Rz(t){const[n,a]=R.useState(t),o=R.useCallback(l=>a(u=>fw(l,u)),[]);return[n,a,o]}function jz(t){const[n,a]=R.useState(t),o=R.useCallback(l=>a(u=>dw(l,u)),[]);return[n,a,o]}function zz({dimensions:t,lineWidth:n,variant:a,className:o}){return w.jsx("path",{strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:le(["react-flow__background-pattern",a,o])})}function Oz({radius:t,className:n}){return w.jsx("circle",{cx:t,cy:t,r:t,className:le(["react-flow__background-pattern","dots",n])})}var Yi;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Yi||(Yi={}));const Vz={[Yi.Dots]:1,[Yi.Lines]:1,[Yi.Cross]:6},Lz=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Hw({id:t,variant:n=Yi.Dots,gap:a=20,size:o,lineWidth:l=1,offset:u=0,color:c,bgColor:d,style:p,className:h,patternClassName:g}){const y=R.useRef(null),{transform:v,patternId:x}=Rt(Lz,It),S=o||Vz[n],T=n===Yi.Dots,A=n===Yi.Cross,E=Array.isArray(a)?a:[a,a],_=[E[0]*v[2]||1,E[1]*v[2]||1],N=S*v[2],M=Array.isArray(u)?u:[u,u],z=A?[N,N]:_,V=[M[0]*v[2]||1+z[0]/2,M[1]*v[2]||1+z[1]/2],O=`${x}${t||""}`;return w.jsxs("svg",{className:le(["react-flow__background",h]),style:{...p,...Qu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":c},ref:y,"data-testid":"rf__background",children:[w.jsx("pattern",{id:O,x:v[0]%_[0],y:v[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${V[0]},-${V[1]})`,children:T?w.jsx(Oz,{radius:N/2,className:g}):w.jsx(zz,{dimensions:z,lineWidth:l,variant:n,className:g})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}Hw.displayName="Background";const Hz=R.memo(Hw);function Bz(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kz(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Uz(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 Yz(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 qz(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 lu({children:t,className:n,...a}){return w.jsx("button",{type:"button",className:le(["react-flow__controls-button",n]),...a,children:t})}const Xz=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Bw({style:t,showZoom:n=!0,showFitView:a=!0,showInteractive:o=!0,fitViewOptions:l,onZoomIn:u,onZoomOut:c,onFitView:d,onInteractiveChange:p,className:h,children:g,position:y="bottom-left",orientation:v="vertical","aria-label":x}){const S=Kt(),{isInteractive:T,minZoomReached:A,maxZoomReached:E,ariaLabelConfig:_}=Rt(Xz,It),{zoomIn:N,zoomOut:M,fitView:z}=Vm(),V=()=>{N(),u?.()},O=()=>{M(),c?.()},k=()=>{z(l),d?.()},X=()=>{S.setState({nodesDraggable:!T,nodesConnectable:!T,elementsSelectable:!T}),p?.(!T)},st=v==="horizontal"?"horizontal":"vertical";return w.jsxs(Ku,{className:le(["react-flow__controls",st,h]),position:y,style:t,"data-testid":"rf__controls","aria-label":x??_["controls.ariaLabel"],children:[n&&w.jsxs(w.Fragment,{children:[w.jsx(lu,{onClick:V,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:E,children:w.jsx(Bz,{})}),w.jsx(lu,{onClick:O,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:A,children:w.jsx(kz,{})})]}),a&&w.jsx(lu,{className:"react-flow__controls-fitview",onClick:k,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:w.jsx(Uz,{})}),o&&w.jsx(lu,{className:"react-flow__controls-interactive",onClick:X,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:T?w.jsx(qz,{}):w.jsx(Yz,{})}),g]})}Bw.displayName="Controls";const Gz=R.memo(Bw);function $z({id:t,x:n,y:a,width:o,height:l,style:u,color:c,strokeColor:d,strokeWidth:p,className:h,borderRadius:g,shapeRendering:y,selected:v,onClick:x}){const{background:S,backgroundColor:T}=u||{},A=c||S||T;return w.jsx("rect",{className:le(["react-flow__minimap-node",{selected:v},h]),x:n,y:a,rx:g,ry:g,width:o,height:l,style:{fill:A,stroke:d,strokeWidth:p},shapeRendering:y,onClick:x?E=>x(E,t):void 0})}const Zz=R.memo($z),Pz=t=>t.nodes.map(n=>n.id),Qd=t=>t instanceof Function?t:()=>t;function Iz({nodeStrokeColor:t,nodeColor:n,nodeClassName:a="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:u=Zz,onClick:c}){const d=Rt(Pz,It),p=Qd(n),h=Qd(t),g=Qd(a),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:d.map(v=>w.jsx(Qz,{id:v,nodeColorFunc:p,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:l,NodeComponent:u,onClick:c,shapeRendering:y},v))})}function Kz({id:t,nodeColorFunc:n,nodeStrokeColorFunc:a,nodeClassNameFunc:o,nodeBorderRadius:l,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:d,onClick:p}){const{node:h,x:g,y,width:v,height:x}=Rt(S=>{const{internals:T}=S.nodeLookup.get(t),A=T.userNode,{x:E,y:_}=T.positionAbsolute,{width:N,height:M}=oi(A);return{node:A,x:E,y:_,width:N,height:M}},It);return!h||h.hidden||!US(h)?null:w.jsx(d,{x:g,y,width:v,height:x,style:h.style,selected:!!h.selected,className:o(h),color:n(h),borderRadius:l,strokeColor:a(h),strokeWidth:u,shapeRendering:c,onClick:p,id:h.id})}const Qz=R.memo(Kz);var Fz=R.memo(Iz);const Jz=200,Wz=150,t6=t=>!t.hidden,e6=t=>{const n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:t.nodeLookup.size>0?kS(Er(t.nodeLookup,{filter:t6}),n):n,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},n6="react-flow__minimap-desc";function kw({style:t,className:n,nodeStrokeColor:a,nodeColor:o,nodeClassName:l="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:d,bgColor:p,maskColor:h,maskStrokeColor:g,maskStrokeWidth:y,position:v="bottom-right",onClick:x,onNodeClick:S,pannable:T=!1,zoomable:A=!1,ariaLabel:E,inversePan:_,zoomStep:N=1,offsetScale:M=5}){const z=Kt(),V=R.useRef(null),{boundingRect:O,viewBB:k,rfId:X,panZoom:st,translateExtent:P,flowWidth:F,flowHeight:it,ariaLabelConfig:L}=Rt(e6,It),$=t?.width??Jz,D=t?.height??Wz,H=O.width/$,U=O.height/D,Z=Math.max(H,U),tt=Z*$,j=Z*D,Y=M*Z,W=O.x-(tt-O.width)/2-Y,et=O.y-(j-O.height)/2-Y,rt=tt+Y*2,ut=j+Y*2,ct=`${n6}-${X}`,lt=R.useRef(0),ft=R.useRef();lt.current=Z,R.useEffect(()=>{if(V.current&&st)return ft.current=yR({domNode:V.current,panZoom:st,getTransform:()=>z.getState().transform,getViewScale:()=>lt.current}),()=>{ft.current?.destroy()}},[st]),R.useEffect(()=>{ft.current?.update({translateExtent:P,width:F,height:it,inversePan:_,pannable:T,zoomStep:N,zoomable:A})},[T,A,_,N,P,F,it]);const Et=x?xt=>{const[Mt,Bt]=ft.current?.pointer(xt)||[0,0];x(xt,{x:Mt,y:Bt})}:void 0,St=S?R.useCallback((xt,Mt)=>{const Bt=z.getState().nodeLookup.get(Mt).internals.userNode;S(xt,Bt)},[]):void 0,yt=E??L["minimap.ariaLabel"];return w.jsx(Ku,{position:v,style:{...t,"--xy-minimap-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*Z:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:le(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:$,height:D,viewBox:`${W} ${et} ${rt} ${ut}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ct,ref:V,onClick:Et,children:[yt&&w.jsx("title",{id:ct,children:yt}),w.jsx(Fz,{onClick:St,nodeColor:o,nodeStrokeColor:a,nodeBorderRadius:u,nodeClassName:l,nodeStrokeWidth:c,nodeComponent:d}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-Y},${et-Y}h${rt+Y*2}v${ut+Y*2}h${-rt-Y*2}z
26
+ M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}kw.displayName="MiniMap";R.memo(kw);const i6=t=>n=>t?`${Math.max(1/n.transform[2],1)}`:void 0,a6={[Ls.Line]:"right",[Ls.Handle]:"bottom-right"};function s6({nodeId:t,position:n,variant:a=Ls.Handle,className:o,style:l=void 0,children:u,color:c,minWidth:d=10,minHeight:p=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:v,autoScale:x=!0,shouldResize:S,onResizeStart:T,onResize:A,onResizeEnd:E}){const _=yw(),N=typeof t=="string"?t:_,M=Kt(),z=R.useRef(null),V=a===Ls.Handle,O=Rt(R.useCallback(i6(V&&x),[V,x]),It),k=R.useRef(null),X=n??a6[a];R.useEffect(()=>{if(!(!z.current||!N))return k.current||(k.current=RR({domNode:z.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:P,transform:F,snapGrid:it,snapToGrid:L,nodeOrigin:$,domNode:D}=M.getState();return{nodeLookup:P,transform:F,snapGrid:it,snapToGrid:L,nodeOrigin:$,paneDomNode:D}},onChange:(P,F)=>{const{triggerNodeChanges:it,nodeLookup:L,parentLookup:$,nodeOrigin:D}=M.getState(),H=[],U={x:P.x,y:P.y},Z=L.get(N);if(Z&&Z.expandParent&&Z.parentId){const tt=Z.origin??D,j=P.width??Z.measured.width??0,Y=P.height??Z.measured.height??0,W={id:Z.id,parentId:Z.parentId,rect:{width:j,height:Y,...YS({x:P.x??Z.position.x,y:P.y??Z.position.y},{width:j,height:Y},Z.parentId,L,tt)}},et=Om([W],L,$,D);H.push(...et),U.x=P.x?Math.max(tt[0]*j,P.x):void 0,U.y=P.y?Math.max(tt[1]*Y,P.y):void 0}if(U.x!==void 0&&U.y!==void 0){const tt={id:N,type:"position",position:{...U}};H.push(tt)}if(P.width!==void 0&&P.height!==void 0){const j={id:N,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};H.push(j)}for(const tt of F){const j={...tt,type:"position"};H.push(j)}it(H)},onEnd:({width:P,height:F})=>{const it={id:N,type:"dimensions",resizing:!1,dimensions:{width:P,height:F}};M.getState().triggerNodeChanges([it])}})),k.current.update({controlPosition:X,boundaries:{minWidth:d,minHeight:p,maxWidth:h,maxHeight:g},keepAspectRatio:y,resizeDirection:v,onResizeStart:T,onResize:A,onResizeEnd:E,shouldResize:S}),()=>{k.current?.destroy()}},[X,d,p,h,g,y,T,A,E,S]);const st=X.split("-");return w.jsx("div",{className:le(["react-flow__resize-control","nodrag",...st,a,o]),ref:z,style:{...l,scale:O,...c&&{[V?"backgroundColor":"borderColor"]:c}},children:u})}R.memo(s6);function o6(){return w.jsxs("div",{className:"space-y-4 p-6",children:[w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx("div",{className:"w-12 h-12 bg-surface rounded-lg animate-shimmer"}),w.jsxs("div",{className:"flex-1 space-y-2",children:[w.jsx("div",{className:"h-4 bg-surface rounded w-1/3 animate-shimmer"}),w.jsx("div",{className:"h-3 bg-surface rounded w-1/4 animate-shimmer"})]})]}),w.jsx("div",{className:"space-y-3",children:[...Array(5)].map((t,n)=>w.jsxs("div",{className:"flex items-center gap-3 p-3 bg-surface rounded-lg",children:[w.jsx("div",{className:"w-4 h-4 bg-background rounded-full animate-shimmer"}),w.jsxs("div",{className:"flex-1 space-y-2",children:[w.jsx("div",{className:"h-3 bg-background rounded w-2/3 animate-shimmer"}),w.jsx("div",{className:"h-2 bg-background rounded w-1/3 animate-shimmer"})]})]},n))})]})}function r6(){return w.jsxs("div",{className:"w-[280px] h-full bg-surface border-r border-border",children:[w.jsxs("div",{className:"p-4 border-b border-border",children:[w.jsx("div",{className:"h-10 rounded mb-3 animate-shimmer"}),w.jsx("div",{className:"h-6 rounded w-24 animate-shimmer"})]}),w.jsx("div",{className:"p-4 space-y-3",children:[...Array(8)].map((t,n)=>w.jsx("div",{children:w.jsxs("div",{className:"flex items-start gap-3 p-3",children:[w.jsx("div",{className:"w-4 h-4 rounded-full mt-1 animate-shimmer"}),w.jsxs("div",{className:"flex-1 space-y-2",children:[w.jsx("div",{className:"h-3 rounded w-3/4 animate-shimmer"}),w.jsx("div",{className:"h-2 rounded w-1/2 animate-shimmer"})]})]})},n))})]})}const l6=R.memo(function({agent:n,status:a,className:o=""}){const l=ir(n),u=a==="working";return w.jsx("span",{className:`
27
+ inline-flex items-center
28
+ px-2.5 py-1
29
+ rounded-md
30
+ text-white text-xs font-semibold
31
+ shrink-0
32
+ ${u?"animate-badge-glow":""}
33
+ ${o}
34
+ `,style:{backgroundColor:l,"--badge-color":`${l}60`},children:n})}),u6=["filePath","command","pattern","query","url"],e1=60;function c6(t){for(const n of u6){const a=t[n];if(!(typeof a!="string"||a===""))return a.length>e1?"..."+a.slice(-e1):a}return null}function f6(t){if(!t||t.length===0)return null;const n=t[0],a=n.name.replace("mcp_",""),o=c6(n.input);return{toolName:a,toolArg:o}}const d6=R.memo(function({status:n}){switch(n){case"working":return w.jsx("span",{className:"flex items-center justify-center w-4 h-4 rounded-full animate-badge-glow",style:{"--badge-color":"rgba(88, 166, 255, 0.5)"},role:"img","aria-label":"Working",children:w.jsx(p1,{className:"w-3 h-3 text-accent animate-spin"})});case"idle":return w.jsx("span",{className:"flex items-center justify-center w-4 h-4",role:"img","aria-label":"Idle",children:w.jsx(Wd,{className:"w-3 h-3 text-success animate-pulse"})});case"waiting":return w.jsx("span",{className:"flex items-center justify-center w-4 h-4",role:"img","aria-label":"Waiting",children:w.jsx(m1,{className:"w-3 h-3 text-amber-500"})});default:return w.jsx("span",{className:"flex items-center justify-center w-4 h-4",role:"img","aria-label":"Completed",children:w.jsx(Bh,{className:"w-3 h-3 text-green-500"})})}}),h6=R.memo(function({activityType:n,pendingCount:a,patchCount:o}){if(!n||n==="idle")return null;switch(n){case"reasoning":return w.jsx("span",{className:"flex items-center gap-1 text-purple-400",title:"Reasoning",children:w.jsx(kT,{className:"w-3 h-3"})});case"patch":return w.jsxs("span",{className:"flex items-center gap-1 text-orange-400",title:`Writing ${o} files`,children:[w.jsx(MT,{className:"w-3 h-3"}),o&&o>1&&w.jsx("span",{className:"text-[10px]",children:o})]});case"tool":return w.jsxs("span",{className:"flex items-center gap-1 text-blue-400",title:`Running ${a} tools`,children:[w.jsx($T,{className:"w-3 h-3"}),a&&a>1&&w.jsx("span",{className:"text-[10px]",children:a})]});case"waiting-tools":return w.jsx("span",{className:"flex items-center gap-1 text-amber-400",title:"Waiting for tools",children:w.jsx(m1,{className:"w-3 h-3"})});case"waiting-user":return w.jsx("span",{className:"flex items-center text-warning",title:"Waiting for your input",children:w.jsx(g1,{className:"w-3.5 h-3.5"})});default:return null}}),m6=R.memo(function({data:n,selected:a}){const o=n;if(!o?.id||!o?.agent)return w.jsx("div",{className:"flex items-center justify-center w-[250px] h-[60px] rounded-md border border-error/50 bg-surface text-error text-xs p-2",children:"Invalid node data"});const l=o.status||"completed",u=l==="completed";let c=o.currentAction;o.activityType==="waiting-user"&&(!c||c==="question")?c="Waiting for your response":c||(o.workingChildCount&&o.workingChildCount>0?c=`Waiting on ${o.workingChildCount} agent${o.workingChildCount>1?"s":""}`:u&&o.parentID&&o.title&&(c=o.title));const d=f6(o.toolCalls),p={initial:{opacity:0,scale:.9},animate:{opacity:u?.3:1,scale:1,transition:{duration:.3}},hover:u?{opacity:.8}:{}};return w.jsxs(BC.div,{initial:"initial",animate:"animate",whileHover:"hover",variants:p,className:`
35
+ relative flex flex-col w-[250px] rounded-md border
36
+ bg-surface transition-colors duration-200
37
+ ${a?"border-accent ring-1 ring-accent shadow-[0_0_15px_rgba(88,166,255,0.15)]":"border-border"}
38
+ ${o.activityType==="waiting-user"?"border-l-2 border-l-warning":""}
39
+ ${l==="working"?"animate-node-pulse":""}
40
+ `,children:[w.jsx(Hs,{type:"target",position:pt.Top,className:"!bg-border !w-2 !h-2"}),w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50 bg-black/20",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(l6,{agent:o.agent,status:l}),w.jsx(d6,{status:l})]}),w.jsx(h6,{activityType:o.activityType,pendingCount:o.pendingToolCount,patchCount:o.patchFilesCount})]}),w.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[w.jsx("div",{className:"text-xs text-text-secondary line-clamp-2 min-h-[1.5em]",title:c||"",children:c||w.jsx("span",{className:"italic opacity-50",children:"No activity"})}),d&&!o.activityType?.startsWith("waiting")&&w.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-text-primary font-mono bg-black/30 rounded px-1.5 py-1",children:[w.jsx("span",{className:"text-gray-400 shrink-0",children:d.toolName}),d.toolArg&&w.jsx("span",{className:"text-gray-500 truncate",title:d.toolArg,children:d.toolArg})]})]}),w.jsxs("div",{className:"px-3 py-2 border-t border-border/50 flex items-center justify-between text-[10px] text-text-secondary bg-black/10",children:[w.jsx("div",{className:"flex flex-col truncate max-w-[120px]",children:(o.providerID||o.modelID)&&w.jsxs("span",{className:"truncate",title:`${o.providerID}/${o.modelID}`,children:[o.providerID,"/",o.modelID]})}),w.jsxs("div",{className:"flex flex-col items-end shrink-0",children:[w.jsx("span",{children:qC(o.updatedAt)}),o.tokens!==void 0&&w.jsxs("span",{children:[o.tokens.toLocaleString()," toks"]})]})]}),w.jsx(Hs,{type:"source",position:pt.Bottom,className:"!bg-border !w-2 !h-2"})]})}),p6="#58a6ff",g6="#22c55e",y6="#30363d",n1=2,i1=[0,1,2];function v6({id:t,sourceX:n,sourceY:a,targetX:o,targetY:l,sourcePosition:u,targetPosition:c,style:d={},markerEnd:p,data:h}){const[g]=Cm({sourceX:n,sourceY:a,sourcePosition:u,targetX:o,targetY:l,targetPosition:c}),y=h?.direction??null,v=y!==null,x=y==="up",S=x?g6:p6,T=v?`${S}40`:y6,A={...d,stroke:T,strokeWidth:2,transition:"stroke 0.3s ease, stroke-width 0.3s ease"};return w.jsxs(w.Fragment,{children:[w.jsx(Nr,{path:g,markerEnd:p,style:A}),v&&w.jsxs("g",{children:[w.jsx("path",{id:`edge-path-${t}`,d:g,fill:"none",stroke:"none"}),i1.map(E=>w.jsx("circle",{r:"3",fill:S,className:x?"edge-particle-return":"edge-particle",children:w.jsx("animateMotion",{dur:`${n1}s`,repeatCount:"indefinite",begin:`${E*(n1/i1.length)}s`,...x?{keyPoints:"1;0",keyTimes:"0;1",calcMode:"linear"}:{},children:w.jsx("mpath",{href:`#edge-path-${t}`})})},`${t}-${y}-p${E}`))]})]})}const x6=R.memo(v6);function a1(t,n){var a,o=1;t==null&&(t=0),n==null&&(n=0);function l(){var u,c=a.length,d,p=0,h=0;for(u=0;u<c;++u)d=a[u],p+=d.x,h+=d.y;for(p=(p/c-t)*o,h=(h/c-n)*o,u=0;u<c;++u)d=a[u],d.x-=p,d.y-=h}return l.initialize=function(u){a=u},l.x=function(u){return arguments.length?(t=+u,l):t},l.y=function(u){return arguments.length?(n=+u,l):n},l.strength=function(u){return arguments.length?(o=+u,l):o},l}function b6(t){const n=+this._x.call(null,t),a=+this._y.call(null,t);return Uw(this.cover(n,a),n,a,t)}function Uw(t,n,a,o){if(isNaN(n)||isNaN(a))return t;var l,u=t._root,c={data:o},d=t._x0,p=t._y0,h=t._x1,g=t._y1,y,v,x,S,T,A,E,_;if(!u)return t._root=c,t;for(;u.length;)if((T=n>=(y=(d+h)/2))?d=y:h=y,(A=a>=(v=(p+g)/2))?p=v:g=v,l=u,!(u=u[E=A<<1|T]))return l[E]=c,t;if(x=+t._x.call(null,u.data),S=+t._y.call(null,u.data),n===x&&a===S)return c.next=u,l?l[E]=c:t._root=c,t;do l=l?l[E]=new Array(4):t._root=new Array(4),(T=n>=(y=(d+h)/2))?d=y:h=y,(A=a>=(v=(p+g)/2))?p=v:g=v;while((E=A<<1|T)===(_=(S>=v)<<1|x>=y));return l[_]=u,l[E]=c,t}function S6(t){var n,a,o=t.length,l,u,c=new Array(o),d=new Array(o),p=1/0,h=1/0,g=-1/0,y=-1/0;for(a=0;a<o;++a)isNaN(l=+this._x.call(null,n=t[a]))||isNaN(u=+this._y.call(null,n))||(c[a]=l,d[a]=u,l<p&&(p=l),l>g&&(g=l),u<h&&(h=u),u>y&&(y=u));if(p>g||h>y)return this;for(this.cover(p,h).cover(g,y),a=0;a<o;++a)Uw(this,c[a],d[a],t[a]);return this}function w6(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var a=this._x0,o=this._y0,l=this._x1,u=this._y1;if(isNaN(a))l=(a=Math.floor(t))+1,u=(o=Math.floor(n))+1;else{for(var c=l-a||1,d=this._root,p,h;a>t||t>=l||o>n||n>=u;)switch(h=(n<o)<<1|t<a,p=new Array(4),p[h]=d,d=p,c*=2,h){case 0:l=a+c,u=o+c;break;case 1:a=l-c,u=o+c;break;case 2:l=a+c,o=u-c;break;case 3:a=l-c,o=u-c;break}this._root&&this._root.length&&(this._root=d)}return this._x0=a,this._y0=o,this._x1=l,this._y1=u,this}function E6(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function T6(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ne(t,n,a,o,l){this.node=t,this.x0=n,this.y0=a,this.x1=o,this.y1=l}function A6(t,n,a){var o,l=this._x0,u=this._y0,c,d,p,h,g=this._x1,y=this._y1,v=[],x=this._root,S,T;for(x&&v.push(new Ne(x,l,u,g,y)),a==null?a=1/0:(l=t-a,u=n-a,g=t+a,y=n+a,a*=a);S=v.pop();)if(!(!(x=S.node)||(c=S.x0)>g||(d=S.y0)>y||(p=S.x1)<l||(h=S.y1)<u))if(x.length){var A=(c+p)/2,E=(d+h)/2;v.push(new Ne(x[3],A,E,p,h),new Ne(x[2],c,E,A,h),new Ne(x[1],A,d,p,E),new Ne(x[0],c,d,A,E)),(T=(n>=E)<<1|t>=A)&&(S=v[v.length-1],v[v.length-1]=v[v.length-1-T],v[v.length-1-T]=S)}else{var _=t-+this._x.call(null,x.data),N=n-+this._y.call(null,x.data),M=_*_+N*N;if(M<a){var z=Math.sqrt(a=M);l=t-z,u=n-z,g=t+z,y=n+z,o=x.data}}return o}function N6(t){if(isNaN(g=+this._x.call(null,t))||isNaN(y=+this._y.call(null,t)))return this;var n,a=this._root,o,l,u,c=this._x0,d=this._y0,p=this._x1,h=this._y1,g,y,v,x,S,T,A,E;if(!a)return this;if(a.length)for(;;){if((S=g>=(v=(c+p)/2))?c=v:p=v,(T=y>=(x=(d+h)/2))?d=x:h=x,n=a,!(a=a[A=T<<1|S]))return this;if(!a.length)break;(n[A+1&3]||n[A+2&3]||n[A+3&3])&&(o=n,E=A)}for(;a.data!==t;)if(l=a,!(a=a.next))return this;return(u=a.next)&&delete a.next,l?(u?l.next=u:delete l.next,this):n?(u?n[A]=u:delete n[A],(a=n[0]||n[1]||n[2]||n[3])&&a===(n[3]||n[2]||n[1]||n[0])&&!a.length&&(o?o[E]=a:this._root=a),this):(this._root=u,this)}function M6(t){for(var n=0,a=t.length;n<a;++n)this.remove(t[n]);return this}function _6(){return this._root}function C6(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function D6(t){var n=[],a,o=this._root,l,u,c,d,p;for(o&&n.push(new Ne(o,this._x0,this._y0,this._x1,this._y1));a=n.pop();)if(!t(o=a.node,u=a.x0,c=a.y0,d=a.x1,p=a.y1)&&o.length){var h=(u+d)/2,g=(c+p)/2;(l=o[3])&&n.push(new Ne(l,h,g,d,p)),(l=o[2])&&n.push(new Ne(l,u,g,h,p)),(l=o[1])&&n.push(new Ne(l,h,c,d,g)),(l=o[0])&&n.push(new Ne(l,u,c,h,g))}return this}function R6(t){var n=[],a=[],o;for(this._root&&n.push(new Ne(this._root,this._x0,this._y0,this._x1,this._y1));o=n.pop();){var l=o.node;if(l.length){var u,c=o.x0,d=o.y0,p=o.x1,h=o.y1,g=(c+p)/2,y=(d+h)/2;(u=l[0])&&n.push(new Ne(u,c,d,g,y)),(u=l[1])&&n.push(new Ne(u,g,d,p,y)),(u=l[2])&&n.push(new Ne(u,c,y,g,h)),(u=l[3])&&n.push(new Ne(u,g,y,p,h))}a.push(o)}for(;o=a.pop();)t(o.node,o.x0,o.y0,o.x1,o.y1);return this}function j6(t){return t[0]}function z6(t){return arguments.length?(this._x=t,this):this._x}function O6(t){return t[1]}function V6(t){return arguments.length?(this._y=t,this):this._y}function Yw(t,n,a){var o=new Hm(n??j6,a??O6,NaN,NaN,NaN,NaN);return t==null?o:o.addAll(t)}function Hm(t,n,a,o,l,u){this._x=t,this._y=n,this._x0=a,this._y0=o,this._x1=l,this._y1=u,this._root=void 0}function s1(t){for(var n={data:t.data},a=n;t=t.next;)a=a.next={data:t.data};return n}var Ce=Yw.prototype=Hm.prototype;Ce.copy=function(){var t=new Hm(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,a,o;if(!n)return t;if(!n.length)return t._root=s1(n),t;for(a=[{source:n,target:t._root=new Array(4)}];n=a.pop();)for(var l=0;l<4;++l)(o=n.source[l])&&(o.length?a.push({source:o,target:n.target[l]=new Array(4)}):n.target[l]=s1(o));return t};Ce.add=b6;Ce.addAll=S6;Ce.cover=w6;Ce.data=E6;Ce.extent=T6;Ce.find=A6;Ce.remove=N6;Ce.removeAll=M6;Ce.root=_6;Ce.size=C6;Ce.visit=D6;Ce.visitAfter=R6;Ce.x=z6;Ce.y=V6;function Qo(t){return function(){return t}}function Ts(t){return(t()-.5)*1e-6}function L6(t){return t.index}function o1(t,n){var a=t.get(n);if(!a)throw new Error("node not found: "+n);return a}function H6(t){var n=L6,a=y,o,l=Qo(30),u,c,d,p,h,g=1;t==null&&(t=[]);function y(A){return 1/Math.min(d[A.source.index],d[A.target.index])}function v(A){for(var E=0,_=t.length;E<g;++E)for(var N=0,M,z,V,O,k,X,st;N<_;++N)M=t[N],z=M.source,V=M.target,O=V.x+V.vx-z.x-z.vx||Ts(h),k=V.y+V.vy-z.y-z.vy||Ts(h),X=Math.sqrt(O*O+k*k),X=(X-u[N])/X*A*o[N],O*=X,k*=X,V.vx-=O*(st=p[N]),V.vy-=k*st,z.vx+=O*(st=1-st),z.vy+=k*st}function x(){if(c){var A,E=c.length,_=t.length,N=new Map(c.map((z,V)=>[n(z,V,c),z])),M;for(A=0,d=new Array(E);A<_;++A)M=t[A],M.index=A,typeof M.source!="object"&&(M.source=o1(N,M.source)),typeof M.target!="object"&&(M.target=o1(N,M.target)),d[M.source.index]=(d[M.source.index]||0)+1,d[M.target.index]=(d[M.target.index]||0)+1;for(A=0,p=new Array(_);A<_;++A)M=t[A],p[A]=d[M.source.index]/(d[M.source.index]+d[M.target.index]);o=new Array(_),S(),u=new Array(_),T()}}function S(){if(c)for(var A=0,E=t.length;A<E;++A)o[A]=+a(t[A],A,t)}function T(){if(c)for(var A=0,E=t.length;A<E;++A)u[A]=+l(t[A],A,t)}return v.initialize=function(A,E){c=A,h=E,x()},v.links=function(A){return arguments.length?(t=A,x(),v):t},v.id=function(A){return arguments.length?(n=A,v):n},v.iterations=function(A){return arguments.length?(g=+A,v):g},v.strength=function(A){return arguments.length?(a=typeof A=="function"?A:Qo(+A),S(),v):a},v.distance=function(A){return arguments.length?(l=typeof A=="function"?A:Qo(+A),T(),v):l},v}const B6=1664525,k6=1013904223,r1=4294967296;function U6(){let t=1;return()=>(t=(B6*t+k6)%r1)/r1}function Y6(t){return t.x}function q6(t){return t.y}var X6=10,G6=Math.PI*(3-Math.sqrt(5));function $6(t){var n,a=1,o=.001,l=1-Math.pow(o,1/300),u=0,c=.6,d=new Map,p=wm(y),h=xr("tick","end"),g=U6();t==null&&(t=[]);function y(){v(),h.call("tick",n),a<o&&(p.stop(),h.call("end",n))}function v(T){var A,E=t.length,_;T===void 0&&(T=1);for(var N=0;N<T;++N)for(a+=(u-a)*l,d.forEach(function(M){M(a)}),A=0;A<E;++A)_=t[A],_.fx==null?_.x+=_.vx*=c:(_.x=_.fx,_.vx=0),_.fy==null?_.y+=_.vy*=c:(_.y=_.fy,_.vy=0);return n}function x(){for(var T=0,A=t.length,E;T<A;++T){if(E=t[T],E.index=T,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var _=X6*Math.sqrt(.5+T),N=T*G6;E.x=_*Math.cos(N),E.y=_*Math.sin(N)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function S(T){return T.initialize&&T.initialize(t,g),T}return x(),n={tick:v,restart:function(){return p.restart(y),n},stop:function(){return p.stop(),n},nodes:function(T){return arguments.length?(t=T,x(),d.forEach(S),n):t},alpha:function(T){return arguments.length?(a=+T,n):a},alphaMin:function(T){return arguments.length?(o=+T,n):o},alphaDecay:function(T){return arguments.length?(l=+T,n):+l},alphaTarget:function(T){return arguments.length?(u=+T,n):u},velocityDecay:function(T){return arguments.length?(c=1-T,n):1-c},randomSource:function(T){return arguments.length?(g=T,d.forEach(S),n):g},force:function(T,A){return arguments.length>1?(A==null?d.delete(T):d.set(T,S(A)),n):d.get(T)},find:function(T,A,E){var _=0,N=t.length,M,z,V,O,k;for(E==null?E=1/0:E*=E,_=0;_<N;++_)O=t[_],M=T-O.x,z=A-O.y,V=M*M+z*z,V<E&&(k=O,E=V);return k},on:function(T,A){return arguments.length>1?(h.on(T,A),n):h.on(T)}}}function Z6(){var t,n,a,o,l=Qo(-30),u,c=1,d=1/0,p=.81;function h(x){var S,T=t.length,A=Yw(t,Y6,q6).visitAfter(y);for(o=x,S=0;S<T;++S)n=t[S],A.visit(v)}function g(){if(t){var x,S=t.length,T;for(u=new Array(S),x=0;x<S;++x)T=t[x],u[T.index]=+l(T,x,t)}}function y(x){var S=0,T,A,E=0,_,N,M;if(x.length){for(_=N=M=0;M<4;++M)(T=x[M])&&(A=Math.abs(T.value))&&(S+=T.value,E+=A,_+=A*T.x,N+=A*T.y);x.x=_/E,x.y=N/E}else{T=x,T.x=T.data.x,T.y=T.data.y;do S+=u[T.data.index];while(T=T.next)}x.value=S}function v(x,S,T,A){if(!x.value)return!0;var E=x.x-n.x,_=x.y-n.y,N=A-S,M=E*E+_*_;if(N*N/p<M)return M<d&&(E===0&&(E=Ts(a),M+=E*E),_===0&&(_=Ts(a),M+=_*_),M<c&&(M=Math.sqrt(c*M)),n.vx+=E*x.value*o/M,n.vy+=_*x.value*o/M),!0;if(x.length||M>=d)return;(x.data!==n||x.next)&&(E===0&&(E=Ts(a),M+=E*E),_===0&&(_=Ts(a),M+=_*_),M<c&&(M=Math.sqrt(c*M)));do x.data!==n&&(N=u[x.data.index]*o/M,n.vx+=E*N,n.vy+=_*N);while(x=x.next)}return h.initialize=function(x,S){t=x,a=S,g()},h.strength=function(x){return arguments.length?(l=typeof x=="function"?x:Qo(+x),g(),h):l},h.distanceMin=function(x){return arguments.length?(c=x*x,h):Math.sqrt(c)},h.distanceMax=function(x){return arguments.length?(d=x*x,h):Math.sqrt(d)},h.theta=function(x){return arguments.length?(p=x*x,h):Math.sqrt(p)},h}const P6=250,I6=140,K6=24,Q6=.9,F6=2;function J6(t={}){const{width:n=P6,height:a=I6,padding:o=K6,strength:l=Q6,iterations:u=F6}=t;let c=[];const d=n+o,p=a+o,h=()=>{for(let g=0;g<u;g+=1)for(let y=0;y<c.length;y+=1){const v=c[y];if(!(v.x==null||v.y==null))for(let x=y+1;x<c.length;x+=1){const S=c[x];if(S.x==null||S.y==null)continue;const T=S.x-v.x,A=S.y-v.y,E=d-Math.abs(T),_=p-Math.abs(A);if(!(E<=0||_<=0))if(E<_){const N=T===0?1:Math.sign(T),M=E*.5*l*N;v.fx==null&&(v.vx=(v.vx??0)-M),S.fx==null&&(S.vx=(S.vx??0)+M)}else{const N=A===0?1:Math.sign(A),M=_*.5*l*N;v.fy==null&&(v.vy=(v.vy??0)-M),S.fy==null&&(S.vy=(S.vy??0)+M)}}}};return h.initialize=(g,y)=>{c=g},h}const qw=250,Xw=140,Gw=qw/2,$w=Xw/2,W6=.45,tO=.001,eO=.04,nO=.1,iO=260,aO=.12,sO=-1200;function vu(t){return{x:t.position.x+Gw,y:t.position.y+$w}}function l1(t,n,a){const o=t.get(n.id);if(!o)return;const l=vu(n);return o.x=l.x,o.y=l.y,o.fx=a?l.x:null,o.fy=a?l.y:null,o}function oO({nodes:t,edges:n,setNodes:a}){const o=R.useRef(null),l=R.useRef(null),u=R.useRef(new Map),c=R.useRef(null),d=R.useRef(!1),p=R.useRef({nodeIdsKey:"",edgeLinksKey:""});R.useEffect(()=>{if(o.current!=null&&l.current!=null)return;const T=H6([]).id(E=>E.id).distance(iO).strength(aO),A=$6([]).alphaMin(tO).alphaDecay(eO).force("link",T).force("charge",Z6().strength(sO)).force("collide",J6({width:qw,height:Xw})).force("center",a1(0,0)).stop();o.current=A,l.current=T},[]);const h=R.useMemo(()=>t.map(T=>T.id).sort((T,A)=>T.localeCompare(A)).join("|"),[t]),g=R.useMemo(()=>n.map(T=>`${T.id}:${T.source}:${T.target}`).sort((T,A)=>T.localeCompare(A)).join("|"),[n]),y=R.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),d.current=!1},[]),v=R.useCallback(()=>{if(d.current||!o.current)return;d.current=!0;const A=()=>{const E=o.current;if(!E){y();return}if(E.tick(),a(_=>{let N=!1;const M=_.map(z=>{const V=u.current.get(z.id);if(!V)return z;if(z.dragging){const X=vu(z);return V.x=X.x,V.y=X.y,V.fx=X.x,V.fy=X.y,z}if(V.x==null||V.y==null)return z;const O=V.x-Gw,k=V.y-$w;return Number.isNaN(O)||Number.isNaN(k)||Math.abs(z.position.x-O)<.1&&Math.abs(z.position.y-k)<.1?z:(N=!0,{...z,position:{x:O,y:k}})});return N?M:_}),E.alpha()<=E.alphaMin()){E.stop(),y();return}c.current=requestAnimationFrame(A)};c.current=requestAnimationFrame(A)},[a,y]);R.useEffect(()=>{const T=o.current,A=l.current;if(!T||!A)return;const E=p.current,_=E.nodeIdsKey!==h,N=E.edgeLinksKey!==g;if(!_&&!N)return;p.current={nodeIdsKey:h,edgeLinksKey:g};const M=new Set(t.map(O=>O.id));for(const O of u.current.keys())M.has(O)||u.current.delete(O);const z=[];for(const O of t){const k=u.current.get(O.id);if(k){if(k.x==null||k.y==null){const P=vu(O);k.x=P.x,k.y=P.y}z.push(k);continue}const X=vu(O),st={id:O.id,x:X.x,y:X.y};u.current.set(O.id,st),z.push(st)}T.nodes(z);const V=n.filter(O=>M.has(O.source)&&M.has(O.target)).map(O=>({source:O.source,target:O.target}));if(A.links(V),z.length>0){let O=0,k=0;for(const X of z)O+=X.x??0,k+=X.y??0;T.force("center",a1(O/z.length,k/z.length))}if(z.length===0){T.stop(),y();return}(_||N)&&(T.alpha(W6),T.alphaTarget(0),v())},[t,n,h,g,v,y]);const x=R.useCallback((T,A)=>l1(u.current,A,!0),[]),S=R.useCallback((T,A)=>{l1(u.current,A,!1);const E=o.current;E&&(E.alpha(nO),v())},[v]);return R.useEffect(()=>()=>{y(),o.current?.stop()},[y]),{onNodeDragStart:x,onNodeDragStop:S}}const rO={agentNode:m6},lO={animatedEdge:x6};function Fd({children:t,testId:n,headerRight:a}){return w.jsxs("div",{className:"h-full w-full bg-surface overflow-hidden flex flex-col","data-testid":n,children:[w.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between bg-surface z-10",children:[w.jsx("h3",{className:"font-semibold text-sm",children:"Live Activity"}),a]}),t]})}const uO=3e3,cO=({sessions:t,loading:n})=>{const[a,o,l]=Rz([]),[u,c,d]=jz([]),p=R.useRef(new Map),h=R.useRef(new Set),g=R.useRef(new Map),y=R.useCallback(()=>{c(T=>[...T])},[c]);R.useEffect(()=>{const T=g.current;return()=>{for(const A of T.values())clearTimeout(A)}},[]),R.useEffect(()=>{o(T=>{const A=new Map(T.map(_=>[_.id,_.position]));return t.map((_,N)=>{const M=A.get(_.id),z={x:N%3*300,y:Math.floor(N/3)*200};return{id:_.id,type:"agentNode",data:_,position:M||z}})}),c(()=>{const T=new Map(t.map(E=>[E.id,E]));for(const E of t){if(!E.parentID)continue;const _=p.current.get(E.id),N=E.status,M=T.get(E.parentID);if(_==="working"&&N==="completed"&&M?.status==="working"){h.current.add(E.id);const z=g.current.get(E.id);z&&clearTimeout(z),g.current.set(E.id,setTimeout(()=>{h.current.delete(E.id),g.current.delete(E.id),y()},uO))}}p.current=new Map(t.map(E=>[E.id,E.status??"idle"]));const A=[];for(const E of t){if(!E.parentID||!T.has(E.parentID))continue;let _=null;E.status==="working"?_="down":h.current.has(E.id)&&(_="up"),A.push({id:`${E.parentID}-${E.id}`,source:E.parentID,target:E.id,type:"animatedEdge",data:{direction:_}})}return A})},[t,o,c,y]);const{onNodeDragStart:v,onNodeDragStop:x}=oO({nodes:a,edges:u,setNodes:o}),S=R.useMemo(()=>t.some(T=>T.status==="working"),[t]);return n&&t.length===0?w.jsx(Fd,{testId:"graph-view-loading",children:w.jsx(o6,{})}):t.length===0?w.jsx(Fd,{testId:"graph-view-empty",children:w.jsx(Wb,{icon:Jd,title:"No Activity",description:"Select a session to view live activity"})}):w.jsx(Fd,{testId:"graph-view",headerRight:S?w.jsxs("span",{className:"relative flex h-2 w-2",title:"Activity in progress",children:[w.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent opacity-75"}),w.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-accent"})]}):void 0,children:w.jsx("div",{className:"flex-1 w-full h-full relative",children:w.jsxs(Dz,{nodes:a,edges:u,onNodesChange:l,onEdgesChange:d,nodeTypes:rO,edgeTypes:lO,onNodeDragStart:v,onNodeDragStop:x,fitView:!0,nodesDraggable:!0,nodesConnectable:!1,minZoom:.1,maxZoom:2,children:[w.jsx(Hz,{color:"#374151",gap:16}),w.jsx(Gz,{showInteractive:!1})]})})})};function fO({stats:t}){const[n,a]=R.useState(!1),[o,l]=R.useState(!1),u=R.useRef(null),c=R.useRef(null);if(R.useEffect(()=>{const g=y=>{u.current&&!u.current.contains(y.target)&&a(!1)};return n&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[n]),R.useEffect(()=>{const g=t?.totalTokens,y=c.current;if(g!==void 0&&y!==null&&g!==y){const v=setTimeout(()=>l(!0),0),x=setTimeout(()=>l(!1),600);return c.current=g,()=>{clearTimeout(v),clearTimeout(x)}}g!==void 0&&(c.current=g)},[t?.totalTokens]),!t)return w.jsxs("div",{className:"inline-flex items-center h-8 px-3 gap-2 bg-surface/50 border border-border/50 rounded-full text-text-secondary text-xs font-medium select-none","data-testid":"session-stats-empty",children:[w.jsx(jy,{className:"w-3.5 h-3.5 opacity-50"}),w.jsx("span",{children:"No stats"})]});const d=t.totalCost!==void 0?`$${t.totalCost.toFixed(2)}`:"—",p=Eh(t.totalTokens),h=t.modelBreakdown.length;return w.jsxs("div",{className:"relative inline-flex items-center h-8 bg-surface border border-border rounded-full shadow-sm select-none","data-testid":"session-stats",ref:u,children:[w.jsxs("div",{className:"flex items-center gap-1.5 pl-3 pr-3",children:[w.jsx(FT,{className:`w-4 h-4 transition-all duration-300 ${o?"text-white scale-110 drop-shadow-[0_0_6px_#58a6ff]":"text-[#58a6ff] scale-100"}`,strokeWidth:2.5}),w.jsx("span",{className:`font-mono text-sm font-semibold tabular-nums transition-colors duration-300 ${o?"text-white":"text-text-primary"}`,children:p})]}),w.jsx("div",{className:"w-px h-3.5 bg-border"}),w.jsxs("div",{className:"flex items-center gap-2 px-3",children:[w.jsx(jy,{className:"w-3.5 h-3.5 text-emerald-400",strokeWidth:2.5}),w.jsx("span",{className:"font-mono text-xs text-text-primary font-medium tracking-tight",children:d})]}),w.jsx("div",{className:"w-px h-3.5 bg-border"}),w.jsxs("button",{type:"button",onClick:()=>a(!n),className:`
41
+ group flex items-center gap-2 px-3 pr-4 h-full
42
+ hover:bg-white/5 transition-all duration-200
43
+ rounded-r-full outline-none focus:bg-white/5
44
+ ${n?"bg-white/5":""}
45
+ `,children:[w.jsx(vT,{className:`w-3.5 h-3.5 ${n?"text-purple-400":"text-text-secondary group-hover:text-purple-400"} transition-colors duration-200`,strokeWidth:2.5}),w.jsx("span",{className:`text-xs font-medium ${n?"text-text-primary":"text-text-secondary group-hover:text-text-primary"} transition-colors duration-200`,children:h}),w.jsx(Fo,{className:`w-3 h-3 text-text-secondary transition-transform duration-200 ${n?"rotate-180":""}`,strokeWidth:2.5})]}),w.jsxs("div",{className:`
46
+ absolute top-full right-0 mt-2 w-64
47
+ bg-surface border border-border rounded-xl shadow-2xl
48
+ origin-top-right transition-all duration-200 z-50 overflow-hidden
49
+ ${n?"opacity-100 scale-100 translate-y-0 pointer-events-auto":"opacity-0 scale-95 -translate-y-1 pointer-events-none"}
50
+ `,children:[w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-[#0d1117]/30 border-b border-border",children:[w.jsx("span",{className:"text-[10px] font-bold text-text-secondary uppercase tracking-wider",children:"Model Breakdown"}),w.jsxs("span",{className:"text-[10px] font-mono text-text-secondary opacity-70",children:[h," active"]})]}),w.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:t.modelBreakdown.map(g=>w.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-xs group hover:bg-white/5 transition-colors",children:[w.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[w.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-purple-400/50 group-hover:bg-purple-400 transition-colors shrink-0"}),w.jsx("span",{className:"text-text-secondary group-hover:text-text-primary transition-colors truncate",title:g.modelID,children:g.modelID})]}),w.jsx("span",{className:"text-text-primary font-mono ml-3 bg-white/5 px-1.5 py-0.5 rounded text-[10px]",children:Eh(g.tokens)})]},g.modelID))})]})]})}function dO(t){const n=[],a=new Map,o=new Set;return t.forEach(l=>{a.set(l.id,l)}),t.forEach(l=>{if(l.parentID&&a.has(l.parentID)){const u=a.get(l.parentID);n.push({id:`spawn-${l.id}`,type:"agent-spawn",timestamp:l.createdAt,agentName:u.agent,spawnedAgentName:l.agent})}if(l.toolCalls&&l.toolCalls.length>0&&l.toolCalls.forEach(u=>{o.has(u.id)||(o.add(u.id),n.push({id:u.id,type:"tool-call",timestamp:new Date(u.timestamp),agentName:u.agentName,toolName:u.name,state:u.state,summary:u.summary,input:u.input,error:u.error}))}),l.status==="completed"){const u=l.updatedAt?new Date(l.updatedAt).getTime()-new Date(l.createdAt).getTime():void 0;n.push({id:`complete-${l.id}`,type:"agent-complete",timestamp:l.updatedAt,agentName:l.agent,status:l.status,durationMs:u})}}),n.sort((l,u)=>new Date(l.timestamp).getTime()-new Date(u.timestamp).getTime()),n}function hO(t){const{sessions:n,selectedId:a,onSelect:o}=t,l=R.useCallback(u=>{if(!(document.activeElement?.tagName==="INPUT"||document.activeElement?.tagName==="TEXTAREA")){if(u.key==="Escape"){o(null);return}if(u.key==="j"||u.key==="ArrowDown"||u.key==="k"||u.key==="ArrowUp"){const c=[...n].sort((p,h)=>{const g=new Date(h.updatedAt).getTime()-new Date(p.updatedAt).getTime();return g!==0?g:p.id.localeCompare(h.id)}),d=c.findIndex(p=>p.id===a);u.key==="j"||u.key==="ArrowDown"?d===-1?c.length>0&&o(c[0].id):d<c.length-1&&o(c[d+1].id):(u.key==="k"||u.key==="ArrowUp")&&d>0&&o(c[d-1].id)}}},[n,a,o]);R.useEffect(()=>(document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}),[l])}function mO(){const{sessions:t,sessionStats:n,activitySessions:a,selectedSessionId:o,setSelectedSessionId:l,projects:u,selectedProjectId:c,setSelectedProjectId:d,loading:p,error:h,isReconnecting:g,notificationPermission:y,requestNotificationPermission:v}=vr();hO({sessions:t,selectedId:o,onSelect:l});const x=R.useMemo(()=>dO(a).filter(S=>S.type!=="tool-call"),[a]);return h&&!g?w.jsx("div",{className:"flex h-screen bg-background text-text-primary items-center justify-center",children:w.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[w.jsx(h1,{className:"w-12 h-12 text-error"}),w.jsx("h2",{className:"text-xl font-semibold",children:"Connection Lost"}),w.jsxs("p",{className:"text-text-secondary",children:["Failed to connect to OCWatch backend. Make sure the server is running on port ",JT,"."]}),w.jsx("p",{className:"text-sm text-text-secondary font-mono bg-surface px-3 py-2 rounded border border-border",children:h.message}),w.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"px-4 py-2 bg-accent text-white rounded-lg hover:bg-accent/90 transition-colors",children:"Retry Connection"})]})}):w.jsxs("div",{className:"flex h-screen bg-background text-text-primary overflow-hidden",children:[p&&t.length===0?w.jsx(r6,{}):w.jsx(WC,{sessions:t,selectedId:o,onSelect:l,projects:u,selectedProjectId:c,onProjectSelect:d}),w.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative h-full",children:[w.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[w.jsxs("header",{className:"flex items-center justify-between gap-4 border-b border-border p-4 flex-shrink-0",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("div",{className:"p-1.5 bg-surface rounded-lg border border-border",children:w.jsx(zT,{className:"w-5 h-5 text-accent"})}),w.jsxs("div",{className:"flex items-baseline gap-2",children:[w.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"OCWatch"}),w.jsx("span",{className:"text-text-secondary text-xs hidden sm:inline-block",children:"Activity Monitor"})]}),g&&w.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 bg-warning/10 border border-warning/20 rounded-lg",children:[w.jsx(PT,{className:"w-3 h-3 text-warning animate-pulse"}),w.jsx("span",{className:"text-xs text-warning",children:"Reconnecting..."})]})]}),w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx(fO,{stats:n}),y==="default"?w.jsx("button",{type:"button",onClick:()=>v(),className:"p-1.5 rounded-lg border border-border hover:bg-surface transition-colors",title:"Enable notifications",children:w.jsx(Ry,{className:"w-4 h-4 text-text-secondary"})}):y==="granted"?w.jsx("span",{className:"p-1.5 rounded-lg border border-border bg-surface",title:"Notifications enabled",children:w.jsx(Ry,{className:"w-4 h-4 text-accent"})}):w.jsx("span",{className:"p-1.5 rounded-lg border border-border opacity-50",title:"Notifications blocked — enable in browser settings",children:w.jsx(pT,{className:"w-4 h-4 text-text-secondary"})})]})]}),w.jsx("main",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:w.jsx(cO,{sessions:a,loading:p})})]}),w.jsx(YC,{entries:x})]})]})}function pO(){return w.jsx(ZC,{children:w.jsx(mO,{})})}class gO extends R.Component{constructor(n){super(n),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,a){console.error("ErrorBoundary caught an error:",n),console.error("Component stack:",a.componentStack),this.setState({errorInfo:a})}handleReload=()=>{window.location.reload()};render(){return this.state.hasError?w.jsx("div",{className:"flex h-screen bg-background text-text-primary items-center justify-center p-6",children:w.jsxs("div",{className:"flex flex-col items-center gap-6 max-w-2xl text-center",children:[w.jsx("div",{className:"p-4 bg-error/10 rounded-full border border-error/20",children:w.jsx(h1,{className:"w-16 h-16 text-error"})}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("h1",{className:"text-3xl font-semibold",children:"Something went wrong"}),w.jsx("p",{className:"text-text-secondary text-lg",children:"OCWatch encountered an unexpected error and needs to reload."})]}),this.state.error&&w.jsxs("div",{className:"w-full bg-surface border border-border rounded-lg p-4 text-left",children:[w.jsx("p",{className:"text-sm font-mono text-error mb-2",children:this.state.error.toString()}),this.state.errorInfo&&w.jsxs("details",{className:"text-xs font-mono text-text-secondary",children:[w.jsx("summary",{className:"cursor-pointer hover:text-text-primary",children:"Show stack trace"}),w.jsx("pre",{className:"mt-2 overflow-auto max-h-64 whitespace-pre-wrap",children:this.state.errorInfo.componentStack})]})]}),w.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-6 py-3 bg-accent text-white rounded-lg hover:bg-accent/90 transition-colors font-medium",children:[w.jsx(HT,{className:"w-5 h-5"}),"Reload Application"]}),w.jsx("p",{className:"text-sm text-text-secondary",children:"If this problem persists, check the browser console for more details."})]})}):this.props.children}}sT.createRoot(document.getElementById("root")).render(w.jsx(R.StrictMode,{children:w.jsx(gO,{children:w.jsx(pO,{})})}));