@exaudeus/workrail 3.19.1 → 3.20.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.
- package/dist/console/assets/index-B8NW82uK.css +1 -0
- package/dist/console/assets/index-De5T1Dpm.js +28 -0
- package/dist/console/index.html +2 -2
- package/dist/manifest.json +17 -17
- package/dist/mcp/transports/shutdown-hooks.d.ts +4 -0
- package/dist/mcp/transports/shutdown-hooks.js +15 -0
- package/dist/mcp/transports/stdio-entry.js +8 -0
- package/dist/v2/infra/local/session-lock/index.d.ts +1 -0
- package/dist/v2/infra/local/session-lock/index.js +31 -0
- package/package.json +8 -3
- package/dist/console/assets/index-QhCFuxQV.js +0 -28
- package/dist/console/assets/index-ibLhWBmX.css +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(s){if(s.ep)return;s.ep=!0;const l=r(s);fetch(s.href,l)}})();function Fc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ch={exports:{}},So={};var Yx;function w_(){if(Yx)return So;Yx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,s,l){var u=null;if(l!==void 0&&(u=""+l),s.key!==void 0&&(u=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:e,type:a,key:u,ref:s!==void 0?s:null,props:l}}return So.Fragment=t,So.jsx=r,So.jsxs=r,So}var $x;function S_(){return $x||($x=1,Ch.exports=w_()),Ch.exports}var b=S_(),_h={exports:{}},Ae={};var Gx;function E_(){if(Gx)return Ae;Gx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function S(z,$,R){this.props=z,this.context=$,this.refs=N,this.updater=R||w}S.prototype.isReactComponent={},S.prototype.setState=function(z,$){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,$,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function A(){}A.prototype=S.prototype;function _(z,$,R){this.props=z,this.context=$,this.refs=N,this.updater=R||w}var k=_.prototype=new A;k.constructor=_,C(k,S.prototype),k.isPureReactComponent=!0;var H=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function U(z,$,R){var te=R.ref;return{$$typeof:e,type:z,key:$,ref:te!==void 0?te:null,props:R}}function q(z,$){return U(z.type,$,z.props)}function I(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function Y(z){var $={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(R){return $[R]})}var Q=/\/+/g;function L(z,$){return typeof z=="object"&&z!==null&&z.key!=null?Y(""+z.key):$.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(M,M):(z.status="pending",z.then(function($){z.status==="pending"&&(z.status="fulfilled",z.value=$)},function($){z.status==="pending"&&(z.status="rejected",z.reason=$)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function T(z,$,R,te,ue){var fe=typeof z;(fe==="undefined"||fe==="boolean")&&(z=null);var de=!1;if(z===null)de=!0;else switch(fe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(z.$$typeof){case e:case t:de=!0;break;case p:return de=z._init,T(de(z._payload),$,R,te,ue)}}if(de)return ue=ue(z),de=te===""?"."+L(z,0):te,H(ue)?(R="",de!=null&&(R=de.replace(Q,"$&/")+"/"),T(ue,$,R,"",function(we){return we})):ue!=null&&(I(ue)&&(ue=q(ue,R+(ue.key==null||z&&z.key===ue.key?"":(""+ue.key).replace(Q,"$&/")+"/")+de)),$.push(ue)),1;de=0;var le=te===""?".":te+":";if(H(z))for(var pe=0;pe<z.length;pe++)te=z[pe],fe=le+L(te,pe),de+=T(te,$,R,fe,ue);else if(pe=v(z),typeof pe=="function")for(z=pe.call(z),pe=0;!(te=z.next()).done;)te=te.value,fe=le+L(te,pe++),de+=T(te,$,R,fe,ue);else if(fe==="object"){if(typeof z.then=="function")return T(V(z),$,R,te,ue);throw $=String(z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return de}function F(z,$,R){if(z==null)return z;var te=[],ue=0;return T(z,te,"","",function(fe){return $.call(R,fe,ue++)}),te}function X(z){if(z._status===-1){var $=z._result;$=$(),$.then(function(R){(z._status===0||z._status===-1)&&(z._status=1,z._result=R)},function(R){(z._status===0||z._status===-1)&&(z._status=2,z._result=R)}),z._status===-1&&(z._status=0,z._result=$)}if(z._status===1)return z._result.default;throw z._result}var Z=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},j={map:F,forEach:function(z,$,R){F(z,function(){$.apply(this,arguments)},R)},count:function(z){var $=0;return F(z,function(){$++}),$},toArray:function(z){return F(z,function($){return $})||[]},only:function(z){if(!I(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ae.Activity=g,Ae.Children=j,Ae.Component=S,Ae.Fragment=r,Ae.Profiler=s,Ae.PureComponent=_,Ae.StrictMode=a,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(z){return D.H.useMemoCache(z)}},Ae.cache=function(z){return function(){return z.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(z,$,R){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var te=C({},z.props),ue=z.key;if($!=null)for(fe in $.key!==void 0&&(ue=""+$.key),$)!P.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(te[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)te.children=R;else if(1<fe){for(var de=Array(fe),le=0;le<fe;le++)de[le]=arguments[le+2];te.children=de}return U(z.type,ue,te)},Ae.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Ae.createElement=function(z,$,R){var te,ue={},fe=null;if($!=null)for(te in $.key!==void 0&&(fe=""+$.key),$)P.call($,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=$[te]);var de=arguments.length-2;if(de===1)ue.children=R;else if(1<de){for(var le=Array(de),pe=0;pe<de;pe++)le[pe]=arguments[pe+2];ue.children=le}if(z&&z.defaultProps)for(te in de=z.defaultProps,de)ue[te]===void 0&&(ue[te]=de[te]);return U(z,fe,ue)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(z){return{$$typeof:f,render:z}},Ae.isValidElement=I,Ae.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:X}},Ae.memo=function(z,$){return{$$typeof:d,type:z,compare:$===void 0?null:$}},Ae.startTransition=function(z){var $=D.T,R={};D.T=R;try{var te=z(),ue=D.S;ue!==null&&ue(R,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(M,Z)}catch(fe){Z(fe)}finally{$!==null&&R.types!==null&&($.types=R.types),D.T=$}},Ae.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ae.use=function(z){return D.H.use(z)},Ae.useActionState=function(z,$,R){return D.H.useActionState(z,$,R)},Ae.useCallback=function(z,$){return D.H.useCallback(z,$)},Ae.useContext=function(z){return D.H.useContext(z)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(z,$){return D.H.useDeferredValue(z,$)},Ae.useEffect=function(z,$){return D.H.useEffect(z,$)},Ae.useEffectEvent=function(z){return D.H.useEffectEvent(z)},Ae.useId=function(){return D.H.useId()},Ae.useImperativeHandle=function(z,$,R){return D.H.useImperativeHandle(z,$,R)},Ae.useInsertionEffect=function(z,$){return D.H.useInsertionEffect(z,$)},Ae.useLayoutEffect=function(z,$){return D.H.useLayoutEffect(z,$)},Ae.useMemo=function(z,$){return D.H.useMemo(z,$)},Ae.useOptimistic=function(z,$){return D.H.useOptimistic(z,$)},Ae.useReducer=function(z,$,R){return D.H.useReducer(z,$,R)},Ae.useRef=function(z){return D.H.useRef(z)},Ae.useState=function(z){return D.H.useState(z)},Ae.useSyncExternalStore=function(z,$,R){return D.H.useSyncExternalStore(z,$,R)},Ae.useTransition=function(){return D.H.useTransition()},Ae.version="19.2.4",Ae}var Xx;function hl(){return Xx||(Xx=1,_h.exports=E_()),_h.exports}var B=hl();const ds=Fc(B);var Nh={exports:{}},Eo={},kh={exports:{}},Mh={};var Qx;function C_(){return Qx||(Qx=1,(function(e){function t(T,F){var X=T.length;T.push(F);e:for(;0<X;){var Z=X-1>>>1,j=T[Z];if(0<s(j,F))T[Z]=F,T[X]=j,X=Z;else break e}}function r(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var F=T[0],X=T.pop();if(X!==F){T[0]=X;e:for(var Z=0,j=T.length,z=j>>>1;Z<z;){var $=2*(Z+1)-1,R=T[$],te=$+1,ue=T[te];if(0>s(R,X))te<j&&0>s(ue,R)?(T[Z]=ue,T[te]=X,Z=te):(T[Z]=R,T[$]=X,Z=$);else if(te<j&&0>s(ue,X))T[Z]=ue,T[te]=X,Z=te;else break e}}return F}function s(T,F){var X=T.sortIndex-F.sortIndex;return X!==0?X:T.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],p=1,g=null,y=3,v=!1,w=!1,C=!1,N=!1,S=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function k(T){for(var F=r(d);F!==null;){if(F.callback===null)a(d);else if(F.startTime<=T)a(d),F.sortIndex=F.expirationTime,t(h,F);else break;F=r(d)}}function H(T){if(C=!1,k(T),!w)if(r(h)!==null)w=!0,M||(M=!0,Y());else{var F=r(d);F!==null&&V(H,F.startTime-T)}}var M=!1,D=-1,P=5,U=-1;function q(){return N?!0:!(e.unstable_now()-U<P)}function I(){if(N=!1,M){var T=e.unstable_now();U=T;var F=!0;try{e:{w=!1,C&&(C=!1,A(D),D=-1),v=!0;var X=y;try{t:{for(k(T),g=r(h);g!==null&&!(g.expirationTime>T&&q());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,y=g.priorityLevel;var j=Z(g.expirationTime<=T);if(T=e.unstable_now(),typeof j=="function"){g.callback=j,k(T),F=!0;break t}g===r(h)&&a(h),k(T)}else a(h);g=r(h)}if(g!==null)F=!0;else{var z=r(d);z!==null&&V(H,z.startTime-T),F=!1}}break e}finally{g=null,y=X,v=!1}F=void 0}}finally{F?Y():M=!1}}}var Y;if(typeof _=="function")Y=function(){_(I)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,L=Q.port2;Q.port1.onmessage=I,Y=function(){L.postMessage(null)}}else Y=function(){S(I,0)};function V(T,F){D=S(function(){T(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(T){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var X=y;y=F;try{return T()}finally{y=X}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(T,F){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var X=y;y=T;try{return F()}finally{y=X}},e.unstable_scheduleCallback=function(T,F,X){var Z=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Z+X:Z):X=Z,T){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=X+j,T={id:p++,callback:F,priorityLevel:T,startTime:X,expirationTime:j,sortIndex:-1},X>Z?(T.sortIndex=X,t(d,T),r(h)===null&&T===r(d)&&(C?(A(D),D=-1):C=!0,V(H,X-Z))):(T.sortIndex=j,t(h,T),w||v||(w=!0,M||(M=!0,Y()))),T},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(T){var F=y;return function(){var X=y;y=F;try{return T.apply(this,arguments)}finally{y=X}}}})(Mh)),Mh}var Kx;function __(){return Kx||(Kx=1,kh.exports=C_()),kh.exports}var Th={exports:{}},Lt={};var Zx;function N_(){if(Zx)return Lt;Zx=1;var e=hl();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,d,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:h,containerInfo:d,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Lt.createPortal=function(h,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,p)},Lt.flushSync=function(h){var d=u.T,p=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=d,a.p=p,a.d.f()}},Lt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(h,d))},Lt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Lt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,g=f(p,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?a.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):p==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Lt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=f(d.as,d.crossOrigin);a.d.M(h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(h)},Lt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,g=f(p,d.crossOrigin);a.d.L(h,p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Lt.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=f(d.as,d.crossOrigin);a.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(h)},Lt.requestFormReset=function(h){a.d.r(h)},Lt.unstable_batchedUpdates=function(h,d){return h(d)},Lt.useFormState=function(h,d,p){return u.H.useFormState(h,d,p)},Lt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Lt.version="19.2.4",Lt}var Wx;function $1(){if(Wx)return Th.exports;Wx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Th.exports=N_(),Th.exports}var Jx;function k_(){if(Jx)return Eo;Jx=1;var e=__(),t=hl(),r=$1();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var i=n,o=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(o=i.return),n=i.return;while(n)}return i.tag===3?o:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(l(n)!==n)throw Error(a(188))}function d(n){var i=n.alternate;if(!i){if(i=l(n),i===null)throw Error(a(188));return i!==n?null:n}for(var o=n,c=i;;){var m=o.return;if(m===null)break;var x=m.alternate;if(x===null){if(c=m.return,c!==null){o=c;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===o)return h(m),n;if(x===c)return h(m),i;x=x.sibling}throw Error(a(188))}if(o.return!==c.return)o=m,c=x;else{for(var E=!1,O=m.child;O;){if(O===o){E=!0,o=m,c=x;break}if(O===c){E=!0,c=m,o=x;break}O=O.sibling}if(!E){for(O=x.child;O;){if(O===o){E=!0,o=x,c=m;break}if(O===c){E=!0,c=x,o=m;break}O=O.sibling}if(!E)throw Error(a(189))}}if(o.alternate!==c)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?n:i}function p(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=p(n),i!==null)return i;n=n.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=I&&n[I]||n["@@iterator"],typeof n=="function"?n:null)}var Q=Symbol.for("react.client.reference");function L(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Q?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case C:return"Fragment";case S:return"Profiler";case N:return"StrictMode";case H:return"Suspense";case M:return"SuspenseList";case U:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case _:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case k:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case D:return i=n.displayName||null,i!==null?i:L(n.type)||"Memo";case P:i=n._payload,n=n._init;try{return L(n(i))}catch{}}return null}var V=Array.isArray,T=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],j=-1;function z(n){return{current:n}}function $(n){0>j||(n.current=Z[j],Z[j]=null,j--)}function R(n,i){j++,Z[j]=n.current,n.current=i}var te=z(null),ue=z(null),fe=z(null),de=z(null);function le(n,i){switch(R(fe,i),R(ue,n),R(te,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?px(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=px(i),n=mx(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}$(te),R(te,n)}function pe(){$(te),$(ue),$(fe)}function we(n){n.memoizedState!==null&&R(de,n);var i=te.current,o=mx(i,n.type);i!==o&&(R(ue,n),R(te,o))}function Ee(n){ue.current===n&&($(te),$(ue)),de.current===n&&($(de),xo._currentValue=X)}var ve,Ce;function ce(n){if(ve===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);ve=i&&i[1]||"",Ce=-1<o.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ve+n+Ce}var ge=!1;function be(n,i){if(!n||ge)return"";ge=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(re){var ne=re}Reflect.construct(n,[],oe)}else{try{oe.call()}catch(re){ne=re}n.call(oe.prototype)}}else{try{throw Error()}catch(re){ne=re}(oe=n())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(re){if(re&&ne&&typeof re.stack=="string")return[re.stack,ne.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=c.DetermineComponentFrameRoot(),E=x[0],O=x[1];if(E&&O){var G=E.split(`
|
|
4
|
-
`),ee=O.split(`
|
|
5
|
-
`);for(m=c=0;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;if(c===G.length||m===ee.length)for(c=G.length-1,m=ee.length-1;1<=c&&0<=m&&G[c]!==ee[m];)m--;for(;1<=c&&0<=m;c--,m--)if(G[c]!==ee[m]){if(c!==1||m!==1)do if(c--,m--,0>m||G[c]!==ee[m]){var ae=`
|
|
6
|
-
`+G[c].replace(" at new "," at ");return n.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",n.displayName)),ae}while(1<=c&&0<=m);break}}}finally{ge=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?ce(o):""}function De(n,i){switch(n.tag){case 26:case 27:case 5:return ce(n.type);case 16:return ce("Lazy");case 13:return n.child!==i&&i!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return be(n.type,!1);case 11:return be(n.type.render,!1);case 1:return be(n.type,!0);case 31:return ce("Activity");default:return""}}function qe(n){try{var i="",o=null;do i+=De(n,o),o=n,n=n.return;while(n);return i}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var Fe=Object.prototype.hasOwnProperty,_t=e.unstable_scheduleCallback,Ot=e.unstable_cancelCallback,sn=e.unstable_shouldYield,wn=e.unstable_requestPaint,Te=e.unstable_now,ct=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ze=e.unstable_LowPriority,Ue=e.unstable_IdlePriority,Ht=e.log,jn=e.unstable_setDisableYieldValue,kt=null,ht=null;function Dt(n){if(typeof Ht=="function"&&jn(n),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(kt,n)}catch{}}var Qe=Math.clz32?Math.clz32:df,Vn=Math.log,on=Math.LN2;function df(n){return n>>>=0,n===0?32:31-(Vn(n)/on|0)|0}var fa=256,da=262144,ha=4194304;function rr(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function pa(n,i,o){var c=n.pendingLanes;if(c===0)return 0;var m=0,x=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var O=c&134217727;return O!==0?(c=O&~x,c!==0?m=rr(c):(E&=O,E!==0?m=rr(E):o||(o=O&~n,o!==0&&(m=rr(o))))):(O=c&~x,O!==0?m=rr(O):E!==0?m=rr(E):o||(o=c&~n,o!==0&&(m=rr(o)))),m===0?0:i!==0&&i!==m&&(i&x)===0&&(x=m&-m,o=i&-i,x>=o||x===32&&(o&4194048)!==0)?i:m}function xi(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function hf(n,i){switch(n){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 Cl(){var n=ha;return ha<<=1,(ha&62914560)===0&&(ha=4194304),n}function Ms(n){for(var i=[],o=0;31>o;o++)i.push(n);return i}function vi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function pf(n,i,o,c,m,x){var E=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var O=n.entanglements,G=n.expirationTimes,ee=n.hiddenUpdates;for(o=E&~o;0<o;){var ae=31-Qe(o),oe=1<<ae;O[ae]=0,G[ae]=-1;var ne=ee[ae];if(ne!==null)for(ee[ae]=null,ae=0;ae<ne.length;ae++){var re=ne[ae];re!==null&&(re.lane&=-536870913)}o&=~oe}c!==0&&_l(n,c,0),x!==0&&m===0&&n.tag!==0&&(n.suspendedLanes|=x&~(E&~i))}function _l(n,i,o){n.pendingLanes|=i,n.suspendedLanes&=~i;var c=31-Qe(i);n.entangledLanes|=i,n.entanglements[c]=n.entanglements[c]|1073741824|o&261930}function Nl(n,i){var o=n.entangledLanes|=i;for(n=n.entanglements;o;){var c=31-Qe(o),m=1<<c;m&i|n[c]&i&&(n[c]|=i),o&=~m}}function kl(n,i){var o=i&-i;return o=(o&42)!==0?1:Ts(o),(o&(n.suspendedLanes|i))!==0?0:o}function Ts(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function As(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ml(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:Bx(n.type))}function Tl(n,i){var o=F.p;try{return F.p=n,i()}finally{F.p=o}}var qn=Math.random().toString(36).slice(2),Et="__reactFiber$"+qn,zt="__reactProps$"+qn,ir="__reactContainer$"+qn,ma="__reactEvents$"+qn,Al="__reactListeners$"+qn,mf="__reactHandles$"+qn,Rl="__reactResources$"+qn,bi="__reactMarker$"+qn;function Rs(n){delete n[Et],delete n[zt],delete n[ma],delete n[Al],delete n[mf]}function Rr(n){var i=n[Et];if(i)return i;for(var o=n.parentNode;o;){if(i=o[ir]||o[Et]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(n=Sx(n);n!==null;){if(o=n[Et])return o;n=Sx(n)}return i}n=o,o=n.parentNode}return null}function jr(n){if(n=n[Et]||n[ir]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Or(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Dr(n){var i=n[Rl];return i||(i=n[Rl]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function gt(n){n[bi]=!0}var jl=new Set,Ol={};function ar(n,i){zr(n,i),zr(n+"Capture",i)}function zr(n,i){for(Ol[n]=i,n=0;n<i.length;n++)jl.add(i[n])}var gf=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]*$"),js={},Dl={};function yf(n){return Fe.call(Dl,n)?!0:Fe.call(js,n)?!1:gf.test(n)?Dl[n]=!0:(js[n]=!0,!1)}function ga(n,i,o){if(yf(i))if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+o)}}function ya(n,i,o){if(o===null)n.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+o)}}function On(n,i,o,c){if(c===null)n.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(i,o,""+c)}}function qt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function zl(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function xf(n,i,o){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,x=c.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return m.call(this)},set:function(E){o=""+E,x.call(this,E)}}),Object.defineProperty(n,i,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(E){o=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function xa(n){if(!n._valueTracker){var i=zl(n)?"checked":"value";n._valueTracker=xf(n,i,""+n[i])}}function Ll(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var o=i.getValue(),c="";return n&&(c=zl(n)?n.checked?"true":"false":n.value),n=c,n!==o?(i.setValue(n),!0):!1}function wi(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var vf=/[\n"\\]/g;function Ft(n){return n.replace(vf,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Si(n,i,o,c,m,x,E,O){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),i!=null?E==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+qt(i)):n.value!==""+qt(i)&&(n.value=""+qt(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?Os(n,E,qt(i)):o!=null?Os(n,E,qt(o)):c!=null&&n.removeAttribute("value"),m==null&&x!=null&&(n.defaultChecked=!!x),m!=null&&(n.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?n.name=""+qt(O):n.removeAttribute("name")}function Il(n,i,o,c,m,x,E,O){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),i!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){xa(n);return}o=o!=null?""+qt(o):"",i=i!=null?""+qt(i):o,O||i===n.value||(n.value=i),n.defaultValue=i}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=O?n.checked:!!c,n.defaultChecked=!!c,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),xa(n)}function Os(n,i,o){i==="number"&&wi(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function sr(n,i,o,c){if(n=n.options,i){i={};for(var m=0;m<o.length;m++)i["$"+o[m]]=!0;for(o=0;o<n.length;o++)m=i.hasOwnProperty("$"+n[o].value),n[o].selected!==m&&(n[o].selected=m),m&&c&&(n[o].defaultSelected=!0)}else{for(o=""+qt(o),i=null,m=0;m<n.length;m++){if(n[m].value===o){n[m].selected=!0,c&&(n[m].defaultSelected=!0);return}i!==null||n[m].disabled||(i=n[m])}i!==null&&(i.selected=!0)}}function ug(n,i,o){if(i!=null&&(i=""+qt(i),i!==n.value&&(n.value=i),o==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=o!=null?""+qt(o):""}function cg(n,i,o,c){if(i==null){if(c!=null){if(o!=null)throw Error(a(92));if(V(c)){if(1<c.length)throw Error(a(93));c=c[0]}o=c}o==null&&(o=""),i=o}o=qt(i),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c),xa(n)}function va(n,i){if(i){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=i;return}}n.textContent=i}var gC=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 fg(n,i,o){var c=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":c?n.setProperty(i,o):typeof o!="number"||o===0||gC.has(i)?i==="float"?n.cssFloat=o:n[i]=(""+o).trim():n[i]=o+"px"}function dg(n,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var m in i)c=i[m],i.hasOwnProperty(m)&&o[m]!==c&&fg(n,m,c)}else for(var x in i)i.hasOwnProperty(x)&&fg(n,x,i[x])}function bf(n){if(n.indexOf("-")===-1)return!1;switch(n){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 yC=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"]]),xC=/^[\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 Bl(n){return xC.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function or(){}var wf=null;function Sf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ba=null,wa=null;function hg(n){var i=jr(n);if(i&&(n=i.stateNode)){var o=n[zt]||null;e:switch(n=i.stateNode,i.type){case"input":if(Si(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Ft(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var c=o[i];if(c!==n&&c.form===n.form){var m=c[zt]||null;if(!m)throw Error(a(90));Si(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<o.length;i++)c=o[i],c.form===n.form&&Ll(c)}break e;case"textarea":ug(n,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&sr(n,!!o.multiple,i,!1)}}}var Ef=!1;function pg(n,i,o){if(Ef)return n(i,o);Ef=!0;try{var c=n(i);return c}finally{if(Ef=!1,(ba!==null||wa!==null)&&(_u(),ba&&(i=ba,n=wa,wa=ba=null,hg(i),n)))for(i=0;i<n.length;i++)hg(n[i])}}function Ds(n,i){var o=n.stateNode;if(o===null)return null;var c=o[zt]||null;if(c===null)return null;o=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cf=!1;if(lr)try{var zs={};Object.defineProperty(zs,"passive",{get:function(){Cf=!0}}),window.addEventListener("test",zs,zs),window.removeEventListener("test",zs,zs)}catch{Cf=!1}var Lr=null,_f=null,Hl=null;function mg(){if(Hl)return Hl;var n,i=_f,o=i.length,c,m="value"in Lr?Lr.value:Lr.textContent,x=m.length;for(n=0;n<o&&i[n]===m[n];n++);var E=o-n;for(c=1;c<=E&&i[o-c]===m[x-c];c++);return Hl=m.slice(n,1<c?1-c:void 0)}function Pl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Ul(){return!0}function gg(){return!1}function Yt(n){function i(o,c,m,x,E){this._reactName=o,this._targetInst=m,this.type=c,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var O in n)n.hasOwnProperty(O)&&(o=n[O],this[O]=o?o(x):x[O]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ul:gg,this.isPropagationStopped=gg,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),i}var Ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vl=Yt(Ei),Ls=g({},Ei,{view:0,detail:0}),vC=Yt(Ls),Nf,kf,Is,ql=g({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Is&&(Is&&n.type==="mousemove"?(Nf=n.screenX-Is.screenX,kf=n.screenY-Is.screenY):kf=Nf=0,Is=n),Nf)},movementY:function(n){return"movementY"in n?n.movementY:kf}}),yg=Yt(ql),bC=g({},ql,{dataTransfer:0}),wC=Yt(bC),SC=g({},Ls,{relatedTarget:0}),Mf=Yt(SC),EC=g({},Ei,{animationName:0,elapsedTime:0,pseudoElement:0}),CC=Yt(EC),_C=g({},Ei,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),NC=Yt(_C),kC=g({},Ei,{data:0}),xg=Yt(kC),MC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TC={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"},AC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RC(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=AC[n])?!!i[n]:!1}function Tf(){return RC}var jC=g({},Ls,{key:function(n){if(n.key){var i=MC[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Pl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?TC[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tf,charCode:function(n){return n.type==="keypress"?Pl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Pl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),OC=Yt(jC),DC=g({},ql,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vg=Yt(DC),zC=g({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tf}),LC=Yt(zC),IC=g({},Ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),BC=Yt(IC),HC=g({},ql,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),PC=Yt(HC),UC=g({},Ei,{newState:0,oldState:0}),VC=Yt(UC),qC=[9,13,27,32],Af=lr&&"CompositionEvent"in window,Bs=null;lr&&"documentMode"in document&&(Bs=document.documentMode);var FC=lr&&"TextEvent"in window&&!Bs,bg=lr&&(!Af||Bs&&8<Bs&&11>=Bs),wg=" ",Sg=!1;function Eg(n,i){switch(n){case"keyup":return qC.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Sa=!1;function YC(n,i){switch(n){case"compositionend":return Cg(i);case"keypress":return i.which!==32?null:(Sg=!0,wg);case"textInput":return n=i.data,n===wg&&Sg?null:n;default:return null}}function $C(n,i){if(Sa)return n==="compositionend"||!Af&&Eg(n,i)?(n=mg(),Hl=_f=Lr=null,Sa=!1,n):null;switch(n){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 bg&&i.locale!=="ko"?null:i.data;default:return null}}var GC={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 _g(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!GC[n.type]:i==="textarea"}function Ng(n,i,o,c){ba?wa?wa.push(c):wa=[c]:ba=c,i=ju(i,"onChange"),0<i.length&&(o=new Vl("onChange","change",null,o,c),n.push({event:o,listeners:i}))}var Hs=null,Ps=null;function XC(n){lx(n,0)}function Fl(n){var i=Or(n);if(Ll(i))return n}function kg(n,i){if(n==="change")return i}var Mg=!1;if(lr){var Rf;if(lr){var jf="oninput"in document;if(!jf){var Tg=document.createElement("div");Tg.setAttribute("oninput","return;"),jf=typeof Tg.oninput=="function"}Rf=jf}else Rf=!1;Mg=Rf&&(!document.documentMode||9<document.documentMode)}function Ag(){Hs&&(Hs.detachEvent("onpropertychange",Rg),Ps=Hs=null)}function Rg(n){if(n.propertyName==="value"&&Fl(Ps)){var i=[];Ng(i,Ps,n,Sf(n)),pg(XC,i)}}function QC(n,i,o){n==="focusin"?(Ag(),Hs=i,Ps=o,Hs.attachEvent("onpropertychange",Rg)):n==="focusout"&&Ag()}function KC(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Fl(Ps)}function ZC(n,i){if(n==="click")return Fl(i)}function WC(n,i){if(n==="input"||n==="change")return Fl(i)}function JC(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var ln=typeof Object.is=="function"?Object.is:JC;function Us(n,i){if(ln(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var o=Object.keys(n),c=Object.keys(i);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var m=o[c];if(!Fe.call(i,m)||!ln(n[m],i[m]))return!1}return!0}function jg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Og(n,i){var o=jg(n);n=0;for(var c;o;){if(o.nodeType===3){if(c=n+o.textContent.length,n<=i&&c>=i)return{node:o,offset:i-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=jg(o)}}function Dg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Dg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function zg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wi(n.document);i instanceof n.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)n=i.contentWindow;else break;i=wi(n.document)}return i}function Of(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var e2=lr&&"documentMode"in document&&11>=document.documentMode,Ea=null,Df=null,Vs=null,zf=!1;function Lg(n,i,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;zf||Ea==null||Ea!==wi(c)||(c=Ea,"selectionStart"in c&&Of(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Vs&&Us(Vs,c)||(Vs=c,c=ju(Df,"onSelect"),0<c.length&&(i=new Vl("onSelect","select",null,i,o),n.push({event:i,listeners:c}),i.target=Ea)))}function Ci(n,i){var o={};return o[n.toLowerCase()]=i.toLowerCase(),o["Webkit"+n]="webkit"+i,o["Moz"+n]="moz"+i,o}var Ca={animationend:Ci("Animation","AnimationEnd"),animationiteration:Ci("Animation","AnimationIteration"),animationstart:Ci("Animation","AnimationStart"),transitionrun:Ci("Transition","TransitionRun"),transitionstart:Ci("Transition","TransitionStart"),transitioncancel:Ci("Transition","TransitionCancel"),transitionend:Ci("Transition","TransitionEnd")},Lf={},Ig={};lr&&(Ig=document.createElement("div").style,"AnimationEvent"in window||(delete Ca.animationend.animation,delete Ca.animationiteration.animation,delete Ca.animationstart.animation),"TransitionEvent"in window||delete Ca.transitionend.transition);function _i(n){if(Lf[n])return Lf[n];if(!Ca[n])return n;var i=Ca[n],o;for(o in i)if(i.hasOwnProperty(o)&&o in Ig)return Lf[n]=i[o];return n}var Bg=_i("animationend"),Hg=_i("animationiteration"),Pg=_i("animationstart"),t2=_i("transitionrun"),n2=_i("transitionstart"),r2=_i("transitioncancel"),Ug=_i("transitionend"),Vg=new Map,If="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(" ");If.push("scrollEnd");function Dn(n,i){Vg.set(n,i),ar(i,[n])}var Yl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Sn=[],_a=0,Bf=0;function $l(){for(var n=_a,i=Bf=_a=0;i<n;){var o=Sn[i];Sn[i++]=null;var c=Sn[i];Sn[i++]=null;var m=Sn[i];Sn[i++]=null;var x=Sn[i];if(Sn[i++]=null,c!==null&&m!==null){var E=c.pending;E===null?m.next=m:(m.next=E.next,E.next=m),c.pending=m}x!==0&&qg(o,m,x)}}function Gl(n,i,o,c){Sn[_a++]=n,Sn[_a++]=i,Sn[_a++]=o,Sn[_a++]=c,Bf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Hf(n,i,o,c){return Gl(n,i,o,c),Xl(n)}function Ni(n,i){return Gl(n,null,null,i),Xl(n)}function qg(n,i,o){n.lanes|=o;var c=n.alternate;c!==null&&(c.lanes|=o);for(var m=!1,x=n.return;x!==null;)x.childLanes|=o,c=x.alternate,c!==null&&(c.childLanes|=o),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(m=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,m&&i!==null&&(m=31-Qe(o),n=x.hiddenUpdates,c=n[m],c===null?n[m]=[i]:c.push(i),i.lane=o|536870912),x):null}function Xl(n){if(50<co)throw co=0,Xd=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Na={};function i2(n,i,o,c){this.tag=n,this.key=o,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=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function un(n,i,o,c){return new i2(n,i,o,c)}function Pf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ur(n,i){var o=n.alternate;return o===null?(o=un(n.tag,i,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=i,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,i=n.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Fg(n,i){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,i=o.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Ql(n,i,o,c,m,x){var E=0;if(c=n,typeof n=="function")Pf(n)&&(E=1);else if(typeof n=="string")E=u_(n,o,te.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case U:return n=un(31,o,i,m),n.elementType=U,n.lanes=x,n;case C:return ki(o.children,m,x,i);case N:E=8,m|=24;break;case S:return n=un(12,o,i,m|2),n.elementType=S,n.lanes=x,n;case H:return n=un(13,o,i,m),n.elementType=H,n.lanes=x,n;case M:return n=un(19,o,i,m),n.elementType=M,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case _:E=10;break e;case A:E=9;break e;case k:E=11;break e;case D:E=14;break e;case P:E=16,c=null;break e}E=29,o=Error(a(130,n===null?"null":typeof n,"")),c=null}return i=un(E,o,i,m),i.elementType=n,i.type=c,i.lanes=x,i}function ki(n,i,o,c){return n=un(7,n,c,i),n.lanes=o,n}function Uf(n,i,o){return n=un(6,n,null,i),n.lanes=o,n}function Yg(n){var i=un(18,null,null,0);return i.stateNode=n,i}function Vf(n,i,o){return i=un(4,n.children!==null?n.children:[],n.key,i),i.lanes=o,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var $g=new WeakMap;function En(n,i){if(typeof n=="object"&&n!==null){var o=$g.get(n);return o!==void 0?o:(i={value:n,source:i,stack:qe(i)},$g.set(n,i),i)}return{value:n,source:i,stack:qe(i)}}var ka=[],Ma=0,Kl=null,qs=0,Cn=[],_n=0,Ir=null,Fn=1,Yn="";function cr(n,i){ka[Ma++]=qs,ka[Ma++]=Kl,Kl=n,qs=i}function Gg(n,i,o){Cn[_n++]=Fn,Cn[_n++]=Yn,Cn[_n++]=Ir,Ir=n;var c=Fn;n=Yn;var m=32-Qe(c)-1;c&=~(1<<m),o+=1;var x=32-Qe(i)+m;if(30<x){var E=m-m%5;x=(c&(1<<E)-1).toString(32),c>>=E,m-=E,Fn=1<<32-Qe(i)+m|o<<m|c,Yn=x+n}else Fn=1<<x|o<<m|c,Yn=n}function qf(n){n.return!==null&&(cr(n,1),Gg(n,1,0))}function Ff(n){for(;n===Kl;)Kl=ka[--Ma],ka[Ma]=null,qs=ka[--Ma],ka[Ma]=null;for(;n===Ir;)Ir=Cn[--_n],Cn[_n]=null,Yn=Cn[--_n],Cn[_n]=null,Fn=Cn[--_n],Cn[_n]=null}function Xg(n,i){Cn[_n++]=Fn,Cn[_n++]=Yn,Cn[_n++]=Ir,Fn=i.id,Yn=i.overflow,Ir=n}var Mt=null,it=null,Pe=!1,Br=null,Nn=!1,Yf=Error(a(519));function Hr(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fs(En(i,n)),Yf}function Qg(n){var i=n.stateNode,o=n.type,c=n.memoizedProps;switch(i[Et]=n,i[zt]=c,o){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(o=0;o<ho.length;o++)Ie(ho[o],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),Il(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),cg(i,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||c.suppressHydrationWarning===!0||dx(i.textContent,o)?(c.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),c.onScroll!=null&&Ie("scroll",i),c.onScrollEnd!=null&&Ie("scrollend",i),c.onClick!=null&&(i.onclick=or),i=!0):i=!1,i||Hr(n,!0)}function Kg(n){for(Mt=n.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Mt=Mt.return}}function Ta(n){if(n!==Mt)return!1;if(!Pe)return Kg(n),Pe=!0,!1;var i=n.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||uh(n.type,n.memoizedProps)),o=!o),o&&it&&Hr(n),Kg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));it=wx(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));it=wx(n)}else i===27?(i=it,Jr(n.type)?(n=ph,ph=null,it=n):it=i):it=Mt?Mn(n.stateNode.nextSibling):null;return!0}function Mi(){it=Mt=null,Pe=!1}function $f(){var n=Br;return n!==null&&(Qt===null?Qt=n:Qt.push.apply(Qt,n),Br=null),n}function Fs(n){Br===null?Br=[n]:Br.push(n)}var Gf=z(null),Ti=null,fr=null;function Pr(n,i,o){R(Gf,i._currentValue),i._currentValue=o}function dr(n){n._currentValue=Gf.current,$(Gf)}function Xf(n,i,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),n===o)break;n=n.return}}function Qf(n,i,o,c){var m=n.child;for(m!==null&&(m.return=n);m!==null;){var x=m.dependencies;if(x!==null){var E=m.child;x=x.firstContext;e:for(;x!==null;){var O=x;x=m;for(var G=0;G<i.length;G++)if(O.context===i[G]){x.lanes|=o,O=x.alternate,O!==null&&(O.lanes|=o),Xf(x.return,o,n),c||(E=null);break e}x=O.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(a(341));E.lanes|=o,x=E.alternate,x!==null&&(x.lanes|=o),Xf(E,o,n),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===n){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function Aa(n,i,o,c){n=null;for(var m=i,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var O=m.type;ln(m.pendingProps.value,E.value)||(n!==null?n.push(O):n=[O])}}else if(m===de.current){if(E=m.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(n!==null?n.push(xo):n=[xo])}m=m.return}n!==null&&Qf(i,n,o,c),i.flags|=262144}function Zl(n){for(n=n.firstContext;n!==null;){if(!ln(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ai(n){Ti=n,fr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Tt(n){return Zg(Ti,n)}function Wl(n,i){return Ti===null&&Ai(n),Zg(n,i)}function Zg(n,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},fr===null){if(n===null)throw Error(a(308));fr=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else fr=fr.next=i;return o}var a2=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(o,c){n.push(c)}};this.abort=function(){i.aborted=!0,n.forEach(function(o){return o()})}},s2=e.unstable_scheduleCallback,o2=e.unstable_NormalPriority,yt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kf(){return{controller:new a2,data:new Map,refCount:0}}function Ys(n){n.refCount--,n.refCount===0&&s2(o2,function(){n.controller.abort()})}var $s=null,Zf=0,Ra=0,ja=null;function l2(n,i){if($s===null){var o=$s=[];Zf=0,Ra=eh(),ja={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Zf++,i.then(Wg,Wg),i}function Wg(){if(--Zf===0&&$s!==null){ja!==null&&(ja.status="fulfilled");var n=$s;$s=null,Ra=0,ja=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function u2(n,i){var o=[],c={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return n.then(function(){c.status="fulfilled",c.value=i;for(var m=0;m<o.length;m++)(0,o[m])(i)},function(m){for(c.status="rejected",c.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),c}var Jg=T.S;T.S=function(n,i){L0=Te(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&l2(n,i),Jg!==null&&Jg(n,i)};var Ri=z(null);function Wf(){var n=Ri.current;return n!==null?n:tt.pooledCache}function Jl(n,i){i===null?R(Ri,Ri.current):R(Ri,i.pool)}function ey(){var n=Wf();return n===null?null:{parent:yt._currentValue,pool:n}}var Oa=Error(a(460)),Jf=Error(a(474)),eu=Error(a(542)),tu={then:function(){}};function ty(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ny(n,i,o){switch(o=n[o],o===void 0?n.push(i):o!==i&&(i.then(or,or),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,iy(n),n;default:if(typeof i.status=="string")i.then(or,or);else{if(n=tt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(c){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=c}},function(c){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,iy(n),n}throw Oi=i,Oa}}function ji(n){try{var i=n._init;return i(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Oi=o,Oa):o}}var Oi=null;function ry(){if(Oi===null)throw Error(a(459));var n=Oi;return Oi=null,n}function iy(n){if(n===Oa||n===eu)throw Error(a(483))}var Da=null,Gs=0;function nu(n){var i=Gs;return Gs+=1,Da===null&&(Da=[]),ny(Da,n,i)}function Xs(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function ru(n,i){throw i.$$typeof===y?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ay(n){function i(W,K){if(n){var J=W.deletions;J===null?(W.deletions=[K],W.flags|=16):J.push(K)}}function o(W,K){if(!n)return null;for(;K!==null;)i(W,K),K=K.sibling;return null}function c(W){for(var K=new Map;W!==null;)W.key!==null?K.set(W.key,W):K.set(W.index,W),W=W.sibling;return K}function m(W,K){return W=ur(W,K),W.index=0,W.sibling=null,W}function x(W,K,J){return W.index=J,n?(J=W.alternate,J!==null?(J=J.index,J<K?(W.flags|=67108866,K):J):(W.flags|=67108866,K)):(W.flags|=1048576,K)}function E(W){return n&&W.alternate===null&&(W.flags|=67108866),W}function O(W,K,J,se){return K===null||K.tag!==6?(K=Uf(J,W.mode,se),K.return=W,K):(K=m(K,J),K.return=W,K)}function G(W,K,J,se){var Se=J.type;return Se===C?ae(W,K,J.props.children,se,J.key):K!==null&&(K.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===P&&ji(Se)===K.type)?(K=m(K,J.props),Xs(K,J),K.return=W,K):(K=Ql(J.type,J.key,J.props,null,W.mode,se),Xs(K,J),K.return=W,K)}function ee(W,K,J,se){return K===null||K.tag!==4||K.stateNode.containerInfo!==J.containerInfo||K.stateNode.implementation!==J.implementation?(K=Vf(J,W.mode,se),K.return=W,K):(K=m(K,J.children||[]),K.return=W,K)}function ae(W,K,J,se,Se){return K===null||K.tag!==7?(K=ki(J,W.mode,se,Se),K.return=W,K):(K=m(K,J),K.return=W,K)}function oe(W,K,J){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Uf(""+K,W.mode,J),K.return=W,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case v:return J=Ql(K.type,K.key,K.props,null,W.mode,J),Xs(J,K),J.return=W,J;case w:return K=Vf(K,W.mode,J),K.return=W,K;case P:return K=ji(K),oe(W,K,J)}if(V(K)||Y(K))return K=ki(K,W.mode,J,null),K.return=W,K;if(typeof K.then=="function")return oe(W,nu(K),J);if(K.$$typeof===_)return oe(W,Wl(W,K),J);ru(W,K)}return null}function ne(W,K,J,se){var Se=K!==null?K.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Se!==null?null:O(W,K,""+J,se);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===Se?G(W,K,J,se):null;case w:return J.key===Se?ee(W,K,J,se):null;case P:return J=ji(J),ne(W,K,J,se)}if(V(J)||Y(J))return Se!==null?null:ae(W,K,J,se,null);if(typeof J.then=="function")return ne(W,K,nu(J),se);if(J.$$typeof===_)return ne(W,K,Wl(W,J),se);ru(W,J)}return null}function re(W,K,J,se,Se){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return W=W.get(J)||null,O(K,W,""+se,Se);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case v:return W=W.get(se.key===null?J:se.key)||null,G(K,W,se,Se);case w:return W=W.get(se.key===null?J:se.key)||null,ee(K,W,se,Se);case P:return se=ji(se),re(W,K,J,se,Se)}if(V(se)||Y(se))return W=W.get(J)||null,ae(K,W,se,Se,null);if(typeof se.then=="function")return re(W,K,J,nu(se),Se);if(se.$$typeof===_)return re(W,K,J,Wl(K,se),Se);ru(K,se)}return null}function ye(W,K,J,se){for(var Se=null,Ye=null,xe=K,je=K=0,He=null;xe!==null&&je<J.length;je++){xe.index>je?(He=xe,xe=null):He=xe.sibling;var $e=ne(W,xe,J[je],se);if($e===null){xe===null&&(xe=He);break}n&&xe&&$e.alternate===null&&i(W,xe),K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e,xe=He}if(je===J.length)return o(W,xe),Pe&&cr(W,je),Se;if(xe===null){for(;je<J.length;je++)xe=oe(W,J[je],se),xe!==null&&(K=x(xe,K,je),Ye===null?Se=xe:Ye.sibling=xe,Ye=xe);return Pe&&cr(W,je),Se}for(xe=c(xe);je<J.length;je++)He=re(xe,W,je,J[je],se),He!==null&&(n&&He.alternate!==null&&xe.delete(He.key===null?je:He.key),K=x(He,K,je),Ye===null?Se=He:Ye.sibling=He,Ye=He);return n&&xe.forEach(function(ii){return i(W,ii)}),Pe&&cr(W,je),Se}function ke(W,K,J,se){if(J==null)throw Error(a(151));for(var Se=null,Ye=null,xe=K,je=K=0,He=null,$e=J.next();xe!==null&&!$e.done;je++,$e=J.next()){xe.index>je?(He=xe,xe=null):He=xe.sibling;var ii=ne(W,xe,$e.value,se);if(ii===null){xe===null&&(xe=He);break}n&&xe&&ii.alternate===null&&i(W,xe),K=x(ii,K,je),Ye===null?Se=ii:Ye.sibling=ii,Ye=ii,xe=He}if($e.done)return o(W,xe),Pe&&cr(W,je),Se;if(xe===null){for(;!$e.done;je++,$e=J.next())$e=oe(W,$e.value,se),$e!==null&&(K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e);return Pe&&cr(W,je),Se}for(xe=c(xe);!$e.done;je++,$e=J.next())$e=re(xe,W,je,$e.value,se),$e!==null&&(n&&$e.alternate!==null&&xe.delete($e.key===null?je:$e.key),K=x($e,K,je),Ye===null?Se=$e:Ye.sibling=$e,Ye=$e);return n&&xe.forEach(function(b_){return i(W,b_)}),Pe&&cr(W,je),Se}function et(W,K,J,se){if(typeof J=="object"&&J!==null&&J.type===C&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case v:e:{for(var Se=J.key;K!==null;){if(K.key===Se){if(Se=J.type,Se===C){if(K.tag===7){o(W,K.sibling),se=m(K,J.props.children),se.return=W,W=se;break e}}else if(K.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===P&&ji(Se)===K.type){o(W,K.sibling),se=m(K,J.props),Xs(se,J),se.return=W,W=se;break e}o(W,K);break}else i(W,K);K=K.sibling}J.type===C?(se=ki(J.props.children,W.mode,se,J.key),se.return=W,W=se):(se=Ql(J.type,J.key,J.props,null,W.mode,se),Xs(se,J),se.return=W,W=se)}return E(W);case w:e:{for(Se=J.key;K!==null;){if(K.key===Se)if(K.tag===4&&K.stateNode.containerInfo===J.containerInfo&&K.stateNode.implementation===J.implementation){o(W,K.sibling),se=m(K,J.children||[]),se.return=W,W=se;break e}else{o(W,K);break}else i(W,K);K=K.sibling}se=Vf(J,W.mode,se),se.return=W,W=se}return E(W);case P:return J=ji(J),et(W,K,J,se)}if(V(J))return ye(W,K,J,se);if(Y(J)){if(Se=Y(J),typeof Se!="function")throw Error(a(150));return J=Se.call(J),ke(W,K,J,se)}if(typeof J.then=="function")return et(W,K,nu(J),se);if(J.$$typeof===_)return et(W,K,Wl(W,J),se);ru(W,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,K!==null&&K.tag===6?(o(W,K.sibling),se=m(K,J),se.return=W,W=se):(o(W,K),se=Uf(J,W.mode,se),se.return=W,W=se),E(W)):o(W,K)}return function(W,K,J,se){try{Gs=0;var Se=et(W,K,J,se);return Da=null,Se}catch(xe){if(xe===Oa||xe===eu)throw xe;var Ye=un(29,xe,null,W.mode);return Ye.lanes=se,Ye.return=W,Ye}}}var Di=ay(!0),sy=ay(!1),Ur=!1;function ed(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Vr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function qr(n,i,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Ge&2)!==0){var m=c.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),c.pending=i,i=Xl(n),qg(n,null,o),i}return Gl(n,c,i,o),Xl(n)}function Qs(n,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var c=i.lanes;c&=n.pendingLanes,o|=c,i.lanes=o,Nl(n,o)}}function nd(n,i){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var m=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var E={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?m=x=E:x=x.next=E,o=o.next}while(o!==null);x===null?m=x=i:x=x.next=i}else m=x=i;o={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:c.shared,callbacks:c.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=i:n.next=i,o.lastBaseUpdate=i}var rd=!1;function Ks(){if(rd){var n=ja;if(n!==null)throw n}}function Zs(n,i,o,c){rd=!1;var m=n.updateQueue;Ur=!1;var x=m.firstBaseUpdate,E=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var G=O,ee=G.next;G.next=null,E===null?x=ee:E.next=ee,E=G;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,O=ae.lastBaseUpdate,O!==E&&(O===null?ae.firstBaseUpdate=ee:O.next=ee,ae.lastBaseUpdate=G))}if(x!==null){var oe=m.baseState;E=0,ae=ee=G=null,O=x;do{var ne=O.lane&-536870913,re=ne!==O.lane;if(re?(Be&ne)===ne:(c&ne)===ne){ne!==0&&ne===Ra&&(rd=!0),ae!==null&&(ae=ae.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var ye=n,ke=O;ne=i;var et=o;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){oe=ye.call(et,oe,ne);break e}oe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ne=typeof ye=="function"?ye.call(et,oe,ne):ye,ne==null)break e;oe=g({},oe,ne);break e;case 2:Ur=!0}}ne=O.callback,ne!==null&&(n.flags|=64,re&&(n.flags|=8192),re=m.callbacks,re===null?m.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ae===null?(ee=ae=re,G=oe):ae=ae.next=re,E|=ne;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;re=O,O=re.next,re.next=null,m.lastBaseUpdate=re,m.shared.pending=null}}while(!0);ae===null&&(G=oe),m.baseState=G,m.firstBaseUpdate=ee,m.lastBaseUpdate=ae,x===null&&(m.shared.lanes=0),Xr|=E,n.lanes=E,n.memoizedState=oe}}function oy(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function ly(n,i){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)oy(o[n],i)}var za=z(null),iu=z(0);function uy(n,i){n=wr,R(iu,n),R(za,i),wr=n|i.baseLanes}function id(){R(iu,wr),R(za,za.current)}function ad(){wr=iu.current,$(za),$(iu)}var cn=z(null),kn=null;function Fr(n){var i=n.alternate;R(pt,pt.current&1),R(cn,n),kn===null&&(i===null||za.current!==null||i.memoizedState!==null)&&(kn=n)}function sd(n){R(pt,pt.current),R(cn,n),kn===null&&(kn=n)}function cy(n){n.tag===22?(R(pt,pt.current),R(cn,n),kn===null&&(kn=n)):Yr()}function Yr(){R(pt,pt.current),R(cn,cn.current)}function fn(n){$(cn),kn===n&&(kn=null),$(pt)}var pt=z(0);function au(n){for(var i=n;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||dh(o)||hh(o)))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===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var hr=0,Re=null,We=null,xt=null,su=!1,La=!1,zi=!1,ou=0,Ws=0,Ia=null,c2=0;function ft(){throw Error(a(321))}function od(n,i){if(i===null)return!1;for(var o=0;o<i.length&&o<n.length;o++)if(!ln(n[o],i[o]))return!1;return!0}function ld(n,i,o,c,m,x){return hr=x,Re=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,T.H=n===null||n.memoizedState===null?Gy:Ed,zi=!1,x=o(c,m),zi=!1,La&&(x=dy(i,o,c,m)),fy(n),x}function fy(n){T.H=to;var i=We!==null&&We.next!==null;if(hr=0,xt=We=Re=null,su=!1,Ws=0,Ia=null,i)throw Error(a(300));n===null||vt||(n=n.dependencies,n!==null&&Zl(n)&&(vt=!0))}function dy(n,i,o,c){Re=n;var m=0;do{if(La&&(Ia=null),Ws=0,La=!1,25<=m)throw Error(a(301));if(m+=1,xt=We=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}T.H=Xy,x=i(o,c)}while(La);return x}function f2(){var n=T.H,i=n.useState()[0];return i=typeof i.then=="function"?Js(i):i,n=n.useState()[0],(We!==null?We.memoizedState:null)!==n&&(Re.flags|=1024),i}function ud(){var n=ou!==0;return ou=0,n}function cd(n,i,o){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~o}function fd(n){if(su){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}su=!1}hr=0,xt=We=Re=null,La=!1,Ws=ou=0,Ia=null}function Pt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Re.memoizedState=xt=n:xt=xt.next=n,xt}function mt(){if(We===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=We.next;var i=xt===null?Re.memoizedState:xt.next;if(i!==null)xt=i,We=n;else{if(n===null)throw Re.alternate===null?Error(a(467)):Error(a(310));We=n,n={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},xt===null?Re.memoizedState=xt=n:xt=xt.next=n}return xt}function lu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Js(n){var i=Ws;return Ws+=1,Ia===null&&(Ia=[]),n=ny(Ia,n,i),i=Re,(xt===null?i.memoizedState:xt.next)===null&&(i=i.alternate,T.H=i===null||i.memoizedState===null?Gy:Ed),n}function uu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Js(n);if(n.$$typeof===_)return Tt(n)}throw Error(a(438,String(n)))}function dd(n){var i=null,o=Re.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var c=Re.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=lu(),Re.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(n),c=0;c<n;c++)o[c]=q;return i.index++,o}function pr(n,i){return typeof i=="function"?i(n):i}function cu(n){var i=mt();return hd(i,We,n)}function hd(n,i,o){var c=n.queue;if(c===null)throw Error(a(311));c.lastRenderedReducer=o;var m=n.baseQueue,x=c.pending;if(x!==null){if(m!==null){var E=m.next;m.next=x.next,x.next=E}i.baseQueue=m=x,c.pending=null}if(x=n.baseState,m===null)n.memoizedState=x;else{i=m.next;var O=E=null,G=null,ee=i,ae=!1;do{var oe=ee.lane&-536870913;if(oe!==ee.lane?(Be&oe)===oe:(hr&oe)===oe){var ne=ee.revertLane;if(ne===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),oe===Ra&&(ae=!0);else if((hr&ne)===ne){ee=ee.next,ne===Ra&&(ae=!0);continue}else oe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(O=G=oe,E=x):G=G.next=oe,Re.lanes|=ne,Xr|=ne;oe=ee.action,zi&&o(x,oe),x=ee.hasEagerState?ee.eagerState:o(x,oe)}else ne={lane:oe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},G===null?(O=G=ne,E=x):G=G.next=ne,Re.lanes|=oe,Xr|=oe;ee=ee.next}while(ee!==null&&ee!==i);if(G===null?E=x:G.next=O,!ln(x,n.memoizedState)&&(vt=!0,ae&&(o=ja,o!==null)))throw o;n.memoizedState=x,n.baseState=E,n.baseQueue=G,c.lastRenderedState=x}return m===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function pd(n){var i=mt(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=n;var c=o.dispatch,m=o.pending,x=i.memoizedState;if(m!==null){o.pending=null;var E=m=m.next;do x=n(x,E.action),E=E.next;while(E!==m);ln(x,i.memoizedState)||(vt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,c]}function hy(n,i,o){var c=Re,m=mt(),x=Pe;if(x){if(o===void 0)throw Error(a(407));o=o()}else o=i();var E=!ln((We||m).memoizedState,o);if(E&&(m.memoizedState=o,vt=!0),m=m.queue,yd(gy.bind(null,c,m,n),[n]),m.getSnapshot!==i||E||xt!==null&&xt.memoizedState.tag&1){if(c.flags|=2048,Ba(9,{destroy:void 0},my.bind(null,c,m,o,i),null),tt===null)throw Error(a(349));x||(hr&127)!==0||py(c,i,o)}return o}function py(n,i,o){n.flags|=16384,n={getSnapshot:i,value:o},i=Re.updateQueue,i===null?(i=lu(),Re.updateQueue=i,i.stores=[n]):(o=i.stores,o===null?i.stores=[n]:o.push(n))}function my(n,i,o,c){i.value=o,i.getSnapshot=c,yy(i)&&xy(n)}function gy(n,i,o){return o(function(){yy(i)&&xy(n)})}function yy(n){var i=n.getSnapshot;n=n.value;try{var o=i();return!ln(n,o)}catch{return!0}}function xy(n){var i=Ni(n,2);i!==null&&Kt(i,n,2)}function md(n){var i=Pt();if(typeof n=="function"){var o=n;if(n=o(),zi){Dt(!0);try{o()}finally{Dt(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:n},i}function vy(n,i,o,c){return n.baseState=o,hd(n,We,typeof c=="function"?c:pr)}function d2(n,i,o,c,m){if(hu(n))throw Error(a(485));if(n=i.action,n!==null){var x={payload:m,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){x.listeners.push(E)}};T.T!==null?o(!0):x.isTransition=!1,c(x),o=i.pending,o===null?(x.next=i.pending=x,by(i,x)):(x.next=o.next,i.pending=o.next=x)}}function by(n,i){var o=i.action,c=i.payload,m=n.state;if(i.isTransition){var x=T.T,E={};T.T=E;try{var O=o(m,c),G=T.S;G!==null&&G(E,O),wy(n,i,O)}catch(ee){gd(n,i,ee)}finally{x!==null&&E.types!==null&&(x.types=E.types),T.T=x}}else try{x=o(m,c),wy(n,i,x)}catch(ee){gd(n,i,ee)}}function wy(n,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Sy(n,i,c)},function(c){return gd(n,i,c)}):Sy(n,i,o)}function Sy(n,i,o){i.status="fulfilled",i.value=o,Ey(i),n.state=o,i=n.pending,i!==null&&(o=i.next,o===i?n.pending=null:(o=o.next,i.next=o,by(n,o)))}function gd(n,i,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=o,Ey(i),i=i.next;while(i!==c)}n.action=null}function Ey(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Cy(n,i){return i}function _y(n,i){if(Pe){var o=tt.formState;if(o!==null){e:{var c=Re;if(Pe){if(it){t:{for(var m=it,x=Nn;m.nodeType!==8;){if(!x){m=null;break t}if(m=Mn(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){it=Mn(m.nextSibling),c=m.data==="F!";break e}}Hr(c)}c=!1}c&&(i=o[0])}}return o=Pt(),o.memoizedState=o.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cy,lastRenderedState:i},o.queue=c,o=Fy.bind(null,Re,c),c.dispatch=o,c=md(!1),x=Sd.bind(null,Re,!1,c.queue),c=Pt(),m={state:i,dispatch:null,action:n,pending:null},c.queue=m,o=d2.bind(null,Re,m,x,o),m.dispatch=o,c.memoizedState=n,[i,o,!1]}function Ny(n){var i=mt();return ky(i,We,n)}function ky(n,i,o){if(i=hd(n,i,Cy)[0],n=cu(pr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Js(i)}catch(E){throw E===Oa?eu:E}else c=i;i=mt();var m=i.queue,x=m.dispatch;return o!==i.memoizedState&&(Re.flags|=2048,Ba(9,{destroy:void 0},h2.bind(null,m,o),null)),[c,x,n]}function h2(n,i){n.action=i}function My(n){var i=mt(),o=We;if(o!==null)return ky(i,o,n);mt(),i=i.memoizedState,o=mt();var c=o.queue.dispatch;return o.memoizedState=n,[i,c,!1]}function Ba(n,i,o,c){return n={tag:n,create:o,deps:c,inst:i,next:null},i=Re.updateQueue,i===null&&(i=lu(),Re.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=n.next=n:(c=o.next,o.next=n,n.next=c,i.lastEffect=n),n}function Ty(){return mt().memoizedState}function fu(n,i,o,c){var m=Pt();Re.flags|=n,m.memoizedState=Ba(1|i,{destroy:void 0},o,c===void 0?null:c)}function du(n,i,o,c){var m=mt();c=c===void 0?null:c;var x=m.memoizedState.inst;We!==null&&c!==null&&od(c,We.memoizedState.deps)?m.memoizedState=Ba(i,x,o,c):(Re.flags|=n,m.memoizedState=Ba(1|i,x,o,c))}function Ay(n,i){fu(8390656,8,n,i)}function yd(n,i){du(2048,8,n,i)}function p2(n){Re.flags|=4;var i=Re.updateQueue;if(i===null)i=lu(),Re.updateQueue=i,i.events=[n];else{var o=i.events;o===null?i.events=[n]:o.push(n)}}function Ry(n){var i=mt().memoizedState;return p2({ref:i,nextImpl:n}),function(){if((Ge&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function jy(n,i){return du(4,2,n,i)}function Oy(n,i){return du(4,4,n,i)}function Dy(n,i){if(typeof i=="function"){n=n();var o=i(n);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function zy(n,i,o){o=o!=null?o.concat([n]):null,du(4,4,Dy.bind(null,i,n),o)}function xd(){}function Ly(n,i){var o=mt();i=i===void 0?null:i;var c=o.memoizedState;return i!==null&&od(i,c[1])?c[0]:(o.memoizedState=[n,i],n)}function Iy(n,i){var o=mt();i=i===void 0?null:i;var c=o.memoizedState;if(i!==null&&od(i,c[1]))return c[0];if(c=n(),zi){Dt(!0);try{n()}finally{Dt(!1)}}return o.memoizedState=[c,i],c}function vd(n,i,o){return o===void 0||(hr&1073741824)!==0&&(Be&261930)===0?n.memoizedState=i:(n.memoizedState=o,n=B0(),Re.lanes|=n,Xr|=n,o)}function By(n,i,o,c){return ln(o,i)?o:za.current!==null?(n=vd(n,o,c),ln(n,i)||(vt=!0),n):(hr&42)===0||(hr&1073741824)!==0&&(Be&261930)===0?(vt=!0,n.memoizedState=o):(n=B0(),Re.lanes|=n,Xr|=n,i)}function Hy(n,i,o,c,m){var x=F.p;F.p=x!==0&&8>x?x:8;var E=T.T,O={};T.T=O,Sd(n,!1,i,o);try{var G=m(),ee=T.S;if(ee!==null&&ee(O,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ae=u2(G,c);eo(n,i,ae,pn(n))}else eo(n,i,c,pn(n))}catch(oe){eo(n,i,{then:function(){},status:"rejected",reason:oe},pn())}finally{F.p=x,E!==null&&O.types!==null&&(E.types=O.types),T.T=E}}function m2(){}function bd(n,i,o,c){if(n.tag!==5)throw Error(a(476));var m=Py(n).queue;Hy(n,m,i,X,o===null?m2:function(){return Uy(n),o(c)})}function Py(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:X},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:o},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Uy(n){var i=Py(n);i.next===null&&(i=n.alternate.memoizedState),eo(n,i.next.queue,{},pn())}function wd(){return Tt(xo)}function Vy(){return mt().memoizedState}function qy(){return mt().memoizedState}function g2(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var o=pn();n=Vr(o);var c=qr(i,n,o);c!==null&&(Kt(c,i,o),Qs(c,i,o)),i={cache:Kf()},n.payload=i;return}i=i.return}}function y2(n,i,o){var c=pn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},hu(n)?Yy(i,o):(o=Hf(n,i,o,c),o!==null&&(Kt(o,n,c),$y(o,i,c)))}function Fy(n,i,o){var c=pn();eo(n,i,o,c)}function eo(n,i,o,c){var m={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(hu(n))Yy(i,m);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var E=i.lastRenderedState,O=x(E,o);if(m.hasEagerState=!0,m.eagerState=O,ln(O,E))return Gl(n,i,m,0),tt===null&&$l(),!1}catch{}if(o=Hf(n,i,m,c),o!==null)return Kt(o,n,c),$y(o,i,c),!0}return!1}function Sd(n,i,o,c){if(c={lane:2,revertLane:eh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},hu(n)){if(i)throw Error(a(479))}else i=Hf(n,o,c,2),i!==null&&Kt(i,n,2)}function hu(n){var i=n.alternate;return n===Re||i!==null&&i===Re}function Yy(n,i){La=su=!0;var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}function $y(n,i,o){if((o&4194048)!==0){var c=i.lanes;c&=n.pendingLanes,o|=c,i.lanes=o,Nl(n,o)}}var to={readContext:Tt,use:uu,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};to.useEffectEvent=ft;var Gy={readContext:Tt,use:uu,useCallback:function(n,i){return Pt().memoizedState=[n,i===void 0?null:i],n},useContext:Tt,useEffect:Ay,useImperativeHandle:function(n,i,o){o=o!=null?o.concat([n]):null,fu(4194308,4,Dy.bind(null,i,n),o)},useLayoutEffect:function(n,i){return fu(4194308,4,n,i)},useInsertionEffect:function(n,i){fu(4,2,n,i)},useMemo:function(n,i){var o=Pt();i=i===void 0?null:i;var c=n();if(zi){Dt(!0);try{n()}finally{Dt(!1)}}return o.memoizedState=[c,i],c},useReducer:function(n,i,o){var c=Pt();if(o!==void 0){var m=o(i);if(zi){Dt(!0);try{o(i)}finally{Dt(!1)}}}else m=i;return c.memoizedState=c.baseState=m,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:m},c.queue=n,n=n.dispatch=y2.bind(null,Re,n),[c.memoizedState,n]},useRef:function(n){var i=Pt();return n={current:n},i.memoizedState=n},useState:function(n){n=md(n);var i=n.queue,o=Fy.bind(null,Re,i);return i.dispatch=o,[n.memoizedState,o]},useDebugValue:xd,useDeferredValue:function(n,i){var o=Pt();return vd(o,n,i)},useTransition:function(){var n=md(!1);return n=Hy.bind(null,Re,n.queue,!0,!1),Pt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,o){var c=Re,m=Pt();if(Pe){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),tt===null)throw Error(a(349));(Be&127)!==0||py(c,i,o)}m.memoizedState=o;var x={value:o,getSnapshot:i};return m.queue=x,Ay(gy.bind(null,c,x,n),[n]),c.flags|=2048,Ba(9,{destroy:void 0},my.bind(null,c,x,o,i),null),o},useId:function(){var n=Pt(),i=tt.identifierPrefix;if(Pe){var o=Yn,c=Fn;o=(c&~(1<<32-Qe(c)-1)).toString(32)+o,i="_"+i+"R_"+o,o=ou++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=c2++,i="_"+i+"r_"+o.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:wd,useFormState:_y,useActionState:_y,useOptimistic:function(n){var i=Pt();i.memoizedState=i.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=Sd.bind(null,Re,!0,o),o.dispatch=i,[n,i]},useMemoCache:dd,useCacheRefresh:function(){return Pt().memoizedState=g2.bind(null,Re)},useEffectEvent:function(n){var i=Pt(),o={impl:n};return i.memoizedState=o,function(){if((Ge&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Ed={readContext:Tt,use:uu,useCallback:Ly,useContext:Tt,useEffect:yd,useImperativeHandle:zy,useInsertionEffect:jy,useLayoutEffect:Oy,useMemo:Iy,useReducer:cu,useRef:Ty,useState:function(){return cu(pr)},useDebugValue:xd,useDeferredValue:function(n,i){var o=mt();return By(o,We.memoizedState,n,i)},useTransition:function(){var n=cu(pr)[0],i=mt().memoizedState;return[typeof n=="boolean"?n:Js(n),i]},useSyncExternalStore:hy,useId:Vy,useHostTransitionStatus:wd,useFormState:Ny,useActionState:Ny,useOptimistic:function(n,i){var o=mt();return vy(o,We,n,i)},useMemoCache:dd,useCacheRefresh:qy};Ed.useEffectEvent=Ry;var Xy={readContext:Tt,use:uu,useCallback:Ly,useContext:Tt,useEffect:yd,useImperativeHandle:zy,useInsertionEffect:jy,useLayoutEffect:Oy,useMemo:Iy,useReducer:pd,useRef:Ty,useState:function(){return pd(pr)},useDebugValue:xd,useDeferredValue:function(n,i){var o=mt();return We===null?vd(o,n,i):By(o,We.memoizedState,n,i)},useTransition:function(){var n=pd(pr)[0],i=mt().memoizedState;return[typeof n=="boolean"?n:Js(n),i]},useSyncExternalStore:hy,useId:Vy,useHostTransitionStatus:wd,useFormState:My,useActionState:My,useOptimistic:function(n,i){var o=mt();return We!==null?vy(o,We,n,i):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:dd,useCacheRefresh:qy};Xy.useEffectEvent=Ry;function Cd(n,i,o,c){i=n.memoizedState,o=o(c,i),o=o==null?i:g({},i,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var _d={enqueueSetState:function(n,i,o){n=n._reactInternals;var c=pn(),m=Vr(c);m.payload=i,o!=null&&(m.callback=o),i=qr(n,m,c),i!==null&&(Kt(i,n,c),Qs(i,n,c))},enqueueReplaceState:function(n,i,o){n=n._reactInternals;var c=pn(),m=Vr(c);m.tag=1,m.payload=i,o!=null&&(m.callback=o),i=qr(n,m,c),i!==null&&(Kt(i,n,c),Qs(i,n,c))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var o=pn(),c=Vr(o);c.tag=2,i!=null&&(c.callback=i),i=qr(n,c,o),i!==null&&(Kt(i,n,o),Qs(i,n,o))}};function Qy(n,i,o,c,m,x,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,x,E):i.prototype&&i.prototype.isPureReactComponent?!Us(o,c)||!Us(m,x):!0}function Ky(n,i,o,c){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,c),i.state!==n&&_d.enqueueReplaceState(i,i.state,null)}function Li(n,i){var o=i;if("ref"in i){o={};for(var c in i)c!=="ref"&&(o[c]=i[c])}if(n=n.defaultProps){o===i&&(o=g({},o));for(var m in n)o[m]===void 0&&(o[m]=n[m])}return o}function Zy(n){Yl(n)}function Wy(n){console.error(n)}function Jy(n){Yl(n)}function pu(n,i){try{var o=n.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function e0(n,i,o){try{var c=n.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Nd(n,i,o){return o=Vr(o),o.tag=3,o.payload={element:null},o.callback=function(){pu(n,i)},o}function t0(n){return n=Vr(n),n.tag=3,n}function n0(n,i,o,c){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var x=c.value;n.payload=function(){return m(x)},n.callback=function(){e0(i,o,c)}}var E=o.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){e0(i,o,c),typeof m!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})})}function x2(n,i,o,c,m){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=o.alternate,i!==null&&Aa(i,o,m,!0),o=cn.current,o!==null){switch(o.tag){case 31:case 13:return kn===null?Nu():o.alternate===null&&dt===0&&(dt=3),o.flags&=-257,o.flags|=65536,o.lanes=m,c===tu?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([c]):i.add(c),Zd(n,c,m)),!1;case 22:return o.flags|=65536,c===tu?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([c]):o.add(c)),Zd(n,c,m)),!1}throw Error(a(435,o.tag))}return Zd(n,c,m),Nu(),!1}if(Pe)return i=cn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,c!==Yf&&(n=Error(a(422),{cause:c}),Fs(En(n,o)))):(c!==Yf&&(i=Error(a(423),{cause:c}),Fs(En(i,o))),n=n.current.alternate,n.flags|=65536,m&=-m,n.lanes|=m,c=En(c,o),m=Nd(n.stateNode,c,m),nd(n,m),dt!==4&&(dt=2)),!1;var x=Error(a(520),{cause:c});if(x=En(x,o),uo===null?uo=[x]:uo.push(x),dt!==4&&(dt=2),i===null)return!0;c=En(c,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,n=m&-m,o.lanes|=n,n=Nd(o.stateNode,c,n),nd(o,n),!1;case 1:if(i=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Qr===null||!Qr.has(x))))return o.flags|=65536,m&=-m,o.lanes|=m,m=t0(m),n0(m,n,o,c),nd(o,m),!1}o=o.return}while(o!==null);return!1}var kd=Error(a(461)),vt=!1;function At(n,i,o,c){i.child=n===null?sy(i,null,o,c):Di(i,n.child,o,c)}function r0(n,i,o,c,m){o=o.render;var x=i.ref;if("ref"in c){var E={};for(var O in c)O!=="ref"&&(E[O]=c[O])}else E=c;return Ai(i),c=ld(n,i,o,E,x,m),O=ud(),n!==null&&!vt?(cd(n,i,m),mr(n,i,m)):(Pe&&O&&qf(i),i.flags|=1,At(n,i,c,m),i.child)}function i0(n,i,o,c,m){if(n===null){var x=o.type;return typeof x=="function"&&!Pf(x)&&x.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=x,a0(n,i,x,c,m)):(n=Ql(o.type,null,c,i,i.mode,m),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,!zd(n,m)){var E=x.memoizedProps;if(o=o.compare,o=o!==null?o:Us,o(E,c)&&n.ref===i.ref)return mr(n,i,m)}return i.flags|=1,n=ur(x,c),n.ref=i.ref,n.return=i,i.child=n}function a0(n,i,o,c,m){if(n!==null){var x=n.memoizedProps;if(Us(x,c)&&n.ref===i.ref)if(vt=!1,i.pendingProps=c=x,zd(n,m))(n.flags&131072)!==0&&(vt=!0);else return i.lanes=n.lanes,mr(n,i,m)}return Md(n,i,o,c,m)}function s0(n,i,o,c){var m=c.children,x=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|o:o,n!==null){for(c=i.child=n.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~x}else c=0,i.child=null;return o0(n,i,x,o,c)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Jl(i,x!==null?x.cachePool:null),x!==null?uy(i,x):id(),cy(i);else return c=i.lanes=536870912,o0(n,i,x!==null?x.baseLanes|o:o,o,c)}else x!==null?(Jl(i,x.cachePool),uy(i,x),Yr(),i.memoizedState=null):(n!==null&&Jl(i,null),id(),Yr());return At(n,i,m,o),i.child}function no(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function o0(n,i,o,c,m){var x=Wf();return x=x===null?null:{parent:yt._currentValue,pool:x},i.memoizedState={baseLanes:o,cachePool:x},n!==null&&Jl(i,null),id(),cy(i),n!==null&&Aa(n,i,c,!0),i.childLanes=m,null}function mu(n,i){return i=yu({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function l0(n,i,o){return Di(i,n.child,null,o),n=mu(i,i.pendingProps),n.flags|=2,fn(i),i.memoizedState=null,n}function v2(n,i,o){var c=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Pe){if(c.mode==="hidden")return n=mu(i,c),i.lanes=536870912,no(null,n);if(sd(i),(n=it)?(n=bx(n,Nn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ir!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},o=Yg(n),o.return=i,i.child=o,Mt=i,it=null)):n=null,n===null)throw Hr(i);return i.lanes=536870912,null}return mu(i,c)}var x=n.memoizedState;if(x!==null){var E=x.dehydrated;if(sd(i),m)if(i.flags&256)i.flags&=-257,i=l0(n,i,o);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(vt||Aa(n,i,o,!1),m=(o&n.childLanes)!==0,vt||m){if(c=tt,c!==null&&(E=kl(c,o),E!==0&&E!==x.retryLane))throw x.retryLane=E,Ni(n,E),Kt(c,n,E),kd;Nu(),i=l0(n,i,o)}else n=x.treeContext,it=Mn(E.nextSibling),Mt=i,Pe=!0,Br=null,Nn=!1,n!==null&&Xg(i,n),i=mu(i,c),i.flags|=4096;return i}return n=ur(n.child,{mode:c.mode,children:c.children}),n.ref=i.ref,i.child=n,n.return=i,n}function gu(n,i){var o=i.ref;if(o===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(n===null||n.ref!==o)&&(i.flags|=4194816)}}function Md(n,i,o,c,m){return Ai(i),o=ld(n,i,o,c,void 0,m),c=ud(),n!==null&&!vt?(cd(n,i,m),mr(n,i,m)):(Pe&&c&&qf(i),i.flags|=1,At(n,i,o,m),i.child)}function u0(n,i,o,c,m,x){return Ai(i),i.updateQueue=null,o=dy(i,c,o,m),fy(n),c=ud(),n!==null&&!vt?(cd(n,i,x),mr(n,i,x)):(Pe&&c&&qf(i),i.flags|=1,At(n,i,o,x),i.child)}function c0(n,i,o,c,m){if(Ai(i),i.stateNode===null){var x=Na,E=o.contextType;typeof E=="object"&&E!==null&&(x=Tt(E)),x=new o(c,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=_d,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=c,x.state=i.memoizedState,x.refs={},ed(i),E=o.contextType,x.context=typeof E=="object"&&E!==null?Tt(E):Na,x.state=i.memoizedState,E=o.getDerivedStateFromProps,typeof E=="function"&&(Cd(i,o,E,c),x.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(E=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),E!==x.state&&_d.enqueueReplaceState(x,x.state,null),Zs(i,c,x,m),Ks(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(n===null){x=i.stateNode;var O=i.memoizedProps,G=Li(o,O);x.props=G;var ee=x.context,ae=o.contextType;E=Na,typeof ae=="object"&&ae!==null&&(E=Tt(ae));var oe=o.getDerivedStateFromProps;ae=typeof oe=="function"||typeof x.getSnapshotBeforeUpdate=="function",O=i.pendingProps!==O,ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O||ee!==E)&&Ky(i,x,c,E),Ur=!1;var ne=i.memoizedState;x.state=ne,Zs(i,c,x,m),Ks(),ee=i.memoizedState,O||ne!==ee||Ur?(typeof oe=="function"&&(Cd(i,o,oe,c),ee=i.memoizedState),(G=Ur||Qy(i,o,G,c,ne,ee,E))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=ee),x.props=c,x.state=ee,x.context=E,c=G):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{x=i.stateNode,td(n,i),E=i.memoizedProps,ae=Li(o,E),x.props=ae,oe=i.pendingProps,ne=x.context,ee=o.contextType,G=Na,typeof ee=="object"&&ee!==null&&(G=Tt(ee)),O=o.getDerivedStateFromProps,(ee=typeof O=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(E!==oe||ne!==G)&&Ky(i,x,c,G),Ur=!1,ne=i.memoizedState,x.state=ne,Zs(i,c,x,m),Ks();var re=i.memoizedState;E!==oe||ne!==re||Ur||n!==null&&n.dependencies!==null&&Zl(n.dependencies)?(typeof O=="function"&&(Cd(i,o,O,c),re=i.memoizedState),(ae=Ur||Qy(i,o,ae,c,ne,re,G)||n!==null&&n.dependencies!==null&&Zl(n.dependencies))?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(c,re,G),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(c,re,G)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=re),x.props=c,x.state=re,x.context=G,c=ae):(typeof x.componentDidUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ne===n.memoizedState||(i.flags|=1024),c=!1)}return x=c,gu(n,i),c=(i.flags&128)!==0,x||c?(x=i.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,n!==null&&c?(i.child=Di(i,n.child,null,m),i.child=Di(i,null,o,m)):At(n,i,o,m),i.memoizedState=x.state,n=i.child):n=mr(n,i,m),n}function f0(n,i,o,c){return Mi(),i.flags|=256,At(n,i,o,c),i.child}var Td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(n){return{baseLanes:n,cachePool:ey()}}function Rd(n,i,o){return n=n!==null?n.childLanes&~o:0,i&&(n|=hn),n}function d0(n,i,o){var c=i.pendingProps,m=!1,x=(i.flags&128)!==0,E;if((E=x)||(E=n!==null&&n.memoizedState===null?!1:(pt.current&2)!==0),E&&(m=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(Pe){if(m?Fr(i):Yr(),(n=it)?(n=bx(n,Nn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:Ir!==null?{id:Fn,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},o=Yg(n),o.return=i,i.child=o,Mt=i,it=null)):n=null,n===null)throw Hr(i);return hh(n)?i.lanes=32:i.lanes=536870912,null}var O=c.children;return c=c.fallback,m?(Yr(),m=i.mode,O=yu({mode:"hidden",children:O},m),c=ki(c,m,o,null),O.return=i,c.return=i,O.sibling=c,i.child=O,c=i.child,c.memoizedState=Ad(o),c.childLanes=Rd(n,E,o),i.memoizedState=Td,no(null,c)):(Fr(i),jd(i,O))}var G=n.memoizedState;if(G!==null&&(O=G.dehydrated,O!==null)){if(x)i.flags&256?(Fr(i),i.flags&=-257,i=Od(n,i,o)):i.memoizedState!==null?(Yr(),i.child=n.child,i.flags|=128,i=null):(Yr(),O=c.fallback,m=i.mode,c=yu({mode:"visible",children:c.children},m),O=ki(O,m,o,null),O.flags|=2,c.return=i,O.return=i,c.sibling=O,i.child=c,Di(i,n.child,null,o),c=i.child,c.memoizedState=Ad(o),c.childLanes=Rd(n,E,o),i.memoizedState=Td,i=no(null,c));else if(Fr(i),hh(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var ee=E.dgst;E=ee,c=Error(a(419)),c.stack="",c.digest=E,Fs({value:c,source:null,stack:null}),i=Od(n,i,o)}else if(vt||Aa(n,i,o,!1),E=(o&n.childLanes)!==0,vt||E){if(E=tt,E!==null&&(c=kl(E,o),c!==0&&c!==G.retryLane))throw G.retryLane=c,Ni(n,c),Kt(E,n,c),kd;dh(O)||Nu(),i=Od(n,i,o)}else dh(O)?(i.flags|=192,i.child=n.child,i=null):(n=G.treeContext,it=Mn(O.nextSibling),Mt=i,Pe=!0,Br=null,Nn=!1,n!==null&&Xg(i,n),i=jd(i,c.children),i.flags|=4096);return i}return m?(Yr(),O=c.fallback,m=i.mode,G=n.child,ee=G.sibling,c=ur(G,{mode:"hidden",children:c.children}),c.subtreeFlags=G.subtreeFlags&65011712,ee!==null?O=ur(ee,O):(O=ki(O,m,o,null),O.flags|=2),O.return=i,c.return=i,c.sibling=O,i.child=c,no(null,c),c=i.child,O=n.child.memoizedState,O===null?O=Ad(o):(m=O.cachePool,m!==null?(G=yt._currentValue,m=m.parent!==G?{parent:G,pool:G}:m):m=ey(),O={baseLanes:O.baseLanes|o,cachePool:m}),c.memoizedState=O,c.childLanes=Rd(n,E,o),i.memoizedState=Td,no(n.child,c)):(Fr(i),o=n.child,n=o.sibling,o=ur(o,{mode:"visible",children:c.children}),o.return=i,o.sibling=null,n!==null&&(E=i.deletions,E===null?(i.deletions=[n],i.flags|=16):E.push(n)),i.child=o,i.memoizedState=null,o)}function jd(n,i){return i=yu({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function yu(n,i){return n=un(22,n,null,i),n.lanes=0,n}function Od(n,i,o){return Di(i,n.child,null,o),n=jd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function h0(n,i,o){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i),Xf(n.return,i,o)}function Dd(n,i,o,c,m,x){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:m,treeForkCount:x}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=c,E.tail=o,E.tailMode=m,E.treeForkCount=x)}function p0(n,i,o){var c=i.pendingProps,m=c.revealOrder,x=c.tail;c=c.children;var E=pt.current,O=(E&2)!==0;if(O?(E=E&1|2,i.flags|=128):E&=1,R(pt,E),At(n,i,c,o),c=Pe?qs:0,!O&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&h0(n,o,i);else if(n.tag===19)h0(n,o,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(m){case"forwards":for(o=i.child,m=null;o!==null;)n=o.alternate,n!==null&&au(n)===null&&(m=o),o=o.sibling;o=m,o===null?(m=i.child,i.child=null):(m=o.sibling,o.sibling=null),Dd(i,!1,m,o,x,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=i.child,i.child=null;m!==null;){if(n=m.alternate,n!==null&&au(n)===null){i.child=m;break}n=m.sibling,m.sibling=o,o=m,m=n}Dd(i,!0,o,null,x,c);break;case"together":Dd(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function mr(n,i,o){if(n!==null&&(i.dependencies=n.dependencies),Xr|=i.lanes,(o&i.childLanes)===0)if(n!==null){if(Aa(n,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,o=ur(n,n.pendingProps),i.child=o,o.return=i;n.sibling!==null;)n=n.sibling,o=o.sibling=ur(n,n.pendingProps),o.return=i;o.sibling=null}return i.child}function zd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Zl(n)))}function b2(n,i,o){switch(i.tag){case 3:le(i,i.stateNode.containerInfo),Pr(i,yt,n.memoizedState.cache),Mi();break;case 27:case 5:we(i);break;case 4:le(i,i.stateNode.containerInfo);break;case 10:Pr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,sd(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(Fr(i),i.flags|=128,null):(o&i.child.childLanes)!==0?d0(n,i,o):(Fr(i),n=mr(n,i,o),n!==null?n.sibling:null);Fr(i);break;case 19:var m=(n.flags&128)!==0;if(c=(o&i.childLanes)!==0,c||(Aa(n,i,o,!1),c=(o&i.childLanes)!==0),m){if(c)return p0(n,i,o);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),R(pt,pt.current),c)break;return null;case 22:return i.lanes=0,s0(n,i,o,i.pendingProps);case 24:Pr(i,yt,n.memoizedState.cache)}return mr(n,i,o)}function m0(n,i,o){if(n!==null)if(n.memoizedProps!==i.pendingProps)vt=!0;else{if(!zd(n,o)&&(i.flags&128)===0)return vt=!1,b2(n,i,o);vt=(n.flags&131072)!==0}else vt=!1,Pe&&(i.flags&1048576)!==0&&Gg(i,qs,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(n=ji(i.elementType),i.type=n,typeof n=="function")Pf(n)?(c=Li(n,c),i.tag=1,i=c0(null,i,n,c,o)):(i.tag=0,i=Md(null,i,n,c,o));else{if(n!=null){var m=n.$$typeof;if(m===k){i.tag=11,i=r0(null,i,n,c,o);break e}else if(m===D){i.tag=14,i=i0(null,i,n,c,o);break e}}throw i=L(n)||n,Error(a(306,i,""))}}return i;case 0:return Md(n,i,i.type,i.pendingProps,o);case 1:return c=i.type,m=Li(c,i.pendingProps),c0(n,i,c,m,o);case 3:e:{if(le(i,i.stateNode.containerInfo),n===null)throw Error(a(387));c=i.pendingProps;var x=i.memoizedState;m=x.element,td(n,i),Zs(i,c,null,o);var E=i.memoizedState;if(c=E.cache,Pr(i,yt,c),c!==x.cache&&Qf(i,[yt],o,!0),Ks(),c=E.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=f0(n,i,c,o);break e}else if(c!==m){m=En(Error(a(424)),i),Fs(m),i=f0(n,i,c,o);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,it=Mn(n.firstChild),Mt=i,Pe=!0,Br=null,Nn=!0,o=sy(i,null,c,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Mi(),c===m){i=mr(n,i,o);break e}At(n,i,c,o)}i=i.child}return i;case 26:return gu(n,i),n===null?(o=Nx(i.type,null,i.pendingProps,null))?i.memoizedState=o:Pe||(o=i.type,n=i.pendingProps,c=Ou(fe.current).createElement(o),c[Et]=i,c[zt]=n,Rt(c,o,n),gt(c),i.stateNode=c):i.memoizedState=Nx(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return we(i),n===null&&Pe&&(c=i.stateNode=Ex(i.type,i.pendingProps,fe.current),Mt=i,Nn=!0,m=it,Jr(i.type)?(ph=m,it=Mn(c.firstChild)):it=m),At(n,i,i.pendingProps.children,o),gu(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Pe&&((m=c=it)&&(c=K2(c,i.type,i.pendingProps,Nn),c!==null?(i.stateNode=c,Mt=i,it=Mn(c.firstChild),Nn=!1,m=!0):m=!1),m||Hr(i)),we(i),m=i.type,x=i.pendingProps,E=n!==null?n.memoizedProps:null,c=x.children,uh(m,x)?c=null:E!==null&&uh(m,E)&&(i.flags|=32),i.memoizedState!==null&&(m=ld(n,i,f2,null,null,o),xo._currentValue=m),gu(n,i),At(n,i,c,o),i.child;case 6:return n===null&&Pe&&((n=o=it)&&(o=Z2(o,i.pendingProps,Nn),o!==null?(i.stateNode=o,Mt=i,it=null,n=!0):n=!1),n||Hr(i)),null;case 13:return d0(n,i,o);case 4:return le(i,i.stateNode.containerInfo),c=i.pendingProps,n===null?i.child=Di(i,null,c,o):At(n,i,c,o),i.child;case 11:return r0(n,i,i.type,i.pendingProps,o);case 7:return At(n,i,i.pendingProps,o),i.child;case 8:return At(n,i,i.pendingProps.children,o),i.child;case 12:return At(n,i,i.pendingProps.children,o),i.child;case 10:return c=i.pendingProps,Pr(i,i.type,c.value),At(n,i,c.children,o),i.child;case 9:return m=i.type._context,c=i.pendingProps.children,Ai(i),m=Tt(m),c=c(m),i.flags|=1,At(n,i,c,o),i.child;case 14:return i0(n,i,i.type,i.pendingProps,o);case 15:return a0(n,i,i.type,i.pendingProps,o);case 19:return p0(n,i,o);case 31:return v2(n,i,o);case 22:return s0(n,i,o,i.pendingProps);case 24:return Ai(i),c=Tt(yt),n===null?(m=Wf(),m===null&&(m=tt,x=Kf(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=o),m=x),i.memoizedState={parent:c,cache:m},ed(i),Pr(i,yt,m)):((n.lanes&o)!==0&&(td(n,i),Zs(i,null,null,o),Ks()),m=n.memoizedState,x=i.memoizedState,m.parent!==c?(m={parent:c,cache:c},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),Pr(i,yt,c)):(c=x.cache,Pr(i,yt,c),c!==m.cache&&Qf(i,[yt],o,!0))),At(n,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function gr(n){n.flags|=4}function Ld(n,i,o,c,m){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(m&335544128)===m)if(n.stateNode.complete)n.flags|=8192;else if(V0())n.flags|=8192;else throw Oi=tu,Jf}else n.flags&=-16777217}function g0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Rx(i))if(V0())n.flags|=8192;else throw Oi=tu,Jf}function xu(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?Cl():536870912,n.lanes|=i,Va|=i)}function ro(n,i){if(!Pe)switch(n.tailMode){case"hidden":i=n.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function at(n){var i=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(i)for(var m=n.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=n,m=m.sibling;else for(m=n.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=n,m=m.sibling;return n.subtreeFlags|=c,n.childLanes=o,i}function w2(n,i,o){var c=i.pendingProps;switch(Ff(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(i),null;case 1:return at(i),null;case 3:return o=i.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),dr(yt),pe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Ta(i)?gr(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,$f())),at(i),null;case 26:var m=i.type,x=i.memoizedState;return n===null?(gr(i),x!==null?(at(i),g0(i,x)):(at(i),Ld(i,m,null,c,o))):x?x!==n.memoizedState?(gr(i),at(i),g0(i,x)):(at(i),i.flags&=-16777217):(n=n.memoizedProps,n!==c&&gr(i),at(i),Ld(i,m,n,c,o)),null;case 27:if(Ee(i),o=fe.current,m=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return at(i),null}n=te.current,Ta(i)?Qg(i):(n=Ex(m,c,o),i.stateNode=n,gr(i))}return at(i),null;case 5:if(Ee(i),m=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(!c){if(i.stateNode===null)throw Error(a(166));return at(i),null}if(x=te.current,Ta(i))Qg(i);else{var E=Ou(fe.current);switch(x){case 1:x=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=E.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof c.is=="string"?E.createElement("select",{is:c.is}):E.createElement("select"),c.multiple?x.multiple=!0:c.size&&(x.size=c.size);break;default:x=typeof c.is=="string"?E.createElement(m,{is:c.is}):E.createElement(m)}}x[Et]=i,x[zt]=c;e:for(E=i.child;E!==null;){if(E.tag===5||E.tag===6)x.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===i)break e;for(;E.sibling===null;){if(E.return===null||E.return===i)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}i.stateNode=x;e:switch(Rt(x,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gr(i)}}return at(i),Ld(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,o),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==c&&gr(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,Ta(i)){if(n=i.stateNode,o=i.memoizedProps,c=null,m=Mt,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}n[Et]=i,n=!!(n.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||dx(n.nodeValue,o)),n||Hr(i,!0)}else n=Ou(n).createTextNode(c),n[Et]=i,i.stateNode=n}return at(i),null;case 31:if(o=i.memoizedState,n===null||n.memoizedState!==null){if(c=Ta(i),o!==null){if(n===null){if(!c)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;at(i),n=!1}else o=$f(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return i.flags&256?(fn(i),i):(fn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return at(i),null;case 13:if(c=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(m=Ta(i),c!==null&&c.dehydrated!==null){if(n===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[Et]=i}else Mi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;at(i),m=!1}else m=$f(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(fn(i),i):(fn(i),null)}return fn(i),(i.flags&128)!==0?(i.lanes=o,i):(o=c!==null,n=n!==null&&n.memoizedState!==null,o&&(c=i.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==m&&(c.flags|=2048)),o!==n&&o&&(i.child.flags|=8192),xu(i,i.updateQueue),at(i),null);case 4:return pe(),n===null&&ih(i.stateNode.containerInfo),at(i),null;case 10:return dr(i.type),at(i),null;case 19:if($(pt),c=i.memoizedState,c===null)return at(i),null;if(m=(i.flags&128)!==0,x=c.rendering,x===null)if(m)ro(c,!1);else{if(dt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(x=au(n),x!==null){for(i.flags|=128,ro(c,!1),n=x.updateQueue,i.updateQueue=n,xu(i,n),i.subtreeFlags=0,n=o,o=i.child;o!==null;)Fg(o,n),o=o.sibling;return R(pt,pt.current&1|2),Pe&&cr(i,c.treeForkCount),i.child}n=n.sibling}c.tail!==null&&Te()>Eu&&(i.flags|=128,m=!0,ro(c,!1),i.lanes=4194304)}else{if(!m)if(n=au(x),n!==null){if(i.flags|=128,m=!0,n=n.updateQueue,i.updateQueue=n,xu(i,n),ro(c,!0),c.tail===null&&c.tailMode==="hidden"&&!x.alternate&&!Pe)return at(i),null}else 2*Te()-c.renderingStartTime>Eu&&o!==536870912&&(i.flags|=128,m=!0,ro(c,!1),i.lanes=4194304);c.isBackwards?(x.sibling=i.child,i.child=x):(n=c.last,n!==null?n.sibling=x:i.child=x,c.last=x)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Te(),n.sibling=null,o=pt.current,R(pt,m?o&1|2:o&1),Pe&&cr(i,c.treeForkCount),n):(at(i),null);case 22:case 23:return fn(i),ad(),c=i.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(o&536870912)!==0&&(i.flags&128)===0&&(at(i),i.subtreeFlags&6&&(i.flags|=8192)):at(i),o=i.updateQueue,o!==null&&xu(i,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048),n!==null&&$(Ri),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),dr(yt),at(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function S2(n,i){switch(Ff(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return dr(yt),pe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Ee(i),null;case 31:if(i.memoizedState!==null){if(fn(i),i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(fn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Mi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return $(pt),null;case 4:return pe(),null;case 10:return dr(i.type),null;case 22:case 23:return fn(i),ad(),n!==null&&$(Ri),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return dr(yt),null;case 25:return null;default:return null}}function y0(n,i){switch(Ff(i),i.tag){case 3:dr(yt),pe();break;case 26:case 27:case 5:Ee(i);break;case 4:pe();break;case 31:i.memoizedState!==null&&fn(i);break;case 13:fn(i);break;case 19:$(pt);break;case 10:dr(i.type);break;case 22:case 23:fn(i),ad(),n!==null&&$(Ri);break;case 24:dr(yt)}}function io(n,i){try{var o=i.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var m=c.next;o=m;do{if((o.tag&n)===n){c=void 0;var x=o.create,E=o.inst;c=x(),E.destroy=c}o=o.next}while(o!==m)}}catch(O){Ze(i,i.return,O)}}function $r(n,i,o){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var x=m.next;c=x;do{if((c.tag&n)===n){var E=c.inst,O=E.destroy;if(O!==void 0){E.destroy=void 0,m=i;var G=o,ee=O;try{ee()}catch(ae){Ze(m,G,ae)}}}c=c.next}while(c!==x)}}catch(ae){Ze(i,i.return,ae)}}function x0(n){var i=n.updateQueue;if(i!==null){var o=n.stateNode;try{ly(i,o)}catch(c){Ze(n,n.return,c)}}}function v0(n,i,o){o.props=Li(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(c){Ze(n,i,c)}}function ao(n,i){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof o=="function"?n.refCleanup=o(c):o.current=c}}catch(m){Ze(n,i,m)}}function $n(n,i){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(m){Ze(n,i,m)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){Ze(n,i,m)}else o.current=null}function b0(n){var i=n.type,o=n.memoizedProps,c=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(m){Ze(n,n.return,m)}}function Id(n,i,o){try{var c=n.stateNode;F2(c,n.type,o,i),c[zt]=i}catch(m){Ze(n,n.return,m)}}function w0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Jr(n.type)||n.tag===4}function Bd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||w0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Jr(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hd(n,i,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(n),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=or));else if(c!==4&&(c===27&&Jr(n.type)&&(o=n.stateNode,i=null),n=n.child,n!==null))for(Hd(n,i,o),n=n.sibling;n!==null;)Hd(n,i,o),n=n.sibling}function vu(n,i,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?o.insertBefore(n,i):o.appendChild(n);else if(c!==4&&(c===27&&Jr(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(vu(n,i,o),n=n.sibling;n!==null;)vu(n,i,o),n=n.sibling}function S0(n){var i=n.stateNode,o=n.memoizedProps;try{for(var c=n.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Rt(i,c,o),i[Et]=n,i[zt]=o}catch(x){Ze(n,n.return,x)}}var yr=!1,bt=!1,Pd=!1,E0=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function E2(n,i){if(n=n.containerInfo,oh=Pu,n=zg(n),Of(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var m=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var E=0,O=-1,G=-1,ee=0,ae=0,oe=n,ne=null;t:for(;;){for(var re;oe!==o||m!==0&&oe.nodeType!==3||(O=E+m),oe!==x||c!==0&&oe.nodeType!==3||(G=E+c),oe.nodeType===3&&(E+=oe.nodeValue.length),(re=oe.firstChild)!==null;)ne=oe,oe=re;for(;;){if(oe===n)break t;if(ne===o&&++ee===m&&(O=E),ne===x&&++ae===c&&(G=E),(re=oe.nextSibling)!==null)break;oe=ne,ne=oe.parentNode}oe=re}o=O===-1||G===-1?null:{start:O,end:G}}else o=null}o=o||{start:0,end:0}}else o=null;for(lh={focusedElem:n,selectionRange:o},Pu=!1,Nt=i;Nt!==null;)if(i=Nt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Nt=n;else for(;Nt!==null;){switch(i=Nt,x=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)m=n[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,o=i,m=x.memoizedProps,x=x.memoizedState,c=o.stateNode;try{var ye=Li(o.type,m);n=c.getSnapshotBeforeUpdate(ye,x),c.__reactInternalSnapshotBeforeUpdate=n}catch(ke){Ze(o,o.return,ke)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,o=n.nodeType,o===9)fh(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":fh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Nt=n;break}Nt=i.return}}function C0(n,i,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:vr(n,o),c&4&&io(5,o);break;case 1:if(vr(n,o),c&4)if(n=o.stateNode,i===null)try{n.componentDidMount()}catch(E){Ze(o,o.return,E)}else{var m=Li(o.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(m,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){Ze(o,o.return,E)}}c&64&&x0(o),c&512&&ao(o,o.return);break;case 3:if(vr(n,o),c&64&&(n=o.updateQueue,n!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{ly(n,i)}catch(E){Ze(o,o.return,E)}}break;case 27:i===null&&c&4&&S0(o);case 26:case 5:vr(n,o),i===null&&c&4&&b0(o),c&512&&ao(o,o.return);break;case 12:vr(n,o);break;case 31:vr(n,o),c&4&&k0(n,o);break;case 13:vr(n,o),c&4&&M0(n,o),c&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=j2.bind(null,o),W2(n,o))));break;case 22:if(c=o.memoizedState!==null||yr,!c){i=i!==null&&i.memoizedState!==null||bt,m=yr;var x=bt;yr=c,(bt=i)&&!x?br(n,o,(o.subtreeFlags&8772)!==0):vr(n,o),yr=m,bt=x}break;case 30:break;default:vr(n,o)}}function _0(n){var i=n.alternate;i!==null&&(n.alternate=null,_0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Rs(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var st=null,$t=!1;function xr(n,i,o){for(o=o.child;o!==null;)N0(n,i,o),o=o.sibling}function N0(n,i,o){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(kt,o)}catch{}switch(o.tag){case 26:bt||$n(o,i),xr(n,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:bt||$n(o,i);var c=st,m=$t;Jr(o.type)&&(st=o.stateNode,$t=!1),xr(n,i,o),mo(o.stateNode),st=c,$t=m;break;case 5:bt||$n(o,i);case 6:if(c=st,m=$t,st=null,xr(n,i,o),st=c,$t=m,st!==null)if($t)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(o.stateNode)}catch(x){Ze(o,i,x)}else try{st.removeChild(o.stateNode)}catch(x){Ze(o,i,x)}break;case 18:st!==null&&($t?(n=st,xx(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),Ka(n)):xx(st,o.stateNode));break;case 4:c=st,m=$t,st=o.stateNode.containerInfo,$t=!0,xr(n,i,o),st=c,$t=m;break;case 0:case 11:case 14:case 15:$r(2,o,i),bt||$r(4,o,i),xr(n,i,o);break;case 1:bt||($n(o,i),c=o.stateNode,typeof c.componentWillUnmount=="function"&&v0(o,i,c)),xr(n,i,o);break;case 21:xr(n,i,o);break;case 22:bt=(c=bt)||o.memoizedState!==null,xr(n,i,o),bt=c;break;default:xr(n,i,o)}}function k0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Ka(n)}catch(o){Ze(i,i.return,o)}}}function M0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Ka(n)}catch(o){Ze(i,i.return,o)}}function C2(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new E0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new E0),i;default:throw Error(a(435,n.tag))}}function bu(n,i){var o=C2(n);i.forEach(function(c){if(!o.has(c)){o.add(c);var m=O2.bind(null,n,c);c.then(m,m)}})}function Gt(n,i){var o=i.deletions;if(o!==null)for(var c=0;c<o.length;c++){var m=o[c],x=n,E=i,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(Jr(O.type)){st=O.stateNode,$t=!1;break e}break;case 5:st=O.stateNode,$t=!1;break e;case 3:case 4:st=O.stateNode.containerInfo,$t=!0;break e}O=O.return}if(st===null)throw Error(a(160));N0(x,E,m),st=null,$t=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)T0(i,n),i=i.sibling}var zn=null;function T0(n,i){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(i,n),Xt(n),c&4&&($r(3,n,n.return),io(3,n),$r(5,n,n.return));break;case 1:Gt(i,n),Xt(n),c&512&&(bt||o===null||$n(o,o.return)),c&64&&yr&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var m=zn;if(Gt(i,n),Xt(n),c&512&&(bt||o===null||$n(o,o.return)),c&4){var x=o!==null?o.memoizedState:null;if(c=n.memoizedState,o===null)if(c===null)if(n.stateNode===null){e:{c=n.type,o=n.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":x=m.getElementsByTagName("title")[0],(!x||x[bi]||x[Et]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(c),m.head.insertBefore(x,m.querySelector("head > title"))),Rt(x,c,o),x[Et]=n,gt(x),c=x;break e;case"link":var E=Tx("link","href",m).get(c+(o.href||""));if(E){for(var O=0;O<E.length;O++)if(x=E[O],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){E.splice(O,1);break t}}x=m.createElement(c),Rt(x,c,o),m.head.appendChild(x);break;case"meta":if(E=Tx("meta","content",m).get(c+(o.content||""))){for(O=0;O<E.length;O++)if(x=E[O],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){E.splice(O,1);break t}}x=m.createElement(c),Rt(x,c,o),m.head.appendChild(x);break;default:throw Error(a(468,c))}x[Et]=n,gt(x),c=x}n.stateNode=c}else Ax(m,n.type,n.stateNode);else n.stateNode=Mx(m,c,n.memoizedProps);else x!==c?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,c===null?Ax(m,n.type,n.stateNode):Mx(m,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Id(n,n.memoizedProps,o.memoizedProps)}break;case 27:Gt(i,n),Xt(n),c&512&&(bt||o===null||$n(o,o.return)),o!==null&&c&4&&Id(n,n.memoizedProps,o.memoizedProps);break;case 5:if(Gt(i,n),Xt(n),c&512&&(bt||o===null||$n(o,o.return)),n.flags&32){m=n.stateNode;try{va(m,"")}catch(ye){Ze(n,n.return,ye)}}c&4&&n.stateNode!=null&&(m=n.memoizedProps,Id(n,m,o!==null?o.memoizedProps:m)),c&1024&&(Pd=!0);break;case 6:if(Gt(i,n),Xt(n),c&4){if(n.stateNode===null)throw Error(a(162));c=n.memoizedProps,o=n.stateNode;try{o.nodeValue=c}catch(ye){Ze(n,n.return,ye)}}break;case 3:if(Lu=null,m=zn,zn=Du(i.containerInfo),Gt(i,n),zn=m,Xt(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Ka(i.containerInfo)}catch(ye){Ze(n,n.return,ye)}Pd&&(Pd=!1,A0(n));break;case 4:c=zn,zn=Du(n.stateNode.containerInfo),Gt(i,n),Xt(n),zn=c;break;case 12:Gt(i,n),Xt(n);break;case 31:Gt(i,n),Xt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,bu(n,c)));break;case 13:Gt(i,n),Xt(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Su=Te()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,bu(n,c)));break;case 22:m=n.memoizedState!==null;var G=o!==null&&o.memoizedState!==null,ee=yr,ae=bt;if(yr=ee||m,bt=ae||G,Gt(i,n),bt=ae,yr=ee,Xt(n),c&8192)e:for(i=n.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(o===null||G||yr||bt||Ii(n)),o=null,i=n;;){if(i.tag===5||i.tag===26){if(o===null){G=o=i;try{if(x=G.stateNode,m)E=x.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=G.stateNode;var oe=G.memoizedProps.style,ne=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ye){Ze(G,G.return,ye)}}}else if(i.tag===6){if(o===null){G=i;try{G.stateNode.nodeValue=m?"":G.memoizedProps}catch(ye){Ze(G,G.return,ye)}}}else if(i.tag===18){if(o===null){G=i;try{var re=G.stateNode;m?vx(re,!0):vx(G.stateNode,!1)}catch(ye){Ze(G,G.return,ye)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=n.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,bu(n,o))));break;case 19:Gt(i,n),Xt(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,bu(n,c)));break;case 30:break;case 21:break;default:Gt(i,n),Xt(n)}}function Xt(n){var i=n.flags;if(i&2){try{for(var o,c=n.return;c!==null;){if(w0(c)){o=c;break}c=c.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var m=o.stateNode,x=Bd(n);vu(n,x,m);break;case 5:var E=o.stateNode;o.flags&32&&(va(E,""),o.flags&=-33);var O=Bd(n);vu(n,O,E);break;case 3:case 4:var G=o.stateNode.containerInfo,ee=Bd(n);Hd(n,ee,G);break;default:throw Error(a(161))}}catch(ae){Ze(n,n.return,ae)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function A0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;A0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function vr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)C0(n,i.alternate,i),i=i.sibling}function Ii(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:$r(4,i,i.return),Ii(i);break;case 1:$n(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&v0(i,i.return,o),Ii(i);break;case 27:mo(i.stateNode);case 26:case 5:$n(i,i.return),Ii(i);break;case 22:i.memoizedState===null&&Ii(i);break;case 30:Ii(i);break;default:Ii(i)}n=n.sibling}}function br(n,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,m=n,x=i,E=x.flags;switch(x.tag){case 0:case 11:case 15:br(m,x,o),io(4,x);break;case 1:if(br(m,x,o),c=x,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ee){Ze(c,c.return,ee)}if(c=x,m=c.updateQueue,m!==null){var O=c.stateNode;try{var G=m.shared.hiddenCallbacks;if(G!==null)for(m.shared.hiddenCallbacks=null,m=0;m<G.length;m++)oy(G[m],O)}catch(ee){Ze(c,c.return,ee)}}o&&E&64&&x0(x),ao(x,x.return);break;case 27:S0(x);case 26:case 5:br(m,x,o),o&&c===null&&E&4&&b0(x),ao(x,x.return);break;case 12:br(m,x,o);break;case 31:br(m,x,o),o&&E&4&&k0(m,x);break;case 13:br(m,x,o),o&&E&4&&M0(m,x);break;case 22:x.memoizedState===null&&br(m,x,o),ao(x,x.return);break;case 30:break;default:br(m,x,o)}i=i.sibling}}function Ud(n,i){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Ys(o))}function Vd(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Ys(n))}function Ln(n,i,o,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)R0(n,i,o,c),i=i.sibling}function R0(n,i,o,c){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Ln(n,i,o,c),m&2048&&io(9,i);break;case 1:Ln(n,i,o,c);break;case 3:Ln(n,i,o,c),m&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&Ys(n)));break;case 12:if(m&2048){Ln(n,i,o,c),n=i.stateNode;try{var x=i.memoizedProps,E=x.id,O=x.onPostCommit;typeof O=="function"&&O(E,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(G){Ze(i,i.return,G)}}else Ln(n,i,o,c);break;case 31:Ln(n,i,o,c);break;case 13:Ln(n,i,o,c);break;case 23:break;case 22:x=i.stateNode,E=i.alternate,i.memoizedState!==null?x._visibility&2?Ln(n,i,o,c):so(n,i):x._visibility&2?Ln(n,i,o,c):(x._visibility|=2,Ha(n,i,o,c,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Ud(E,i);break;case 24:Ln(n,i,o,c),m&2048&&Vd(i.alternate,i);break;default:Ln(n,i,o,c)}}function Ha(n,i,o,c,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=n,E=i,O=o,G=c,ee=E.flags;switch(E.tag){case 0:case 11:case 15:Ha(x,E,O,G,m),io(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?Ha(x,E,O,G,m):so(x,E):(ae._visibility|=2,Ha(x,E,O,G,m)),m&&ee&2048&&Ud(E.alternate,E);break;case 24:Ha(x,E,O,G,m),m&&ee&2048&&Vd(E.alternate,E);break;default:Ha(x,E,O,G,m)}i=i.sibling}}function so(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=n,c=i,m=c.flags;switch(c.tag){case 22:so(o,c),m&2048&&Ud(c.alternate,c);break;case 24:so(o,c),m&2048&&Vd(c.alternate,c);break;default:so(o,c)}i=i.sibling}}var oo=8192;function Pa(n,i,o){if(n.subtreeFlags&oo)for(n=n.child;n!==null;)j0(n,i,o),n=n.sibling}function j0(n,i,o){switch(n.tag){case 26:Pa(n,i,o),n.flags&oo&&n.memoizedState!==null&&c_(o,zn,n.memoizedState,n.memoizedProps);break;case 5:Pa(n,i,o);break;case 3:case 4:var c=zn;zn=Du(n.stateNode.containerInfo),Pa(n,i,o),zn=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=oo,oo=16777216,Pa(n,i,o),oo=c):Pa(n,i,o));break;default:Pa(n,i,o)}}function O0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function lo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];Nt=c,z0(c,n)}O0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)D0(n),n=n.sibling}function D0(n){switch(n.tag){case 0:case 11:case 15:lo(n),n.flags&2048&&$r(9,n,n.return);break;case 3:lo(n);break;case 12:lo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,wu(n)):lo(n);break;default:lo(n)}}function wu(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var c=i[o];Nt=c,z0(c,n)}O0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:$r(8,i,i.return),wu(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,wu(i));break;default:wu(i)}n=n.sibling}}function z0(n,i){for(;Nt!==null;){var o=Nt;switch(o.tag){case 0:case 11:case 15:$r(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ys(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Nt=c;else e:for(o=n;Nt!==null;){c=Nt;var m=c.sibling,x=c.return;if(_0(c),c===o){Nt=null;break e}if(m!==null){m.return=x,Nt=m;break e}Nt=x}}}var _2={getCacheForType:function(n){var i=Tt(yt),o=i.data.get(n);return o===void 0&&(o=n(),i.data.set(n,o)),o},cacheSignal:function(){return Tt(yt).controller.signal}},N2=typeof WeakMap=="function"?WeakMap:Map,Ge=0,tt=null,Le=null,Be=0,Ke=0,dn=null,Gr=!1,Ua=!1,qd=!1,wr=0,dt=0,Xr=0,Bi=0,Fd=0,hn=0,Va=0,uo=null,Qt=null,Yd=!1,Su=0,L0=0,Eu=1/0,Cu=null,Qr=null,Ct=0,Kr=null,qa=null,Sr=0,$d=0,Gd=null,I0=null,co=0,Xd=null;function pn(){return(Ge&2)!==0&&Be!==0?Be&-Be:T.T!==null?eh():Ml()}function B0(){if(hn===0)if((Be&536870912)===0||Pe){var n=da;da<<=1,(da&3932160)===0&&(da=262144),hn=n}else hn=536870912;return n=cn.current,n!==null&&(n.flags|=32),hn}function Kt(n,i,o){(n===tt&&(Ke===2||Ke===9)||n.cancelPendingCommit!==null)&&(Fa(n,0),Zr(n,Be,hn,!1)),vi(n,o),((Ge&2)===0||n!==tt)&&(n===tt&&((Ge&2)===0&&(Bi|=o),dt===4&&Zr(n,Be,hn,!1)),Gn(n))}function H0(n,i,o){if((Ge&6)!==0)throw Error(a(327));var c=!o&&(i&127)===0&&(i&n.expiredLanes)===0||xi(n,i),m=c?T2(n,i):Kd(n,i,!0),x=c;do{if(m===0){Ua&&!c&&Zr(n,i,0,!1);break}else{if(o=n.current.alternate,x&&!k2(o)){m=Kd(n,i,!1),x=!1;continue}if(m===2){if(x=i,n.errorRecoveryDisabledLanes&x)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var O=n;m=uo;var G=O.current.memoizedState.isDehydrated;if(G&&(Fa(O,E).flags|=256),E=Kd(O,E,!1),E!==2){if(qd&&!G){O.errorRecoveryDisabledLanes|=x,Bi|=x,m=4;break e}x=Qt,Qt=m,x!==null&&(Qt===null?Qt=x:Qt.push.apply(Qt,x))}m=E}if(x=!1,m!==2)continue}}if(m===1){Fa(n,0),Zr(n,i,0,!0);break}e:{switch(c=n,x=m,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Zr(c,i,hn,!Gr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(m=Su+300-Te(),10<m)){if(Zr(c,i,hn,!Gr),pa(c,0,!0)!==0)break e;Sr=i,c.timeoutHandle=gx(P0.bind(null,c,o,Qt,Cu,Yd,i,hn,Bi,Va,Gr,x,"Throttled",-0,0),m);break e}P0(c,o,Qt,Cu,Yd,i,hn,Bi,Va,Gr,x,null,-0,0)}}break}while(!0);Gn(n)}function P0(n,i,o,c,m,x,E,O,G,ee,ae,oe,ne,re){if(n.timeoutHandle=-1,oe=i.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:or},j0(i,x,oe);var ye=(x&62914560)===x?Su-Te():(x&4194048)===x?L0-Te():0;if(ye=f_(oe,ye),ye!==null){Sr=x,n.cancelPendingCommit=ye(X0.bind(null,n,i,x,o,c,m,E,O,G,ae,oe,null,ne,re)),Zr(n,x,E,!ee);return}}X0(n,i,x,o,c,m,E,O,G)}function k2(n){for(var i=n;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var m=o[c],x=m.getSnapshot;m=m.value;try{if(!ln(x(),m))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Zr(n,i,o,c){i&=~Fd,i&=~Bi,n.suspendedLanes|=i,n.pingedLanes&=~i,c&&(n.warmLanes|=i),c=n.expirationTimes;for(var m=i;0<m;){var x=31-Qe(m),E=1<<x;c[x]=-1,m&=~E}o!==0&&_l(n,o,i)}function _u(){return(Ge&6)===0?(fo(0),!1):!0}function Qd(){if(Le!==null){if(Ke===0)var n=Le.return;else n=Le,fr=Ti=null,fd(n),Da=null,Gs=0,n=Le;for(;n!==null;)y0(n.alternate,n),n=n.return;Le=null}}function Fa(n,i){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,G2(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Sr=0,Qd(),tt=n,Le=o=ur(n.current,null),Be=i,Ke=0,dn=null,Gr=!1,Ua=xi(n,i),qd=!1,Va=hn=Fd=Bi=Xr=dt=0,Qt=uo=null,Yd=!1,(i&8)!==0&&(i|=i&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=i;0<c;){var m=31-Qe(c),x=1<<m;i|=n[m],c&=~x}return wr=i,$l(),o}function U0(n,i){Re=null,T.H=to,i===Oa||i===eu?(i=ry(),Ke=3):i===Jf?(i=ry(),Ke=4):Ke=i===kd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,dn=i,Le===null&&(dt=1,pu(n,En(i,n.current)))}function V0(){var n=cn.current;return n===null?!0:(Be&4194048)===Be?kn===null:(Be&62914560)===Be||(Be&536870912)!==0?n===kn:!1}function q0(){var n=T.H;return T.H=to,n===null?to:n}function F0(){var n=T.A;return T.A=_2,n}function Nu(){dt=4,Gr||(Be&4194048)!==Be&&cn.current!==null||(Ua=!0),(Xr&134217727)===0&&(Bi&134217727)===0||tt===null||Zr(tt,Be,hn,!1)}function Kd(n,i,o){var c=Ge;Ge|=2;var m=q0(),x=F0();(tt!==n||Be!==i)&&(Cu=null,Fa(n,i)),i=!1;var E=dt;e:do try{if(Ke!==0&&Le!==null){var O=Le,G=dn;switch(Ke){case 8:Qd(),E=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(i=!0);var ee=Ke;if(Ke=0,dn=null,Ya(n,O,G,ee),o&&Ua){E=0;break e}break;default:ee=Ke,Ke=0,dn=null,Ya(n,O,G,ee)}}M2(),E=dt;break}catch(ae){U0(n,ae)}while(!0);return i&&n.shellSuspendCounter++,fr=Ti=null,Ge=c,T.H=m,T.A=x,Le===null&&(tt=null,Be=0,$l()),E}function M2(){for(;Le!==null;)Y0(Le)}function T2(n,i){var o=Ge;Ge|=2;var c=q0(),m=F0();tt!==n||Be!==i?(Cu=null,Eu=Te()+500,Fa(n,i)):Ua=xi(n,i);e:do try{if(Ke!==0&&Le!==null){i=Le;var x=dn;t:switch(Ke){case 1:Ke=0,dn=null,Ya(n,i,x,1);break;case 2:case 9:if(ty(x)){Ke=0,dn=null,$0(i);break}i=function(){Ke!==2&&Ke!==9||tt!==n||(Ke=7),Gn(n)},x.then(i,i);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:ty(x)?(Ke=0,dn=null,$0(i)):(Ke=0,dn=null,Ya(n,i,x,7));break;case 5:var E=null;switch(Le.tag){case 26:E=Le.memoizedState;case 5:case 27:var O=Le;if(E?Rx(E):O.stateNode.complete){Ke=0,dn=null;var G=O.sibling;if(G!==null)Le=G;else{var ee=O.return;ee!==null?(Le=ee,ku(ee)):Le=null}break t}}Ke=0,dn=null,Ya(n,i,x,5);break;case 6:Ke=0,dn=null,Ya(n,i,x,6);break;case 8:Qd(),dt=6;break e;default:throw Error(a(462))}}A2();break}catch(ae){U0(n,ae)}while(!0);return fr=Ti=null,T.H=c,T.A=m,Ge=o,Le!==null?0:(tt=null,Be=0,$l(),dt)}function A2(){for(;Le!==null&&!sn();)Y0(Le)}function Y0(n){var i=m0(n.alternate,n,wr);n.memoizedProps=n.pendingProps,i===null?ku(n):Le=i}function $0(n){var i=n,o=i.alternate;switch(i.tag){case 15:case 0:i=u0(o,i,i.pendingProps,i.type,void 0,Be);break;case 11:i=u0(o,i,i.pendingProps,i.type.render,i.ref,Be);break;case 5:fd(i);default:y0(o,i),i=Le=Fg(i,wr),i=m0(o,i,wr)}n.memoizedProps=n.pendingProps,i===null?ku(n):Le=i}function Ya(n,i,o,c){fr=Ti=null,fd(i),Da=null,Gs=0;var m=i.return;try{if(x2(n,m,i,o,Be)){dt=1,pu(n,En(o,n.current)),Le=null;return}}catch(x){if(m!==null)throw Le=m,x;dt=1,pu(n,En(o,n.current)),Le=null;return}i.flags&32768?(Pe||c===1?n=!0:Ua||(Be&536870912)!==0?n=!1:(Gr=n=!0,(c===2||c===9||c===3||c===6)&&(c=cn.current,c!==null&&c.tag===13&&(c.flags|=16384))),G0(i,n)):ku(i)}function ku(n){var i=n;do{if((i.flags&32768)!==0){G0(i,Gr);return}n=i.return;var o=w2(i.alternate,i,wr);if(o!==null){Le=o;return}if(i=i.sibling,i!==null){Le=i;return}Le=i=n}while(i!==null);dt===0&&(dt=5)}function G0(n,i){do{var o=S2(n.alternate,n);if(o!==null){o.flags&=32767,Le=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(n=n.sibling,n!==null)){Le=n;return}Le=n=o}while(n!==null);dt=6,Le=null}function X0(n,i,o,c,m,x,E,O,G){n.cancelPendingCommit=null;do Mu();while(Ct!==0);if((Ge&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Bf,pf(n,o,x,E,O,G),n===tt&&(Le=tt=null,Be=0),qa=i,Kr=n,Sr=o,$d=x,Gd=m,I0=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,D2(Ne,function(){return J0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=T.T,T.T=null,m=F.p,F.p=2,E=Ge,Ge|=4;try{E2(n,i,o)}finally{Ge=E,F.p=m,T.T=c}}Ct=1,Q0(),K0(),Z0()}}function Q0(){if(Ct===1){Ct=0;var n=Kr,i=qa,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=T.T,T.T=null;var c=F.p;F.p=2;var m=Ge;Ge|=4;try{T0(i,n);var x=lh,E=zg(n.containerInfo),O=x.focusedElem,G=x.selectionRange;if(E!==O&&O&&O.ownerDocument&&Dg(O.ownerDocument.documentElement,O)){if(G!==null&&Of(O)){var ee=G.start,ae=G.end;if(ae===void 0&&(ae=ee),"selectionStart"in O)O.selectionStart=ee,O.selectionEnd=Math.min(ae,O.value.length);else{var oe=O.ownerDocument||document,ne=oe&&oe.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),ye=O.textContent.length,ke=Math.min(G.start,ye),et=G.end===void 0?ke:Math.min(G.end,ye);!re.extend&&ke>et&&(E=et,et=ke,ke=E);var W=Og(O,ke),K=Og(O,et);if(W&&K&&(re.rangeCount!==1||re.anchorNode!==W.node||re.anchorOffset!==W.offset||re.focusNode!==K.node||re.focusOffset!==K.offset)){var J=oe.createRange();J.setStart(W.node,W.offset),re.removeAllRanges(),ke>et?(re.addRange(J),re.extend(K.node,K.offset)):(J.setEnd(K.node,K.offset),re.addRange(J))}}}}for(oe=[],re=O;re=re.parentNode;)re.nodeType===1&&oe.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<oe.length;O++){var se=oe[O];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Pu=!!oh,lh=oh=null}finally{Ge=m,F.p=c,T.T=o}}n.current=i,Ct=2}}function K0(){if(Ct===2){Ct=0;var n=Kr,i=qa,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=T.T,T.T=null;var c=F.p;F.p=2;var m=Ge;Ge|=4;try{C0(n,i.alternate,i)}finally{Ge=m,F.p=c,T.T=o}}Ct=3}}function Z0(){if(Ct===4||Ct===3){Ct=0,wn();var n=Kr,i=qa,o=Sr,c=I0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ct=5:(Ct=0,qa=Kr=null,W0(n,n.pendingLanes));var m=n.pendingLanes;if(m===0&&(Qr=null),As(o),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(kt,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=T.T,m=F.p,F.p=2,T.T=null;try{for(var x=n.onRecoverableError,E=0;E<c.length;E++){var O=c[E];x(O.value,{componentStack:O.stack})}}finally{T.T=i,F.p=m}}(Sr&3)!==0&&Mu(),Gn(n),m=n.pendingLanes,(o&261930)!==0&&(m&42)!==0?n===Xd?co++:(co=0,Xd=n):co=0,fo(0)}}function W0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,Ys(i)))}function Mu(){return Q0(),K0(),Z0(),J0()}function J0(){if(Ct!==5)return!1;var n=Kr,i=$d;$d=0;var o=As(Sr),c=T.T,m=F.p;try{F.p=32>o?32:o,T.T=null,o=Gd,Gd=null;var x=Kr,E=Sr;if(Ct=0,qa=Kr=null,Sr=0,(Ge&6)!==0)throw Error(a(331));var O=Ge;if(Ge|=4,D0(x.current),R0(x,x.current,E,o),Ge=O,fo(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(kt,x)}catch{}return!0}finally{F.p=m,T.T=c,W0(n,i)}}function ex(n,i,o){i=En(o,i),i=Nd(n.stateNode,i,2),n=qr(n,i,2),n!==null&&(vi(n,2),Gn(n))}function Ze(n,i,o){if(n.tag===3)ex(n,n,o);else for(;i!==null;){if(i.tag===3){ex(i,n,o);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Qr===null||!Qr.has(c))){n=En(o,n),o=t0(2),c=qr(i,o,2),c!==null&&(n0(o,c,i,n),vi(c,2),Gn(c));break}}i=i.return}}function Zd(n,i,o){var c=n.pingCache;if(c===null){c=n.pingCache=new N2;var m=new Set;c.set(i,m)}else m=c.get(i),m===void 0&&(m=new Set,c.set(i,m));m.has(o)||(qd=!0,m.add(o),n=R2.bind(null,n,i,o),i.then(n,n))}function R2(n,i,o){var c=n.pingCache;c!==null&&c.delete(i),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,tt===n&&(Be&o)===o&&(dt===4||dt===3&&(Be&62914560)===Be&&300>Te()-Su?(Ge&2)===0&&Fa(n,0):Fd|=o,Va===Be&&(Va=0)),Gn(n)}function tx(n,i){i===0&&(i=Cl()),n=Ni(n,i),n!==null&&(vi(n,i),Gn(n))}function j2(n){var i=n.memoizedState,o=0;i!==null&&(o=i.retryLane),tx(n,o)}function O2(n,i){var o=0;switch(n.tag){case 31:case 13:var c=n.stateNode,m=n.memoizedState;m!==null&&(o=m.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),tx(n,o)}function D2(n,i){return _t(n,i)}var Tu=null,$a=null,Wd=!1,Au=!1,Jd=!1,Wr=0;function Gn(n){n!==$a&&n.next===null&&($a===null?Tu=$a=n:$a=$a.next=n),Au=!0,Wd||(Wd=!0,L2())}function fo(n,i){if(!Jd&&Au){Jd=!0;do for(var o=!1,c=Tu;c!==null;){if(n!==0){var m=c.pendingLanes;if(m===0)var x=0;else{var E=c.suspendedLanes,O=c.pingedLanes;x=(1<<31-Qe(42|n)+1)-1,x&=m&~(E&~O),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,ax(c,x))}else x=Be,x=pa(c,c===tt?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(x&3)===0||xi(c,x)||(o=!0,ax(c,x));c=c.next}while(o);Jd=!1}}function z2(){nx()}function nx(){Au=Wd=!1;var n=0;Wr!==0&&$2()&&(n=Wr);for(var i=Te(),o=null,c=Tu;c!==null;){var m=c.next,x=rx(c,i);x===0?(c.next=null,o===null?Tu=m:o.next=m,m===null&&($a=o)):(o=c,(n!==0||(x&3)!==0)&&(Au=!0)),c=m}Ct!==0&&Ct!==5||fo(n),Wr!==0&&(Wr=0)}function rx(n,i){for(var o=n.suspendedLanes,c=n.pingedLanes,m=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var E=31-Qe(x),O=1<<E,G=m[E];G===-1?((O&o)===0||(O&c)!==0)&&(m[E]=hf(O,i)):G<=i&&(n.expiredLanes|=O),x&=~O}if(i=tt,o=Be,o=pa(n,n===i?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,o===0||n===i&&(Ke===2||Ke===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Ot(c),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||xi(n,o)){if(i=o&-o,i===n.callbackPriority)return i;switch(c!==null&&Ot(c),As(o)){case 2:case 8:o=me;break;case 32:o=Ne;break;case 268435456:o=Ue;break;default:o=Ne}return c=ix.bind(null,n),o=_t(o,c),n.callbackPriority=i,n.callbackNode=o,i}return c!==null&&c!==null&&Ot(c),n.callbackPriority=2,n.callbackNode=null,2}function ix(n,i){if(Ct!==0&&Ct!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Mu()&&n.callbackNode!==o)return null;var c=Be;return c=pa(n,n===tt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(H0(n,c,i),rx(n,Te()),n.callbackNode!=null&&n.callbackNode===o?ix.bind(null,n):null)}function ax(n,i){if(Mu())return null;H0(n,i,!0)}function L2(){X2(function(){(Ge&6)!==0?_t(ie,z2):nx()})}function eh(){if(Wr===0){var n=Ra;n===0&&(n=fa,fa<<=1,(fa&261888)===0&&(fa=256)),Wr=n}return Wr}function sx(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Bl(""+n)}function ox(n,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,n.id&&o.setAttribute("form",n.id),i.parentNode.insertBefore(o,i),n=new FormData(n),o.parentNode.removeChild(o),n}function I2(n,i,o,c,m){if(i==="submit"&&o&&o.stateNode===m){var x=sx((m[zt]||null).action),E=c.submitter;E&&(i=(i=E[zt]||null)?sx(i.formAction):E.getAttribute("formAction"),i!==null&&(x=i,E=null));var O=new Vl("action","action",null,c,m);n.push({event:O,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Wr!==0){var G=E?ox(m,E):new FormData(m);bd(o,{pending:!0,data:G,method:m.method,action:x},null,G)}}else typeof x=="function"&&(O.preventDefault(),G=E?ox(m,E):new FormData(m),bd(o,{pending:!0,data:G,method:m.method,action:x},x,G))},currentTarget:m}]})}}for(var th=0;th<If.length;th++){var nh=If[th],B2=nh.toLowerCase(),H2=nh[0].toUpperCase()+nh.slice(1);Dn(B2,"on"+H2)}Dn(Bg,"onAnimationEnd"),Dn(Hg,"onAnimationIteration"),Dn(Pg,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(t2,"onTransitionRun"),Dn(n2,"onTransitionStart"),Dn(r2,"onTransitionCancel"),Dn(Ug,"onTransitionEnd"),zr("onMouseEnter",["mouseout","mouseover"]),zr("onMouseLeave",["mouseout","mouseover"]),zr("onPointerEnter",["pointerout","pointerover"]),zr("onPointerLeave",["pointerout","pointerover"]),ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ar("onBeforeInput",["compositionend","keypress","textInput","paste"]),ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ho="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(" "),P2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ho));function lx(n,i){i=(i&4)!==0;for(var o=0;o<n.length;o++){var c=n[o],m=c.event;c=c.listeners;e:{var x=void 0;if(i)for(var E=c.length-1;0<=E;E--){var O=c[E],G=O.instance,ee=O.currentTarget;if(O=O.listener,G!==x&&m.isPropagationStopped())break e;x=O,m.currentTarget=ee;try{x(m)}catch(ae){Yl(ae)}m.currentTarget=null,x=G}else for(E=0;E<c.length;E++){if(O=c[E],G=O.instance,ee=O.currentTarget,O=O.listener,G!==x&&m.isPropagationStopped())break e;x=O,m.currentTarget=ee;try{x(m)}catch(ae){Yl(ae)}m.currentTarget=null,x=G}}}}function Ie(n,i){var o=i[ma];o===void 0&&(o=i[ma]=new Set);var c=n+"__bubble";o.has(c)||(ux(i,n,2,!1),o.add(c))}function rh(n,i,o){var c=0;i&&(c|=4),ux(o,n,c,i)}var Ru="_reactListening"+Math.random().toString(36).slice(2);function ih(n){if(!n[Ru]){n[Ru]=!0,jl.forEach(function(o){o!=="selectionchange"&&(P2.has(o)||rh(o,!1,n),rh(o,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Ru]||(i[Ru]=!0,rh("selectionchange",!1,i))}}function ux(n,i,o,c){switch(Bx(i)){case 2:var m=p_;break;case 8:m=m_;break;default:m=vh}o=m.bind(null,i,o,n),m=void 0,!Cf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),c?m!==void 0?n.addEventListener(i,o,{capture:!0,passive:m}):n.addEventListener(i,o,!0):m!==void 0?n.addEventListener(i,o,{passive:m}):n.addEventListener(i,o,!1)}function ah(n,i,o,c,m){var x=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var E=c.tag;if(E===3||E===4){var O=c.stateNode.containerInfo;if(O===m)break;if(E===4)for(E=c.return;E!==null;){var G=E.tag;if((G===3||G===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;O!==null;){if(E=Rr(O),E===null)return;if(G=E.tag,G===5||G===6||G===26||G===27){c=x=E;continue e}O=O.parentNode}}c=c.return}pg(function(){var ee=x,ae=Sf(o),oe=[];e:{var ne=Vg.get(n);if(ne!==void 0){var re=Vl,ye=n;switch(n){case"keypress":if(Pl(o)===0)break e;case"keydown":case"keyup":re=OC;break;case"focusin":ye="focus",re=Mf;break;case"focusout":ye="blur",re=Mf;break;case"beforeblur":case"afterblur":re=Mf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=wC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=LC;break;case Bg:case Hg:case Pg:re=CC;break;case Ug:re=BC;break;case"scroll":case"scrollend":re=vC;break;case"wheel":re=PC;break;case"copy":case"cut":case"paste":re=NC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=vg;break;case"toggle":case"beforetoggle":re=VC}var ke=(i&4)!==0,et=!ke&&(n==="scroll"||n==="scrollend"),W=ke?ne!==null?ne+"Capture":null:ne;ke=[];for(var K=ee,J;K!==null;){var se=K;if(J=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||J===null||W===null||(se=Ds(K,W),se!=null&&ke.push(po(K,se,J))),et)break;K=K.return}0<ke.length&&(ne=new re(ne,ye,null,o,ae),oe.push({event:ne,listeners:ke}))}}if((i&7)===0){e:{if(ne=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",ne&&o!==wf&&(ye=o.relatedTarget||o.fromElement)&&(Rr(ye)||ye[ir]))break e;if((re||ne)&&(ne=ae.window===ae?ae:(ne=ae.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(ye=o.relatedTarget||o.toElement,re=ee,ye=ye?Rr(ye):null,ye!==null&&(et=l(ye),ke=ye.tag,ye!==et||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=ee),re!==ye)){if(ke=yg,se="onMouseLeave",W="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(ke=vg,se="onPointerLeave",W="onPointerEnter",K="pointer"),et=re==null?ne:Or(re),J=ye==null?ne:Or(ye),ne=new ke(se,K+"leave",re,o,ae),ne.target=et,ne.relatedTarget=J,se=null,Rr(ae)===ee&&(ke=new ke(W,K+"enter",ye,o,ae),ke.target=J,ke.relatedTarget=et,se=ke),et=se,re&&ye)t:{for(ke=U2,W=re,K=ye,J=0,se=W;se;se=ke(se))J++;se=0;for(var Se=K;Se;Se=ke(Se))se++;for(;0<J-se;)W=ke(W),J--;for(;0<se-J;)K=ke(K),se--;for(;J--;){if(W===K||K!==null&&W===K.alternate){ke=W;break t}W=ke(W),K=ke(K)}ke=null}else ke=null;re!==null&&cx(oe,ne,re,ke,!1),ye!==null&&et!==null&&cx(oe,et,ye,ke,!0)}}e:{if(ne=ee?Or(ee):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var Ye=kg;else if(_g(ne))if(Mg)Ye=WC;else{Ye=KC;var xe=QC}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&bf(ee.elementType)&&(Ye=kg):Ye=ZC;if(Ye&&(Ye=Ye(n,ee))){Ng(oe,Ye,o,ae);break e}xe&&xe(n,ne,ee),n==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Os(ne,"number",ne.value)}switch(xe=ee?Or(ee):window,n){case"focusin":(_g(xe)||xe.contentEditable==="true")&&(Ea=xe,Df=ee,Vs=null);break;case"focusout":Vs=Df=Ea=null;break;case"mousedown":zf=!0;break;case"contextmenu":case"mouseup":case"dragend":zf=!1,Lg(oe,o,ae);break;case"selectionchange":if(e2)break;case"keydown":case"keyup":Lg(oe,o,ae)}var je;if(Af)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Sa?Eg(n,o)&&(He="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(He="onCompositionStart");He&&(bg&&o.locale!=="ko"&&(Sa||He!=="onCompositionStart"?He==="onCompositionEnd"&&Sa&&(je=mg()):(Lr=ae,_f="value"in Lr?Lr.value:Lr.textContent,Sa=!0)),xe=ju(ee,He),0<xe.length&&(He=new xg(He,n,null,o,ae),oe.push({event:He,listeners:xe}),je?He.data=je:(je=Cg(o),je!==null&&(He.data=je)))),(je=FC?YC(n,o):$C(n,o))&&(He=ju(ee,"onBeforeInput"),0<He.length&&(xe=new xg("onBeforeInput","beforeinput",null,o,ae),oe.push({event:xe,listeners:He}),xe.data=je)),I2(oe,n,ee,o,ae)}lx(oe,i)})}function po(n,i,o){return{instance:n,listener:i,currentTarget:o}}function ju(n,i){for(var o=i+"Capture",c=[];n!==null;){var m=n,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=Ds(n,o),m!=null&&c.unshift(po(n,m,x)),m=Ds(n,i),m!=null&&c.push(po(n,m,x))),n.tag===3)return c;n=n.return}return[]}function U2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function cx(n,i,o,c,m){for(var x=i._reactName,E=[];o!==null&&o!==c;){var O=o,G=O.alternate,ee=O.stateNode;if(O=O.tag,G!==null&&G===c)break;O!==5&&O!==26&&O!==27||ee===null||(G=ee,m?(ee=Ds(o,x),ee!=null&&E.unshift(po(o,ee,G))):m||(ee=Ds(o,x),ee!=null&&E.push(po(o,ee,G)))),o=o.return}E.length!==0&&n.push({event:i,listeners:E})}var V2=/\r\n?/g,q2=/\u0000|\uFFFD/g;function fx(n){return(typeof n=="string"?n:""+n).replace(V2,`
|
|
9
|
-
`).replace(q2,"")}function dx(n,i){return i=fx(i),fx(n)===i}function Je(n,i,o,c,m,x){switch(o){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||va(n,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&va(n,""+c);break;case"className":ya(n,"class",c);break;case"tabIndex":ya(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ya(n,o,c);break;case"style":dg(n,c,x);break;case"data":if(i!=="object"){ya(n,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||o!=="href")){n.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=Bl(""+c),n.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(o,"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 x=="function"&&(o==="formAction"?(i!=="input"&&Je(n,i,"name",m.name,m,null),Je(n,i,"formEncType",m.formEncType,m,null),Je(n,i,"formMethod",m.formMethod,m,null),Je(n,i,"formTarget",m.formTarget,m,null)):(Je(n,i,"encType",m.encType,m,null),Je(n,i,"method",m.method,m,null),Je(n,i,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=Bl(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(n.onclick=or);break;case"onScroll":c!=null&&Ie("scroll",n);break;case"onScrollEnd":c!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}o=Bl(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""+c):n.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":c===!0?n.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,c):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(o,c):n.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(o):n.setAttribute(o,c);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),ga(n,"popover",c);break;case"xlinkActuate":On(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":On(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":On(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":On(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":On(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":On(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":On(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":On(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":On(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ga(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=yC.get(o)||o,ga(n,o,c))}}function sh(n,i,o,c,m,x){switch(o){case"style":dg(n,c,x);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(a(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(a(60));n.innerHTML=o}}break;case"children":typeof c=="string"?va(n,c):(typeof c=="number"||typeof c=="bigint")&&va(n,""+c);break;case"onScroll":c!=null&&Ie("scroll",n);break;case"onScrollEnd":c!=null&&Ie("scrollend",n);break;case"onClick":c!=null&&(n.onclick=or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ol.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),i=o.slice(2,m?o.length-7:void 0),x=n[zt]||null,x=x!=null?x[o]:null,typeof x=="function"&&n.removeEventListener(i,x,m),typeof c=="function")){typeof x!="function"&&x!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(i,c,m);break e}o in n?n[o]=c:c===!0?n.setAttribute(o,""):ga(n,o,c)}}}function Rt(n,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var c=!1,m=!1,x;for(x in o)if(o.hasOwnProperty(x)){var E=o[x];if(E!=null)switch(x){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Je(n,i,x,E,o,null)}}m&&Je(n,i,"srcSet",o.srcSet,o,null),c&&Je(n,i,"src",o.src,o,null);return;case"input":Ie("invalid",n);var O=x=E=m=null,G=null,ee=null;for(c in o)if(o.hasOwnProperty(c)){var ae=o[c];if(ae!=null)switch(c){case"name":m=ae;break;case"type":E=ae;break;case"checked":G=ae;break;case"defaultChecked":ee=ae;break;case"value":x=ae;break;case"defaultValue":O=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:Je(n,i,c,ae,o,null)}}Il(n,x,O,G,ee,E,m,!1);return;case"select":Ie("invalid",n),c=E=x=null;for(m in o)if(o.hasOwnProperty(m)&&(O=o[m],O!=null))switch(m){case"value":x=O;break;case"defaultValue":E=O;break;case"multiple":c=O;default:Je(n,i,m,O,o,null)}i=x,o=E,n.multiple=!!c,i!=null?sr(n,!!c,i,!1):o!=null&&sr(n,!!c,o,!0);return;case"textarea":Ie("invalid",n),x=m=c=null;for(E in o)if(o.hasOwnProperty(E)&&(O=o[E],O!=null))switch(E){case"value":c=O;break;case"defaultValue":m=O;break;case"children":x=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(a(91));break;default:Je(n,i,E,O,o,null)}cg(n,c,m,x);return;case"option":for(G in o)o.hasOwnProperty(G)&&(c=o[G],c!=null)&&(G==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":Je(n,i,G,c,o,null));return;case"dialog":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(c=0;c<ho.length;c++)Ie(ho[c],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in o)if(o.hasOwnProperty(ee)&&(c=o[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Je(n,i,ee,c,o,null)}return;default:if(bf(i)){for(ae in o)o.hasOwnProperty(ae)&&(c=o[ae],c!==void 0&&sh(n,i,ae,c,o,void 0));return}}for(O in o)o.hasOwnProperty(O)&&(c=o[O],c!=null&&Je(n,i,O,c,o,null))}function F2(n,i,o,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,E=null,O=null,G=null,ee=null,ae=null;for(re in o){var oe=o[re];if(o.hasOwnProperty(re)&&oe!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":G=oe;default:c.hasOwnProperty(re)||Je(n,i,re,null,c,oe)}}for(var ne in c){var re=c[ne];if(oe=o[ne],c.hasOwnProperty(ne)&&(re!=null||oe!=null))switch(ne){case"type":x=re;break;case"name":m=re;break;case"checked":ee=re;break;case"defaultChecked":ae=re;break;case"value":E=re;break;case"defaultValue":O=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:re!==oe&&Je(n,i,ne,re,c,oe)}}Si(n,E,O,G,ee,ae,x,m);return;case"select":re=E=O=ne=null;for(x in o)if(G=o[x],o.hasOwnProperty(x)&&G!=null)switch(x){case"value":break;case"multiple":re=G;default:c.hasOwnProperty(x)||Je(n,i,x,null,c,G)}for(m in c)if(x=c[m],G=o[m],c.hasOwnProperty(m)&&(x!=null||G!=null))switch(m){case"value":ne=x;break;case"defaultValue":O=x;break;case"multiple":E=x;default:x!==G&&Je(n,i,m,x,c,G)}i=O,o=E,c=re,ne!=null?sr(n,!!o,ne,!1):!!c!=!!o&&(i!=null?sr(n,!!o,i,!0):sr(n,!!o,o?[]:"",!1));return;case"textarea":re=ne=null;for(O in o)if(m=o[O],o.hasOwnProperty(O)&&m!=null&&!c.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Je(n,i,O,null,c,m)}for(E in c)if(m=c[E],x=o[E],c.hasOwnProperty(E)&&(m!=null||x!=null))switch(E){case"value":ne=m;break;case"defaultValue":re=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:m!==x&&Je(n,i,E,m,c,x)}ug(n,ne,re);return;case"option":for(var ye in o)ne=o[ye],o.hasOwnProperty(ye)&&ne!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?n.selected=!1:Je(n,i,ye,null,c,ne));for(G in c)ne=c[G],re=o[G],c.hasOwnProperty(G)&&ne!==re&&(ne!=null||re!=null)&&(G==="selected"?n.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Je(n,i,G,ne,c,re));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 ke in o)ne=o[ke],o.hasOwnProperty(ke)&&ne!=null&&!c.hasOwnProperty(ke)&&Je(n,i,ke,null,c,ne);for(ee in c)if(ne=c[ee],re=o[ee],c.hasOwnProperty(ee)&&ne!==re&&(ne!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Je(n,i,ee,ne,c,re)}return;default:if(bf(i)){for(var et in o)ne=o[et],o.hasOwnProperty(et)&&ne!==void 0&&!c.hasOwnProperty(et)&&sh(n,i,et,void 0,c,ne);for(ae in c)ne=c[ae],re=o[ae],!c.hasOwnProperty(ae)||ne===re||ne===void 0&&re===void 0||sh(n,i,ae,ne,c,re);return}}for(var W in o)ne=o[W],o.hasOwnProperty(W)&&ne!=null&&!c.hasOwnProperty(W)&&Je(n,i,W,null,c,ne);for(oe in c)ne=c[oe],re=o[oe],!c.hasOwnProperty(oe)||ne===re||ne==null&&re==null||Je(n,i,oe,ne,c,re)}function hx(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Y2(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var m=o[c],x=m.transferSize,E=m.initiatorType,O=m.duration;if(x&&O&&hx(E)){for(E=0,O=m.responseEnd,c+=1;c<o.length;c++){var G=o[c],ee=G.startTime;if(ee>O)break;var ae=G.transferSize,oe=G.initiatorType;ae&&hx(oe)&&(G=G.responseEnd,E+=ae*(G<O?1:(O-ee)/(G-ee)))}if(--c,i+=8*(x+E)/(m.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var oh=null,lh=null;function Ou(n){return n.nodeType===9?n:n.ownerDocument}function px(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mx(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function uh(n,i){return n==="textarea"||n==="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 ch=null;function $2(){var n=window.event;return n&&n.type==="popstate"?n===ch?!1:(ch=n,!0):(ch=null,!1)}var gx=typeof setTimeout=="function"?setTimeout:void 0,G2=typeof clearTimeout=="function"?clearTimeout:void 0,yx=typeof Promise=="function"?Promise:void 0,X2=typeof queueMicrotask=="function"?queueMicrotask:typeof yx<"u"?function(n){return yx.resolve(null).then(n).catch(Q2)}:gx;function Q2(n){setTimeout(function(){throw n})}function Jr(n){return n==="head"}function xx(n,i){var o=i,c=0;do{var m=o.nextSibling;if(n.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(c===0){n.removeChild(m),Ka(i);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")mo(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,mo(o);for(var x=o.firstChild;x;){var E=x.nextSibling,O=x.nodeName;x[bi]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=E}}else o==="body"&&mo(n.ownerDocument.body);o=m}while(o);Ka(i)}function vx(n,i){var o=n;n=0;do{var c=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=c}while(o)}function fh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":fh(o),Rs(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function K2(n,i,o,c){for(;n.nodeType===1;){var m=o;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[bi])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==m.rel||n.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||n.getAttribute("title")!==(m.title==null?null:m.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(m.src==null?null:m.src)||n.getAttribute("type")!==(m.type==null?null:m.type)||n.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=Mn(n.nextSibling),n===null)break}return null}function Z2(n,i,o){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Mn(n.nextSibling),n===null))return null;return n}function bx(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Mn(n.nextSibling),n===null))return null;return n}function dh(n){return n.data==="$?"||n.data==="$~"}function hh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function W2(n,i){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||o.readyState!=="loading")i();else{var c=function(){i(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Mn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var ph=null;function wx(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(i===0)return Mn(n.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}n=n.nextSibling}return null}function Sx(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return n;i--}else o!=="/$"&&o!=="/&"||i++}n=n.previousSibling}return null}function Ex(n,i,o){switch(i=Ou(o),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function mo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Rs(n)}var Tn=new Map,Cx=new Set;function Du(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Er=F.d;F.d={f:J2,r:e_,D:t_,C:n_,L:r_,m:i_,X:s_,S:a_,M:o_};function J2(){var n=Er.f(),i=_u();return n||i}function e_(n){var i=jr(n);i!==null&&i.tag===5&&i.type==="form"?Uy(i):Er.r(n)}var Ga=typeof document>"u"?null:document;function _x(n,i,o){var c=Ga;if(c&&typeof i=="string"&&i){var m=Ft(i);m='link[rel="'+n+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),Cx.has(m)||(Cx.add(m),n={rel:n,crossOrigin:o,href:i},c.querySelector(m)===null&&(i=c.createElement("link"),Rt(i,"link",n),gt(i),c.head.appendChild(i)))}}function t_(n){Er.D(n),_x("dns-prefetch",n,null)}function n_(n,i){Er.C(n,i),_x("preconnect",n,i)}function r_(n,i,o){Er.L(n,i,o);var c=Ga;if(c&&n&&i){var m='link[rel="preload"][as="'+Ft(i)+'"]';i==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+Ft(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+Ft(o.imageSizes)+'"]')):m+='[href="'+Ft(n)+'"]';var x=m;switch(i){case"style":x=Xa(n);break;case"script":x=Qa(n)}Tn.has(x)||(n=g({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:n,as:i},o),Tn.set(x,n),c.querySelector(m)!==null||i==="style"&&c.querySelector(go(x))||i==="script"&&c.querySelector(yo(x))||(i=c.createElement("link"),Rt(i,"link",n),gt(i),c.head.appendChild(i)))}}function i_(n,i){Er.m(n,i);var o=Ga;if(o&&n){var c=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Ft(c)+'"][href="'+Ft(n)+'"]',x=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Qa(n)}if(!Tn.has(x)&&(n=g({rel:"modulepreload",href:n},i),Tn.set(x,n),o.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(yo(x)))return}c=o.createElement("link"),Rt(c,"link",n),gt(c),o.head.appendChild(c)}}}function a_(n,i,o){Er.S(n,i,o);var c=Ga;if(c&&n){var m=Dr(c).hoistableStyles,x=Xa(n);i=i||"default";var E=m.get(x);if(!E){var O={loading:0,preload:null};if(E=c.querySelector(go(x)))O.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":i},o),(o=Tn.get(x))&&mh(n,o);var G=E=c.createElement("link");gt(G),Rt(G,"link",n),G._p=new Promise(function(ee,ae){G.onload=ee,G.onerror=ae}),G.addEventListener("load",function(){O.loading|=1}),G.addEventListener("error",function(){O.loading|=2}),O.loading|=4,zu(E,i,c)}E={type:"stylesheet",instance:E,count:1,state:O},m.set(x,E)}}}function s_(n,i){Er.X(n,i);var o=Ga;if(o&&n){var c=Dr(o).hoistableScripts,m=Qa(n),x=c.get(m);x||(x=o.querySelector(yo(m)),x||(n=g({src:n,async:!0},i),(i=Tn.get(m))&&gh(n,i),x=o.createElement("script"),gt(x),Rt(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function o_(n,i){Er.M(n,i);var o=Ga;if(o&&n){var c=Dr(o).hoistableScripts,m=Qa(n),x=c.get(m);x||(x=o.querySelector(yo(m)),x||(n=g({src:n,async:!0,type:"module"},i),(i=Tn.get(m))&&gh(n,i),x=o.createElement("script"),gt(x),Rt(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},c.set(m,x))}}function Nx(n,i,o,c){var m=(m=fe.current)?Du(m):null;if(!m)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=Xa(o.href),o=Dr(m).hoistableStyles,c=o.get(i),c||(c={type:"style",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=Xa(o.href);var x=Dr(m).hoistableStyles,E=x.get(n);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,E),(x=m.querySelector(go(n)))&&!x._p&&(E.instance=x,E.state.loading=5),Tn.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Tn.set(n,o),x||l_(m,n,o,E.state))),i&&c===null)throw Error(a(528,""));return E}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Qa(o),o=Dr(m).hoistableScripts,c=o.get(i),c||(c={type:"script",instance:null,count:0,state:null},o.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function Xa(n){return'href="'+Ft(n)+'"'}function go(n){return'link[rel="stylesheet"]['+n+"]"}function kx(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function l_(n,i,o,c){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=n.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),Rt(i,"link",o),gt(i),n.head.appendChild(i))}function Qa(n){return'[src="'+Ft(n)+'"]'}function yo(n){return"script[async]"+n}function Mx(n,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var c=n.querySelector('style[data-href~="'+Ft(o.href)+'"]');if(c)return i.instance=c,gt(c),c;var m=g({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),gt(c),Rt(c,"style",m),zu(c,o.precedence,n),i.instance=c;case"stylesheet":m=Xa(o.href);var x=n.querySelector(go(m));if(x)return i.state.loading|=4,i.instance=x,gt(x),x;c=kx(o),(m=Tn.get(m))&&mh(c,m),x=(n.ownerDocument||n).createElement("link"),gt(x);var E=x;return E._p=new Promise(function(O,G){E.onload=O,E.onerror=G}),Rt(x,"link",c),i.state.loading|=4,zu(x,o.precedence,n),i.instance=x;case"script":return x=Qa(o.src),(m=n.querySelector(yo(x)))?(i.instance=m,gt(m),m):(c=o,(m=Tn.get(x))&&(c=g({},o),gh(c,m)),n=n.ownerDocument||n,m=n.createElement("script"),gt(m),Rt(m,"link",c),n.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,zu(c,o.precedence,n));return i.instance}function zu(n,i,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,x=m,E=0;E<c.length;E++){var O=c[E];if(O.dataset.precedence===i)x=O;else if(x!==m)break}x?x.parentNode.insertBefore(n,x.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(n,i.firstChild))}function mh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function gh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Lu=null;function Tx(n,i,o){if(Lu===null){var c=new Map,m=Lu=new Map;m.set(o,c)}else m=Lu,c=m.get(o),c||(c=new Map,m.set(o,c));if(c.has(n))return c;for(c.set(n,null),o=o.getElementsByTagName(n),m=0;m<o.length;m++){var x=o[m];if(!(x[bi]||x[Et]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var E=x.getAttribute(i)||"";E=n+E;var O=c.get(E);O?O.push(x):c.set(E,[x])}}return c}function Ax(n,i,o){n=n.ownerDocument||n,n.head.insertBefore(o,i==="title"?n.querySelector("head > title"):null)}function u_(n,i,o){if(o===1||i.itemProp!=null)return!1;switch(n){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"?(n=i.disabled,typeof i.precedence=="string"&&n==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 Rx(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function c_(n,i,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=Xa(c.href),x=i.querySelector(go(m));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Iu.bind(n),i.then(n,n)),o.state.loading|=4,o.instance=x,gt(x);return}x=i.ownerDocument||i,c=kx(c),(m=Tn.get(m))&&mh(c,m),x=x.createElement("link"),gt(x);var E=x;E._p=new Promise(function(O,G){E.onload=O,E.onerror=G}),Rt(x,"link",c),o.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Iu.bind(n),i.addEventListener("load",o),i.addEventListener("error",o))}}var yh=0;function f_(n,i){return n.stylesheets&&n.count===0&&Hu(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var c=setTimeout(function(){if(n.stylesheets&&Hu(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+i);0<n.imgBytes&&yh===0&&(yh=62500*Y2());var m=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Hu(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>yh?50:800)+i);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Bu=null;function Hu(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Bu=new Map,i.forEach(d_,n),Bu=null,Iu.call(n))}function d_(n,i){if(!(i.state.loading&4)){var o=Bu.get(n);if(o)var c=o.get(null);else{o=new Map,Bu.set(n,o);for(var m=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var E=m[x];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(o.set(E.dataset.precedence,E),c=E)}c&&o.set(null,c)}m=i.instance,E=m.getAttribute("data-precedence"),x=o.get(E)||c,x===c&&o.set(null,m),o.set(E,m),this.count++,c=Iu.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),x?x.parentNode.insertBefore(m,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(m,n.firstChild)),i.state.loading|=4}}var xo={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function h_(n,i,o,c,m,x,E,O,G){this.tag=1,this.containerInfo=n,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=Ms(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ms(0),this.hiddenUpdates=Ms(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function jx(n,i,o,c,m,x,E,O,G,ee,ae,oe){return n=new h_(n,i,o,E,G,ee,ae,oe,O),i=1,x===!0&&(i|=24),x=un(3,null,null,i),n.current=x,x.stateNode=n,i=Kf(),i.refCount++,n.pooledCache=i,i.refCount++,x.memoizedState={element:c,isDehydrated:o,cache:i},ed(x),n}function Ox(n){return n?(n=Na,n):Na}function Dx(n,i,o,c,m,x){m=Ox(m),c.context===null?c.context=m:c.pendingContext=m,c=Vr(i),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=qr(n,c,i),o!==null&&(Kt(o,n,i),Qs(o,n,i))}function zx(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<i?o:i}}function xh(n,i){zx(n,i),(n=n.alternate)&&zx(n,i)}function Lx(n){if(n.tag===13||n.tag===31){var i=Ni(n,67108864);i!==null&&Kt(i,n,67108864),xh(n,67108864)}}function Ix(n){if(n.tag===13||n.tag===31){var i=pn();i=Ts(i);var o=Ni(n,i);o!==null&&Kt(o,n,i),xh(n,i)}}var Pu=!0;function p_(n,i,o,c){var m=T.T;T.T=null;var x=F.p;try{F.p=2,vh(n,i,o,c)}finally{F.p=x,T.T=m}}function m_(n,i,o,c){var m=T.T;T.T=null;var x=F.p;try{F.p=8,vh(n,i,o,c)}finally{F.p=x,T.T=m}}function vh(n,i,o,c){if(Pu){var m=bh(c);if(m===null)ah(n,i,c,Uu,o),Hx(n,c);else if(y_(m,n,i,o,c))c.stopPropagation();else if(Hx(n,c),i&4&&-1<g_.indexOf(n)){for(;m!==null;){var x=jr(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var E=rr(x.pendingLanes);if(E!==0){var O=x;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var G=1<<31-Qe(E);O.entanglements[1]|=G,E&=~G}Gn(x),(Ge&6)===0&&(Eu=Te()+500,fo(0))}}break;case 31:case 13:O=Ni(x,2),O!==null&&Kt(O,x,2),_u(),xh(x,2)}if(x=bh(c),x===null&&ah(n,i,c,Uu,o),x===m)break;m=x}m!==null&&c.stopPropagation()}else ah(n,i,c,null,o)}}function bh(n){return n=Sf(n),wh(n)}var Uu=null;function wh(n){if(Uu=null,n=Rr(n),n!==null){var i=l(n);if(i===null)n=null;else{var o=i.tag;if(o===13){if(n=u(i),n!==null)return n;n=null}else if(o===31){if(n=f(i),n!==null)return n;n=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Uu=n,null}function Bx(n){switch(n){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(ct()){case ie:return 2;case me:return 8;case Ne:case ze:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var Sh=!1,ei=null,ti=null,ni=null,vo=new Map,bo=new Map,ri=[],g_="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 Hx(n,i){switch(n){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":ti=null;break;case"mouseover":case"mouseout":ni=null;break;case"pointerover":case"pointerout":vo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(i.pointerId)}}function wo(n,i,o,c,m,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:o,eventSystemFlags:c,nativeEvent:x,targetContainers:[m]},i!==null&&(i=jr(i),i!==null&&Lx(i)),n):(n.eventSystemFlags|=c,i=n.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),n)}function y_(n,i,o,c,m){switch(i){case"focusin":return ei=wo(ei,n,i,o,c,m),!0;case"dragenter":return ti=wo(ti,n,i,o,c,m),!0;case"mouseover":return ni=wo(ni,n,i,o,c,m),!0;case"pointerover":var x=m.pointerId;return vo.set(x,wo(vo.get(x)||null,n,i,o,c,m)),!0;case"gotpointercapture":return x=m.pointerId,bo.set(x,wo(bo.get(x)||null,n,i,o,c,m)),!0}return!1}function Px(n){var i=Rr(n.target);if(i!==null){var o=l(i);if(o!==null){if(i=o.tag,i===13){if(i=u(o),i!==null){n.blockedOn=i,Tl(n.priority,function(){Ix(o)});return}}else if(i===31){if(i=f(o),i!==null){n.blockedOn=i,Tl(n.priority,function(){Ix(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Vu(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var o=bh(n.nativeEvent);if(o===null){o=n.nativeEvent;var c=new o.constructor(o.type,o);wf=c,o.target.dispatchEvent(c),wf=null}else return i=jr(o),i!==null&&Lx(i),n.blockedOn=o,!1;i.shift()}return!0}function Ux(n,i,o){Vu(n)&&o.delete(i)}function x_(){Sh=!1,ei!==null&&Vu(ei)&&(ei=null),ti!==null&&Vu(ti)&&(ti=null),ni!==null&&Vu(ni)&&(ni=null),vo.forEach(Ux),bo.forEach(Ux)}function qu(n,i){n.blockedOn===i&&(n.blockedOn=null,Sh||(Sh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,x_)))}var Fu=null;function Vx(n){Fu!==n&&(Fu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fu===n&&(Fu=null);for(var i=0;i<n.length;i+=3){var o=n[i],c=n[i+1],m=n[i+2];if(typeof c!="function"){if(wh(c||o)===null)continue;break}var x=jr(o);x!==null&&(n.splice(i,3),i-=3,bd(x,{pending:!0,data:m,method:o.method,action:c},c,m))}}))}function Ka(n){function i(G){return qu(G,n)}ei!==null&&qu(ei,n),ti!==null&&qu(ti,n),ni!==null&&qu(ni,n),vo.forEach(i),bo.forEach(i);for(var o=0;o<ri.length;o++){var c=ri[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ri.length&&(o=ri[0],o.blockedOn===null);)Px(o),o.blockedOn===null&&ri.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var m=o[c],x=o[c+1],E=m[zt]||null;if(typeof x=="function")E||Vx(o);else if(E){var O=null;if(x&&x.hasAttribute("formAction")){if(m=x,E=x[zt]||null)O=E.formAction;else if(wh(m)!==null)continue}else O=E.action;typeof O=="function"?o[c+1]=O:(o.splice(c,3),c-=3),Vx(o)}}}function qx(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function Eh(n){this._internalRoot=n}Yu.prototype.render=Eh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,c=pn();Dx(o,c,n,i,null,null)},Yu.prototype.unmount=Eh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Dx(n.current,2,null,n,null,null),_u(),i[ir]=null}};function Yu(n){this._internalRoot=n}Yu.prototype.unstable_scheduleHydration=function(n){if(n){var i=Ml();n={blockedOn:null,target:n,priority:i};for(var o=0;o<ri.length&&i!==0&&i<ri[o].priority;o++);ri.splice(o,0,n),o===0&&Px(n)}};var Fx=t.version;if(Fx!=="19.2.4")throw Error(a(527,Fx,"19.2.4"));F.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=d(i),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var v_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{kt=$u.inject(v_),ht=$u}catch{}}return Eo.createRoot=function(n,i){if(!s(n))throw Error(a(299));var o=!1,c="",m=Zy,x=Wy,E=Jy;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=jx(n,1,!1,null,null,o,c,null,m,x,E,qx),n[ir]=i.current,ih(n),new Eh(i)},Eo.hydrateRoot=function(n,i,o){if(!s(n))throw Error(a(299));var c=!1,m="",x=Zy,E=Wy,O=Jy,G=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(x=o.onUncaughtError),o.onCaughtError!==void 0&&(E=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError),o.formState!==void 0&&(G=o.formState)),i=jx(n,1,!0,i,o??null,c,m,G,x,E,O,qx),i.context=Ox(null),o=i.current,c=pn(),c=Ts(c),m=Vr(c),m.callback=null,qr(o,m,c),o=c,i.current.lanes=o,vi(i,o),Gn(i),n[ir]=i.current,ih(n),new Yu(i)},Eo.version="19.2.4",Eo}var ev;function M_(){if(ev)return Nh.exports;ev=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Nh.exports=k_(),Nh.exports}var T_=M_(),pl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},A_=class extends pl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},om=new A_,R_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},j_=class{#e=R_;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Vi=new j_;function O_(e){setTimeout(e,0)}var D_=typeof window>"u"||"Deno"in globalThis;function Wt(){}function z_(e,t){return typeof e=="function"?e(t):e}function gp(e){return typeof e=="number"&&e>=0&&e!==1/0}function G1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hi(e,t){return typeof e=="function"?e(t):e}function An(e,t){return typeof e=="function"?e(t):e}function tv(e,t){const{type:r="all",exact:a,fetchStatus:s,predicate:l,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==lm(u,t.options))return!1}else if(!Go(t.queryKey,u))return!1}if(r!=="all"){const h=t.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||l&&!l(t))}function nv(e,t){const{exact:r,status:a,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if($o(t.options.mutationKey)!==$o(l))return!1}else if(!Go(t.options.mutationKey,l))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function lm(e,t){return(t?.queryKeyHashFn||$o)(e)}function $o(e){return JSON.stringify(e,(t,r)=>xp(r)?Object.keys(r).sort().reduce((a,s)=>(a[s]=r[s],a),{}):r)}function Go(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Go(e[r],t[r])):!1}var L_=Object.prototype.hasOwnProperty;function X1(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=rv(e)&&rv(t);if(!a&&!(xp(e)&&xp(t)))return t;const l=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,h=a?new Array(f):{};let d=0;for(let p=0;p<f;p++){const g=a?p:u[p],y=e[g],v=t[g];if(y===v){h[g]=y,(a?p<l:L_.call(e,g))&&d++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){h[g]=v;continue}const w=X1(y,v,r+1);h[g]=w,w===y&&d++}return l===f&&d===l?e:h}function yp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function rv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xp(e){if(!iv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!iv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function iv(e){return Object.prototype.toString.call(e)==="[object Object]"}function I_(e){return new Promise(t=>{Vi.setTimeout(t,e)})}function vp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?X1(e,t):t}function B_(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function H_(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var um=Symbol();function Q1(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===um?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function K1(e,t){return typeof e=="function"?e(...t):!!e}function P_(e,t,r){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),a||(a=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Xo=(()=>{let e=()=>D_;return{isServer(){return e()},setIsServer(t){e=t}}})();function bp(){let e,t;const r=new Promise((s,l)=>{e=s,t=l});r.status="pending",r.catch(()=>{});function a(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},r.reject=s=>{a({status:"rejected",reason:s}),t(s)},r}var U_=O_;function V_(){let e=[],t=0,r=f=>{f()},a=f=>{f()},s=U_;const l=f=>{t?e.push(f):s(()=>{r(f)})},u=()=>{const f=e;e=[],f.length&&s(()=>{a(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},batchCalls:f=>(...h)=>{l(()=>{f(...h)})},schedule:l,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{s=f}}}var jt=V_(),q_=class extends pl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},wc=new q_;function F_(e){return Math.min(1e3*2**e,3e4)}function Z1(e){return(e??"online")==="online"?wc.isOnline():!0}var wp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function W1(e){let t=!1,r=0,a;const s=bp(),l=()=>s.status!=="pending",u=C=>{if(!l()){const N=new wp(C);y(N),e.onCancel?.(N)}},f=()=>{t=!0},h=()=>{t=!1},d=()=>om.isFocused()&&(e.networkMode==="always"||wc.isOnline())&&e.canRun(),p=()=>Z1(e.networkMode)&&e.canRun(),g=C=>{l()||(a?.(),s.resolve(C))},y=C=>{l()||(a?.(),s.reject(C))},v=()=>new Promise(C=>{a=N=>{(l()||d())&&C(N)},e.onPause?.()}).then(()=>{a=void 0,l()||e.onContinue?.()}),w=()=>{if(l())return;let C;const N=r===0?e.initialPromise:void 0;try{C=N??e.fn()}catch(S){C=Promise.reject(S)}Promise.resolve(C).then(g).catch(S=>{if(l())return;const A=e.retry??(Xo.isServer()?0:3),_=e.retryDelay??F_,k=typeof _=="function"?_(r,S):_,H=A===!0||typeof A=="number"&&r<A||typeof A=="function"&&A(r,S);if(t||!H){y(S);return}r++,e.onFail?.(r,S),I_(k).then(()=>d()?void 0:v()).then(()=>{t?y(S):w()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(a?.(),s),cancelRetry:f,continueRetry:h,canStart:p,start:()=>(p()?w():v().then(w),s)}}var J1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gp(this.gcTime)&&(this.#e=Vi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Vi.clearTimeout(this.#e),this.#e=void 0)}},Y_=class extends J1{#e;#t;#n;#i;#r;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=sv(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=sv(this.options);t.data!==void 0&&(this.setState(av(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=vp(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#l({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Wt).catch(Wt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>An(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===um||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!G1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a||this.#o()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#o(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},s=()=>{const f=Q1(this.options,t),d=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(p),p})();return this.#a=!1,this.options.persister?this.options.persister(f,d,this):f(d)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return a(f),f})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=W1({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof wp&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(f,h)=>{this.#l({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof wp){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#l({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ew(r.data,this.options),fetchMeta:e.meta??null};case"success":const a={...r,...av(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?a:void 0,a;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),jt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function ew(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function av(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function sv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var $_=class extends pl{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=bp(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#s;#a;#o;#l;#h;#p;#c;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ov(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof An(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!yp(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&lv(this.#t,r,this.options,t)&&this.#d(),this.updateResult(),a&&(this.#t!==r||An(this.options.enabled,this.#t)!==An(t.enabled,this.#t)||hi(this.options.staleTime,this.#t)!==hi(t.staleTime,this.#t))&&this.#g();const s=this.#y();a&&(this.#t!==r||An(this.options.enabled,this.#t)!==An(t.enabled,this.#t)||s!==this.#u)&&this.#x(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return X_(this,r)&&(this.#i=r,this.#s=this.options,this.#r=this.#t.state),r}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(r,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Wt)),t}#g(){this.#b();const e=hi(this.options.staleTime,this.#t);if(Xo.isServer()||this.#i.isStale||!gp(e))return;const r=G1(this.#i.dataUpdatedAt,e)+1;this.#c=Vi.setTimeout(()=>{this.#i.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#x(e){this.#w(),this.#u=e,!(Xo.isServer()||An(this.options.enabled,this.#t)===!1||!gp(this.#u)||this.#u===0)&&(this.#f=Vi.setInterval(()=>{(this.options.refetchIntervalInBackground||om.isFocused())&&this.#d()},this.#u))}#v(){this.#g(),this.#x(this.#y())}#b(){this.#c&&(Vi.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#f&&(Vi.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,a=this.options,s=this.#i,l=this.#r,u=this.#s,h=e!==r?e.state:this.#n,{state:d}=e;let p={...d},g=!1,y;if(t._optimisticResults){const P=this.hasListeners(),U=!P&&ov(e,t),q=P&&lv(e,r,t,a);(U||q)&&(p={...p,...ew(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:C}=p;y=p.data;let N=!1;if(t.placeholderData!==void 0&&y===void 0&&C==="pending"){let P;s?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(P=s.data,N=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,P!==void 0&&(C="success",y=vp(s?.data,P,t),g=!0)}if(t.select&&y!==void 0&&!N)if(s&&y===l?.data&&t.select===this.#l)y=this.#h;else try{this.#l=t.select,y=t.select(y),y=vp(s?.data,y,t),this.#h=y,this.#o=null}catch(P){this.#o=P}this.#o&&(v=this.#o,y=this.#h,w=Date.now(),C="error");const S=p.fetchStatus==="fetching",A=C==="pending",_=C==="error",k=A&&S,H=y!==void 0,D={status:C,fetchStatus:p.fetchStatus,isPending:A,isSuccess:C==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:S,isRefetching:S&&!A,isLoadingError:_&&!H,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:_&&H,isStale:cm(e,t),refetch:this.refetch,promise:this.#a,isEnabled:An(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=D.data!==void 0,U=D.status==="error"&&!P,q=Q=>{U?Q.reject(D.error):P&&Q.resolve(D.data)},I=()=>{const Q=this.#a=D.promise=bp();q(Q)},Y=this.#a;switch(Y.status){case"pending":e.queryHash===r.queryHash&&q(Y);break;case"fulfilled":(U||D.data!==Y.value)&&I();break;case"rejected":(!U||D.error!==Y.reason)&&I();break}}return D}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#p=this.#t),yp(t,e))return;this.#i=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!this.#m.size)return!0;const l=new Set(s??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const f=u;return this.#i[f]!==e[f]&&l.has(f)})};this.#E({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#E(e){jt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function G_(e,t){return An(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ov(e,t){return G_(e,t)||e.state.data!==void 0&&Sp(e,t,t.refetchOnMount)}function Sp(e,t,r){if(An(t.enabled,e)!==!1&&hi(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&cm(e,t)}return!1}function lv(e,t,r,a){return(e!==t||An(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&cm(e,r)}function cm(e,t){return An(t.enabled,e)!==!1&&e.isStaleByTime(hi(t.staleTime,e))}function X_(e,t){return!yp(e.getCurrentResult(),t)}function uv(e){return{onFetch:(t,r)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const d=async()=>{let p=!1;const g=w=>{P_(w,()=>t.signal,()=>p=!0)},y=Q1(t.options,t.fetchOptions),v=async(w,C,N)=>{if(p)return Promise.reject();if(C==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:C,direction:N?"backward":"forward",meta:t.options.meta};return g(M),M})(),_=await y(A),{maxPages:k}=t.options,H=N?H_:B_;return{pages:H(w.pages,_,k),pageParams:H(w.pageParams,C,k)}};if(s&&l.length){const w=s==="backward",C=w?Q_:cv,N={pages:l,pageParams:u},S=C(a,N);f=await v(N,S,w)}else{const w=e??l.length;do{const C=h===0?u[0]??a.initialPageParam:cv(a,f);if(h>0&&C==null)break;f=await v(f,C),h++}while(h<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}function cv(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function Q_(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var K_=class extends J1{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Z_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=W1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",s=!this.#i.canStart();try{if(a)t();else{this.#r({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:s})}const l=await this.#i.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),jt.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Z_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var W_=class extends pl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const a=new K_({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#e.add(e);const t=Gu(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Gu(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Gu(e);if(typeof t=="string"){const a=this.#t.get(t)?.find(s=>s.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Gu(e);return typeof t=="string"?this.#t.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){jt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>nv(t,r))}findAll(e={}){return this.getAll().filter(t=>nv(e,t))}notify(e){jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return jt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Wt))))}};function Gu(e){return e.options.scope?.id}var J_=class extends pl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const a=t.queryKey,s=t.queryHash??lm(a,t);let l=this.get(s);return l||(l=new Y_({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>tv(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>tv(e,r)):t}notify(e){jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){jt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},eN=class{#e;#t;#n;#i;#r;#s;#a;#o;constructor(e={}){this.#e=e.queryCache||new J_,this.#t=e.mutationCache||new W_,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=om.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=wc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(hi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(a.queryHash)?.state.data,u=z_(t,l);if(u!==void 0)return this.#e.build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return jt.batch(()=>this.#e.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;jt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return jt.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=jt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(r)));return Promise.all(a).then(Wt).catch(Wt)}invalidateQueries(e,t={}){return jt.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},a=jt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,r);return r.throwOnError||(l=l.catch(Wt)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(a).then(Wt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(hi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wt).catch(Wt)}fetchInfiniteQuery(e){return e.behavior=uv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wt).catch(Wt)}ensureInfiniteQueryData(e){return e.behavior=uv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set($o(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(a=>{Go(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){this.#r.set($o(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(a=>{Go(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===um&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tw=B.createContext(void 0),fm=e=>{const t=B.useContext(tw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tN=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(tw.Provider,{value:e,children:t})),nw=B.createContext(!1),nN=()=>B.useContext(nw);nw.Provider;function rN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var iN=B.createContext(rN()),aN=()=>B.useContext(iN),sN=(e,t,r)=>{const a=r?.state.error&&typeof e.throwOnError=="function"?K1(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},oN=e=>{B.useEffect(()=>{e.clearReset()},[e])},lN=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||K1(r,[e.error,a])),uN=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>r(a(...s)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},cN=(e,t)=>e.isLoading&&e.isFetching&&!t,fN=(e,t)=>e?.suspense&&t.isPending,fv=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function dN(e,t,r){const a=nN(),s=aN(),l=fm(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=l.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",uN(u),sN(u,s,f),oN(s);const h=!l.getQueryCache().get(u.queryHash),[d]=B.useState(()=>new t(l,u)),p=d.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(y=>{const v=g?d.subscribe(jt.batchCalls(y)):Wt;return d.updateResult(),v},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),B.useEffect(()=>{d.setOptions(u)},[u,d]),fN(u,p))throw fv(u,d,s);if(lN({result:p,errorResetBoundary:s,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw p.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,p),u.experimental_prefetchInRender&&!Xo.isServer()&&cN(p,a)&&(h?fv(u,d,s):f?.promise)?.catch(Wt).finally(()=>{d.updateResult()}),u.notifyOnChangeProps?p:d.trackResult(p)}function aa(e,t){return dN(e,$_)}var Io=typeof window<"u"?B.useLayoutEffect:B.useEffect;function Ah(e){const t=B.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function hN(e,t,r={},a={}){B.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([l])=>{t(l)},r);return s.observe(e.current),()=>{s.disconnect()}},[t,r,a.disabled,e])}function pN(e){const t=B.useRef(null);return B.useImperativeHandle(e,()=>t.current,[]),t}var rw=!1;function Qo(e){return e[e.length-1]}function mN(e){return typeof e=="function"}function ci(e,t){return mN(e)?e(t):e}var gN=Object.prototype.hasOwnProperty,dv=Object.prototype.propertyIsEnumerable,yN=()=>Object.create(null),Hi=(e,t)=>qi(e,t,yN);function qi(e,t,r=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const s=t,l=mv(e)&&mv(s);if(!l&&!(hs(e)&&hs(s)))return s;const u=l?e:hv(e);if(!u)return s;const f=l?s:hv(s);if(!f)return s;const h=u.length,d=f.length,p=l?new Array(d):r();let g=0;for(let y=0;y<d;y++){const v=l?y:f[y],w=e[v],C=s[v];if(w===C){p[v]=w,(l?y<h:gN.call(e,v))&&g++;continue}if(w===null||C===null||typeof w!="object"||typeof C!="object"){p[v]=C;continue}const N=qi(w,C,r,a+1);p[v]=N,N===w&&g++}return h===d&&g===h?e:p}function hv(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!dv.call(e,s))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const a=t;for(const s of r){if(!dv.call(e,s))return!1;a.push(s)}return a}function hs(e){if(!pv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!pv(r)||!r.hasOwnProperty("isPrototypeOf"))}function pv(e){return Object.prototype.toString.call(e)==="[object Object]"}function mv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xi(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,s=e.length;a<s;a++)if(!Xi(e[a],t[a],r))return!1;return!0}if(hs(e)&&hs(t)){const a=r?.ignoreUndefined??!0;if(r?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!Xi(e[u],t[u],r))return!1;return!0}let s=0;if(!a)s=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&s++;let l=0;for(const u in t)if((!a||t[u]!==void 0)&&(l++,l>s||!Xi(e[u],t[u],r)))return!1;return s===l}return!1}function ps(e){let t,r;const a=new Promise((s,l)=>{t=s,r=l});return a.status="pending",a.resolve=s=>{a.status="resolved",a.value=s,t(s),e?.(s)},a.reject=s=>{a.status="rejected",r(s)},a}function Ko(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function xN(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function gv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return xN(t)}var vN=["http:","https:","mailto:","tel:"];function Sc(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}function Co(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,a="",s;for(;(s=t.exec(e))!==null;)a+=gv(e.slice(r,s.index))+s[0],r=t.lastIndex;a=a+gv(r?e.slice(r):e);let l=!1;return a.startsWith("//")&&(l=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:l}}function bN(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function wN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mr(){throw new Error("Invariant failed")}function Zo(e){const t=new Map;let r,a;const s=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,a&&(a.next=l,l.prev=a)):(l.next.prev=void 0,r=l.next,l.next=void 0,a&&(l.prev=a,a.next=l)),a=l)};return{get(l){const u=t.get(l);if(u)return s(u),u.value},set(l,u){if(t.size>=e&&r){const h=r;t.delete(h.key),h.next&&(r=h.next,h.next.prev=void 0),h===a&&(a=void 0)}const f=t.get(l);if(f)f.value=u,s(f);else{const h={key:l,value:u,prev:a};a&&(a.next=h),a=h,r||(r=h),t.set(l,h)}},clear(){t.clear(),r=void 0,a=void 0}}}var Fi=4,iw=5;function SN(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function dm(e,t,r=new Uint16Array(6)){const a=e.indexOf("/",t),s=a===-1?e.length:a,l=e.substring(t,s);if(!l||!l.includes("$"))return r[0]=0,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r;if(l==="$"){const f=e.length;return r[0]=2,r[1]=t,r[2]=t,r[3]=f,r[4]=f,r[5]=f,r}if(l.charCodeAt(0)===36)return r[0]=1,r[1]=t,r[2]=t+1,r[3]=s,r[4]=s,r[5]=s,r;const u=SN(l);if(u){const[f,h]=u,d=l.charCodeAt(f+1);if(d===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const p=f+3,g=h;if(p<g)return r[0]=3,r[1]=t+f,r[2]=t+p,r[3]=t+g,r[4]=t+h+1,r[5]=s,r}}else if(d===36){const p=f+1,g=f+2;return g===h?(r[0]=2,r[1]=t+f,r[2]=t+p,r[3]=t+g,r[4]=t+h+1,r[5]=e.length,r):(r[0]=1,r[1]=t+f,r[2]=t+g,r[3]=t+h,r[4]=t+h+1,r[5]=s,r)}}return r[0]=0,r[1]=t,r[2]=t,r[3]=s,r[4]=s,r[5]=s,r}function Yc(e,t,r,a,s,l,u){u?.(r);let f=a;{const h=r.fullPath??r.from,d=h.length,p=r.options?.caseSensitive??e,g=!!(r.options?.params?.parse&&r.options?.skipRouteOnParseError?.params);for(;f<d;){const v=dm(h,f,t);let w;const C=f,N=v[5];switch(f=N+1,l++,v[0]){case 0:{const S=h.substring(v[2],v[3]);if(p){const A=s.static?.get(S);if(A)w=A;else{s.static??=new Map;const _=Yi(r.fullPath??r.from);_.parent=s,_.depth=l,w=_,s.static.set(S,_)}}else{const A=S.toLowerCase(),_=s.staticInsensitive?.get(A);if(_)w=_;else{s.staticInsensitive??=new Map;const k=Yi(r.fullPath??r.from);k.parent=s,k.depth=l,w=k,s.staticInsensitive.set(A,k)}}break}case 1:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,H=A?_?A:A.toLowerCase():void 0,M=!g&&s.dynamic?.find(D=>!D.skipOnParamError&&D.caseSensitive===_&&D.prefix===k&&D.suffix===H);if(M)w=M;else{const D=jh(1,r.fullPath??r.from,_,k,H);w=D,D.depth=l,D.parent=s,s.dynamic??=[],s.dynamic.push(D)}break}case 3:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,H=A?_?A:A.toLowerCase():void 0,M=!g&&s.optional?.find(D=>!D.skipOnParamError&&D.caseSensitive===_&&D.prefix===k&&D.suffix===H);if(M)w=M;else{const D=jh(3,r.fullPath??r.from,_,k,H);w=D,D.parent=s,D.depth=l,s.optional??=[],s.optional.push(D)}break}case 2:{const S=h.substring(C,v[1]),A=h.substring(v[4],N),_=p&&!!(S||A),k=S?_?S:S.toLowerCase():void 0,H=A?_?A:A.toLowerCase():void 0,M=jh(2,r.fullPath??r.from,_,k,H);w=M,M.parent=s,M.depth=l,s.wildcard??=[],s.wildcard.push(M)}}s=w}if(g&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const v=Yi(r.fullPath??r.from);v.kind=iw,v.parent=s,l++,v.depth=l,s.pathless??=[],s.pathless.push(v),s=v}const y=(r.path||!r.children)&&!r.isRoot;if(y&&h.endsWith("/")){const v=Yi(r.fullPath??r.from);v.kind=Fi,v.parent=s,l++,v.depth=l,s.index=v,s=v}s.parse=r.options?.params?.parse??null,s.skipOnParamError=g,s.parsingPriority=r.options?.skipRouteOnParseError?.priority??0,y&&!s.route&&(s.route=r,s.fullPath=r.fullPath??r.from)}if(r.children)for(const h of r.children)Yc(e,t,h,f,s,l,u)}function Rh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function li(e){if(e.pathless)for(const t of e.pathless)li(t);if(e.static)for(const t of e.static.values())li(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())li(t);if(e.dynamic?.length){e.dynamic.sort(Rh);for(const t of e.dynamic)li(t)}if(e.optional?.length){e.optional.sort(Rh);for(const t of e.optional)li(t)}if(e.wildcard?.length){e.wildcard.sort(Rh);for(const t of e.wildcard)li(t)}}function Yi(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function jh(e,t,r,a,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:a,suffix:s}}function EN(e,t){const r=Yi("/"),a=new Uint16Array(6);for(const s of e)Yc(!1,a,s,1,r,0);li(r),t.masksTree=r,t.flatCache=Zo(1e3)}function CN(e,t){e||="/";const r=t.flatCache.get(e);if(r)return r;const a=hm(e,t.masksTree);return t.flatCache.set(e,a),a}function _N(e,t,r,a,s){e||="/",a||="/";const l=t?`case\0${e}`:e;let u=s.singleCache.get(l);return u||(u=Yi("/"),Yc(t,new Uint16Array(6),{from:e},1,u,0),s.singleCache.set(l,u)),hm(a,u,r)}function NN(e,t,r=!1){const a=r?e:`nofuzz\0${e}`,s=t.matchCache.get(a);if(s!==void 0)return s;e||="/";let l;try{l=hm(e,t.segmentTree,r)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=TN(l.route)),t.matchCache.set(a,l),l}function kN(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function MN(e,t=!1,r){const a=Yi(e.fullPath),s=new Uint16Array(6),l={},u={};let f=0;return Yc(t,s,e,1,a,0,h=>{if(r?.(h,f),h.id in l&&Mr(),l[h.id]=h,f!==0&&h.path){const d=kN(h.fullPath);(!u[d]||h.fullPath.endsWith("/"))&&(u[d]=h)}f++}),li(a),{processedTree:{segmentTree:a,singleCache:Zo(1e3),matchCache:Zo(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function hm(e,t,r=!1){const a=e.split("/"),s=RN(e,a,t,r);if(!s)return null;const[l]=aw(e,a,s);return{route:s.node.route,rawParams:l,parsedParams:s.parsedParams}}function aw(e,t,r){const a=AN(r.node);let s=null;const l=Object.create(null);let u=r.extract?.part??0,f=r.extract?.node??0,h=r.extract?.path??0,d=r.extract?.segment??0;for(;f<a.length;u++,f++,h++,d++){const p=a[f];if(p.kind===Fi)break;if(p.kind===iw){d--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),p.kind===1){s??=r.node.fullPath.split("/");const v=s[d],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const C=p.suffix?.length??0,N=v.substring(w+2,v.length-C-1),S=g.substring(w,g.length-C);l[N]=decodeURIComponent(S)}else{const C=v.substring(1);l[C]=decodeURIComponent(g)}}else if(p.kind===3){if(r.skipped&1<<f){u--,h=y-1;continue}s??=r.node.fullPath.split("/");const v=s[d],w=p.prefix?.length??0,C=p.suffix?.length??0,N=v.substring(w+3,v.length-C-1),S=p.suffix||p.prefix?g.substring(w,g.length-C):g;S&&(l[N]=decodeURIComponent(S))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),C=decodeURIComponent(w);l["*"]=C,l._splat=C;break}}return r.rawParams&&Object.assign(l,r.rawParams),[l,{part:u,node:f,path:h,segment:d}]}function TN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function AN(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function RN(e,t,r,a){if(e==="/"&&r.index)return{node:r.index,skipped:0};const s=!Qo(t),l=s&&e!=="/",u=t.length-(s?1:0),f=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,d=null,p=null;for(;f.length;){const g=f.pop(),{node:y,index:v,skipped:w,depth:C,statics:N,dynamics:S,optionals:A}=g;let{extract:_,rawParams:k,parsedParams:H}=g;if(y.skipOnParamError){if(!Oh(e,t,g))continue;k=g.rawParams,_=g.extract,H=g.parsedParams}a&&y.route&&y.kind!==Fi&&_o(d,g)&&(d=g);const M=v===u;if(M&&(y.route&&!l&&_o(p,g)&&(p=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const D=M?void 0:t[v];let P;if(M&&y.index){const U={node:y.index,index:v,skipped:w,depth:C+1,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H};let q=!0;if(y.index.skipOnParamError&&(Oh(e,t,U)||(q=!1)),q){if(N===u&&!S&&!A&&!w)return U;_o(p,U)&&(p=U)}}if(y.wildcard&&_o(h,g))for(const U of y.wildcard){const{prefix:q,suffix:I}=U;if(q&&(M||!(U.caseSensitive?D:P??=D.toLowerCase()).startsWith(q)))continue;if(I){if(M)continue;const Q=t.slice(v).join("/").slice(-I.length);if((U.caseSensitive?Q:Q.toLowerCase())!==I)continue}const Y={node:U,index:u,skipped:w,depth:C,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H};if(!(U.skipOnParamError&&!Oh(e,t,Y))){h=Y;break}}if(y.optional){const U=w|1<<C,q=C+1;for(let I=y.optional.length-1;I>=0;I--){const Y=y.optional[I];f.push({node:Y,index:v,skipped:U,depth:q,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H})}if(!M)for(let I=y.optional.length-1;I>=0;I--){const Y=y.optional[I],{prefix:Q,suffix:L}=Y;if(Q||L){const V=Y.caseSensitive?D:P??=D.toLowerCase();if(Q&&!V.startsWith(Q)||L&&!V.endsWith(L))continue}f.push({node:Y,index:v+1,skipped:w,depth:q,statics:N,dynamics:S,optionals:A+1,extract:_,rawParams:k,parsedParams:H})}}if(!M&&y.dynamic&&D)for(let U=y.dynamic.length-1;U>=0;U--){const q=y.dynamic[U],{prefix:I,suffix:Y}=q;if(I||Y){const Q=q.caseSensitive?D:P??=D.toLowerCase();if(I&&!Q.startsWith(I)||Y&&!Q.endsWith(Y))continue}f.push({node:q,index:v+1,skipped:w,depth:C+1,statics:N,dynamics:S+1,optionals:A,extract:_,rawParams:k,parsedParams:H})}if(!M&&y.staticInsensitive){const U=y.staticInsensitive.get(P??=D.toLowerCase());U&&f.push({node:U,index:v+1,skipped:w,depth:C+1,statics:N+1,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H})}if(!M&&y.static){const U=y.static.get(D);U&&f.push({node:U,index:v+1,skipped:w,depth:C+1,statics:N+1,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H})}if(y.pathless){const U=C+1;for(let q=y.pathless.length-1;q>=0;q--){const I=y.pathless[q];f.push({node:I,index:v,skipped:w,depth:U,statics:N,dynamics:S,optionals:A,extract:_,rawParams:k,parsedParams:H})}}}if(p&&h)return _o(h,p)?p:h;if(p)return p;if(h)return h;if(a&&d){let g=d.index;for(let v=0;v<d.index;v++)g+=t[v].length;const y=g===e.length?"/":e.slice(g);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(y),d}return null}function Oh(e,t,r){try{const[a,s]=aw(e,t,r);r.rawParams=a,r.extract=s;const l=r.node.parse(a);return r.parsedParams=Object.assign(Object.create(null),r.parsedParams,l),!0}catch{return null}}function _o(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Fi)>(e.node.kind===Fi)||t.node.kind===Fi==(e.node.kind===Fi)&&t.depth>e.depth))):!0}function cc(e){return pm(e.filter(t=>t!==void 0).join("/"))}function pm(e){return e.replace(/\/{2,}/g,"/")}function sw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function pi(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function ow(e){return pi(sw(e))}function Ec(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function jN(e,t,r){return Ec(e,r)===Ec(t,r)}function ON({base:e,to:t,trailingSlash:r="never",cache:a}){const s=t.startsWith("/"),l=!s&&t===".";let u;if(a){u=s?t:l?e:e+"\0"+t;const g=a.get(u);if(g)return g}let f;if(l)f=e.split("/");else if(s)f=t.split("/");else{for(f=e.split("/");f.length>1&&Qo(f)==="";)f.pop();const g=t.split("/");for(let y=0,v=g.length;y<v;y++){const w=g[y];w===""?y?y===v-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Qo(f)===""?r==="never"&&f.pop():r==="always"&&f.push(""));let h,d="";for(let g=0;g<f.length;g++){g>0&&(d+="/");const y=f[g];if(!y)continue;h=dm(y,0,h);const v=h[0];if(v===0){d+=y;continue}const w=h[5],C=y.substring(0,h[1]),N=y.substring(h[4],w),S=y.substring(h[2],h[3]);v===1?d+=C||N?`${C}{$${S}}${N}`:`$${S}`:v===2?d+=C||N?`${C}{$}${N}`:"$":d+=`${C}{-$${S}}${N}`}d=pm(d);const p=d||"/";return u&&a&&a.set(u,p),p}function DN(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),r=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(r,"g");return s=>s.replace(a,l=>t.get(l)??l)}function Dh(e,t,r){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(s=>xv(s,r)).join("/"):xv(a,r)}function yv({path:e,params:t,decoder:r,...a}){let s=!1;const l=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:s};const u=e.length;let f=0,h,d="";for(;f<u;){const p=f;h=dm(e,p,h);const g=h[5];if(f=g+1,p===g)continue;const y=h[0];if(y===0){d+="/"+e.substring(p,g);continue}if(y===2){const v=t._splat;l._splat=v,l["*"]=v;const w=e.substring(p,h[1]),C=e.substring(h[4],g);if(!v){s=!0,(w||C)&&(d+="/"+w+C);continue}const N=Dh("_splat",t,r);d+="/"+w+N+C;continue}if(y===1){const v=e.substring(h[2],h[3]);!s&&!(v in t)&&(s=!0),l[v]=t[v];const w=e.substring(p,h[1]),C=e.substring(h[4],g),N=Dh(v,t,r)??"undefined";d+="/"+w+N+C;continue}if(y===3){const v=e.substring(h[2],h[3]),w=t[v];if(w==null)continue;l[v]=w;const C=e.substring(p,h[1]),N=e.substring(h[4],g),S=Dh(v,t,r)??"";d+="/"+C+S+N;continue}}return e.endsWith("/")&&(d+="/"),{usedParams:l,interpolatedPath:d||"/",isMissingParams:s}}function xv(e,t){const r=encodeURIComponent(e);return t?.(r)??r}function Ut(e){return!!e?.isNotFound}function zN(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var LN="tsr-scroll-restoration-v1_3";function IN(){const e=zN();if(!e)return null;let t={};try{const a=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");hs(a)&&(t=a)}catch{}return{get state(){return t},set:a=>{t=ci(a,t)||t},persist:()=>{try{e.setItem(LN,JSON.stringify(t))}catch{}}}}var vv=IN(),BN=e=>e.state.__TSR_key||e.href;function HN(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}var Xu=!1,No="window",bv="data-scroll-restoration-id";function PN(e,t){if(!vv)return;const r=vv;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!r)return;e.isScrollRestorationSetup=!0,Xu=!1;const a=e.options.getScrollRestorationKey||BN,s=new Map;window.history.scrollRestoration="manual";const l=f=>{if(!(Xu||!e.isScrollRestoring))if(f.target===document||f.target===window)s.set(No,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const h=f.target;s.set(h,{scrollX:h.scrollLeft||0,scrollY:h.scrollTop||0})}},u=f=>{if(!e.isScrollRestoring||!f||s.size===0||!r)return;const h=r.state[f]||={};for(const[d,p]of s){let g;if(d===No)g=No;else if(d.isConnected){const y=d.getAttribute(bv);g=y?`[${bv}="${y}"]`:HN(d)}g&&(h[g]=p)}};document.addEventListener("scroll",l,!0),e.subscribe("onBeforeLoad",f=>{u(f.fromLocation?a(f.fromLocation):void 0),s.clear()}),window.addEventListener("pagehide",()=>{u(a(e.stores.resolvedLocation.state??e.stores.location.state)),r.persist()}),e.subscribe("onRendered",f=>{const h=a(f.toLocation),d=e.options.scrollRestorationBehavior,p=e.options.scrollToTopSelectors;if(s.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Xu=!0;try{const g=e.isScrollRestoring?r.state[h]:void 0;let y=!1;if(g)for(const v in g){const w=g[v];if(!hs(w))continue;const{scrollX:C,scrollY:N}=w;if(!(!Number.isFinite(C)||!Number.isFinite(N))){if(v===No)window.scrollTo({top:N,left:C,behavior:d}),y=!0;else if(v){let S;try{S=document.querySelector(v)}catch{continue}S&&(S.scrollLeft=C,S.scrollTop=N,y=!0)}}}if(!y){const v=e.history.location.hash.slice(1);if(v){const w=window.history.state?.__hashScrollIntoViewOptions??!0;if(w){const C=document.getElementById(v);C&&C.scrollIntoView(w)}}else{const w={top:0,left:0,behavior:d};if(window.scrollTo(w),p)for(const C of p){if(C===No)continue;const N=typeof C=="function"?C():document.querySelector(C);N&&N.scrollTo(w)}}}}finally{Xu=!1}e.isScrollRestoring&&r.set(g=>(g[h]||={},g))}})}function UN(e,t=String){const r=new URLSearchParams;for(const a in e){const s=e[a];s!==void 0&&r.set(a,t(s))}return r.toString()}function zh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function VN(e){const t=new URLSearchParams(e),r=Object.create(null);for(const[a,s]of t.entries()){const l=r[a];l==null?r[a]=zh(s):Array.isArray(l)?l.push(zh(s)):r[a]=[l,zh(s)]}return r}var qN=YN(JSON.parse),FN=$N(JSON.stringify,JSON.parse);function YN(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=VN(t);for(const a in r){const s=r[a];if(typeof s=="string")try{r[a]=e(s)}catch{}}return r}}function $N(e,t){const r=typeof t=="function";function a(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(r&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const l=UN(s,a);return l?`?${l}`:""}}var Qi="__root__";function GN(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function en(e){return e instanceof Response&&!!e.options}function XN(e){return{input:({url:t})=>{for(const r of e)t=Ep(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=lw(e[r],t);return t}}}function QN(e){const t=ow(e.basepath),r=`/${t}`,a=`${r}/`,s=e.caseSensitive?r:r.toLowerCase(),l=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===s?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(r.length)),u},output:({url:u})=>(u.pathname=cc(["/",t,u.pathname]),u)}}function Ep(e,t){const r=e?.input?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function lw(e,t){const r=e?.output?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function KN(e,t){const{createMutableStore:r,createReadonlyStore:a,batch:s,init:l}=t,u=new Map,f=new Map,h=new Map,d=r(e.status),p=r(e.loadedAt),g=r(e.isLoading),y=r(e.isTransitioning),v=r(e.location),w=r(e.resolvedLocation),C=r(e.statusCode),N=r(e.redirect),S=r([]),A=r([]),_=r([]),k=a(()=>Lh(u,S.state)),H=a(()=>Lh(f,A.state)),M=a(()=>Lh(h,_.state)),D=a(()=>S.state[0]),P=a(()=>S.state.some(F=>u.get(F)?.state.status==="pending")),U=a(()=>({locationHref:v.state.href,resolvedLocationHref:w.state?.href,status:d.state})),q=a(()=>({status:d.state,loadedAt:p.state,isLoading:g.state,isTransitioning:y.state,matches:k.state,location:v.state,resolvedLocation:w.state,statusCode:C.state,redirect:N.state})),I=Zo(64);function Y(F){let X=I.get(F);return X||(X=a(()=>{const Z=S.state;for(const j of Z){const z=u.get(j);if(z&&z.routeId===F)return z.state}}),I.set(F,X)),X}const Q={status:d,loadedAt:p,isLoading:g,isTransitioning:y,location:v,resolvedLocation:w,statusCode:C,redirect:N,matchesId:S,pendingMatchesId:A,cachedMatchesId:_,activeMatchesSnapshot:k,pendingMatchesSnapshot:H,cachedMatchesSnapshot:M,firstMatchId:D,hasPendingMatches:P,matchRouteReactivity:U,activeMatchStoresById:u,pendingMatchStoresById:f,cachedMatchStoresById:h,__store:q,getMatchStoreByRouteId:Y,setActiveMatches:L,setPendingMatches:V,setCachedMatches:T};L(e.matches),l?.(Q);function L(F){Ih(F,u,S,r,s)}function V(F){Ih(F,f,A,r,s)}function T(F){Ih(F,h,_,r,s)}return Q}function Lh(e,t){const r=[];for(const a of t){const s=e.get(a);s&&r.push(s.state)}return r}function Ih(e,t,r,a,s){const l=e.map(f=>f.id),u=new Set(l);s(()=>{for(const f of t.keys())u.has(f)||t.delete(f);for(const f of e){const h=t.get(f.id);if(!h){const d=a(f);d.routeId=f.routeId,t.set(f.id,d);continue}h.routeId=f.routeId,h.state!==f&&h.setState(()=>f)}wN(r.state,l)||r.setState(()=>l)})}var Cp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ZN=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),$c=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),Ki=(e,t,r=!0)=>{const a={...e.router.options.context??{}},s=r?t:t-1;for(let l=0;l<=s;l++){const u=e.matches[l];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},wv=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),s=a>=0?a:0;let l=r?e.matches.findIndex(u=>u.routeId===r):e.firstBadMatchIndex??e.matches.length-1;l<0&&(l=s);for(let u=l;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return r?l:s},fi=(e,t,r)=>{if(!(!en(r)&&!Ut(r)))throw en(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,a=>({...a,status:en(r)?"redirected":a.status==="pending"?"success":a.status,context:Ki(e,t.index),isFetching:!1,error:r})),Ut(r)&&!r.routeId&&(r.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),en(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},uw=(e,t)=>{const r=e.router.getMatch(t);return!!(!r||r._nonReactive.dehydrated)},Sv=(e,t,r)=>{const a=Ki(e,r);e.updateMatch(t,s=>({...s,context:a}))},ko=(e,t,r,a)=>{const{id:s,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(r instanceof Promise)throw r;r.routerCode=a,e.firstBadMatchIndex??=t,fi(e,e.router.getMatch(s),r);try{u.options.onError?.(r)}catch(f){r=f,fi(e,e.router.getMatch(s),r)}e.updateMatch(s,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!en(r)&&!Ut(r)&&(e.serialError??=r)},cw=(e,t,r,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const s=r.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!$c(e,t)&&(r.options.loader||r.options.beforeLoad||dw(r))&&typeof s=="number"&&s!==1/0&&(r.options.pendingComponent??e.router.options?.defaultPendingComponent)){const l=setTimeout(()=>{Cp(e)},s);a._nonReactive.pendingTimeout=l}},WN=(e,t,r)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;cw(e,t,r,a);const s=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&fi(e,l,l.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(s):s()},JN=(e,t,r,a)=>{const s=e.router.getMatch(t);let l=s._nonReactive.loadPromise;s._nonReactive.loadPromise=ps(()=>{l?.resolve(),l=void 0});const{paramsError:u,searchError:f}=s;u&&ko(e,r,u,"PARSE_PARAMS"),f&&ko(e,r,f,"VALIDATE_SEARCH"),cw(e,t,a,s);const h=new AbortController;let d=!1;const p=()=>{d||(d=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:h})))},g=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,k=>({...k,isFetching:!1}))};if(!a.options.beforeLoad){e.router.batch(()=>{p(),g()});return}s._nonReactive.beforeLoadPromise=ps();const y={...Ki(e,r,!1),...s.__routeContext},{search:v,params:w,cause:C}=s,N=$c(e,t),S={search:v,abortController:h,params:w,preload:N,context:y,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":C,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},A=k=>{if(k===void 0){e.router.batch(()=>{p(),g()});return}(en(k)||Ut(k))&&(p(),ko(e,r,k,"BEFORE_LOAD")),e.router.batch(()=>{p(),e.updateMatch(t,H=>({...H,__beforeLoadContext:k})),g()})};let _;try{if(_=a.options.beforeLoad(S),Ko(_))return p(),_.catch(k=>{ko(e,r,k,"BEFORE_LOAD")}).then(A)}catch(k){p(),ko(e,r,k,"BEFORE_LOAD")}A(_)},ek=(e,t)=>{const{id:r,routeId:a}=e.matches[t],s=e.router.looseRoutesById[a],l=()=>f(),u=()=>JN(e,r,t,s),f=()=>{if(uw(e,r))return;const h=WN(e,r,s);return Ko(h)?h.then(u):u()};return l()},tk=(e,t,r)=>{const a=e.router.getMatch(t);if(!a||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([r.options.head?.(s),r.options.scripts?.(s),r.options.headers?.(s)]).then(([l,u,f])=>({meta:l?.meta,links:l?.links,headScripts:l?.scripts,headers:f,scripts:u,styles:l?.styles}))},fw=(e,t,r,a,s)=>{const l=t[a-1],{params:u,loaderDeps:f,abortController:h,cause:d}=e.router.getMatch(r),p=Ki(e,a),g=$c(e,r);return{params:u,deps:f,preload:!!g,parentMatchPromise:l,abortController:h,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},Ev=async(e,t,r,a,s)=>{try{const l=e.router.getMatch(r);try{(!(rw??e.router.isServer)||l.ssr===!0)&&Wo(s);const u=s.options.loader,f=typeof u=="function"?u:u?.handler,h=f?.(fw(e,t,r,a,s)),d=!!f&&Ko(h);if((d||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||l._nonReactive.minPendingPromise)&&e.updateMatch(r,g=>({...g,isFetching:"loader"})),f){const g=d?await h:h;fi(e,e.router.getMatch(r),g),g!==void 0&&e.updateMatch(r,y=>({...y,loaderData:g}))}s._lazyPromise&&await s._lazyPromise;const p=l._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(r,g=>({...g,error:void 0,context:Ki(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let f=u;if(f?.name==="AbortError"){if(l.abortController.signal.aborted){l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:Ki(e,a)}));return}const h=l._nonReactive.minPendingPromise;h&&await h,Ut(u)&&await s.options.notFoundComponent?.preload?.(),fi(e,e.router.getMatch(r),u);try{s.options.onError?.(u)}catch(d){f=d,fi(e,e.router.getMatch(r),d)}!en(f)&&!Ut(f)&&await Wo(s,["errorComponent"]),e.updateMatch(r,d=>({...d,error:f,context:Ki(e,a),status:"error",isFetching:!1}))}}catch(l){const u=e.router.getMatch(r);u&&(u._nonReactive.loaderPromise=void 0),fi(e,u,l)}},nk=async(e,t,r)=>{async function a(v,w,C,N,S){const A=Date.now()-w.updatedAt,_=v?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,k=S.options.shouldReload,H=typeof k=="function"?k(fw(e,t,s,r,S)):k,{status:M,invalid:D}=N,P=A>=_&&(!!e.forceStaleReload||N.cause==="enter"||C!==void 0&&C!==N.id);u=M==="success"&&(D||(H??P)),v&&S.options.preload===!1||(u&&!e.sync&&p?(f=!0,(async()=>{try{await Ev(e,t,s,r,S);const U=e.router.getMatch(s);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){en(U)&&await e.router.navigate(U.options)}})()):M!=="success"||u?await Ev(e,t,s,r,S):Sv(e,s,r))}const{id:s,routeId:l}=e.matches[r];let u=!1,f=!1;const h=e.router.looseRoutesById[l],d=h.options.loader,p=((typeof d=="function"?void 0:d?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(uw(e,s)){if(!e.router.getMatch(s))return e.matches[r];Sv(e,s,r)}else{const v=e.router.getMatch(s),w=e.router.stores.matchesId.state[r],C=(w&&e.router.stores.activeMatchStoresById.get(w)||null)?.routeId===l?w:e.router.stores.activeMatchesSnapshot.state.find(S=>S.routeId===l)?.id,N=$c(e,s);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const S=e.router.getMatch(s),A=S._nonReactive.error||S.error;A&&fi(e,S,A),S.status==="pending"&&await a(N,v,C,S,h)}else{const S=N&&!e.router.stores.activeMatchStoresById.has(s),A=e.router.getMatch(s);A._nonReactive.loaderPromise=ps(),S!==A.preload&&e.updateMatch(s,_=>({..._,preload:S})),await a(N,v,C,A,h)}}const g=e.router.getMatch(s);f||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,f||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const y=f?g.isFetching:!1;return y!==g.isFetching||g.invalid!==!1?(e.updateMatch(s,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(s)):g};async function Cv(e){const t=e,r=[];ZN(t.router)&&Cp(t);let a;for(let y=0;y<t.matches.length;y++){try{const v=ek(t,y);Ko(v)&&await v}catch(v){if(en(v))throw v;if(Ut(v))a=v;else if(!t.preload)throw v;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,l=a&&!t.preload?wv(t,a):void 0,u=a&&t.preload?0:l!==void 0?Math.min(l+1,s):s;let f,h;for(let y=0;y<u;y++)r.push(nk(t,r,y));try{await Promise.all(r)}catch{const y=await Promise.allSettled(r);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(en(w))throw w;Ut(w)?f??=w:h??=w}if(h!==void 0)throw h}const d=f??(a&&!t.preload?a:void 0);let p=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!d&&a&&t.preload)return t.matches;if(d){const y=wv(t,d);y===void 0&&Mr();const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],C=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&C&&(w.options.notFoundComponent=C),d.routeId=v.routeId;const N=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,S=>({...S,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),p=y,await Wo(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Wo(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],C=t.router.looseRoutesById[w];try{const N=tk(t,v,C);if(N){const S=await N;t.updateMatch(v,A=>({...A,...S}))}}catch(N){console.error(`Error executing head for route ${w}:`,N)}}const g=Cp(t);if(Ko(g)&&await g,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function _v(e,t){const r=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(r.length!==0)return Promise.all(r)}function Wo(e,t=fc){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:s,...l}=a.options;Object.assign(e.options,l),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const r=()=>e._componentsLoaded?void 0:t===fc?(()=>{if(e._componentsPromise===void 0){const a=_v(e,fc);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():_v(e,t);return e._lazyPromise?e._lazyPromise.then(r):r()}function dw(e){for(const t of fc)if(e.options[t]?.preload)return!0;return!1}var fc=["component","errorComponent","pendingComponent","notFoundComponent"],mi="__TSR_index",Nv="popstate",kv="beforeunload";function rk(e){let t=e.getLocation();const r=new Set,a=u=>{t=e.getLocation(),r.forEach(f=>f({location:t,action:u}))},s=u=>{e.notifyOnIndexChange??!0?a(u):t=e.getLocation()},l=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const d=e.getBlockers?.()??[],p=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&d.length&&p)for(const g of d){const y=Jo(h.path,h.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:u=>(r.add(u),()=>{r.delete(u)}),push:(u,f,h)=>{const d=t.state[mi];f=Mv(d+1,f),l({task:()=>{e.pushState(u,f),a({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const d=t.state[mi];f=Mv(d,f),l({task:()=>{e.replaceState(u,f),a({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{l({task:()=>{e.go(u),s({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[mi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(d=>d!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function Mv(e,t){t||(t={});const r=mm();return{...t,key:r,__TSR_key:r,[mi]:e}}function hw(e){const t=e?.window??(typeof document<"u"?window:void 0),r=t.history.pushState,a=t.history.replaceState;let s=[];const l=()=>s,u=P=>s=P,f=e?.createHref??(P=>P),h=e?.parseLocation??(()=>Jo(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=mm();t.history.replaceState({[mi]:0,key:P,__TSR_key:P},"")}let d=h(),p,g=!1,y=!1,v=!1,w=!1;const C=()=>d;let N,S;const A=()=>{N&&(D._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),D._ignoreSubscribers=!1,N=void 0,S=void 0,p=void 0)},_=(P,U,q)=>{const I=f(U);S||(p=d),d=Jo(U,q),N={href:I,state:q,isPush:N?.isPush||P==="push"},S||(S=Promise.resolve().then(()=>A()))},k=P=>{d=h(),D.notify({type:P})},H=async()=>{if(y){y=!1;return}const P=h(),U=P.state[mi]-d.state[mi],q=U===1,I=U===-1,Y=!q&&!I||g;g=!1;const Q=Y?"GO":I?"BACK":"FORWARD",L=Y?{type:"GO",index:U}:{type:I?"BACK":"FORWARD"};if(v)v=!1;else{const V=l();if(typeof document<"u"&&V.length){for(const T of V)if(await T.blockerFn({currentLocation:d,nextLocation:P,action:Q})){y=!0,t.history.go(1),D.notify(L);return}}}d=h(),D.notify(L)},M=P=>{if(w){w=!1;return}let U=!1;const q=l();if(typeof document<"u"&&q.length)for(const I of q){const Y=I.enableBeforeUnload??!0;if(Y===!0){U=!0;break}if(typeof Y=="function"&&Y()===!0){U=!0;break}}if(U)return P.preventDefault(),P.returnValue=""},D=rk({getLocation:C,getLength:()=>t.history.length,pushState:(P,U)=>_("push",P,U),replaceState:(P,U)=>_("replace",P,U),back:P=>(P&&(v=!0),w=!0,t.history.back()),forward:P=>{P&&(v=!0),w=!0,t.history.forward()},go:P=>{g=!0,t.history.go(P)},createHref:P=>f(P),flush:A,destroy:()=>{t.history.pushState=r,t.history.replaceState=a,t.removeEventListener(kv,M,{capture:!0}),t.removeEventListener(Nv,H)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(kv,M,{capture:!0}),t.addEventListener(Nv,H),t.history.pushState=function(...P){const U=r.apply(t.history,P);return D._ignoreSubscribers||k("PUSH"),U},t.history.replaceState=function(...P){const U=a.apply(t.history,P);return D._ignoreSubscribers||k("REPLACE"),U},D}function ik(e){const t=typeof document<"u"?window:void 0;return hw({window:t,parseLocation:()=>{const r=t.location.hash.split("#").slice(1),a=r[0]??"/",s=t.location.search,l=r.slice(1);return Jo(`${a}${s}${l.length===0?"":`#${l.join("#")}`}`,t.history.state)},createHref:r=>`${t.location.pathname}${t.location.search}#${r}`})}function ak(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Jo(e,t){const r=ak(e),a=r.indexOf("#"),s=r.indexOf("?"),l=mm();return{href:r,pathname:r.substring(0,a>0?s>0?Math.min(a,s):a:s>0?s:r.length),hash:a>-1?r.substring(a):"",search:s>-1?r.slice(s,a===-1?void 0:a):"",state:t||{[mi]:0,key:l,__TSR_key:l}}}function mm(){return(Math.random()+1).toString(36).substring(7)}function ss(e,t){const r=t,a=e;return{fromLocation:r,toLocation:a,pathChanged:r?.pathname!==a.pathname,hrefChanged:r?.href!==a.href,hashChanged:r?.hash!==a.hash}}var sk=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{const a=this.options,s=this.basepath??a?.basepath??"/",l=this.basepath===void 0,u=a?.rewrite;if(this.options={...a,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=DN(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=hw()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=Zo(1e3),p=this.buildRouteTree(),this.setRoutes(p)}if(!this.stores&&this.latestLocation){const p=this.getStoreConfig(this);this.batch=p.batch,this.stores=KN(lk(this.latestLocation),p),PN(this)}let f=!1;const h=this.options.basepath??"/",d=this.options.rewrite;if(l||s!==h||u!==d){this.basepath=h;const p=[],g=ow(h);g&&g!=="/"&&p.push(QN({basepath:h})),d&&p.push(d),this.rewrite=p.length===0?void 0:p.length===1?p[0]:XN(p),this.history&&this.updateLatestLocation(),f=!0}f&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=MN(this.routeTree,this.options.caseSensitive,(a,s)=>{a.init({originalIndex:s})});return this.options.routeMasks&&EN(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,a)=>{const s={eventType:r,fn:a};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=r=>{this.subscribers.forEach(a=>{a.eventType===r.type&&a.fn(r)})},this.parseLocation=(r,a)=>{const s=({pathname:h,search:d,hash:p,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const S=this.options.parseSearch(d),A=this.options.stringifySearch(S);return{href:h+A+p,publicHref:h+A+p,pathname:Co(h).path,external:!1,searchStr:A,search:Hi(a?.search,S),hash:Co(p.slice(1)).path,state:qi(a?.state,y)}}const v=new URL(g,this.origin),w=Ep(this.rewrite,v),C=this.options.parseSearch(w.search),N=this.options.stringifySearch(C);return w.search=N,{href:w.href.replace(w.origin,""),publicHref:g,pathname:Co(w.pathname).path,external:!!this.rewrite&&w.origin!==this.origin,searchStr:N,search:Hi(a?.search,C),hash:Co(w.hash.slice(1)).path,state:qi(a?.state,y)}},l=s(r),{__tempLocation:u,__tempKey:f}=l.state;if(u&&(!f||f===this.tempLocationKey)){const h=s(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(r,a)=>ON({base:r,to:pm(a),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,a,s)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:a},s):this.matchRoutesInternal(r,a),this.getMatchedRoutes=r=>uk({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const a=this.getMatch(r);a&&(a.abortController.abort(),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(r=>{this.cancelMatch(r)}),this.stores.matchesId.state.forEach(r=>{if(this.stores.pendingMatchStoresById.has(r))return;const a=this.stores.activeMatchStoresById.get(r)?.state;a&&(a.status==="pending"||a.isFetching==="loader")&&this.cancelMatch(r)})},this.buildLocation=r=>{const a=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,d=this.resolvePathWithBase(h,"."),p=f.search,g=Object.assign(Object.create(null),f.params),y=l.to?this.resolvePathWithBase(d,`${l.to}`):this.resolvePathWithBase(d,"."),v=l.params===!1||l.params===null?Object.create(null):(l.params??!0)===!0?g:Object.assign(g,ci(l.params,g)),w=this.getMatchedRoutes(y);let C=w.matchedRoutes;if((!w.foundRoute||w.foundRoute.path!=="/"&&w.routeParams["**"])&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]),Object.keys(v).length>0)for(const q of C){const I=q.options.params?.stringify??q.options.stringifyParams;if(I)try{Object.assign(v,I(v))}catch{}}const N=r.leaveParams?y:Co(yv({path:y,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=p;if(r._includeValidateSearch&&this.options.search?.strict){const q={};C.forEach(I=>{if(I.options.validateSearch)try{Object.assign(q,dc(I.options.validateSearch,{...q,...S}))}catch{}}),S=q}S=ck({search:S,dest:l,destRoutes:C,_includeValidateSearch:r._includeValidateSearch}),S=Hi(p,S);const A=this.options.stringifySearch(S),_=l.hash===!0?u.hash:l.hash?ci(l.hash,u.hash):void 0,k=_?`#${_}`:"";let H=l.state===!0?u.state:l.state?ci(l.state,u.state):{};H=qi(u.state,H);const M=`${N}${A}${k}`;let D,P,U=!1;if(this.rewrite){const q=new URL(M,this.origin),I=lw(this.rewrite,q);D=q.href.replace(q.origin,""),I.origin!==this.origin?(P=I.href,U=!0):P=I.pathname+I.search+I.hash}else D=bN(M),P=D;return{publicHref:P,href:D,pathname:N,search:S,searchStr:A,state:H,hash:_??"",external:U,unmaskOnReload:l.unmaskOnReload}},s=(l={},u)=>{const f=a(l);let h=u?a(u):void 0;if(!h){const d=Object.create(null);if(this.options.routeMasks){const p=CN(f.pathname,this.processedTree);if(p){Object.assign(d,p.rawParams);const{from:g,params:y,...v}=p.route,w=y===!1||y===null?Object.create(null):(y??!0)===!0?d:Object.assign(d,ci(y,d));u={from:r.from,...v,params:w},h=a(u)}}}return h&&(f.maskedLocation=h),f};return r.mask?s(r,{from:r.from,...r.mask}):s(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:a,...s})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(p=>{s.state[p]=this.latestLocation.state[p]});const d=Xi(s.state,this.latestLocation.state);return h.forEach(p=>{delete s.state[p]}),d},u=pi(this.latestLocation.href)===pi(s.href);let f=this.commitLocationPromise;if(this.commitLocationPromise=ps(()=>{f?.resolve(),f=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:d,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[s.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:a})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:a,hashScrollIntoView:s,viewTransition:l,ignoreBlocker:u,href:f,...h}={})=>{if(f){const g=this.history.location.state.__TSR_index,y=Jo(f,{__TSR_index:r?g:g+1}),v=new URL(y.pathname,this.origin);h.to=Ep(this.rewrite,v).pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const d=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:l,replace:r,resetScroll:a,hashScrollIntoView:s,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:r,reloadDocument:a,href:s,publicHref:l,...u})=>{let f=!1;if(s)try{new URL(`${s}`),f=!0}catch{}if(f&&!a&&(a=!0),a){if(r!==void 0||!s){const d=this.buildLocation({to:r,...u});s=s??d.publicHref,l=l??d.publicHref}const h=!f&&l?l:s;if(Sc(h,this.protocolAllowlist))return Promise.resolve();if(!u.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const p of d)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:s,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation),a=this.stores.cachedMatchesSnapshot.state.filter(s=>!r.some(l=>l.id===s.id));this.batch(()=>{this.stores.status.setState(()=>"pending"),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(r),this.stores.setCachedMatches(a)})},this.load=async r=>{let a,s,l;const u=this.stores.resolvedLocation.state??this.stores.location.state;for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,p=this.stores.resolvedLocation.state,g=ss(d,p);this.stores.redirect.state||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await Cv({router:this,sync:r?.sync,forceStaleReload:u.href===d.href,matches:this.stores.pendingMatchesSnapshot.state,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=null,v=null,w=null,C=null;this.batch(()=>{const N=this.stores.pendingMatchesSnapshot.state,S=N.length,A=this.stores.activeMatchesSnapshot.state;y=S?A.filter(H=>!this.stores.pendingMatchStoresById.has(H.id)):null;const _=new Set;for(const H of this.stores.pendingMatchStoresById.values())H.routeId&&_.add(H.routeId);const k=new Set;for(const H of this.stores.activeMatchStoresById.values())H.routeId&&k.add(H.routeId);v=S?A.filter(H=>!_.has(H.routeId)):null,w=S?N.filter(H=>!k.has(H.routeId)):null,C=S?N.filter(H=>k.has(H.routeId)):A,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),S&&(this.stores.setActiveMatches(N),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...y.filter(H=>H.status!=="error"&&H.status!=="notFound"&&H.status!=="redirected")]),this.clearExpiredCache())});for(const[N,S]of[[v,"onLeave"],[w,"onEnter"],[C,"onStay"]])if(N)for(const A of N)this.looseRoutesById[A.routeId].options[S]?.(A)})})}})}catch(d){en(d)?(a=d,this.navigate({...a.options,replace:!0,ignoreBlocker:!0})):Ut(d)&&(s=d);const p=a?a.status:s?404:this.stores.activeMatchesSnapshot.state.some(g=>g.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>p),this.stores.redirect.setState(()=>a)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let f;this.hasNotFoundMatch()?f=404:this.stores.activeMatchesSnapshot.state.some(h=>h.status==="error")&&(f=500),f!==void 0&&this.stores.statusCode.setState(()=>f)},this.startViewTransition=r=>{const a=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,a&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof a=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.stores.resolvedLocation.state,f=typeof a.types=="function"?a.types(ss(l,u)):a.types;if(f===!1){r();return}s={update:r,types:f}}else s=r;document.startViewTransition(s)}else r()},this.updateMatch=(r,a)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStoresById.get(r);if(s){s.setState(a);return}const l=this.stores.activeMatchStoresById.get(r);if(l){l.setState(a);return}const u=this.stores.cachedMatchStoresById.get(r);if(u){const f=a(u.state);f.status==="redirected"?this.stores.cachedMatchStoresById.delete(r)&&this.stores.cachedMatchesId.setState(h=>h.filter(d=>d!==r)):u.setState(()=>f)}})},this.getMatch=r=>this.stores.cachedMatchStoresById.get(r)?.state??this.stores.pendingMatchStoresById.get(r)?.state??this.stores.activeMatchStoresById.get(r)?.state,this.invalidate=r=>{const a=s=>r?.filter?.(s)??!0?{...s,invalid:!0,...r?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(a)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(a)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(a))}),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const a=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const s=r.options._builtLocation??this.buildLocation(r.options),l=this.getParsedLocationHref(s);r.options.href=l,r.headers.set("Location",l)}else if(a)try{const s=new URL(a);if(this.origin&&s.origin===this.origin){const l=s.pathname+s.search+s.hash;r.options.href=l,r.headers.set("Location",l)}}catch{}if(r.options.href&&!r.options._builtLocation&&Sc(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const a=r?.filter;a!==void 0?this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(s=>!a(s))):this.stores.setCachedMatches([])},this.clearExpiredCache=()=>{const r=Date.now(),a=s=>{const l=this.looseRoutesById[s.routeId];if(!l.options.loader)return!0;const u=(s.preload?l.options.preloadGcTime??this.options.defaultPreloadGcTime:l.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:r-s.updatedAt>=u};this.clearCache({filter:a})},this.loadRouteChunk=Wo,this.preloadRoute=async r=>{const a=r._builtLocation??this.buildLocation(r);let s=this.matchRoutes(a,{throwOnError:!0,preload:!0,dest:r});const l=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),u=new Set([...l,...this.stores.cachedMatchesId.state]),f=s.filter(h=>!u.has(h.id));if(f.length){const h=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...h,...f])}try{return s=await Cv({router:this,matches:s,location:a,preload:!0,updateMatch:(h,d)=>{l.has(h)?s=s.map(p=>p.id===h?d(p):p):this.updateMatch(h,d)}}),s}catch(h){if(en(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:a});Ut(h)||console.error(h);return}},this.matchRoute=(r,a)=>{const s={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},l=this.buildLocation(s);if(a?.pending&&this.stores.status.state!=="pending")return!1;const u=(a?.pending===void 0?!this.stores.isLoading.state:a.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,f=_N(l.pathname,a?.caseSensitive??!1,a?.fuzzy??!1,u.pathname,this.processedTree);return!f||r.params&&!Xi(f.rawParams,r.params,{partial:!0})?!1:a?.includeSearch??!0?Xi(u.search,l.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(r=>r.status==="notFound"||r.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??FN,parseSearch:e.parseSearch??qN,protocolAllowlist:e.protocolAllowlist??vN}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:r}){this.routesById=e,this.routesByPath=t,this.processedTree=r;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const r=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:s,parsedParams:l}=r;let{matchedRoutes:u}=r,f=!1;(a?a.path!=="/"&&s["**"]:pi(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const h=f?dk(this.options.notFoundMode,u):void 0,d=new Array(u.length),p=new Map;for(const g of this.stores.activeMatchStoresById.values())g.routeId&&p.set(g.routeId,g.state);for(let g=0;g<u.length;g++){const y=u[g],v=d[g-1];let w,C,N;{const Q=v?.search??e.search,L=v?._strictSearch??void 0;try{const V=dc(y.options.validateSearch,{...Q})??void 0;w={...Q,...V},C={...L,...V},N=void 0}catch(V){let T=V;if(V instanceof Cc||(T=new Cc(V.message,{cause:V})),t?.throwOnError)throw T;w=Q,C={},N=T}}const S=y.options.loaderDeps?.({search:w})??"",A=S?JSON.stringify(S):"",{interpolatedPath:_,usedParams:k}=yv({path:y.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),H=y.id+_+A,M=this.getMatch(H),D=p.get(y.id),P=M?._strictParams??k;let U;if(!M)try{Tv(y,k,l,P)}catch(Q){if(Ut(Q)||en(Q)?U=Q:U=new ok(Q.message,{cause:Q}),t?.throwOnError)throw U}Object.assign(s,P);const q=D?"stay":"enter";let I;if(M)I={...M,cause:q,params:D?.params??s,_strictParams:P,search:Hi(D?D.search:M.search,w),_strictSearch:C};else{const Q=y.options.loader||y.options.beforeLoad||y.lazyFn||dw(y)?"pending":"success";I={id:H,ssr:y.options.ssr,index:g,routeId:y.id,params:D?.params??s,_strictParams:P,pathname:_,updatedAt:Date.now(),search:D?Hi(D.search,w):w,_strictSearch:C,searchError:void 0,status:Q,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:ps()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:D?qi(D.loaderDeps,S):S,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(I.globalNotFound=h===y.id),I.searchError=N;const Y=this.getParentContext(v);I.context={...Y,...I.__routeContext,...I.__beforeLoadContext},d[g]=I}for(let g=0;g<d.length;g++){const y=d[g],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),C=p.get(y.routeId);if(y.params=C?Hi(C.params,s):s,!w){const N=d[g-1],S=this.getParentContext(N);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:S??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:d,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...S,...y.__routeContext,...y.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:r,parsedParams:a}=this.getMatchedRoutes(e.pathname),s=Qo(t),l={...e.search};for(const p of t)try{Object.assign(l,dc(p.options.validateSearch,l))}catch{}const u=Qo(this.stores.matchesId.state),f=u&&this.stores.activeMatchStoresById.get(u)?.state,h=f&&f.routeId===s.id&&f.pathname===e.pathname;let d;if(h)d=f.params;else{const p=Object.assign(Object.create(null),r);for(const g of t)try{Tv(g,r,a??{},p)}catch{}d=p}return{matchedRoutes:t,fullPath:s.fullPath,search:l,params:d}}},Cc=class extends Error{},ok=class extends Error{};function lk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function dc(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Cc("Async validation not supported");if(r.issues)throw new Cc(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function uk({pathname:e,routesById:t,processedTree:r}){const a=Object.create(null),s=pi(e);let l,u;const f=NN(s,r,!0);return f&&(l=f.route,Object.assign(a,f.rawParams),u=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:l,parsedParams:u}}function ck({search:e,dest:t,destRoutes:r,_includeValidateSearch:a}){return fk(r)(e,t,a??!1)}function fk(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of e){if("search"in s.options)s.options.search?.middlewares&&t.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const l=({search:u,next:f})=>{let h=u;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(h=s.options.preSearchFilters.reduce((p,g)=>g(p),u));const d=f(h);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((p,g)=>g(p),d):d};t.middlewares.push(l)}if(s.options.validateSearch){const l=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...dc(s.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const r=({search:s})=>{const l=t.dest;return l.search?l.search===!0?s:ci(l.search,s):{}};t.middlewares.push(r);const a=(s,l,u)=>{if(s>=u.length)return l;const f=u[s];return f({search:l,next:d=>a(s+1,d,u)})};return function(l,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,l,t.middlewares)}}function dk(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const a=t[r];if(a.children)return a.id}return Qi}function Tv(e,t,r,a){const s=e.options.params?.parse??e.options.parseParams;if(s)if(e.options.skipRouteOnParseError)for(const l in t)l in r&&(a[l]=r[l]);else{const l=s(a);Object.assign(a,l)}}var hk="Error preloading route! ☝️",pw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Qi:this.parentRoute||Mr();let s=a?Qi:r?.path;s&&s!=="/"&&(s=sw(s));const l=r?.id||s;let u=a?Qi:cc([this.parentRoute.id==="__root__"?"":this.parentRoute.id,l]);s==="__root__"&&(s="/"),u!=="__root__"&&(u=cc(["/",u]));const f=u==="__root__"?"/":cc([this.parentRoute.fullPath,s]);this._path=s,this._id=u,this._fullPath=f,this._to=pi(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>GN({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},pk=class extends pw{constructor(e){super(e)}};function mk(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.state,r=t.state.__hashScrollIntoViewOptions??!0;if(r&&t.hash!==""){const a=document.getElementById(t.hash);a&&a.scrollIntoView(r)}}}function gm(e){const t=e.errorComponent??ym;return b.jsx(gk,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:a})=>r?B.createElement(t,{error:r,reset:a}):e.children})}var gk=class extends B.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function ym({error:e}){const[t,r]=B.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(a=>!a),children:t?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),t?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?b.jsx("code",{children:e.message}):null})}):null]})}function yk({children:e,fallback:t=null}){return mw()?b.jsx(ds.Fragment,{children:e}):b.jsx(ds.Fragment,{children:t})}function mw(){return ds.useSyncExternalStore(xk,()=>!0,()=>!1)}function xk(){return()=>{}}var gw=B.createContext(null);function rn(e){return B.useContext(gw)}var Gc=B.createContext(void 0),vk=B.createContext(void 0),ot=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(ot||{});function bk({update:e,notify:t,unwatched:r}){return{link:a,unlink:s,propagate:l,checkDirty:u,shallowPropagate:f};function a(d,p,g){const y=p.depsTail;if(y!==void 0&&y.dep===d)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===d){v.version=g,p.depsTail=v;return}const w=d.subsTail;if(w!==void 0&&w.version===g&&w.sub===p)return;const C=p.depsTail=d.subsTail={version:g,dep:d,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=C),y!==void 0?y.nextDep=C:p.deps=C,w!==void 0?w.nextSub=C:d.subs=C}function s(d,p=d.sub){const g=d.dep,y=d.prevDep,v=d.nextDep,w=d.nextSub,C=d.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=C:g.subsTail=C,C!==void 0?C.nextSub=w:(g.subs=w)===void 0&&r(g),v}function l(d){let p=d.nextSub,g;e:do{const y=d.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&h(d,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const C=(d=w).nextSub;C!==void 0&&(g={value:p,prev:g},p=C);continue}}if((d=p)!==void 0){p=d.nextSub;continue}for(;g!==void 0;)if(d=g.value,g=g.prev,d!==void 0){p=d.nextSub;continue e}break}while(!0)}function u(d,p){let g,y=0,v=!1;e:do{const w=d.dep,C=w.flags;if(p.flags&16)v=!0;else if((C&17)===17){if(e(w)){const N=w.subs;N.nextSub!==void 0&&f(N),v=!0}}else if((C&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(g={value:d,prev:g}),d=w.deps,p=w,++y;continue}if(!v){const N=d.nextDep;if(N!==void 0){d=N;continue}}for(;y--;){const N=p.subs,S=N.nextSub!==void 0;if(S?(d=g.value,g=g.prev):d=N,v){if(e(p)){S&&f(N),p=d.sub;continue}v=!1}else p.flags&=-33;p=d.sub;const A=d.nextDep;if(A!==void 0){d=A;continue e}}return v}while(!0)}function f(d){do{const p=d.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((d=d.nextSub)!==void 0)}function h(d,p){let g=p.depsTail;for(;g!==void 0;){if(g===d)return!0;g=g.prevDep}return!1}}function xm(e,t,r){const a=typeof e=="object",s=a?e:void 0;return{next:(a?e.next:e)?.bind(s),error:(a?e.error:t)?.bind(s),complete:(a?e.complete:r)?.bind(s)}}const _p=[];let hc=0;const{link:Av,unlink:wk,propagate:Sk,checkDirty:yw,shallowPropagate:Rv}=bk({update(e){return e._update()},notify(e){_p[Np++]=e,e.flags&=~ot.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ot.Mutable|ot.Dirty,_c(e))}});let Qu=0,Np=0,Kn,kp=0;function xw(e){try{++kp,e()}finally{--kp||vw()}}function _c(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=wk(r,e)}function vw(){if(!(kp>0)){for(;Qu<Np;){const e=_p[Qu];_p[Qu++]=void 0,e.notify()}Qu=0,Np=0}}function bw(e,t){const r=typeof e=="function",a=e,s={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?ot.None:ot.Mutable,get(){return Kn!==void 0&&Av(s,Kn,hc),s._snapshot},subscribe(l){const u=xm(l),f={current:!1},h=Ek(()=>{s.get(),f.current?u.next?.(s._snapshot):f.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(l){const u=Kn,f=Object.is;if(r)Kn=s,++hc,s.depsTail=void 0;else if(l===void 0)return!1;r&&(s.flags=ot.Mutable|ot.RecursedCheck);try{const h=s._snapshot,d=typeof l=="function"?l(h):l===void 0&&r?a(h):l;return h===void 0||!f(h,d)?(s._snapshot=d,!0):!1}finally{Kn=u,r&&(s.flags&=~ot.RecursedCheck),_c(s)}}};return r?(s.flags=ot.Mutable|ot.Dirty,s.get=function(){const l=s.flags;if(l&ot.Dirty||l&ot.Pending&&yw(s.deps,s)){if(s._update()){const u=s.subs;u!==void 0&&Rv(u)}}else l&ot.Pending&&(s.flags=l&~ot.Pending);return Kn!==void 0&&Av(s,Kn,hc),s._snapshot}):s.set=function(l){if(s._update(l)){const u=s.subs;u!==void 0&&(Sk(u),Rv(u),vw())}},s}function Ek(e){const t=()=>{const a=Kn;Kn=r,++hc,r.depsTail=void 0,r.flags=ot.Watching|ot.RecursedCheck;try{return e()}finally{Kn=a,r.flags&=~ot.RecursedCheck,_c(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ot.Watching|ot.RecursedCheck,notify(){const a=this.flags;a&ot.Dirty||a&ot.Pending&&yw(this.deps,this)?t():this.flags=ot.Watching},stop(){this.flags=ot.None,this.depsTail=void 0,_c(this)}};return t(),r}class Ck{constructor(t){this.atom=bw(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(xm(t))}}class _k{constructor(t){this.atom=bw(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(xm(t))}}function jv(e){return typeof e=="function"?new _k(e):new Ck(e)}var Bh={exports:{}},Hh={},Ph={exports:{}},Uh={};var Ov;function Nk(){if(Ov)return Uh;Ov=1;var e=hl();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(g,y){var v=y(),w=a({inst:{value:v,getSnapshot:y}}),C=w[0].inst,N=w[1];return l(function(){C.value=v,C.getSnapshot=y,h(C)&&N({inst:C})},[g,v,y]),s(function(){return h(C)&&N({inst:C}),g(function(){h(C)&&N({inst:C})})},[g]),u(v),v}function h(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!r(g,v)}catch{return!0}}function d(g,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Uh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Uh}var Dv;function kk(){return Dv||(Dv=1,Ph.exports=Nk()),Ph.exports}var zv;function Mk(){if(zv)return Hh;zv=1;var e=hl(),t=kk();function r(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var a=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return Hh.useSyncExternalStoreWithSelector=function(d,p,g,y,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=f(function(){function S(M){if(!A){if(A=!0,_=M,M=y(M),v!==void 0&&C.hasValue){var D=C.value;if(v(D,M))return k=D}return k=M}if(D=k,a(_,M))return D;var P=y(M);return v!==void 0&&v(D,P)?(_=M,D):(_=M,k=P)}var A=!1,_,k,H=g===void 0?null:g;return[function(){return S(p())},H===null?void 0:function(){return S(H())}]},[p,g,y,v]);var N=s(d,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=N},[N]),h(N),N},Hh}var Lv;function Tk(){return Lv||(Lv=1,Bh.exports=Mk()),Bh.exports}var ww=Tk();const Ak=Fc(ww);function Rk(e,t){return e===t}function Vt(e,t,r=Rk){const a=B.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),s=B.useCallback(()=>e?.get(),[e]);return ww.useSyncExternalStoreWithSelector(a,s,s,t,r)}var jk={state:void 0,get:()=>{},subscribe:()=>()=>{}};function sa(e){const t=rn(),r=B.useContext(e.from?vk:Gc),a=e.from??r,s=a?e.from?t.stores.getMatchStoreByRouteId(a):t.stores.activeMatchStoresById.get(a):void 0,l=B.useRef(void 0);return Vt(s??jk,u=>{if((e.shouldThrow??!0)&&!u&&Mr(),u===void 0)return;const f=e.select?e.select(u):u;if(e.structuralSharing??t.options.defaultStructuralSharing){const h=qi(l.current,f);return l.current=h,h}return f})}function Sw(e){return sa({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ew(e){const{select:t,...r}=e;return sa({...r,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Cw(e){return sa({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function _w(e){return sa({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Xc(e){const t=rn();return B.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function Nw(e){return sa({...e,select:t=>e.select?e.select(t.context):t.context})}var Ok=$1();function Dk(e,t){const r=rn(),a=pN(t),{activeProps:s,inactiveProps:l,activeOptions:u,to:f,preload:h,preloadDelay:d,hashScrollIntoView:p,replace:g,startTransition:y,resetScroll:v,viewTransition:w,children:C,target:N,disabled:S,style:A,className:_,onClick:k,onBlur:H,onFocus:M,onMouseEnter:D,onMouseLeave:P,onTouchStart:U,ignoreBlocker:q,params:I,search:Y,hash:Q,state:L,mask:V,reloadDocument:T,unsafeRelative:F,from:X,_fromLocation:Z,...j}=e,z=mw(),$=B.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),R=Vt(r.stores.location,Te=>Te,(Te,ct)=>Te.href===ct.href),te=B.useMemo(()=>{const Te={_fromLocation:R,...$};return r.buildLocation(Te)},[r,R,$]),ue=te.maskedLocation?te.maskedLocation.publicHref:te.publicHref,fe=te.maskedLocation?te.maskedLocation.external:te.external,de=B.useMemo(()=>Pk(ue,fe,r.history,S),[S,fe,ue,r.history]),le=B.useMemo(()=>{if(de?.external)return Sc(de.href,r.protocolAllowlist)?void 0:de.href;if(!Uk(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),Sc(f,r.protocolAllowlist)?void 0:f}catch{}},[f,de,r.protocolAllowlist]),pe=B.useMemo(()=>{if(le)return!1;if(u?.exact){if(!jN(R.pathname,te.pathname,r.basepath))return!1}else{const Te=Ec(R.pathname,r.basepath),ct=Ec(te.pathname,r.basepath);if(!(Te.startsWith(ct)&&(Te.length===ct.length||Te[ct.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Xi(R.search,te.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?z&&R.hash===te.hash:!0},[u?.exact,u?.explicitUndefined,u?.includeHash,u?.includeSearch,R,le,z,te.hash,te.pathname,te.search,r.basepath]),we=pe?ci(s,{})??zk:Vh,Ee=pe?Vh:ci(l,{})??Vh,ve=[_,we.className,Ee.className].filter(Boolean).join(" "),Ce=(A||we.style||Ee.style)&&{...A,...we.style,...Ee.style},[ce,ge]=B.useState(!1),be=B.useRef(!1),De=e.reloadDocument||le?!1:h??r.options.defaultPreload,qe=d??r.options.defaultPreloadDelay??0,Fe=B.useCallback(()=>{r.preloadRoute({...$,_builtLocation:te}).catch(Te=>{console.warn(Te),console.warn(hk)})},[r,$,te]);hN(a,B.useCallback(Te=>{Te?.isIntersecting&&Fe()},[Fe]),Hk,{disabled:!!S||De!=="viewport"}),B.useEffect(()=>{be.current||!S&&De==="render"&&(Fe(),be.current=!0)},[S,Fe,De]);const _t=Te=>{const ct=Te.currentTarget.getAttribute("target"),ie=N!==void 0?N:ct;if(!S&&!Vk(Te)&&!Te.defaultPrevented&&(!ie||ie==="_self")&&Te.button===0){Te.preventDefault(),Ok.flushSync(()=>{ge(!0)});const me=r.subscribe("onResolved",()=>{me(),ge(!1)});r.navigate({...$,replace:g,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:q})}};if(le)return{...j,ref:a,href:le,...C&&{children:C},...N&&{target:N},...S&&{disabled:S},...A&&{style:A},..._&&{className:_},...k&&{onClick:k},...H&&{onBlur:H},...M&&{onFocus:M},...D&&{onMouseEnter:D},...P&&{onMouseLeave:P},...U&&{onTouchStart:U}};const Ot=Te=>{if(S||De!=="intent")return;if(!qe){Fe();return}const ct=Te.currentTarget;if(Mo.has(ct))return;const ie=setTimeout(()=>{Mo.delete(ct),Fe()},qe);Mo.set(ct,ie)},sn=Te=>{S||De!=="intent"||Fe()},wn=Te=>{if(S||!De||!qe)return;const ct=Te.currentTarget,ie=Mo.get(ct);ie&&(clearTimeout(ie),Mo.delete(ct))};return{...j,...we,...Ee,href:de?.href,ref:a,onClick:Za([k,_t]),onBlur:Za([H,wn]),onFocus:Za([M,Ot]),onMouseEnter:Za([D,Ot]),onMouseLeave:Za([P,wn]),onTouchStart:Za([U,sn]),disabled:!!S,target:N,...Ce&&{style:Ce},...ve&&{className:ve},...S&&Lk,...pe&&Ik,...z&&ce&&Bk}}var Vh={},zk={className:"active"},Lk={role:"link","aria-disabled":!0},Ik={"data-status":"active","aria-current":"page"},Bk={"data-transitioning":"transitioning"},Mo=new WeakMap,Hk={rootMargin:"100px"},Za=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Pk(e,t,r,a){if(!a)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function Uk(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var kw=B.forwardRef((e,t)=>{const{_asChild:r,...a}=e,{type:s,...l}=Dk(a,t),u=typeof a.children=="function"?a.children({isActive:l["data-status"]==="active"}):a.children;if(!r){const{disabled:f,...h}=l;return B.createElement("a",h,u)}return B.createElement(r,l,u)});function Vk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var qk=class extends pw{constructor(e){super(e),this.useMatch=t=>sa({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Nw({...t,from:this.id}),this.useSearch=t=>_w({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ew({...t,from:this.id}),this.useLoaderData=t=>Sw({...t,from:this.id}),this.useNavigate=()=>Xc({from:this.fullPath}),this.Link=ds.forwardRef((t,r)=>b.jsx(kw,{ref:r,from:this.fullPath,...t}))}};function ml(e){return new qk(e)}var Fk=class extends pk{constructor(e){super(e),this.useMatch=t=>sa({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Nw({...t,from:this.id}),this.useSearch=t=>_w({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cw({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ew({...t,from:this.id}),this.useLoaderData=t=>Sw({...t,from:this.id}),this.useNavigate=()=>Xc({from:this.fullPath}),this.Link=ds.forwardRef((t,r)=>b.jsx(kw,{ref:r,from:this.fullPath,...t}))}};function Yk(e){return new Fk(e)}function $k(e){const t=rn(),r=`not-found-${Vt(t.stores.location,a=>a.pathname)}-${Vt(t.stores.status,a=>a)}`;return b.jsx(gm,{getResetKey:()=>r,onCatch:(a,s)=>{if(Ut(a))e.onCatch?.(a,s);else throw a},errorComponent:({error:a})=>{if(Ut(a))return e.fallback?.(a);throw a},children:e.children})}function Gk(){return b.jsx("p",{children:"Not Found"})}function ns(e){return b.jsx(b.Fragment,{children:e.children})}function Mw(e,t,r){return t.options.notFoundComponent?b.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?b.jsx(e.options.defaultNotFoundComponent,{...r}):b.jsx(Gk,{})}function Xk(e){return null}function Qk(){return Xk(rn()),null}var Tw=B.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const s=Vt(r.stores.loadedAt,u=>u),l=Vt(a,u=>u);return b.jsx(Kk,{router:r,matchId:t,resetKey:s,matchState:B.useMemo(()=>{const u=l.routeId,f=r.routesById[u].parentRoute?.id;return{routeId:u,ssr:l.ssr,_displayPending:l._displayPending,parentRouteId:f}},[l._displayPending,l.routeId,l.ssr,r.routesById])})});function Kk({router:e,matchId:t,resetKey:r,matchState:a}){const s=e.routesById[a.routeId],l=s.options.pendingComponent??e.options.defaultPendingComponent,u=l?b.jsx(l,{}):null,f=s.options.errorComponent??e.options.defaultErrorComponent,h=s.options.onCatch??e.options.defaultOnCatch,d=s.isRoot?s.options.notFoundComponent??e.options.notFoundRoute?.options.component:s.options.notFoundComponent,p=a.ssr===!1||a.ssr==="data-only",g=(!s.isRoot||s.options.wrapInSuspense||p)&&(s.options.wrapInSuspense??l??(s.options.errorComponent?.preload||p))?B.Suspense:ns,y=f?gm:ns,v=d?$k:ns;return b.jsxs(s.isRoot?s.options.shellComponent??ns:ns,{children:[b.jsx(Gc.Provider,{value:t,children:b.jsx(g,{fallback:u,children:b.jsx(y,{getResetKey:()=>r,errorComponent:f||ym,onCatch:(w,C)=>{if(Ut(w))throw w.routeId??=a.routeId,w;h?.(w,C)},children:b.jsx(v,{fallback:w=>{if(w.routeId??=a.routeId,!d||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!s.isRoot)throw w;return B.createElement(d,w)},children:p||a._displayPending?b.jsx(yk,{fallback:u,children:b.jsx(Iv,{matchId:t})}):b.jsx(Iv,{matchId:t})})})})}),a.parentRouteId===Qi?b.jsxs(b.Fragment,{children:[b.jsx(Zk,{resetKey:r}),e.options.scrollRestoration&&rw?b.jsx(Qk,{}):null]}):null]})}function Zk({resetKey:e}){const t=rn(),r=B.useRef(void 0);return Io(()=>{const a=t.latestLocation.href;(r.current===void 0||r.current!==a)&&(t.emit({type:"onRendered",...ss(t.stores.location.state,t.stores.resolvedLocation.state)}),r.current=a)},[t.latestLocation.state.__TSR_key,e,t]),null}var Iv=B.memo(function({matchId:t}){const r=rn(),a=r.stores.activeMatchStoresById.get(t);a||Mr();const s=Vt(a,d=>d),l=s.routeId,u=r.routesById[l],f=B.useMemo(()=>{const d=(r.routesById[l].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:l,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return d?JSON.stringify(d):void 0},[l,s.loaderDeps,s._strictParams,s._strictSearch,r.options.defaultRemountDeps,r.routesById]),h=B.useMemo(()=>{const d=u.options.component??r.options.defaultComponent;return d?b.jsx(d,{},f):b.jsx(Wk,{})},[f,u.options.component,r.options.defaultComponent]);if(s._displayPending)throw r.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw r.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const d=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(d){const p=r.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=ps();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw r.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return Ut(s.error)||Mr(),Mw(r,u,s.error);if(s.status==="redirected")throw en(s.error)||Mr(),r.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return h}),Wk=B.memo(function(){const t=rn(),r=B.useContext(Gc);let a,s=!1,l;{const d=r?t.stores.activeMatchStoresById.get(r):void 0;[a,s]=Vt(d,p=>[p?.routeId,p?.globalNotFound??!1]),l=Vt(t.stores.matchesId,p=>p[p.findIndex(g=>g===r)+1])}const u=a?t.routesById[a]:void 0,f=t.options.defaultPendingComponent?b.jsx(t.options.defaultPendingComponent,{}):null;if(s)return u||Mr(),Mw(t,u,void 0);if(!l)return null;const h=b.jsx(Tw,{matchId:l});return a===Qi?b.jsx(B.Suspense,{fallback:f,children:h}):h});function Jk(){const e=rn(),t=B.useRef({router:e,mounted:!1}),[r,a]=B.useState(!1),s=Vt(e.stores.isLoading,g=>g),l=Vt(e.stores.hasPendingMatches,g=>g),u=Ah(s),f=s||r||l,h=Ah(f),d=s||l,p=Ah(d);return e.startTransition=g=>{a(!0),B.startTransition(()=>{g(),a(!1)})},B.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return pi(e.latestLocation.publicHref)!==pi(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),Io(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Io(()=>{u&&!s&&e.emit({type:"onLoad",...ss(e.stores.location.state,e.stores.resolvedLocation.state)})},[u,e,s]),Io(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ss(e.stores.location.state,e.stores.resolvedLocation.state)})},[d,p,e]),Io(()=>{if(h&&!f){const g=ss(e.stores.location.state,e.stores.resolvedLocation.state);e.emit({type:"onResolved",...g}),xw(()=>{e.stores.status.setState(()=>"idle"),e.stores.resolvedLocation.setState(()=>e.stores.location.state)}),g.hrefChanged&&mk(e)}},[f,h,e]),null}function eM(){const e=rn(),t=e.routesById[Qi].options.pendingComponent??e.options.defaultPendingComponent,r=t?b.jsx(t,{}):null,a=b.jsxs(typeof document<"u"&&e.ssr?ns:B.Suspense,{fallback:r,children:[b.jsx(Jk,{}),b.jsx(tM,{})]});return e.options.InnerWrap?b.jsx(e.options.InnerWrap,{children:a}):a}function tM(){const e=rn(),t=Vt(e.stores.firstMatchId,s=>s),r=Vt(e.stores.loadedAt,s=>s),a=t?b.jsx(Tw,{matchId:t}):null;return b.jsx(Gc.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:b.jsx(gm,{getResetKey:()=>r,errorComponent:ym,onCatch:void 0,children:a})})}function nM(){const e=rn();return Vt(e.stores.matchRouteReactivity,t=>t),B.useCallback(t=>{const{pending:r,caseSensitive:a,fuzzy:s,includeSearch:l,...u}=t;return e.matchRoute(u,{pending:r,caseSensitive:a,fuzzy:s,includeSearch:l})},[e])}var rM=e=>({createMutableStore:jv,createReadonlyStore:jv,batch:xw}),iM=e=>new aM(e),aM=class extends sk{constructor(e){super(e,rM)}};function sM({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const a=b.jsx(gw.Provider,{value:e,children:t});return e.options.Wrap?b.jsx(e.options.Wrap,{children:a}):a}function oM({router:e,...t}){return b.jsx(sM,{router:e,...t,children:b.jsx(eM,{})})}function lM(e){const r=rn();return B.useRef(void 0),Vt(r.stores.__store,a=>a)}const Mp=new Set,It=new WeakMap,ea=new WeakMap,xn=new WeakMap,el=new WeakMap,qh=new WeakMap,Bo=new WeakMap,Zi=new WeakMap,di=new WeakMap,rs=new WeakSet;let Jt,vm=0,bm=0;const Nr="__aa_tgt",tl="__aa_del",Nc="__aa_new",Aw=e=>{const t=dM(e);t&&t.forEach(r=>hM(r))},uM=e=>{e.forEach(t=>{t.target===Jt&&cM(),It.has(t.target)&&oa(t.target)})};function Rw(e){const t=e.getBoundingClientRect(),r=Jt?.clientWidth||0,a=Jt?.clientHeight||0;return t.bottom<0||t.top>a||t.right<0||t.left>r}function wm(e){const t=el.get(e);t?.disconnect();let r=It.get(e),a=0;const s=5;r||(r=ms(e),It.set(e,r));const{offsetWidth:l,offsetHeight:u}=Jt,h=[r.top-s,l-(r.left+s+r.width),u-(r.top+s+r.height),r.left-s].map(p=>`${-1*Math.floor(p)}px`).join(" "),d=new IntersectionObserver(()=>{++a>1&&oa(e)},{root:Jt,threshold:1,rootMargin:h});d.observe(e),el.set(e,d)}function oa(e,t=!0){clearTimeout(di.get(e));const r=Qc(e),a=t?nl(r)?500:r.duration:0;di.set(e,setTimeout(async()=>{const s=xn.get(e);try{await s?.finished,It.set(e,ms(e)),wm(e)}catch{}},a))}function cM(){clearTimeout(di.get(Jt)),di.set(Jt,setTimeout(()=>{Mp.forEach(e=>pc(e,t=>jw(()=>oa(t))))},100))}function fM(e){setTimeout(()=>{Bo.set(e,setInterval(()=>jw(oa.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function jw(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let _r;const Ow=typeof window<"u"&&"ResizeObserver"in window;Ow&&(Jt=document.documentElement,new MutationObserver(Aw),_r=new ResizeObserver(uM),window.addEventListener("scroll",()=>{bm=window.scrollY,vm=window.scrollX}),_r.observe(Jt));function dM(e){return e.reduce((a,s)=>[...a,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(a=>a.nodeName==="#comment")?!1:e.reduce((a,s)=>{if(a===!1)return!1;if(s.target instanceof Element){if(Fh(s.target),!a.has(s.target)){a.add(s.target);for(let l=0;l<s.target.children.length;l++){const u=s.target.children.item(l);if(u){if(tl in u)return!1;Fh(s.target,u),a.add(u)}}}if(s.removedNodes.length)for(let l=0;l<s.removedNodes.length;l++){const u=s.removedNodes[l];if(tl in u)return!1;u instanceof Element&&(a.add(u),Fh(s.target,u),ea.set(u,[s.previousSibling,s.nextSibling]))}}return a},new Set)}function Fh(e,t){!t&&!(Nr in e)?Object.defineProperty(e,Nr,{value:e}):t&&!(Nr in t)&&Object.defineProperty(t,Nr,{value:e})}function hM(e){var t,r;const a=e.isConnected,s=It.has(e);a&&ea.has(e)&&ea.delete(e),((t=xn.get(e))===null||t===void 0?void 0:t.playState)!=="finished"&&((r=xn.get(e))===null||r===void 0||r.cancel()),Nc in e?Bv(e):s&&a?mM(e):s&&!a?gM(e):Bv(e)}function Xn(e){return Number(e.replace(/[^0-9.\-]/g,""))}function pM(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function ms(e){const t=e.getBoundingClientRect(),{x:r,y:a}=pM(e);return{top:t.top+a,left:t.left+r,width:t.width,height:t.height}}function Dw(e,t,r){let a=t.width,s=t.height,l=r.width,u=r.height;const f=getComputedStyle(e);if(f.getPropertyValue("box-sizing")==="content-box"){const d=Xn(f.paddingTop)+Xn(f.paddingBottom)+Xn(f.borderTopWidth)+Xn(f.borderBottomWidth),p=Xn(f.paddingLeft)+Xn(f.paddingRight)+Xn(f.borderRightWidth)+Xn(f.borderLeftWidth);a-=p,l-=p,s-=d,u-=d}return[a,l,s,u].map(Math.round)}function Qc(e){return Nr in e&&Zi.has(e[Nr])?Zi.get(e[Nr]):{duration:250,easing:"ease-in-out"}}function zw(e){if(Nr in e)return e[Nr]}function Sm(e){const t=zw(e);return t?rs.has(t):!1}function pc(e,...t){t.forEach(r=>r(e,Zi.has(e)));for(let r=0;r<e.children.length;r++){const a=e.children.item(r);a&&t.forEach(s=>s(a,Zi.has(a)))}}function Em(e){return Array.isArray(e)?e:[e]}function nl(e){return typeof e=="function"}function mM(e){const t=It.get(e),r=ms(e);if(!Sm(e))return It.set(e,r);if(Rw(e)){It.set(e,r),wm(e);return}let a;if(!t)return;const s=Qc(e);if(typeof s!="function"){let l=t.left-r.left,u=t.top-r.top;const f=t.left+t.width-(r.left+r.width);t.top+t.height-(r.top+r.height)==0&&(u=0),f==0&&(l=0);const[d,p,g,y]=Dw(e,t,r),v={transform:`translate(${l}px, ${u}px)`},w={transform:"translate(0, 0)"};d!==p&&(v.width=`${d}px`,w.width=`${p}px`),g!==y&&(v.height=`${g}px`,w.height=`${y}px`),a=e.animate([v,w],{duration:s.duration,easing:s.easing})}else{const[l]=Em(s(e,"remain",t,r));a=new Animation(l),a.play()}xn.set(e,a),It.set(e,r),a.addEventListener("finish",oa.bind(null,e,!1),{once:!0})}function Bv(e){Nc in e&&delete e[Nc];const t=ms(e);It.set(e,t);const r=Qc(e);if(!Sm(e))return;if(Rw(e)){wm(e);return}let a;if(typeof r!="function")a=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:r.duration*1.5,easing:"ease-in"});else{const[s]=Em(r(e,"add",t));a=new Animation(s),a.play()}xn.set(e,a),a.addEventListener("finish",oa.bind(null,e,!1),{once:!0})}function Hv(e,t){var r;e.remove(),It.delete(e),ea.delete(e),xn.delete(e),(r=el.get(e))===null||r===void 0||r.disconnect(),setTimeout(()=>{if(tl in e&&delete e[tl],Object.defineProperty(e,Nc,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const a in t)e.style[a]=""},0)}function gM(e){var t;if(!ea.has(e)||!It.has(e))return;const[r,a]=ea.get(e);Object.defineProperty(e,tl,{value:!0,configurable:!0});const s=window.scrollX,l=window.scrollY;if(a&&a.parentNode&&a.parentNode instanceof Element?a.parentNode.insertBefore(e,a):r&&r.parentNode?r.parentNode.appendChild(e):(t=zw(e))===null||t===void 0||t.appendChild(e),!Sm(e))return Hv(e);const[u,f,h,d]=xM(e),p=Qc(e),g=It.get(e);(s!==vm||l!==bm)&&yM(e,s,l,p);let y,v={position:"absolute",top:`${u}px`,left:`${f}px`,width:`${h}px`,height:`${d}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!nl(p))Object.assign(e.style,v),y=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[w,C]=Em(p(e,"remove",g));C?.styleReset!==!1&&(v=C?.styleReset||v,Object.assign(e.style,v)),y=new Animation(w),y.play()}xn.set(e,y),y.addEventListener("finish",()=>Hv(e,v),{once:!0})}function yM(e,t,r,a){const s=vm-t,l=bm-r,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(Jt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+l),!e.parentElement)return;const h=e.parentElement;let d=h.clientHeight,p=h.clientWidth;const g=performance.now();function y(){requestAnimationFrame(()=>{if(!nl(a)){const v=d-h.clientHeight,w=p-h.clientWidth;g+a.duration>performance.now()?(window.scrollTo({left:window.scrollX-w,top:window.scrollY-v}),d=h.clientHeight,p=h.clientWidth,y()):document.documentElement.style.scrollBehavior=u}})}y()}function xM(e){var t;const r=It.get(e),[a,,s]=Dw(e,r,ms(e));let l=e.parentElement;for(;l&&(getComputedStyle(l).position==="static"||l instanceof HTMLBodyElement);)l=l.parentElement;l||(l=document.body);const u=getComputedStyle(l),f=!xn.has(e)||((t=xn.get(e))===null||t===void 0?void 0:t.playState)==="finished"?ms(l):It.get(l),h=Math.round(r.top-f.top)-Xn(u.borderTopWidth),d=Math.round(r.left-f.left)-Xn(u.borderLeftWidth);return[h,d,a,s]}function vM(e,t={}){if(Ow&&_r&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!nl(t)&&!t.disrespectUserMotionPreference)){rs.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),pc(e,oa,fM,u=>_r?.observe(u)),nl(t)?Zi.set(e,t):Zi.set(e,{duration:250,easing:"ease-in-out",...t});const l=new MutationObserver(Aw);l.observe(e,{childList:!0}),qh.set(e,l),Mp.add(e)}return Object.freeze({parent:e,enable:()=>{rs.add(e)},disable:()=>{rs.delete(e),pc(e,a=>{const s=xn.get(a);try{s?.cancel()}catch{}xn.delete(a);const l=di.get(a);l&&clearTimeout(l),di.delete(a);const u=Bo.get(a);u&&clearInterval(u),Bo.delete(a)})},isEnabled:()=>rs.has(e),destroy:()=>{rs.delete(e),Mp.delete(e),Zi.delete(e);const a=qh.get(e);a?.disconnect(),qh.delete(e),pc(e,s=>{_r?.unobserve(s);const l=xn.get(s);try{l?.cancel()}catch{}xn.delete(s);const u=el.get(s);u?.disconnect(),el.delete(s);const f=Bo.get(s);f&&clearInterval(f),Bo.delete(s);const h=di.get(s);h&&clearTimeout(h),di.delete(s),It.delete(s),ea.delete(s)})}})}function bM(e){const[t,r]=B.useState(),a=B.useMemo(()=>e,[]),s=B.useCallback(u=>{u instanceof HTMLElement?r(vM(u,a)):r(void 0)},[a]),l=B.useCallback(u=>{t&&(u?t.enable():t.disable())},[t]);return B.useEffect(()=>()=>{var u;(u=t?.destroy)===null||u===void 0||u.call(t)},[t]),[s,l]}function wM(e,t){return e.isLoading?{state:"loading"}:e.isError?{state:"error",message:e.error instanceof Error?e.error.message:"Could not load performance data.",retry:t}:e.data===null?{state:"devModeOff"}:e.data===void 0?{state:"loading"}:e.data.devMode===!1?{state:"devModeOff"}:{state:"data",data:e.data}}class Cm extends Error{constructor(t,r){super(`HTTP ${t}: ${r}`),this.status=t,this.name="HttpError"}}async function la(e){const t=await fetch(e);if(!t.ok)throw new Cm(t.status,t.statusText);const r=await t.json();if(!r.success||!r.data)throw new Error(r.error??"Unknown error");return r.data}function _m(){return aa({queryKey:["sessions"],queryFn:()=>la("/api/v2/sessions"),refetchInterval:3e4,staleTime:25e3})}function SM(e){return aa({queryKey:["session",e],queryFn:()=>la(`/api/v2/sessions/${e}`),enabled:!!e,refetchInterval:5e3,refetchIntervalInBackground:!1,staleTime:3e3})}function EM(e,t){return aa({queryKey:["node",e,t],queryFn:()=>la(`/api/v2/sessions/${e}/nodes/${t}`),enabled:!!t})}function CM(){return aa({queryKey:["worktrees"],queryFn:()=>la("/api/v2/worktrees"),refetchInterval:3e4,staleTime:2e4})}function _M(){return aa({queryKey:["workflows"],queryFn:()=>la("/api/v2/workflows"),staleTime:1/0,refetchInterval:!1})}function NM(){const e=aa({queryKey:["perf","tool-calls"],queryFn:async()=>{try{return await la("/api/v2/perf/tool-calls")}catch(r){if(r instanceof Cm&&r.status===404)return null;throw r}},refetchInterval:5e3,staleTime:3e3,refetchIntervalInBackground:!1});return wM(e,()=>{e.refetch()})}function kM(e){return aa({queryKey:["workflow",e],queryFn:()=>la(`/api/v2/workflows/${e}`),enabled:e!==null,staleTime:1/0,refetchInterval:!1})}function MM(){const e=fm();B.useEffect(()=>{let t=null,r=null;function a(){t=new EventSource("/api/v2/workspace/events"),t.onmessage=s=>{try{const l=JSON.parse(s.data);l.type==="change"?e.invalidateQueries({queryKey:["sessions"]}):l.type==="worktrees-updated"&&e.invalidateQueries({queryKey:["worktrees"]})}catch{}},t.onerror=()=>{t?.close(),t=null,r=setTimeout(a,5e3)}}return a(),()=>{r!==null&&clearTimeout(r),t?.close()}},[e])}function kc({label:e,color:t,pulse:r=!1,className:a="",role:s,"aria-label":l}){return b.jsxs("span",{className:`font-mono text-[10px] font-bold uppercase tracking-[0.20em]${r?" badge-live":""}${a?` ${a}`:""}`,style:t?{color:t}:void 0,role:s,"aria-label":l,children:["[ ",e," ]"]})}const TM={in_progress:{label:"IN PROGRESS",pulse:!0},dormant:{label:"DORMANT",pulse:!1,color:"var(--text-muted)"},complete:{label:"COMPLETE",pulse:!1,color:"var(--success)"},complete_with_gaps:{label:"GAPS",pulse:!1,color:"var(--warning)"},blocked:{label:"BLOCKED",pulse:!1,color:"var(--blocked)"}};function Nm({status:e}){const{label:t,pulse:r,color:a}=TM[e];return b.jsx(kc,{label:t,pulse:r,color:a})}function Lw({health:e}){return e==="healthy"?null:b.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",style:{backgroundColor:"var(--error)20",color:"var(--error)"},children:"Corrupt"})}function AM({children:e,variant:t="default",className:r=""}){const a="font-mono text-[10px] px-1.5 py-0.5 text-[var(--text-secondary)] inline-flex items-center",s=t==="outlined"?"border border-[var(--border)]":"bg-[var(--bg-secondary)]";return b.jsx("span",{className:`${a} ${s} ${r}`,children:e})}const RM=1;function Iw(e){return`polygon(${e}px 0, 100% 0, 100% 100%, 0 100%, 0 ${e}px)`}function Es({cut:e=12,borderColor:t="var(--border)",background:r="var(--bg-card)",dropShadow:a,backdropFilter:s,className:l,style:u,children:f}){const h=Iw(e);return b.jsxs("div",{className:l,style:{filter:a?`${a}`:void 0,...u},children:[b.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:t,clipPath:h,pointerEvents:"none"}}),b.jsx("div",{style:{position:"absolute",inset:RM,background:r,backdropFilter:s??void 0,WebkitBackdropFilter:s??void 0,clipPath:h,display:"flex",flexDirection:"column",overflow:"hidden"},children:f})]})}const km=B.forwardRef(function({variant:t="list",onClick:r,onKeyDown:a,onFocus:s,tabIndex:l,className:u="",style:f,children:h,"aria-label":d,cut:p=10,borderColor:g},y){if(t==="hero")return b.jsx(Es,{cut:p,borderColor:g,className:`relative ${u}`,style:f,children:h});const v="energy-card group cursor-pointer bg-[var(--bg-card)] border border-[var(--border)] hover:border-[var(--accent)] transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",w={grid:"flex flex-col min-h-[160px]",list:"w-full text-left"}[t],C=`${v} ${w} ${u}`,N=t==="grid"&&b.jsx("div",{className:"h-[3px] w-full bg-[var(--accent)] opacity-60 group-hover:opacity-100 transition-opacity shrink-0"});return r?b.jsxs("button",{ref:y,type:"button",onClick:r,onKeyDown:a,onFocus:s,tabIndex:l,"aria-label":d,className:C,style:f,children:[N,h]}):b.jsxs("div",{"aria-label":d,className:C,style:f,children:[N,h]})});function Cs(e){const t=Date.now()-e;if(t<0)return"just now";const r=Math.floor(t/1e3);if(r<60)return"just now";const a=Math.floor(r/60);if(a<60)return`${a}m ago`;const s=Math.floor(a/60);if(s<24)return`${s}h ago`;const l=Math.floor(s/24);if(l<7)return`${l}d ago`;const u=Math.floor(l/7);return u<5?`${u}w ago`:`${Math.floor(l/30)}mo ago`}function jM(e){if(e.size<2)return 1;const t=new Set;for(const s of e.values())t.add(Math.round(s.getBoundingClientRect().top));if(t.size<2){const s=Math.round(e.get(0)?.getBoundingClientRect().top??0);let l=0;for(const u of e.values())Math.round(u.getBoundingClientRect().top)===s&&l++;return Math.max(1,l)}const r=Math.round(e.get(0)?.getBoundingClientRect().top??0);let a=0;for(const s of e.values())Math.round(s.getBoundingClientRect().top)===r&&a++;return Math.max(1,a)}function Pv(e,t,r,a){if(r===0)return 0;const l=(e??(t>0?-1:r))+t;return a?(l%r+r)%r:Math.max(0,Math.min(r-1,l))}function Uv(e,t,r,a,s){if(r===0)return 0;const l=e??0,u=l%a,f=Math.floor(l/a),h=Math.ceil(r/a);let d=f+t;s?d=(d%h+h)%h:d=Math.max(0,Math.min(h-1,d));const p=d*a+u;return Math.min(p,r-1)}function Bw({count:e,cols:t="auto",onActivate:r,loop:a=!0}){const[s,l]=B.useState(null),u=B.useRef(new Map),f=B.useCallback(p=>{l(p),p!==null&&u.current.get(p)?.focus()},[]),h=B.useCallback(()=>t==="auto"?jM(u.current):Math.max(1,t),[t]),d=B.useCallback(p=>({tabIndex:s===null?p===0?0:-1:s===p?0:-1,onFocus:()=>{l(p)},onKeyDown:g=>{const y=h();let v=null;switch(g.key){case"ArrowRight":case"d":case"D":v=Pv(p,1,e,a);break;case"ArrowLeft":case"a":case"A":v=Pv(p,-1,e,a);break;case"ArrowDown":case"s":case"S":v=Uv(p,1,e,y,a);break;case"ArrowUp":case"w":case"W":v=Uv(p,-1,e,y,a);break;case"Home":v=0;break;case"End":v=e-1;break;case"Enter":case" ":g.preventDefault(),r?.(p);return;default:return}v!==null&&(g.preventDefault(),f(v))},ref:g=>{g?u.current.set(p,g):u.current.delete(p)}}),[s,e,a,h,r,f]);return{focusedIndex:s,setFocusedIndex:f,getItemProps:d,containerProps:{role:"grid"}}}const Mc={in_progress:0,blocked:1,dormant:2,complete_with_gaps:3,complete:4},Tp=[{value:"recent",label:"Recent",compareFn:(e,t)=>t.lastModifiedMs-e.lastModifiedMs},{value:"status",label:"Status",compareFn:(e,t)=>Mc[e.status]-Mc[t.status]||t.lastModifiedMs-e.lastModifiedMs},{value:"workflow",label:"Workflow",compareFn:(e,t)=>(e.workflowName??e.workflowId??"").localeCompare(t.workflowName??t.workflowId??"")||t.lastModifiedMs-e.lastModifiedMs},{value:"nodes",label:"Node count",compareFn:(e,t)=>t.nodeCount-e.nodeCount||t.lastModifiedMs-e.lastModifiedMs}],Ap=[{value:"none",label:"No grouping",keyFn:null},{value:"workflow",label:"Workflow",keyFn:e=>e.workflowName??e.workflowId??"Unknown workflow"},{value:"status",label:"Status",keyFn:e=>e.status,groupCompareFn:(e,t)=>(Mc[e]??99)-(Mc[t]??99)},{value:"branch",label:"Branch",keyFn:e=>e.gitBranch??"No branch"}],OM=[{value:"all",label:"All"},{value:"in_progress",label:"In Progress"},{value:"dormant",label:"Dormant"},{value:"complete",label:"Complete"},{value:"complete_with_gaps",label:"Gaps"},{value:"blocked",label:"Blocked"}],os=25;function DM(e,t,r){let a=[...e];if(r!=="all"&&(a=a.filter(s=>s.status===r)),t.trim()){const s=t.toLowerCase();a=a.filter(l=>(l.sessionTitle??"").toLowerCase().includes(s)||(l.workflowName??"").toLowerCase().includes(s)||(l.workflowId??"").toLowerCase().includes(s)||l.sessionId.toLowerCase().includes(s)||(l.gitBranch??"").toLowerCase().includes(s))}return a}function zM(e,t){const r=Tp.find(a=>a.value===t)??Tp[0];return[...e].sort(r.compareFn)}function LM(e,t){const r=Ap.find(l=>l.value===t)??Ap[0];if(!r.keyFn)return[{label:"",sessions:e}];const a=new Map;for(const l of e){const u=r.keyFn(l),f=a.get(u)??[];f.push(l),a.set(u,f)}const s=r.groupCompareFn??((l,u)=>l.localeCompare(u));return Array.from(a.entries()).sort(([l],[u])=>s(l,u)).map(([l,u])=>({label:l,sessions:u}))}function IM(e,t){const[r,a]=B.useState(e),s=B.useRef(null);return B.useEffect(()=>(s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>a(e),t),()=>{s.current!==null&&clearTimeout(s.current)}),[e,t]),r}function BM({onSelectSession:e,initialSearch:t=""}){const{data:r,isLoading:a,error:s}=_m(),[l,u]=B.useState(t),[f,h]=B.useState("recent"),[d,p]=B.useState("none"),[g,y]=B.useState("all"),[v,w]=B.useState(0),C=IM(l,200),N=B.useCallback(Q=>{u(Q),w(0)},[]),S=B.useCallback(Q=>{h(Q),w(0)},[]),A=B.useCallback(Q=>{p(Q),w(0)},[]),_=B.useCallback(Q=>{y(Q),w(0)},[]),k=B.useMemo(()=>{if(!r)return{groups:[],total:0,filtered:0};const Q=DM(r.sessions,C,g),L=zM(Q,f);return{groups:LM(L,d),total:r.sessions.length,filtered:Q.length}},[r,C,g,f,d]),H=B.useMemo(()=>{if(!r)return{};const Q={all:r.sessions.length};for(const L of r.sessions)Q[L.status]=(Q[L.status]??0)+1;return Q},[r]);if(a)return b.jsx("div",{className:"flex items-center justify-center py-20",children:b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading sessions..."})});if(s)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load sessions: ",s.message]});if(!r||r.sessions.length===0)return b.jsxs("div",{className:"text-center py-16",children:[b.jsx("p",{className:"text-[var(--text-secondary)] text-lg",children:"No v2 sessions found"}),b.jsx("p",{className:"text-[var(--text-muted)] text-sm mt-2",children:"Sessions will appear here when workflows are executed with v2 tools enabled."})]});const M=d!=="none",D=v*os,P=D+os,U=Math.ceil(k.filtered/os),q=M?[]:k.groups[0]?.sessions.slice(D,P)??[],{getItemProps:I,containerProps:Y}=Bw({count:q.length,cols:1,onActivate:B.useCallback(Q=>{e(q[Q].sessionId)},[q,e])});return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"flex items-center justify-between",children:b.jsxs("h2",{className:"text-lg font-medium text-[var(--text-primary)]",children:["Sessions",b.jsx("span",{className:"text-[var(--text-muted)] font-normal ml-2 text-sm",children:k.filtered===k.total?k.total:`${k.filtered} / ${k.total}`})]})}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-[360px]",children:[b.jsx("input",{type:"text",value:l,onChange:Q=>N(Q.target.value),placeholder:"Search sessions...",className:"w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-1.5 text-sm text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)] transition-colors"}),l&&b.jsx("button",{onClick:()=>N(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-xs",children:"clear"})]}),b.jsx(Vv,{label:"Sort",value:f,options:Tp,onChange:S}),b.jsx(Vv,{label:"Group",value:d,options:Ap,onChange:A})]}),b.jsx("div",{className:"flex flex-wrap gap-1.5",children:OM.map(Q=>{const L=H[Q.value]??0;if(Q.value!=="all"&&L===0)return null;const V=g===Q.value;return b.jsxs("button",{onClick:()=>_(Q.value),className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${V?"bg-[var(--accent)] text-white":"bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-card)] hover:text-[var(--text-primary)]"}`,children:[Q.label,b.jsx("span",{className:"ml-1 opacity-70",children:L})]},Q.value)})}),k.filtered===0?b.jsx("div",{className:"text-center py-12 text-[var(--text-muted)] text-sm",children:"No sessions match the current filters"}):M?b.jsx("div",{className:"space-y-6",children:k.groups.map(Q=>b.jsx(HM,{label:Q.label,sessions:Q.sessions,sort:f,statusFilter:g,onSelectSession:e},Q.label+"-"+f+"-"+g))}):b.jsxs(b.Fragment,{children:[b.jsx("div",{...Y,className:"space-y-2",children:q.map((Q,L)=>b.jsx(Pw,{session:Q,onClick:()=>e(Q.sessionId),navProps:I(L)},Q.sessionId))}),U>1&&b.jsx(Hw,{page:v,totalPages:U,onPageChange:w})]})]})}function Vv({label:e,value:t,options:r,onChange:a}){return b.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)]",children:[e,b.jsx("select",{value:t,onChange:s=>a(s.target.value),className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-2 py-1.5 text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)] cursor-pointer",children:r.map(s=>b.jsx("option",{value:s.value,children:s.label},s.value))})]})}function HM({label:e,sessions:t,sort:r,statusFilter:a,onSelectSession:s}){const[l,u]=B.useState(!1),[f,h]=B.useState(0);B.useEffect(()=>h(0),[t.length]);const d=Math.ceil(t.length/os),p=f*os,g=p+os,y=t.slice(p,g);return b.jsxs("div",{children:[b.jsxs("button",{onClick:()=>u(!l),className:"flex items-center gap-2 mb-2 cursor-pointer group",children:[b.jsx("span",{className:"text-[var(--text-muted)] text-xs transition-transform duration-150",style:{transform:l?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),b.jsx("span",{className:"text-sm font-medium text-[var(--text-secondary)] group-hover:text-[var(--text-primary)] transition-colors",children:e}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",t.length,")"]})]}),!l&&b.jsxs("div",{className:"ml-4",children:[b.jsx("div",{className:"space-y-2",children:y.map(v=>b.jsx(Pw,{session:v,onClick:()=>s(v.sessionId)},v.sessionId))}),d>1&&b.jsx("div",{className:"mt-2",children:b.jsx(Hw,{page:f,totalPages:d,onPageChange:h})})]})]})}function Hw({page:e,totalPages:t,onPageChange:r}){return b.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[b.jsx("button",{onClick:()=>r(e-1),disabled:e===0,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Prev"}),b.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:[e+1," / ",t]}),b.jsx("button",{onClick:()=>r(e+1),disabled:e>=t-1,className:"px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer",children:"Next"})]})}function Pw({session:e,onClick:t,navProps:r}){const a=e.sessionTitle,s=e.workflowName??e.workflowId,l=Cs(e.lastModifiedMs);return b.jsxs(km,{variant:"list",onClick:t,tabIndex:r?.tabIndex,onKeyDown:r?.onKeyDown,onFocus:r?.onFocus,ref:r?.ref,className:"rounded-lg px-4 py-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsx("div",{className:"min-w-0 flex-1",children:b.jsx("div",{className:"text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors",children:a??s??"Unnamed session"})}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums",children:l}),b.jsx(Lw,{health:e.health}),b.jsx(Nm,{status:e.status})]})]}),b.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[a&&s&&b.jsx(Ku,{children:s}),e.gitBranch&&b.jsx(Ku,{icon:"branch",children:e.gitBranch}),b.jsxs(Ku,{icon:"graph",children:[e.nodeCount,"N / ",e.edgeCount,"E"]}),e.tipCount>1&&b.jsxs(Ku,{icon:"fork",children:[e.tipCount," tips"]}),e.hasUnresolvedGaps&&b.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] text-[var(--warning)]",children:"gaps"})]}),b.jsx("div",{className:"mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate",children:e.sessionId})]})}const PM={branch:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.5 2.5 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Z"})}),graph:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.5 2.5 0 0 1 2 11.5Z"})}),fork:b.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",className:"shrink-0",children:b.jsx("path",{d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm2.122-.75a2.25 2.25 0 1 0-3.244 0A2.5 2.5 0 0 0 2 5v5.5A2.5 2.5 0 0 0 4.5 13h3.25a.75.75 0 0 0 0-1.5H4.5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v5.5a1 1 0 0 1-1 1H8.75Z"})})};function Ku({children:e,icon:t}){return b.jsxs(AM,{className:"gap-1 rounded text-[var(--text-muted)] max-w-[200px] truncate",children:[t&&PM[t],e]})}const UM=720*60*60*1e3,qv={in_progress:0,dormant:0,blocked:1,complete_with_gaps:2,complete:3};function VM(e){if(e.length!==0)return[...e].sort((t,r)=>{const a=qv[t.status]-qv[r.status];return a!==0?a:r.lastModifiedMs-t.lastModifiedMs})[0]}function qM(e,t,r){const a=e.primarySession?.status;if(a==="in_progress"||a==="blocked")return"visible";const s=(e.worktree?.changedCount??0)>0,l=(e.worktree?.aheadCount??0)>0;return s||l?"visible":a==="dormant"?t==="all"?"visible":"hidden":r-e.activityMs<UM||t==="all"?"visible":"hidden"}function Fv(e){switch(e.primarySession?.status){case"in_progress":return 0;case"blocked":return 1;case"dormant":return 2;default:return(e.worktree?.changedCount??0)>0||(e.worktree?.aheadCount??0)>0?3:4}}function FM(e,t,r){return[...e].filter(a=>qM(a,t,r)==="visible").sort((a,s)=>{const l=Fv(a)-Fv(s);return l!==0?l:s.activityMs-a.activityMs})}function YM(e,t){const r=new Map;for(const f of t)for(const h of f.worktrees)h.branch!==null&&r.set(`${h.branch}\0${f.repoRoot}`,{wt:h,repoName:f.repoName,repoRoot:f.repoRoot});const a=new Map;for(const[f,h]of r){const[d]=f.split("\0"),p=a.get(d)??[];p.push(h),a.set(d,p)}const s=new Map;for(const f of e){if(f.gitBranch===null)continue;const h=a.get(f.gitBranch)??[];if(h.length===0){if(!f.repoRoot)continue;const d=`${f.gitBranch}\0${f.repoRoot}`,p=s.get(d);if(p?p.push(f):s.set(d,[f]),!r.has(d)){const g=f.repoRoot.split("/").at(-1)??f.repoRoot;r.set(d,{wt:void 0,repoName:g,repoRoot:f.repoRoot})}continue}for(const d of h){const p=`${f.gitBranch}\0${d.repoRoot}`,g=s.get(p);g?g.push(f):s.set(p,[f])}}const l=[],u=new Set;for(const[f,h]of s){const[d,p]=f.split("\0"),g=r.get(f),y=VM(h),v=Math.max(y?.lastModifiedMs??0,g?.wt?.headTimestampMs??0),w=g?.repoName??p.split("/").at(-1)??p;l.push({branch:d,repoRoot:p,repoName:w,worktree:g?.wt,primarySession:y,allSessions:h,activityMs:v}),u.add(f)}for(const[f,{wt:h,repoName:d,repoRoot:p}]of r){if(u.has(f))continue;const[g]=f.split("\0");l.push({branch:g,repoRoot:p,repoName:d,worktree:h,primarySession:void 0,allSessions:[],activityMs:h?.headTimestampMs??0})}return l}function Uw({children:e,className:t="",style:r}){return b.jsx("div",{className:`branch-tree-line ${t}`,style:r,children:e})}const Vw=[{workflow:"coding task workflow",task:"add a dark mode toggle to the settings page"},{workflow:"coding task workflow",task:"write tests for the authentication module"},{workflow:"coding task workflow",task:"refactor the data layer to use a repository pattern"},{workflow:"coding task workflow",task:"add pagination to the search results view"},{workflow:"bug investigation workflow",task:"find why the API returns 500 on logout"},{workflow:"bug investigation workflow",task:"trace why notifications stop sending after 24 hours"},{workflow:"bug investigation workflow",task:"figure out why the build is failing on CI but not locally"},{workflow:"MR review workflow",task:"review my latest changes on this branch"},{workflow:"MR review workflow",task:"review PR #123 before it merges"}],Yh=["The DAG view shows every node the agent created, including blocked attempts and alternative paths.","Dormant sessions have been idle for over an hour -- return to the original conversation to resume.","Gaps are open questions the agent flagged but could not resolve. Check them in the node detail panel.","The preferred tip node (highlighted in yellow in the DAG) is the most recent forward position.","Complete with gaps means the workflow finished but left critical follow-ups unresolved.","The tip count badge shows how many execution paths a session explored.","Use j and k to navigate between branches, Enter to expand, and / to open the full session archive."];function $M(e){return e[Math.floor(Math.random()*e.length)]}function GM({hidden:e=!1}){const t=Xc(),{data:r,isLoading:a,error:s,refetch:l}=_m(),{data:u,isLoading:f}=CM();MM();const[h,d]=B.useState("active"),[p,g]=B.useState(-1),[y,v]=B.useState(null),w=B.useRef(0),C=B.useRef(!0),N=B.useRef(new Map),S=B.useCallback(D=>{w.current=window.scrollY,t({to:"/session/$sessionId",params:{sessionId:D}})},[t]);B.useEffect(()=>{if(C.current){C.current=!1;return}if(!e){const D=requestAnimationFrame(()=>{window.scrollTo({top:w.current})});return()=>cancelAnimationFrame(D)}},[e]);const{repoGroups:A,orderedItems:_,archiveRepos:k,dormantHiddenCount:H}=B.useMemo(()=>{const D=Date.now(),P={repoGroups:[],orderedItems:[],archiveRepos:[],dormantHiddenCount:0};if(!r)return P;const U=u?.repos??[],q=YM(r.sessions,U),I=new Map;for(const T of q)I.has(T.repoRoot)||I.set(T.repoRoot,T.repoName);const Y=new Map;for(const T of q){const F=Y.get(T.repoRoot)??[];F.push(T),Y.set(T.repoRoot,F)}const Q=[...Y.entries()].map(([T,F])=>({repoRoot:T,repoName:F[0].repoName,sortedItems:FM(F,h,D)})).filter(T=>T.sortedItems.length>0).sort((T,F)=>{const X=T.sortedItems.some(j=>j.primarySession?.status==="in_progress"||j.primarySession?.status==="blocked")?0:1,Z=F.sortedItems.some(j=>j.primarySession?.status==="in_progress"||j.primarySession?.status==="blocked")?0:1;return X!==Z?X-Z:T.repoName.localeCompare(F.repoName)}),L=Q.flatMap(T=>T.sortedItems),V=h==="active"?q.filter(T=>T.primarySession?.status==="dormant"&&(T.worktree?.changedCount??0)===0&&(T.worktree?.aheadCount??0)===0).length:0;return{repoGroups:Q,orderedItems:L,archiveRepos:[...I.entries()],dormantHiddenCount:V}},[r,u,h]);B.useEffect(()=>{g(-1)},[_.length]),iT({items:_,focusedIndex:p,setFocusedIndex:g,onSelectSession:S,scope:h,setScope:d,refetch:l,archive:y,setArchive:v,disabled:e});const M=(r?.totalCount??0)>0;return a?b.jsx("div",{className:`flex items-center justify-center py-32 ${e?"hidden":""}`,children:b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-muted)] uppercase tracking-[0.25em] motion-safe:animate-pulse",children:"// LOADING WORKSPACE..."})}):s?b.jsxs("div",{className:`p-4 ${e?"hidden":""}`,style:{borderLeft:"3px solid var(--error)"},children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--error)] block mb-1",children:"// ERROR"}),b.jsxs("span",{className:"text-sm text-[var(--text-secondary)]",children:["Failed to load workspace: ",s.message]})]}):y!==null?b.jsxs("div",{className:`space-y-4 ${e?"hidden":""}`,children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{onClick:()=>v(null),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:"// WORKSPACE ←"}),y.repoName&&b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]",children:y.repoName})]}),b.jsx(BM,{onSelectSession:S})]}):b.jsxs("div",{className:`space-y-6 ${e?"hidden":""}`,children:[M?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex items-start justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("h1",{className:"font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none",style:{color:"var(--accent)",textShadow:"0 0 28px rgba(244,196,48,0.35)"},children:"Workspace"}),b.jsxs("p",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5",children:["// ",_.length," session",_.length!==1?"s":""]})]}),b.jsx(tT,{scope:h,onChange:d})]}),_.length===0?b.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)] text-center py-8",children:"// no sessions match current filter"}):b.jsx("div",{className:"space-y-6",children:A.map((D,P)=>{const U=A.slice(0,P).reduce((q,I)=>q+I.sortedItems.length,0);return b.jsx(XM,{group:D,showHeader:!0,focusedIndex:p,groupOffset:U,worktreesFetching:f,onSelectSession:S,expandStateRef:N},D.repoRoot)})}),H>0&&b.jsxs("button",{type:"button",onClick:()=>d("all"),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:["// ",H," dormant session",H!==1?"s":""," hidden — show all"]}),b.jsx(nT,{repos:k,onOpen:D=>v({repoName:D})})]}):b.jsxs(b.Fragment,{children:[b.jsx(rT,{prompt:$M(Vw)}),b.jsx($v,{})]}),b.jsx($v,{})]})}const Yv=12;function XM({group:e,showHeader:t,focusedIndex:r,groupOffset:a,worktreesFetching:s,onSelectSession:l,expandStateRef:u}){const[f,h]=B.useState(!1),d=f?e.sortedItems:e.sortedItems.slice(0,Yv),p=e.sortedItems.length-Yv,g=e.sortedItems.filter(y=>y.primarySession?.status==="in_progress"||y.primarySession?.status==="blocked").length;return b.jsxs("section",{children:[t&&b.jsx("div",{style:{position:"sticky",top:"var(--app-header-height)",zIndex:10},className:"mb-3",children:b.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",style:{background:"var(--bg-secondary)",borderLeft:"3px solid var(--accent)",borderBottom:"1px solid rgba(244,196,48,0.15)"},children:[b.jsx("span",{className:"font-mono text-[12px] font-bold uppercase tracking-[0.25em] text-[var(--text-primary)]",children:e.repoName}),g>0&&b.jsx(kc,{label:`${g} ACTIVE`,color:"var(--accent-strong)"}),b.jsx("div",{className:"flex-1 h-px",style:{background:"rgba(244,196,48,0.12)"}})]})}),b.jsxs("div",{className:"space-y-3",children:[d.map((y,v)=>{const w=a+v,C=r===w;if(y.allSessions.length===0)return b.jsx(ZM,{item:y,isFocused:C,worktreesFetching:s,expandStateRef:u},`${y.branch}\0${y.repoRoot}`);if(y.allSessions.length>1)return b.jsx(KM,{item:y,isFocused:C,worktreesFetching:s,onSelectSession:l,expandStateRef:u},`${y.branch}\0${y.repoRoot}`);const N=y.allSessions[0];return b.jsxs(Uw,{style:C?{outline:"2px solid var(--accent)",outlineOffset:"2px"}:void 0,children:[b.jsx(qw,{item:y,worktreesFetching:s,filesExpanded:!1,onToggleFiles:()=>{},unpushedExpanded:!1,onToggleUnpushed:()=>{}}),b.jsx("div",{className:"pl-3 mt-px",children:b.jsx(Rp,{session:N,item:y,showBranch:!1,onSelect:()=>l(N.sessionId)})})]},`${y.branch}\0${y.repoRoot}`)}),!f&&p>0&&b.jsxs("button",{type:"button",onClick:()=>h(!0),className:"w-full text-left px-3 py-2 font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:["+ ",p," more ",p===1?"branch":"branches"]})]})]})}const QM=(e,t)=>{const r=s=>s.status==="in_progress"||s.status==="dormant"?0:s.status==="blocked"?1:2,a=r(e)-r(t);return a!==0?a:t.lastModifiedMs-e.lastModifiedMs};function KM({item:e,isFocused:t,worktreesFetching:r,onSelectSession:a,expandStateRef:s}){const l=`${e.branch}\0${e.repoRoot}`,u=()=>s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1},[f,h]=B.useState(!1),[d,p]=B.useState(()=>u().filesExpanded),[g,y]=B.useState(()=>u().unpushedExpanded),v=[...e.allSessions].sort(QM),w=B.useCallback(()=>{p(A=>{const _=!A,k=s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return s.current?.set(l,{...k,filesExpanded:_}),_})},[l,s]),C=B.useCallback(()=>{y(A=>{const _=!A,k=s.current?.get(l)??{filesExpanded:!1,unpushedExpanded:!1};return s.current?.set(l,{...k,unpushedExpanded:_}),_})},[l,s]),N=v.filter(A=>A.status==="in_progress"||A.status==="blocked"||A.status==="dormant"),S=v.filter(A=>A.status!=="in_progress"&&A.status!=="blocked"&&A.status!=="dormant");return b.jsxs(Uw,{style:t?{outline:"2px solid var(--accent)",outlineOffset:"2px"}:void 0,children:[b.jsx(qw,{item:e,worktreesFetching:r,filesExpanded:d,onToggleFiles:w,unpushedExpanded:g,onToggleUnpushed:C}),d&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(Fw,{files:e.worktree.changedFiles}),g&&e.worktree&&b.jsx(Yw,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount}),b.jsxs("div",{className:"pl-3 mt-px space-y-px",children:[N.map(A=>b.jsx(Rp,{session:A,showBranch:!1,onSelect:()=>a(A.sessionId)},A.sessionId)),S.length>0&&b.jsxs(b.Fragment,{children:[f&&S.map(A=>b.jsx(Rp,{session:A,showBranch:!1,onSelect:()=>a(A.sessionId)},A.sessionId)),b.jsx("button",{type:"button",onClick:()=>h(A=>!A),className:"w-full text-left px-3 py-1.5 font-mono text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:f?"// hide history":`+ ${S.length} completed workflow${S.length!==1?"s":""}`})]})]})]})}function qw({item:e,worktreesFetching:t,filesExpanded:r,onToggleFiles:a,unpushedExpanded:s,onToggleUnpushed:l}){const u=Cs(e.activityMs);return b.jsxs("div",{className:"flex items-center gap-2 py-1 pr-3",children:[b.jsx("span",{className:"font-mono text-[11px] font-medium text-[var(--text-secondary)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx($w,{}),b.jsx(Mm,{item:e,fetching:t,compact:!0,filesExpanded:r,onToggleFiles:a,unpushedExpanded:s,onToggleUnpushed:l}),b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:u})]})}function Rp({session:e,item:t,showBranch:r=!0,onSelect:a}){const s=Cs(e.lastModifiedMs),l=e.sessionTitle?.trim()||e.workflowName||e.workflowId||e.sessionId.slice(0,8),u=e.workflowName??e.workflowId??null,f=e.status==="dormant",h=e.status==="in_progress"?"var(--accent-strong)":e.status==="blocked"?"var(--blocked)":f?"rgba(244, 196, 48, 0.55)":"rgba(244, 196, 48, 0.15)";return b.jsx(km,{variant:"list",onClick:a,className:"px-4 py-3",style:{borderLeft:`3px solid ${h}`},children:b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[f&&b.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 mt-[3px] bg-[var(--accent)]","aria-hidden":"true",title:"Dormant"}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:"text-sm text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-1 mb-0.5",children:l}),b.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[r&&t&&b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] truncate max-w-[200px]",children:t.branch}),u&&e.sessionTitle&&b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0",children:u}),r&&t?.worktree&&b.jsx(Mm,{item:t,fetching:!1,compact:!0})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.hasUnresolvedGaps&&b.jsx("span",{className:"text-[10px] text-[var(--warning)]",title:"Unresolved gaps",children:"⚠"}),b.jsx(Nm,{status:e.status}),b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] tabular-nums",children:s})]})]})})}function ZM({item:e,isFocused:t,worktreesFetching:r,expandStateRef:a}){const s=`${e.branch}\0${e.repoRoot}`,l=()=>a.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1},[u,f]=B.useState(()=>l().filesExpanded),[h,d]=B.useState(()=>l().unpushedExpanded),[p]=bM(),g=Cs(e.activityMs),y=B.useCallback(()=>{f(w=>{const C=!w,N=a.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(s,{...N,filesExpanded:C}),C})},[s,a]),v=B.useCallback(()=>{d(w=>{const C=!w,N=a.current?.get(s)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(s,{...N,unpushedExpanded:C}),C})},[s,a]);return b.jsxs("div",{ref:p,children:[b.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded ${t?"ring-2 ring-[var(--accent)] ring-offset-1":""}`,children:[b.jsx("div",{className:"w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--border)]",title:"No sessions"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)] truncate flex-1",children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!=="main"&&b.jsx($w,{}),b.jsx(Mm,{item:e,fetching:r,compact:!0,filesExpanded:u,onToggleFiles:y,unpushedExpanded:h,onToggleUnpushed:v}),e.worktree?.headMessage&&b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] truncate hidden sm:block max-w-[200px] opacity-60",children:e.worktree.headMessage}),b.jsx("span",{className:"text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:g})]}),u&&e.worktree&&e.worktree.changedFiles.length>0&&b.jsx(Fw,{files:e.worktree.changedFiles}),h&&e.worktree&&b.jsx(Yw,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount})]})}function Mm({item:e,fetching:t,compact:r=!1,filesExpanded:a,onToggleFiles:s,unpushedExpanded:l,onToggleUnpushed:u}){if(t&&e.worktree===void 0||e.worktree?.enrichment===null)return b.jsx("span",{className:"flex gap-1",children:b.jsx(eT,{})});const f=e.worktree;if(!f)return null;const h=f.changedCount,d=f.aheadCount;if(h===0&&d===0)return null;const p=`text-xs px-1.5 py-0.5 rounded bg-orange-500/10 text-orange-400 border border-orange-500/20 tabular-nums${r?" text-[10px]":""}`;return b.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&(s?b.jsxs("button",{type:"button","aria-expanded":a??!1,"aria-label":`Show ${h} uncommitted file${h===1?"":"s"}`,title:`${h} file${h===1?"":"s"} edited but not yet committed — click to expand`,onClick:s,className:`${p} cursor-pointer hover:bg-orange-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1${a?" ring-1 ring-orange-500/40":""}`,children:[h," uncommitted"]}):b.jsxs("span",{title:`${h} file${h===1?"":"s"} edited but not yet committed`,className:p,children:[h," uncommitted"]})),d>0&&(u?b.jsxs("button",{type:"button","aria-expanded":l??!1,"aria-label":`Show ${d} unpushed commit${d===1?"":"s"}`,title:`${d} commit${d===1?"":"s"} not yet pushed -- click to expand`,onClick:u,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 tabular-nums${r?" text-[10px]":""}${l?" ring-1 ring-blue-500/40":""}`,children:[d," unpushed"]}):b.jsxs("span",{title:`${d} commit${d===1?"":"s"} not yet pushed`,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 tabular-nums${r?" text-[10px]":""}`,children:[d," unpushed"]}))]})}const WM={modified:"var(--warning)",added:"var(--success)",deleted:"var(--error)",untracked:"#a0a0a0",renamed:"var(--accent)",other:"#a0a0a0"},JM={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",other:"~"};function Fw({files:e}){return b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((t,r)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"text-[10px] font-mono font-semibold w-3 shrink-0 tabular-nums",style:{color:WM[t.status]},title:t.status,children:JM[t.status]}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:t.path})]},r))})}function Yw({commits:e,count:t}){return e.length===0?b.jsx("div",{className:"mx-3 mb-1 px-2 py-1.5 rounded border border-[var(--border)] bg-[var(--bg-card)]",children:b.jsx("span",{className:"text-[11px] text-[var(--text-muted)] italic",children:t!==void 0&&t>0?`${t} commit${t===1?"":"s"} ahead -- details unavailable`:"No unpushed commits"})}):b.jsx("div",{className:"mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]",children:e.map((r,a)=>b.jsxs("div",{className:"flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]",children:[b.jsx("span",{className:"font-mono text-[10px] text-[var(--text-muted)] shrink-0 tabular-nums w-14",children:r.hash}),b.jsx("span",{className:"font-mono text-[11px] text-[var(--text-secondary)] truncate",children:r.message})]},a))})}function $w(){return b.jsx("span",{title:"Merged into main",className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 shrink-0",children:"merged"})}function eT(){return b.jsx("span",{className:"inline-block h-5 w-20 rounded bg-[var(--bg-tertiary)] motion-safe:animate-pulse"})}function tT({scope:e,onChange:t}){return b.jsx("div",{className:"flex items-center gap-1",children:["active","all"].map(r=>b.jsx("button",{type:"button",onClick:()=>t(r),className:`font-mono text-[10px] uppercase tracking-[0.20em] px-2.5 py-1 transition-colors capitalize ${e===r?"border border-[var(--accent)] text-[var(--accent)] bg-transparent":"border border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r==="active"?"Active":"All"},r))})}function nT({repos:e,onOpen:t}){return b.jsxs("div",{className:"flex flex-col gap-1 pt-2 border-t border-[var(--border)]",children:[e.map(([r,a])=>b.jsx("button",{type:"button",onClick:()=>t(a),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:"// SESSION ARCHIVE →"},r)),e.length>1&&b.jsx("button",{type:"button",onClick:()=>t(void 0),className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left",children:"// ALL SESSIONS →"})]})}function rT({prompt:e}){return b.jsxs("div",{className:"flex flex-col items-center gap-8 py-20 text-center",children:[b.jsxs("div",{children:[b.jsx("p",{className:"font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-muted)] mb-3",children:"// WORKSPACE READY"}),b.jsx("h2",{className:"text-xl font-semibold text-[var(--text-primary)] mb-3",children:"Ready when you are"}),b.jsx("p",{className:"text-sm text-[var(--text-muted)] max-w-sm leading-relaxed",children:"Sessions appear here when your agent runs a workflow. Start one by telling your agent:"})]}),b.jsx("div",{className:"relative h-[100px] max-w-lg w-full",children:b.jsx(Es,{cut:12,borderColor:"var(--border)",background:"var(--bg-card)",className:"absolute inset-0",children:b.jsxs("div",{className:"px-6 py-5 text-left",children:[b.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] mb-2",children:"Try this prompt"}),b.jsxs("p",{className:"text-[var(--text-primary)] text-sm leading-relaxed",children:['"Use the'," ",b.jsx("span",{className:"text-[var(--accent)] font-medium",children:e.workflow})," ","to ",e.task,'"']})]})})}),b.jsxs("p",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]",children:["// ",Vw.length," PROMPTS AVAILABLE"]})]})}function $v(){const[e,t]=B.useState(()=>Math.floor(Math.random()*Yh.length)),[r,a]=B.useState(!1);return B.useEffect(()=>{let s=null;const l=setInterval(()=>{a(!0),s=setTimeout(()=>{t(u=>(u+1)%Yh.length),a(!1),s=null},300)},6e4);return()=>{clearInterval(l),s!==null&&clearTimeout(s)}},[]),b.jsx("div",{className:"flex items-start gap-3 border border-[var(--border)] px-4 py-3",style:{borderLeft:"3px solid rgba(244, 196, 48, 0.4)"},children:b.jsxs("div",{style:{opacity:r?0:1,transition:"opacity 300ms"},children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--accent)]",children:"// TIP"}),b.jsx("p",{className:"text-sm text-[var(--text-secondary)] mt-1 leading-relaxed",children:Yh[e]})]})})}function iT({items:e,focusedIndex:t,setFocusedIndex:r,onSelectSession:a,scope:s,setScope:l,refetch:u,archive:f,setArchive:h,disabled:d}){const p=B.useRef(e);p.current=e;const g=B.useRef(a);g.current=a;const y=B.useRef(s);y.current=s;const v=B.useRef(t);v.current=t;const w=B.useRef(f);w.current=f;const C=B.useRef(d);C.current=d,B.useEffect(()=>{function N(S){if(C.current||S.metaKey||S.ctrlKey||S.altKey)return;const A=document.activeElement;if(A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement||A instanceof HTMLSelectElement)return;if(S.key==="Escape"&&w.current!==null){h(null);return}const _=p.current,k=v.current;switch(S.key){case"j":case"ArrowDown":{S.preventDefault();const H=Math.min(k+1,_.length-1);r(H);break}case"k":case"ArrowUp":{S.preventDefault();const H=Math.max(k-1,0);r(H);break}case"Enter":case" ":{if(S.preventDefault(),k>=0&&k<_.length){const M=_[k].primarySession?.sessionId;M&&g.current(M)}break}case"Escape":break;case"/":{S.preventDefault(),h({repoName:void 0});break}case"r":{S.preventDefault(),u();break}case"a":{S.preventDefault(),l(y.current==="active"?"all":"active");break}}}return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[r,l,u,h])}function gn({children:e,color:t,className:r="",style:a}){return b.jsx("span",{className:`font-mono text-[10px] uppercase tracking-[0.30em] ${r}`,style:{color:t??"var(--text-muted)",...a},children:e})}function St(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,a;r<e.length;r++)(a=St(e[r]))!==""&&(t+=(t&&" ")+a);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var aT={value:()=>{}};function Kc(){for(var e=0,t=arguments.length,r={},a;e<t;++e){if(!(a=arguments[e]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new mc(r)}function mc(e){this._=e}function sT(e,t){return e.trim().split(/^|\s+/).map(function(r){var a="",s=r.indexOf(".");if(s>=0&&(a=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}mc.prototype=Kc.prototype={constructor:mc,on:function(e,t){var r=this._,a=sT(e+"",r),s,l=-1,u=a.length;if(arguments.length<2){for(;++l<u;)if((s=(e=a[l]).type)&&(s=oT(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(s=(e=a[l]).type)r[s]=Gv(r[s],e.name,t);else if(t==null)for(s in r)r[s]=Gv(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new mc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),a=0,s,l;a<s;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,s=l.length;a<s;++a)l[a].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],s=0,l=a.length;s<l;++s)a[s].value.apply(t,r)}};function oT(e,t){for(var r=0,a=e.length,s;r<a;++r)if((s=e[r]).name===t)return s.value}function Gv(e,t,r){for(var a=0,s=e.length;a<s;++a)if(e[a].name===t){e[a]=aT,e=e.slice(0,a).concat(e.slice(a+1));break}return r!=null&&e.push({name:t,value:r}),e}var jp="http://www.w3.org/1999/xhtml";const Xv={svg:"http://www.w3.org/2000/svg",xhtml:jp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Xv.hasOwnProperty(t)?{space:Xv[t],local:e}:e}function lT(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===jp&&t.documentElement.namespaceURI===jp?t.createElement(e):t.createElementNS(r,e)}}function uT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gw(e){var t=Zc(e);return(t.local?uT:lT)(t)}function cT(){}function Tm(e){return e==null?cT:function(){return this.querySelector(e)}}function fT(e){typeof e!="function"&&(e=Tm(e));for(var t=this._groups,r=t.length,a=new Array(r),s=0;s<r;++s)for(var l=t[s],u=l.length,f=a[s]=new Array(u),h,d,p=0;p<u;++p)(h=l[p])&&(d=e.call(h,h.__data__,p,l))&&("__data__"in h&&(d.__data__=h.__data__),f[p]=d);return new bn(a,this._parents)}function dT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hT(){return[]}function Xw(e){return e==null?hT:function(){return this.querySelectorAll(e)}}function pT(e){return function(){return dT(e.apply(this,arguments))}}function mT(e){typeof e=="function"?e=pT(e):e=Xw(e);for(var t=this._groups,r=t.length,a=[],s=[],l=0;l<r;++l)for(var u=t[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(a.push(e.call(h,h.__data__,d,u)),s.push(h));return new bn(a,s)}function Qw(e){return function(){return this.matches(e)}}function Kw(e){return function(t){return t.matches(e)}}var gT=Array.prototype.find;function yT(e){return function(){return gT.call(this.children,e)}}function xT(){return this.firstElementChild}function vT(e){return this.select(e==null?xT:yT(typeof e=="function"?e:Kw(e)))}var bT=Array.prototype.filter;function wT(){return Array.from(this.children)}function ST(e){return function(){return bT.call(this.children,e)}}function ET(e){return this.selectAll(e==null?wT:ST(typeof e=="function"?e:Kw(e)))}function CT(e){typeof e!="function"&&(e=Qw(e));for(var t=this._groups,r=t.length,a=new Array(r),s=0;s<r;++s)for(var l=t[s],u=l.length,f=a[s]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new bn(a,this._parents)}function Zw(e){return new Array(e.length)}function _T(){return new bn(this._enter||this._groups.map(Zw),this._parents)}function Tc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tc.prototype={constructor:Tc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function NT(e){return function(){return e}}function kT(e,t,r,a,s,l){for(var u=0,f,h=t.length,d=l.length;u<d;++u)(f=t[u])?(f.__data__=l[u],a[u]=f):r[u]=new Tc(e,l[u]);for(;u<h;++u)(f=t[u])&&(s[u]=f)}function MT(e,t,r,a,s,l,u){var f,h,d=new Map,p=t.length,g=l.length,y=new Array(p),v;for(f=0;f<p;++f)(h=t[f])&&(y[f]=v=u.call(h,h.__data__,f,t)+"",d.has(v)?s[f]=h:d.set(v,h));for(f=0;f<g;++f)v=u.call(e,l[f],f,l)+"",(h=d.get(v))?(a[f]=h,h.__data__=l[f],d.delete(v)):r[f]=new Tc(e,l[f]);for(f=0;f<p;++f)(h=t[f])&&d.get(y[f])===h&&(s[f]=h)}function TT(e){return e.__data__}function AT(e,t){if(!arguments.length)return Array.from(this,TT);var r=t?MT:kT,a=this._parents,s=this._groups;typeof e!="function"&&(e=NT(e));for(var l=s.length,u=new Array(l),f=new Array(l),h=new Array(l),d=0;d<l;++d){var p=a[d],g=s[d],y=g.length,v=RT(e.call(p,p&&p.__data__,d,a)),w=v.length,C=f[d]=new Array(w),N=u[d]=new Array(w),S=h[d]=new Array(y);r(p,g,C,N,S,v,t);for(var A=0,_=0,k,H;A<w;++A)if(k=C[A]){for(A>=_&&(_=A+1);!(H=N[_])&&++_<w;);k._next=H||null}}return u=new bn(u,a),u._enter=f,u._exit=h,u}function RT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jT(){return new bn(this._exit||this._groups.map(Zw),this._parents)}function OT(e,t,r){var a=this.enter(),s=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),r==null?l.remove():r(l),a&&s?a.merge(s).order():s}function DT(e){for(var t=e.selection?e.selection():e,r=this._groups,a=t._groups,s=r.length,l=a.length,u=Math.min(s,l),f=new Array(s),h=0;h<u;++h)for(var d=r[h],p=a[h],g=d.length,y=f[h]=new Array(g),v,w=0;w<g;++w)(v=d[w]||p[w])&&(y[w]=v);for(;h<s;++h)f[h]=r[h];return new bn(f,this._parents)}function zT(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var a=e[t],s=a.length-1,l=a[s],u;--s>=0;)(u=a[s])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function LT(e){e||(e=IT);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,a=r.length,s=new Array(a),l=0;l<a;++l){for(var u=r[l],f=u.length,h=s[l]=new Array(f),d,p=0;p<f;++p)(d=u[p])&&(h[p]=d);h.sort(t)}return new bn(s,this._parents).order()}function IT(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function BT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function HT(){return Array.from(this)}function PT(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],s=0,l=a.length;s<l;++s){var u=a[s];if(u)return u}return null}function UT(){let e=0;for(const t of this)++e;return e}function VT(){return!this.node()}function qT(e){for(var t=this._groups,r=0,a=t.length;r<a;++r)for(var s=t[r],l=0,u=s.length,f;l<u;++l)(f=s[l])&&e.call(f,f.__data__,l,s);return this}function FT(e){return function(){this.removeAttribute(e)}}function YT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $T(e,t){return function(){this.setAttribute(e,t)}}function GT(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function XT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function QT(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function KT(e,t){var r=Zc(e);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((t==null?r.local?YT:FT:typeof t=="function"?r.local?QT:XT:r.local?GT:$T)(r,t))}function Ww(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ZT(e){return function(){this.style.removeProperty(e)}}function WT(e,t,r){return function(){this.style.setProperty(e,t,r)}}function JT(e,t,r){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,r)}}function eA(e,t,r){return arguments.length>1?this.each((t==null?ZT:typeof t=="function"?JT:WT)(e,t,r??"")):gs(this.node(),e)}function gs(e,t){return e.style.getPropertyValue(t)||Ww(e).getComputedStyle(e,null).getPropertyValue(t)}function tA(e){return function(){delete this[e]}}function nA(e,t){return function(){this[e]=t}}function rA(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function iA(e,t){return arguments.length>1?this.each((t==null?tA:typeof t=="function"?rA:nA)(e,t)):this.node()[e]}function Jw(e){return e.trim().split(/^|\s+/)}function Am(e){return e.classList||new eS(e)}function eS(e){this._node=e,this._names=Jw(e.getAttribute("class")||"")}eS.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function tS(e,t){for(var r=Am(e),a=-1,s=t.length;++a<s;)r.add(t[a])}function nS(e,t){for(var r=Am(e),a=-1,s=t.length;++a<s;)r.remove(t[a])}function aA(e){return function(){tS(this,e)}}function sA(e){return function(){nS(this,e)}}function oA(e,t){return function(){(t.apply(this,arguments)?tS:nS)(this,e)}}function lA(e,t){var r=Jw(e+"");if(arguments.length<2){for(var a=Am(this.node()),s=-1,l=r.length;++s<l;)if(!a.contains(r[s]))return!1;return!0}return this.each((typeof t=="function"?oA:t?aA:sA)(r,t))}function uA(){this.textContent=""}function cA(e){return function(){this.textContent=e}}function fA(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function dA(e){return arguments.length?this.each(e==null?uA:(typeof e=="function"?fA:cA)(e)):this.node().textContent}function hA(){this.innerHTML=""}function pA(e){return function(){this.innerHTML=e}}function mA(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gA(e){return arguments.length?this.each(e==null?hA:(typeof e=="function"?mA:pA)(e)):this.node().innerHTML}function yA(){this.nextSibling&&this.parentNode.appendChild(this)}function xA(){return this.each(yA)}function vA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bA(){return this.each(vA)}function wA(e){var t=typeof e=="function"?e:Gw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function SA(){return null}function EA(e,t){var r=typeof e=="function"?e:Gw(e),a=t==null?SA:typeof t=="function"?t:Tm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function CA(){var e=this.parentNode;e&&e.removeChild(this)}function _A(){return this.each(CA)}function NA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MA(e){return this.select(e?kA:NA)}function TA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function AA(e){return function(t){e.call(this,t,this.__data__)}}function RA(e){return e.trim().split(/^|\s+/).map(function(t){var r="",a=t.indexOf(".");return a>=0&&(r=t.slice(a+1),t=t.slice(0,a)),{type:t,name:r}})}function jA(e){return function(){var t=this.__on;if(t){for(var r=0,a=-1,s=t.length,l;r<s;++r)l=t[r],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function OA(e,t,r){return function(){var a=this.__on,s,l=AA(t);if(a){for(var u=0,f=a.length;u<f;++u)if((s=a[u]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=r),s.value=t;return}}this.addEventListener(e.type,l,r),s={type:e.type,name:e.name,value:t,listener:l,options:r},a?a.push(s):this.__on=[s]}}function DA(e,t,r){var a=RA(e+""),s,l=a.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,p;h<d;++h)for(s=0,p=f[h];s<l;++s)if((u=a[s]).type===p.type&&u.name===p.name)return p.value}return}for(f=t?OA:jA,s=0;s<l;++s)this.each(f(a[s],t,r));return this}function rS(e,t,r){var a=Ww(e),s=a.CustomEvent;typeof s=="function"?s=new s(t,r):(s=a.document.createEvent("Event"),r?(s.initEvent(t,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function zA(e,t){return function(){return rS(this,e,t)}}function LA(e,t){return function(){return rS(this,e,t.apply(this,arguments))}}function IA(e,t){return this.each((typeof t=="function"?LA:zA)(e,t))}function*BA(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var a=e[t],s=0,l=a.length,u;s<l;++s)(u=a[s])&&(yield u)}var iS=[null];function bn(e,t){this._groups=e,this._parents=t}function gl(){return new bn([[document.documentElement]],iS)}function HA(){return this}bn.prototype=gl.prototype={constructor:bn,select:fT,selectAll:mT,selectChild:vT,selectChildren:ET,filter:CT,data:AT,enter:_T,exit:jT,join:OT,merge:DT,selection:HA,order:zT,sort:LT,call:BT,nodes:HT,node:PT,size:UT,empty:VT,each:qT,attr:KT,style:eA,property:iA,classed:lA,text:dA,html:gA,raise:xA,lower:bA,append:wA,insert:EA,remove:_A,clone:MA,datum:TA,on:DA,dispatch:IA,[Symbol.iterator]:BA};function yn(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],iS)}function PA(e){let t;for(;t=e.sourceEvent;)e=t;return e}function In(e,t){if(e=PA(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const UA={passive:!1},rl={capture:!0,passive:!1};function $h(e){e.stopImmediatePropagation()}function ls(e){e.preventDefault(),e.stopImmediatePropagation()}function aS(e){var t=e.document.documentElement,r=yn(e).on("dragstart.drag",ls,rl);"onselectstart"in t?r.on("selectstart.drag",ls,rl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sS(e,t){var r=e.document.documentElement,a=yn(e).on("dragstart.drag",null);t&&(a.on("click.drag",ls,rl),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Zu=e=>()=>e;function Op(e,{sourceEvent:t,subject:r,target:a,identifier:s,active:l,x:u,y:f,dx:h,dy:d,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:p}})}Op.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function VA(e){return!e.ctrlKey&&!e.button}function qA(){return this.parentNode}function FA(e,t){return t??{x:e.x,y:e.y}}function YA(){return navigator.maxTouchPoints||"ontouchstart"in this}function oS(){var e=VA,t=qA,r=FA,a=YA,s={},l=Kc("start","drag","end"),u=0,f,h,d,p,g=0;function y(k){k.on("mousedown.drag",v).filter(a).on("touchstart.drag",N).on("touchmove.drag",S,UA).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(k,H){if(!(p||!e.call(this,k,H))){var M=_(this,t.call(this,k,H),k,H,"mouse");M&&(yn(k.view).on("mousemove.drag",w,rl).on("mouseup.drag",C,rl),aS(k.view),$h(k),d=!1,f=k.clientX,h=k.clientY,M("start",k))}}function w(k){if(ls(k),!d){var H=k.clientX-f,M=k.clientY-h;d=H*H+M*M>g}s.mouse("drag",k)}function C(k){yn(k.view).on("mousemove.drag mouseup.drag",null),sS(k.view,d),ls(k),s.mouse("end",k)}function N(k,H){if(e.call(this,k,H)){var M=k.changedTouches,D=t.call(this,k,H),P=M.length,U,q;for(U=0;U<P;++U)(q=_(this,D,k,H,M[U].identifier,M[U]))&&($h(k),q("start",k,M[U]))}}function S(k){var H=k.changedTouches,M=H.length,D,P;for(D=0;D<M;++D)(P=s[H[D].identifier])&&(ls(k),P("drag",k,H[D]))}function A(k){var H=k.changedTouches,M=H.length,D,P;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),D=0;D<M;++D)(P=s[H[D].identifier])&&($h(k),P("end",k,H[D]))}function _(k,H,M,D,P,U){var q=l.copy(),I=In(U||M,H),Y,Q,L;if((L=r.call(k,new Op("beforestart",{sourceEvent:M,target:y,identifier:P,active:u,x:I[0],y:I[1],dx:0,dy:0,dispatch:q}),D))!=null)return Y=L.x-I[0]||0,Q=L.y-I[1]||0,function V(T,F,X){var Z=I,j;switch(T){case"start":s[P]=V,j=u++;break;case"end":delete s[P],--u;case"drag":I=In(X||F,H),j=u;break}q.call(T,k,new Op(T,{sourceEvent:F,subject:L,target:y,identifier:P,active:j,x:I[0]+Y,y:I[1]+Q,dx:I[0]-Z[0],dy:I[1]-Z[1],dispatch:q}),D)}}return y.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Zu(!!k),y):e},y.container=function(k){return arguments.length?(t=typeof k=="function"?k:Zu(k),y):t},y.subject=function(k){return arguments.length?(r=typeof k=="function"?k:Zu(k),y):r},y.touchable=function(k){return arguments.length?(a=typeof k=="function"?k:Zu(!!k),y):a},y.on=function(){var k=l.on.apply(l,arguments);return k===l?y:k},y.clickDistance=function(k){return arguments.length?(g=(k=+k)*k,y):Math.sqrt(g)},y}function Rm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function lS(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function yl(){}var il=.7,Ac=1/il,us="\\s*([+-]?\\d+)\\s*",al="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$A=/^#([0-9a-f]{3,8})$/,GA=new RegExp(`^rgb\\(${us},${us},${us}\\)$`),XA=new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),QA=new RegExp(`^rgba\\(${us},${us},${us},${al}\\)$`),KA=new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${al}\\)$`),ZA=new RegExp(`^hsl\\(${al},${Jn},${Jn}\\)$`),WA=new RegExp(`^hsla\\(${al},${Jn},${Jn},${al}\\)$`),Qv={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};Rm(yl,ta,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kv,formatHex:Kv,formatHex8:JA,formatHsl:eR,formatRgb:Zv,toString:Zv});function Kv(){return this.rgb().formatHex()}function JA(){return this.rgb().formatHex8()}function eR(){return uS(this).formatHsl()}function Zv(){return this.rgb().formatRgb()}function ta(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=$A.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Wv(t):r===3?new tn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Wu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Wu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GA.exec(e))?new tn(t[1],t[2],t[3],1):(t=XA.exec(e))?new tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=QA.exec(e))?Wu(t[1],t[2],t[3],t[4]):(t=KA.exec(e))?Wu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZA.exec(e))?tb(t[1],t[2]/100,t[3]/100,1):(t=WA.exec(e))?tb(t[1],t[2]/100,t[3]/100,t[4]):Qv.hasOwnProperty(e)?Wv(Qv[e]):e==="transparent"?new tn(NaN,NaN,NaN,0):null}function Wv(e){return new tn(e>>16&255,e>>8&255,e&255,1)}function Wu(e,t,r,a){return a<=0&&(e=t=r=NaN),new tn(e,t,r,a)}function tR(e){return e instanceof yl||(e=ta(e)),e?(e=e.rgb(),new tn(e.r,e.g,e.b,e.opacity)):new tn}function Dp(e,t,r,a){return arguments.length===1?tR(e):new tn(e,t,r,a??1)}function tn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}Rm(tn,Dp,lS(yl,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?il:Math.pow(il,e),new tn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tn(Wi(this.r),Wi(this.g),Wi(this.b),Rc(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:Jv,formatHex:Jv,formatHex8:nR,formatRgb:eb,toString:eb}));function Jv(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function nR(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function eb(){const e=Rc(this.opacity);return`${e===1?"rgb(":"rgba("}${Wi(this.r)}, ${Wi(this.g)}, ${Wi(this.b)}${e===1?")":`, ${e})`}`}function Rc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $i(e){return e=Wi(e),(e<16?"0":"")+e.toString(16)}function tb(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Bn(e,t,r,a)}function uS(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);if(e instanceof yl||(e=ta(e)),!e)return new Bn;if(e instanceof Bn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,s=Math.min(t,r,a),l=Math.max(t,r,a),u=NaN,f=l-s,h=(l+s)/2;return f?(t===l?u=(r-a)/f+(r<a)*6:r===l?u=(a-t)/f+2:u=(t-r)/f+4,f/=h<.5?l+s:2-l-s,u*=60):f=h>0&&h<1?0:u,new Bn(u,f,h,e.opacity)}function rR(e,t,r,a){return arguments.length===1?uS(e):new Bn(e,t,r,a??1)}function Bn(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}Rm(Bn,rR,lS(yl,{brighter(e){return e=e==null?Ac:Math.pow(Ac,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?il:Math.pow(il,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,s=2*r-a;return new tn(Gh(e>=240?e-240:e+120,s,a),Gh(e,s,a),Gh(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new Bn(nb(this.h),Ju(this.s),Ju(this.l),Rc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Rc(this.opacity);return`${e===1?"hsl(":"hsla("}${nb(this.h)}, ${Ju(this.s)*100}%, ${Ju(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nb(e){return e=(e||0)%360,e<0?e+360:e}function Ju(e){return Math.max(0,Math.min(1,e||0))}function Gh(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const jm=e=>()=>e;function iR(e,t){return function(r){return e+r*t}}function aR(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function sR(e){return(e=+e)==1?cS:function(t,r){return r-t?aR(t,r,e):jm(isNaN(t)?r:t)}}function cS(e,t){var r=t-e;return r?iR(e,r):jm(isNaN(e)?t:e)}const jc=(function e(t){var r=sR(t);function a(s,l){var u=r((s=Dp(s)).r,(l=Dp(l)).r),f=r(s.g,l.g),h=r(s.b,l.b),d=cS(s.opacity,l.opacity);return function(p){return s.r=u(p),s.g=f(p),s.b=h(p),s.opacity=d(p),s+""}}return a.gamma=e,a})(1);function oR(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(l){for(s=0;s<r;++s)a[s]=e[s]*(1-l)+t[s]*l;return a}}function lR(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uR(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,s=new Array(a),l=new Array(r),u;for(u=0;u<a;++u)s[u]=Uo(e[u],t[u]);for(;u<r;++u)l[u]=t[u];return function(f){for(u=0;u<a;++u)l[u]=s[u](f);return l}}function cR(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function Zn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function fR(e,t){var r={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=Uo(e[s],t[s]):a[s]=t[s];return function(l){for(s in r)a[s]=r[s](l);return a}}var zp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xh=new RegExp(zp.source,"g");function dR(e){return function(){return e}}function hR(e){return function(t){return e(t)+""}}function fS(e,t){var r=zp.lastIndex=Xh.lastIndex=0,a,s,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(a=zp.exec(e))&&(s=Xh.exec(t));)(l=s.index)>r&&(l=t.slice(r,l),f[u]?f[u]+=l:f[++u]=l),(a=a[0])===(s=s[0])?f[u]?f[u]+=s:f[++u]=s:(f[++u]=null,h.push({i:u,x:Zn(a,s)})),r=Xh.lastIndex;return r<t.length&&(l=t.slice(r),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?hR(h[0].x):dR(t):(t=h.length,function(d){for(var p=0,g;p<t;++p)f[(g=h[p]).i]=g.x(d);return f.join("")})}function Uo(e,t){var r=typeof t,a;return t==null||r==="boolean"?jm(t):(r==="number"?Zn:r==="string"?(a=ta(t))?(t=a,jc):fS:t instanceof ta?jc:t instanceof Date?cR:lR(t)?oR:Array.isArray(t)?uR:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fR:Zn)(e,t)}var rb=180/Math.PI,Lp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dS(e,t,r,a,s,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*a)&&(r-=e*h,a-=t*h),(f=Math.sqrt(r*r+a*a))&&(r/=f,a/=f,h/=f),e*a<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*rb,skewX:Math.atan(h)*rb,scaleX:u,scaleY:f}}var ec;function pR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lp:dS(t.a,t.b,t.c,t.d,t.e,t.f)}function mR(e){return e==null||(ec||(ec=document.createElementNS("http://www.w3.org/2000/svg","g")),ec.setAttribute("transform",e),!(e=ec.transform.baseVal.consolidate()))?Lp:(e=e.matrix,dS(e.a,e.b,e.c,e.d,e.e,e.f))}function hS(e,t,r,a){function s(d){return d.length?d.pop()+" ":""}function l(d,p,g,y,v,w){if(d!==g||p!==y){var C=v.push("translate(",null,t,null,r);w.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(p,y)})}else(g||y)&&v.push("translate("+g+t+y+r)}function u(d,p,g,y){d!==p?(d-p>180?p+=360:p-d>180&&(d+=360),y.push({i:g.push(s(g)+"rotate(",null,a)-2,x:Zn(d,p)})):p&&g.push(s(g)+"rotate("+p+a)}function f(d,p,g,y){d!==p?y.push({i:g.push(s(g)+"skewX(",null,a)-2,x:Zn(d,p)}):p&&g.push(s(g)+"skewX("+p+a)}function h(d,p,g,y,v,w){if(d!==g||p!==y){var C=v.push(s(v)+"scale(",null,",",null,")");w.push({i:C-4,x:Zn(d,g)},{i:C-2,x:Zn(p,y)})}else(g!==1||y!==1)&&v.push(s(v)+"scale("+g+","+y+")")}return function(d,p){var g=[],y=[];return d=e(d),p=e(p),l(d.translateX,d.translateY,p.translateX,p.translateY,g,y),u(d.rotate,p.rotate,g,y),f(d.skewX,p.skewX,g,y),h(d.scaleX,d.scaleY,p.scaleX,p.scaleY,g,y),d=p=null,function(v){for(var w=-1,C=y.length,N;++w<C;)g[(N=y[w]).i]=N.x(v);return g.join("")}}}var gR=hS(pR,"px, ","px)","deg)"),yR=hS(mR,", ",")",")"),xR=1e-12;function ib(e){return((e=Math.exp(e))+1/e)/2}function vR(e){return((e=Math.exp(e))-1/e)/2}function bR(e){return((e=Math.exp(2*e))-1)/(e+1)}const gc=(function e(t,r,a){function s(l,u){var f=l[0],h=l[1],d=l[2],p=u[0],g=u[1],y=u[2],v=p-f,w=g-h,C=v*v+w*w,N,S;if(C<xR)S=Math.log(y/d)/t,N=function(D){return[f+D*v,h+D*w,d*Math.exp(t*D*S)]};else{var A=Math.sqrt(C),_=(y*y-d*d+a*C)/(2*d*r*A),k=(y*y-d*d-a*C)/(2*y*r*A),H=Math.log(Math.sqrt(_*_+1)-_),M=Math.log(Math.sqrt(k*k+1)-k);S=(M-H)/t,N=function(D){var P=D*S,U=ib(H),q=d/(r*A)*(U*bR(t*P+H)-vR(H));return[f+q*v,h+q*w,d*U/ib(t*P+H)]}}return N.duration=S*1e3*t/Math.SQRT2,N}return s.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},s})(Math.SQRT2,2,4);var ys=0,Ho=0,To=0,pS=1e3,Oc,Po,Dc=0,na=0,Wc=0,sl=typeof performance=="object"&&performance.now?performance:Date,mS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Om(){return na||(mS(wR),na=sl.now()+Wc)}function wR(){na=0}function zc(){this._call=this._time=this._next=null}zc.prototype=gS.prototype={constructor:zc,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Om():+r)+(t==null?0:+t),!this._next&&Po!==this&&(Po?Po._next=this:Oc=this,Po=this),this._call=e,this._time=r,Ip()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ip())}};function gS(e,t,r){var a=new zc;return a.restart(e,t,r),a}function SR(){Om(),++ys;for(var e=Oc,t;e;)(t=na-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ys}function ab(){na=(Dc=sl.now())+Wc,ys=Ho=0;try{SR()}finally{ys=0,CR(),na=0}}function ER(){var e=sl.now(),t=e-Dc;t>pS&&(Wc-=t,Dc=e)}function CR(){for(var e,t=Oc,r,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Oc=r);Po=e,Ip(a)}function Ip(e){if(!ys){Ho&&(Ho=clearTimeout(Ho));var t=e-na;t>24?(e<1/0&&(Ho=setTimeout(ab,e-sl.now()-Wc)),To&&(To=clearInterval(To))):(To||(Dc=sl.now(),To=setInterval(ER,pS)),ys=1,mS(ab))}}function sb(e,t,r){var a=new zc;return t=t==null?0:+t,a.restart(s=>{a.stop(),e(s+t)},t,r),a}var _R=Kc("start","end","cancel","interrupt"),NR=[],yS=0,ob=1,Bp=2,yc=3,lb=4,Hp=5,xc=6;function Jc(e,t,r,a,s,l){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;kR(e,r,{name:t,index:a,group:s,on:_R,tween:NR,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:yS})}function Dm(e,t){var r=Un(e,t);if(r.state>yS)throw new Error("too late; already scheduled");return r}function nr(e,t){var r=Un(e,t);if(r.state>yc)throw new Error("too late; already running");return r}function Un(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function kR(e,t,r){var a=e.__transition,s;a[t]=r,r.timer=gS(l,0,r.time);function l(d){r.state=ob,r.timer.restart(u,r.delay,r.time),r.delay<=d&&u(d-r.delay)}function u(d){var p,g,y,v;if(r.state!==ob)return h();for(p in a)if(v=a[p],v.name===r.name){if(v.state===yc)return sb(u);v.state===lb?(v.state=xc,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete a[p]):+p<t&&(v.state=xc,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete a[p])}if(sb(function(){r.state===yc&&(r.state=lb,r.timer.restart(f,r.delay,r.time),f(d))}),r.state=Bp,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Bp){for(r.state=yc,s=new Array(y=r.tween.length),p=0,g=-1;p<y;++p)(v=r.tween[p].value.call(e,e.__data__,r.index,r.group))&&(s[++g]=v);s.length=g+1}}function f(d){for(var p=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Hp,1),g=-1,y=s.length;++g<y;)s[g].call(e,p);r.state===Hp&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=xc,r.timer.stop(),delete a[t];for(var d in a)return;delete e.__transition}}function vc(e,t){var r=e.__transition,a,s,l=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((a=r[u]).name!==t){l=!1;continue}s=a.state>Bp&&a.state<Hp,a.state=xc,a.timer.stop(),a.on.call(s?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete r[u]}l&&delete e.__transition}}function MR(e){return this.each(function(){vc(this,e)})}function TR(e,t){var r,a;return function(){var s=nr(this,e),l=s.tween;if(l!==r){a=r=l;for(var u=0,f=a.length;u<f;++u)if(a[u].name===t){a=a.slice(),a.splice(u,1);break}}s.tween=a}}function AR(e,t,r){var a,s;if(typeof r!="function")throw new Error;return function(){var l=nr(this,e),u=l.tween;if(u!==a){s=(a=u).slice();for(var f={name:t,value:r},h=0,d=s.length;h<d;++h)if(s[h].name===t){s[h]=f;break}h===d&&s.push(f)}l.tween=s}}function RR(e,t){var r=this._id;if(e+="",arguments.length<2){for(var a=Un(this.node(),r).tween,s=0,l=a.length,u;s<l;++s)if((u=a[s]).name===e)return u.value;return null}return this.each((t==null?TR:AR)(r,e,t))}function zm(e,t,r){var a=e._id;return e.each(function(){var s=nr(this,a);(s.value||(s.value={}))[t]=r.apply(this,arguments)}),function(s){return Un(s,a).value[t]}}function xS(e,t){var r;return(typeof t=="number"?Zn:t instanceof ta?jc:(r=ta(t))?(t=r,jc):fS)(e,t)}function jR(e){return function(){this.removeAttribute(e)}}function OR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DR(e,t,r){var a,s=r+"",l;return function(){var u=this.getAttribute(e);return u===s?null:u===a?l:l=t(a=u,r)}}function zR(e,t,r){var a,s=r+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===s?null:u===a?l:l=t(a=u,r)}}function LR(e,t,r){var a,s,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===a&&h===s?l:(s=h,l=t(a=u,f)))}}function IR(e,t,r){var a,s,l;return function(){var u,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===a&&h===s?l:(s=h,l=t(a=u,f)))}}function BR(e,t){var r=Zc(e),a=r==="transform"?yR:xS;return this.attrTween(e,typeof t=="function"?(r.local?IR:LR)(r,a,zm(this,"attr."+e,t)):t==null?(r.local?OR:jR)(r):(r.local?zR:DR)(r,a,t))}function HR(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function PR(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function UR(e,t){var r,a;function s(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&PR(e,l)),r}return s._value=t,s}function VR(e,t){var r,a;function s(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&HR(e,l)),r}return s._value=t,s}function qR(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var a=Zc(e);return this.tween(r,(a.local?UR:VR)(a,t))}function FR(e,t){return function(){Dm(this,e).delay=+t.apply(this,arguments)}}function YR(e,t){return t=+t,function(){Dm(this,e).delay=t}}function $R(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?FR:YR)(t,e)):Un(this.node(),t).delay}function GR(e,t){return function(){nr(this,e).duration=+t.apply(this,arguments)}}function XR(e,t){return t=+t,function(){nr(this,e).duration=t}}function QR(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GR:XR)(t,e)):Un(this.node(),t).duration}function KR(e,t){if(typeof t!="function")throw new Error;return function(){nr(this,e).ease=t}}function ZR(e){var t=this._id;return arguments.length?this.each(KR(t,e)):Un(this.node(),t).ease}function WR(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;nr(this,e).ease=r}}function JR(e){if(typeof e!="function")throw new Error;return this.each(WR(this._id,e))}function ej(e){typeof e!="function"&&(e=Qw(e));for(var t=this._groups,r=t.length,a=new Array(r),s=0;s<r;++s)for(var l=t[s],u=l.length,f=a[s]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new Tr(a,this._parents,this._name,this._id)}function tj(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,a=t.length,s=r.length,l=Math.min(a,s),u=new Array(a),f=0;f<l;++f)for(var h=t[f],d=r[f],p=h.length,g=u[f]=new Array(p),y,v=0;v<p;++v)(y=h[v]||d[v])&&(g[v]=y);for(;f<a;++f)u[f]=t[f];return new Tr(u,this._parents,this._name,this._id)}function nj(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function rj(e,t,r){var a,s,l=nj(t)?Dm:nr;return function(){var u=l(this,e),f=u.on;f!==a&&(s=(a=f).copy()).on(t,r),u.on=s}}function ij(e,t){var r=this._id;return arguments.length<2?Un(this.node(),r).on.on(e):this.each(rj(r,e,t))}function aj(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function sj(){return this.on("end.remove",aj(this._id))}function oj(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Tm(e));for(var a=this._groups,s=a.length,l=new Array(s),u=0;u<s;++u)for(var f=a[u],h=f.length,d=l[u]=new Array(h),p,g,y=0;y<h;++y)(p=f[y])&&(g=e.call(p,p.__data__,y,f))&&("__data__"in p&&(g.__data__=p.__data__),d[y]=g,Jc(d[y],t,r,y,d,Un(p,r)));return new Tr(l,this._parents,t,r)}function lj(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Xw(e));for(var a=this._groups,s=a.length,l=[],u=[],f=0;f<s;++f)for(var h=a[f],d=h.length,p,g=0;g<d;++g)if(p=h[g]){for(var y=e.call(p,p.__data__,g,h),v,w=Un(p,r),C=0,N=y.length;C<N;++C)(v=y[C])&&Jc(v,t,r,C,y,w);l.push(y),u.push(p)}return new Tr(l,u,t,r)}var uj=gl.prototype.constructor;function cj(){return new uj(this._groups,this._parents)}function fj(e,t){var r,a,s;return function(){var l=gs(this,e),u=(this.style.removeProperty(e),gs(this,e));return l===u?null:l===r&&u===a?s:s=t(r=l,a=u)}}function vS(e){return function(){this.style.removeProperty(e)}}function dj(e,t,r){var a,s=r+"",l;return function(){var u=gs(this,e);return u===s?null:u===a?l:l=t(a=u,r)}}function hj(e,t,r){var a,s,l;return function(){var u=gs(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),gs(this,e))),u===h?null:u===a&&h===s?l:(s=h,l=t(a=u,f))}}function pj(e,t){var r,a,s,l="style."+t,u="end."+l,f;return function(){var h=nr(this,e),d=h.on,p=h.value[l]==null?f||(f=vS(t)):void 0;(d!==r||s!==p)&&(a=(r=d).copy()).on(u,s=p),h.on=a}}function mj(e,t,r){var a=(e+="")=="transform"?gR:xS;return t==null?this.styleTween(e,fj(e,a)).on("end.style."+e,vS(e)):typeof t=="function"?this.styleTween(e,hj(e,a,zm(this,"style."+e,t))).each(pj(this._id,e)):this.styleTween(e,dj(e,a,t),r).on("end.style."+e,null)}function gj(e,t,r){return function(a){this.style.setProperty(e,t.call(this,a),r)}}function yj(e,t,r){var a,s;function l(){var u=t.apply(this,arguments);return u!==s&&(a=(s=u)&&gj(e,u,r)),a}return l._value=t,l}function xj(e,t,r){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,yj(e,t,r??""))}function vj(e){return function(){this.textContent=e}}function bj(e){return function(){var t=e(this);this.textContent=t??""}}function wj(e){return this.tween("text",typeof e=="function"?bj(zm(this,"text",e)):vj(e==null?"":e+""))}function Sj(e){return function(t){this.textContent=e.call(this,t)}}function Ej(e){var t,r;function a(){var s=e.apply(this,arguments);return s!==r&&(t=(r=s)&&Sj(s)),t}return a._value=e,a}function Cj(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ej(e))}function _j(){for(var e=this._name,t=this._id,r=bS(),a=this._groups,s=a.length,l=0;l<s;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var p=Un(h,t);Jc(h,e,r,d,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Tr(a,this._parents,e,r)}function Nj(){var e,t,r=this,a=r._id,s=r.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--s===0&&l()}};r.each(function(){var d=nr(this,a),p=d.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),s===0&&l()})}var kj=0;function Tr(e,t,r,a){this._groups=e,this._parents=t,this._name=r,this._id=a}function bS(){return++kj}var Cr=gl.prototype;Tr.prototype={constructor:Tr,select:oj,selectAll:lj,selectChild:Cr.selectChild,selectChildren:Cr.selectChildren,filter:ej,merge:tj,selection:cj,transition:_j,call:Cr.call,nodes:Cr.nodes,node:Cr.node,size:Cr.size,empty:Cr.empty,each:Cr.each,on:ij,attr:BR,attrTween:qR,style:mj,styleTween:xj,text:wj,textTween:Cj,remove:sj,tween:RR,delay:$R,duration:QR,ease:ZR,easeVarying:JR,end:Nj,[Symbol.iterator]:Cr[Symbol.iterator]};function Mj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Tj={time:null,delay:0,duration:250,ease:Mj};function Aj(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Rj(e){var t,r;e instanceof Tr?(t=e._id,e=e._name):(t=bS(),(r=Tj).time=Om(),e=e==null?null:e+"");for(var a=this._groups,s=a.length,l=0;l<s;++l)for(var u=a[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&Jc(h,e,t,d,u,r||Aj(h,t));return new Tr(a,this._parents,e,t)}gl.prototype.interrupt=MR;gl.prototype.transition=Rj;const tc=e=>()=>e;function jj(e,{sourceEvent:t,target:r,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function kr(e,t,r){this.k=e,this.x=t,this.y=r}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new kr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ef=new kr(1,0,0);wS.prototype=kr.prototype;function wS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ef;return e.__zoom}function Qh(e){e.stopImmediatePropagation()}function Ao(e){e.preventDefault(),e.stopImmediatePropagation()}function Oj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Dj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ub(){return this.__zoom||ef}function zj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Lj(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ij(e,t,r){var a=e.invertX(t[0][0])-r[0][0],s=e.invertX(t[1][0])-r[1][0],l=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function SS(){var e=Oj,t=Dj,r=Ij,a=zj,s=Lj,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=gc,d=Kc("start","zoom","end"),p,g,y,v=500,w=150,C=0,N=10;function S(L){L.property("__zoom",ub).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(L,V,T,F){var X=L.selection?L.selection():L;X.property("__zoom",ub),L!==X?H(L,V,T,F):X.interrupt().each(function(){M(this,arguments).event(F).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(L,V,T,F){S.scaleTo(L,function(){var X=this.__zoom.k,Z=typeof V=="function"?V.apply(this,arguments):V;return X*Z},T,F)},S.scaleTo=function(L,V,T,F){S.transform(L,function(){var X=t.apply(this,arguments),Z=this.__zoom,j=T==null?k(X):typeof T=="function"?T.apply(this,arguments):T,z=Z.invert(j),$=typeof V=="function"?V.apply(this,arguments):V;return r(_(A(Z,$),j,z),X,u)},T,F)},S.translateBy=function(L,V,T,F){S.transform(L,function(){return r(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),u)},null,F)},S.translateTo=function(L,V,T,F,X){S.transform(L,function(){var Z=t.apply(this,arguments),j=this.__zoom,z=F==null?k(Z):typeof F=="function"?F.apply(this,arguments):F;return r(ef.translate(z[0],z[1]).scale(j.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof T=="function"?-T.apply(this,arguments):-T),Z,u)},F,X)};function A(L,V){return V=Math.max(l[0],Math.min(l[1],V)),V===L.k?L:new kr(V,L.x,L.y)}function _(L,V,T){var F=V[0]-T[0]*L.k,X=V[1]-T[1]*L.k;return F===L.x&&X===L.y?L:new kr(L.k,F,X)}function k(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function H(L,V,T,F){L.on("start.zoom",function(){M(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(F).end()}).tween("zoom",function(){var X=this,Z=arguments,j=M(X,Z).event(F),z=t.apply(X,Z),$=T==null?k(z):typeof T=="function"?T.apply(X,Z):T,R=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),te=X.__zoom,ue=typeof V=="function"?V.apply(X,Z):V,fe=h(te.invert($).concat(R/te.k),ue.invert($).concat(R/ue.k));return function(de){if(de===1)de=ue;else{var le=fe(de),pe=R/le[2];de=new kr(pe,$[0]-le[0]*pe,$[1]-le[1]*pe)}j.zoom(null,de)}})}function M(L,V,T){return!T&&L.__zooming||new D(L,V)}function D(L,V){this.that=L,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,V),this.taps=0}D.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,V){return this.mouse&&L!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var V=yn(this.that).datum();d.call(L,this.that,new jj(L,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:d}),V)}};function P(L,...V){if(!e.apply(this,arguments))return;var T=M(this,V).event(L),F=this.__zoom,X=Math.max(l[0],Math.min(l[1],F.k*Math.pow(2,a.apply(this,arguments)))),Z=In(L);if(T.wheel)(T.mouse[0][0]!==Z[0]||T.mouse[0][1]!==Z[1])&&(T.mouse[1]=F.invert(T.mouse[0]=Z)),clearTimeout(T.wheel);else{if(F.k===X)return;T.mouse=[Z,F.invert(Z)],vc(this),T.start()}Ao(L),T.wheel=setTimeout(j,w),T.zoom("mouse",r(_(A(F,X),T.mouse[0],T.mouse[1]),T.extent,u));function j(){T.wheel=null,T.end()}}function U(L,...V){if(y||!e.apply(this,arguments))return;var T=L.currentTarget,F=M(this,V,!0).event(L),X=yn(L.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",R,!0),Z=In(L,T),j=L.clientX,z=L.clientY;aS(L.view),Qh(L),F.mouse=[Z,this.__zoom.invert(Z)],vc(this),F.start();function $(te){if(Ao(te),!F.moved){var ue=te.clientX-j,fe=te.clientY-z;F.moved=ue*ue+fe*fe>C}F.event(te).zoom("mouse",r(_(F.that.__zoom,F.mouse[0]=In(te,T),F.mouse[1]),F.extent,u))}function R(te){X.on("mousemove.zoom mouseup.zoom",null),sS(te.view,F.moved),Ao(te),F.event(te).end()}}function q(L,...V){if(e.apply(this,arguments)){var T=this.__zoom,F=In(L.changedTouches?L.changedTouches[0]:L,this),X=T.invert(F),Z=T.k*(L.shiftKey?.5:2),j=r(_(A(T,Z),F,X),t.apply(this,V),u);Ao(L),f>0?yn(this).transition().duration(f).call(H,j,F,L):yn(this).call(S.transform,j,F,L)}}function I(L,...V){if(e.apply(this,arguments)){var T=L.touches,F=T.length,X=M(this,V,L.changedTouches.length===F).event(L),Z,j,z,$;for(Qh(L),j=0;j<F;++j)z=T[j],$=In(z,this),$=[$,this.__zoom.invert($),z.identifier],X.touch0?!X.touch1&&X.touch0[2]!==$[2]&&(X.touch1=$,X.taps=0):(X.touch0=$,Z=!0,X.taps=1+!!p);p&&(p=clearTimeout(p)),Z&&(X.taps<2&&(g=$[0],p=setTimeout(function(){p=null},v)),vc(this),X.start())}}function Y(L,...V){if(this.__zooming){var T=M(this,V).event(L),F=L.changedTouches,X=F.length,Z,j,z,$;for(Ao(L),Z=0;Z<X;++Z)j=F[Z],z=In(j,this),T.touch0&&T.touch0[2]===j.identifier?T.touch0[0]=z:T.touch1&&T.touch1[2]===j.identifier&&(T.touch1[0]=z);if(j=T.that.__zoom,T.touch1){var R=T.touch0[0],te=T.touch0[1],ue=T.touch1[0],fe=T.touch1[1],de=(de=ue[0]-R[0])*de+(de=ue[1]-R[1])*de,le=(le=fe[0]-te[0])*le+(le=fe[1]-te[1])*le;j=A(j,Math.sqrt(de/le)),z=[(R[0]+ue[0])/2,(R[1]+ue[1])/2],$=[(te[0]+fe[0])/2,(te[1]+fe[1])/2]}else if(T.touch0)z=T.touch0[0],$=T.touch0[1];else return;T.zoom("touch",r(_(j,z,$),T.extent,u))}}function Q(L,...V){if(this.__zooming){var T=M(this,V).event(L),F=L.changedTouches,X=F.length,Z,j;for(Qh(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},v),Z=0;Z<X;++Z)j=F[Z],T.touch0&&T.touch0[2]===j.identifier?delete T.touch0:T.touch1&&T.touch1[2]===j.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(j=In(j,this),Math.hypot(g[0]-j[0],g[1]-j[1])<N)){var z=yn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return S.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:tc(+L),S):a},S.filter=function(L){return arguments.length?(e=typeof L=="function"?L:tc(!!L),S):e},S.touchable=function(L){return arguments.length?(s=typeof L=="function"?L:tc(!!L),S):s},S.extent=function(L){return arguments.length?(t=typeof L=="function"?L:tc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),S):t},S.scaleExtent=function(L){return arguments.length?(l[0]=+L[0],l[1]=+L[1],S):[l[0],l[1]]},S.translateExtent=function(L){return arguments.length?(u[0][0]=+L[0][0],u[1][0]=+L[1][0],u[0][1]=+L[0][1],u[1][1]=+L[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(L){return arguments.length?(r=L,S):r},S.duration=function(L){return arguments.length?(f=+L,S):f},S.interpolate=function(L){return arguments.length?(h=L,S):h},S.on=function(){var L=d.on.apply(d,arguments);return L===d?S:L},S.clickDistance=function(L){return arguments.length?(C=(L=+L)*L,S):Math.sqrt(C)},S.tapDistance=function(L){return arguments.length?(N=+L,S):N},S}const er={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:a}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ol=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ES=["Enter"," ","Escape"],CS={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"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 xs;(function(e){e.Strict="strict",e.Loose="loose"})(xs||(xs={}));var Ji;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ji||(Ji={}));var ll;(function(e){e.Partial="partial",e.Full="full"})(ll||(ll={}));const _S={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ui;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ui||(ui={}));var Lc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Lc||(Lc={}));var _e;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(_e||(_e={}));const cb={[_e.Left]:_e.Right,[_e.Right]:_e.Left,[_e.Top]:_e.Bottom,[_e.Bottom]:_e.Top};function NS(e){return e===null?null:e?"valid":"invalid"}const kS=e=>"id"in e&&"source"in e&&"target"in e,Bj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Lm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),xl=(e,t=[0,0])=>{const{width:r,height:a}=Ar(e),s=e.origin??t,l=r*s[0],u=a*s[1];return{x:e.position.x-l,y:e.position.y-u}},Hj=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((a,s)=>{const l=typeof s=="string";let u=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(s):Lm(s)?s:t.nodeLookup.get(s.id));const f=u?Ic(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return tf(a,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return nf(r)},vl=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(r=tf(r,Ic(s)),a=!0)}),a?nf(r):{x:0,y:0,width:0,height:0}},Im=(e,t,[r,a,s]=[0,0,1],l=!1,u=!1)=>{const f={...wl(t,[r,a,s]),width:t.width/s,height:t.height/s},h=[];for(const d of e.values()){const{measured:p,selectable:g=!0,hidden:y=!1}=d;if(u&&!g||y)continue;const v=p.width??d.width??d.initialWidth??null,w=p.height??d.height??d.initialHeight??null,C=ul(f,bs(d)),N=(v??0)*(w??0),S=l&&C>0;(!d.internals.handleBounds||S||C>=N||d.dragging)&&h.push(d)}return h},Pj=(e,t)=>{const r=new Set;return e.forEach(a=>{r.add(a.id)}),t.filter(a=>r.has(a.source)||r.has(a.target))};function Uj(e,t){const r=new Map,a=t?.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&(t?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&r.set(s.id,s)}),r}async function Vj({nodes:e,width:t,height:r,panZoom:a,minZoom:s,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const f=Uj(e,u),h=vl(f),d=Bm(h,t,r,u?.minZoom??s,u?.maxZoom??l,u?.padding??.1);return await a.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function MS({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:a=[0,0],nodeExtent:s,onError:l}){const u=r.get(e),f=u.parentId?r.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},p=u.origin??a;let g=u.extent||s;if(u.extent==="parent"&&!u.expandParent)if(!f)l?.("005",er.error005());else{const v=f.measured.width,w=f.measured.height;v&&w&&(g=[[h,d],[h+v,d+w]])}else f&&ws(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const y=ws(g)?ra(t,g,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",er.error015()),{position:{x:y.x-h+(u.measured.width??0)*p[0],y:y.y-d+(u.measured.height??0)*p[1]},positionAbsolute:y}}async function qj({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:a,onBeforeDelete:s}){const l=new Set(e.map(y=>y.id)),u=[];for(const y of r){if(y.deletable===!1)continue;const v=l.has(y.id),w=!v&&y.parentId&&u.find(C=>C.id===y.parentId);(v||w)&&u.push(y)}const f=new Set(t.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),p=Pj(u,h);for(const y of h)f.has(y.id)&&!p.find(w=>w.id===y.id)&&p.push(y);if(!s)return{edges:p,nodes:u};const g=await s({nodes:u,edges:p});return typeof g=="boolean"?g?{edges:p,nodes:u}:{edges:[],nodes:[]}:g}const vs=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),ra=(e={x:0,y:0},t,r)=>({x:vs(e.x,t[0][0],t[1][0]-(r?.width??0)),y:vs(e.y,t[0][1],t[1][1]-(r?.height??0))});function TS(e,t,r){const{width:a,height:s}=Ar(r),{x:l,y:u}=r.internals.positionAbsolute;return ra(e,[[l,u],[l+a,u+s]],t)}const fb=(e,t,r)=>e<t?vs(Math.abs(e-t),1,t)/t:e>r?-vs(Math.abs(e-r),1,t)/t:0,AS=(e,t,r=15,a=40)=>{const s=fb(e.x,a,t.width-a)*r,l=fb(e.y,a,t.height-a)*r;return[s,l]},tf=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pp=({x:e,y:t,width:r,height:a})=>({x:e,y:t,x2:e+r,y2:t+a}),nf=({x:e,y:t,x2:r,y2:a})=>({x:e,y:t,width:r-e,height:a-t}),bs=(e,t=[0,0])=>{const{x:r,y:a}=Lm(e)?e.internals.positionAbsolute:xl(e,t);return{x:r,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Ic=(e,t=[0,0])=>{const{x:r,y:a}=Lm(e)?e.internals.positionAbsolute:xl(e,t);return{x:r,y:a,x2:r+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},RS=(e,t)=>nf(tf(Pp(e),Pp(t))),ul=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),a=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*a)},db=e=>Hn(e.width)&&Hn(e.height)&&Hn(e.x)&&Hn(e.y),Hn=e=>!isNaN(e)&&isFinite(e),Fj=(e,t)=>{},bl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wl=({x:e,y:t},[r,a,s],l=!1,u=[1,1])=>{const f={x:(e-r)/s,y:(t-a)/s};return l?bl(f,u):f},Bc=({x:e,y:t},[r,a,s])=>({x:e*s+r,y:t*s+a});function Wa(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Yj(e,t,r){if(typeof e=="string"||typeof e=="number"){const a=Wa(e,r),s=Wa(e,t);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof e=="object"){const a=Wa(e.top??e.y??0,r),s=Wa(e.bottom??e.y??0,r),l=Wa(e.left??e.x??0,t),u=Wa(e.right??e.x??0,t);return{top:a,right:u,bottom:s,left:l,x:l+u,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function $j(e,t,r,a,s,l){const{x:u,y:f}=Bc(e,[t,r,a]),{x:h,y:d}=Bc({x:e.x+e.width,y:e.y+e.height},[t,r,a]),p=s-h,g=l-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(p),bottom:Math.floor(g)}}const Bm=(e,t,r,a,s,l)=>{const u=Yj(l,t,r),f=(t-u.x)/e.width,h=(r-u.y)/e.height,d=Math.min(f,h),p=vs(d,a,s),g=e.x+e.width/2,y=e.y+e.height/2,v=t/2-g*p,w=r/2-y*p,C=$j(e,v,w,p,t,r),N={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-N.left+N.right,y:w-N.top+N.bottom,zoom:p}},cl=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ws(e){return e!=null&&e!=="parent"}function Ar(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function jS(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function OS(e,t={width:0,height:0},r,a,s){const l={...e},u=a.get(r);if(u){const f=u.origin||s;l.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function hb(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function Gj(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}function Xj(e){return{...CS,...e||{}}}function Vo(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:a,containerBounds:s}){const{x:l,y:u}=Pn(e),f=wl({x:l-(s?.left??0),y:u-(s?.top??0)},a),{x:h,y:d}=r?bl(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const Hm=e=>({width:e.offsetWidth,height:e.offsetHeight}),DS=e=>e?.getRootNode?.()||window?.document,Qj=["INPUT","SELECT","TEXTAREA"];function zS(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Qj.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const LS=e=>"clientX"in e,Pn=(e,t)=>{const r=LS(e),a=r?e.clientX:e.touches?.[0].clientX,s=r?e.clientY:e.touches?.[0].clientY;return{x:a-(t?.left??0),y:s-(t?.top??0)}},pb=(e,t,r,a,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:s,position:u.getAttribute("data-handlepos"),x:(f.left-r.left)/a,y:(f.top-r.top)/a,...Hm(u)}})};function IS({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=e*.125+s*.375+u*.375+r*.125,d=t*.125+l*.375+f*.375+a*.125,p=Math.abs(h-e),g=Math.abs(d-t);return[h,d,p,g]}function nc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function mb({pos:e,x1:t,y1:r,x2:a,y2:s,c:l}){switch(e){case _e.Left:return[t-nc(t-a,l),r];case _e.Right:return[t+nc(a-t,l),r];case _e.Top:return[t,r-nc(r-s,l)];case _e.Bottom:return[t,r+nc(s-r,l)]}}function BS({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:s,targetPosition:l=_e.Top,curvature:u=.25}){const[f,h]=mb({pos:r,x1:e,y1:t,x2:a,y2:s,c:u}),[d,p]=mb({pos:l,x1:a,y1:s,x2:e,y2:t,c:u}),[g,y,v,w]=IS({sourceX:e,sourceY:t,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:p});return[`M${e},${t} C${f},${h} ${d},${p} ${a},${s}`,g,y,v,w]}function HS({sourceX:e,sourceY:t,targetX:r,targetY:a}){const s=Math.abs(r-e)/2,l=r<e?r+s:r-s,u=Math.abs(a-t)/2,f=a<t?a+u:a-u;return[l,f,s,u]}function Kj({sourceNode:e,targetNode:t,selected:r=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return a;const u=s&&r?a+1e3:a,f=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return u+f}function Zj({sourceNode:e,targetNode:t,width:r,height:a,transform:s}){const l=tf(Ic(e),Ic(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-s[0]/s[2],y:-s[1]/s[2],width:r/s[2],height:a/s[2]};return ul(u,nf(l))>0}const Wj=({source:e,sourceHandle:t,target:r,targetHandle:a})=>`xy-edge__${e}${t||""}-${r}${a||""}`,Jj=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),e3=(e,t,r={})=>{if(!e.source||!e.target)return t;const a=r.getEdgeId||Wj;let s;return kS(e)?s={...e}:s={...e,id:a(e)},Jj(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function PS({sourceX:e,sourceY:t,targetX:r,targetY:a}){const[s,l,u,f]=HS({sourceX:e,sourceY:t,targetX:r,targetY:a});return[`M ${e},${t}L ${r},${a}`,s,l,u,f]}const gb={[_e.Left]:{x:-1,y:0},[_e.Right]:{x:1,y:0},[_e.Top]:{x:0,y:-1},[_e.Bottom]:{x:0,y:1}},t3=({source:e,sourcePosition:t=_e.Bottom,target:r})=>t===_e.Left||t===_e.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},yb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function n3({source:e,sourcePosition:t=_e.Bottom,target:r,targetPosition:a=_e.Top,center:s,offset:l,stepPosition:u}){const f=gb[t],h=gb[a],d={x:e.x+f.x*l,y:e.y+f.y*l},p={x:r.x+h.x*l,y:r.y+h.y*l},g=t3({source:d,sourcePosition:t,target:p}),y=g.x!==0?"x":"y",v=g[y];let w=[],C,N;const S={x:0,y:0},A={x:0,y:0},[,,_,k]=HS({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[y]*h[y]===-1){y==="x"?(C=s.x??d.x+(p.x-d.x)*u,N=s.y??(d.y+p.y)/2):(C=s.x??(d.x+p.x)/2,N=s.y??d.y+(p.y-d.y)*u);const P=[{x:C,y:d.y},{x:C,y:p.y}],U=[{x:d.x,y:N},{x:p.x,y:N}];f[y]===v?w=y==="x"?P:U:w=y==="x"?U:P}else{const P=[{x:d.x,y:p.y}],U=[{x:p.x,y:d.y}];if(y==="x"?w=f.x===v?U:P:w=f.y===v?P:U,t===a){const L=Math.abs(e[y]-r[y]);if(L<=l){const V=Math.min(l-1,l-L);f[y]===v?S[y]=(d[y]>e[y]?-1:1)*V:A[y]=(p[y]>r[y]?-1:1)*V}}if(t!==a){const L=y==="x"?"y":"x",V=f[y]===h[L],T=d[L]>p[L],F=d[L]<p[L];(f[y]===1&&(!V&&T||V&&F)||f[y]!==1&&(!V&&F||V&&T))&&(w=y==="x"?P:U)}const q={x:d.x+S.x,y:d.y+S.y},I={x:p.x+A.x,y:p.y+A.y},Y=Math.max(Math.abs(q.x-w[0].x),Math.abs(I.x-w[0].x)),Q=Math.max(Math.abs(q.y-w[0].y),Math.abs(I.y-w[0].y));Y>=Q?(C=(q.x+I.x)/2,N=w[0].y):(C=w[0].x,N=(q.y+I.y)/2)}const H={x:d.x+S.x,y:d.y+S.y},M={x:p.x+A.x,y:p.y+A.y};return[[e,...H.x!==w[0].x||H.y!==w[0].y?[H]:[],...w,...M.x!==w[w.length-1].x||M.y!==w[w.length-1].y?[M]:[],r],C,N,_,k]}function r3(e,t,r,a){const s=Math.min(yb(e,t)/2,yb(t,r)/2,a),{x:l,y:u}=t;if(e.x===l&&l===r.x||e.y===u&&u===r.y)return`L${l} ${u}`;if(e.y===u){const d=e.x<r.x?-1:1,p=e.y<r.y?1:-1;return`L ${l+s*d},${u}Q ${l},${u} ${l},${u+s*p}`}const f=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${l},${u+s*h}Q ${l},${u} ${l+s*f},${u}`}function Up({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:s,targetPosition:l=_e.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:p=.5}){const[g,y,v,w,C]=n3({source:{x:e,y:t},sourcePosition:r,target:{x:a,y:s},targetPosition:l,center:{x:f,y:h},offset:d,stepPosition:p});let N=`M${g[0].x} ${g[0].y}`;for(let S=1;S<g.length-1;S++)N+=r3(g[S-1],g[S],g[S+1],u);return N+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[N,y,v,w,C]}function xb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function i3(e){const{sourceNode:t,targetNode:r}=e;if(!xb(t)||!xb(r))return null;const a=t.internals.handleBounds||vb(t.handles),s=r.internals.handleBounds||vb(r.handles),l=bb(a?.source??[],e.sourceHandle),u=bb(e.connectionMode===xs.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",er.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=l?.position||_e.Bottom,h=u?.position||_e.Top,d=ia(t,l,f),p=ia(r,u,h);return{sourceX:d.x,sourceY:d.y,targetX:p.x,targetY:p.y,sourcePosition:f,targetPosition:h}}function vb(e){if(!e)return null;const t=[],r=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?t.push(a):a.type==="target"&&r.push(a);return{source:t,target:r}}function ia(e,t,r=_e.Left,a=!1){const s=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??Ar(e);if(a)return{x:s+u/2,y:l+f/2};switch(t?.position??r){case _e.Top:return{x:s+u/2,y:l};case _e.Right:return{x:s+u,y:l+f/2};case _e.Bottom:return{x:s+u/2,y:l+f};case _e.Left:return{x:s,y:l+f/2}}}function bb(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function Vp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function a3(e,{id:t,defaultColor:r,defaultMarkerStart:a,defaultMarkerEnd:s}){const l=new Set;return e.reduce((u,f)=>([f.markerStart||a,f.markerEnd||s].forEach(h=>{if(h&&typeof h=="object"){const d=Vp(h,t);l.has(d)||(u.push({id:d,color:h.color||r,...h}),l.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const US=1e3,s3=10,Pm={nodeOrigin:[0,0],nodeExtent:ol,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},o3={...Pm,checkEquality:!0};function Um(e,t){const r={...e};for(const a in t)t[a]!==void 0&&(r[a]=t[a]);return r}function l3(e,t,r){const a=Um(Pm,r);for(const s of e.values())if(s.parentId)qm(s,e,t,a);else{const l=xl(s,a.nodeOrigin),u=ws(s.extent)?s.extent:a.nodeExtent,f=ra(l,u,Ar(s));s.internals.positionAbsolute=f}}function u3(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const r=[],a=[];for(const s of e.handles){const l={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?r.push(l):s.type==="target"&&a.push(l)}return{source:r,target:a}}function Vm(e){return e==="manual"}function qp(e,t,r,a={}){const s=Um(o3,a),l={i:0},u=new Map(t),f=s?.elevateNodesOnSelect&&!Vm(s.zIndexMode)?US:0;let h=e.length>0,d=!1;t.clear(),r.clear();for(const p of e){let g=u.get(p.id);if(s.checkEquality&&p===g?.internals.userNode)t.set(p.id,g);else{const y=xl(p,s.nodeOrigin),v=ws(p.extent)?p.extent:s.nodeExtent,w=ra(y,v,Ar(p));g={...s.defaults,...p,measured:{width:p.measured?.width,height:p.measured?.height},internals:{positionAbsolute:w,handleBounds:u3(p,g),z:VS(p,f,s.zIndexMode),userNode:p}},t.set(p.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),p.parentId&&qm(g,t,r,a,l),d||=p.selected??!1}return{nodesInitialized:h,hasSelectedNodes:d}}function c3(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function qm(e,t,r,a,s){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Um(Pm,a),d=e.parentId,p=t.get(d);if(!p){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}c3(e,r),s&&!p.parentId&&p.internals.rootParentIndex===void 0&&h==="auto"&&(p.internals.rootParentIndex=++s.i,p.internals.z=p.internals.z+s.i*s3),s&&p.internals.rootParentIndex!==void 0&&(s.i=p.internals.rootParentIndex);const g=l&&!Vm(h)?US:0,{x:y,y:v,z:w}=f3(e,p,u,f,g,h),{positionAbsolute:C}=e.internals,N=y!==C.x||v!==C.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:v}:C,z:w}})}function VS(e,t,r){const a=Hn(e.zIndex)?e.zIndex:0;return Vm(r)?a:a+(e.selected?t:0)}function f3(e,t,r,a,s,l){const{x:u,y:f}=t.internals.positionAbsolute,h=Ar(e),d=xl(e,r),p=ws(e.extent)?ra(d,e.extent,h):d;let g=ra({x:u+p.x,y:f+p.y},a,h);e.extent==="parent"&&(g=TS(g,h,t));const y=VS(e,s,l),v=t.internals.z??0;return{x:g.x,y:g.y,z:v>=y?v+1:y}}function Fm(e,t,r,a=[0,0]){const s=[],l=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const h=l.get(u.parentId)?.expandedRect??bs(f),d=RS(h,u.rect);l.set(u.parentId,{expandedRect:d,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,p=Ar(f),g=f.origin??a,y=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,v=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(p.width,Math.round(u.width)),C=Math.max(p.height,Math.round(u.height)),N=(w-p.width)*g[0],S=(C-p.height)*g[1];(y>0||v>0||N||S)&&(s.push({id:h,type:"position",position:{x:f.position.x-y+N,y:f.position.y-v+S}}),r.get(h)?.forEach(A=>{e.some(_=>_.id===A.id)||s.push({id:A.id,type:"position",position:{x:A.position.x+y,y:A.position.y+v}})})),(p.width<u.width||p.height<u.height||y||v)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(y?g[0]*y-N:0),height:C+(v?g[1]*v-S:0)}})}),s}function d3(e,t,r,a,s,l,u){const f=a?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],p=window.getComputedStyle(f),{m22:g}=new window.DOMMatrixReadOnly(p.transform),y=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const C=Hm(v.nodeElement),N=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(N||!w.internals.handleBounds||v.force))){const A=v.nodeElement.getBoundingClientRect(),_=ws(w.extent)?w.extent:l;let{positionAbsolute:k}=w.internals;w.parentId&&w.extent==="parent"?k=TS(k,C,t.get(w.parentId)):_&&(k=ra(k,_,C));const H={...w,measured:C,internals:{...w.internals,positionAbsolute:k,handleBounds:{source:pb("source",v.nodeElement,A,g,w.id),target:pb("target",v.nodeElement,A,g,w.id)}}};t.set(w.id,H),w.parentId&&qm(H,t,r,{nodeOrigin:s,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&y.push({id:w.id,parentId:w.parentId,rect:bs(H,s)}))}}if(y.length>0){const v=Fm(y,t,r,s);d.push(...v)}return{changes:d,updatedInternals:h}}async function h3({delta:e,panZoom:t,transform:r,translateExtent:a,width:s,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[s,l]],a),f=!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2]);return Promise.resolve(f)}function wb(e,t,r,a,s,l){let u=s;const f=a.get(u)||new Map;a.set(u,f.set(r,t)),u=`${s}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(r,t)),l){u=`${s}-${e}-${l}`;const d=a.get(u)||new Map;a.set(u,d.set(r,t))}}function qS(e,t,r){e.clear(),t.clear();for(const a of r){const{source:s,target:l,sourceHandle:u=null,targetHandle:f=null}=a,h={edgeId:a.id,source:s,target:l,sourceHandle:u,targetHandle:f},d=`${s}-${u}--${l}-${f}`,p=`${l}-${f}--${s}-${u}`;wb("source",h,p,e,s,u),wb("target",h,d,e,l,f),t.set(a.id,a)}}function FS(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:FS(r,t):!1}function Sb(e,t,r){let a=e;do{if(a?.matches?.(t))return!0;if(a===r)return!1;a=a?.parentElement}while(a);return!1}function p3(e,t,r,a){const s=new Map;for(const[l,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!FS(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(l);f&&s.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return s}function Kh({nodeId:e,dragItems:t,nodeLookup:r,dragging:a=!0}){const s=[];for(const[u,f]of t){const h=r.get(u)?.internals.userNode;h&&s.push({...h,position:f.position,dragging:a})}if(!e)return[s[0],s];const l=r.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:a}:s[0],s]}function m3({dragItems:e,snapGrid:t,x:r,y:a}){const s=e.values().next().value;if(!s)return null;const l={x:r-s.distance.x,y:a-s.distance.y},u=bl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function g3({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:a,onDragStop:s}){let l={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},p=null,g=!1,y=null,v=!1,w=!1,C=null;function N({noDragClassName:A,handleSelector:_,domNode:k,isSelectable:H,nodeId:M,nodeClickDistance:D=0}){y=yn(k);function P({x:Y,y:Q}){const{nodeLookup:L,nodeExtent:V,snapGrid:T,snapToGrid:F,nodeOrigin:X,onNodeDrag:Z,onSelectionDrag:j,onError:z,updateNodePositions:$}=t();l={x:Y,y:Q};let R=!1;const te=f.size>1,ue=te&&V?Pp(vl(f)):null,fe=te&&F?m3({dragItems:f,snapGrid:T,x:Y,y:Q}):null;for(const[de,le]of f){if(!L.has(de))continue;let pe={x:Y-le.distance.x,y:Q-le.distance.y};F&&(pe=fe?{x:Math.round(pe.x+fe.x),y:Math.round(pe.y+fe.y)}:bl(pe,T));let we=null;if(te&&V&&!le.extent&&ue){const{positionAbsolute:Ce}=le.internals,ce=Ce.x-ue.x+V[0][0],ge=Ce.x+le.measured.width-ue.x2+V[1][0],be=Ce.y-ue.y+V[0][1],De=Ce.y+le.measured.height-ue.y2+V[1][1];we=[[ce,be],[ge,De]]}const{position:Ee,positionAbsolute:ve}=MS({nodeId:de,nextPosition:pe,nodeLookup:L,nodeExtent:we||V,nodeOrigin:X,onError:z});R=R||le.position.x!==Ee.x||le.position.y!==Ee.y,le.position=Ee,le.internals.positionAbsolute=ve}if(w=w||R,!!R&&($(f,!0),C&&(a||Z||!M&&j))){const[de,le]=Kh({nodeId:M,dragItems:f,nodeLookup:L});a?.(C,f,de,le),Z?.(C,de,le),M||j?.(C,le)}}async function U(){if(!p)return;const{transform:Y,panBy:Q,autoPanSpeed:L,autoPanOnNodeDrag:V}=t();if(!V){h=!1,cancelAnimationFrame(u);return}const[T,F]=AS(d,p,L);(T!==0||F!==0)&&(l.x=(l.x??0)-T/Y[2],l.y=(l.y??0)-F/Y[2],await Q({x:T,y:F})&&P(l)),u=requestAnimationFrame(U)}function q(Y){const{nodeLookup:Q,multiSelectionActive:L,nodesDraggable:V,transform:T,snapGrid:F,snapToGrid:X,selectNodesOnDrag:Z,onNodeDragStart:j,onSelectionDragStart:z,unselectNodesAndEdges:$}=t();g=!0,(!Z||!H)&&!L&&M&&(Q.get(M)?.selected||$()),H&&Z&&M&&e?.(M);const R=Vo(Y.sourceEvent,{transform:T,snapGrid:F,snapToGrid:X,containerBounds:p});if(l=R,f=p3(Q,V,R,M),f.size>0&&(r||j||!M&&z)){const[te,ue]=Kh({nodeId:M,dragItems:f,nodeLookup:Q});r?.(Y.sourceEvent,f,te,ue),j?.(Y.sourceEvent,te,ue),M||z?.(Y.sourceEvent,ue)}}const I=oS().clickDistance(D).on("start",Y=>{const{domNode:Q,nodeDragThreshold:L,transform:V,snapGrid:T,snapToGrid:F}=t();p=Q?.getBoundingClientRect()||null,v=!1,w=!1,C=Y.sourceEvent,L===0&&q(Y),l=Vo(Y.sourceEvent,{transform:V,snapGrid:T,snapToGrid:F,containerBounds:p}),d=Pn(Y.sourceEvent,p)}).on("drag",Y=>{const{autoPanOnNodeDrag:Q,transform:L,snapGrid:V,snapToGrid:T,nodeDragThreshold:F,nodeLookup:X}=t(),Z=Vo(Y.sourceEvent,{transform:L,snapGrid:V,snapToGrid:T,containerBounds:p});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||M&&!X.has(M))&&(v=!0),!v){if(!h&&Q&&g&&(h=!0,U()),!g){const j=Pn(Y.sourceEvent,p),z=j.x-d.x,$=j.y-d.y;Math.sqrt(z*z+$*$)>F&&q(Y)}(l.x!==Z.xSnapped||l.y!==Z.ySnapped)&&f&&g&&(d=Pn(Y.sourceEvent,p),P(Z))}}).on("end",Y=>{if(!(!g||v)&&(h=!1,g=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:Q,updateNodePositions:L,onNodeDragStop:V,onSelectionDragStop:T}=t();if(w&&(L(f,!1),w=!1),s||V||!M&&T){const[F,X]=Kh({nodeId:M,dragItems:f,nodeLookup:Q,dragging:!1});s?.(Y.sourceEvent,f,F,X),V?.(Y.sourceEvent,F,X),M||T?.(Y.sourceEvent,X)}}}).filter(Y=>{const Q=Y.target;return!Y.button&&(!A||!Sb(Q,`.${A}`,k))&&(!_||Sb(Q,_,k))});y.call(I)}function S(){y?.on(".drag",null)}return{update:N,destroy:S}}function y3(e,t,r){const a=[],s={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const l of t.values())ul(s,bs(l))>0&&a.push(l);return a}const x3=250;function v3(e,t,r,a){let s=[],l=1/0;const u=y3(e,r,t+x3);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(a.nodeId===d.nodeId&&a.type===d.type&&a.id===d.id)continue;const{x:p,y:g}=ia(f,d,d.position,!0),y=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(g-e.y,2));y>t||(y<l?(s=[{...d,x:p,y:g}],l=y):y===l&&s.push({...d,x:p,y:g}))}}if(!s.length)return null;if(s.length>1){const f=a.type==="source"?"target":"source";return s.find(h=>h.type===f)??s[0]}return s[0]}function YS(e,t,r,a,s,l=!1){const u=a.get(e);if(!u)return null;const f=s==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(r?f?.find(d=>d.id===r):f?.[0])??null;return h&&l?{...h,...ia(u,h,h.position,!0)}:h}function $S(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function b3(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const GS=()=>!0;function w3(e,{connectionMode:t,connectionRadius:r,handleId:a,nodeId:s,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:p,flowId:g,panBy:y,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:N,isValidConnection:S=GS,onReconnectEnd:A,updateConnection:_,getTransform:k,getFromHandle:H,autoPanSpeed:M,dragThreshold:D=1,handleDomNode:P}){const U=DS(e.target);let q=0,I;const{x:Y,y:Q}=Pn(e),L=$S(l,P),V=f?.getBoundingClientRect();let T=!1;if(!V||!L)return;const F=YS(s,L,a,h,t);if(!F)return;let X=Pn(e,V),Z=!1,j=null,z=!1,$=null;function R(){if(!p||!V)return;const[Ee,ve]=AS(X,V,M);y({x:Ee,y:ve}),q=requestAnimationFrame(R)}const te={...F,nodeId:s,type:L,position:F.position},ue=h.get(s);let de={inProgress:!0,isValid:null,from:ia(ue,te,_e.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ue,to:X,toHandle:null,toPosition:cb[te.position],toNode:null,pointer:X};function le(){T=!0,_(de),w?.(e,{nodeId:s,handleId:a,handleType:L})}D===0&&le();function pe(Ee){if(!T){const{x:De,y:qe}=Pn(Ee),Fe=De-Y,_t=qe-Q;if(!(Fe*Fe+_t*_t>D*D))return;le()}if(!H()||!te){we(Ee);return}const ve=k();X=Pn(Ee,V),I=v3(wl(X,ve,!1,[1,1]),r,h,te),Z||(R(),Z=!0);const Ce=XS(Ee,{handle:I,connectionMode:t,fromNodeId:s,fromHandleId:a,fromType:u?"target":"source",isValidConnection:S,doc:U,lib:d,flowId:g,nodeLookup:h});$=Ce.handleDomNode,j=Ce.connection,z=b3(!!I,Ce.isValid);const ce=h.get(s),ge=ce?ia(ce,te,_e.Left,!0):de.from,be={...de,from:ge,isValid:z,to:Ce.toHandle&&z?Bc({x:Ce.toHandle.x,y:Ce.toHandle.y},ve):X,toHandle:Ce.toHandle,toPosition:z&&Ce.toHandle?Ce.toHandle.position:cb[te.position],toNode:Ce.toHandle?h.get(Ce.toHandle.nodeId):null,pointer:X};_(be),de=be}function we(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(T){(I||$)&&j&&z&&C?.(j);const{inProgress:ve,...Ce}=de,ce={...Ce,toPosition:de.toHandle?de.toPosition:null};N?.(Ee,ce),l&&A?.(Ee,ce)}v(),cancelAnimationFrame(q),Z=!1,z=!1,j=null,$=null,U.removeEventListener("mousemove",pe),U.removeEventListener("mouseup",we),U.removeEventListener("touchmove",pe),U.removeEventListener("touchend",we)}}U.addEventListener("mousemove",pe),U.addEventListener("mouseup",we),U.addEventListener("touchmove",pe),U.addEventListener("touchend",we)}function XS(e,{handle:t,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:d=GS,nodeLookup:p}){const g=l==="target",y=t?u.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:v,y:w}=Pn(e),C=u.elementFromPoint(v,w),N=C?.classList.contains(`${f}-flow__handle`)?C:y,S={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const A=$S(void 0,N),_=N.getAttribute("data-nodeid"),k=N.getAttribute("data-handleid"),H=N.classList.contains("connectable"),M=N.classList.contains("connectableend");if(!_||!A)return S;const D={source:g?_:a,sourceHandle:g?k:s,target:g?a:_,targetHandle:g?s:k};S.connection=D;const U=H&&M&&(r===xs.Strict?g&&A==="source"||!g&&A==="target":_!==a||k!==s);S.isValid=U&&d(D),S.toHandle=YS(_,A,k,p,r,!0)}return S}const Fp={onPointerDown:w3,isValid:XS};function S3({domNode:e,panZoom:t,getTransform:r,getViewScale:a}){const s=yn(e);function l({translateExtent:f,width:h,height:d,zoomStep:p=1,pannable:g=!0,zoomable:y=!0,inversePan:v=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const k=r(),H=_.sourceEvent.ctrlKey&&cl()?10:1,M=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*p,D=k[2]*Math.pow(2,M*H);t.scaleTo(D)};let C=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(C=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},S=_=>{const k=r();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const H=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],M=[H[0]-C[0],H[1]-C[1]];C=H;const D=a()*Math.max(k[2],Math.log(k[2]))*(v?-1:1),P={x:k[0]-M[0]*D,y:k[1]-M[1]*D},U=[[0,0],[h,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:k[2]},U,f)},A=SS().on("start",N).on("zoom",g?S:null).on("zoom.wheel",y?w:null);s.call(A,{})}function u(){s.on("zoom",null)}return{update:l,destroy:u,pointer:In}}const rf=e=>({x:e.x,y:e.y,zoom:e.k}),Zh=({x:e,y:t,zoom:r})=>ef.translate(e,t).scale(r),is=(e,t)=>e.target.closest(`.${t}`),QS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),E3=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wh=(e,t=0,r=E3,a=()=>{})=>{const s=typeof t=="number"&&t>0;return s||a(),s?e.transition().duration(t).ease(r).on("end",a):e},KS=e=>{const t=e.ctrlKey&&cl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function C3({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return p=>{if(is(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(p.ctrlKey&&u){const N=In(p),S=KS(p),A=g*Math.pow(2,S);a.scaleTo(r,A,N,p);return}const y=p.deltaMode===1?20:1;let v=s===Ji.Vertical?0:p.deltaX*y,w=s===Ji.Horizontal?0:p.deltaY*y;!cl()&&p.shiftKey&&s!==Ji.Vertical&&(v=p.deltaY*y,w=0),a.translateBy(r,-(v/g)*l,-(w/g)*l,{internal:!0});const C=rf(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(p,C),e.panScrollTimeout=setTimeout(()=>{d?.(p,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(p,C))}}function _3({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(a,s){const l=a.type==="wheel",u=!t&&l&&!a.ctrlKey,f=is(a,e);if(a.ctrlKey&&l&&f&&a.preventDefault(),u||f)return null;a.preventDefault(),r.call(this,a,s)}}function N3({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return a=>{if(a.sourceEvent?.internal)return;const s=rf(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=s,a.sourceEvent?.type==="mousedown"&&t(!0),r&&r?.(a.sourceEvent,s)}}function k3({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:a,onPanZoom:s}){return l=>{e.usedRightMouseButton=!!(r&&QS(t,e.mouseButton??0)),l.sourceEvent?.sync||a([l.transform.x,l.transform.y,l.transform.k]),s&&!l.sourceEvent?.internal&&s?.(l.sourceEvent,rf(l.transform))}}function M3({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&QS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),s)){const f=rf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s?.(u.sourceEvent,f)},r?150:0)}}}function T3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:p}){return g=>{const y=e||t,v=r&&g.ctrlKey,w=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(is(g,`${d}-flow__node`)||is(g,`${d}-flow__edge`)))return!0;if(!a&&!y&&!s&&!l&&!r||u||p&&!w||is(g,f)&&w||is(g,h)&&(!w||s&&w&&!e)||!r&&g.ctrlKey&&w)return!1;if(!r&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!s&&!v&&w||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const C=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||w)&&C}}function A3({domNode:e,minZoom:t,maxZoom:r,translateExtent:a,viewport:s,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),g=SS().scaleExtent([t,r]).translateExtent(a),y=yn(e).call(g);A({x:s.x,y:s.y,zoom:vs(s.zoom,t,r)},[[0,0],[p.width,p.height]],a);const v=y.on("wheel.zoom"),w=y.on("dblclick.zoom");g.wheelDelta(KS);function C(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Uo:gc).transform(Wh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function N({noWheelClassName:I,noPanClassName:Y,onPaneContextMenu:Q,userSelectionActive:L,panOnScroll:V,panOnDrag:T,panOnScrollMode:F,panOnScrollSpeed:X,preventScrolling:Z,zoomOnPinch:j,zoomOnScroll:z,zoomOnDoubleClick:$,zoomActivationKeyPressed:R,lib:te,onTransformChange:ue,connectionInProgress:fe,paneClickDistance:de,selectionOnDrag:le}){L&&!d.isZoomingOrPanning&&S();const pe=V&&!R&&!L;g.clickDistance(le?1/0:!Hn(de)||de<0?0:de);const we=pe?C3({zoomPanValues:d,noWheelClassName:I,d3Selection:y,d3Zoom:g,panOnScrollMode:F,panOnScrollSpeed:X,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):_3({noWheelClassName:I,preventScrolling:Z,d3ZoomHandler:v});if(y.on("wheel.zoom",we,{passive:!1}),!L){const ve=N3({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});g.on("start",ve);const Ce=k3({zoomPanValues:d,panOnDrag:T,onPaneContextMenu:!!Q,onPanZoom:l,onTransformChange:ue});g.on("zoom",Ce);const ce=M3({zoomPanValues:d,panOnDrag:T,panOnScroll:V,onPaneContextMenu:Q,onPanZoomEnd:f,onDraggingChange:h});g.on("end",ce)}const Ee=T3({zoomActivationKeyPressed:R,panOnDrag:T,zoomOnScroll:z,panOnScroll:V,zoomOnDoubleClick:$,zoomOnPinch:j,userSelectionActive:L,noPanClassName:Y,noWheelClassName:I,lib:te,connectionInProgress:fe});g.filter(Ee),$?y.on("dblclick.zoom",w):y.on("dblclick.zoom",null)}function S(){g.on("zoom",null)}async function A(I,Y,Q){const L=Zh(I),V=g?.constrain()(L,Y,Q);return V&&await C(V),new Promise(T=>T(V))}async function _(I,Y){const Q=Zh(I);return await C(Q,Y),new Promise(L=>L(Q))}function k(I){if(y){const Y=Zh(I),Q=y.property("__zoom");(Q.k!==I.zoom||Q.x!==I.x||Q.y!==I.y)&&g?.transform(y,Y,null,{sync:!0})}}function H(){const I=y?wS(y.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function M(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Uo:gc).scaleTo(Wh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function D(I,Y){return y?new Promise(Q=>{g?.interpolate(Y?.interpolate==="linear"?Uo:gc).scaleBy(Wh(y,Y?.duration,Y?.ease,()=>Q(!0)),I)}):Promise.resolve(!1)}function P(I){g?.scaleExtent(I)}function U(I){g?.translateExtent(I)}function q(I){const Y=!Hn(I)||I<0?0:I;g?.clickDistance(Y)}return{update:N,destroy:S,setViewport:_,setViewportConstrained:A,getViewport:H,scaleTo:M,scaleBy:D,setScaleExtent:P,setTranslateExtent:U,syncViewport:k,setClickDistance:q}}var Ss;(function(e){e.Line="line",e.Handle="handle"})(Ss||(Ss={}));function R3({width:e,prevWidth:t,height:r,prevHeight:a,affectsX:s,affectsY:l}){const u=e-t,f=r-a,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&s&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function Eb(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),a=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:a,affectsY:s}}function ai(e,t){return Math.max(0,t-e)}function si(e,t){return Math.max(0,e-t)}function rc(e,t,r){return Math.max(0,t-e,e-r)}function Cb(e,t){return e?!t:t}function j3(e,t,r,a,s,l,u,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:p,isVertical:g}=t,y=p&&g,{xSnapped:v,ySnapped:w}=r,{minWidth:C,maxWidth:N,minHeight:S,maxHeight:A}=a,{x:_,y:k,width:H,height:M,aspectRatio:D}=e;let P=Math.floor(p?v-e.pointerX:0),U=Math.floor(g?w-e.pointerY:0);const q=H+(h?-P:P),I=M+(d?-U:U),Y=-l[0]*H,Q=-l[1]*M;let L=rc(q,C,N),V=rc(I,S,A);if(u){let X=0,Z=0;h&&P<0?X=ai(_+P+Y,u[0][0]):!h&&P>0&&(X=si(_+q+Y,u[1][0])),d&&U<0?Z=ai(k+U+Q,u[0][1]):!d&&U>0&&(Z=si(k+I+Q,u[1][1])),L=Math.max(L,X),V=Math.max(V,Z)}if(f){let X=0,Z=0;h&&P>0?X=si(_+P,f[0][0]):!h&&P<0&&(X=ai(_+q,f[1][0])),d&&U>0?Z=si(k+U,f[0][1]):!d&&U<0&&(Z=ai(k+I,f[1][1])),L=Math.max(L,X),V=Math.max(V,Z)}if(s){if(p){const X=rc(q/D,S,A)*D;if(L=Math.max(L,X),u){let Z=0;!h&&!d||h&&!d&&y?Z=si(k+Q+q/D,u[1][1])*D:Z=ai(k+Q+(h?P:-P)/D,u[0][1])*D,L=Math.max(L,Z)}if(f){let Z=0;!h&&!d||h&&!d&&y?Z=ai(k+q/D,f[1][1])*D:Z=si(k+(h?P:-P)/D,f[0][1])*D,L=Math.max(L,Z)}}if(g){const X=rc(I*D,C,N)/D;if(V=Math.max(V,X),u){let Z=0;!h&&!d||d&&!h&&y?Z=si(_+I*D+Y,u[1][0])/D:Z=ai(_+(d?U:-U)*D+Y,u[0][0])/D,V=Math.max(V,Z)}if(f){let Z=0;!h&&!d||d&&!h&&y?Z=ai(_+I*D,f[1][0])/D:Z=si(_+(d?U:-U)*D,f[0][0])/D,V=Math.max(V,Z)}}}U=U+(U<0?V:-V),P=P+(P<0?L:-L),s&&(y?q>I*D?U=(Cb(h,d)?-P:P)/D:P=(Cb(h,d)?-U:U)*D:p?(U=P/D,d=h):(P=U*D,h=d));const T=h?_+P:_,F=d?k+U:k;return{width:H+(h?-P:P),height:M+(d?-U:U),x:l[0]*P*(h?-1:1)+T,y:l[1]*U*(d?-1:1)+F}}const ZS={width:0,height:0,x:0,y:0},O3={...ZS,pointerX:0,pointerY:0,aspectRatio:1};function D3(e){return[[0,0],[e.measured.width,e.measured.height]]}function z3(e,t,r){const a=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,f=r[0]*l,h=r[1]*u;return[[a-f,s-h],[a+l-f,s+u-h]]}function L3({domNode:e,nodeId:t,getStoreItems:r,onChange:a,onEnd:s}){const l=yn(e);let u={controlDirection:Eb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:p,keepAspectRatio:g,resizeDirection:y,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:N}){let S={...ZS},A={...O3};u={boundaries:p,resizeDirection:y,keepAspectRatio:g,controlDirection:Eb(d)};let _,k=null,H=[],M,D,P,U=!1;const q=oS().on("start",I=>{const{nodeLookup:Y,transform:Q,snapGrid:L,snapToGrid:V,nodeOrigin:T,paneDomNode:F}=r();if(_=Y.get(t),!_)return;k=F?.getBoundingClientRect()??null;const{xSnapped:X,ySnapped:Z}=Vo(I.sourceEvent,{transform:Q,snapGrid:L,snapToGrid:V,containerBounds:k});S={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},A={...S,pointerX:X,pointerY:Z,aspectRatio:S.width/S.height},M=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(M=Y.get(_.parentId),D=M&&_.extent==="parent"?D3(M):void 0),H=[],P=void 0;for(const[j,z]of Y)if(z.parentId===t&&(H.push({id:j,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const $=z3(z,_,z.origin??T);P?P=[[Math.min($[0][0],P[0][0]),Math.min($[0][1],P[0][1])],[Math.max($[1][0],P[1][0]),Math.max($[1][1],P[1][1])]]:P=$}v?.(I,{...S})}).on("drag",I=>{const{transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V}=r(),T=Vo(I.sourceEvent,{transform:Y,snapGrid:Q,snapToGrid:L,containerBounds:k}),F=[];if(!_)return;const{x:X,y:Z,width:j,height:z}=S,$={},R=_.origin??V,{width:te,height:ue,x:fe,y:de}=j3(A,u.controlDirection,T,u.boundaries,u.keepAspectRatio,R,D,P),le=te!==j,pe=ue!==z,we=fe!==X&&le,Ee=de!==Z&&pe;if(!we&&!Ee&&!le&&!pe)return;if((we||Ee||R[0]===1||R[1]===1)&&($.x=we?fe:S.x,$.y=Ee?de:S.y,S.x=$.x,S.y=$.y,H.length>0)){const ge=fe-X,be=de-Z;for(const De of H)De.position={x:De.position.x-ge+R[0]*(te-j),y:De.position.y-be+R[1]*(ue-z)},F.push(De)}if((le||pe)&&($.width=le&&(!u.resizeDirection||u.resizeDirection==="horizontal")?te:S.width,$.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?ue:S.height,S.width=$.width,S.height=$.height),M&&_.expandParent){const ge=R[0]*($.width??0);$.x&&$.x<ge&&(S.x=ge,A.x=A.x-($.x-ge));const be=R[1]*($.height??0);$.y&&$.y<be&&(S.y=be,A.y=A.y-($.y-be))}const ve=R3({width:S.width,prevWidth:j,height:S.height,prevHeight:z,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ce={...S,direction:ve};N?.(I,Ce)!==!1&&(U=!0,w?.(I,Ce),a($,F))}).on("end",I=>{U&&(C?.(I,{...S}),s?.({...S}),U=!1)});l.call(q)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}const I3={},_b=e=>{let t;const r=new Set,a=(p,g)=>{const y=typeof p=="function"?p(t):p;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(w=>w(t,v))}},s=()=>t,h={setState:a,getState:s,getInitialState:()=>d,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(I3?"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."),r.clear()}},d=t=e(a,s,h);return h},B3=e=>e?_b(e):_b,{useDebugValue:H3}=ds,{useSyncExternalStoreWithSelector:P3}=Ak,U3=e=>e;function WS(e,t=U3,r){const a=P3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return H3(a),a}const Nb=(e,t)=>{const r=B3(e),a=(s,l=t)=>WS(r,s,l);return Object.assign(a,r),a},V3=(e,t)=>e?Nb(e,t):Nb;function lt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[a,s]of e)if(!Object.is(s,t.get(a)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const a of r)if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1;return!0}const af=B.createContext(null),q3=af.Provider,JS=er.error001();function Ve(e,t){const r=B.useContext(af);if(r===null)throw new Error(JS);return WS(r,e,t)}function ut(){const e=B.useContext(af);if(e===null)throw new Error(JS);return B.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kb={display:"none"},F3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},eE="react-flow__node-desc",tE="react-flow__edge-desc",Y3="react-flow__aria-live",$3=e=>e.ariaLiveMessage,G3=e=>e.ariaLabelConfig;function X3({rfId:e}){const t=Ve($3);return b.jsx("div",{id:`${Y3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:F3,children:t})}function Q3({rfId:e,disableKeyboardA11y:t}){const r=Ve(G3);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${eE}-${e}`,style:kb,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${tE}-${e}`,style:kb,children:r["edge.a11yDescription.default"]}),!t&&b.jsx(X3,{rfId:e})]})}const sf=B.forwardRef(({position:e="top-left",children:t,className:r,style:a,...s},l)=>{const u=`${e}`.split("-");return b.jsx("div",{className:St(["react-flow__panel",r,...u]),style:a,ref:l,...s,children:t})});sf.displayName="Panel";function K3({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:b.jsx(sf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Z3=e=>{const t=[],r=[];for(const[,a]of e.nodeLookup)a.selected&&t.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&r.push(a);return{selectedNodes:t,selectedEdges:r}},ic=e=>e.id;function W3(e,t){return lt(e.selectedNodes.map(ic),t.selectedNodes.map(ic))&<(e.selectedEdges.map(ic),t.selectedEdges.map(ic))}function J3({onSelectionChange:e}){const t=ut(),{selectedNodes:r,selectedEdges:a}=Ve(Z3,W3);return B.useEffect(()=>{const s={nodes:r,edges:a};e?.(s),t.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[r,a,e]),null}const eO=e=>!!e.onSelectionChangeHandlers;function tO({onSelectionChange:e}){const t=Ve(eO);return e||t?b.jsx(J3,{onSelectionChange:e}):null}const Yp=typeof window<"u"?B.useLayoutEffect:B.useEffect,nE=[0,0],nO={x:0,y:0,zoom:1},rO=["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"],Mb=[...rO,"rfId"],iO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Tb={translateExtent:ol,nodeOrigin:nE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function aO(e){const{setNodes:t,setEdges:r,setMinZoom:a,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ve(iO,lt),d=ut();Yp(()=>(h(e.defaultNodes,e.defaultEdges),()=>{p.current=Tb,f()}),[]);const p=B.useRef(Tb);return Yp(()=>{for(const g of Mb){const y=e[g],v=p.current[g];y!==v&&(typeof e[g]>"u"||(g==="nodes"?t(y):g==="edges"?r(y):g==="minZoom"?a(y):g==="maxZoom"?s(y):g==="translateExtent"?l(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?d.setState({ariaLabelConfig:Xj(y)}):g==="fitView"?d.setState({fitViewQueued:y}):g==="fitViewOptions"?d.setState({fitViewOptions:y}):d.setState({[g]:y})))}p.current=e},Mb.map(g=>e[g])),null}function Ab(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function sO(e){const[t,r]=B.useState(e==="system"?null:e);return B.useEffect(()=>{if(e!=="system"){r(e);return}const a=Ab(),s=()=>r(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[e]),t!==null?t:Ab()?.matches?"dark":"light"}const Rb=typeof document<"u"?document:null;function fl(e=null,t={target:Rb,actInsideInputWithModifier:!0}){const[r,a]=B.useState(!1),s=B.useRef(!1),l=B.useRef(new Set([])),[u,f]=B.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
10
|
-
`).replace(`
|
|
11
|
-
|
|
12
|
-
`,`
|
|
13
|
-
+`).split(`
|
|
14
|
-
`)),p=d.reduce((g,y)=>g.concat(...y),[]);return[d,p]}return[[],[]]},[e]);return B.useEffect(()=>{const h=t?.target??Rb,d=t?.actInsideInputWithModifier??!0;if(e!==null){const p=v=>{if(s.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!s.current||s.current&&!d)&&zS(v))return!1;const C=Ob(v.code,f);if(l.current.add(v[C]),jb(u,l.current,!1)){const N=v.composedPath?.()?.[0]||v.target,S=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(s.current||!S)&&v.preventDefault(),a(!0)}},g=v=>{const w=Ob(v.code,f);jb(u,l.current,!0)?(a(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),s.current=!1},y=()=>{l.current.clear(),a(!1)};return h?.addEventListener("keydown",p),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",p),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,a]),r}function jb(e,t,r){return e.filter(a=>r||a.length===t.size).some(a=>a.every(s=>t.has(s)))}function Ob(e,t){return t.includes(e)?"code":"key"}const oO=()=>{const e=ut();return B.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(t,r):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[a,s,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??a,y:t.y??s,zoom:t.zoom??l},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,a]=e.getState().transform;return{x:t,y:r,zoom:a}},setCenter:async(t,r,a)=>e.getState().setCenter(t,r,a),fitBounds:async(t,r)=>{const{width:a,height:s,minZoom:l,maxZoom:u,panZoom:f}=e.getState(),h=Bm(t,a,s,l,u,r?.padding??.1);return f?(await f.setViewport(h,{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:a,snapGrid:s,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:f,y:h}=u.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},p=r.snapGrid??s,g=r.snapToGrid??l;return wl(d,a,g,p)},flowToScreenPosition:t=>{const{transform:r,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),u=Bc(t,r);return{x:u.x+s,y:u.y+l}}}),[])};function rE(e,t){const r=[],a=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")a.set(l.id,[l]);else{const u=a.get(l.id);u?u.push(l):a.set(l.id,[l])}for(const l of t){const u=a.get(l.id);if(!u){r.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){r.push({...u[0].item});continue}const f={...l};for(const h of u)lO(h,f);r.push(f)}return s.length&&s.forEach(l=>{l.index!==void 0?r.splice(l.index,0,{...l.item}):r.push({...l.item})}),r}function lO(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function uO(e,t){return rE(e,t)}function cO(e,t){return rE(e,t)}function Ui(e,t){return{id:e,type:"select",selected:t}}function as(e,t=new Set,r=!1){const a=[];for(const[s,l]of e){const u=t.has(s);!(l.selected===void 0&&!u)&&l.selected!==u&&(r&&(l.selected=u),a.push(Ui(l.id,u)))}return a}function Db({items:e=[],lookup:t}){const r=[],a=new Map(e.map(s=>[s.id,s]));for(const[s,l]of e.entries()){const u=t.get(l.id),f=u?.internals?.userNode??u;f!==void 0&&f!==l&&r.push({id:l.id,item:l,type:"replace"}),f===void 0&&r.push({item:l,type:"add",index:s})}for(const[s]of t)a.get(s)===void 0&&r.push({id:s,type:"remove"});return r}function zb(e){return{id:e.id,type:"remove"}}const Lb=e=>Bj(e),fO=e=>kS(e);function iE(e){return B.forwardRef(e)}function Ib(e){const[t,r]=B.useState(BigInt(0)),[a]=B.useState(()=>dO(()=>r(s=>s+BigInt(1))));return Yp(()=>{const s=a.get();s.length&&(e(s),a.reset())},[t]),a}function dO(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const aE=B.createContext(null);function hO({children:e}){const t=ut(),r=B.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:p,onNodesChange:g,nodeLookup:y,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=h;for(const S of f)C=typeof S=="function"?S(C):S;let N=Db({items:C,lookup:y});for(const S of w.values())N=S(N);p&&d(C),N.length>0?g?.(N):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:A,setNodes:_}=t.getState();S&&_(A)})},[]),a=Ib(r),s=B.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:p,onEdgesChange:g,edgeLookup:y}=t.getState();let v=h;for(const w of f)v=typeof w=="function"?w(v):w;p?d(v):g&&g(Db({items:v,lookup:y}))},[]),l=Ib(s),u=B.useMemo(()=>({nodeQueue:a,edgeQueue:l}),[]);return b.jsx(aE.Provider,{value:u,children:e})}function pO(){const e=B.useContext(aE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mO=e=>!!e.panZoom;function Ym(){const e=oO(),t=ut(),r=pO(),a=Ve(mO),s=B.useMemo(()=>{const l=g=>t.getState().nodeLookup.get(g),u=g=>{r.nodeQueue.push(g)},f=g=>{r.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState(),w=Lb(g)?g:y.get(g.id),C=w.parentId?OS(w.position,w.measured,w.parentId,y,v):w.position,N={...w,position:C,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return bs(N)},d=(g,y,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&Lb(N)?N:{...C,...N}}return C}))},p=(g,y,v={replace:!1})=>{f(w=>w.map(C=>{if(C.id===g){const N=typeof y=="function"?y(C):y;return v.replace&&fO(N)?N:{...C,...N}}return C}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>l(g)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(y=>({...y}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:u,setEdges:f,addNodes:g=>{const y=Array.isArray(g)?g:[g];r.nodeQueue.push(v=>[...v,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];r.edgeQueue.push(v=>[...v,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:v}=t.getState(),[w,C,N]=v;return{nodes:g.map(S=>({...S})),edges:y.map(S=>({...S})),viewport:{x:w,y:C,zoom:N}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:N,triggerNodeChanges:S,triggerEdgeChanges:A,onDelete:_,onBeforeDelete:k}=t.getState(),{nodes:H,edges:M}=await qj({nodesToRemove:g,edgesToRemove:y,nodes:v,edges:w,onBeforeDelete:k}),D=M.length>0,P=H.length>0;if(D){const U=M.map(zb);N?.(M),A(U)}if(P){const U=H.map(zb);C?.(H),S(U)}return(P||D)&&_?.({nodes:H,edges:M}),{deletedNodes:H,deletedEdges:M}},getIntersectingNodes:(g,y=!0,v)=>{const w=db(g),C=w?g:h(g),N=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const A=t.getState().nodeLookup.get(S.id);if(A&&!w&&(S.id===g.id||!A.internals.positionAbsolute))return!1;const _=bs(N?S:A),k=ul(_,C);return y&&k>0||k>=_.width*_.height||k>=C.width*C.height}):[]},isNodeIntersecting:(g,y,v=!0)=>{const C=db(g)?g:h(g);if(!C)return!1;const N=ul(C,y);return v&&N>0||N>=y.width*y.height||N>=C.width*C.height},updateNode:d,updateNodeData:(g,y,v={replace:!1})=>{d(g,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(g,y,v={replace:!1})=>{p(g,w=>{const C=typeof y=="function"?y(w):y;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:v}=t.getState();return Hj(g,{nodeLookup:y,nodeOrigin:v})},getHandleConnections:({type:g,id:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=t.getState().fitViewResolver??Gj();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),r.nodeQueue.push(v=>[...v]),y.promise}}},[]);return B.useMemo(()=>({...s,...e,viewportInitialized:a}),[a])}const Bb=e=>e.selected,gO=typeof window<"u"?window:void 0;function yO({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=ut(),{deleteElements:a}=Ym(),s=fl(e,{actInsideInputWithModifier:!1}),l=fl(t,{target:gO});B.useEffect(()=>{if(s){const{edges:u,nodes:f}=r.getState();a({nodes:f.filter(Bb),edges:u.filter(Bb)}),r.setState({nodesSelectionActive:!1})}},[s]),B.useEffect(()=>{r.setState({multiSelectionActive:l})},[l])}function xO(e){const t=ut();B.useEffect(()=>{const r=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=Hm(e.current);(a.height===0||a.width===0)&&t.getState().onError?.("004",er.error004()),t.setState({width:a.width||500,height:a.height||500})};if(e.current){r(),window.addEventListener("resize",r);const a=new ResizeObserver(()=>r());return a.observe(e.current),()=>{window.removeEventListener("resize",r),a&&e.current&&a.unobserve(e.current)}}},[])}const of={position:"absolute",width:"100%",height:"100%",top:0,left:0},vO=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bO({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=Ji.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:p,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:N,onViewportChange:S,isControlledViewport:A,paneClickDistance:_,selectionOnDrag:k}){const H=ut(),M=B.useRef(null),{userSelectionActive:D,lib:P,connectionInProgress:U}=Ve(vO,lt),q=fl(y),I=B.useRef();xO(M);const Y=B.useCallback(Q=>{S?.({x:Q[0],y:Q[1],zoom:Q[2]}),A||H.setState({transform:Q})},[S,A]);return B.useEffect(()=>{if(M.current){I.current=A3({domNode:M.current,minZoom:p,maxZoom:g,translateExtent:d,viewport:h,onDraggingChange:T=>H.setState(F=>F.paneDragging===T?F:{paneDragging:T}),onPanZoomStart:(T,F)=>{const{onViewportChangeStart:X,onMoveStart:Z}=H.getState();Z?.(T,F),X?.(F)},onPanZoom:(T,F)=>{const{onViewportChange:X,onMove:Z}=H.getState();Z?.(T,F),X?.(F)},onPanZoomEnd:(T,F)=>{const{onViewportChangeEnd:X,onMoveEnd:Z}=H.getState();Z?.(T,F),X?.(F)}});const{x:Q,y:L,zoom:V}=I.current.getViewport();return H.setState({panZoom:I.current,transform:[Q,L,V],domNode:M.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),B.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:q,preventScrolling:v,noPanClassName:N,userSelectionActive:D,noWheelClassName:C,lib:P,onTransformChange:Y,connectionInProgress:U,selectionOnDrag:k,paneClickDistance:_})},[e,t,r,a,s,l,u,f,q,v,N,D,C,P,Y,U,k,_]),b.jsx("div",{className:"react-flow__renderer",ref:M,style:of,children:w})}const wO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function SO(){const{userSelectionActive:e,userSelectionRect:t}=Ve(wO,lt);return e&&t?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Jh=(e,t)=>r=>{r.target===t.current&&e?.(r)},EO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function CO({isSelecting:e,selectionKeyPressed:t,selectionMode:r=ll.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:p,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:v,children:w}){const C=ut(),{userSelectionActive:N,elementsSelectable:S,dragging:A,connectionInProgress:_}=Ve(EO,lt),k=S&&(e||N),H=B.useRef(null),M=B.useRef(),D=B.useRef(new Set),P=B.useRef(new Set),U=B.useRef(!1),q=X=>{if(U.current||_){U.current=!1;return}h?.(X),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},I=X=>{if(Array.isArray(a)&&a?.includes(2)){X.preventDefault();return}d?.(X)},Y=p?X=>p(X):void 0,Q=X=>{U.current&&(X.stopPropagation(),U.current=!1)},L=X=>{const{domNode:Z}=C.getState();if(M.current=Z?.getBoundingClientRect(),!M.current)return;const j=X.target===H.current;if(!j&&!!X.target.closest(".nokey")||!e||!(l&&j||t)||X.button!==0||!X.isPrimary)return;X.target?.setPointerCapture?.(X.pointerId),U.current=!1;const{x:R,y:te}=Pn(X.nativeEvent,M.current);C.setState({userSelectionRect:{width:0,height:0,startX:R,startY:te,x:R,y:te}}),j||(X.stopPropagation(),X.preventDefault())},V=X=>{const{userSelectionRect:Z,transform:j,nodeLookup:z,edgeLookup:$,connectionLookup:R,triggerNodeChanges:te,triggerEdgeChanges:ue,defaultEdgeOptions:fe,resetSelectedElements:de}=C.getState();if(!M.current||!Z)return;const{x:le,y:pe}=Pn(X.nativeEvent,M.current),{startX:we,startY:Ee}=Z;if(!U.current){const be=t?0:s;if(Math.hypot(le-we,pe-Ee)<=be)return;de(),u?.(X)}U.current=!0;const ve={startX:we,startY:Ee,x:le<we?le:we,y:pe<Ee?pe:Ee,width:Math.abs(le-we),height:Math.abs(pe-Ee)},Ce=D.current,ce=P.current;D.current=new Set(Im(z,ve,j,r===ll.Partial,!0).map(be=>be.id)),P.current=new Set;const ge=fe?.selectable??!0;for(const be of D.current){const De=R.get(be);if(De)for(const{edgeId:qe}of De.values()){const Fe=$.get(qe);Fe&&(Fe.selectable??ge)&&P.current.add(qe)}}if(!hb(Ce,D.current)){const be=as(z,D.current,!0);te(be)}if(!hb(ce,P.current)){const be=as($,P.current);ue(be)}C.setState({userSelectionRect:ve,userSelectionActive:!0,nodesSelectionActive:!1})},T=X=>{X.button===0&&(X.target?.releasePointerCapture?.(X.pointerId),!N&&X.target===H.current&&C.getState().userSelectionRect&&q?.(X),C.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(f?.(X),C.setState({nodesSelectionActive:D.current.size>0})))},F=a===!0||Array.isArray(a)&&a.includes(0);return b.jsxs("div",{className:St(["react-flow__pane",{draggable:F,dragging:A,selection:e}]),onClick:k?void 0:Jh(q,H),onContextMenu:Jh(I,H),onWheel:Jh(Y,H),onPointerEnter:k?void 0:g,onPointerMove:k?V:y,onPointerUp:k?T:void 0,onPointerDownCapture:k?L:void 0,onClickCapture:k?Q:void 0,onPointerLeave:v,ref:H,style:of,children:[w,b.jsx(SO,{})]})}function $p({id:e,store:t,unselect:r=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",er.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&u)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([e])}function sE({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:a,nodeId:s,isSelectable:l,nodeClickDistance:u}){const f=ut(),[h,d]=B.useState(!1),p=B.useRef();return B.useEffect(()=>{p.current=g3({getStoreItems:()=>f.getState(),onNodeMouseDown:g=>{$p({id:g,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),B.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:r,handleSelector:a,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:u}),()=>{p.current?.destroy()}},[r,a,t,l,e,s,u]),h}const _O=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function oE(){const e=ut();return B.useCallback(r=>{const{nodeExtent:a,snapToGrid:s,snapGrid:l,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:p}=e.getState(),g=new Map,y=_O(u),v=s?l[0]:5,w=s?l[1]:5,C=r.direction.x*v*r.factor,N=r.direction.y*w*r.factor;for(const[,S]of d){if(!y(S))continue;let A={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+N};s&&(A=bl(A,l));const{position:_,positionAbsolute:k}=MS({nodeId:S.id,nextPosition:A,nodeLookup:d,nodeExtent:a,nodeOrigin:p,onError:f});S.position=_,S.internals.positionAbsolute=k,g.set(S.id,S)}h(g)},[])}const $m=B.createContext(null),NO=$m.Provider;$m.Consumer;const lE=()=>B.useContext($m),kO=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),MO=(e,t,r)=>a=>{const{connectionClickStartHandle:s,connectionMode:l,connection:u}=a,{fromHandle:f,toHandle:h,isValid:d}=u,p=h?.nodeId===e&&h?.id===t&&h?.type===r;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===r,connectingTo:p,clickConnecting:s?.nodeId===e&&s?.id===t&&s?.type===r,isPossibleEndHandle:l===xs.Strict?f?.type!==r:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!s,valid:p&&d}};function TO({type:e="source",position:t=_e.Top,isValidConnection:r,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:p,onTouchStart:g,...y},v){const w=u||null,C=e==="target",N=ut(),S=lE(),{connectOnClick:A,noPanClassName:_,rfId:k}=Ve(kO,lt),{connectingFrom:H,connectingTo:M,clickConnecting:D,isPossibleEndHandle:P,connectionInProcess:U,clickConnectionInProcess:q,valid:I}=Ve(MO(S,w,e),lt);S||N.getState().onError?.("010",er.error010());const Y=V=>{const{defaultEdgeOptions:T,onConnect:F,hasDefaultEdges:X}=N.getState(),Z={...T,...V};if(X){const{edges:j,setEdges:z}=N.getState();z(e3(Z,j))}F?.(Z),f?.(Z)},Q=V=>{if(!S)return;const T=LS(V.nativeEvent);if(s&&(T&&V.button===0||!T)){const F=N.getState();Fp.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:C,handleId:w,nodeId:S,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...X)=>N.getState().onConnectEnd?.(...X),updateConnection:F.updateConnection,onConnect:Y,isValidConnection:r||((...X)=>N.getState().isValidConnection?.(...X)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}T?p?.(V):g?.(V)},L=V=>{const{onClickConnectStart:T,onClickConnectEnd:F,connectionClickStartHandle:X,connectionMode:Z,isValidConnection:j,lib:z,rfId:$,nodeLookup:R,connection:te}=N.getState();if(!S||!X&&!s)return;if(!X){T?.(V.nativeEvent,{nodeId:S,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const ue=DS(V.target),fe=r||j,{connection:de,isValid:le}=Fp.isValid(V.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:Z,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:fe,flowId:$,doc:ue,lib:z,nodeLookup:R});le&&de&&Y(de);const pe=structuredClone(te);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,F?.(V,pe),N.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${k}-${S}-${w}-${e}`,className:St(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!C,target:C,connectable:a,connectablestart:s,connectableend:l,clickconnecting:D,connectingfrom:H,connectingto:M,valid:I,connectionindicator:a&&(!U||P)&&(U||q?l:s)}]),onMouseDown:Q,onTouchStart:Q,onClick:A?L:void 0,ref:v,...y,children:h})}const Hc=B.memo(iE(TO));function AO({data:e,isConnectable:t,sourcePosition:r=_e.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(Hc,{type:"source",position:r,isConnectable:t})]})}function RO({data:e,isConnectable:t,targetPosition:r=_e.Top,sourcePosition:a=_e.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Hc,{type:"target",position:r,isConnectable:t}),e?.label,b.jsx(Hc,{type:"source",position:a,isConnectable:t})]})}function jO(){return null}function OO({data:e,isConnectable:t,targetPosition:r=_e.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Hc,{type:"target",position:r,isConnectable:t}),e?.label]})}const Pc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Hb={input:AO,default:RO,output:OO,group:jO};function DO(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const zO=e=>{const{width:t,height:r,x:a,y:s}=vl(e.nodeLookup,{filter:l=>!!l.selected});return{width:Hn(t)?t:null,height:Hn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${s}px)`}};function LO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const a=ut(),{width:s,height:l,transformString:u,userSelectionActive:f}=Ve(zO,lt),h=oE(),d=B.useRef(null);B.useEffect(()=>{r||d.current?.focus({preventScroll:!0})},[r]);const p=!f&&s!==null&&l!==null;if(sE({nodeRef:d,disabled:!p}),!p)return null;const g=e?v=>{const w=a.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,y=v=>{Object.prototype.hasOwnProperty.call(Pc,v.key)&&(v.preventDefault(),h({direction:Pc[v.key],factor:v.shiftKey?4:1}))};return b.jsx("div",{className:St(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:r?void 0:-1,onKeyDown:r?void 0:y,style:{width:s,height:l}})})}const Pb=typeof window<"u"?window:void 0,IO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function uE({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:p,selectionMode:g,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:S,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:k,panOnScrollSpeed:H,panOnScrollMode:M,zoomOnDoubleClick:D,panOnDrag:P,defaultViewport:U,translateExtent:q,minZoom:I,maxZoom:Y,preventScrolling:Q,onSelectionContextMenu:L,noWheelClassName:V,noPanClassName:T,disableKeyboardA11y:F,onViewportChange:X,isControlledViewport:Z}){const{nodesSelectionActive:j,userSelectionActive:z}=Ve(IO,lt),$=fl(d,{target:Pb}),R=fl(C,{target:Pb}),te=R||P,ue=R||k,fe=p&&te!==!0,de=$||z||fe;return yO({deleteKeyCode:h,multiSelectionKeyCode:w}),b.jsx(bO,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:ue,panOnScrollSpeed:H,panOnScrollMode:M,zoomOnDoubleClick:D,panOnDrag:!$&&te,defaultViewport:U,translateExtent:q,minZoom:I,maxZoom:Y,zoomActivationKeyCode:N,preventScrolling:Q,noWheelClassName:V,noPanClassName:T,onViewportChange:X,isControlledViewport:Z,paneClickDistance:f,selectionOnDrag:fe,children:b.jsxs(CO,{onSelectionStart:y,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:te,isSelecting:!!de,selectionMode:g,selectionKeyPressed:$,paneClickDistance:f,selectionOnDrag:fe,children:[e,j&&b.jsx(LO,{onSelectionContextMenu:L,noPanClassName:T,disableKeyboardA11y:F})]})})}uE.displayName="FlowRenderer";const BO=B.memo(uE),HO=e=>t=>e?Im(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function PO(e){return Ve(B.useCallback(HO(e),[e]),lt)}const UO=e=>e.updateNodeInternals;function VO(){const e=Ve(UO),[t]=B.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const a=new Map;r.forEach(s=>{const l=s.target.getAttribute("data-id");a.set(l,{id:l,nodeElement:s.target,force:!0})}),e(a)}));return B.useEffect(()=>()=>{t?.disconnect()},[t]),t}function qO({node:e,nodeType:t,hasDimensions:r,resizeObserver:a}){const s=ut(),l=B.useRef(null),u=B.useRef(null),f=B.useRef(e.sourcePosition),h=B.useRef(e.targetPosition),d=B.useRef(t),p=r&&!!e.internals.handleBounds;return B.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&a?.unobserve(u.current),a?.observe(l.current),u.current=l.current)},[p,e.hidden]),B.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),B.useEffect(()=>{if(l.current){const g=d.current!==t,y=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(g||y||v)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function FO({id:e,onClick:t,onMouseEnter:r,onMouseMove:a,onMouseLeave:s,onContextMenu:l,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:p,resizeObserver:g,noDragClassName:y,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:N,nodeClickDistance:S,onError:A}){const{node:_,internals:k,isParent:H}=Ve(le=>{const pe=le.nodeLookup.get(e),we=le.parentLookup.has(e);return{node:pe,internals:pe.internals,isParent:we}},lt);let M=_.type||"default",D=N?.[M]||Hb[M];D===void 0&&(A?.("003",er.error003(M)),M="default",D=N?.default||Hb.default);const P=!!(_.draggable||f&&typeof _.draggable>"u"),U=!!(_.selectable||h&&typeof _.selectable>"u"),q=!!(_.connectable||d&&typeof _.connectable>"u"),I=!!(_.focusable||p&&typeof _.focusable>"u"),Y=ut(),Q=jS(_),L=qO({node:_,nodeType:M,hasDimensions:Q,resizeObserver:g}),V=sE({nodeRef:L,disabled:_.hidden||!P,noDragClassName:y,handleSelector:_.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:S}),T=oE();if(_.hidden)return null;const F=Ar(_),X=DO(_),Z=U||P||t||r||a||s,j=r?le=>r(le,{...k.userNode}):void 0,z=a?le=>a(le,{...k.userNode}):void 0,$=s?le=>s(le,{...k.userNode}):void 0,R=l?le=>l(le,{...k.userNode}):void 0,te=u?le=>u(le,{...k.userNode}):void 0,ue=le=>{const{selectNodesOnDrag:pe,nodeDragThreshold:we}=Y.getState();U&&(!pe||!P||we>0)&&$p({id:e,store:Y,nodeRef:L}),t&&t(le,{...k.userNode})},fe=le=>{if(!(zS(le.nativeEvent)||w)){if(ES.includes(le.key)&&U){const pe=le.key==="Escape";$p({id:e,store:Y,unselect:pe,nodeRef:L})}else if(P&&_.selected&&Object.prototype.hasOwnProperty.call(Pc,le.key)){le.preventDefault();const{ariaLabelConfig:pe}=Y.getState();Y.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:le.key.replace("Arrow","").toLowerCase(),x:~~k.positionAbsolute.x,y:~~k.positionAbsolute.y})}),T({direction:Pc[le.key],factor:le.shiftKey?4:1})}}},de=()=>{if(w||!L.current?.matches(":focus-visible"))return;const{transform:le,width:pe,height:we,autoPanOnNodeFocus:Ee,setCenter:ve}=Y.getState();if(!Ee)return;Im(new Map([[e,_]]),{x:0,y:0,width:pe,height:we},le,!0).length>0||ve(_.position.x+F.width/2,_.position.y+F.height/2,{zoom:le[2]})};return b.jsx("div",{className:St(["react-flow__node",`react-flow__node-${M}`,{[v]:P},_.className,{selected:_.selected,selectable:U,parent:H,draggable:P,dragging:V}]),ref:L,style:{zIndex:k.z,transform:`translate(${k.positionAbsolute.x}px,${k.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:Q?"visible":"hidden",..._.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:z,onMouseLeave:$,onContextMenu:R,onClick:ue,onDoubleClick:te,onKeyDown:I?fe:void 0,tabIndex:I?0:void 0,onFocus:I?de:void 0,role:_.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${eE}-${C}`,"aria-label":_.ariaLabel,..._.domAttributes,children:b.jsx(NO,{value:e,children:b.jsx(D,{id:e,data:_.data,type:M,positionAbsoluteX:k.positionAbsolute.x,positionAbsoluteY:k.positionAbsolute.y,selected:_.selected??!1,selectable:U,draggable:P,deletable:_.deletable??!0,isConnectable:q,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:k.z,parentId:_.parentId,...F})})})}var YO=B.memo(FO);const $O=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function cE(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:s,onError:l}=Ve($O,lt),u=PO(e.onlyRenderVisibleElements),f=VO();return b.jsx("div",{className:"react-flow__nodes",style:of,children:u.map(h=>b.jsx(YO,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},h))})}cE.displayName="NodeRenderer";const GO=B.memo(cE);function XO(e){return Ve(B.useCallback(r=>{if(!e)return r.edges.map(s=>s.id);const a=[];if(r.width&&r.height)for(const s of r.edges){const l=r.nodeLookup.get(s.source),u=r.nodeLookup.get(s.target);l&&u&&Zj({sourceNode:l,targetNode:u,width:r.width,height:r.height,transform:r.transform})&&a.push(s.id)}return a},[e]),lt)}const QO=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},KO=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ub={[Lc.Arrow]:QO,[Lc.ArrowClosed]:KO};function ZO(e){const t=ut();return B.useMemo(()=>Object.prototype.hasOwnProperty.call(Ub,e)?Ub[e]:(t.getState().onError?.("009",er.error009(e)),null),[e])}const WO=({id:e,type:t,color:r,width:a=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=ZO(t);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:b.jsx(h,{color:r,strokeWidth:u})}):null},fE=({defaultColor:e,rfId:t})=>{const r=Ve(l=>l.edges),a=Ve(l=>l.defaultEdgeOptions),s=B.useMemo(()=>a3(r,{id:t,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[r,a,t,e]);return s.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:s.map(l=>b.jsx(WO,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};fE.displayName="MarkerDefinitions";var JO=B.memo(fE);function dE({x:e,y:t,label:r,labelStyle:a,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...p}){const[g,y]=B.useState({x:1,y:0,width:0,height:0}),v=St(["react-flow__edge-textwrapper",d]),w=B.useRef(null);return B.useEffect(()=>{if(w.current){const C=w.current.getBBox();y({x:C.x,y:C.y,width:C.width,height:C.height})}},[r]),r?b.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...p,children:[s&&b.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),b.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:w,style:a,children:r}),h]}):null}dE.displayName="EdgeText";const e4=B.memo(dE);function lf({path:e,labelX:t,labelY:r,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...p}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...p,d:e,fill:"none",className:St(["react-flow__edge-path",p.className])}),d?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,a&&Hn(t)&&Hn(r)?b.jsx(e4,{x:t,y:r,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function Vb({pos:e,x1:t,y1:r,x2:a,y2:s}){return e===_e.Left||e===_e.Right?[.5*(t+a),r]:[t,.5*(r+s)]}function hE({sourceX:e,sourceY:t,sourcePosition:r=_e.Bottom,targetX:a,targetY:s,targetPosition:l=_e.Top}){const[u,f]=Vb({pos:r,x1:e,y1:t,x2:a,y2:s}),[h,d]=Vb({pos:l,x1:a,y1:s,x2:e,y2:t}),[p,g,y,v]=IS({sourceX:e,sourceY:t,targetX:a,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${u},${f} ${h},${d} ${a},${s}`,p,g,y,v]}function pE(e){return B.memo(({id:t,sourceX:r,sourceY:a,targetX:s,targetY:l,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:S})=>{const[A,_,k]=hE({sourceX:r,sourceY:a,sourcePosition:u,targetX:s,targetY:l,targetPosition:f}),H=e.isInternal?void 0:t;return b.jsx(lf,{id:H,path:A,labelX:_,labelY:k,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:S})})}const t4=pE({isInternal:!1}),mE=pE({isInternal:!0});t4.displayName="SimpleBezierEdge";mE.displayName="SimpleBezierEdgeInternal";function gE(e){return B.memo(({id:t,sourceX:r,sourceY:a,targetX:s,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,sourcePosition:v=_e.Bottom,targetPosition:w=_e.Top,markerEnd:C,markerStart:N,pathOptions:S,interactionWidth:A})=>{const[_,k,H]=Up({sourceX:r,sourceY:a,sourcePosition:v,targetX:s,targetY:l,targetPosition:w,borderRadius:S?.borderRadius,offset:S?.offset,stepPosition:S?.stepPosition}),M=e.isInternal?void 0:t;return b.jsx(lf,{id:M,path:_,labelX:k,labelY:H,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:C,markerStart:N,interactionWidth:A})})}const yE=gE({isInternal:!1}),xE=gE({isInternal:!0});yE.displayName="SmoothStepEdge";xE.displayName="SmoothStepEdgeInternal";function vE(e){return B.memo(({id:t,...r})=>{const a=e.isInternal?void 0:t;return b.jsx(yE,{...r,id:a,pathOptions:B.useMemo(()=>({borderRadius:0,offset:r.pathOptions?.offset}),[r.pathOptions?.offset])})})}const n4=vE({isInternal:!1}),bE=vE({isInternal:!0});n4.displayName="StepEdge";bE.displayName="StepEdgeInternal";function wE(e){return B.memo(({id:t,sourceX:r,sourceY:a,targetX:s,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[N,S,A]=PS({sourceX:r,sourceY:a,targetX:s,targetY:l}),_=e.isInternal?void 0:t;return b.jsx(lf,{id:_,path:N,labelX:S,labelY:A,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:w,interactionWidth:C})})}const r4=wE({isInternal:!1}),SE=wE({isInternal:!0});r4.displayName="StraightEdge";SE.displayName="StraightEdgeInternal";function EE(e){return B.memo(({id:t,sourceX:r,sourceY:a,targetX:s,targetY:l,sourcePosition:u=_e.Bottom,targetPosition:f=_e.Top,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,pathOptions:S,interactionWidth:A})=>{const[_,k,H]=BS({sourceX:r,sourceY:a,sourcePosition:u,targetX:s,targetY:l,targetPosition:f,curvature:S?.curvature}),M=e.isInternal?void 0:t;return b.jsx(lf,{id:M,path:_,labelX:k,labelY:H,label:h,labelStyle:d,labelShowBg:p,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:N,interactionWidth:A})})}const i4=EE({isInternal:!1}),CE=EE({isInternal:!0});i4.displayName="BezierEdge";CE.displayName="BezierEdgeInternal";const qb={default:CE,straight:SE,step:bE,smoothstep:xE,simplebezier:mE},Fb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},a4=(e,t,r)=>r===_e.Left?e-t:r===_e.Right?e+t:e,s4=(e,t,r)=>r===_e.Top?e-t:r===_e.Bottom?e+t:e,Yb="react-flow__edgeupdater";function $b({position:e,centerX:t,centerY:r,radius:a=10,onMouseDown:s,onMouseEnter:l,onMouseOut:u,type:f}){return b.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:u,className:St([Yb,`${Yb}-${f}`]),cx:a4(t,a,e),cy:s4(r,a,e),r:a,stroke:"transparent",fill:"transparent"})}function o4({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:a,sourceY:s,targetX:l,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:p,onReconnectEnd:g,setReconnecting:y,setUpdateHover:v}){const w=ut(),C=(k,H)=>{if(k.button!==0)return;const{autoPanOnConnect:M,domNode:D,connectionMode:P,connectionRadius:U,lib:q,onConnectStart:I,cancelConnection:Y,nodeLookup:Q,rfId:L,panBy:V,updateConnection:T}=w.getState(),F=H.type==="target",X=(z,$)=>{y(!1),g?.(z,r,H.type,$)},Z=z=>d?.(r,z),j=(z,$)=>{y(!0),p?.(k,r,H.type),I?.(z,$)};Fp.onPointerDown(k.nativeEvent,{autoPanOnConnect:M,connectionMode:P,connectionRadius:U,domNode:D,handleId:H.id,nodeId:H.nodeId,nodeLookup:Q,isTarget:F,edgeUpdaterType:H.type,lib:q,flowId:L,cancelConnection:Y,panBy:V,isValidConnection:(...z)=>w.getState().isValidConnection?.(...z)??!0,onConnect:Z,onConnectStart:j,onConnectEnd:(...z)=>w.getState().onConnectEnd?.(...z),onReconnectEnd:X,updateConnection:T,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:k.currentTarget})},N=k=>C(k,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),S=k=>C(k,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),A=()=>v(!0),_=()=>v(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx($b,{position:f,centerX:a,centerY:s,radius:t,onMouseDown:N,onMouseEnter:A,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&b.jsx($b,{position:h,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:A,onMouseOut:_,type:"target"})]})}function l4({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:a,onClick:s,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:p,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:N,onError:S,disableKeyboardA11y:A}){let _=Ve(ve=>ve.edgeLookup.get(e));const k=Ve(ve=>ve.defaultEdgeOptions);_=k?{...k,..._}:_;let H=_.type||"default",M=C?.[H]||qb[H];M===void 0&&(S?.("011",er.error011(H)),H="default",M=C?.default||qb.default);const D=!!(_.focusable||t&&typeof _.focusable>"u"),P=typeof g<"u"&&(_.reconnectable||r&&typeof _.reconnectable>"u"),U=!!(_.selectable||a&&typeof _.selectable>"u"),q=B.useRef(null),[I,Y]=B.useState(!1),[Q,L]=B.useState(!1),V=ut(),{zIndex:T,sourceX:F,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$}=Ve(B.useCallback(ve=>{const Ce=ve.nodeLookup.get(_.source),ce=ve.nodeLookup.get(_.target);if(!Ce||!ce)return{zIndex:_.zIndex,...Fb};const ge=i3({id:e,sourceNode:Ce,targetNode:ce,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ve.connectionMode,onError:S});return{zIndex:Kj({selected:_.selected,zIndex:_.zIndex,sourceNode:Ce,targetNode:ce,elevateOnSelect:ve.elevateEdgesOnSelect,zIndexMode:ve.zIndexMode}),...ge||Fb}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),lt),R=B.useMemo(()=>_.markerStart?`url('#${Vp(_.markerStart,w)}')`:void 0,[_.markerStart,w]),te=B.useMemo(()=>_.markerEnd?`url('#${Vp(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||F===null||X===null||Z===null||j===null)return null;const ue=ve=>{const{addSelectedEdges:Ce,unselectNodesAndEdges:ce,multiSelectionActive:ge}=V.getState();U&&(V.setState({nodesSelectionActive:!1}),_.selected&&ge?(ce({nodes:[],edges:[_]}),q.current?.blur()):Ce([e])),s&&s(ve,_)},fe=l?ve=>{l(ve,{..._})}:void 0,de=u?ve=>{u(ve,{..._})}:void 0,le=f?ve=>{f(ve,{..._})}:void 0,pe=h?ve=>{h(ve,{..._})}:void 0,we=d?ve=>{d(ve,{..._})}:void 0,Ee=ve=>{if(!A&&ES.includes(ve.key)&&U){const{unselectNodesAndEdges:Ce,addSelectedEdges:ce}=V.getState();ve.key==="Escape"?(q.current?.blur(),Ce({edges:[_]})):ce([e])}};return b.jsx("svg",{style:{zIndex:T},children:b.jsxs("g",{className:St(["react-flow__edge",`react-flow__edge-${H}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!U&&!s,updating:I,selectable:U}]),onClick:ue,onDoubleClick:fe,onContextMenu:de,onMouseEnter:le,onMouseMove:pe,onMouseLeave:we,onKeyDown:D?Ee:void 0,tabIndex:D?0:void 0,role:_.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":D?`${tE}-${w}`:void 0,ref:q,..._.domAttributes,children:[!Q&&b.jsx(M,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:U,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:F,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:R,markerEnd:te,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),P&&b.jsx(o4,{edge:_,isReconnectable:P,reconnectRadius:p,onReconnect:g,onReconnectStart:y,onReconnectEnd:v,sourceX:F,sourceY:X,targetX:Z,targetY:j,sourcePosition:z,targetPosition:$,setUpdateHover:Y,setReconnecting:L})]})})}var u4=B.memo(l4);const c4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _E({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:a,noPanClassName:s,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:p,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:N,edgesReconnectable:S,elementsSelectable:A,onError:_}=Ve(c4,lt),k=XO(t);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(JO,{defaultColor:e,rfId:r}),k.map(H=>b.jsx(u4,{id:H,edgesFocusable:N,edgesReconnectable:S,elementsSelectable:A,noPanClassName:s,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:p,reconnectRadius:g,onDoubleClick:y,onReconnectStart:v,onReconnectEnd:w,rfId:r,onError:_,edgeTypes:a,disableKeyboardA11y:C},H))]})}_E.displayName="EdgeRenderer";const f4=B.memo(_E),d4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function h4({children:e}){const t=Ve(d4);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function p4(e){const t=Ym(),r=B.useRef(!1);B.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const m4=e=>e.panZoom?.syncViewport;function g4(e){const t=Ve(m4),r=ut();return B.useEffect(()=>{e&&(t?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function y4(e){return e.connection.inProgress?{...e.connection,to:wl(e.connection.to,e.transform)}:{...e.connection}}function x4(e){return y4}function v4(e){const t=x4();return Ve(t,lt)}const b4=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function w4({containerStyle:e,style:t,type:r,component:a}){const{nodesConnectable:s,width:l,height:u,isValid:f,inProgress:h}=Ve(b4,lt);return!(l&&s&&h)?null:b.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:St(["react-flow__connection",NS(f)]),children:b.jsx(NE,{style:t,type:r,CustomComponent:a,isValid:f})})})}const NE=({style:e,type:t=ui.Bezier,CustomComponent:r,isValid:a})=>{const{inProgress:s,from:l,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:p,toHandle:g,toPosition:y,pointer:v}=v4();if(!s)return;if(r)return b.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:y,connectionStatus:NS(a),toNode:p,toHandle:g,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:y};switch(t){case ui.Bezier:[w]=BS(C);break;case ui.SimpleBezier:[w]=hE(C);break;case ui.Step:[w]=Up({...C,borderRadius:0});break;case ui.SmoothStep:[w]=Up(C);break;default:[w]=PS(C)}return b.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};NE.displayName="ConnectionLine";const S4={};function Gb(e=S4){B.useRef(e),ut(),B.useEffect(()=>{},[e])}function E4(){ut(),B.useRef(!1),B.useEffect(()=>{},[])}function kE({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:N,connectionLineContainerStyle:S,selectionKeyCode:A,selectionOnDrag:_,selectionMode:k,multiSelectionKeyCode:H,panActivationKeyCode:M,zoomActivationKeyCode:D,deleteKeyCode:P,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:I,translateExtent:Y,minZoom:Q,maxZoom:L,preventScrolling:V,defaultMarkerColor:T,zoomOnScroll:F,zoomOnPinch:X,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:z,zoomOnDoubleClick:$,panOnDrag:R,onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:de,onPaneScroll:le,onPaneContextMenu:pe,paneClickDistance:we,nodeClickDistance:Ee,onEdgeContextMenu:ve,onEdgeMouseEnter:Ce,onEdgeMouseMove:ce,onEdgeMouseLeave:ge,reconnectRadius:be,onReconnect:De,onReconnectStart:qe,onReconnectEnd:Fe,noDragClassName:_t,noWheelClassName:Ot,noPanClassName:sn,disableKeyboardA11y:wn,nodeExtent:Te,rfId:ct,viewport:ie,onViewportChange:me}){return Gb(e),Gb(t),E4(),p4(r),g4(ie),b.jsx(BO,{onPaneClick:te,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:de,onPaneContextMenu:pe,onPaneScroll:le,paneClickDistance:we,deleteKeyCode:P,selectionKeyCode:A,selectionOnDrag:_,selectionMode:k,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:H,panActivationKeyCode:M,zoomActivationKeyCode:D,elementsSelectable:q,zoomOnScroll:F,zoomOnPinch:X,zoomOnDoubleClick:$,panOnScroll:Z,panOnScrollSpeed:j,panOnScrollMode:z,panOnDrag:R,defaultViewport:I,translateExtent:Y,minZoom:Q,maxZoom:L,onSelectionContextMenu:g,preventScrolling:V,noDragClassName:_t,noWheelClassName:Ot,noPanClassName:sn,disableKeyboardA11y:wn,onViewportChange:me,isControlledViewport:!!ie,children:b.jsxs(h4,{children:[b.jsx(f4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:u,onReconnect:De,onReconnectStart:qe,onReconnectEnd:Fe,onlyRenderVisibleElements:U,onEdgeContextMenu:ve,onEdgeMouseEnter:Ce,onEdgeMouseMove:ce,onEdgeMouseLeave:ge,reconnectRadius:be,defaultMarkerColor:T,noPanClassName:sn,disableKeyboardA11y:wn,rfId:ct}),b.jsx(w4,{style:C,type:w,component:N,containerStyle:S}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(GO,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:p,nodeClickDistance:Ee,onlyRenderVisibleElements:U,noPanClassName:sn,noDragClassName:_t,disableKeyboardA11y:wn,nodeExtent:Te,rfId:ct}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}kE.displayName="GraphView";const C4=B.memo(kE),Xb=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:s,height:l,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:p,nodeExtent:g,zIndexMode:y="basic"}={})=>{const v=new Map,w=new Map,C=new Map,N=new Map,S=a??t??[],A=r??e??[],_=p??[0,0],k=g??ol;qS(C,N,S);const{nodesInitialized:H}=qp(A,v,w,{nodeOrigin:_,nodeExtent:k,zIndexMode:y});let M=[0,0,1];if(u&&s&&l){const D=vl(v,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:P,y:U,zoom:q}=Bm(D,s,l,h,d,f?.padding??.1);M=[P,U,q]}return{rfId:"1",width:s??0,height:l??0,transform:M,nodes:A,nodesInitialized:H,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:N,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:ol,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{..._S},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Fj,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:CS,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},_4=({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:s,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:p,nodeExtent:g,zIndexMode:y})=>V3((v,w)=>{async function C(){const{nodeLookup:N,panZoom:S,fitViewOptions:A,fitViewResolver:_,width:k,height:H,minZoom:M,maxZoom:D}=w();S&&(await Vj({nodes:N,width:k,height:H,panZoom:S,minZoom:M,maxZoom:D},A),_?.resolve(!0),v({fitViewResolver:null}))}return{...Xb({nodes:e,edges:t,width:s,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:p,nodeExtent:g,defaultNodes:r,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:S,parentLookup:A,nodeOrigin:_,elevateNodesOnSelect:k,fitViewQueued:H,zIndexMode:M,nodesSelectionActive:D}=w(),{nodesInitialized:P,hasSelectedNodes:U}=qp(N,S,A,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:M}),q=D&&U;H&&P?(C(),v({nodes:N,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:q})):v({nodes:N,nodesInitialized:P,nodesSelectionActive:q})},setEdges:N=>{const{connectionLookup:S,edgeLookup:A}=w();qS(S,A,N),v({edges:N})},setDefaultNodesAndEdges:(N,S)=>{if(N){const{setNodes:A}=w();A(N),v({hasDefaultNodes:!0})}if(S){const{setEdges:A}=w();A(S),v({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:S,nodeLookup:A,parentLookup:_,domNode:k,nodeOrigin:H,nodeExtent:M,debug:D,fitViewQueued:P,zIndexMode:U}=w(),{changes:q,updatedInternals:I}=d3(N,A,_,k,H,M,U);I&&(l3(A,_,{nodeOrigin:H,nodeExtent:M,zIndexMode:U}),P?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),q?.length>0&&(D&&console.log("React Flow: trigger node changes",q),S?.(q)))},updateNodePositions:(N,S=!1)=>{const A=[];let _=[];const{nodeLookup:k,triggerNodeChanges:H,connection:M,updateConnection:D,onNodesChangeMiddlewareMap:P}=w();for(const[U,q]of N){const I=k.get(U),Y=!!(I?.expandParent&&I?.parentId&&q?.position),Q={id:U,type:"position",position:Y?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:S};if(I&&M.inProgress&&M.fromNode.id===I.id){const L=ia(I,M.fromHandle,_e.Left,!0);D({...M,from:L})}Y&&I.parentId&&A.push({id:U,parentId:I.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),_.push(Q)}if(A.length>0){const{parentLookup:U,nodeOrigin:q}=w(),I=Fm(A,k,U,q);_.push(...I)}for(const U of P.values())_=U(_);H(_)},triggerNodeChanges:N=>{const{onNodesChange:S,setNodes:A,nodes:_,hasDefaultNodes:k,debug:H}=w();if(N?.length){if(k){const M=uO(N,_);A(M)}H&&console.log("React Flow: trigger node changes",N),S?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:S,setEdges:A,edges:_,hasDefaultEdges:k,debug:H}=w();if(N?.length){if(k){const M=cO(N,_);A(M)}H&&console.log("React Flow: trigger edge changes",N),S?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:S,edgeLookup:A,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:H}=w();if(S){const M=N.map(D=>Ui(D,!0));k(M);return}k(as(_,new Set([...N]),!0)),H(as(A))},addSelectedEdges:N=>{const{multiSelectionActive:S,edgeLookup:A,nodeLookup:_,triggerNodeChanges:k,triggerEdgeChanges:H}=w();if(S){const M=N.map(D=>Ui(D,!0));H(M);return}H(as(A,new Set([...N]))),k(as(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:S}={})=>{const{edges:A,nodes:_,nodeLookup:k,triggerNodeChanges:H,triggerEdgeChanges:M}=w(),D=N||_,P=S||A,U=[];for(const I of D){if(!I.selected)continue;const Y=k.get(I.id);Y&&(Y.selected=!1),U.push(Ui(I.id,!1))}const q=[];for(const I of P)I.selected&&q.push(Ui(I.id,!1));H(U),M(q)},setMinZoom:N=>{const{panZoom:S,maxZoom:A}=w();S?.setScaleExtent([N,A]),v({minZoom:N})},setMaxZoom:N=>{const{panZoom:S,minZoom:A}=w();S?.setScaleExtent([A,N]),v({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),v({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:S,triggerNodeChanges:A,triggerEdgeChanges:_,elementsSelectable:k}=w();if(!k)return;const H=S.reduce((D,P)=>P.selected?[...D,Ui(P.id,!1)]:D,[]),M=N.reduce((D,P)=>P.selected?[...D,Ui(P.id,!1)]:D,[]);A(H),_(M)},setNodeExtent:N=>{const{nodes:S,nodeLookup:A,parentLookup:_,nodeOrigin:k,elevateNodesOnSelect:H,nodeExtent:M,zIndexMode:D}=w();N[0][0]===M[0][0]&&N[0][1]===M[0][1]&&N[1][0]===M[1][0]&&N[1][1]===M[1][1]||(qp(S,A,_,{nodeOrigin:k,nodeExtent:N,elevateNodesOnSelect:H,checkEquality:!1,zIndexMode:D}),v({nodeExtent:N}))},panBy:N=>{const{transform:S,width:A,height:_,panZoom:k,translateExtent:H}=w();return h3({delta:N,panZoom:k,transform:S,translateExtent:H,width:A,height:_})},setCenter:async(N,S,A)=>{const{width:_,height:k,maxZoom:H,panZoom:M}=w();if(!M)return Promise.resolve(!1);const D=typeof A?.zoom<"u"?A.zoom:H;return await M.setViewport({x:_/2-N*D,y:k/2-S*D,zoom:D},{duration:A?.duration,ease:A?.ease,interpolate:A?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{..._S}})},updateConnection:N=>{v({connection:N})},reset:()=>v({...Xb()})}},Object.is);function N4({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:a,initialWidth:s,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:p,nodeExtent:g,zIndexMode:y,children:v}){const[w]=B.useState(()=>_4({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,width:s,height:l,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:p,nodeExtent:g,zIndexMode:y}));return b.jsx(q3,{value:w,children:b.jsx(hO,{children:v})})}function k4({children:e,nodes:t,edges:r,defaultNodes:a,defaultEdges:s,width:l,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:p,nodeOrigin:g,nodeExtent:y,zIndexMode:v}){return B.useContext(af)?b.jsx(b.Fragment,{children:e}):b.jsx(N4,{initialNodes:t,initialEdges:r,defaultNodes:a,defaultEdges:s,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:p,nodeOrigin:g,nodeExtent:y,zIndexMode:v,children:e})}const M4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function T4({nodes:e,edges:t,defaultNodes:r,defaultEdges:a,className:s,nodeTypes:l,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:p,onMoveStart:g,onMoveEnd:y,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:S,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:H,onNodeDoubleClick:M,onNodeDragStart:D,onNodeDrag:P,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:I,onDelete:Y,onSelectionChange:Q,onSelectionDragStart:L,onSelectionDrag:V,onSelectionDragStop:T,onSelectionContextMenu:F,onSelectionStart:X,onSelectionEnd:Z,onBeforeDelete:j,connectionMode:z,connectionLineType:$=ui.Bezier,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,deleteKeyCode:fe="Backspace",selectionKeyCode:de="Shift",selectionOnDrag:le=!1,selectionMode:pe=ll.Full,panActivationKeyCode:we="Space",multiSelectionKeyCode:Ee=cl()?"Meta":"Control",zoomActivationKeyCode:ve=cl()?"Meta":"Control",snapToGrid:Ce,snapGrid:ce,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:be,nodesDraggable:De,autoPanOnNodeFocus:qe,nodesConnectable:Fe,nodesFocusable:_t,nodeOrigin:Ot=nE,edgesFocusable:sn,edgesReconnectable:wn,elementsSelectable:Te=!0,defaultViewport:ct=nO,minZoom:ie=.5,maxZoom:me=2,translateExtent:Ne=ol,preventScrolling:ze=!0,nodeExtent:Ue,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:jn=!0,zoomOnPinch:kt=!0,panOnScroll:ht=!1,panOnScrollSpeed:Dt=.5,panOnScrollMode:Qe=Ji.Free,zoomOnDoubleClick:Vn=!0,panOnDrag:on=!0,onPaneClick:df,onPaneMouseEnter:fa,onPaneMouseMove:da,onPaneMouseLeave:ha,onPaneScroll:rr,onPaneContextMenu:pa,paneClickDistance:xi=1,nodeClickDistance:hf=0,children:Cl,onReconnect:Ms,onReconnectStart:vi,onReconnectEnd:pf,onEdgeContextMenu:_l,onEdgeDoubleClick:Nl,onEdgeMouseEnter:kl,onEdgeMouseMove:Ts,onEdgeMouseLeave:As,reconnectRadius:Ml=10,onNodesChange:Tl,onEdgesChange:qn,noDragClassName:Et="nodrag",noWheelClassName:zt="nowheel",noPanClassName:ir="nopan",fitView:ma,fitViewOptions:Al,connectOnClick:mf,attributionPosition:Rl,proOptions:bi,defaultEdgeOptions:Rs,elevateNodesOnSelect:Rr=!0,elevateEdgesOnSelect:jr=!1,disableKeyboardA11y:Or=!1,autoPanOnConnect:Dr,autoPanOnNodeDrag:gt,autoPanSpeed:jl,connectionRadius:Ol,isValidConnection:ar,onError:zr,style:gf,id:js,nodeDragThreshold:Dl,connectionDragThreshold:yf,viewport:ga,onViewportChange:ya,width:On,height:qt,colorMode:zl="light",debug:xf,onScroll:xa,ariaLabelConfig:Ll,zIndexMode:wi="basic",...vf},Ft){const Si=js||"1",Il=sO(zl),Os=B.useCallback(sr=>{sr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),xa?.(sr)},[xa]);return b.jsx("div",{"data-testid":"rf__wrapper",...vf,onScroll:Os,style:{...gf,...M4},ref:Ft,className:St(["react-flow",s,Il]),id:js,role:"application",children:b.jsxs(k4,{nodes:e,edges:t,width:On,height:qt,fitView:ma,fitViewOptions:Al,minZoom:ie,maxZoom:me,nodeOrigin:Ot,nodeExtent:Ue,zIndexMode:wi,children:[b.jsx(aO,{nodes:e,edges:t,defaultNodes:r,defaultEdges:a,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:S,nodesDraggable:De,autoPanOnNodeFocus:qe,nodesConnectable:Fe,nodesFocusable:_t,edgesFocusable:sn,edgesReconnectable:wn,elementsSelectable:Te,elevateNodesOnSelect:Rr,elevateEdgesOnSelect:jr,minZoom:ie,maxZoom:me,nodeExtent:Ue,onNodesChange:Tl,onEdgesChange:qn,snapToGrid:Ce,snapGrid:ce,connectionMode:z,translateExtent:Ne,connectOnClick:mf,defaultEdgeOptions:Rs,fitView:ma,fitViewOptions:Al,onNodesDelete:q,onEdgesDelete:I,onDelete:Y,onNodeDragStart:D,onNodeDrag:P,onNodeDragStop:U,onSelectionDrag:V,onSelectionDragStart:L,onSelectionDragStop:T,onMove:p,onMoveStart:g,onMoveEnd:y,noPanClassName:ir,nodeOrigin:Ot,rfId:Si,autoPanOnConnect:Dr,autoPanOnNodeDrag:gt,autoPanSpeed:jl,onError:zr,connectionRadius:Ol,isValidConnection:ar,selectNodesOnDrag:be,nodeDragThreshold:Dl,connectionDragThreshold:yf,onBeforeDelete:j,debug:xf,ariaLabelConfig:Ll,zIndexMode:wi}),b.jsx(C4,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:k,onNodeContextMenu:H,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:R,connectionLineComponent:te,connectionLineContainerStyle:ue,selectionKeyCode:de,selectionOnDrag:le,selectionMode:pe,deleteKeyCode:fe,multiSelectionKeyCode:Ee,panActivationKeyCode:we,zoomActivationKeyCode:ve,onlyRenderVisibleElements:ge,defaultViewport:ct,translateExtent:Ne,minZoom:ie,maxZoom:me,preventScrolling:ze,zoomOnScroll:jn,zoomOnPinch:kt,zoomOnDoubleClick:Vn,panOnScroll:ht,panOnScrollSpeed:Dt,panOnScrollMode:Qe,panOnDrag:on,onPaneClick:df,onPaneMouseEnter:fa,onPaneMouseMove:da,onPaneMouseLeave:ha,onPaneScroll:rr,onPaneContextMenu:pa,paneClickDistance:xi,nodeClickDistance:hf,onSelectionContextMenu:F,onSelectionStart:X,onSelectionEnd:Z,onReconnect:Ms,onReconnectStart:vi,onReconnectEnd:pf,onEdgeContextMenu:_l,onEdgeDoubleClick:Nl,onEdgeMouseEnter:kl,onEdgeMouseMove:Ts,onEdgeMouseLeave:As,reconnectRadius:Ml,defaultMarkerColor:Ht,noDragClassName:Et,noWheelClassName:zt,noPanClassName:ir,rfId:Si,disableKeyboardA11y:Or,nodeExtent:Ue,viewport:ga,onViewportChange:ya}),b.jsx(tO,{onSelectionChange:Q}),Cl,b.jsx(K3,{proOptions:bi,position:Rl}),b.jsx(Q3,{rfId:Si,disableKeyboardA11y:Or})]})})}var A4=iE(T4);function R4({dimensions:e,lineWidth:t,variant:r,className:a}){return b.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:St(["react-flow__background-pattern",r,a])})}function j4({radius:e,className:t}){return b.jsx("circle",{cx:e,cy:e,r:e,className:St(["react-flow__background-pattern","dots",t])})}var gi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gi||(gi={}));const O4={[gi.Dots]:1,[gi.Lines]:1,[gi.Cross]:6},D4=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ME({id:e,variant:t=gi.Dots,gap:r=20,size:a,lineWidth:s=1,offset:l=0,color:u,bgColor:f,style:h,className:d,patternClassName:p}){const g=B.useRef(null),{transform:y,patternId:v}=Ve(D4,lt),w=a||O4[t],C=t===gi.Dots,N=t===gi.Cross,S=Array.isArray(r)?r:[r,r],A=[S[0]*y[2]||1,S[1]*y[2]||1],_=w*y[2],k=Array.isArray(l)?l:[l,l],H=N?[_,_]:A,M=[k[0]*y[2]||1+H[0]/2,k[1]*y[2]||1+H[1]/2],D=`${v}${e||""}`;return b.jsxs("svg",{className:St(["react-flow__background",d]),style:{...h,...of,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[b.jsx("pattern",{id:D,x:y[0]%A[0],y:y[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:C?b.jsx(j4,{radius:_/2,className:p}):b.jsx(R4,{dimensions:H,lineWidth:s,variant:t,className:p})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}ME.displayName="Background";B.memo(ME);function z4(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function L4(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function I4(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 B4(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 H4(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 ac({children:e,className:t,...r}){return b.jsx("button",{type:"button",className:St(["react-flow__controls-button",t]),...r,children:e})}const P4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function TE({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:p,position:g="bottom-left",orientation:y="vertical","aria-label":v}){const w=ut(),{isInteractive:C,minZoomReached:N,maxZoomReached:S,ariaLabelConfig:A}=Ve(P4,lt),{zoomIn:_,zoomOut:k,fitView:H}=Ym(),M=()=>{_(),l?.()},D=()=>{k(),u?.()},P=()=>{H(s),f?.()},U=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),h?.(!C)},q=y==="horizontal"?"horizontal":"vertical";return b.jsxs(sf,{className:St(["react-flow__controls",q,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":v??A["controls.ariaLabel"],children:[t&&b.jsxs(b.Fragment,{children:[b.jsx(ac,{onClick:M,className:"react-flow__controls-zoomin",title:A["controls.zoomIn.ariaLabel"],"aria-label":A["controls.zoomIn.ariaLabel"],disabled:S,children:b.jsx(z4,{})}),b.jsx(ac,{onClick:D,className:"react-flow__controls-zoomout",title:A["controls.zoomOut.ariaLabel"],"aria-label":A["controls.zoomOut.ariaLabel"],disabled:N,children:b.jsx(L4,{})})]}),r&&b.jsx(ac,{className:"react-flow__controls-fitview",onClick:P,title:A["controls.fitView.ariaLabel"],"aria-label":A["controls.fitView.ariaLabel"],children:b.jsx(I4,{})}),a&&b.jsx(ac,{className:"react-flow__controls-interactive",onClick:U,title:A["controls.interactive.ariaLabel"],"aria-label":A["controls.interactive.ariaLabel"],children:C?b.jsx(H4,{}):b.jsx(B4,{})}),p]})}TE.displayName="Controls";B.memo(TE);function U4({id:e,x:t,y:r,width:a,height:s,style:l,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:p,shapeRendering:g,selected:y,onClick:v}){const{background:w,backgroundColor:C}=l||{},N=u||w||C;return b.jsx("rect",{className:St(["react-flow__minimap-node",{selected:y},d]),x:t,y:r,rx:p,ry:p,width:a,height:s,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:g,onClick:v?S=>v(S,e):void 0})}const V4=B.memo(U4),q4=e=>e.nodes.map(t=>t.id),ep=e=>e instanceof Function?e:()=>e;function F4({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:l=V4,onClick:u}){const f=Ve(q4,lt),h=ep(t),d=ep(e),p=ep(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:f.map(y=>b.jsx($4,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:p,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:l,onClick:u,shapeRendering:g},y))})}function Y4({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:p,y:g,width:y,height:v}=Ve(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const N=C.internals.userNode,{x:S,y:A}=C.internals.positionAbsolute,{width:_,height:k}=Ar(N);return{node:N,x:S,y:A,width:_,height:k}},lt);return!d||d.hidden||!jS(d)?null:b.jsx(f,{x:p,y:g,width:y,height:v,style:d.style,selected:!!d.selected,className:a(d),color:t(d),borderRadius:s,strokeColor:r(d),strokeWidth:l,shapeRendering:u,onClick:h,id:d.id})}const $4=B.memo(Y4);var G4=B.memo(F4);const X4=200,Q4=150,K4=e=>!e.hidden,Z4=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?RS(vl(e.nodeLookup,{filter:K4}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},W4="react-flow__minimap-desc";function AE({style:e,className:t,nodeStrokeColor:r,nodeColor:a,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:p,maskStrokeWidth:g,position:y="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:N=!1,ariaLabel:S,inversePan:A,zoomStep:_=1,offsetScale:k=5}){const H=ut(),M=B.useRef(null),{boundingRect:D,viewBB:P,rfId:U,panZoom:q,translateExtent:I,flowWidth:Y,flowHeight:Q,ariaLabelConfig:L}=Ve(Z4,lt),V=e?.width??X4,T=e?.height??Q4,F=D.width/V,X=D.height/T,Z=Math.max(F,X),j=Z*V,z=Z*T,$=k*Z,R=D.x-(j-D.width)/2-$,te=D.y-(z-D.height)/2-$,ue=j+$*2,fe=z+$*2,de=`${W4}-${U}`,le=B.useRef(0),pe=B.useRef();le.current=Z,B.useEffect(()=>{if(M.current&&q)return pe.current=S3({domNode:M.current,panZoom:q,getTransform:()=>H.getState().transform,getViewScale:()=>le.current}),()=>{pe.current?.destroy()}},[q]),B.useEffect(()=>{pe.current?.update({translateExtent:I,width:Y,height:Q,inversePan:A,pannable:C,zoomStep:_,zoomable:N})},[C,N,A,_,I,Y,Q]);const we=v?Ce=>{const[ce,ge]=pe.current?.pointer(Ce)||[0,0];v(Ce,{x:ce,y:ge})}:void 0,Ee=w?B.useCallback((Ce,ce)=>{const ge=H.getState().nodeLookup.get(ce).internals.userNode;w(Ce,ge)},[]):void 0,ve=S??L["minimap.ariaLabel"];return b.jsx(sf,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Z:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:St(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:V,height:T,viewBox:`${R} ${te} ${ue} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":de,ref:M,onClick:we,children:[ve&&b.jsx("title",{id:de,children:ve}),b.jsx(G4,{onClick:Ee,nodeColor:a,nodeStrokeColor:r,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:u,nodeComponent:f}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${R-$},${te-$}h${ue+$*2}v${fe+$*2}h${-ue-$*2}z
|
|
15
|
-
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}AE.displayName="MiniMap";B.memo(AE);const J4=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,eD={[Ss.Line]:"right",[Ss.Handle]:"bottom-right"};function tD({nodeId:e,position:t,variant:r=Ss.Handle,className:a,style:s=void 0,children:l,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:N,onResizeEnd:S}){const A=lE(),_=typeof e=="string"?e:A,k=ut(),H=B.useRef(null),M=r===Ss.Handle,D=Ve(B.useCallback(J4(M&&v),[M,v]),lt),P=B.useRef(null),U=t??eD[r];B.useEffect(()=>{if(!(!H.current||!_))return P.current||(P.current=L3({domNode:H.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:I,transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V,domNode:T}=k.getState();return{nodeLookup:I,transform:Y,snapGrid:Q,snapToGrid:L,nodeOrigin:V,paneDomNode:T}},onChange:(I,Y)=>{const{triggerNodeChanges:Q,nodeLookup:L,parentLookup:V,nodeOrigin:T}=k.getState(),F=[],X={x:I.x,y:I.y},Z=L.get(_);if(Z&&Z.expandParent&&Z.parentId){const j=Z.origin??T,z=I.width??Z.measured.width??0,$=I.height??Z.measured.height??0,R={id:Z.id,parentId:Z.parentId,rect:{width:z,height:$,...OS({x:I.x??Z.position.x,y:I.y??Z.position.y},{width:z,height:$},Z.parentId,L,j)}},te=Fm([R],L,V,T);F.push(...te),X.x=I.x?Math.max(j[0]*z,I.x):void 0,X.y=I.y?Math.max(j[1]*$,I.y):void 0}if(X.x!==void 0&&X.y!==void 0){const j={id:_,type:"position",position:{...X}};F.push(j)}if(I.width!==void 0&&I.height!==void 0){const z={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};F.push(z)}for(const j of Y){const z={...j,type:"position"};F.push(z)}Q(F)},onEnd:({width:I,height:Y})=>{const Q={id:_,type:"dimensions",resizing:!1,dimensions:{width:I,height:Y}};k.getState().triggerNodeChanges([Q])}})),P.current.update({controlPosition:U,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:p},keepAspectRatio:g,resizeDirection:y,onResizeStart:C,onResize:N,onResizeEnd:S,shouldResize:w}),()=>{P.current?.destroy()}},[U,f,h,d,p,g,C,N,S,w]);const q=U.split("-");return b.jsx("div",{className:St(["react-flow__resize-control","nodrag",...q,r,a]),ref:H,style:{...s,scale:D,...u&&{[M?"backgroundColor":"borderColor"]:u}},children:l})}B.memo(tD);const Qb=268,Kb=112,Ja=56,Gp=220,Zb=172,Xp=124,Wb=104,Jb=600;function nD(e){if(e.nodes.length===0)return{nodes:[],edges:[],graphWidth:Ja*2,graphHeight:Ja*2,currentNodeId:null,startNodeId:null,latestBranchNodeId:null,summary:{currentNodeLabel:"No active node",lineageNodeCount:0,sideNodeCount:0,alternateBranchCount:0,blockedAttemptCount:0}};const t=new Map(e.nodes.map(q=>[q.nodeId,q])),r=new Map;for(const q of e.nodes){if(!q.parentNodeId)continue;const I=r.get(q.parentNodeId)??[];I.push(q),r.set(q.parentNodeId,I)}for(const q of r.values())q.sort((I,Y)=>I.createdAtEventIndex-Y.createdAtEventIndex);const a=rD(e),s=a?iD(a,t):new Set,l=aD(e.nodes,t),u=new Map,f=new Map,h=new Map,d=new Set,p=new Set;let g=0,y=0;const v=()=>{g+=1;const q=Math.ceil(g/2);return g%2===1?-q:q},w=(q,I,Y,Q)=>{if(u.has(q))return;u.set(q,I),f.set(q,Y),h.set(q,Q);const L=r.get(q)??[];if(L.length===0)return;const[V,...T]=L;V&&w(V.nodeId,I,Y,Q);let F=1;for(const X of T){const Z=I<0?I-F:I+F;w(X.nodeId,Z,Y,Q),F+=1}},C=[...s].sort((q,I)=>(l.get(q)??0)-(l.get(I)??0));for(const q of C){u.set(q,0),f.set(q,"active"),h.set(q,null);const I=r.get(q)??[];for(const Y of I){if(s.has(Y.nodeId))continue;y+=1;const Q=Y.nodeKind==="blocked_attempt"?"blocked":"alternate";Q==="blocked"?p.add(Y.nodeId):d.add(Y.nodeId),w(Y.nodeId,v(),Q,y)}}const N=e.nodes.filter(q=>!q.parentNodeId||!t.has(q.parentNodeId)).sort((q,I)=>q.createdAtEventIndex-I.createdAtEventIndex);for(const q of N)if(!u.has(q.nodeId)){if(!s.has(q.nodeId)){y+=1;const I=q.nodeKind==="blocked_attempt"?"blocked":"alternate";I==="blocked"?p.add(q.nodeId):d.add(q.nodeId),w(q.nodeId,v(),I,y);continue}u.set(q.nodeId,0),f.set(q.nodeId,"active"),h.set(q.nodeId,null)}for(const q of e.nodes)if(!u.has(q.nodeId)){y+=1;const I=q.nodeKind==="blocked_attempt"?"blocked":"alternate";I==="blocked"?p.add(q.nodeId):d.add(q.nodeId),w(q.nodeId,v(),I,y)}const S=Math.min(...u.values()),A=Math.max(...u.values()),_=sD(e.nodes,l,t,s),k=e.nodes.map(q=>{const I=s.has(q.nodeId),Y=_.get(q.nodeId)??0;return{node:q,depth:Y,lane:u.get(q.nodeId)??0,x:Jb+Ja+Y*Qb,y:Ja+((u.get(q.nodeId)??0)-S)*Kb,isActiveLineage:I,isCurrent:q.nodeId===a,branchKind:f.get(q.nodeId)??"alternate",branchIndex:h.get(q.nodeId)??null}}),H=k.reduce((q,I)=>Math.max(q,I.depth),0),M=a?t.get(a)??null:null,D=[...d,...p].map(q=>t.get(q)).filter(q=>!!q).sort((q,I)=>I.createdAtEventIndex-q.createdAtEventIndex)[0]??null,P={currentNodeLabel:M?.stepLabel??(M?Gm(M.nodeId):"No active node"),lineageNodeCount:s.size,sideNodeCount:e.nodes.length-s.size,alternateBranchCount:d.size,blockedAttemptCount:e.nodes.filter(q=>q.nodeKind==="blocked_attempt").length},U=new Set(k.map(q=>q.node.nodeId));return{nodes:k,edges:e.edges.filter(q=>U.has(q.fromNodeId)&&U.has(q.toNodeId)),graphWidth:Jb*2+Ja*2+H*Qb+Gp,graphHeight:Ja*2+(A-S)*Kb+Xp,currentNodeId:a,startNodeId:C[0]??N[0]?.nodeId??null,latestBranchNodeId:D?.nodeId??null,summary:P}}function rD(e){if(e.preferredTipNodeId)return e.preferredTipNodeId;const t=e.nodes.find(a=>a.isPreferredTip);if(t)return t.nodeId;const r=e.nodes.filter(a=>a.isTip).sort((a,s)=>s.createdAtEventIndex-a.createdAtEventIndex)[0];return r?r.nodeId:[...e.nodes].sort((a,s)=>s.createdAtEventIndex-a.createdAtEventIndex)[0]?.nodeId??null}function iD(e,t){const r=new Set;let a=e;for(;a&&!r.has(a);){r.add(a);const s=t.get(a)?.parentNodeId??null;a=s&&t.has(s)?s:null}return r}function aD(e,t){const r=new Map,a=new Set,s=l=>{const u=r.get(l);if(u!==void 0)return u;if(a.has(l))return r.set(l,0),0;a.add(l);const h=t.get(l)?.parentNodeId??null;if(!h||!t.has(h))return r.set(l,0),a.delete(l),0;const d=s(h)+1;return r.set(l,d),a.delete(l),d};for(const l of e)s(l.nodeId);return r}function Gm(e){return e.slice(-8)}function sD(e,t,r,a){const s=new Map;for(const f of a)s.set(f,t.get(f)??0);const l=new Set,u=f=>{const h=s.get(f);if(h!==void 0)return h;if(l.has(f)){const v=t.get(f)??0;return s.set(f,v),v}l.add(f);const p=r.get(f)?.parentNodeId??null;if(!p||!r.has(p)){const v=t.get(f)??0;return s.set(f,v),l.delete(f),v}const y=u(p)+1;return s.set(f,y),l.delete(f),y};for(const f of e)s.has(f.nodeId)||u(f.nodeId);return s}function oD({run:e,selectedNodeId:t=null,onNodeClick:r}){const a=B.useRef(null),s=B.useRef(null),l=B.useRef(!1),[u,f]=B.useState(null),[h,d]=B.useState(null),p=B.useRef(null),g=B.useMemo(()=>nD(e),[e]),y=B.useMemo(()=>new Map(g.nodes.map(k=>[k.node.nodeId,k])),[g.nodes]),v=e.status==="in_progress",w=B.useCallback((k,H="smooth")=>{if(!k)return;const M=s.current,D=y.get(k);if(!M||!D)return;a.current?.scrollIntoView({behavior:H,block:"nearest"});const P=D.isActiveLineage?Gp:Zb,U=D.isActiveLineage?Xp:Wb;M.scrollTo({left:Math.max(0,D.x-M.clientWidth/2+P/2),top:Math.max(0,D.y-M.clientHeight/2+U/2),behavior:H})},[y]);B.useEffect(()=>{l.current||g.currentNodeId&&(l.current=!0,w(g.currentNodeId,"auto"))},[]);const{nodes:C,edges:N}=B.useMemo(()=>{const k=g.currentNodeId?g.edges.find(D=>D.toNodeId===g.currentNodeId)?.fromNodeId??null:null,H=g.nodes.map(D=>{const{node:P,isActiveLineage:U,isCurrent:q}=D,I=P.nodeId===t,Y=U?Gp:Zb,Q=U?Xp:Wb,L=dD(P,U,q,I),V=cD(P,U),T=RE(P,D.branchKind,D.branchIndex);return{id:P.nodeId,position:{x:D.x,y:D.y},data:{label:b.jsx(lD,{node:P,isActiveLineage:U,isCurrent:q,isSelected:I,isLiveRun:v,branchKind:D.branchKind,branchIndex:D.branchIndex,displayLabel:T,stepNumber:U?D.depth+1:null,totalSteps:U?g.summary.lineageNodeCount:null})},style:{width:Y,height:Q,padding:0,borderRadius:0,border:`1px solid ${L}`,background:V,color:"var(--text-primary)",boxShadow:I?"0 0 0 1px rgba(244, 179, 65, 0.7), 0 0 18px rgba(244, 179, 65, 0.16)":q?"0 0 0 1px rgba(0, 240, 255, 0.65), 0 0 24px rgba(0, 240, 255, 0.18)":U?"0 0 16px rgba(0, 240, 255, 0.1)":"none",opacity:U?1:.72,cursor:"pointer",display:"flex",alignItems:"stretch",justifyContent:"stretch"}}}),M=g.edges.map((D,P)=>{const U=y.get(D.fromNodeId),q=y.get(D.toNodeId),I=!!(U?.isActiveLineage&&q?.isActiveLineage),Y=v&&!!g.currentNodeId&&D.toNodeId===g.currentNodeId&&D.fromNodeId===k;return{id:`lineage-edge-${P}`,source:D.fromNodeId,target:D.toNodeId,type:"smoothstep",animated:Y,className:Y?"workrail-current-lineage-edge":void 0,style:{stroke:Y?"var(--accent-strong)":I?D.edgeKind==="checkpoint"?"var(--success)":"var(--accent-strong)":"rgba(123, 141, 167, 0.45)",strokeWidth:Y?2.6:I?2.2:1.5,opacity:I?1:.72}}});return{nodes:H,edges:M}},[v,g.currentNodeId,g.edges,g.nodes,y,t]),S=B.useCallback((k,H)=>{r?.(H.id)},[r]),A=B.useCallback((k,H)=>{const M=y.get(H.id)?.node.stepLabel??null;if(!M||M.length<=35)return;const D=s.current?.getBoundingClientRect();if(!D)return;const P=k.clientX-D.left+12,U=k.clientY-D.top+16,q=Math.min(P,(s.current?.clientWidth??9999)-272);p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{f(M),d({x:q,y:U})},300)},[y]),_=B.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),f(null),d(null)},[]);return b.jsxs("div",{ref:a,className:"h-full flex flex-col bg-[var(--bg-primary)]",children:[b.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 console-blueprint-grid",children:[b.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(Pi,{label:"Current",value:g.summary.currentNodeLabel,emphasis:!0}),b.jsx(Pi,{label:"Status",value:yD(e.status)}),b.jsx(Pi,{label:"Active lineage",value:`${g.summary.lineageNodeCount} nodes`}),b.jsx(Pi,{label:"Alternate branches",value:`${g.summary.alternateBranchCount}`}),b.jsx(Pi,{label:"Historical nodes",value:`${g.summary.sideNodeCount}`}),b.jsx(Pi,{label:"Blocked attempts",value:`${g.summary.blockedAttemptCount}`}),b.jsx(Pi,{label:"Critical gaps",value:e.hasUnresolvedCriticalGaps?"Present":"None"})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(tp,{onClick:()=>w(g.startNodeId),children:"Start"}),b.jsx(tp,{onClick:()=>w(g.currentNodeId),children:"Current"}),b.jsx(tp,{onClick:()=>w(g.latestBranchNodeId),children:"Latest branch"})]})]}),b.jsx(uD,{model:g,selectedNodeId:t,onNavigateToNode:w})]}),b.jsxs("div",{ref:s,className:"relative flex-1 overflow-auto lineage-scroll-surface",children:[b.jsx("div",{style:{width:Math.max(g.graphWidth,960),height:Math.max(g.graphHeight,360)},children:b.jsx(A4,{nodes:C,edges:N,fitView:!1,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,colorMode:"dark",onNodeClick:S,onNodeMouseEnter:A,onNodeMouseLeave:_,style:{background:"transparent"}})}),u&&h&&b.jsx("div",{style:{position:"absolute",left:h.x,top:h.y,pointerEvents:"none",zIndex:50,maxWidth:260,background:"rgba(10, 12, 20, 0.96)",border:"1px solid rgba(123, 141, 167, 0.35)",padding:"6px 10px",fontSize:12,lineHeight:1.5,color:"var(--text-primary)",wordWrap:"break-word",boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:u})]})]})}function lD({node:e,isActiveLineage:t,isCurrent:r,isSelected:a,isLiveRun:s,branchKind:l,branchIndex:u,displayLabel:f,stepNumber:h,totalSteps:d}){const p=pD(e);return b.jsxs("div",{className:`relative flex h-full w-full flex-col text-left overflow-hidden ${r&&s?"workrail-current-lineage-node":""} ${a?"workrail-selected-lineage-node":""}`,children:[p&&b.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:3,background:p,pointerEvents:"none"}}),b.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-3 py-3",children:[b.jsxs("div",{className:"flex items-start justify-between gap-2",children:[b.jsx(gn,{color:fD(l,t),children:gD(e.nodeKind,l,u)}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[a&&b.jsx(gn,{color:"var(--warning)",children:"Selected"}),r&&b.jsx(gn,{color:s?"var(--accent-strong)":"var(--text-secondary)",children:"Current"})]})]}),b.jsx("div",{className:t?"text-sm font-medium leading-snug":"text-[13px] leading-snug",style:{color:"var(--text-primary)",display:"-webkit-box",WebkitLineClamp:t?4:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:f})]}),b.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-[rgba(255,255,255,0.06)] bg-[rgba(0,0,0,0.18)] px-3 py-2",children:[b.jsx(gn,{color:"var(--text-secondary)",className:"min-w-0 truncate text-[11px]",children:h!==null&&d!==null?`${h} / ${d}`:`evt ${e.createdAtEventIndex}`}),e.isTip?b.jsx(gn,{className:"shrink-0",color:e.isPreferredTip?"var(--warning)":"var(--text-muted)",children:e.isPreferredTip?"Preferred tip":"Tip"}):b.jsx(gn,{className:"shrink-0",color:"transparent",children:"spacer"})]})]})}function uD({model:e,selectedNodeId:t,onNavigateToNode:r}){const a=e.nodes.filter(l=>l.isActiveLineage),s=e.nodes.filter(l=>!l.isActiveLineage).slice(-8);return b.jsx("div",{className:"mt-3 border border-[var(--border)] bg-[rgba(10,10,10,0.38)] px-3 py-2 corner-brackets",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(gn,{children:"Lineage rail"}),a.map(l=>b.jsx(e1,{label:l.node.stepLabel??Gm(l.node.nodeId),isCurrent:l.isCurrent,isSelected:l.node.nodeId===t,tone:"active",onClick:()=>r(l.node.nodeId)},l.node.nodeId)),s.length>0&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"mx-1 h-px w-6 bg-[var(--border)]"}),s.map(l=>b.jsx(e1,{label:RE(l.node,l.branchKind,l.branchIndex),isCurrent:!1,isSelected:l.node.nodeId===t,tone:l.branchKind==="blocked"?"blocked":"side",onClick:()=>r(l.node.nodeId)},l.node.nodeId))]})]})})}function Pi({label:e,value:t,emphasis:r=!1}){return b.jsxs("div",{className:"min-w-[120px] border px-3 py-2",style:{borderColor:r?"rgba(0, 240, 255, 0.42)":"var(--border)",background:r?"rgba(0, 240, 255, 0.08)":"rgba(15, 19, 31, 0.78)"},children:[b.jsx(gn,{children:e}),b.jsx("div",{className:"mt-1 text-sm text-[var(--text-primary)]",children:t})]})}function tp({children:e,onClick:t}){return b.jsx("button",{type:"button",onClick:t,className:"border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] transition-colors hover:border-[var(--accent-strong)] hover:text-[var(--text-primary)]",children:e})}function e1({label:e,isCurrent:t,isSelected:r,tone:a,onClick:s}){const l=r?"rgba(244, 179, 65, 0.16)":a==="active"?t?"rgba(0, 240, 255, 0.2)":"rgba(0, 240, 255, 0.08)":a==="blocked"?"rgba(239, 68, 68, 0.12)":"rgba(125, 136, 156, 0.12)",u=r?"rgba(244, 179, 65, 0.48)":a==="active"?t?"rgba(0, 240, 255, 0.6)":"rgba(0, 240, 255, 0.32)":a==="blocked"?"rgba(239, 68, 68, 0.34)":"rgba(125, 136, 156, 0.3)";return b.jsx("button",{type:"button",title:e,onClick:s,className:"border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em] text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",style:{background:l,borderColor:u},children:xD(e)})}function cD(e,t){return e.nodeKind==="blocked_attempt"?t?"rgba(80, 24, 31, 0.92)":"rgba(52, 24, 30, 0.82)":e.nodeKind==="checkpoint"?t?"rgba(18, 61, 51, 0.92)":"rgba(18, 43, 38, 0.82)":t?"rgba(27, 31, 44, 0.96)":"rgba(24, 28, 39, 0.82)"}function fD(e,t){return e==="blocked"?"var(--error)":e==="alternate"?t?"var(--accent-strong)":"rgba(186, 197, 219, 0.72)":t?"var(--accent-strong)":"var(--text-muted)"}function dD(e,t,r,a){return a?"var(--warning)":r?"var(--accent-strong)":e.nodeKind==="blocked_attempt"?t?"var(--error)":"rgba(239, 68, 68, 0.5)":e.nodeKind==="checkpoint"?t?"var(--success)":"rgba(34, 197, 94, 0.45)":t?"rgba(0, 240, 255, 0.55)":"rgba(123, 141, 167, 0.45)"}const hD=[{test:e=>e.hasFailedValidations,color:"var(--error)"},{test:e=>e.hasGaps,color:"var(--warning)"},{test:e=>e.hasRecap||e.hasArtifacts,color:"var(--accent)"}];function pD(e){return hD.find(t=>t.test(e))?.color??null}function mD(e){switch(e){case"blocked_attempt":return"Blocked";case"checkpoint":return"Checkpoint";case"step":return"Step"}}function gD(e,t,r){return t==="blocked"?r?`Blocked branch ${r}`:"Blocked branch":t==="alternate"?r?`Alt branch ${r}`:"Alt branch":mD(e)}function yD(e){switch(e){case"complete":return"Complete";case"complete_with_gaps":return"Complete with gaps";case"blocked":return"Blocked";case"in_progress":return"In progress"}}function RE(e,t,r){return e.stepLabel?e.stepLabel:t==="blocked"?r?`Blocked attempt ${r}`:"Blocked attempt":t==="alternate"?r?`Alternate path ${r}`:"Alternate path":Gm(e.nodeId)}function xD(e){return e.length>18?`${e.slice(0,18)}…`:e}function vD(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const bD=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SD={};function t1(e,t){return(SD.jsx?wD:bD).test(e)}const ED=/[ \t\n\f\r]/g;function CD(e){return typeof e=="object"?e.type==="text"?n1(e.value):!1:n1(e)}function n1(e){return e.replace(ED,"")===""}class Sl{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function jE(e,t){const r={},a={};for(const s of e)Object.assign(r,s.property),Object.assign(a,s.normal);return new Sl(r,a,t)}function Qp(e){return e.toLowerCase()}class an{constructor(t,r){this.attribute=r,this.property=t}}an.prototype.attribute="";an.prototype.booleanish=!1;an.prototype.boolean=!1;an.prototype.commaOrSpaceSeparated=!1;an.prototype.commaSeparated=!1;an.prototype.defined=!1;an.prototype.mustUseProperty=!1;an.prototype.number=!1;an.prototype.overloadedBoolean=!1;an.prototype.property="";an.prototype.spaceSeparated=!1;an.prototype.space=void 0;let _D=0;const Oe=ua(),wt=ua(),Kp=ua(),he=ua(),nt=ua(),cs=ua(),mn=ua();function ua(){return 2**++_D}const Zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:wt,commaOrSpaceSeparated:mn,commaSeparated:cs,number:he,overloadedBoolean:Kp,spaceSeparated:nt},Symbol.toStringTag,{value:"Module"})),np=Object.keys(Zp);class Xm extends an{constructor(t,r,a,s){let l=-1;if(super(t,r),r1(this,"space",s),typeof a=="number")for(;++l<np.length;){const u=np[l];r1(this,np[l],(a&Zp[u])===Zp[u])}}}Xm.prototype.defined=!0;function r1(e,t,r){r&&(e[t]=r)}function _s(e){const t={},r={};for(const[a,s]of Object.entries(e.properties)){const l=new Xm(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,r[Qp(a)]=a,r[Qp(l.attribute)]=a}return new Sl(t,r,e.space)}const OE=_s({properties:{ariaActiveDescendant:null,ariaAtomic:wt,ariaAutoComplete:null,ariaBusy:wt,ariaChecked:wt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:nt,ariaCurrent:null,ariaDescribedBy:nt,ariaDetails:null,ariaDisabled:wt,ariaDropEffect:nt,ariaErrorMessage:null,ariaExpanded:wt,ariaFlowTo:nt,ariaGrabbed:wt,ariaHasPopup:null,ariaHidden:wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nt,ariaLevel:he,ariaLive:null,ariaModal:wt,ariaMultiLine:wt,ariaMultiSelectable:wt,ariaOrientation:null,ariaOwns:nt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:wt,ariaReadOnly:wt,ariaRelevant:null,ariaRequired:wt,ariaRoleDescription:nt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:wt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function DE(e,t){return t in e?e[t]:t}function zE(e,t){return DE(e,t.toLowerCase())}const ND=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:cs,acceptCharset:nt,accessKey:nt,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:nt,autoFocus:Oe,autoPlay:Oe,blocking:nt,capture:null,charSet:null,checked:Oe,cite:null,className:nt,cols:he,colSpan:null,content:null,contentEditable:wt,controls:Oe,controlsList:nt,coords:he|cs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:Kp,draggable:wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:nt,height:he,hidden:Kp,high:he,href:null,hrefLang:null,htmlFor:nt,httpEquiv:nt,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:nt,itemRef:nt,itemScope:Oe,itemType:nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oe,optimum:he,pattern:null,ping:nt,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:nt,required:Oe,reversed:Oe,rows:he,rowSpan:he,sandbox:nt,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:wt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:wt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:zE}),kD=_s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:cs,g2:cs,glyphName:cs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mn,rev:mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mn,requiredFeatures:mn,requiredFonts:mn,requiredFormats:mn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DE}),LE=_s({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),IE=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zE}),BE=_s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),MD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},TD=/[A-Z]/g,i1=/-[a-z]/g,AD=/^data[-\w.:]+$/i;function RD(e,t){const r=Qp(t);let a=t,s=an;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&AD.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(i1,OD);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!i1.test(l)){let u=l.replace(TD,jD);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=Xm}return new s(a,t)}function jD(e){return"-"+e.toLowerCase()}function OD(e){return e.charAt(1).toUpperCase()}const DD=jE([OE,ND,LE,IE,BE],"html"),Qm=jE([OE,kD,LE,IE,BE],"svg");function zD(e){return e.join(" ").trim()}var es={},rp,a1;function LD(){if(a1)return rp;a1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
16
|
-
`,d="/",p="*",g="",y="comment",v="declaration";function w(N,S){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];S=S||{};var A=1,_=1;function k(L){var V=L.match(t);V&&(A+=V.length);var T=L.lastIndexOf(h);_=~T?L.length-T:_+L.length}function H(){var L={line:A,column:_};return function(V){return V.position=new M(L),U(),V}}function M(L){this.start=L,this.end={line:A,column:_},this.source=S.source}M.prototype.content=N;function D(L){var V=new Error(S.source+":"+A+":"+_+": "+L);if(V.reason=L,V.filename=S.source,V.line=A,V.column=_,V.source=N,!S.silent)throw V}function P(L){var V=L.exec(N);if(V){var T=V[0];return k(T),N=N.slice(T.length),V}}function U(){P(r)}function q(L){var V;for(L=L||[];V=I();)V!==!1&&L.push(V);return L}function I(){var L=H();if(!(d!=N.charAt(0)||p!=N.charAt(1))){for(var V=2;g!=N.charAt(V)&&(p!=N.charAt(V)||d!=N.charAt(V+1));)++V;if(V+=2,g===N.charAt(V-1))return D("End of comment missing");var T=N.slice(2,V-2);return _+=2,k(T),N=N.slice(V),_+=2,L({type:y,comment:T})}}function Y(){var L=H(),V=P(a);if(V){if(I(),!P(s))return D("property missing ':'");var T=P(l),F=L({type:v,property:C(V[0].replace(e,g)),value:T?C(T[0].replace(e,g)):g});return P(u),F}}function Q(){var L=[];q(L);for(var V;V=Y();)V!==!1&&(L.push(V),q(L));return L}return U(),Q()}function C(N){return N?N.replace(f,g):g}return rp=w,rp}var s1;function ID(){if(s1)return es;s1=1;var e=es&&es.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(es,"__esModule",{value:!0}),es.default=r;const t=e(LD());function r(a,s){let l=null;if(!a||typeof a!="string")return l;const u=(0,t.default)(a),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:p}=h;f?s(d,p,h):p&&(l=l||{},l[d]=p)}),l}return es}var Ro={},o1;function BD(){if(o1)return Ro;o1=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||r.test(d)||e.test(d)},u=function(d,p){return p.toUpperCase()},f=function(d,p){return"".concat(p,"-")},h=function(d,p){return p===void 0&&(p={}),l(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(s,f):d=d.replace(a,f),d.replace(t,u))};return Ro.camelCase=h,Ro}var jo,l1;function HD(){if(l1)return jo;l1=1;var e=jo&&jo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(ID()),r=BD();function a(s,l){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(u[(0,r.camelCase)(f,l)]=h)}),u}return a.default=a,jo=a,jo}var PD=HD();const UD=Fc(PD),HE=PE("end"),Km=PE("start");function PE(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function VD(e){const t=Km(e),r=HE(e);if(t&&r)return{start:t,end:r}}function qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?u1(e.position):"start"in e||"end"in e?u1(e):"line"in e||"column"in e?Wp(e):""}function Wp(e){return c1(e&&e.line)+":"+c1(e&&e.column)}function u1(e){return Wp(e&&e.start)+"-"+Wp(e&&e.end)}function c1(e){return e&&typeof e=="number"?e:1}class Bt extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let s="",l={},u=!1;if(r&&("line"in r&&"column"in r?l={place:r}:"start"in r&&"end"in r?l={place:r}:"type"in r?l={ancestors:[r],place:r.position}:l={...r}),typeof t=="string"?s=t:!l.cause&&t&&(u=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?l.ruleId=a:(l.source=a.slice(0,h),l.ruleId=a.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=qo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Bt.prototype.file="";Bt.prototype.name="";Bt.prototype.reason="";Bt.prototype.message="";Bt.prototype.stack="";Bt.prototype.column=void 0;Bt.prototype.line=void 0;Bt.prototype.ancestors=void 0;Bt.prototype.cause=void 0;Bt.prototype.fatal=void 0;Bt.prototype.place=void 0;Bt.prototype.ruleId=void 0;Bt.prototype.source=void 0;const Zm={}.hasOwnProperty,qD=new Map,FD=/[A-Z]/g,YD=new Set(["table","tbody","thead","tfoot","tr"]),$D=new Set(["td","th"]),UE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=tz(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=ez(r,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Qm:DD,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=VE(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function VE(e,t,r){if(t.type==="element")return XD(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return QD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ZD(e,t,r);if(t.type==="mdxjsEsm")return KD(e,t);if(t.type==="root")return WD(e,t,r);if(t.type==="text")return JD(e,t)}function XD(e,t,r){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=Qm,e.schema=s),e.ancestors.push(t);const l=FE(e,t.tagName,!1),u=nz(e,t);let f=Jm(e,t);return YD.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!CD(h):!0})),qE(e,u,l,t),Wm(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function QD(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}dl(e,t.position)}function KD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);dl(e,t.position)}function ZD(e,t,r){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=Qm,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:FE(e,t.name,!0),u=rz(e,t),f=Jm(e,t);return qE(e,u,l,t),Wm(u,f),e.ancestors.pop(),e.schema=a,e.create(t,l,u,r)}function WD(e,t,r){const a={};return Wm(a,Jm(e,t)),e.create(t,e.Fragment,a,r)}function JD(e,t){return t.value}function qE(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Wm(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function ez(e,t,r){return a;function a(s,l,u,f){const d=Array.isArray(u.children)?r:t;return f?d(l,u,f):d(l,u)}}function tz(e,t){return r;function r(a,s,l,u){const f=Array.isArray(l.children),h=Km(a);return t(s,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function nz(e,t){const r={};let a,s;for(s in t.properties)if(s!=="children"&&Zm.call(t.properties,s)){const l=iz(e,s,t.properties[s]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&$D.has(t.tagName)?a=f:r[u]=f}}if(a){const l=r.style||(r.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function rz(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else dl(e,t.position);else{const s=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else dl(e,t.position);else l=a.value===null?!0:a.value;r[s]=l}return r}function Jm(e,t){const r=[];let a=-1;const s=e.passKeys?new Map:qD;for(;++a<t.children.length;){const l=t.children[a];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=s.get(h)||0;u=h+"-"+d,s.set(h,d+1)}}const f=VE(e,l,u);f!==void 0&&r.push(f)}return r}function iz(e,t,r){const a=RD(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?vD(r):zD(r)),a.property==="style"){let s=typeof r=="object"?r:az(e,String(r));return e.stylePropertyNameCase==="css"&&(s=sz(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?MD[a.property]||a.property:a.attribute,r]}}function az(e,t){try{return UD(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,s=new Bt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=UE+"#cannot-parse-style-attribute",s}}function FE(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,u;for(;++l<s.length;){const f=t1(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}a=u}else a=t1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Zm.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);dl(e)}function dl(e,t){const r=new Bt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=UE+"#cannot-handle-mdx-estrees-without-createevaluater",r}function sz(e){const t={};let r;for(r in e)Zm.call(e,r)&&(t[oz(r)]=e[r]);return t}function oz(e){let t=e.replace(FD,lz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lz(e){return"-"+e.toLowerCase()}const ip={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},uz={};function cz(e,t){const r=uz,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return YE(e,a,s)}function YE(e,t,r){if(fz(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return f1(e.children,t,r)}return Array.isArray(e)?f1(e,t,r):""}function f1(e,t,r){const a=[];let s=-1;for(;++s<e.length;)a[s]=YE(e[s],t,r);return a.join("")}function fz(e){return!!(e&&typeof e=="object")}const d1=document.createElement("i");function eg(e){const t="&"+e+";";d1.innerHTML=t;const r=d1.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function tr(e,t,r,a){const s=e.length;let l=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);l<a.length;)u=a.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Rn(e,t){return e.length>0?(tr(e,e.length,0,t),e):t}const h1={}.hasOwnProperty;function dz(e){const t={};let r=-1;for(;++r<e.length;)hz(t,e[r]);return t}function hz(e,t){let r;for(r in t){const s=(h1.call(e,r)?e[r]:void 0)||(e[r]={}),l=t[r];let u;if(l)for(u in l){h1.call(s,u)||(s[u]=[]);const f=l[u];pz(s[u],Array.isArray(f)?f:f?[f]:[])}}}function pz(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);tr(e,0,0,a)}function $E(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Wn=yi(/[A-Za-z]/),vn=yi(/[\dA-Za-z]/),mz=yi(/[#-'*+\--9=?A-Z^-~]/);function Jp(e){return e!==null&&(e<32||e===127)}const em=yi(/\d/),gz=yi(/[\dA-Fa-f]/),yz=yi(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function nn(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const xz=yi(new RegExp("\\p{P}|\\p{S}","u")),vz=yi(/\s/);function yi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ns(e){const t=[];let r=-1,a=0,s=0;for(;++r<e.length;){const l=e.charCodeAt(r);let u="";if(l===37&&vn(e.charCodeAt(r+1))&&vn(e.charCodeAt(r+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const f=e.charCodeAt(r+1);l<56320&&f>56319&&f<57344?(u=String.fromCharCode(l,f),s=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+s+1,u=""),s&&(r+=s,s=0)}return t.join("")+e.slice(a)}function rt(e,t,r,a){const s=a?a-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(h){return Xe(h)?(e.enter(r),f(h)):t(h)}function f(h){return Xe(h)&&l++<s?(e.consume(h),f):(e.exit(r),t(h))}}const bz={tokenize:wz};function wz(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let r;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),rt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),l(f)}function l(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Me(f)?(e.consume(f),e.exit("chunkText"),l):(e.consume(f),u)}}const Sz={tokenize:Ez},p1={tokenize:Cz};function Ez(e){const t=this,r=[];let a=0,s,l,u;return f;function f(_){if(a<r.length){const k=r[a];return t.containerState=k[1],e.attempt(k[0].continuation,h,d)(_)}return d(_)}function h(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const k=t.events.length;let H=k,M;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){M=t.events[H][1].end;break}S(a);let D=k;for(;D<t.events.length;)t.events[D][1].end={...M},D++;return tr(t.events,H+1,0,t.events.slice(k)),t.events.length=D,d(_)}return f(_)}function d(_){if(a===r.length){if(!s)return y(_);if(s.currentConstruct&&s.currentConstruct.concrete)return w(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(p1,p,g)(_)}function p(_){return s&&A(),S(a),y(_)}function g(_){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,w(_)}function y(_){return t.containerState={},e.attempt(p1,v,w)(_)}function v(_){return a++,r.push([t.currentConstruct,t.containerState]),y(_)}function w(_){if(_===null){s&&A(),S(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),C(_)}function C(_){if(_===null){N(e.exit("chunkFlow"),!0),S(0),e.consume(_);return}return Me(_)?(e.consume(_),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(_),C)}function N(_,k){const H=t.sliceStream(_);if(k&&H.push(null),_.previous=l,l&&(l.next=_),l=_,s.defineSkip(_.start),s.write(H),t.parser.lazy[_.start.line]){let M=s.events.length;for(;M--;)if(s.events[M][1].start.offset<u&&(!s.events[M][1].end||s.events[M][1].end.offset>u))return;const D=t.events.length;let P=D,U,q;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(U){q=t.events[P][1].end;break}U=!0}for(S(a),M=D;M<t.events.length;)t.events[M][1].end={...q},M++;tr(t.events,P+1,0,t.events.slice(D)),t.events.length=M}}function S(_){let k=r.length;for(;k-- >_;){const H=r[k];t.containerState=H[1],H[0].exit.call(t,e)}r.length=_}function A(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function Cz(e,t,r){return rt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function m1(e){if(e===null||nn(e)||vz(e))return 1;if(xz(e))return 2}function tg(e,t,r){const a=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!a.includes(l)&&(t=l(t,r),a.push(l))}return t}const tm={name:"attention",resolveAll:_z,tokenize:Nz};function _z(e,t){let r=-1,a,s,l,u,f,h,d,p;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[a][1].end},y={...e[r][1].start};g1(g,-h),g1(y,h),u={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},l={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[r][1].start={...f.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Rn(d,[["enter",e[a][1],t],["exit",e[a][1],t]])),d=Rn(d,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",l,t]]),d=Rn(d,tg(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),d=Rn(d,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[r][1].end.offset-e[r][1].start.offset?(p=2,d=Rn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):p=0,tr(e,a-1,r-a+3,d),r=a+d.length-p-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function Nz(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,s=m1(a);let l;return u;function u(h){return l=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===l)return e.consume(h),f;const d=e.exit("attentionSequence"),p=m1(h),g=!p||p===2&&s||r.includes(h),y=!s||s===2&&p||r.includes(a);return d._open=!!(l===42?g:g&&(s||!y)),d._close=!!(l===42?y:y&&(p||!g)),t(h)}}function g1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kz={name:"autolink",tokenize:Mz};function Mz(e,t,r){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Wn(v)?(e.consume(v),u):v===64?r(v):d(v)}function u(v){return v===43||v===45||v===46||vn(v)?(a=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),a=0,h):(v===43||v===45||v===46||vn(v))&&a++<32?(e.consume(v),f):(a=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Jp(v)?r(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),p):mz(v)?(e.consume(v),d):r(v)}function p(v){return vn(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),a=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||vn(v))&&a++<63){const w=v===45?y:g;return e.consume(v),w}return r(v)}}const uf={partial:!0,tokenize:Tz};function Tz(e,t,r){return a;function a(l){return Xe(l)?rt(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Me(l)?t(l):r(l)}}const GE={continuation:{tokenize:Rz},exit:jz,name:"blockQuote",tokenize:Az};function Az(e,t,r){const a=this;return s;function s(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return r(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function Rz(e,t,r){const a=this;return s;function s(u){return Xe(u)?rt(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(GE,t,r)(u)}}function jz(e){e.exit("blockQuote")}const XE={name:"characterEscape",tokenize:Oz};function Oz(e,t,r){return a;function a(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return yz(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(l)}}const QE={name:"characterReference",tokenize:Dz};function Dz(e,t,r){const a=this;let s=0,l,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,u=vn,p(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=gz,p):(e.enter("characterReferenceValue"),l=7,u=em,p(g))}function p(g){if(g===59&&s){const y=e.exit("characterReferenceValue");return u===vn&&!eg(a.sliceSerialize(y))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&s++<l?(e.consume(g),p):r(g)}}const y1={partial:!0,tokenize:Lz},x1={concrete:!0,name:"codeFenced",tokenize:zz};function zz(e,t,r){const a=this,s={partial:!0,tokenize:H};let l=0,u=0,f;return h;function h(M){return d(M)}function d(M){const D=a.events[a.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(M)}function p(M){return M===f?(u++,e.consume(M),p):u<3?r(M):(e.exit("codeFencedFenceSequence"),Xe(M)?rt(e,g,"whitespace")(M):g(M))}function g(M){return M===null||Me(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(y1,C,k)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Me(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):Xe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,v,"whitespace")(M)):M===96&&M===f?r(M):(e.consume(M),y)}function v(M){return M===null||Me(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||Me(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===f?r(M):(e.consume(M),w)}function C(M){return e.attempt(s,k,N)(M)}function N(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),S}function S(M){return l>0&&Xe(M)?rt(e,A,"linePrefix",l+1)(M):A(M)}function A(M){return M===null||Me(M)?e.check(y1,C,k)(M):(e.enter("codeFlowValue"),_(M))}function _(M){return M===null||Me(M)?(e.exit("codeFlowValue"),A(M)):(e.consume(M),_)}function k(M){return e.exit("codeFenced"),t(M)}function H(M,D,P){let U=0;return q;function q(V){return M.enter("lineEnding"),M.consume(V),M.exit("lineEnding"),I}function I(V){return M.enter("codeFencedFence"),Xe(V)?rt(M,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Y(V)}function Y(V){return V===f?(M.enter("codeFencedFenceSequence"),Q(V)):P(V)}function Q(V){return V===f?(U++,M.consume(V),Q):U>=u?(M.exit("codeFencedFenceSequence"),Xe(V)?rt(M,L,"whitespace")(V):L(V)):P(V)}function L(V){return V===null||Me(V)?(M.exit("codeFencedFence"),D(V)):P(V)}}}function Lz(e,t,r){const a=this;return s;function s(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const ap={name:"codeIndented",tokenize:Bz},Iz={partial:!0,tokenize:Hz};function Bz(e,t,r){const a=this;return s;function s(d){return e.enter("codeIndented"),rt(e,l,"linePrefix",5)(d)}function l(d){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(d):r(d)}function u(d){return d===null?h(d):Me(d)?e.attempt(Iz,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Me(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function Hz(e,t,r){const a=this;return s;function s(u){return a.parser.lazy[a.now().line]?r(u):Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):rt(e,l,"linePrefix",5)(u)}function l(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Me(u)?s(u):r(u)}}const Pz={name:"codeText",previous:Vz,resolve:Uz,tokenize:qz};function Uz(e){let t=e.length-4,r=3,a,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function Vz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qz(e,t,r){let a=0,s,l;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(l=e.enter("codeTextSequence"),s=0,p(g)):Me(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||Me(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),d)}function p(g){return g===96?(e.consume(g),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(l.type="codeTextData",d(g))}}class Fz{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const s=r||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Oo(this.left,a),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Oo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Oo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Oo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Oo(this.left,r.reverse())}}}function Oo(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function KE(e){const t={};let r=-1,a,s,l,u,f,h,d;const p=new Fz(e);for(;++r<p.length;){for(;r in t;)r=t[r];if(a=p.get(r),r&&a[1].type==="chunkFlow"&&p.get(r-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,Yz(p,r)),r=t[r],d=!0);else if(a[1]._container){for(l=r,s=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},f=p.slice(s,r),f.unshift(a),p.splice(s,r-s+1,f))}}return tr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function Yz(e,t){const r=e.get(t)[1],a=e.get(t)[2];let s=t-1;const l=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let p,g,y=-1,v=r,w=0,C=0;const N=[C];for(;v;){for(;e.get(++s)[1]!==v;);l.push(s),v._tokenizer||(p=a.sliceStream(v),v.next||p.push(null),g&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(C=y+1,N.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),y=N.length;y--;){const S=f.slice(N[y],N[y+1]),A=l.pop();h.push([A,A+S.length-1]),e.splice(A,2,S)}for(h.reverse(),y=-1;++y<h.length;)d[w+h[y][0]]=w+h[y][1],w+=h[y][1]-h[y][0]-1;return d}const $z={resolve:Xz,tokenize:Qz},Gz={partial:!0,tokenize:Kz};function Xz(e){return KE(e),e}function Qz(e,t){let r;return a;function a(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?l(f):Me(f)?e.check(Gz,u,l)(f):(e.consume(f),s)}function l(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function Kz(e,t,r){const a=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),rt(e,l,"linePrefix")}function l(u){if(u===null||Me(u))return r(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function ZE(e,t,r,a,s,l,u,f,h){const d=h||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(a),e.enter(s),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||Jp(S)?r(S):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),C(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(f),y(S)):S===null||S===60||Me(S)?r(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||nn(S))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(S)):p<d&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||Jp(S)?r(S):(e.consume(S),S===92?N:C)}function N(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function WE(e,t,r,a,s,l){const u=this;let f=0,h;return d;function d(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(l),p}function p(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(v):v===93?(e.exit(l),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Me(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Me(v)||f++>999?(e.exit("chunkString"),p(v)):(e.consume(v),h||(h=!Xe(v)),v===92?y:g)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function JE(e,t,r,a,s,l){let u;return f;function f(y){return y===34||y===39||y===40?(e.enter(a),e.enter(s),e.consume(y),e.exit(s),u=y===40?41:y,h):r(y)}function h(y){return y===u?(e.enter(s),e.consume(y),e.exit(s),e.exit(a),t):(e.enter(l),d(y))}function d(y){return y===u?(e.exit(l),h(u)):y===null?r(y):Me(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),rt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===u||y===null||Me(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?g:p)}function g(y){return y===u||y===92?(e.consume(y),p):p(y)}}function Fo(e,t){let r;return a;function a(s){return Me(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,a):Xe(s)?rt(e,a,r?"linePrefix":"lineSuffix")(s):t(s)}}const Zz={name:"definition",tokenize:Jz},Wz={partial:!0,tokenize:e5};function Jz(e,t,r){const a=this;let s;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return WE.call(a,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=fs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):r(v)}function h(v){return nn(v)?Fo(e,d)(v):d(v)}function d(v){return ZE(e,p,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Wz,g,g)(v)}function g(v){return Xe(v)?rt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Me(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):r(v)}}function e5(e,t,r){return a;function a(f){return nn(f)?Fo(e,s)(f):r(f)}function s(f){return JE(e,l,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return Xe(f)?rt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Me(f)?t(f):r(f)}}const t5={name:"hardBreakEscape",tokenize:n5};function n5(e,t,r){return a;function a(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Me(l)?(e.exit("hardBreakEscape"),t(l)):r(l)}}const r5={name:"headingAtx",resolve:i5,tokenize:a5};function i5(e,t){let r=e.length-2,a=3,s,l;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},l={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},tr(e,a,r-a+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function a5(e,t,r){let a=0;return s;function s(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&a++<6?(e.consume(p),u):p===null||nn(p)?(e.exit("atxHeadingSequence"),f(p)):r(p)}function f(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||Me(p)?(e.exit("atxHeading"),t(p)):Xe(p)?rt(e,f,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),f(p))}function d(p){return p===null||p===35||nn(p)?(e.exit("atxHeadingText"),f(p)):(e.consume(p),d)}}const s5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],v1=["pre","script","style","textarea"],o5={concrete:!0,name:"htmlFlow",resolveTo:c5,tokenize:f5},l5={partial:!0,tokenize:h5},u5={partial:!0,tokenize:d5};function c5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function f5(e,t,r){const a=this;let s,l,u,f,h;return d;function d(R){return p(R)}function p(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),g}function g(R){return R===33?(e.consume(R),y):R===47?(e.consume(R),l=!0,C):R===63?(e.consume(R),s=3,a.interrupt?t:j):Wn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function y(R){return R===45?(e.consume(R),s=2,v):R===91?(e.consume(R),s=5,f=0,w):Wn(R)?(e.consume(R),s=4,a.interrupt?t:j):r(R)}function v(R){return R===45?(e.consume(R),a.interrupt?t:j):r(R)}function w(R){const te="CDATA[";return R===te.charCodeAt(f++)?(e.consume(R),f===te.length?a.interrupt?t:Y:w):r(R)}function C(R){return Wn(R)?(e.consume(R),u=String.fromCharCode(R),N):r(R)}function N(R){if(R===null||R===47||R===62||nn(R)){const te=R===47,ue=u.toLowerCase();return!te&&!l&&v1.includes(ue)?(s=1,a.interrupt?t(R):Y(R)):s5.includes(u.toLowerCase())?(s=6,te?(e.consume(R),S):a.interrupt?t(R):Y(R)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(R):l?A(R):_(R))}return R===45||vn(R)?(e.consume(R),u+=String.fromCharCode(R),N):r(R)}function S(R){return R===62?(e.consume(R),a.interrupt?t:Y):r(R)}function A(R){return Xe(R)?(e.consume(R),A):q(R)}function _(R){return R===47?(e.consume(R),q):R===58||R===95||Wn(R)?(e.consume(R),k):Xe(R)?(e.consume(R),_):q(R)}function k(R){return R===45||R===46||R===58||R===95||vn(R)?(e.consume(R),k):H(R)}function H(R){return R===61?(e.consume(R),M):Xe(R)?(e.consume(R),H):_(R)}function M(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(e.consume(R),h=R,D):Xe(R)?(e.consume(R),M):P(R)}function D(R){return R===h?(e.consume(R),h=null,U):R===null||Me(R)?r(R):(e.consume(R),D)}function P(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||nn(R)?H(R):(e.consume(R),P)}function U(R){return R===47||R===62||Xe(R)?_(R):r(R)}function q(R){return R===62?(e.consume(R),I):r(R)}function I(R){return R===null||Me(R)?Y(R):Xe(R)?(e.consume(R),I):r(R)}function Y(R){return R===45&&s===2?(e.consume(R),T):R===60&&s===1?(e.consume(R),F):R===62&&s===4?(e.consume(R),z):R===63&&s===3?(e.consume(R),j):R===93&&s===5?(e.consume(R),Z):Me(R)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(l5,$,Q)(R)):R===null||Me(R)?(e.exit("htmlFlowData"),Q(R)):(e.consume(R),Y)}function Q(R){return e.check(u5,L,$)(R)}function L(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return R===null||Me(R)?Q(R):(e.enter("htmlFlowData"),Y(R))}function T(R){return R===45?(e.consume(R),j):Y(R)}function F(R){return R===47?(e.consume(R),u="",X):Y(R)}function X(R){if(R===62){const te=u.toLowerCase();return v1.includes(te)?(e.consume(R),z):Y(R)}return Wn(R)&&u.length<8?(e.consume(R),u+=String.fromCharCode(R),X):Y(R)}function Z(R){return R===93?(e.consume(R),j):Y(R)}function j(R){return R===62?(e.consume(R),z):R===45&&s===2?(e.consume(R),j):Y(R)}function z(R){return R===null||Me(R)?(e.exit("htmlFlowData"),$(R)):(e.consume(R),z)}function $(R){return e.exit("htmlFlow"),t(R)}}function d5(e,t,r){const a=this;return s;function s(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):r(u)}function l(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function h5(e,t,r){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(uf,t,r)}}const p5={name:"htmlText",tokenize:m5};function m5(e,t,r){const a=this;let s,l,u;return f;function f(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),H):j===63?(e.consume(j),_):Wn(j)?(e.consume(j),P):r(j)}function d(j){return j===45?(e.consume(j),p):j===91?(e.consume(j),l=0,w):Wn(j)?(e.consume(j),A):r(j)}function p(j){return j===45?(e.consume(j),v):r(j)}function g(j){return j===null?r(j):j===45?(e.consume(j),y):Me(j)?(u=g,F(j)):(e.consume(j),g)}function y(j){return j===45?(e.consume(j),v):g(j)}function v(j){return j===62?T(j):j===45?y(j):g(j)}function w(j){const z="CDATA[";return j===z.charCodeAt(l++)?(e.consume(j),l===z.length?C:w):r(j)}function C(j){return j===null?r(j):j===93?(e.consume(j),N):Me(j)?(u=C,F(j)):(e.consume(j),C)}function N(j){return j===93?(e.consume(j),S):C(j)}function S(j){return j===62?T(j):j===93?(e.consume(j),S):C(j)}function A(j){return j===null||j===62?T(j):Me(j)?(u=A,F(j)):(e.consume(j),A)}function _(j){return j===null?r(j):j===63?(e.consume(j),k):Me(j)?(u=_,F(j)):(e.consume(j),_)}function k(j){return j===62?T(j):_(j)}function H(j){return Wn(j)?(e.consume(j),M):r(j)}function M(j){return j===45||vn(j)?(e.consume(j),M):D(j)}function D(j){return Me(j)?(u=D,F(j)):Xe(j)?(e.consume(j),D):T(j)}function P(j){return j===45||vn(j)?(e.consume(j),P):j===47||j===62||nn(j)?U(j):r(j)}function U(j){return j===47?(e.consume(j),T):j===58||j===95||Wn(j)?(e.consume(j),q):Me(j)?(u=U,F(j)):Xe(j)?(e.consume(j),U):T(j)}function q(j){return j===45||j===46||j===58||j===95||vn(j)?(e.consume(j),q):I(j)}function I(j){return j===61?(e.consume(j),Y):Me(j)?(u=I,F(j)):Xe(j)?(e.consume(j),I):U(j)}function Y(j){return j===null||j===60||j===61||j===62||j===96?r(j):j===34||j===39?(e.consume(j),s=j,Q):Me(j)?(u=Y,F(j)):Xe(j)?(e.consume(j),Y):(e.consume(j),L)}function Q(j){return j===s?(e.consume(j),s=void 0,V):j===null?r(j):Me(j)?(u=Q,F(j)):(e.consume(j),Q)}function L(j){return j===null||j===34||j===39||j===60||j===61||j===96?r(j):j===47||j===62||nn(j)?U(j):(e.consume(j),L)}function V(j){return j===47||j===62||nn(j)?U(j):r(j)}function T(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):r(j)}function F(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),X}function X(j){return Xe(j)?rt(e,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):Z(j)}function Z(j){return e.enter("htmlTextData"),u(j)}}const ng={name:"labelEnd",resolveAll:v5,resolveTo:b5,tokenize:w5},g5={tokenize:S5},y5={tokenize:E5},x5={tokenize:C5};function v5(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==r.length&&tr(e,0,e.length,r),e}function b5(e,t){let r=e.length,a=0,s,l,u,f;for(;r--;)if(s=e[r][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=r,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(u=r);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=Rn(f,e.slice(l+1,l+a+3)),f=Rn(f,[["enter",p,t]]),f=Rn(f,tg(t.parser.constructs.insideSpan.null,e.slice(l+a+4,u-3),t)),f=Rn(f,[["exit",p,t],e[u-2],e[u-1],["exit",d,t]]),f=Rn(f,e.slice(u+1)),f=Rn(f,[["exit",h,t]]),tr(e,l,e.length,f),e}function w5(e,t,r){const a=this;let s=a.events.length,l,u;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){l=a.events[s][1];break}return f;function f(y){return l?l._inactive?g(y):(u=a.parser.defined.includes(fs(a.sliceSerialize({start:l.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),h):r(y)}function h(y){return y===40?e.attempt(g5,p,u?p:g)(y):y===91?e.attempt(y5,p,u?d:g)(y):u?p(y):g(y)}function d(y){return e.attempt(x5,p,g)(y)}function p(y){return t(y)}function g(y){return l._balanced=!0,r(y)}}function S5(e,t,r){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return nn(g)?Fo(e,l)(g):l(g)}function l(g){return g===41?p(g):ZE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return nn(g)?Fo(e,h)(g):p(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?JE(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function d(g){return nn(g)?Fo(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function E5(e,t,r){const a=this;return s;function s(f){return WE.call(a,e,l,u,"reference","referenceMarker","referenceString")(f)}function l(f){return a.parser.defined.includes(fs(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function u(f){return r(f)}}function C5(e,t,r){return a;function a(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):r(l)}}const _5={name:"labelStartImage",resolveAll:ng.resolveAll,tokenize:N5};function N5(e,t,r){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),l}function l(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):t(f)}}const k5={name:"labelStartLink",resolveAll:ng.resolveAll,tokenize:M5};function M5(e,t,r){const a=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):t(u)}}const sp={name:"lineEnding",tokenize:T5};function T5(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),rt(e,t,"linePrefix")}}const bc={name:"thematicBreak",tokenize:A5};function A5(e,t,r){let a=0,s;return l;function l(d){return e.enter("thematicBreak"),u(d)}function u(d){return s=d,f(d)}function f(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):a>=3&&(d===null||Me(d))?(e.exit("thematicBreak"),t(d)):r(d)}function h(d){return d===s?(e.consume(d),a++,h):(e.exit("thematicBreakSequence"),Xe(d)?rt(e,f,"whitespace")(d):f(d))}}const Zt={continuation:{tokenize:D5},exit:L5,name:"list",tokenize:O5},R5={partial:!0,tokenize:I5},j5={partial:!0,tokenize:z5};function O5(e,t,r){const a=this,s=a.events[a.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(v){const w=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:em(v)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(bc,r,d)(v):d(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return r(v)}function h(v){return em(v)&&++u<10?(e.consume(v),h):(!a.interrupt||u<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):r(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(uf,a.interrupt?r:p,e.attempt(R5,y,g))}function p(v){return a.containerState.initialBlankLine=!0,l++,y(v)}function g(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):r(v)}function y(v){return a.containerState.size=l+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function D5(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(uf,s,l);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,rt(e,t,"listItemIndent",a.containerState.size+1)(f)}function l(f){return a.containerState.furtherBlankLines||!Xe(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(j5,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,rt(e,e.attempt(Zt,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function z5(e,t,r){const a=this;return rt(e,s,"listItemIndent",a.containerState.size+1);function s(l){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(l):r(l)}}function L5(e){e.exit(this.containerState.type)}function I5(e,t,r){const a=this;return rt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const u=a.events[a.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):r(l)}}const b1={name:"setextUnderline",resolveTo:B5,tokenize:H5};function B5(e,t){let r=e.length,a,s,l;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!l&&e[r][1].type==="definition"&&(l=r);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",u,t]),e.splice(l+1,0,["exit",e[a][1],t]),e[a][1].end={...e[l][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function H5(e,t,r){const a=this;let s;return l;function l(d){let p=a.events.length,g;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){g=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=d,u(d)):r(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===s?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Xe(d)?rt(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Me(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const P5={tokenize:U5};function U5(e){const t=this,r=e.attempt(uf,a,e.attempt(this.parser.constructs.flowInitial,s,rt(e,e.attempt(this.parser.constructs.flow,s,e.attempt($z,s)),"linePrefix")));return r;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const V5={resolveAll:tC()},q5=eC("string"),F5=eC("text");function eC(e){return{resolveAll:tC(e==="text"?Y5:void 0),tokenize:t};function t(r){const a=this,s=this.parser.constructs[e],l=r.attempt(s,u,f);return u;function u(p){return d(p)?l(p):f(p)}function f(p){if(p===null){r.consume(p);return}return r.enter("data"),r.consume(p),h}function h(p){return d(p)?(r.exit("data"),l(p)):(r.consume(p),h)}function d(p){if(p===null)return!0;const g=s[p];let y=-1;if(g)for(;++y<g.length;){const v=g[y];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function tC(e){return t;function t(r,a){let s=-1,l;for(;++s<=r.length;)l===void 0?r[s]&&r[s][1].type==="data"&&(l=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==l+2&&(r[l][1].end=r[s-1][1].end,r.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(r,a):r}}function Y5(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],s=t.sliceStream(a);let l=s.length,u=-1,f=0,h;for(;l--;){const d=s[l];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:a.start._bufferIndex+u,_index:a.start._index+l,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const $5={42:Zt,43:Zt,45:Zt,48:Zt,49:Zt,50:Zt,51:Zt,52:Zt,53:Zt,54:Zt,55:Zt,56:Zt,57:Zt,62:GE},G5={91:Zz},X5={[-2]:ap,[-1]:ap,32:ap},Q5={35:r5,42:bc,45:[b1,bc],60:o5,61:b1,95:bc,96:x1,126:x1},K5={38:QE,92:XE},Z5={[-5]:sp,[-4]:sp,[-3]:sp,33:_5,38:QE,42:tm,60:[kz,p5],91:k5,92:[t5,XE],93:ng,95:tm,96:Pz},W5={null:[tm,V5]},J5={null:[42,95]},eL={null:[]},tL=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J5,contentInitial:G5,disable:eL,document:$5,flow:Q5,flowInitial:X5,insideSpan:W5,string:K5,text:Z5},Symbol.toStringTag,{value:"Module"}));function nL(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},l=[];let u=[],f=[];const h={attempt:D(H),check:D(M),consume:A,enter:_,exit:k,interrupt:D(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:g};let p=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function g(I){return u=Rn(u,I),N(),u[u.length-1]!==null?[]:(P(t,0),d.events=tg(l,d.events,d),d.events)}function y(I,Y){return iL(v(I),Y)}function v(I){return rL(u,I)}function w(){const{_bufferIndex:I,_index:Y,line:Q,column:L,offset:V}=a;return{_bufferIndex:I,_index:Y,line:Q,column:L,offset:V}}function C(I){s[I.line]=I.column,q()}function N(){let I;for(;a._index<u.length;){const Y=u[a._index];if(typeof Y=="string")for(I=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===I&&a._bufferIndex<Y.length;)S(Y.charCodeAt(a._bufferIndex));else S(Y)}}function S(I){p=p(I)}function A(I){Me(I)?(a.line++,a.column=1,a.offset+=I===-3?2:1,q()):I!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=I}function _(I,Y){const Q=Y||{};return Q.type=I,Q.start=w(),d.events.push(["enter",Q,d]),f.push(Q),Q}function k(I){const Y=f.pop();return Y.end=w(),d.events.push(["exit",Y,d]),Y}function H(I,Y){P(I,Y.from)}function M(I,Y){Y.restore()}function D(I,Y){return Q;function Q(L,V,T){let F,X,Z,j;return Array.isArray(L)?$(L):"tokenize"in L?$([L]):z(L);function z(fe){return de;function de(le){const pe=le!==null&&fe[le],we=le!==null&&fe.null,Ee=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(we)?we:we?[we]:[]];return $(Ee)(le)}}function $(fe){return F=fe,X=0,fe.length===0?T:R(fe[X])}function R(fe){return de;function de(le){return j=U(),Z=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ue():fe.tokenize.call(Y?Object.assign(Object.create(d),Y):d,h,te,ue)(le)}}function te(fe){return I(Z,j),V}function ue(fe){return j.restore(),++X<F.length?R(F[X]):T}}}function P(I,Y){I.resolveAll&&!l.includes(I)&&l.push(I),I.resolve&&tr(d.events,Y,d.events.length-Y,I.resolve(d.events.slice(Y),d)),I.resolveTo&&(d.events=I.resolveTo(d.events,d))}function U(){const I=w(),Y=d.previous,Q=d.currentConstruct,L=d.events.length,V=Array.from(f);return{from:L,restore:T};function T(){a=I,d.previous=Y,d.currentConstruct=Q,d.events.length=L,f=V,q()}}function q(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function rL(e,t){const r=t.start._index,a=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let u;if(r===s)u=[e[r].slice(a,l)];else{if(u=e.slice(r,s),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}l>0&&u.push(e[s].slice(0,l))}return u}function iL(e,t){let r=-1;const a=[];let s;for(;++r<e.length;){const l=e[r];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
|
|
17
|
-
`;break}case-3:{u=`\r
|
|
18
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(l)}s=l===-2,a.push(u)}return a.join("")}function aL(e){const a={constructs:dz([tL,...(e||{}).extensions||[]]),content:s(bz),defined:[],document:s(Sz),flow:s(P5),lazy:{},string:s(q5),text:s(F5)};return a;function s(l){return u;function u(f){return nL(a,l,f)}}}function sL(e){for(;!KE(e););return e}const w1=/[\0\t\n\r]/g;function oL(){let e=1,t="",r=!0,a;return s;function s(l,u,f){const h=[];let d,p,g,y,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),g=0,t="",r&&(l.charCodeAt(0)===65279&&g++,r=void 0);g<l.length;){if(w1.lastIndex=g,d=w1.exec(l),y=d&&d.index!==void 0?d.index:l.length,v=l.charCodeAt(y),!d){t=l.slice(g);break}if(v===10&&g===y&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),g<y&&(h.push(l.slice(g,y)),e+=y-g),v){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}g=y+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const lL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uL(e){return e.replace(lL,cL)}function cL(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),l=s===120||s===88;return $E(r.slice(l?2:1),l?16:10)}return eg(r)||e}const nC={}.hasOwnProperty;function fL(e,t,r){return typeof t!="string"&&(r=t,t=void 0),dL(r)(sL(aL(r).document().write(oL()(e,t,!0))))}function dL(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Fe),autolinkProtocol:U,autolinkEmail:U,atxHeading:l(ge),blockQuote:l(we),characterEscape:U,characterReference:U,codeFenced:l(Ee),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Ee,u),codeText:l(ve,u),codeTextData:U,data:U,codeFlowValue:U,definition:l(Ce),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(ce),hardBreakEscape:l(be),hardBreakTrailing:l(be),htmlFlow:l(De,u),htmlFlowData:U,htmlText:l(De,u),htmlTextData:U,image:l(qe),label:u,link:l(Fe),listItem:l(Ot),listItemValue:y,listOrdered:l(_t,g),listUnordered:l(_t),paragraph:l(sn),reference:R,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ge),strong:l(wn),thematicBreak:l(ct)},exit:{atxHeading:h(),atxHeadingSequence:H,autolink:h(),autolinkEmail:pe,autolinkProtocol:le,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:fe,characterReference:de,codeFenced:h(N),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:h(S),codeText:h(V),codeTextData:q,data:q,definition:h(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(Q),htmlFlowData:q,htmlText:h(L),htmlTextData:q,image:h(F),label:Z,labelText:X,lineEnding:I,link:h(T),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:te,resourceDestinationString:j,resourceTitleString:z,resource:$,setextHeading:h(P),setextHeadingLineSequence:D,setextHeadingText:M,strong:h(),thematicBreak:h()}};rC(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(ie){let me={type:"root",children:[]};const Ne={stack:[me],tokenStack:[],config:t,enter:f,exit:d,buffer:u,resume:p,data:r},ze=[];let Ue=-1;for(;++Ue<ie.length;)if(ie[Ue][1].type==="listOrdered"||ie[Ue][1].type==="listUnordered")if(ie[Ue][0]==="enter")ze.push(Ue);else{const Ht=ze.pop();Ue=s(ie,Ht,Ue)}for(Ue=-1;++Ue<ie.length;){const Ht=t[ie[Ue][0]];nC.call(Ht,ie[Ue][1].type)&&Ht[ie[Ue][1].type].call(Object.assign({sliceSerialize:ie[Ue][2].sliceSerialize},Ne),ie[Ue][1])}if(Ne.tokenStack.length>0){const Ht=Ne.tokenStack[Ne.tokenStack.length-1];(Ht[1]||S1).call(Ne,void 0,Ht[0])}for(me.position={start:oi(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:oi(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<t.transforms.length;)me=t.transforms[Ue](me)||me;return me}function s(ie,me,Ne){let ze=me-1,Ue=-1,Ht=!1,jn,kt,ht,Dt;for(;++ze<=Ne;){const Qe=ie[ze];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?Ue++:Ue--,Dt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(jn&&!Dt&&!Ue&&!ht&&(ht=ze),Dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dt=void 0}if(!Ue&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||Ue===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(jn){let Vn=ze;for(kt=void 0;Vn--;){const on=ie[Vn];if(on[1].type==="lineEnding"||on[1].type==="lineEndingBlank"){if(on[0]==="exit")continue;kt&&(ie[kt][1].type="lineEndingBlank",Ht=!0),on[1].type="lineEnding",kt=Vn}else if(!(on[1].type==="linePrefix"||on[1].type==="blockQuotePrefix"||on[1].type==="blockQuotePrefixWhitespace"||on[1].type==="blockQuoteMarker"||on[1].type==="listItemIndent"))break}ht&&(!kt||ht<kt)&&(jn._spread=!0),jn.end=Object.assign({},kt?ie[kt][1].start:Qe[1].end),ie.splice(kt||ze,0,["exit",jn,Qe[2]]),ze++,Ne++}if(Qe[1].type==="listItemPrefix"){const Vn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};jn=Vn,ie.splice(ze,0,["enter",Vn,Qe[2]]),ze++,Ne++,ht=void 0,Dt=!0}}}return ie[me][1]._spread=Ht,Ne}function l(ie,me){return Ne;function Ne(ze){f.call(this,ie(ze),ze),me&&me.call(this,ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ie,me,Ne){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([me,Ne||void 0]),ie.position={start:oi(me.start),end:void 0}}function h(ie){return me;function me(Ne){ie&&ie.call(this,Ne),d.call(this,Ne)}}function d(ie,me){const Ne=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==ie.type&&(me?me.call(this,ie,ze[0]):(ze[1]||S1).call(this,ie,ze[0]));else throw new Error("Cannot close `"+ie.type+"` ("+qo({start:ie.start,end:ie.end})+"): it’s not open");Ne.position.end=oi(ie.end)}function p(){return cz(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(ie){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.lang=ie}function w(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/(\r?\n|\r)$/g,"")}function A(ie){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=fs(this.sliceSerialize(ie)).toLowerCase()}function _(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function k(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function H(ie){const me=this.stack[this.stack.length-1];if(!me.depth){const Ne=this.sliceSerialize(ie).length;me.depth=Ne}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function U(ie){const Ne=this.stack[this.stack.length-1].children;let ze=Ne[Ne.length-1];(!ze||ze.type!=="text")&&(ze=Te(),ze.position={start:oi(ie.start),end:void 0},Ne.push(ze)),this.stack.push(ze)}function q(ie){const me=this.stack.pop();me.value+=this.sliceSerialize(ie),me.position.end=oi(ie.end)}function I(ie){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=me.children[me.children.length-1];Ne.position.end=oi(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(U.call(this,ie),q.call(this,ie))}function Y(){this.data.atHardBreak=!0}function Q(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function L(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function V(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function T(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function F(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(ie){const me=this.sliceSerialize(ie),Ne=this.stack[this.stack.length-2];Ne.label=uL(me),Ne.identifier=fs(me).toLowerCase()}function Z(){const ie=this.stack[this.stack.length-1],me=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const ze=ie.children;Ne.children=ze}else Ne.alt=me}function j(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function z(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function $(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function te(ie){const me=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=me,Ne.identifier=fs(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function ue(ie){this.data.characterReferenceType=ie.type}function fe(ie){const me=this.sliceSerialize(ie),Ne=this.data.characterReferenceType;let ze;Ne?(ze=$E(me,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=eg(me);const Ue=this.stack[this.stack.length-1];Ue.value+=ze}function de(ie){const me=this.stack.pop();me.position.end=oi(ie.end)}function le(ie){q.call(this,ie);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ie)}function pe(ie){q.call(this,ie);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ie)}function we(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function ge(){return{type:"heading",depth:0,children:[]}}function be(){return{type:"break"}}function De(){return{type:"html",value:""}}function qe(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function _t(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Ot(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function sn(){return{type:"paragraph",children:[]}}function wn(){return{type:"strong",children:[]}}function Te(){return{type:"text",value:""}}function ct(){return{type:"thematicBreak"}}}function oi(e){return{line:e.line,column:e.column,offset:e.offset}}function rC(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?rC(e,a):hL(e,a)}}function hL(e,t){let r;for(r in t)if(nC.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function S1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+qo({start:t.start,end:t.end})+") is still open")}function pL(e){const t=this;t.parser=r;function r(a){return fL(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function mL(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function gL(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
19
|
-
`}]}function yL(e,t){const r=t.value?t.value+`
|
|
20
|
-
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function xL(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vL(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bL(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Ns(a.toLowerCase()),l=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=l+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function wL(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SL(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function iC(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=a:s.push({type:"text",value:a}),s}function EL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return iC(e,t);const s={src:Ns(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function CL(e,t){const r={src:Ns(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function _L(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function NL(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return iC(e,t);const s={href:Ns(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function kL(e,t){const r={href:Ns(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function ML(e,t,r){const a=e.all(t),s=r?TL(r):aC(t),l={},u=[];if(typeof t.checked=="boolean"){const p=a[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const p=a[f];(s||f!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
|
|
21
|
-
`}),p.type==="element"&&p.tagName==="p"&&!s?u.push(...p.children):u.push(p)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
22
|
-
`});const d={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,d),e.applyData(t,d)}function TL(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=aC(r[a])}return t}function aC(e){const t=e.spread;return t??e.children.length>1}function AL(e,t){const r={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++s<a.length;){const u=a[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function RL(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jL(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function OL(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function DL(e,t){const r=e.all(t),a=r.shift(),s=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),s.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Km(t.children[1]),h=HE(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),s.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function zL(e,t,r){const a=r?r.children:void 0,l=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const g=t.children[h],y={},v=u?u[h]:void 0;v&&(y.align=v);let w={type:"element",tagName:l,properties:y,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function LL(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const E1=9,C1=32;function IL(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),s=0;const l=[];for(;a;)l.push(_1(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=r.exec(t);return l.push(_1(t.slice(s),s>0,!1)),l.join("")}function _1(e,t,r){let a=0,s=e.length;if(t){let l=e.codePointAt(a);for(;l===E1||l===C1;)a++,l=e.codePointAt(a)}if(r){let l=e.codePointAt(s-1);for(;l===E1||l===C1;)s--,l=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function BL(e,t){const r={type:"text",value:IL(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function HL(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const PL={blockquote:mL,break:gL,code:yL,delete:xL,emphasis:vL,footnoteReference:bL,heading:wL,html:SL,imageReference:EL,image:CL,inlineCode:_L,linkReference:NL,link:kL,listItem:ML,list:AL,paragraph:RL,root:jL,strong:OL,table:DL,tableCell:LL,tableRow:zL,text:BL,thematicBreak:HL,toml:sc,yaml:sc,definition:sc,footnoteDefinition:sc};function sc(){}const sC=-1,cf=0,Yo=1,Uc=2,rg=3,ig=4,ag=5,sg=6,oC=7,lC=8,N1=typeof self=="object"?self:globalThis,UL=(e,t)=>{const r=(s,l)=>(e.set(l,s),s),a=s=>{if(e.has(s))return e.get(s);const[l,u]=t[s];switch(l){case cf:case sC:return r(u,s);case Yo:{const f=r([],s);for(const h of u)f.push(a(h));return f}case Uc:{const f=r({},s);for(const[h,d]of u)f[a(h)]=a(d);return f}case rg:return r(new Date(u),s);case ig:{const{source:f,flags:h}=u;return r(new RegExp(f,h),s)}case ag:{const f=r(new Map,s);for(const[h,d]of u)f.set(a(h),a(d));return f}case sg:{const f=r(new Set,s);for(const h of u)f.add(a(h));return f}case oC:{const{name:f,message:h}=u;return r(new N1[f](h),s)}case lC:return r(BigInt(u),s);case"BigInt":return r(Object(BigInt(u)),s);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new N1[l](u),s)};return a},k1=e=>UL(new Map,e)(0),ts="",{toString:VL}={},{keys:qL}=Object,Do=e=>{const t=typeof e;if(t!=="object"||!e)return[cf,t];const r=VL.call(e).slice(8,-1);switch(r){case"Array":return[Yo,ts];case"Object":return[Uc,ts];case"Date":return[rg,ts];case"RegExp":return[ig,ts];case"Map":return[ag,ts];case"Set":return[sg,ts];case"DataView":return[Yo,r]}return r.includes("Array")?[Yo,r]:r.includes("Error")?[oC,r]:[Uc,r]},oc=([e,t])=>e===cf&&(t==="function"||t==="symbol"),FL=(e,t,r,a)=>{const s=(u,f)=>{const h=a.push(u)-1;return r.set(f,h),h},l=u=>{if(r.has(u))return r.get(u);let[f,h]=Do(u);switch(f){case cf:{let p=u;switch(h){case"bigint":f=lC,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return s([sC],u)}return s([f,p],u)}case Yo:{if(h){let y=u;return h==="DataView"?y=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(y=new Uint8Array(u)),s([h,[...y]],u)}const p=[],g=s([f,p],u);for(const y of u)p.push(l(y));return g}case Uc:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],g=s([f,p],u);for(const y of qL(u))(e||!oc(Do(u[y])))&&p.push([l(y),l(u[y])]);return g}case rg:return s([f,u.toISOString()],u);case ig:{const{source:p,flags:g}=u;return s([f,{source:p,flags:g}],u)}case ag:{const p=[],g=s([f,p],u);for(const[y,v]of u)(e||!(oc(Do(y))||oc(Do(v))))&&p.push([l(y),l(v)]);return g}case sg:{const p=[],g=s([f,p],u);for(const y of u)(e||!oc(Do(y)))&&p.push(l(y));return g}}const{message:d}=u;return s([f,{name:h,message:d}],u)};return l},M1=(e,{json:t,lossy:r}={})=>{const a=[];return FL(!(t||r),!!t,new Map,a)(e),a},Vc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?k1(M1(e,t)):structuredClone(e):(e,t)=>k1(M1(e,t));function YL(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function $L(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||YL,a=e.options.footnoteBackLabel||$L,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const p=e.all(d),g=String(d.identifier).toUpperCase(),y=Ns(g.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let A=typeof r=="string"?r:r(h,v);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const A=N.children[N.children.length-1];A&&A.type==="text"?A.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(d,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Vc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
23
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
24
|
-
`}]}}const uC=(function(e){if(e==null)return ZL;if(typeof e=="function")return ff(e);if(typeof e=="object")return Array.isArray(e)?XL(e):QL(e);if(typeof e=="string")return KL(e);throw new Error("Expected function, string, or object as test")});function XL(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=uC(e[r]);return ff(a);function a(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function QL(e){const t=e;return ff(r);function r(a){const s=a;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function KL(e){return ff(t);function t(r){return r&&r.type===e}}function ff(e){return t;function t(r,a,s){return!!(WL(r)&&e.call(this,r,typeof a=="number"?a:void 0,s||void 0))}}function ZL(){return!0}function WL(e){return e!==null&&typeof e=="object"&&"type"in e}const cC=[],JL=!0,T1=!1,e6="skip";function t6(e,t,r,a){let s;typeof t=="function"&&typeof r!="function"?(a=r,r=t):s=t;const l=uC(s),u=a?-1:1;f(e,void 0,[])();function f(h,d,p){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=cC,w,C,N;if((!t||l(h,d,p[p.length-1]||void 0))&&(v=n6(r(h,p)),v[0]===T1))return v;if("children"in h&&h.children){const S=h;if(S.children&&v[0]!==e6)for(C=(a?S.children.length:-1)+u,N=p.concat(S);C>-1&&C<S.children.length;){const A=S.children[C];if(w=f(A,C,N)(),w[0]===T1)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function n6(e){return Array.isArray(e)?e:typeof e=="number"?[JL,e]:e==null?cC:[e]}function fC(e,t,r,a){let s,l,u;typeof t=="function"&&typeof r!="function"?(l=void 0,u=t,s=r):(l=t,u=r,s=a),t6(e,l,f,s);function f(h,d){const p=d[d.length-1],g=p?p.children.indexOf(h):void 0;return u(h,g,p)}}const nm={}.hasOwnProperty,r6={};function i6(e,t){const r=t||r6,a=new Map,s=new Map,l=new Map,u={...PL,...r.handlers},f={all:d,applyData:s6,definitionById:a,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:u,one:h,options:r,patch:a6,wrap:l6};return fC(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:s,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),f;function h(p,g){const y=p.type,v=f.handlers[y];if(nm.call(f.handlers,y)&&v)return v(f,p,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in p){const{children:C,...N}=p,S=Vc(N);return S.children=f.all(p),S}return Vc(p)}return(f.options.unknownHandler||o6)(f,p,g)}function d(p){const g=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=f.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=A1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=A1(C.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function a6(e,t){e.position&&(t.position=VD(e))}function s6(e,t){let r=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&l&&Object.assign(r.properties,Vc(l)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function o6(e,t){const r=t.data||{},a="value"in t&&!(nm.call(r,"hProperties")||nm.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function l6(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
|
|
25
|
-
`});++a<e.length;)a&&r.push({type:"text",value:`
|
|
26
|
-
`}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
27
|
-
`}),r}function A1(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function R1(e,t){const r=i6(e,t),a=r.one(e,void 0),s=GL(r),l=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
28
|
-
`},s),l}function u6(e,t){return e&&"run"in e?async function(r,a){const s=R1(r,{file:a,...t});await e.run(s,a)}:function(r,a){return R1(r,{file:a,...e||t})}}function j1(e){if(e)throw e}var op,O1;function c6(){if(O1)return op;O1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!g)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},u=function(d,p){r&&p.name==="__proto__"?r(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},f=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(a)return a(d,p).value}else return;return d[p]};return op=function h(){var d,p,g,y,v,w,C=arguments[0],N=1,S=arguments.length,A=!1;for(typeof C=="boolean"&&(A=C,C=arguments[1]||{},N=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});N<S;++N)if(d=arguments[N],d!=null)for(p in d)g=f(C,p),y=f(d,p),C!==y&&(A&&y&&(l(y)||(v=s(y)))?(v?(v=!1,w=g&&s(g)?g:[]):w=g&&l(g)?g:{},u(C,{name:p,newValue:h(A,w,y)})):typeof y<"u"&&u(C,{name:p,newValue:y}));return C},op}var f6=c6();const lp=Fc(f6);function rm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function d6(){const e=[],t={run:r,use:a};return t;function r(...s){let l=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...d){const p=e[++l];let g=-1;if(h){u(h);return}for(;++g<s.length;)(d[g]===null||d[g]===void 0)&&(d[g]=s[g]);s=d,p?h6(p,f)(...d):u(null,...d)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function h6(e,t){let r;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(d){const p=d;if(f&&r)throw p;return s(p)}f||(h&&h.then&&typeof h.then=="function"?h.then(l,s):h instanceof Error?s(h):l(h))}function s(u,...f){r||(r=!0,t(u,...f))}function l(u){s(null,u)}}const Qn={basename:p6,dirname:m6,extname:g6,join:y6,sep:"/"};function p6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');El(e);let r=0,a=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){r=s+1;break}}else a<0&&(l=!0,a=s+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){r=s+1;break}}else u<0&&(l=!0,u=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(a=s):(f=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function m6(e){if(El(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function g6(e){El(e);let t=e.length,r=-1,a=0,s=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),f===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||r<0||l===0||l===1&&s===r-1&&s===a+1?"":e.slice(s,r)}function y6(...e){let t=-1,r;for(;++t<e.length;)El(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":x6(r)}function x6(e){El(e);const t=e.codePointAt(0)===47;let r=v6(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function v6(e,t){let r="",a=0,s=-1,l=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||l===1))if(s!==u-1&&l===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",a=0):(r=r.slice(0,h),a=r.length-1-r.lastIndexOf("/")),s=u,l=0;continue}}else if(r.length>0){r="",a=0,s=u,l=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(s+1,u):r=e.slice(s+1,u),a=u-s-1;s=u,l=0}else f===46&&l>-1?l++:l=-1}return r}function El(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const b6={cwd:w6};function w6(){return"/"}function im(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S6(e){if(typeof e=="string")e=new URL(e);else if(!im(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return E6(e)}function E6(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const up=["history","path","basename","stem","extname","dirname"];class dC{constructor(t){let r;t?im(t)?r={path:t}:typeof t=="string"||C6(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":b6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<up.length;){const l=up[a];l in r&&r[l]!==void 0&&r[l]!==null&&(this[l]=l==="history"?[...r[l]]:r[l])}let s;for(s in r)up.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(t){fp(t,"basename"),cp(t,"basename"),this.path=Qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(t){D1(this.basename,"dirname"),this.path=Qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(t){if(cp(t,"extname"),D1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){im(t)&&(t=S6(t)),fp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(t){fp(t,"stem"),cp(t,"stem"),this.path=Qn.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const s=this.message(t,r,a);throw s.fatal=!0,s}info(t,r,a){const s=this.message(t,r,a);return s.fatal=void 0,s}message(t,r,a){const s=new Bt(t,r,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function cp(e,t){if(e&&e.includes(Qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qn.sep+"`")}function fp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function D1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function C6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _6=(function(e){const a=this.constructor.prototype,s=a[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,a),l}),N6={}.hasOwnProperty;class og extends _6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=d6()}copy(){const t=new og;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(lp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(pp("data",this.frozen),this.namespace[t]=r,this):N6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(pp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=r.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=lc(t),a=this.parser||this.Parser;return dp("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),dp("process",this.parser||this.Parser),hp("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(l,u){const f=lc(t),h=a.parse(f);a.run(h,f,function(p,g,y){if(p||!g||!y)return d(p);const v=g,w=a.stringify(v,y);T6(w)?y.value=w:y.result=w,d(p,y)});function d(p,g){p||!g?u(p):l?l(g):r(void 0,g)}}}processSync(t){let r=!1,a;return this.freeze(),dp("processSync",this.parser||this.Parser),hp("processSync",this.compiler||this.Compiler),this.process(t,s),L1("processSync","process",r),a;function s(l,u){r=!0,j1(l),a=u}}run(t,r,a){z1(t),this.freeze();const s=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?l(void 0,a):new Promise(l);function l(u,f){const h=lc(r);s.run(t,h,d);function d(p,g,y){const v=g||t;p?f(p):u?u(v):a(void 0,v,y)}}}runSync(t,r){let a=!1,s;return this.run(t,r,l),L1("runSync","run",a),s;function l(u,f){j1(u),s=f,a=!0}}stringify(t,r){this.freeze();const a=lc(r),s=this.compiler||this.Compiler;return hp("stringify",s),z1(t),s(t,a)}use(t,...r){const a=this.attachers,s=this.namespace;if(pp("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...g]=d;h(p,g)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(s.settings=lp(!0,s.settings,d.settings))}function f(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const g=d[p];l(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,p){let g=-1,y=-1;for(;++g<a.length;)if(a[g][0]===d){y=g;break}if(y===-1)a.push([d,...p]);else if(p.length>0){let[v,...w]=p;const C=a[y][1];rm(C)&&rm(v)&&(v=lp(!0,C,v)),a[y]=[d,v,...w]}}}}const k6=new og().freeze();function dp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function z1(e){if(!rm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L1(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lc(e){return M6(e)?e:new dC(e)}function M6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function T6(e){return typeof e=="string"||A6(e)}function A6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const R6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I1=[],B1={allowDangerousHtml:!0},j6=/^(https?|ircs?|mailto|xmpp)$/i,O6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function D6(e){const t=z6(e),r=L6(e);return I6(t.runSync(t.parse(r),r),e)}function z6(e){const t=e.rehypePlugins||I1,r=e.remarkPlugins||I1,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...B1}:B1;return k6().use(pL).use(r).use(u6,a).use(t)}function L6(e){const t=e.children||"",r=new dC;return typeof t=="string"&&(r.value=t),r}function I6(e,t){const r=t.allowedElements,a=t.allowElement,s=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||B6;for(const p of O6)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+R6+p.id,void 0);return fC(e,d),GD(e,{Fragment:b.Fragment,components:s,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(p,g,y){if(p.type==="raw"&&y&&typeof g=="number")return u?y.children.splice(g,1):y.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let v;for(v in ip)if(Object.hasOwn(ip,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=ip[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=h(String(w||""),v,p))}}if(p.type==="element"){let v=r?!r.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&a&&typeof g=="number"&&(v=!a(p,g,y)),v&&y&&typeof g=="number")return f&&p.children?y.children.splice(g,1,...p.children):y.children.splice(g,1),g}}}function B6(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||r!==-1&&t>r||a!==-1&&t>a||j6.test(e.slice(0,t))?e:""}function hC({children:e,className:t}){return b.jsx("div",{className:`markdown-view ${t??""}`,children:b.jsx(D6,{children:e})})}function H6({sessionId:e,nodeId:t,runStatus:r="complete",currentNodeId:a=null}){const{data:s,isLoading:l,error:u}=EM(e,t);return t?b.jsxs("div",{children:[b.jsx(P6,{stepLabel:s?.stepLabel??null,nodeId:t}),b.jsxs("div",{className:"p-4 space-y-4",children:[l&&b.jsx("div",{className:"text-[var(--text-secondary)] text-sm",children:"Loading..."}),u&&b.jsx("div",{className:"text-[var(--error)] text-sm bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:u.message}),s&&b.jsx(V6,{detail:s,runStatus:r,currentNodeId:a})]})]}):b.jsx("div",{className:"px-5 py-8 text-sm text-[var(--text-secondary)]",children:"Select a node in the lineage to inspect its recap, validations, gaps, and artifacts."})}function P6({stepLabel:e,nodeId:t}){return b.jsxs("div",{className:"px-5 py-4 border-b border-[var(--border)] console-blueprint-grid",children:[b.jsx("div",{className:"text-base font-semibold text-[var(--text-primary)] leading-tight",children:e??"Untitled node"}),b.jsx("div",{className:"mt-1 font-mono text-[11px] text-[var(--text-muted)] truncate",children:t})]})}const U6=[{id:"recap",column:"primary",render:({detail:e,runStatus:t,currentNodeId:r})=>e.recapMarkdown?b.jsx($6,{markdown:e.recapMarkdown},"recap"):t==="in_progress"&&e.nodeId===r&&!e.recapMarkdown?b.jsx(q6,{detail:e},"recap-in-progress"):null},{id:"validations",column:"primary",render:({detail:e})=>e.validations.length>0?b.jsx(X6,{validations:e.validations},"validations"):null},{id:"gaps",column:"primary",render:({detail:e})=>e.gaps.length>0?b.jsx(K6,{gaps:e.gaps},"gaps"):null},{id:"advance-outcome",column:"primary",render:({detail:e})=>e.advanceOutcome?b.jsx(G6,{outcome:e.advanceOutcome},"advance-outcome"):null},{id:"artifacts",column:"primary",render:({detail:e})=>e.artifacts.length>0?b.jsx(J6,{artifacts:e.artifacts},"artifacts"):null},{id:"node-meta",column:"primary",render:({detail:e})=>b.jsx(Y6,{detail:e},"node-meta")}];function V6(e){return b.jsx("div",{className:"space-y-4",children:U6.map(t=>t.render(e))})}function q6({detail:e}){return b.jsx(ca,{title:"Recap",children:b.jsxs("div",{className:"space-y-4 text-sm text-[var(--text-secondary)]",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(F6,{children:"In progress"}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:["event #",e.createdAtEventIndex]})]}),b.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[b.jsx(H1,{label:"Current focus",value:e.stepLabel??"Current workflow step",supportingText:"This step is still running, so the recap will appear once execution finishes."}),b.jsx(H1,{label:"Current state",value:"Waiting for step completion",supportingText:"The node has been created and selected as the current workflow position.",mono:!0})]}),b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] overflow-hidden",children:[b.jsx("div",{className:"px-4 py-3 border-b border-[var(--border)]",children:b.jsx(gn,{children:"What lands here next"})}),b.jsxs("div",{className:"p-4 grid gap-3 md:grid-cols-3",children:[b.jsx(mp,{title:"Recap",description:"A step summary is written when this node completes."}),b.jsx(mp,{title:"Validations",description:"Validation results appear if this step records contract checks."}),b.jsx(mp,{title:"Artifacts",description:"Generated outputs show up here after the step produces them."})]})]})]})})}function F6({children:e}){return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium text-xs",style:{backgroundColor:"rgba(0, 219, 233, 0.12)",color:"var(--accent-strong)"},children:e})}function H1({label:e,value:t,supportingText:r,mono:a=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 space-y-2",children:[b.jsx(gn,{children:e}),b.jsx("div",{className:a?"font-mono text-sm text-[var(--text-primary)]":"text-[var(--text-primary)]",children:t}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:r})]})}function mp({title:e,description:t}){return b.jsxs("div",{className:"border border-[var(--border)] bg-[rgba(255,255,255,0.02)] px-3 py-3 space-y-2",children:[b.jsx(gn,{color:"var(--text-secondary)",children:e}),b.jsx("div",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:t})]})}function Y6({detail:e}){return b.jsx(ca,{title:"Node details",children:b.jsxs("div",{className:"space-y-3",children:[b.jsx(uc,{label:"Kind",value:b.jsx(tI,{kind:e.nodeKind})}),b.jsx(uc,{label:"Event index",value:String(e.createdAtEventIndex),mono:!0}),b.jsx(uc,{label:"Parent",value:e.parentNodeId??"Root",mono:!0}),b.jsx(uc,{label:"Tip state",value:e.isTip?e.isPreferredTip?"Preferred tip":"Tip":"Historical"})]})})}function $6({markdown:e}){return b.jsx(ca,{title:"Recap",children:b.jsx(hC,{children:e})})}function G6({outcome:e}){const t=e.kind==="advanced";return b.jsx(ca,{title:"Advance outcome",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--blocked)20",color:t?"var(--success)":"var(--blocked)"},children:t?"Advanced":"Blocked"}),b.jsxs("span",{className:"text-[var(--text-muted)]",children:["attempt ",e.attemptId.slice(-8)," at event #",e.recordedAtEventIndex]})]})})}function X6({validations:e}){return b.jsx(ca,{title:`Validations (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsx(Q6,{validation:t},t.validationId))})})}function Q6({validation:e}){const t=e.outcome==="pass";return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t?"var(--success)20":"var(--error)20",color:t?"var(--success)":"var(--error)"},children:t?"Pass":"Fail"}),b.jsx("span",{className:"text-[var(--text-muted)] font-mono",children:e.contractRef})]}),e.issues.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Issues"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--error)] space-y-0.5",children:e.issues.map((r,a)=>b.jsx("li",{children:r},a))})]}),e.suggestions.length>0&&b.jsxs("div",{children:[b.jsx("div",{className:"text-[var(--text-muted)] mb-1",children:"Suggestions"}),b.jsx("ul",{className:"list-disc list-inside text-[var(--text-secondary)] space-y-0.5",children:e.suggestions.map((r,a)=>b.jsx("li",{children:r},a))})]})]})}function K6({gaps:e}){return b.jsx(ca,{title:`Gaps (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"flex items-start gap-3 text-xs bg-[var(--bg-primary)] border border-[var(--border)] px-3 py-3",children:[b.jsx("span",{className:"shrink-0 inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:t.isResolved?"var(--success)20":t.severity==="critical"?"var(--error)20":"var(--warning)20",color:t.isResolved?"var(--success)":t.severity==="critical"?"var(--error)":"var(--warning)"},children:t.isResolved?"Resolved":t.severity==="critical"?"Critical":"Non-critical"}),b.jsx("span",{className:"text-[var(--text-secondary)] leading-relaxed",children:t.summary})]},t.gapId))})})}const P1=1e5,Z6=[{prefix:"text/",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:String(e)})},{prefix:"application/json",render:e=>b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e=="string"?e:JSON.stringify(e,null,2)})}];function W6(e){if(e.byteLength>P1)return b.jsxs("div",{className:"text-[var(--text-muted)] italic",children:["Content too large to display (",am(e.byteLength)," -- limit ",am(P1),")"]});const t=Z6.find(r=>e.contentType.startsWith(r.prefix));return t?t.render(e.content):b.jsx("pre",{className:"text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto",children:typeof e.content=="string"?e.content:JSON.stringify(e.content,null,2)})}function J6({artifacts:e}){return b.jsx(ca,{title:`Artifacts (${e.length})`,children:b.jsx("div",{className:"space-y-2",children:e.map(t=>b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2",children:[b.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[var(--text-muted)]",children:[b.jsx("span",{children:t.contentType}),b.jsx("span",{children:"//"}),b.jsx("span",{children:am(t.byteLength)})]}),W6(t)]},t.sha256))})})}function ca({title:e,children:t}){return b.jsxs("div",{children:[b.jsx("div",{className:"mb-2",children:b.jsx(gn,{children:e})}),t]})}function uc({label:e,value:t,mono:r=!1}){return b.jsxs("div",{className:"bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3",children:[b.jsx(gn,{children:e}),b.jsx("div",{className:r?"mt-2 font-mono text-sm text-[var(--text-secondary)] truncate":"mt-2 text-sm text-[var(--text-primary)]",children:t})]})}const eI={step:{label:"Step",color:"var(--accent)"},checkpoint:{label:"Checkpoint",color:"var(--success)"},blocked_attempt:{label:"Blocked",color:"var(--error)"}};function tI({kind:e}){const t=eI[e];return b.jsx("span",{className:"inline-flex items-center px-2 py-1 font-medium",style:{backgroundColor:`${t.color}20`,color:t.color},children:t.label})}function am(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function nI(e){return e.length>16?`…${e.slice(-16)}`:e}function rI({data:e}){const t=e.runs[0]??null,r=t?.workflowName??t?.workflowId??"--",a=t?.workflowHash?.slice(0,12)??"--";return b.jsxs("div",{className:"bg-[var(--bg-card)] border border-[var(--border)] px-5 py-4 corner-brackets",style:{backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[e.sessionTitle&&b.jsx("h2",{className:"text-base font-medium text-[var(--text-primary)] mb-3",children:e.sessionTitle}),b.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-8 gap-y-2",children:[b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Session"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:nI(e.sessionId)}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Workflow"}),b.jsx("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:r}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Hash"}),b.jsx("dd",{className:"font-mono text-xs text-[var(--text-secondary)] self-center",children:a}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Status"}),b.jsxs("dd",{className:"self-center flex items-center gap-2",children:[b.jsx(Lw,{health:e.health}),e.health==="healthy"&&b.jsx("span",{className:"text-sm text-[var(--text-primary)]",children:"Healthy"})]}),b.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center",children:"Runs"}),b.jsxs("dd",{className:"text-sm text-[var(--text-primary)] self-center",children:[e.runs.length," run",e.runs.length!==1?"s":""]})]})]})}function iI({runs:e}){const r=e.some(a=>a.preferredTipNodeId!==null)?"Nodes with a gold border are the current execution tips — click any node to inspect its execution detail.":"Click any node in the DAG to inspect its execution detail.";return b.jsx("p",{className:"border border-[var(--border)] px-4 py-3 text-xs text-[var(--text-muted)]",children:r})}function aI({sessionId:e}){const{data:t,isLoading:r,error:a}=SM(e),[s,l]=B.useState(null),u=B.useCallback((h,d)=>{l(p=>p?.runId===h&&p?.nodeId===d?null:{runId:h,nodeId:d})},[]);if(r)return b.jsx("div",{className:"text-[var(--text-secondary)]",children:"Loading session..."});if(a)return b.jsxs("div",{className:"text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4",children:["Failed to load session: ",a.message]});if(!t)return null;const f=s?t.runs.find(h=>h.runId===s.runId)??null:null;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-4",children:[b.jsx(rI,{data:t}),t.runs.length===0?b.jsx("div",{className:"text-center py-16 text-[var(--text-secondary)]",children:"No runs in this session"}):b.jsxs(b.Fragment,{children:[s===null&&b.jsx(iI,{runs:t.runs}),b.jsx("div",{className:"space-y-6",children:t.runs.map(h=>b.jsx(sI,{run:h,selectedNodeId:s?.runId===h.runId?s.nodeId:null,onNodeClick:u},h.runId))})]})]}),b.jsxs(Es,{cut:18,borderColor:"rgba(244, 196, 48, 0.35)",background:"rgba(27, 31, 44, 0.78)",dropShadow:"drop-shadow(0 16px 48px rgba(0,0,0,0.9)) drop-shadow(0 2px 12px rgba(244,196,48,0.15))",backdropFilter:"blur(16px)",className:"fixed top-3 right-3 bottom-3 w-[560px] max-w-[calc(92vw-12px)] transition-transform duration-200 ease-out",style:{zIndex:40,transform:s?"translateX(0)":"translateX(calc(100% + 12px))"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0 console-blueprint-grid",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)]",children:"Node detail"}),b.jsx("button",{onClick:()=>l(null),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none px-1","aria-label":"Close",children:"×"})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(H6,{sessionId:e,nodeId:s?.nodeId??null,runStatus:f?.status??"complete",currentNodeId:f?.preferredTipNodeId??null})})]})]})}function sI({run:e,selectedNodeId:t,onNodeClick:r}){return b.jsxs(Es,{cut:10,background:"rgba(27, 31, 44, 0.72)",backdropFilter:"blur(8px)",className:"relative",style:{height:"506px"},children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:e.workflowName??e.workflowId??"Run"}),b.jsx("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:e.runId}),b.jsxs("span",{className:"font-mono text-xs text-[var(--text-muted)]",children:[e.nodes.length," nodes · ",e.tipNodeIds.length," tip",e.tipNodeIds.length!==1?"s":""]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[e.hasUnresolvedCriticalGaps&&b.jsx("span",{className:"text-xs text-[var(--warning)]",children:"Critical gaps"}),b.jsx(Nm,{status:e.status})]})]}),b.jsx("div",{className:"flex-1",children:b.jsx(oD,{run:e,selectedNodeId:t,onNodeClick:a=>r(e.runId,a)})})]})}const Gi=[{id:"coding",label:"Coding"},{id:"review_audit",label:"Review & Audit"},{id:"investigation",label:"Investigation"},{id:"design",label:"Design"},{id:"documentation",label:"Documentation"},{id:"tickets",label:"Tickets"},{id:"learning",label:"Learning"},{id:"authoring",label:"Workflow Authoring"}],qc=Object.fromEntries(Gi.map(e=>[e.id,e.label]));function U1({label:e,count:t,countLabel:r="workflow",showRule:a=!0,separator:s="//"}){const l=t!=null?` ${s} ${t} ${r}${t!==1?"s":""}`:"";return b.jsxs("div",{className:"flex items-center gap-3 mb-3 mt-2",children:[b.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] shrink-0",children:[e,l]}),a&&b.jsx("div",{className:"flex-1 h-px bg-[var(--border)]"})]})}function sm({segments:e,className:t=""}){return b.jsx("nav",{"aria-label":"Breadcrumb",className:`flex items-center gap-0 ${t}`,children:e.map((r,a)=>{const s=a===e.length-1,l=!!r.onClick;return b.jsxs("span",{className:"flex items-center",children:[b.jsx("span",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mx-1",children:"//"}),l?b.jsx("button",{type:"button",onClick:r.onClick,className:"font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors cursor-pointer",children:r.label.toUpperCase()}):b.jsx("span",{className:`font-mono text-[10px] uppercase tracking-[0.25em] ${s?"text-[var(--text-secondary)]":"text-[var(--text-muted)]"}`,"aria-current":s?"page":void 0,children:r.label.toUpperCase()})]},a)})})}function pC({workflowId:e,activeTag:t,onBack:r}){const l=fm().getQueryData(["workflows"])?.workflows.find(N=>N.id===e),{data:u,isLoading:f,isError:h,error:d,refetch:p}=kM(e),g=t?qc[t]??t:null,y=u?.name??l?.name??e,v=u?.description??l?.description??null,w=u?.tags??l?.tags??[],C=u?.source??l?.source??null;return b.jsxs("div",{className:"space-y-5 max-w-3xl",children:[b.jsx(sm,{segments:g?[{label:"Workflows",onClick:r},{label:g}]:[{label:"Workflows",onClick:r}]}),b.jsxs("div",{className:"border border-[var(--border)] px-5 py-5 console-blueprint-grid",children:[b.jsx("p",{className:"font-mono text-[10px] uppercase tracking-[0.35em] text-[var(--text-muted)] mb-2",children:"// Workflow"}),b.jsx("h2",{className:"font-mono text-xl font-bold uppercase tracking-[0.08em] leading-tight mb-3",style:{color:"var(--accent)",textShadow:"0 0 24px rgba(244,196,48,0.45), 0 0 48px rgba(244,196,48,0.15)"},children:y}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u&&u.stepCount!=null&&u.stepCount>0&&b.jsxs("span",{className:"font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-secondary)]",children:[u.stepCount," step",u.stepCount!==1?"s":""]}),w.filter(N=>N!=="routines").map(N=>b.jsx("span",{"aria-hidden":"true",className:"font-mono text-[10px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]",children:qc[N]??N},N)),C&&b.jsxs("span",{"aria-hidden":"true",className:"font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-muted)]",children:["src: ",C.displayName]})]}),v&&b.jsx("p",{className:"text-sm text-[var(--text-secondary)] leading-relaxed mt-3",children:v})]}),f&&!l?b.jsx(uI,{}):h?b.jsx(cI,{message:d instanceof Error?d.message:"Could not load workflow details.",is404:d instanceof Cm&&d.status===404,onRetry:()=>{p()},onBack:r}):u?b.jsx(oI,{detail:u,name:y}):b.jsx("div",{className:"space-y-4",children:b.jsx(mC,{})}),b.jsx(sm,{segments:[{label:"Workflows",onClick:r}]})]})}function oI({detail:e,name:t}){const r=e.about!==void 0&&e.about.length>0,a=e.examples!==void 0&&e.examples.length>0,s=e.preconditions!==void 0&&e.preconditions.length>0;return r||a||s?b.jsxs("div",{className:"space-y-6",children:[r&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"About"}),b.jsx(hC,{children:e.about})]}),a&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Try it with:"}),b.jsx("ul",{className:"space-y-2",children:e.examples.map(u=>b.jsxs("li",{className:"flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-none px-4 py-3",children:[b.jsx("div",{"aria-hidden":"true",className:"w-0.5 shrink-0 self-stretch rounded-full",style:{backgroundColor:"var(--accent)"}}),b.jsxs("span",{className:"text-sm text-[var(--text-secondary)] leading-relaxed",children:['"',u,'"']})]},u))})]}),s&&b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Before you start:"}),b.jsx("ul",{className:"space-y-1.5",children:e.preconditions.map(u=>b.jsxs("li",{className:"flex items-start gap-2 text-sm text-[var(--text-secondary)]",children:[b.jsx("span",{className:"shrink-0 text-[var(--text-muted)] mt-0.5",children:"•"}),b.jsx("span",{children:u})]},u))})]}),b.jsx(lI,{name:t})]}):b.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No additional documentation available."})}function lI({name:e}){const[t,r]=B.useState(!1),a=`Use the ${e} to [your goal]`,s=()=>{navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return b.jsxs("section",{children:[b.jsx("h3",{className:"text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3",children:"Start with this prompt"}),b.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] px-4 py-3",children:[b.jsxs("span",{className:"flex-1 text-sm text-[var(--text-secondary)] font-mono truncate",children:['"',a,'"']}),b.jsx("button",{type:"button",onClick:s,className:"shrink-0 text-xs font-mono text-[var(--accent)] hover:text-[var(--text-primary)] transition-colors",children:t?"Copied!":"Copy"})]})]})}function mC(){return b.jsxs("div",{className:"space-y-3 motion-safe:animate-pulse",children:[b.jsx("div",{className:"h-3 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-5/6 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-4 w-4/6 rounded bg-[var(--bg-tertiary)]"})]})}function uI(){return b.jsxs("div",{className:"space-y-6 motion-safe:animate-pulse",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsx("div",{className:"h-6 w-1/2 rounded bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("div",{className:"h-5 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-5 w-24 rounded bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"h-4 w-full rounded bg-[var(--bg-tertiary)]"})]}),b.jsx(mC,{})]})}function cI({message:e,is404:t,onRetry:r,onBack:a}){return b.jsxs("div",{className:"space-y-4 bg-[var(--bg-card)] border border-[var(--border)] p-4",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:t?"Workflow not found.":e}),b.jsxs("div",{className:"flex gap-3",children:[!t&&b.jsx("button",{type:"button",onClick:r,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"}),b.jsxs("button",{type:"button",onClick:a,"aria-label":"Back to workflows list",className:"font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:["<"," WORKFLOWS"]})]})]})}function V1(e){const t=new Set(Gi.map(l=>l.id)),r=new Map,a=[];for(const l of e){const u=l.tags.find(f=>f!=="routines"&&t.has(f));if(u){const f=r.get(u)??[];f.push(l),r.set(u,f)}else a.push(l)}const s=Gi.filter(l=>r.has(l.id)).map(l=>({tagId:l.id,label:l.label,workflows:r.get(l.id)}));return a.length>0&&s.push({tagId:null,label:"Other",workflows:a}),s}function fI({selectedTag:e,onSelectTag:t,onSelectWorkflow:r}){const[a,s]=B.useState(null),[l,u]=B.useState(null),f=B.useRef(null),h=B.useRef(null),d=B.useRef(null),p=B.useRef(!1),g=B.useRef(null),y=B.useRef(null),[v,w]=B.useState(0),[C,N]=B.useState(0),[S,A]=B.useState(38),[_,k]=B.useState(62),[H,M]=B.useState(3),[D,P]=B.useState(2),[U,q]=B.useState(""),[I,Y]=B.useState(!1),[Q,L]=B.useState(!1),{data:V,isLoading:T,isError:F,error:X,refetch:Z}=_M();B.useEffect(()=>{if(a){const ce=requestAnimationFrame(()=>h.current?.focus());return()=>cancelAnimationFrame(ce)}else f.current&&(f.current.focus(),f.current=null)},[a]),B.useEffect(()=>{if(!a)return;const ce=window.scrollY;return document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${ce}px`,document.body.style.width="100%",()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,ce)}},[a]),B.useEffect(()=>{if(!a)return;const ce=ge=>{ge.key==="Escape"&&s(null)};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[a]);const j=B.useMemo(()=>V?.workflows.filter(ce=>!ce.tags.includes("routines"))??[],[V]),z=B.useMemo(()=>[...new Set(j.map(ge=>ge.source.displayName))].sort(),[j]),$=B.useMemo(()=>{const ce=new Set(Gi.map(be=>be.id));let ge=e?e==="__other__"?j.filter(be=>!be.tags.some(De=>De!=="routines"&&ce.has(De))):j.filter(be=>be.tags.includes(e)):j;return l&&(ge=ge.filter(be=>be.source.displayName===l)),ge},[j,e,l]),R=B.useMemo(()=>e?$:V1($).flatMap(ce=>ce.workflows),[$,e]),te=R.findIndex(ce=>ce.id===a),ue=B.useCallback((ce,ge)=>{f.current=ge,s(ce),y.current=ce,ge.blur()},[]),fe=B.useCallback((ce,ge)=>{if(R.length<=1)return;const be=R.findIndex(qe=>qe.id===a);if(be===-1)return;const De=ce==="next"?(be+1)%R.length:(be-1+R.length)%R.length;if(p.current){g.current=De;return}de(De,ce,ge)},[R,a]);function de(ce,ge,be){p.current=!0,Y(!0),w(Fe=>Fe+1),N(Math.floor(Math.random()*4)),A(5+Math.floor(Math.random()*80)),k(5+Math.floor(Math.random()*80)),M(2+Math.floor(Math.random()*40)),P(2+Math.floor(Math.random()*25)),q(be==="horizontal"?ge==="next"?"modal-content--exit-h-next":"modal-content--exit-h-prev":ge==="next"?"modal-content--exit-v-next":"modal-content--exit-v-prev"),d.current&&(d.current.scrollTop=0);const qe=R[ce].id;setTimeout(()=>{s(qe),y.current=qe,q(be==="horizontal"?ge==="next"?"modal-content--enter-h-next":"modal-content--enter-h-prev":ge==="next"?"modal-content--enter-v-next":"modal-content--enter-v-prev"),Y(!1)},80),setTimeout(()=>{if(q(""),p.current=!1,g.current!==null){const Fe=g.current;g.current=null;const _t=R.findIndex(sn=>sn.id===y.current),Ot=Fe>_t?"next":"prev";de(Fe,Ot,"horizontal")}},240)}B.useEffect(()=>{if(!a)return;R.length>1&&L(!0);const ce=setTimeout(()=>L(!1),3e3),ge=["ArrowLeft","ArrowRight","a","A","d","D"],be=["ArrowUp","ArrowDown","w","W","s","S"],De=qe=>{if(be.includes(qe.key)){qe.preventDefault(),qe.stopPropagation();return}if(!ge.includes(qe.key))return;qe.preventDefault(),qe.stopPropagation();const Fe=["ArrowLeft","a","A"].includes(qe.key);fe(Fe?"prev":"next","horizontal")};return document.addEventListener("keydown",De,{capture:!0}),()=>{document.removeEventListener("keydown",De,{capture:!0}),clearTimeout(ce)}},[a,fe]);const{getItemProps:le,containerProps:pe}=Bw({count:R.length,cols:"auto",onActivate:B.useCallback(ce=>{const ge=document.activeElement;ue(R[ce].id,ge)},[R,ue])}),we=new Set(Gi.map(ce=>ce.id)),Ee=new Set(j.flatMap(ce=>ce.tags)),ve=new Map(Gi.map(ce=>[ce.id,j.filter(ge=>ge.tags.includes(ce.id)).length])),Ce=j.filter(ce=>!ce.tags.some(ge=>ge!=="routines"&&we.has(ge))).length;return b.jsxs("div",{className:"space-y-4","aria-busy":T,children:[b.jsxs("div",{children:[b.jsx("h1",{className:"font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none",style:{color:"var(--accent)",textShadow:"0 0 28px rgba(244,196,48,0.35)"},children:"Workflows"}),b.jsxs("p",{className:"font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5",children:["// ",j.length," available"]})]}),b.jsxs("div",{role:"group","aria-label":"Filter workflows by category",className:"flex flex-wrap gap-1.5",children:[b.jsx(zo,{label:"All",count:j.length,isActive:e===null,disabled:T,onClick:()=>t(null)}),Gi.filter(ce=>Ee.has(ce.id)||!V).map(ce=>b.jsx(zo,{label:ce.label,count:ve.get(ce.id)??0,isActive:e===ce.id,disabled:T,onClick:()=>t(e===ce.id?null:ce.id)},ce.id)),Ce>0&&b.jsx(zo,{label:"Other",count:Ce,isActive:e==="__other__",disabled:T,onClick:()=>t(e==="__other__"?null:"__other__")})]}),z.length>1&&b.jsxs("div",{role:"group","aria-label":"Filter workflows by source",className:"flex flex-wrap gap-1.5",children:[b.jsx(zo,{label:"All Sources",count:j.length,isActive:l===null,disabled:T,onClick:()=>u(null)}),z.map(ce=>b.jsx(zo,{label:ce,count:j.filter(ge=>ge.source.displayName===ce).length,isActive:l===ce,disabled:T,onClick:()=>u(l===ce?null:ce)},ce))]}),T?b.jsx(dI,{}):F?b.jsx(hI,{message:X instanceof Error?X.message:"Could not load workflows.",onRetry:()=>{Z()}}):$.length===0?b.jsxs("div",{className:"py-8 text-center space-y-3",children:[b.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No workflows in this category."}),e!==null&&b.jsx("button",{type:"button",onClick:()=>t(null),className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Clear filter"})]}):e!==null?b.jsxs("div",{className:"space-y-2",children:[b.jsx(U1,{label:e==="__other__"?"Other":qc[e]??e,count:$.length,showRule:!0}),b.jsx("div",{...pe,className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:$.map((ce,ge)=>b.jsx(q1,{workflow:ce,onSelect:be=>ue(ce.id,be),navProps:le(ge),isActive:ce.id===a},ce.id))})]}):b.jsx("div",{className:"space-y-6",children:(()=>{let ce=0;return V1($).map(ge=>b.jsxs("div",{className:"space-y-2",children:[b.jsx(U1,{label:ge.label,count:ge.workflows.length,showRule:!0}),b.jsx("div",{...pe,className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:ge.workflows.map(be=>{const De=ce++;return b.jsx(q1,{workflow:be,onSelect:qe=>ue(be.id,qe),navProps:le(De),isActive:be.id===a},be.id)})})]},ge.tagId??"__other__"))})()}),b.jsxs("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-4 pointer-events-none","aria-hidden":!a,children:[a&&b.jsx("div",{className:"absolute inset-0 pointer-events-auto",style:{background:"rgba(0,0,0,0.22)",backdropFilter:"blur(2px)"},onClick:()=>s(null)}),b.jsx("div",{ref:h,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":`Workflow detail${a?`: ${R.find(ce=>ce.id===a)?.name??""}`:""}`,className:`relative w-full max-w-3xl ${a?"pointer-events-auto":"pointer-events-none"}${I?" modal-border-flashing":""}`,style:{height:"85vh",transform:a?"translateY(0) scale(1)":"translateY(24px) scale(0.97)",opacity:a?1:0,transition:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"opacity 150ms ease-out":"transform 250ms ease-out, opacity 250ms ease-out",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)"},children:b.jsxs(Es,{cut:20,borderColor:"rgba(244, 196, 48, 0.45)",background:"rgba(15, 19, 31, 0.50)",dropShadow:"drop-shadow(0 4px 24px rgba(244,196,48,0.15))",className:"h-full flex flex-col",children:[v>0&&b.jsx("div",{className:"modal-scanline","aria-hidden":"true",style:{"--crt-offset":`${C}px`,"--glitch-y":`${S}%`,"--glitch-y2":`${_}%`,"--glitch-w":`${H}px`,"--glitch-w2":`${D}px`,clipPath:Iw(20)}},v),b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[var(--border)] shrink-0 console-blueprint-grid",style:{background:"rgba(15, 19, 31, 0.55)"},children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-secondary)]",children:"Workflow"}),te>=0&&b.jsxs("span",{className:"font-mono text-[10px] tracking-[0.20em] text-[var(--text-secondary)]",children:["[ ",te+1," / ",R.length," ]"]}),b.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] text-[var(--text-secondary)] transition-opacity duration-600",style:{opacity:Q?.5:0},"aria-hidden":"true",children:"[ A / D ] NAV"})]}),b.jsx("button",{type:"button",onClick:()=>s(null),className:"text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none","aria-label":"Close",children:"×"})]}),b.jsxs("div",{ref:d,className:`flex-1 overflow-auto overscroll-contain px-6 py-5 ${U}`,style:{"--text-muted":"var(--text-secondary)"},children:[b.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:R.find(ce=>ce.id===a)?.name??""}),a&&b.jsx(pC,{workflowId:a,activeTag:e,onBack:()=>s(null)})]})]})})]})]})}function zo({label:e,count:t,isActive:r,disabled:a,onClick:s}){return b.jsxs("button",{type:"button",onClick:s,disabled:a,"aria-pressed":r,className:["px-3 py-2 min-w-[44px] min-h-[44px] rounded-none text-xs font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed",r?"border border-[var(--accent)] text-[var(--accent)] bg-transparent":"text-[var(--text-muted)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-card)]"].join(" "),children:[e," · ",t,r&&b.jsx("span",{className:"sr-only",children:"(selected)"})]})}function q1({workflow:e,onSelect:t,navProps:r,isActive:a}){const s=e.tags.filter(u=>u!=="routines").map(u=>qc[u]??u),l=[e.name,e.description,s.length>0?`Tag: ${s.join(", ")}`:null,`Source: ${e.source.displayName}`].filter(Boolean).join(". ");return b.jsx(km,{variant:"grid",onClick:u=>t(u.currentTarget),"aria-label":l,style:a?{borderColor:"var(--accent)",boxShadow:"0 0 0 1px rgba(244,196,48,0.4), 0 0 16px rgba(244,196,48,0.12)"}:void 0,...r,children:b.jsxs("div",{className:"flex flex-col flex-1 p-4 gap-2 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-2",children:e.name}),b.jsx("p",{className:"text-xs text-[var(--text-secondary)] line-clamp-3 leading-relaxed flex-1",children:e.description}),b.jsxs("div",{className:"flex items-center justify-between gap-2 mt-auto pt-2 border-t border-[var(--border)]",children:[b.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.slice(0,1).map(u=>b.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]",children:u},u))}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.stepCount!=null&&e.stepCount>0&&b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)]",children:[e.stepCount,"s"]}),b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)] max-w-[80px] truncate",children:["src: ",e.source.displayName]})]})]})]})})}function dI(){return b.jsx("div",{className:"space-y-6 motion-safe:animate-pulse",children:[0,1].map(e=>b.jsxs("div",{className:"space-y-3",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"h-3 w-24 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"flex-1 h-px bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:[0,1,2,3,4,5].map(t=>b.jsxs("div",{className:"min-h-[160px] bg-[var(--bg-card)] border border-[var(--border)] flex flex-col",children:[b.jsx("div",{className:"h-[3px] bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"p-4 flex flex-col gap-2 flex-1",children:[b.jsx("div",{className:"h-4 w-3/4 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-full bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-5/6 bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"mt-auto pt-2 border-t border-[var(--border)] flex justify-between",children:[b.jsx("div",{className:"h-3 w-12 bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-16 bg-[var(--bg-tertiary)]"})]})]})]},t))})]},e))})}function hI({message:e,onRetry:t}){return b.jsxs("div",{className:"space-y-3 py-8 text-center",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:e}),b.jsx("button",{type:"button",onClick:t,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"})]})}const F1=[{key:"tool",label:"Tool",minWidth:"180px"},{key:"duration",label:"Duration",width:"220px"},{key:"started",label:"Started",width:"100px"},{key:"outcome",label:"Outcome"}],Y1=[{value:"recent",label:"Recent first",compareFn:(e,t)=>t.startedAtMs-e.startedAtMs},{value:"slowest",label:"Slowest first",compareFn:(e,t)=>t.durationMs-e.durationMs}],lg={success:{color:"var(--success)",label:"OK",isError:!1},error:{color:"var(--error)",label:"Error",isError:!0},unknown_tool:{color:"var(--warning)",label:"Unknown",isError:!0}};function pI(){const e=NM(),[t,r]=B.useState("recent");if(e.state==="loading")return b.jsx(vI,{});if(e.state==="devModeOff")return b.jsx("div",{className:"flex items-center justify-center py-16",children:b.jsx("p",{className:"text-sm text-[var(--text-muted)] text-center",children:"nothing to see here"})});if(e.state==="error")return b.jsxs("div",{className:"space-y-3 py-8 text-center",children:[b.jsx("p",{className:"text-sm text-[var(--error)]",children:e.message}),b.jsx("button",{type:"button",onClick:e.retry,className:"text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors",children:"Try again"})]});const{observations:a}=e.data;return b.jsx(mI,{observations:a,sortOrder:t,onSortChange:r})}function mI({observations:e,sortOrder:t,onSortChange:r}){const a=B.useMemo(()=>{const d=Y1.find(p=>p.value===t);return[...e].sort(d.compareFn)},[e,t]),s=B.useMemo(()=>a.reduce((d,p)=>Math.max(d,p.durationMs),0),[a]),l=e.filter(d=>lg[d.outcome].isError).length,u=e.length>0?Math.round(e.reduce((d,p)=>d+p.durationMs,0)/e.length):null,f=e.length>0?e.reduce((d,p)=>Math.max(d,p.startedAtMs),0):null,h=`${e.length} recorded`;return b.jsxs("div",{className:"space-y-3",children:[b.jsxs("p",{className:"text-sm text-[var(--text-secondary)]",children:[h," | ",b.jsxs("span",{style:{color:l>0?"var(--error)":"var(--text-muted)"},children:[l," errors"]})," | ","avg ",u!==null?`${u}ms`:"--"," | ","last call ",f!==null?Cs(f):"no calls yet"]}),b.jsx("div",{role:"radiogroup","aria-label":"Sort order",className:"flex items-center gap-1",children:Y1.map(d=>b.jsx(xI,{label:d.label,isActive:t===d.value,onClick:()=>r(d.value)},d.value))}),b.jsxs("table",{className:"w-full text-sm border-collapse",children:[b.jsx("thead",{children:b.jsx("tr",{className:"text-xs text-[var(--text-muted)] border-b border-[var(--border)]",children:F1.map(d=>b.jsx("th",{scope:"col",className:"text-left py-2 pr-4 font-medium",style:{width:d.width,minWidth:d.minWidth},children:d.label},d.key))})}),b.jsx("tbody",{children:a.length===0?b.jsx("tr",{children:b.jsx("td",{colSpan:F1.length,className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No tool calls recorded yet. Run a workflow to see timing data."})}):a.map((d,p)=>b.jsx(gI,{obs:d,maxDuration:s},`${d.startedAtMs}-${d.toolName}-${p}`))})]})]})}function gI({obs:e,maxDuration:t}){const r=lg[e.outcome].isError,a=t>0?Math.round(e.durationMs/t*120):0;return b.jsxs("tr",{className:"border-b border-[var(--border)] hover:bg-[var(--bg-card)] transition-colors",style:{borderLeft:r?"2px solid var(--error)":"2px solid transparent"},children:[b.jsx("td",{className:"py-2 pr-4 font-mono text-[var(--text-primary)] overflow-hidden text-ellipsis",title:e.toolName,style:{minWidth:"180px",maxWidth:"240px"},children:b.jsx("span",{className:"block truncate",children:e.toolName})}),b.jsxs("td",{className:"py-2 pr-4",style:{width:"220px"},children:[b.jsxs("span",{className:"font-mono text-[var(--text-primary)]",children:[e.durationMs,"ms"]}),b.jsx("div",{"aria-hidden":"true",className:"h-1 rounded mt-1",style:{backgroundColor:"var(--accent)",width:`${a}px`,maxWidth:"120px"}})]}),b.jsx("td",{className:"py-2 pr-4 text-[var(--text-secondary)]",style:{width:"100px"},children:Cs(e.startedAtMs)}),b.jsx("td",{className:"py-2",children:b.jsx(yI,{outcome:e.outcome})})]})}function yI({outcome:e}){const t=lg[e];return b.jsx("span",{className:"inline-block px-2 py-0.5 rounded text-xs font-medium",style:{color:t.color,backgroundColor:`color-mix(in srgb, ${t.color} 12%, transparent)`},children:t.label})}function xI({label:e,isActive:t,onClick:r}){return b.jsx("button",{type:"button",role:"radio",onClick:r,"aria-checked":t,className:["px-3 py-2 rounded text-xs font-medium min-w-[44px] transition-colors",t?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"].join(" "),children:e})}function vI(){return b.jsxs("div",{className:"space-y-3 animate-pulse","aria-busy":"true","aria-label":"Loading performance data",children:[b.jsx("div",{className:"h-4 w-64 rounded bg-[var(--bg-tertiary)]"}),b.jsxs("div",{className:"flex gap-1",children:[b.jsx("div",{className:"h-8 w-24 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-8 w-24 rounded bg-[var(--bg-tertiary)]"})]}),b.jsxs("div",{className:"flex gap-4 border-b border-[var(--border)] pb-2",children:[b.jsx("div",{className:"h-3 w-20 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-14 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-3 w-14 rounded bg-[var(--bg-tertiary)]"})]}),Array.from({length:8}).map((e,t)=>b.jsxs("div",{className:"flex gap-4 py-2",children:[b.jsx("div",{className:"h-4 rounded bg-[var(--bg-tertiary)]",style:{minWidth:"180px",width:"180px"}}),b.jsxs("div",{className:"space-y-1",style:{width:"220px"},children:[b.jsx("div",{className:"h-4 w-16 rounded bg-[var(--bg-tertiary)]"}),b.jsx("div",{className:"h-1 w-20 rounded bg-[var(--bg-tertiary)]"})]}),b.jsx("div",{className:"h-4 w-16 rounded bg-[var(--bg-tertiary)]",style:{width:"100px"}}),b.jsx("div",{className:"h-5 w-12 rounded bg-[var(--bg-tertiary)]"})]},t))]})}const Lo=[{id:"workspace",path:"/"},{id:"workflows",path:"/workflows"},{id:"perf",path:"/perf"}];function bI(){const e=Xc(),t=nM(),{location:r}=lM(),a=t({to:"/session/$sessionId"}),s=t({to:"/workflows"}),l=t({to:"/workflows/$workflowId"}),u=t({to:"/perf"}),f=s!==!1||l!==!1?"workflows":u!==!1?"perf":"workspace",h=a!==!1,d=l!==!1,p=h?a.sessionId:null,g=d?l.workflowId:null,y=new URLSearchParams(r.search).get("tag"),{data:v}=_m(),w=v?.sessions.filter(P=>P.status==="in_progress").length??0,C=v?.sessions.filter(P=>P.status==="blocked").length??0,N=B.useCallback(()=>{e({to:"/"})},[e]),S=B.useCallback(P=>{e({to:"/workflows",search:{tag:P??void 0}})},[e]),A=B.useCallback(P=>{e({to:"/workflows/$workflowId",params:{workflowId:P},search:{tag:y??void 0}})},[e,y]),_=B.useCallback(()=>{e({to:"/workflows",search:{tag:y??void 0}})},[e,y]),[k,H]=B.useState(null),M=B.useCallback((P,U)=>{U(),H(P),setTimeout(()=>H(null),200)},[]),D=B.useRef(null);return B.useEffect(()=>{const P=D.current;if(!P)return;function U(q){if(q.key==="ArrowLeft"||q.key==="ArrowRight"){q.preventDefault();const I=Lo.findIndex(L=>L.id===f),Y=q.key==="ArrowRight"?(I+1)%Lo.length:(I-1+Lo.length)%Lo.length,Q=Lo[Y];e({to:Q.path,...Q.path==="/workflows"?{search:{tag:void 0}}:{}})}}return P.addEventListener("keydown",U),()=>P.removeEventListener("keydown",U)},[f,e]),b.jsxs("div",{className:"min-h-screen",style:{"--app-header-height":"56px"},children:[b.jsxs("header",{style:{background:"rgba(23, 27, 40, 0.92)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",borderBottom:"1px solid rgba(244, 196, 48, 0.25)",boxShadow:"0 4px 24px rgba(0,0,0,0.4)"},className:"fixed top-0 w-full z-50 flex items-center h-14 px-4 gap-6",children:[b.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[b.jsx(Es,{cut:8,borderColor:"rgba(244, 196, 48, 0.5)",background:"rgba(27, 31, 44, 0.8)",className:"relative w-10 h-10",children:b.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:b.jsx("span",{className:"font-mono text-[11px] font-bold text-[var(--accent)] tracking-widest",children:"WR"})})}),b.jsxs("div",{className:"hidden sm:flex flex-col leading-none",children:[b.jsx("span",{className:"font-mono text-[11px] font-bold text-[var(--text-primary)] tracking-[0.25em] uppercase",children:"WR_CONSOLE"}),b.jsxs("span",{className:"font-mono text-[9px] text-[var(--text-muted)] tracking-[0.15em]",children:["// V","3.16.0"]})]})]}),h&&p?b.jsx("nav",{className:"flex items-center flex-1 justify-center",children:b.jsx(sm,{segments:[{label:"Workspace",onClick:N},{label:p?.slice(-12)??""}]})}):b.jsxs("div",{role:"tablist","aria-label":"Console sections",ref:D,className:"flex items-center gap-1 flex-1 justify-center",children:[b.jsxs("button",{role:"tab",id:"tab-workspace","aria-selected":f==="workspace","aria-controls":"panel-workspace",tabIndex:f==="workspace"?0:-1,onClick:()=>M("workspace",()=>{e({to:"/"})}),className:["tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",f==="workspace"?"tab-btn--active text-[var(--accent)] text-glow-amber":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]",k==="workspace"?"tab-activating":""].join(" "),style:f==="workspace"?{backgroundColor:"rgba(244, 196, 48, 0.06)"}:void 0,children:[b.jsx("span",{className:"tab-corner tab-corner--tl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--tr","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--bl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--br","aria-hidden":"true"}),"Workspace"]}),b.jsxs("button",{role:"tab",id:"tab-workflows","aria-selected":f==="workflows","aria-controls":"panel-workflows",tabIndex:f==="workflows"?0:-1,onClick:()=>M("workflows",()=>{e({to:"/workflows",search:{tag:void 0}})}),className:["tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",f==="workflows"?"tab-btn--active text-[var(--accent)] text-glow-amber":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]",k==="workflows"?"tab-activating":""].join(" "),style:f==="workflows"?{backgroundColor:"rgba(244, 196, 48, 0.06)"}:void 0,children:[b.jsx("span",{className:"tab-corner tab-corner--tl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--tr","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--bl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--br","aria-hidden":"true"}),"Workflows"]}),b.jsxs("button",{role:"tab",id:"tab-perf","aria-selected":f==="perf","aria-controls":"panel-perf",tabIndex:f==="perf"?0:-1,onClick:()=>M("perf",()=>{e({to:"/perf"})}),className:["tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150","focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none",f==="perf"?"tab-btn--active text-[var(--accent)] text-glow-amber":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]",k==="perf"?"tab-activating":""].join(" "),style:f==="perf"?{backgroundColor:"rgba(244, 196, 48, 0.06)"}:void 0,children:[b.jsx("span",{className:"tab-corner tab-corner--tl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--tr","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--bl","aria-hidden":"true"}),b.jsx("span",{className:"tab-corner tab-corner--br","aria-hidden":"true"}),"Performance"]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[w>0&&b.jsx(kc,{label:`${Math.min(w,9)}${w>9?"+":""} LIVE`,color:"var(--accent-strong)",pulse:!0,role:"status","aria-label":`${w} live session${w===1?"":"s"}`}),C>0&&b.jsx(kc,{label:`${Math.min(C,9)}${C>9?"+":""} BLOCKED`,color:"var(--blocked)",role:"status","aria-label":`${C} blocked session${C===1?"":"s"}`})]})]}),b.jsxs("main",{className:"p-6",style:{paddingTop:"calc(56px + 1.5rem)"},children:[b.jsxs("div",{id:"panel-workspace",role:"tabpanel","aria-labelledby":"tab-workspace",hidden:f==="workflows"||f==="perf",children:[b.jsx(GM,{hidden:h}),h&&p&&b.jsx(aI,{sessionId:p})]}),f==="workflows"&&b.jsx("div",{id:"panel-workflows",role:"tabpanel","aria-labelledby":"tab-workflows",children:d&&g?b.jsx(pC,{workflowId:g,onBack:_}):b.jsx(fI,{selectedTag:y,onSelectTag:S,onSelectWorkflow:A})}),f==="perf"&&b.jsx("div",{id:"panel-perf",role:"tabpanel","aria-labelledby":"tab-perf",children:b.jsx(pI,{})})]})]})}const ks=Yk({component:bI}),wI=ml({getParentRoute:()=>ks,path:"/",component:()=>null}),SI=ml({getParentRoute:()=>ks,path:"/session/$sessionId",component:()=>null}),EI=ml({getParentRoute:()=>ks,path:"/workflows",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),CI=ml({getParentRoute:()=>ks,path:"/workflows/$workflowId",validateSearch:e=>({tag:typeof e.tag=="string"?e.tag:void 0}),component:()=>null}),_I=ml({getParentRoute:()=>ks,path:"/perf",component:()=>null}),NI=ks.addChildren([wI,SI,EI,CI,_I]),kI=iM({routeTree:NI,history:ik()}),MI=new eN({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});T_.createRoot(document.getElementById("root")).render(b.jsx(B.StrictMode,{children:b.jsx(tN,{client:MI,children:b.jsx(oM,{router:kI})})}));
|