@grackle-ai/web 0.58.0 → 0.59.1
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.
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import{r as DS,a as _,j as c,v as MS,b as RS,t as zr,i as OS,f as BS,M as Yf,c as Kf}from"./markdown-gcy1Jmzi.js";import{r as IS,d as Gv,H as Pv,P as $v,i as LS,B as zS,a as US,C as VS,M as HS}from"./dagview-EHk2VaeR.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const u of f.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function i(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(r){if(r.ep)return;r.ep=!0;const f=i(r);fetch(r.href,f)}})();var Vd={exports:{}},Ul={},Hd={exports:{}},Gd={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* scheduler.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Fv;function GS(){return Fv||(Fv=1,(function(n){function a(B,q){var U=B.length;B.push(q);e:for(;0<U;){var re=U-1>>>1,I=B[re];if(0<r(I,q))B[re]=q,B[U]=I,U=re;else break e}}function i(B){return B.length===0?null:B[0]}function o(B){if(B.length===0)return null;var q=B[0],U=B.pop();if(U!==q){B[0]=U;e:for(var re=0,I=B.length,ie=I>>>1;re<ie;){var he=2*(re+1)-1,se=B[he],He=he+1,gt=B[He];if(0>r(se,U))He<I&&0>r(gt,se)?(B[re]=gt,B[He]=U,re=He):(B[re]=se,B[he]=U,re=he);else if(He<I&&0>r(gt,U))B[re]=gt,B[He]=U,re=He;else break e}}return q}function r(B,q){var U=B.sortIndex-q.sortIndex;return U!==0?U:B.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var u=Date,p=u.now();n.unstable_now=function(){return u.now()-p}}var m=[],g=[],y=1,v=null,b=3,S=!1,C=!1,E=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function D(B){for(var q=i(g);q!==null;){if(q.callback===null)o(g);else if(q.startTime<=B)o(g),q.sortIndex=q.expirationTime,a(m,q);else break;q=i(g)}}function z(B){if(E=!1,D(B),!C)if(i(m)!==null)C=!0,Y||(Y=!0,ae());else{var q=i(g);q!==null&&te(z,q.startTime-B)}}var Y=!1,R=-1,O=5,G=-1;function ee(){return N?!0:!(n.unstable_now()-G<O)}function ne(){if(N=!1,Y){var B=n.unstable_now();G=B;var q=!0;try{e:{C=!1,E&&(E=!1,A(R),R=-1),S=!0;var U=b;try{t:{for(D(B),v=i(m);v!==null&&!(v.expirationTime>B&&ee());){var re=v.callback;if(typeof re=="function"){v.callback=null,b=v.priorityLevel;var I=re(v.expirationTime<=B);if(B=n.unstable_now(),typeof I=="function"){v.callback=I,D(B),q=!0;break t}v===i(m)&&o(m),D(B)}else o(m);v=i(m)}if(v!==null)q=!0;else{var ie=i(g);ie!==null&&te(z,ie.startTime-B),q=!1}}break e}finally{v=null,b=U,S=!1}q=void 0}}finally{q?ae():Y=!1}}}var ae;if(typeof M=="function")ae=function(){M(ne)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,W=oe.port2;oe.port1.onmessage=ne,ae=function(){W.postMessage(null)}}else ae=function(){k(ne,0)};function te(B,q){R=k(function(){B(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(B){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var U=b;b=q;try{return B()}finally{b=U}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(B,q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var U=b;b=B;try{return q()}finally{b=U}},n.unstable_scheduleCallback=function(B,q,U){var re=n.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?re+U:re):U=re,B){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=U+I,B={id:y++,callback:q,priorityLevel:B,startTime:U,expirationTime:I,sortIndex:-1},U>re?(B.sortIndex=U,a(g,B),i(m)===null&&B===i(g)&&(E?(A(R),R=-1):E=!0,te(z,U-re))):(B.sortIndex=I,a(m,B),C||S||(C=!0,Y||(Y=!0,ae()))),B},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(B){var q=b;return function(){var U=b;b=q;try{return B.apply(this,arguments)}finally{b=U}}}})(Gd)),Gd}var qv;function PS(){return qv||(qv=1,Hd.exports=GS()),Hd.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-dom-client.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Yv;function $S(){if(Yv)return Ul;Yv=1;var n=PS(),a=DS(),i=IS();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(f(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,l=t;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){s=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return m(d),e;if(h===l)return m(d),t;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=d,l=h;else{for(var x=!1,T=d.child;T;){if(T===s){x=!0,s=d,l=h;break}if(T===l){x=!0,l=d,s=h;break}T=T.sibling}if(!x){for(T=h.child;T;){if(T===s){x=!0,s=h,l=d;break}if(T===l){x=!0,l=h,s=d;break}T=T.sibling}if(!x)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),M=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case z:return"Suspense";case Y:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case M:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var te=Array.isArray,B=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},re=[],I=-1;function ie(e){return{current:e}}function he(e){0>I||(e.current=re[I],re[I]=null,I--)}function se(e,t){I++,re[I]=e.current,e.current=t}var He=ie(null),gt=ie(null),$t=ie(null),Rn=ie(null);function Yn(e,t){switch(se($t,t),se(gt,e),se(He,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dv(t),e=fv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}he(He),se(He,e)}function Jt(){he(He),he(gt),he($t)}function Te(e){e.memoizedState!==null&&se(Rn,e);var t=He.current,s=fv(t,e.type);t!==s&&(se(gt,e),se(He,s))}function rt(e){gt.current===e&&(he(He),he(gt)),Rn.current===e&&(he(Rn),Bl._currentValue=U)}var Ms,Rs;function On(e){if(Ms===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ms=t&&t[1]||"",Rs=-1<s.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+Ms+e+Rs}var Os=!1;function Bs(e,t){if(!e||Os)return"";Os=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(F){var $=F}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(F){$=F}e.call(Q.prototype)}}else{try{throw Error()}catch(F){$=F}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(F){if(F&&$&&typeof F.stack=="string")return[F.stack,$.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),x=h[0],T=h[1];if(x&&T){var j=x.split(`
|
|
20
|
+
`),P=T.split(`
|
|
21
|
+
`);for(d=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;if(l===j.length||d===P.length)for(l=j.length-1,d=P.length-1;1<=l&&0<=d&&j[l]!==P[d];)d--;for(;1<=l&&0<=d;l--,d--)if(j[l]!==P[d]){if(l!==1||d!==1)do if(l--,d--,0>d||j[l]!==P[d]){var K=`
|
|
22
|
+
`+j[l].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=l&&0<=d);break}}}finally{Os=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?On(s):""}function So(e,t){switch(e.tag){case 26:case 27:case 5:return On(e.type);case 16:return On("Lazy");case 13:return e.child!==t&&t!==null?On("Suspense Fallback"):On("Suspense");case 19:return On("SuspenseList");case 0:case 15:return Bs(e.type,!1);case 11:return Bs(e.type.render,!1);case 1:return Bs(e.type,!0);case 31:return On("Activity");default:return""}}function Yi(e){try{var t="",s=null;do t+=So(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
|
|
23
|
+
Error generating stack: `+l.message+`
|
|
24
|
+
`+l.stack}}var Is=Object.prototype.hasOwnProperty,Ls=n.unstable_scheduleCallback,zs=n.unstable_cancelCallback,To=n.unstable_shouldYield,ko=n.unstable_requestPaint,Bt=n.unstable_now,Nc=n.unstable_getCurrentPriorityLevel,X=n.unstable_ImmediatePriority,le=n.unstable_UserBlockingPriority,ce=n.unstable_NormalPriority,xe=n.unstable_LowPriority,be=n.unstable_IdlePriority,Ze=n.log,ke=n.unstable_setDisableYieldValue,ft=null,Ce=null;function lt(e){if(typeof Ze=="function"&&ke(e),Ce&&typeof Ce.setStrictMode=="function")try{Ce.setStrictMode(ft,e)}catch{}}var Fe=Math.clz32?Math.clz32:It,Vt=Math.log,en=Math.LN2;function It(e){return e>>>=0,e===0?32:31-(Vt(e)/en|0)|0}var xa=256,pn=262144,_a=4194304;function as(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Co(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var d=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var T=l&134217727;return T!==0?(l=T&~h,l!==0?d=as(l):(x&=T,x!==0?d=as(x):s||(s=T&~e,s!==0&&(d=as(s))))):(T=l&~h,T!==0?d=as(T):x!==0?d=as(x):s||(s=l&~e,s!==0&&(d=as(s)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:d}function Ki(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function y_(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qh(){var e=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),e}function Ac(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Zi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function b_(e,t,s,l,d,h){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var T=e.entanglements,j=e.expirationTimes,P=e.hiddenUpdates;for(s=x&~s;0<s;){var K=31-Fe(s),Q=1<<K;T[K]=0,j[K]=-1;var $=P[K];if($!==null)for(P[K]=null,K=0;K<$.length;K++){var F=$[K];F!==null&&(F.lane&=-536870913)}s&=~Q}l!==0&&Yh(e,l,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~t))}function Yh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Fe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function Kh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-Fe(s),d=1<<l;d&t|e[l]&t&&(e[l]|=t),s&=~d}}function Zh(e,t){var s=t&-t;return s=(s&42)!==0?1:jc(s),(s&(e.suspendedLanes|t))!==0?0:s}function jc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xh(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Bv(e.type))}function Qh(e,t){var s=q.p;try{return q.p=e,t()}finally{q.p=s}}var Sa=Math.random().toString(36).slice(2),jt="__reactFiber$"+Sa,Ft="__reactProps$"+Sa,Us="__reactContainer$"+Sa,Dc="__reactEvents$"+Sa,x_="__reactListeners$"+Sa,__="__reactHandles$"+Sa,Wh="__reactResources$"+Sa,Xi="__reactMarker$"+Sa;function Mc(e){delete e[jt],delete e[Ft],delete e[Dc],delete e[x_],delete e[__]}function Vs(e){var t=e[jt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Us]||s[jt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bv(e);e!==null;){if(s=e[jt])return s;e=bv(e)}return t}e=s,s=e.parentNode}return null}function Hs(e){if(e=e[jt]||e[Us]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Qi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Gs(e){var t=e[Wh];return t||(t=e[Wh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[Xi]=!0}var Jh=new Set,ep={};function ss(e,t){Ps(e,t),Ps(e+"Capture",t)}function Ps(e,t){for(ep[e]=t,e=0;e<t.length;e++)Jh.add(t[e])}var S_=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]*$"),tp={},np={};function T_(e){return Is.call(np,e)?!0:Is.call(tp,e)?!1:S_.test(e)?np[e]=!0:(tp[e]=!0,!1)}function Eo(e,t,s){if(T_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function No(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Kn(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function k_(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(x){s=""+x,h.call(this,x)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rc(e){if(!e._valueTracker){var t=ap(e)?"checked":"value";e._valueTracker=k_(e,t,""+e[t])}}function sp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=ap(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function Ao(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var C_=/[\n"\\]/g;function gn(e){return e.replace(C_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oc(e,t,s,l,d,h,x,T){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Bc(e,x,mn(t)):s!=null?Bc(e,x,mn(s)):l!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+mn(T):e.removeAttribute("name")}function ip(e,t,s,l,d,h,x,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Rc(e);return}s=s!=null?""+mn(s):"",t=t!=null?""+mn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=T?e.checked:!!l,e.defaultChecked=!!l,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),Rc(e)}function Bc(e,t,s){t==="number"&&Ao(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function $s(e,t,s,l){if(e=e.options,t){t={};for(var d=0;d<s.length;d++)t["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=t.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&l&&(e[s].defaultSelected=!0)}else{for(s=""+mn(s),t=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function lp(e,t,s){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+mn(s):""}function op(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(o(92));if(te(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=mn(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Rc(e)}function Fs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var E_=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 rp(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||E_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function cp(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var d in t)l=t[d],t.hasOwnProperty(d)&&s[d]!==l&&rp(e,d,l)}else for(var h in t)t.hasOwnProperty(h)&&rp(e,h,t[h])}function Ic(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var N_=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"]]),A_=/^[\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 jo(e){return A_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zn(){}var Lc=null;function zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qs=null,Ys=null;function up(e){var t=Hs(e);if(t&&(e=t.stateNode)){var s=e[Ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+gn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var d=l[Ft]||null;if(!d)throw Error(o(90));Oc(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&sp(l)}break e;case"textarea":lp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&$s(e,!!s.multiple,t,!1)}}}var Uc=!1;function dp(e,t,s){if(Uc)return e(t,s);Uc=!0;try{var l=e(t);return l}finally{if(Uc=!1,(qs!==null||Ys!==null)&&(gr(),qs&&(t=qs,e=Ys,Ys=qs=null,up(t),e)))for(t=0;t<e.length;t++)up(e[t])}}function Wi(e,t){var s=e.stateNode;if(s===null)return null;var l=s[Ft]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vc=!1;if(Xn)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Vc=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Vc=!1}var Ta=null,Hc=null,wo=null;function fp(){if(wo)return wo;var e,t=Hc,s=t.length,l,d="value"in Ta?Ta.value:Ta.textContent,h=d.length;for(e=0;e<s&&t[e]===d[e];e++);var x=s-e;for(l=1;l<=x&&t[s-l]===d[h-l];l++);return wo=d.slice(e,1<l?1-l:void 0)}function Do(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mo(){return!0}function hp(){return!1}function qt(e){function t(s,l,d,h,x){this._reactName=s,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Mo:hp,this.isPropagationStopped=hp,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Mo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ro=qt(is),el=v({},is,{view:0,detail:0}),j_=qt(el),Gc,Pc,tl,Oo=v({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==tl&&(tl&&e.type==="mousemove"?(Gc=e.screenX-tl.screenX,Pc=e.screenY-tl.screenY):Pc=Gc=0,tl=e),Gc)},movementY:function(e){return"movementY"in e?e.movementY:Pc}}),pp=qt(Oo),w_=v({},Oo,{dataTransfer:0}),D_=qt(w_),M_=v({},el,{relatedTarget:0}),$c=qt(M_),R_=v({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),O_=qt(R_),B_=v({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I_=qt(B_),L_=v({},is,{data:0}),mp=qt(L_),z_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U_={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"},V_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=V_[e])?!!t[e]:!1}function Fc(){return H_}var G_=v({},el,{key:function(e){if(e.key){var t=z_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?U_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fc,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P_=qt(G_),$_=v({},Oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=qt($_),F_=v({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fc}),q_=qt(F_),Y_=v({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),K_=qt(Y_),Z_=v({},Oo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),X_=qt(Z_),Q_=v({},is,{newState:0,oldState:0}),W_=qt(Q_),J_=[9,13,27,32],qc=Xn&&"CompositionEvent"in window,nl=null;Xn&&"documentMode"in document&&(nl=document.documentMode);var e1=Xn&&"TextEvent"in window&&!nl,vp=Xn&&(!qc||nl&&8<nl&&11>=nl),yp=" ",bp=!1;function xp(e,t){switch(e){case"keyup":return J_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function t1(e,t){switch(e){case"compositionend":return _p(t);case"keypress":return t.which!==32?null:(bp=!0,yp);case"textInput":return e=t.data,e===yp&&bp?null:e;default:return null}}function n1(e,t){if(Ks)return e==="compositionend"||!qc&&xp(e,t)?(e=fp(),wo=Hc=Ta=null,Ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vp&&t.locale!=="ko"?null:t.data;default:return null}}var a1={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 Sp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!a1[e.type]:t==="textarea"}function Tp(e,t,s,l){qs?Ys?Ys.push(l):Ys=[l]:qs=l,t=Tr(t,"onChange"),0<t.length&&(s=new Ro("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var al=null,sl=null;function s1(e){iv(e,0)}function Bo(e){var t=Qi(e);if(sp(t))return e}function kp(e,t){if(e==="change")return t}var Cp=!1;if(Xn){var Yc;if(Xn){var Kc="oninput"in document;if(!Kc){var Ep=document.createElement("div");Ep.setAttribute("oninput","return;"),Kc=typeof Ep.oninput=="function"}Yc=Kc}else Yc=!1;Cp=Yc&&(!document.documentMode||9<document.documentMode)}function Np(){al&&(al.detachEvent("onpropertychange",Ap),sl=al=null)}function Ap(e){if(e.propertyName==="value"&&Bo(sl)){var t=[];Tp(t,sl,e,zc(e)),dp(s1,t)}}function i1(e,t,s){e==="focusin"?(Np(),al=t,sl=s,al.attachEvent("onpropertychange",Ap)):e==="focusout"&&Np()}function l1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bo(sl)}function o1(e,t){if(e==="click")return Bo(t)}function r1(e,t){if(e==="input"||e==="change")return Bo(t)}function c1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:c1;function il(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var d=s[l];if(!Is.call(t,d)||!tn(e[d],t[d]))return!1}return!0}function jp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wp(e,t){var s=jp(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=jp(s)}}function Dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ao(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ao(e.document)}return t}function Zc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var u1=Xn&&"documentMode"in document&&11>=document.documentMode,Zs=null,Xc=null,ll=null,Qc=!1;function Rp(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Qc||Zs==null||Zs!==Ao(l)||(l=Zs,"selectionStart"in l&&Zc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ll&&il(ll,l)||(ll=l,l=Tr(Xc,"onSelect"),0<l.length&&(t=new Ro("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Zs)))}function ls(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Xs={animationend:ls("Animation","AnimationEnd"),animationiteration:ls("Animation","AnimationIteration"),animationstart:ls("Animation","AnimationStart"),transitionrun:ls("Transition","TransitionRun"),transitionstart:ls("Transition","TransitionStart"),transitioncancel:ls("Transition","TransitionCancel"),transitionend:ls("Transition","TransitionEnd")},Wc={},Op={};Xn&&(Op=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function os(e){if(Wc[e])return Wc[e];if(!Xs[e])return e;var t=Xs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Op)return Wc[e]=t[s];return e}var Bp=os("animationend"),Ip=os("animationiteration"),Lp=os("animationstart"),d1=os("transitionrun"),f1=os("transitionstart"),h1=os("transitioncancel"),zp=os("transitionend"),Up=new Map,Jc="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(" ");Jc.push("scrollEnd");function jn(e,t){Up.set(e,t),ss(t,[e])}var Io=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],Qs=0,eu=0;function Lo(){for(var e=Qs,t=eu=Qs=0;t<e;){var s=vn[t];vn[t++]=null;var l=vn[t];vn[t++]=null;var d=vn[t];vn[t++]=null;var h=vn[t];if(vn[t++]=null,l!==null&&d!==null){var x=l.pending;x===null?d.next=d:(d.next=x.next,x.next=d),l.pending=d}h!==0&&Vp(s,d,h)}}function zo(e,t,s,l){vn[Qs++]=e,vn[Qs++]=t,vn[Qs++]=s,vn[Qs++]=l,eu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function tu(e,t,s,l){return zo(e,t,s,l),Uo(e)}function rs(e,t){return zo(e,null,null,t),Uo(e)}function Vp(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var d=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-Fe(s),e=h.hiddenUpdates,l=e[d],l===null?e[d]=[t]:l.push(t),t.lane=s|536870912),h):null}function Uo(e){if(50<Al)throw Al=0,ud=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ws={};function p1(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,s,l){return new p1(e,t,s,l)}function nu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var s=e.alternate;return s===null?(s=nn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Hp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vo(e,t,s,l,d,h){var x=0;if(l=e,typeof e=="function")nu(e)&&(x=1);else if(typeof e=="string")x=bS(e,s,He.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=nn(31,s,t,d),e.elementType=G,e.lanes=h,e;case E:return cs(s.children,d,h,t);case N:x=8,d|=24;break;case k:return e=nn(12,s,t,d|2),e.elementType=k,e.lanes=h,e;case z:return e=nn(13,s,t,d),e.elementType=z,e.lanes=h,e;case Y:return e=nn(19,s,t,d),e.elementType=Y,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:x=10;break e;case A:x=9;break e;case D:x=11;break e;case R:x=14;break e;case O:x=16,l=null;break e}x=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=nn(x,s,t,d),t.elementType=e,t.type=l,t.lanes=h,t}function cs(e,t,s,l){return e=nn(7,e,l,t),e.lanes=s,e}function au(e,t,s){return e=nn(6,e,null,t),e.lanes=s,e}function Gp(e){var t=nn(18,null,null,0);return t.stateNode=e,t}function su(e,t,s){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pp=new WeakMap;function yn(e,t){if(typeof e=="object"&&e!==null){var s=Pp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Yi(t)},Pp.set(e,t),t)}return{value:e,source:t,stack:Yi(t)}}var Js=[],ei=0,Ho=null,ol=0,bn=[],xn=0,ka=null,Bn=1,In="";function Wn(e,t){Js[ei++]=ol,Js[ei++]=Ho,Ho=e,ol=t}function $p(e,t,s){bn[xn++]=Bn,bn[xn++]=In,bn[xn++]=ka,ka=e;var l=Bn;e=In;var d=32-Fe(l)-1;l&=~(1<<d),s+=1;var h=32-Fe(t)+d;if(30<h){var x=d-d%5;h=(l&(1<<x)-1).toString(32),l>>=x,d-=x,Bn=1<<32-Fe(t)+d|s<<d|l,In=h+e}else Bn=1<<h|s<<d|l,In=e}function iu(e){e.return!==null&&(Wn(e,1),$p(e,1,0))}function lu(e){for(;e===Ho;)Ho=Js[--ei],Js[ei]=null,ol=Js[--ei],Js[ei]=null;for(;e===ka;)ka=bn[--xn],bn[xn]=null,In=bn[--xn],bn[xn]=null,Bn=bn[--xn],bn[xn]=null}function Fp(e,t){bn[xn++]=Bn,bn[xn++]=In,bn[xn++]=ka,Bn=t.id,In=t.overflow,ka=e}var wt=null,Je=null,De=!1,Ca=null,_n=!1,ou=Error(o(519));function Ea(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rl(yn(t,e)),ou}function qp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[jt]=e,t[Ft]=l,s){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(s=0;s<wl.length;s++)Ne(wl[s],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),ip(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),op(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||cv(t.textContent,s)?(l.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),l.onScroll!=null&&Ne("scroll",t),l.onScrollEnd!=null&&Ne("scrollend",t),l.onClick!=null&&(t.onclick=Zn),t=!0):t=!1,t||Ea(e,!0)}function Yp(e){for(wt=e.return;wt;)switch(wt.tag){case 5:case 31:case 13:_n=!1;return;case 27:case 3:_n=!0;return;default:wt=wt.return}}function ti(e){if(e!==wt)return!1;if(!De)return Yp(e),De=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Cd(e.type,e.memoizedProps)),s=!s),s&&Je&&Ea(e),Yp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Je=yv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Je=yv(e)}else t===27?(t=Je,Va(e.type)?(e=wd,wd=null,Je=e):Je=t):Je=wt?Tn(e.stateNode.nextSibling):null;return!0}function us(){Je=wt=null,De=!1}function ru(){var e=Ca;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Ca=null),e}function rl(e){Ca===null?Ca=[e]:Ca.push(e)}var cu=ie(null),ds=null,Jn=null;function Na(e,t,s){se(cu,t._currentValue),t._currentValue=s}function ea(e){e._currentValue=cu.current,he(cu)}function uu(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function du(e,t,s,l){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=d;for(var j=0;j<t.length;j++)if(T.context===t[j]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),uu(h.return,s,e),l||(x=null);break e}h=T.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(o(341));x.lanes|=s,h=x.alternate,h!==null&&(h.lanes|=s),uu(x,s,e),x=null}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===e){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function ni(e,t,s,l){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(o(387));if(x=x.memoizedProps,x!==null){var T=d.type;tn(d.pendingProps.value,x.value)||(e!==null?e.push(T):e=[T])}}else if(d===Rn.current){if(x=d.alternate,x===null)throw Error(o(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Bl):e=[Bl])}d=d.return}e!==null&&du(t,e,s,l),t.flags|=262144}function Go(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fs(e){ds=e,Jn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Kp(ds,e)}function Po(e,t){return ds===null&&fs(e),Kp(e,t)}function Kp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Jn===null){if(e===null)throw Error(o(308));Jn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jn=Jn.next=t;return s}var m1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},g1=n.unstable_scheduleCallback,v1=n.unstable_NormalPriority,vt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fu(){return{controller:new m1,data:new Map,refCount:0}}function cl(e){e.refCount--,e.refCount===0&&g1(v1,function(){e.controller.abort()})}var ul=null,hu=0,ai=0,si=null;function y1(e,t){if(ul===null){var s=ul=[];hu=0,ai=gd(),si={status:"pending",value:void 0,then:function(l){s.push(l)}}}return hu++,t.then(Zp,Zp),t}function Zp(){if(--hu===0&&ul!==null){si!==null&&(si.status="fulfilled");var e=ul;ul=null,ai=0,si=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function b1(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var d=0;d<s.length;d++)(0,s[d])(t)},function(d){for(l.status="rejected",l.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),l}var Xp=B.S;B.S=function(e,t){Rg=Bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&y1(e,t),Xp!==null&&Xp(e,t)};var hs=ie(null);function pu(){var e=hs.current;return e!==null?e:Xe.pooledCache}function $o(e,t){t===null?se(hs,hs.current):se(hs,t.pool)}function Qp(){var e=pu();return e===null?null:{parent:vt._currentValue,pool:e}}var ii=Error(o(460)),mu=Error(o(474)),Fo=Error(o(542)),qo={then:function(){}};function Wp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Jp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Zn,Zn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tm(e),e;default:if(typeof t.status=="string")t.then(Zn,Zn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=l}},function(l){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tm(e),e}throw ms=t,ii}}function ps(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ms=s,ii):s}}var ms=null;function em(){if(ms===null)throw Error(o(459));var e=ms;return ms=null,e}function tm(e){if(e===ii||e===Fo)throw Error(o(483))}var li=null,dl=0;function Yo(e){var t=dl;return dl+=1,li===null&&(li=[]),Jp(li,e,t)}function fl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ko(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nm(e){function t(L,w){if(e){var H=L.deletions;H===null?(L.deletions=[w],L.flags|=16):H.push(w)}}function s(L,w){if(!e)return null;for(;w!==null;)t(L,w),w=w.sibling;return null}function l(L){for(var w=new Map;L!==null;)L.key!==null?w.set(L.key,L):w.set(L.index,L),L=L.sibling;return w}function d(L,w){return L=Qn(L,w),L.index=0,L.sibling=null,L}function h(L,w,H){return L.index=H,e?(H=L.alternate,H!==null?(H=H.index,H<w?(L.flags|=67108866,w):H):(L.flags|=67108866,w)):(L.flags|=1048576,w)}function x(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function T(L,w,H,Z){return w===null||w.tag!==6?(w=au(H,L.mode,Z),w.return=L,w):(w=d(w,H),w.return=L,w)}function j(L,w,H,Z){var pe=H.type;return pe===E?K(L,w,H.props.children,Z,H.key):w!==null&&(w.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&ps(pe)===w.type)?(w=d(w,H.props),fl(w,H),w.return=L,w):(w=Vo(H.type,H.key,H.props,null,L.mode,Z),fl(w,H),w.return=L,w)}function P(L,w,H,Z){return w===null||w.tag!==4||w.stateNode.containerInfo!==H.containerInfo||w.stateNode.implementation!==H.implementation?(w=su(H,L.mode,Z),w.return=L,w):(w=d(w,H.children||[]),w.return=L,w)}function K(L,w,H,Z,pe){return w===null||w.tag!==7?(w=cs(H,L.mode,Z,pe),w.return=L,w):(w=d(w,H),w.return=L,w)}function Q(L,w,H){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=au(""+w,L.mode,H),w.return=L,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case S:return H=Vo(w.type,w.key,w.props,null,L.mode,H),fl(H,w),H.return=L,H;case C:return w=su(w,L.mode,H),w.return=L,w;case O:return w=ps(w),Q(L,w,H)}if(te(w)||ae(w))return w=cs(w,L.mode,H,null),w.return=L,w;if(typeof w.then=="function")return Q(L,Yo(w),H);if(w.$$typeof===M)return Q(L,Po(L,w),H);Ko(L,w)}return null}function $(L,w,H,Z){var pe=w!==null?w.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return pe!==null?null:T(L,w,""+H,Z);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return H.key===pe?j(L,w,H,Z):null;case C:return H.key===pe?P(L,w,H,Z):null;case O:return H=ps(H),$(L,w,H,Z)}if(te(H)||ae(H))return pe!==null?null:K(L,w,H,Z,null);if(typeof H.then=="function")return $(L,w,Yo(H),Z);if(H.$$typeof===M)return $(L,w,Po(L,H),Z);Ko(L,H)}return null}function F(L,w,H,Z,pe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return L=L.get(H)||null,T(w,L,""+Z,pe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return L=L.get(Z.key===null?H:Z.key)||null,j(w,L,Z,pe);case C:return L=L.get(Z.key===null?H:Z.key)||null,P(w,L,Z,pe);case O:return Z=ps(Z),F(L,w,H,Z,pe)}if(te(Z)||ae(Z))return L=L.get(H)||null,K(w,L,Z,pe,null);if(typeof Z.then=="function")return F(L,w,H,Yo(Z),pe);if(Z.$$typeof===M)return F(L,w,H,Po(w,Z),pe);Ko(w,Z)}return null}function ue(L,w,H,Z){for(var pe=null,Oe=null,fe=w,Se=w=0,we=null;fe!==null&&Se<H.length;Se++){fe.index>Se?(we=fe,fe=null):we=fe.sibling;var Be=$(L,fe,H[Se],Z);if(Be===null){fe===null&&(fe=we);break}e&&fe&&Be.alternate===null&&t(L,fe),w=h(Be,w,Se),Oe===null?pe=Be:Oe.sibling=Be,Oe=Be,fe=we}if(Se===H.length)return s(L,fe),De&&Wn(L,Se),pe;if(fe===null){for(;Se<H.length;Se++)fe=Q(L,H[Se],Z),fe!==null&&(w=h(fe,w,Se),Oe===null?pe=fe:Oe.sibling=fe,Oe=fe);return De&&Wn(L,Se),pe}for(fe=l(fe);Se<H.length;Se++)we=F(fe,L,Se,H[Se],Z),we!==null&&(e&&we.alternate!==null&&fe.delete(we.key===null?Se:we.key),w=h(we,w,Se),Oe===null?pe=we:Oe.sibling=we,Oe=we);return e&&fe.forEach(function(Fa){return t(L,Fa)}),De&&Wn(L,Se),pe}function ge(L,w,H,Z){if(H==null)throw Error(o(151));for(var pe=null,Oe=null,fe=w,Se=w=0,we=null,Be=H.next();fe!==null&&!Be.done;Se++,Be=H.next()){fe.index>Se?(we=fe,fe=null):we=fe.sibling;var Fa=$(L,fe,Be.value,Z);if(Fa===null){fe===null&&(fe=we);break}e&&fe&&Fa.alternate===null&&t(L,fe),w=h(Fa,w,Se),Oe===null?pe=Fa:Oe.sibling=Fa,Oe=Fa,fe=we}if(Be.done)return s(L,fe),De&&Wn(L,Se),pe;if(fe===null){for(;!Be.done;Se++,Be=H.next())Be=Q(L,Be.value,Z),Be!==null&&(w=h(Be,w,Se),Oe===null?pe=Be:Oe.sibling=Be,Oe=Be);return De&&Wn(L,Se),pe}for(fe=l(fe);!Be.done;Se++,Be=H.next())Be=F(fe,L,Se,Be.value,Z),Be!==null&&(e&&Be.alternate!==null&&fe.delete(Be.key===null?Se:Be.key),w=h(Be,w,Se),Oe===null?pe=Be:Oe.sibling=Be,Oe=Be);return e&&fe.forEach(function(wS){return t(L,wS)}),De&&Wn(L,Se),pe}function Ke(L,w,H,Z){if(typeof H=="object"&&H!==null&&H.type===E&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case S:e:{for(var pe=H.key;w!==null;){if(w.key===pe){if(pe=H.type,pe===E){if(w.tag===7){s(L,w.sibling),Z=d(w,H.props.children),Z.return=L,L=Z;break e}}else if(w.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&ps(pe)===w.type){s(L,w.sibling),Z=d(w,H.props),fl(Z,H),Z.return=L,L=Z;break e}s(L,w);break}else t(L,w);w=w.sibling}H.type===E?(Z=cs(H.props.children,L.mode,Z,H.key),Z.return=L,L=Z):(Z=Vo(H.type,H.key,H.props,null,L.mode,Z),fl(Z,H),Z.return=L,L=Z)}return x(L);case C:e:{for(pe=H.key;w!==null;){if(w.key===pe)if(w.tag===4&&w.stateNode.containerInfo===H.containerInfo&&w.stateNode.implementation===H.implementation){s(L,w.sibling),Z=d(w,H.children||[]),Z.return=L,L=Z;break e}else{s(L,w);break}else t(L,w);w=w.sibling}Z=su(H,L.mode,Z),Z.return=L,L=Z}return x(L);case O:return H=ps(H),Ke(L,w,H,Z)}if(te(H))return ue(L,w,H,Z);if(ae(H)){if(pe=ae(H),typeof pe!="function")throw Error(o(150));return H=pe.call(H),ge(L,w,H,Z)}if(typeof H.then=="function")return Ke(L,w,Yo(H),Z);if(H.$$typeof===M)return Ke(L,w,Po(L,H),Z);Ko(L,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,w!==null&&w.tag===6?(s(L,w.sibling),Z=d(w,H),Z.return=L,L=Z):(s(L,w),Z=au(H,L.mode,Z),Z.return=L,L=Z),x(L)):s(L,w)}return function(L,w,H,Z){try{dl=0;var pe=Ke(L,w,H,Z);return li=null,pe}catch(fe){if(fe===ii||fe===Fo)throw fe;var Oe=nn(29,fe,null,L.mode);return Oe.lanes=Z,Oe.return=L,Oe}finally{}}}var gs=nm(!0),am=nm(!1),Aa=!1;function gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wa(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ue&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,t=Uo(e),Vp(e,null,s),t}return zo(e,l,t,s),Uo(e)}function hl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Kh(e,s)}}function yu(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var bu=!1;function pl(){if(bu){var e=si;if(e!==null)throw e}}function ml(e,t,s,l){bu=!1;var d=e.updateQueue;Aa=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var j=T,P=j.next;j.next=null,x===null?h=P:x.next=P,x=j;var K=e.alternate;K!==null&&(K=K.updateQueue,T=K.lastBaseUpdate,T!==x&&(T===null?K.firstBaseUpdate=P:T.next=P,K.lastBaseUpdate=j))}if(h!==null){var Q=d.baseState;x=0,K=P=j=null,T=h;do{var $=T.lane&-536870913,F=$!==T.lane;if(F?(je&$)===$:(l&$)===$){$!==0&&$===ai&&(bu=!0),K!==null&&(K=K.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ue=e,ge=T;$=t;var Ke=s;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){Q=ue.call(Ke,Q,$);break e}Q=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,$=typeof ue=="function"?ue.call(Ke,Q,$):ue,$==null)break e;Q=v({},Q,$);break e;case 2:Aa=!0}}$=T.callback,$!==null&&(e.flags|=64,F&&(e.flags|=8192),F=d.callbacks,F===null?d.callbacks=[$]:F.push($))}else F={lane:$,tag:T.tag,payload:T.payload,callback:T.callback,next:null},K===null?(P=K=F,j=Q):K=K.next=F,x|=$;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;F=T,T=F.next,F.next=null,d.lastBaseUpdate=F,d.shared.pending=null}}while(!0);K===null&&(j=Q),d.baseState=j,d.firstBaseUpdate=P,d.lastBaseUpdate=K,h===null&&(d.shared.lanes=0),Ba|=x,e.lanes=x,e.memoizedState=Q}}function sm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function im(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)sm(s[e],t)}var oi=ie(null),Zo=ie(0);function lm(e,t){e=ca,se(Zo,e),se(oi,t),ca=e|t.baseLanes}function xu(){se(Zo,ca),se(oi,oi.current)}function _u(){ca=Zo.current,he(oi),he(Zo)}var an=ie(null),Sn=null;function Da(e){var t=e.alternate;se(ht,ht.current&1),se(an,e),Sn===null&&(t===null||oi.current!==null||t.memoizedState!==null)&&(Sn=e)}function Su(e){se(ht,ht.current),se(an,e),Sn===null&&(Sn=e)}function om(e){e.tag===22?(se(ht,ht.current),se(an,e),Sn===null&&(Sn=e)):Ma()}function Ma(){se(ht,ht.current),se(an,an.current)}function sn(e){he(an),Sn===e&&(Sn=null),he(ht)}var ht=ie(0);function Xo(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ad(s)||jd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ta=0,_e=null,qe=null,yt=null,Qo=!1,ri=!1,vs=!1,Wo=0,gl=0,ci=null,x1=0;function ct(){throw Error(o(321))}function Tu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!tn(e[s],t[s]))return!1;return!0}function ku(e,t,s,l,d,h){return ta=h,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?$m:Uu,vs=!1,h=s(l,d),vs=!1,ri&&(h=cm(t,s,l,d)),rm(e),h}function rm(e){B.H=bl;var t=qe!==null&&qe.next!==null;if(ta=0,yt=qe=_e=null,Qo=!1,gl=0,ci=null,t)throw Error(o(300));e===null||bt||(e=e.dependencies,e!==null&&Go(e)&&(bt=!0))}function cm(e,t,s,l){_e=e;var d=0;do{if(ri&&(ci=null),gl=0,ri=!1,25<=d)throw Error(o(301));if(d+=1,yt=qe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}B.H=Fm,h=t(s,l)}while(ri);return h}function _1(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?vl(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(_e.flags|=1024),t}function Cu(){var e=Wo!==0;return Wo=0,e}function Eu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Nu(e){if(Qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qo=!1}ta=0,yt=qe=_e=null,ri=!1,gl=Wo=0,ci=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?_e.memoizedState=yt=e:yt=yt.next=e,yt}function pt(){if(qe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=yt===null?_e.memoizedState:yt.next;if(t!==null)yt=t,qe=e;else{if(e===null)throw _e.alternate===null?Error(o(467)):Error(o(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},yt===null?_e.memoizedState=yt=e:yt=yt.next=e}return yt}function Jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vl(e){var t=gl;return gl+=1,ci===null&&(ci=[]),e=Jp(ci,e,t),t=_e,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?$m:Uu),e}function er(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vl(e);if(e.$$typeof===M)return Dt(e)}throw Error(o(438,String(e)))}function Au(e){var t=null,s=_e.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=_e.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Jo(),_e.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=ee;return t.index++,s}function na(e,t){return typeof t=="function"?t(e):t}function tr(e){var t=pt();return ju(t,qe,e)}function ju(e,t,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var d=e.baseQueue,h=l.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}t.baseQueue=d=h,l.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var T=x=null,j=null,P=t,K=!1;do{var Q=P.lane&-536870913;if(Q!==P.lane?(je&Q)===Q:(ta&Q)===Q){var $=P.revertLane;if($===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),Q===ai&&(K=!0);else if((ta&$)===$){P=P.next,$===ai&&(K=!0);continue}else Q={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},j===null?(T=j=Q,x=h):j=j.next=Q,_e.lanes|=$,Ba|=$;Q=P.action,vs&&s(h,Q),h=P.hasEagerState?P.eagerState:s(h,Q)}else $={lane:Q,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},j===null?(T=j=$,x=h):j=j.next=$,_e.lanes|=Q,Ba|=Q;P=P.next}while(P!==null&&P!==t);if(j===null?x=h:j.next=T,!tn(h,e.memoizedState)&&(bt=!0,K&&(s=si,s!==null)))throw s;e.memoizedState=h,e.baseState=x,e.baseQueue=j,l.lastRenderedState=h}return d===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function wu(e){var t=pt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,d=s.pending,h=t.memoizedState;if(d!==null){s.pending=null;var x=d=d.next;do h=e(h,x.action),x=x.next;while(x!==d);tn(h,t.memoizedState)||(bt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,l]}function um(e,t,s){var l=_e,d=pt(),h=De;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=t();var x=!tn((qe||d).memoizedState,s);if(x&&(d.memoizedState=s,bt=!0),d=d.queue,Ru(hm.bind(null,l,d,e),[e]),d.getSnapshot!==t||x||yt!==null&&yt.memoizedState.tag&1){if(l.flags|=2048,ui(9,{destroy:void 0},fm.bind(null,l,d,s,t),null),Xe===null)throw Error(o(349));h||(ta&127)!==0||dm(l,t,s)}return s}function dm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_e.updateQueue,t===null?(t=Jo(),_e.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function fm(e,t,s,l){t.value=s,t.getSnapshot=l,pm(t)&&mm(e)}function hm(e,t,s){return s(function(){pm(t)&&mm(e)})}function pm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!tn(e,s)}catch{return!0}}function mm(e){var t=rs(e,2);t!==null&&Qt(t,e,2)}function Du(e){var t=Ht();if(typeof e=="function"){var s=e;if(e=s(),vs){lt(!0);try{s()}finally{lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:e},t}function gm(e,t,s,l){return e.baseState=s,ju(e,qe,typeof l=="function"?l:na)}function S1(e,t,s,l,d){if(sr(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};B.T!==null?s(!0):h.isTransition=!1,l(h),s=t.pending,s===null?(h.next=t.pending=h,vm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function vm(e,t){var s=t.action,l=t.payload,d=e.state;if(t.isTransition){var h=B.T,x={};B.T=x;try{var T=s(d,l),j=B.S;j!==null&&j(x,T),ym(e,t,T)}catch(P){Mu(e,t,P)}finally{h!==null&&x.types!==null&&(h.types=x.types),B.T=h}}else try{h=s(d,l),ym(e,t,h)}catch(P){Mu(e,t,P)}}function ym(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){bm(e,t,l)},function(l){return Mu(e,t,l)}):bm(e,t,s)}function bm(e,t,s){t.status="fulfilled",t.value=s,xm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,vm(e,s)))}function Mu(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,xm(t),t=t.next;while(t!==l)}e.action=null}function xm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _m(e,t){return t}function Sm(e,t){if(De){var s=Xe.formState;if(s!==null){e:{var l=_e;if(De){if(Je){t:{for(var d=Je,h=_n;d.nodeType!==8;){if(!h){d=null;break t}if(d=Tn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Je=Tn(d.nextSibling),l=d.data==="F!";break e}}Ea(l)}l=!1}l&&(t=s[0])}}return s=Ht(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_m,lastRenderedState:t},s.queue=l,s=Hm.bind(null,_e,l),l.dispatch=s,l=Du(!1),h=zu.bind(null,_e,!1,l.queue),l=Ht(),d={state:t,dispatch:null,action:e,pending:null},l.queue=d,s=S1.bind(null,_e,d,h,s),d.dispatch=s,l.memoizedState=e,[t,s,!1]}function Tm(e){var t=pt();return km(t,qe,e)}function km(e,t,s){if(t=ju(e,t,_m)[0],e=tr(na)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=vl(t)}catch(x){throw x===ii?Fo:x}else l=t;t=pt();var d=t.queue,h=d.dispatch;return s!==t.memoizedState&&(_e.flags|=2048,ui(9,{destroy:void 0},T1.bind(null,d,s),null)),[l,h,e]}function T1(e,t){e.action=t}function Cm(e){var t=pt(),s=qe;if(s!==null)return km(t,s,e);pt(),t=t.memoizedState,s=pt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function ui(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=_e.updateQueue,t===null&&(t=Jo(),_e.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Em(){return pt().memoizedState}function nr(e,t,s,l){var d=Ht();_e.flags|=e,d.memoizedState=ui(1|t,{destroy:void 0},s,l===void 0?null:l)}function ar(e,t,s,l){var d=pt();l=l===void 0?null:l;var h=d.memoizedState.inst;qe!==null&&l!==null&&Tu(l,qe.memoizedState.deps)?d.memoizedState=ui(t,h,s,l):(_e.flags|=e,d.memoizedState=ui(1|t,h,s,l))}function Nm(e,t){nr(8390656,8,e,t)}function Ru(e,t){ar(2048,8,e,t)}function k1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=Jo(),_e.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Am(e){var t=pt().memoizedState;return k1({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function jm(e,t){return ar(4,2,e,t)}function wm(e,t){return ar(4,4,e,t)}function Dm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mm(e,t,s){s=s!=null?s.concat([e]):null,ar(4,4,Dm.bind(null,t,e),s)}function Ou(){}function Rm(e,t){var s=pt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&Tu(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Om(e,t){var s=pt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&Tu(t,l[1]))return l[0];if(l=e(),vs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[l,t],l}function Bu(e,t,s){return s===void 0||(ta&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Bg(),_e.lanes|=e,Ba|=e,s)}function Bm(e,t,s,l){return tn(s,t)?s:oi.current!==null?(e=Bu(e,s,l),tn(e,t)||(bt=!0),e):(ta&42)===0||(ta&1073741824)!==0&&(je&261930)===0?(bt=!0,e.memoizedState=s):(e=Bg(),_e.lanes|=e,Ba|=e,t)}function Im(e,t,s,l,d){var h=q.p;q.p=h!==0&&8>h?h:8;var x=B.T,T={};B.T=T,zu(e,!1,t,s);try{var j=d(),P=B.S;if(P!==null&&P(T,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var K=b1(j,l);yl(e,t,K,rn(e))}else yl(e,t,l,rn(e))}catch(Q){yl(e,t,{then:function(){},status:"rejected",reason:Q},rn())}finally{q.p=h,x!==null&&T.types!==null&&(x.types=T.types),B.T=x}}function C1(){}function Iu(e,t,s,l){if(e.tag!==5)throw Error(o(476));var d=Lm(e).queue;Im(e,d,t,U,s===null?C1:function(){return zm(e),s(l)})}function Lm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:U},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zm(e){var t=Lm(e);t.next===null&&(t=e.alternate.memoizedState),yl(e,t.next.queue,{},rn())}function Lu(){return Dt(Bl)}function Um(){return pt().memoizedState}function Vm(){return pt().memoizedState}function E1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=rn();e=ja(s);var l=wa(t,e,s);l!==null&&(Qt(l,t,s),hl(l,t,s)),t={cache:fu()},e.payload=t;return}t=t.return}}function N1(e,t,s){var l=rn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sr(e)?Gm(t,s):(s=tu(e,t,s,l),s!==null&&(Qt(s,e,l),Pm(s,t,l)))}function Hm(e,t,s){var l=rn();yl(e,t,s,l)}function yl(e,t,s,l){var d={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(sr(e))Gm(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var x=t.lastRenderedState,T=h(x,s);if(d.hasEagerState=!0,d.eagerState=T,tn(T,x))return zo(e,t,d,0),Xe===null&&Lo(),!1}catch{}finally{}if(s=tu(e,t,d,l),s!==null)return Qt(s,e,l),Pm(s,t,l),!0}return!1}function zu(e,t,s,l){if(l={lane:2,revertLane:gd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},sr(e)){if(t)throw Error(o(479))}else t=tu(e,s,l,2),t!==null&&Qt(t,e,2)}function sr(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Gm(e,t){ri=Qo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Pm(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,Kh(e,s)}}var bl={readContext:Dt,use:er,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};bl.useEffectEvent=ct;var $m={readContext:Dt,use:er,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Nm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,nr(4194308,4,Dm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return nr(4194308,4,e,t)},useInsertionEffect:function(e,t){nr(4,2,e,t)},useMemo:function(e,t){var s=Ht();t=t===void 0?null:t;var l=e();if(vs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Ht();if(s!==void 0){var d=s(t);if(vs){lt(!0);try{s(t)}finally{lt(!1)}}}else d=t;return l.memoizedState=l.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},l.queue=e,e=e.dispatch=N1.bind(null,_e,e),[l.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Du(e);var t=e.queue,s=Hm.bind(null,_e,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Ou,useDeferredValue:function(e,t){var s=Ht();return Bu(s,e,t)},useTransition:function(){var e=Du(!1);return e=Im.bind(null,_e,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=_e,d=Ht();if(De){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Xe===null)throw Error(o(349));(je&127)!==0||dm(l,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,Nm(hm.bind(null,l,h,e),[e]),l.flags|=2048,ui(9,{destroy:void 0},fm.bind(null,l,h,s,t),null),s},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(De){var s=In,l=Bn;s=(l&~(1<<32-Fe(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Wo++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=x1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Lu,useFormState:Sm,useActionState:Sm,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=zu.bind(null,_e,!0,s),s.dispatch=t,[e,t]},useMemoCache:Au,useCacheRefresh:function(){return Ht().memoizedState=E1.bind(null,_e)},useEffectEvent:function(e){var t=Ht(),s={impl:e};return t.memoizedState=s,function(){if((Ue&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Uu={readContext:Dt,use:er,useCallback:Rm,useContext:Dt,useEffect:Ru,useImperativeHandle:Mm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Om,useReducer:tr,useRef:Em,useState:function(){return tr(na)},useDebugValue:Ou,useDeferredValue:function(e,t){var s=pt();return Bm(s,qe.memoizedState,e,t)},useTransition:function(){var e=tr(na)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:vl(e),t]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:Lu,useFormState:Tm,useActionState:Tm,useOptimistic:function(e,t){var s=pt();return gm(s,qe,e,t)},useMemoCache:Au,useCacheRefresh:Vm};Uu.useEffectEvent=Am;var Fm={readContext:Dt,use:er,useCallback:Rm,useContext:Dt,useEffect:Ru,useImperativeHandle:Mm,useInsertionEffect:jm,useLayoutEffect:wm,useMemo:Om,useReducer:wu,useRef:Em,useState:function(){return wu(na)},useDebugValue:Ou,useDeferredValue:function(e,t){var s=pt();return qe===null?Bu(s,e,t):Bm(s,qe.memoizedState,e,t)},useTransition:function(){var e=wu(na)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:vl(e),t]},useSyncExternalStore:um,useId:Um,useHostTransitionStatus:Lu,useFormState:Cm,useActionState:Cm,useOptimistic:function(e,t){var s=pt();return qe!==null?gm(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Au,useCacheRefresh:Vm};Fm.useEffectEvent=Am;function Vu(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Hu={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=rn(),d=ja(l);d.payload=t,s!=null&&(d.callback=s),t=wa(e,d,l),t!==null&&(Qt(t,e,l),hl(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=rn(),d=ja(l);d.tag=1,d.payload=t,s!=null&&(d.callback=s),t=wa(e,d,l),t!==null&&(Qt(t,e,l),hl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=rn(),l=ja(s);l.tag=2,t!=null&&(l.callback=t),t=wa(e,l,s),t!==null&&(Qt(t,e,s),hl(t,e,s))}};function qm(e,t,s,l,d,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,x):t.prototype&&t.prototype.isPureReactComponent?!il(s,l)||!il(d,h):!0}function Ym(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Hu.enqueueReplaceState(t,t.state,null)}function ys(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Km(e){Io(e)}function Zm(e){console.error(e)}function Xm(e){Io(e)}function ir(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Qm(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Gu(e,t,s){return s=ja(s),s.tag=3,s.payload={element:null},s.callback=function(){ir(e,t)},s}function Wm(e){return e=ja(e),e.tag=3,e}function Jm(e,t,s,l){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;e.payload=function(){return d(h)},e.callback=function(){Qm(t,s,l)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Qm(t,s,l),typeof d!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function A1(e,t,s,l,d){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&ni(t,s,d,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return Sn===null?vr():s.alternate===null&&ut===0&&(ut=3),s.flags&=-257,s.flags|=65536,s.lanes=d,l===qo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),hd(e,l,d)),!1;case 22:return s.flags|=65536,l===qo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),hd(e,l,d)),!1}throw Error(o(435,s.tag))}return hd(e,l,d),vr(),!1}if(De)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,l!==ou&&(e=Error(o(422),{cause:l}),rl(yn(e,s)))):(l!==ou&&(t=Error(o(423),{cause:l}),rl(yn(t,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,l=yn(l,s),d=Gu(e.stateNode,l,d),yu(e,d),ut!==4&&(ut=2)),!1;var h=Error(o(520),{cause:l});if(h=yn(h,s),Nl===null?Nl=[h]:Nl.push(h),ut!==4&&(ut=2),t===null)return!0;l=yn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=Gu(s.stateNode,l,e),yu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ia===null||!Ia.has(h))))return s.flags|=65536,d&=-d,s.lanes|=d,d=Wm(d),Jm(d,e,s,l),yu(s,d),!1}s=s.return}while(s!==null);return!1}var Pu=Error(o(461)),bt=!1;function Mt(e,t,s,l){t.child=e===null?am(t,null,s,l):gs(t,e.child,s,l)}function eg(e,t,s,l,d){s=s.render;var h=t.ref;if("ref"in l){var x={};for(var T in l)T!=="ref"&&(x[T]=l[T])}else x=l;return fs(t),l=ku(e,t,s,x,h,d),T=Cu(),e!==null&&!bt?(Eu(e,t,d),aa(e,t,d)):(De&&T&&iu(t),t.flags|=1,Mt(e,t,l,d),t.child)}function tg(e,t,s,l,d){if(e===null){var h=s.type;return typeof h=="function"&&!nu(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,ng(e,t,h,l,d)):(e=Vo(s.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Qu(e,d)){var x=h.memoizedProps;if(s=s.compare,s=s!==null?s:il,s(x,l)&&e.ref===t.ref)return aa(e,t,d)}return t.flags|=1,e=Qn(h,l),e.ref=t.ref,e.return=t,t.child=e}function ng(e,t,s,l,d){if(e!==null){var h=e.memoizedProps;if(il(h,l)&&e.ref===t.ref)if(bt=!1,t.pendingProps=l=h,Qu(e,d))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,aa(e,t,d)}return $u(e,t,s,l,d)}function ag(e,t,s,l){var d=l.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=t.child=e.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,t.child=null;return sg(e,t,h,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$o(t,h!==null?h.cachePool:null),h!==null?lm(t,h):xu(),om(t);else return l=t.lanes=536870912,sg(e,t,h!==null?h.baseLanes|s:s,s,l)}else h!==null?($o(t,h.cachePool),lm(t,h),Ma(),t.memoizedState=null):(e!==null&&$o(t,null),xu(),Ma());return Mt(e,t,d,s),t.child}function xl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sg(e,t,s,l,d){var h=pu();return h=h===null?null:{parent:vt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&$o(t,null),xu(),om(t),e!==null&&ni(e,t,l,!0),t.childLanes=d,null}function lr(e,t){return t=rr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ig(e,t,s){return gs(t,e.child,null,s),e=lr(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function j1(e,t,s){var l=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(l.mode==="hidden")return e=lr(t,l),t.lanes=536870912,xl(null,e);if(Su(t),(e=Je)?(e=vv(e,_n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:Bn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Gp(e),s.return=t,t.child=s,wt=t,Je=null)):e=null,e===null)throw Ea(t);return t.lanes=536870912,null}return lr(t,l)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Su(t),d)if(t.flags&256)t.flags&=-257,t=ig(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(bt||ni(e,t,s,!1),d=(s&e.childLanes)!==0,bt||d){if(l=Xe,l!==null&&(x=Zh(l,s),x!==0&&x!==h.retryLane))throw h.retryLane=x,rs(e,x),Qt(l,e,x),Pu;vr(),t=ig(e,t,s)}else e=h.treeContext,Je=Tn(x.nextSibling),wt=t,De=!0,Ca=null,_n=!1,e!==null&&Fp(t,e),t=lr(t,l),t.flags|=4096;return t}return e=Qn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function or(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function $u(e,t,s,l,d){return fs(t),s=ku(e,t,s,l,void 0,d),l=Cu(),e!==null&&!bt?(Eu(e,t,d),aa(e,t,d)):(De&&l&&iu(t),t.flags|=1,Mt(e,t,s,d),t.child)}function lg(e,t,s,l,d,h){return fs(t),t.updateQueue=null,s=cm(t,l,s,d),rm(e),l=Cu(),e!==null&&!bt?(Eu(e,t,h),aa(e,t,h)):(De&&l&&iu(t),t.flags|=1,Mt(e,t,s,h),t.child)}function og(e,t,s,l,d){if(fs(t),t.stateNode===null){var h=Ws,x=s.contextType;typeof x=="object"&&x!==null&&(h=Dt(x)),h=new s(l,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Hu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=l,h.state=t.memoizedState,h.refs={},gu(t),x=s.contextType,h.context=typeof x=="object"&&x!==null?Dt(x):Ws,h.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(Vu(t,s,x,l),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Hu.enqueueReplaceState(h,h.state,null),ml(t,l,h,d),pl(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,j=ys(s,T);h.props=j;var P=h.context,K=s.contextType;x=Ws,typeof K=="object"&&K!==null&&(x=Dt(K));var Q=s.getDerivedStateFromProps;K=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,K||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==x)&&Ym(t,h,l,x),Aa=!1;var $=t.memoizedState;h.state=$,ml(t,l,h,d),pl(),P=t.memoizedState,T||$!==P||Aa?(typeof Q=="function"&&(Vu(t,s,Q,l),P=t.memoizedState),(j=Aa||qm(t,s,j,l,$,P,x))?(K||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=P),h.props=l,h.state=P,h.context=x,l=j):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,vu(e,t),x=t.memoizedProps,K=ys(s,x),h.props=K,Q=t.pendingProps,$=h.context,P=s.contextType,j=Ws,typeof P=="object"&&P!==null&&(j=Dt(P)),T=s.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==Q||$!==j)&&Ym(t,h,l,j),Aa=!1,$=t.memoizedState,h.state=$,ml(t,l,h,d),pl();var F=t.memoizedState;x!==Q||$!==F||Aa||e!==null&&e.dependencies!==null&&Go(e.dependencies)?(typeof T=="function"&&(Vu(t,s,T,l),F=t.memoizedState),(K=Aa||qm(t,s,K,l,$,F,j)||e!==null&&e.dependencies!==null&&Go(e.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,F,j),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,F,j)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=F),h.props=l,h.state=F,h.context=j,l=K):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),l=!1)}return h=l,or(e,t),l=(t.flags&128)!==0,h||l?(h=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&l?(t.child=gs(t,e.child,null,d),t.child=gs(t,null,s,d)):Mt(e,t,s,d),t.memoizedState=h.state,e=t.child):e=aa(e,t,d),e}function rg(e,t,s,l){return us(),t.flags|=256,Mt(e,t,s,l),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qu(e){return{baseLanes:e,cachePool:Qp()}}function Yu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=on),e}function cg(e,t,s){var l=t.pendingProps,d=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),x&&(d=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(d?Da(t):Ma(),(e=Je)?(e=vv(e,_n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:Bn,overflow:In}:null,retryLane:536870912,hydrationErrors:null},s=Gp(e),s.return=t,t.child=s,wt=t,Je=null)):e=null,e===null)throw Ea(t);return jd(e)?t.lanes=32:t.lanes=536870912,null}var T=l.children;return l=l.fallback,d?(Ma(),d=t.mode,T=rr({mode:"hidden",children:T},d),l=cs(l,d,s,null),T.return=t,l.return=t,T.sibling=l,t.child=T,l=t.child,l.memoizedState=qu(s),l.childLanes=Yu(e,x,s),t.memoizedState=Fu,xl(null,l)):(Da(t),Ku(t,T))}var j=e.memoizedState;if(j!==null&&(T=j.dehydrated,T!==null)){if(h)t.flags&256?(Da(t),t.flags&=-257,t=Zu(e,t,s)):t.memoizedState!==null?(Ma(),t.child=e.child,t.flags|=128,t=null):(Ma(),T=l.fallback,d=t.mode,l=rr({mode:"visible",children:l.children},d),T=cs(T,d,s,null),T.flags|=2,l.return=t,T.return=t,l.sibling=T,t.child=l,gs(t,e.child,null,s),l=t.child,l.memoizedState=qu(s),l.childLanes=Yu(e,x,s),t.memoizedState=Fu,t=xl(null,l));else if(Da(t),jd(T)){if(x=T.nextSibling&&T.nextSibling.dataset,x)var P=x.dgst;x=P,l=Error(o(419)),l.stack="",l.digest=x,rl({value:l,source:null,stack:null}),t=Zu(e,t,s)}else if(bt||ni(e,t,s,!1),x=(s&e.childLanes)!==0,bt||x){if(x=Xe,x!==null&&(l=Zh(x,s),l!==0&&l!==j.retryLane))throw j.retryLane=l,rs(e,l),Qt(x,e,l),Pu;Ad(T)||vr(),t=Zu(e,t,s)}else Ad(T)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Je=Tn(T.nextSibling),wt=t,De=!0,Ca=null,_n=!1,e!==null&&Fp(t,e),t=Ku(t,l.children),t.flags|=4096);return t}return d?(Ma(),T=l.fallback,d=t.mode,j=e.child,P=j.sibling,l=Qn(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,P!==null?T=Qn(P,T):(T=cs(T,d,s,null),T.flags|=2),T.return=t,l.return=t,l.sibling=T,t.child=l,xl(null,l),l=t.child,T=e.child.memoizedState,T===null?T=qu(s):(d=T.cachePool,d!==null?(j=vt._currentValue,d=d.parent!==j?{parent:j,pool:j}:d):d=Qp(),T={baseLanes:T.baseLanes|s,cachePool:d}),l.memoizedState=T,l.childLanes=Yu(e,x,s),t.memoizedState=Fu,xl(e.child,l)):(Da(t),s=e.child,e=s.sibling,s=Qn(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=s,t.memoizedState=null,s)}function Ku(e,t){return t=rr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function rr(e,t){return e=nn(22,e,null,t),e.lanes=0,e}function Zu(e,t,s){return gs(t,e.child,null,s),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ug(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),uu(e.return,t,s)}function Xu(e,t,s,l,d,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:d,treeForkCount:h}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=l,x.tail=s,x.tailMode=d,x.treeForkCount=h)}function dg(e,t,s){var l=t.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var x=ht.current,T=(x&2)!==0;if(T?(x=x&1|2,t.flags|=128):x&=1,se(ht,x),Mt(e,t,l,s),l=De?ol:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ug(e,s,t);else if(e.tag===19)ug(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=t.child,d=null;s!==null;)e=s.alternate,e!==null&&Xo(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=t.child,t.child=null):(d=s.sibling,s.sibling=null),Xu(t,!1,d,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Xo(e)===null){t.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}Xu(t,!0,s,null,h,l);break;case"together":Xu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function aa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ni(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=Qn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Qn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Qu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Go(e)))}function w1(e,t,s){switch(t.tag){case 3:Yn(t,t.stateNode.containerInfo),Na(t,vt,e.memoizedState.cache),us();break;case 27:case 5:Te(t);break;case 4:Yn(t,t.stateNode.containerInfo);break;case 10:Na(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Su(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Da(t),t.flags|=128,null):(s&t.child.childLanes)!==0?cg(e,t,s):(Da(t),e=aa(e,t,s),e!==null?e.sibling:null);Da(t);break;case 19:var d=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(ni(e,t,s,!1),l=(s&t.childLanes)!==0),d){if(l)return dg(e,t,s);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),se(ht,ht.current),l)break;return null;case 22:return t.lanes=0,ag(e,t,s,t.pendingProps);case 24:Na(t,vt,e.memoizedState.cache)}return aa(e,t,s)}function fg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Qu(e,s)&&(t.flags&128)===0)return bt=!1,w1(e,t,s);bt=(e.flags&131072)!==0}else bt=!1,De&&(t.flags&1048576)!==0&&$p(t,ol,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ps(t.elementType),t.type=e,typeof e=="function")nu(e)?(l=ys(e,l),t.tag=1,t=og(null,t,e,l,s)):(t.tag=0,t=$u(null,t,e,l,s));else{if(e!=null){var d=e.$$typeof;if(d===D){t.tag=11,t=eg(null,t,e,l,s);break e}else if(d===R){t.tag=14,t=tg(null,t,e,l,s);break e}}throw t=W(e)||e,Error(o(306,t,""))}}return t;case 0:return $u(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,d=ys(l,t.pendingProps),og(e,t,l,d,s);case 3:e:{if(Yn(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var h=t.memoizedState;d=h.element,vu(e,t),ml(t,l,null,s);var x=t.memoizedState;if(l=x.cache,Na(t,vt,l),l!==h.cache&&du(t,[vt],s,!0),pl(),l=x.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=rg(e,t,l,s);break e}else if(l!==d){d=yn(Error(o(424)),t),rl(d),t=rg(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Je=Tn(e.firstChild),wt=t,De=!0,Ca=null,_n=!0,s=am(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(us(),l===d){t=aa(e,t,s);break e}Mt(e,t,l,s)}t=t.child}return t;case 26:return or(e,t),e===null?(s=Tv(t.type,null,t.pendingProps,null))?t.memoizedState=s:De||(s=t.type,e=t.pendingProps,l=kr($t.current).createElement(s),l[jt]=t,l[Ft]=e,Rt(l,s,e),Ct(l),t.stateNode=l):t.memoizedState=Tv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&De&&(l=t.stateNode=xv(t.type,t.pendingProps,$t.current),wt=t,_n=!0,d=Je,Va(t.type)?(wd=d,Je=Tn(l.firstChild)):Je=d),Mt(e,t,t.pendingProps.children,s),or(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((d=l=Je)&&(l=lS(l,t.type,t.pendingProps,_n),l!==null?(t.stateNode=l,wt=t,Je=Tn(l.firstChild),_n=!1,d=!0):d=!1),d||Ea(t)),Te(t),d=t.type,h=t.pendingProps,x=e!==null?e.memoizedProps:null,l=h.children,Cd(d,h)?l=null:x!==null&&Cd(d,x)&&(t.flags|=32),t.memoizedState!==null&&(d=ku(e,t,_1,null,null,s),Bl._currentValue=d),or(e,t),Mt(e,t,l,s),t.child;case 6:return e===null&&De&&((e=s=Je)&&(s=oS(s,t.pendingProps,_n),s!==null?(t.stateNode=s,wt=t,Je=null,e=!0):e=!1),e||Ea(t)),null;case 13:return cg(e,t,s);case 4:return Yn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=gs(t,null,l,s):Mt(e,t,l,s),t.child;case 11:return eg(e,t,t.type,t.pendingProps,s);case 7:return Mt(e,t,t.pendingProps,s),t.child;case 8:return Mt(e,t,t.pendingProps.children,s),t.child;case 12:return Mt(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Na(t,t.type,l.value),Mt(e,t,l.children,s),t.child;case 9:return d=t.type._context,l=t.pendingProps.children,fs(t),d=Dt(d),l=l(d),t.flags|=1,Mt(e,t,l,s),t.child;case 14:return tg(e,t,t.type,t.pendingProps,s);case 15:return ng(e,t,t.type,t.pendingProps,s);case 19:return dg(e,t,s);case 31:return j1(e,t,s);case 22:return ag(e,t,s,t.pendingProps);case 24:return fs(t),l=Dt(vt),e===null?(d=pu(),d===null&&(d=Xe,h=fu(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=s),d=h),t.memoizedState={parent:l,cache:d},gu(t),Na(t,vt,d)):((e.lanes&s)!==0&&(vu(e,t),ml(t,null,null,s),pl()),d=e.memoizedState,h=t.memoizedState,d.parent!==l?(d={parent:l,cache:l},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Na(t,vt,l)):(l=h.cache,Na(t,vt,l),l!==d.cache&&du(t,[vt],s,!0))),Mt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function sa(e){e.flags|=4}function Wu(e,t,s,l,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Ug())e.flags|=8192;else throw ms=qo,mu}else e.flags&=-16777217}function hg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Av(t))if(Ug())e.flags|=8192;else throw ms=qo,mu}function cr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qh():536870912,e.lanes|=t,pi|=t)}function _l(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function D1(e,t,s){var l=t.pendingProps;switch(lu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ea(vt),Jt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ti(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ru())),et(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(sa(t),h!==null?(et(t),hg(t,h)):(et(t),Wu(t,d,null,l,s))):h?h!==e.memoizedState?(sa(t),et(t),hg(t,h)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&sa(t),et(t),Wu(t,d,e,l,s)),null;case 27:if(rt(t),s=$t.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return et(t),null}e=He.current,ti(t)?qp(t):(e=xv(d,l,s),t.stateNode=e,sa(t))}return et(t),null;case 5:if(rt(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return et(t),null}if(h=He.current,ti(t))qp(t);else{var x=kr($t.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?x.createElement("select",{is:l.is}):x.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?x.createElement(d,{is:l.is}):x.createElement(d)}}h[jt]=t,h[Ft]=l;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=h;e:switch(Rt(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&sa(t)}}return et(t),Wu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=$t.current,ti(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,d=wt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}e[jt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||cv(e.nodeValue,s)),e||Ea(t,!0)}else e=kr(e).createTextNode(l),e[jt]=t,t.stateNode=e}return et(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ti(t),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[jt]=t}else us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else s=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return et(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ti(t),l!==null&&l.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[jt]=t}else us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),d=!1}else d=ru(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),cr(t,t.updateQueue),et(t),null);case 4:return Jt(),e===null&&xd(t.stateNode.containerInfo),et(t),null;case 10:return ea(t.type),et(t),null;case 19:if(he(ht),l=t.memoizedState,l===null)return et(t),null;if(d=(t.flags&128)!==0,h=l.rendering,h===null)if(d)_l(l,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Xo(e),h!==null){for(t.flags|=128,_l(l,!1),e=h.updateQueue,t.updateQueue=e,cr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Hp(s,e),s=s.sibling;return se(ht,ht.current&1|2),De&&Wn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Bt()>pr&&(t.flags|=128,d=!0,_l(l,!1),t.lanes=4194304)}else{if(!d)if(e=Xo(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,cr(t,e),_l(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!De)return et(t),null}else 2*Bt()-l.renderingStartTime>pr&&s!==536870912&&(t.flags|=128,d=!0,_l(l,!1),t.lanes=4194304);l.isBackwards?(h.sibling=t.child,t.child=h):(e=l.last,e!==null?e.sibling=h:t.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Bt(),e.sibling=null,s=ht.current,se(ht,d?s&1|2:s&1),De&&Wn(t,l.treeForkCount),e):(et(t),null);case 22:case 23:return sn(t),_u(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),s=t.updateQueue,s!==null&&cr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&he(hs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ea(vt),et(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function M1(e,t){switch(lu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(vt),Jt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rt(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(o(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(ht),null;case 4:return Jt(),null;case 10:return ea(t.type),null;case 22:case 23:return sn(t),_u(),e!==null&&he(hs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(vt),null;case 25:return null;default:return null}}function pg(e,t){switch(lu(t),t.tag){case 3:ea(vt),Jt();break;case 26:case 27:case 5:rt(t);break;case 4:Jt();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:he(ht);break;case 10:ea(t.type);break;case 22:case 23:sn(t),_u(),e!==null&&he(hs);break;case 24:ea(vt)}}function Sl(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var d=l.next;s=d;do{if((s.tag&e)===e){l=void 0;var h=s.create,x=s.inst;l=h(),x.destroy=l}s=s.next}while(s!==d)}}catch(T){$e(t,t.return,T)}}function Ra(e,t,s){try{var l=t.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&e)===e){var x=l.inst,T=x.destroy;if(T!==void 0){x.destroy=void 0,d=t;var j=s,P=T;try{P()}catch(K){$e(d,j,K)}}}l=l.next}while(l!==h)}}catch(K){$e(t,t.return,K)}}function mg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{im(t,s)}catch(l){$e(e,e.return,l)}}}function gg(e,t,s){s.props=ys(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){$e(e,t,l)}}function Tl(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(d){$e(e,t,d)}}function Ln(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(d){$e(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){$e(e,t,d)}else s.current=null}function vg(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(d){$e(e,e.return,d)}}function Ju(e,t,s){try{var l=e.stateNode;eS(l,e.type,s,t),l[Ft]=t}catch(d){$e(e,e.return,d)}}function yg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Va(e.type)||e.tag===4}function ed(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Va(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function td(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Zn));else if(l!==4&&(l===27&&Va(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(td(e,t,s),e=e.sibling;e!==null;)td(e,t,s),e=e.sibling}function ur(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Va(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ur(e,t,s),e=e.sibling;e!==null;)ur(e,t,s),e=e.sibling}function bg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Rt(t,l,s),t[jt]=e,t[Ft]=s}catch(h){$e(e,e.return,h)}}var ia=!1,xt=!1,nd=!1,xg=typeof WeakSet=="function"?WeakSet:Set,Et=null;function R1(e,t){if(e=e.containerInfo,Td=Dr,e=Mp(e),Zc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var d=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var x=0,T=-1,j=-1,P=0,K=0,Q=e,$=null;t:for(;;){for(var F;Q!==s||d!==0&&Q.nodeType!==3||(T=x+d),Q!==h||l!==0&&Q.nodeType!==3||(j=x+l),Q.nodeType===3&&(x+=Q.nodeValue.length),(F=Q.firstChild)!==null;)$=Q,Q=F;for(;;){if(Q===e)break t;if($===s&&++P===d&&(T=x),$===h&&++K===l&&(j=x),(F=Q.nextSibling)!==null)break;Q=$,$=Q.parentNode}Q=F}s=T===-1||j===-1?null:{start:T,end:j}}else s=null}s=s||{start:0,end:0}}else s=null;for(kd={focusedElem:e,selectionRange:s},Dr=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,d=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var ue=ys(s.type,d);e=l.getSnapshotBeforeUpdate(ue,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){$e(s,s.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Nd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function _g(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:oa(e,s),l&4&&Sl(5,s);break;case 1:if(oa(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(x){$e(s,s.return,x)}else{var d=ys(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){$e(s,s.return,x)}}l&64&&mg(s),l&512&&Tl(s,s.return);break;case 3:if(oa(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{im(e,t)}catch(x){$e(s,s.return,x)}}break;case 27:t===null&&l&4&&bg(s);case 26:case 5:oa(e,s),t===null&&l&4&&vg(s),l&512&&Tl(s,s.return);break;case 12:oa(e,s);break;case 31:oa(e,s),l&4&&kg(e,s);break;case 13:oa(e,s),l&4&&Cg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=G1.bind(null,s),rS(e,s))));break;case 22:if(l=s.memoizedState!==null||ia,!l){t=t!==null&&t.memoizedState!==null||xt,d=ia;var h=xt;ia=l,(xt=t)&&!h?ra(e,s,(s.subtreeFlags&8772)!==0):oa(e,s),ia=d,xt=h}break;case 30:break;default:oa(e,s)}}function Sg(e){var t=e.alternate;t!==null&&(e.alternate=null,Sg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,Yt=!1;function la(e,t,s){for(s=s.child;s!==null;)Tg(e,t,s),s=s.sibling}function Tg(e,t,s){if(Ce&&typeof Ce.onCommitFiberUnmount=="function")try{Ce.onCommitFiberUnmount(ft,s)}catch{}switch(s.tag){case 26:xt||Ln(s,t),la(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xt||Ln(s,t);var l=st,d=Yt;Va(s.type)&&(st=s.stateNode,Yt=!1),la(e,t,s),Ml(s.stateNode),st=l,Yt=d;break;case 5:xt||Ln(s,t);case 6:if(l=st,d=Yt,st=null,la(e,t,s),st=l,Yt=d,st!==null)if(Yt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(h){$e(s,t,h)}else try{st.removeChild(s.stateNode)}catch(h){$e(s,t,h)}break;case 18:st!==null&&(Yt?(e=st,mv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Si(e)):mv(st,s.stateNode));break;case 4:l=st,d=Yt,st=s.stateNode.containerInfo,Yt=!0,la(e,t,s),st=l,Yt=d;break;case 0:case 11:case 14:case 15:Ra(2,s,t),xt||Ra(4,s,t),la(e,t,s);break;case 1:xt||(Ln(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&gg(s,t,l)),la(e,t,s);break;case 21:la(e,t,s);break;case 22:xt=(l=xt)||s.memoizedState!==null,la(e,t,s),xt=l;break;default:la(e,t,s)}}function kg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Si(e)}catch(s){$e(t,t.return,s)}}}function Cg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Si(e)}catch(s){$e(t,t.return,s)}}function O1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xg),t;default:throw Error(o(435,e.tag))}}function dr(e,t){var s=O1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var d=P1.bind(null,e,l);l.then(d,d)}})}function Kt(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var d=s[l],h=e,x=t,T=x;e:for(;T!==null;){switch(T.tag){case 27:if(Va(T.type)){st=T.stateNode,Yt=!1;break e}break;case 5:st=T.stateNode,Yt=!1;break e;case 3:case 4:st=T.stateNode.containerInfo,Yt=!0;break e}T=T.return}if(st===null)throw Error(o(160));Tg(h,x,d),st=null,Yt=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eg(t,e),t=t.sibling}var wn=null;function Eg(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kt(t,e),Zt(e),l&4&&(Ra(3,e,e.return),Sl(3,e),Ra(5,e,e.return));break;case 1:Kt(t,e),Zt(e),l&512&&(xt||s===null||Ln(s,s.return)),l&64&&ia&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var d=wn;if(Kt(t,e),Zt(e),l&512&&(xt||s===null||Ln(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Xi]||h[jt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(l),d.head.insertBefore(h,d.querySelector("head > title"))),Rt(h,l,s),h[jt]=e,Ct(h),l=h;break e;case"link":var x=Ev("link","href",d).get(l+(s.href||""));if(x){for(var T=0;T<x.length;T++)if(h=x[T],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(T,1);break t}}h=d.createElement(l),Rt(h,l,s),d.head.appendChild(h);break;case"meta":if(x=Ev("meta","content",d).get(l+(s.content||""))){for(T=0;T<x.length;T++)if(h=x[T],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(T,1);break t}}h=d.createElement(l),Rt(h,l,s),d.head.appendChild(h);break;default:throw Error(o(468,l))}h[jt]=e,Ct(h),l=h}e.stateNode=l}else Nv(d,e.type,e.stateNode);else e.stateNode=Cv(d,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Nv(d,e.type,e.stateNode):Cv(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ju(e,e.memoizedProps,s.memoizedProps)}break;case 27:Kt(t,e),Zt(e),l&512&&(xt||s===null||Ln(s,s.return)),s!==null&&l&4&&Ju(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Kt(t,e),Zt(e),l&512&&(xt||s===null||Ln(s,s.return)),e.flags&32){d=e.stateNode;try{Fs(d,"")}catch(ue){$e(e,e.return,ue)}}l&4&&e.stateNode!=null&&(d=e.memoizedProps,Ju(e,d,s!==null?s.memoizedProps:d)),l&1024&&(nd=!0);break;case 6:if(Kt(t,e),Zt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(ue){$e(e,e.return,ue)}}break;case 3:if(Nr=null,d=wn,wn=Cr(t.containerInfo),Kt(t,e),wn=d,Zt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(ue){$e(e,e.return,ue)}nd&&(nd=!1,Ng(e));break;case 4:l=wn,wn=Cr(e.stateNode.containerInfo),Kt(t,e),Zt(e),wn=l;break;case 12:Kt(t,e),Zt(e);break;case 31:Kt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,dr(e,l)));break;case 13:Kt(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hr=Bt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,dr(e,l)));break;case 22:d=e.memoizedState!==null;var j=s!==null&&s.memoizedState!==null,P=ia,K=xt;if(ia=P||d,xt=K||j,Kt(t,e),xt=K,ia=P,Zt(e),l&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(s===null||j||ia||xt||bs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){j=s=t;try{if(h=j.stateNode,d)x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{T=j.stateNode;var Q=j.memoizedProps.style,$=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;T.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ue){$e(j,j.return,ue)}}}else if(t.tag===6){if(s===null){j=t;try{j.stateNode.nodeValue=d?"":j.memoizedProps}catch(ue){$e(j,j.return,ue)}}}else if(t.tag===18){if(s===null){j=t;try{var F=j.stateNode;d?gv(F,!0):gv(j.stateNode,!1)}catch(ue){$e(j,j.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,dr(e,s))));break;case 19:Kt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,dr(e,l)));break;case 30:break;case 21:break;default:Kt(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(yg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var d=s.stateNode,h=ed(e);ur(e,h,d);break;case 5:var x=s.stateNode;s.flags&32&&(Fs(x,""),s.flags&=-33);var T=ed(e);ur(e,T,x);break;case 3:case 4:var j=s.stateNode.containerInfo,P=ed(e);td(e,P,j);break;default:throw Error(o(161))}}catch(K){$e(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ng(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ng(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function oa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_g(e,t.alternate,t),t=t.sibling}function bs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ra(4,t,t.return),bs(t);break;case 1:Ln(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&gg(t,t.return,s),bs(t);break;case 27:Ml(t.stateNode);case 26:case 5:Ln(t,t.return),bs(t);break;case 22:t.memoizedState===null&&bs(t);break;case 30:bs(t);break;default:bs(t)}e=e.sibling}}function ra(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,d=e,h=t,x=h.flags;switch(h.tag){case 0:case 11:case 15:ra(d,h,s),Sl(4,h);break;case 1:if(ra(d,h,s),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(P){$e(l,l.return,P)}if(l=h,d=l.updateQueue,d!==null){var T=l.stateNode;try{var j=d.shared.hiddenCallbacks;if(j!==null)for(d.shared.hiddenCallbacks=null,d=0;d<j.length;d++)sm(j[d],T)}catch(P){$e(l,l.return,P)}}s&&x&64&&mg(h),Tl(h,h.return);break;case 27:bg(h);case 26:case 5:ra(d,h,s),s&&l===null&&x&4&&vg(h),Tl(h,h.return);break;case 12:ra(d,h,s);break;case 31:ra(d,h,s),s&&x&4&&kg(d,h);break;case 13:ra(d,h,s),s&&x&4&&Cg(d,h);break;case 22:h.memoizedState===null&&ra(d,h,s),Tl(h,h.return);break;case 30:break;default:ra(d,h,s)}t=t.sibling}}function ad(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&cl(s))}function sd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&cl(e))}function Dn(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ag(e,t,s,l),t=t.sibling}function Ag(e,t,s,l){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Dn(e,t,s,l),d&2048&&Sl(9,t);break;case 1:Dn(e,t,s,l);break;case 3:Dn(e,t,s,l),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&cl(e)));break;case 12:if(d&2048){Dn(e,t,s,l),e=t.stateNode;try{var h=t.memoizedProps,x=h.id,T=h.onPostCommit;typeof T=="function"&&T(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){$e(t,t.return,j)}}else Dn(e,t,s,l);break;case 31:Dn(e,t,s,l);break;case 13:Dn(e,t,s,l);break;case 23:break;case 22:h=t.stateNode,x=t.alternate,t.memoizedState!==null?h._visibility&2?Dn(e,t,s,l):kl(e,t):h._visibility&2?Dn(e,t,s,l):(h._visibility|=2,di(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),d&2048&&ad(x,t);break;case 24:Dn(e,t,s,l),d&2048&&sd(t.alternate,t);break;default:Dn(e,t,s,l)}}function di(e,t,s,l,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,x=t,T=s,j=l,P=x.flags;switch(x.tag){case 0:case 11:case 15:di(h,x,T,j,d),Sl(8,x);break;case 23:break;case 22:var K=x.stateNode;x.memoizedState!==null?K._visibility&2?di(h,x,T,j,d):kl(h,x):(K._visibility|=2,di(h,x,T,j,d)),d&&P&2048&&ad(x.alternate,x);break;case 24:di(h,x,T,j,d),d&&P&2048&&sd(x.alternate,x);break;default:di(h,x,T,j,d)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,d=l.flags;switch(l.tag){case 22:kl(s,l),d&2048&&ad(l.alternate,l);break;case 24:kl(s,l),d&2048&&sd(l.alternate,l);break;default:kl(s,l)}t=t.sibling}}var Cl=8192;function fi(e,t,s){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)jg(e,t,s),e=e.sibling}function jg(e,t,s){switch(e.tag){case 26:fi(e,t,s),e.flags&Cl&&e.memoizedState!==null&&xS(s,wn,e.memoizedState,e.memoizedProps);break;case 5:fi(e,t,s);break;case 3:case 4:var l=wn;wn=Cr(e.stateNode.containerInfo),fi(e,t,s),wn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Cl,Cl=16777216,fi(e,t,s),Cl=l):fi(e,t,s));break;default:fi(e,t,s)}}function wg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function El(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Et=l,Mg(l,e)}wg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dg(e),e=e.sibling}function Dg(e){switch(e.tag){case 0:case 11:case 15:El(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:El(e);break;case 12:El(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,fr(e)):El(e);break;default:El(e)}}function fr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Et=l,Mg(l,e)}wg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ra(8,t,t.return),fr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,fr(t));break;default:fr(t)}e=e.sibling}}function Mg(e,t){for(;Et!==null;){var s=Et;switch(s.tag){case 0:case 11:case 15:Ra(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:cl(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Et=l;else e:for(s=e;Et!==null;){l=Et;var d=l.sibling,h=l.return;if(Sg(l),l===s){Et=null;break e}if(d!==null){d.return=h,Et=d;break e}Et=h}}}var B1={getCacheForType:function(e){var t=Dt(vt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Dt(vt).controller.signal}},I1=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Xe=null,Ee=null,je=0,Pe=0,ln=null,Oa=!1,hi=!1,id=!1,ca=0,ut=0,Ba=0,xs=0,ld=0,on=0,pi=0,Nl=null,Xt=null,od=!1,hr=0,Rg=0,pr=1/0,mr=null,Ia=null,Tt=0,La=null,mi=null,ua=0,rd=0,cd=null,Og=null,Al=0,ud=null;function rn(){return(Ue&2)!==0&&je!==0?je&-je:B.T!==null?gd():Xh()}function Bg(){if(on===0)if((je&536870912)===0||De){var e=pn;pn<<=1,(pn&3932160)===0&&(pn=262144),on=e}else on=536870912;return e=an.current,e!==null&&(e.flags|=32),on}function Qt(e,t,s){(e===Xe&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(gi(e,0),za(e,je,on,!1)),Zi(e,s),((Ue&2)===0||e!==Xe)&&(e===Xe&&((Ue&2)===0&&(xs|=s),ut===4&&za(e,je,on,!1)),zn(e))}function Ig(e,t,s){if((Ue&6)!==0)throw Error(o(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Ki(e,t),d=l?U1(e,t):fd(e,t,!0),h=l;do{if(d===0){hi&&!l&&za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!L1(s)){d=fd(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var T=e;d=Nl;var j=T.current.memoizedState.isDehydrated;if(j&&(gi(T,x).flags|=256),x=fd(T,x,!1),x!==2){if(id&&!j){T.errorRecoveryDisabledLanes|=h,xs|=h,d=4;break e}h=Xt,Xt=d,h!==null&&(Xt===null?Xt=h:Xt.push.apply(Xt,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){gi(e,0),za(e,t,0,!0);break}e:{switch(l=e,h=d,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:za(l,t,on,!Oa);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=hr+300-Bt(),10<d)){if(za(l,t,on,!Oa),Co(l,0,!0)!==0)break e;ua=t,l.timeoutHandle=hv(Lg.bind(null,l,s,Xt,mr,od,t,on,xs,pi,Oa,h,"Throttled",-0,0),d);break e}Lg(l,s,Xt,mr,od,t,on,xs,pi,Oa,h,null,-0,0)}}break}while(!0);zn(e)}function Lg(e,t,s,l,d,h,x,T,j,P,K,Q,$,F){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zn},jg(t,h,Q);var ue=(h&62914560)===h?hr-Bt():(h&4194048)===h?Rg-Bt():0;if(ue=_S(Q,ue),ue!==null){ua=h,e.cancelPendingCommit=ue(Fg.bind(null,e,t,h,s,l,d,x,T,j,K,Q,null,$,F)),za(e,h,x,!P);return}}Fg(e,t,h,s,l,d,x,T,j)}function L1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var d=s[l],h=d.getSnapshot;d=d.value;try{if(!tn(h(),d))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function za(e,t,s,l){t&=~ld,t&=~xs,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var d=t;0<d;){var h=31-Fe(d),x=1<<h;l[h]=-1,d&=~x}s!==0&&Yh(e,s,t)}function gr(){return(Ue&6)===0?(jl(0),!1):!0}function dd(){if(Ee!==null){if(Pe===0)var e=Ee.return;else e=Ee,Jn=ds=null,Nu(e),li=null,dl=0,e=Ee;for(;e!==null;)pg(e.alternate,e),e=e.return;Ee=null}}function gi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,aS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ua=0,dd(),Xe=e,Ee=s=Qn(e.current,null),je=t,Pe=0,ln=null,Oa=!1,hi=Ki(e,t),id=!1,pi=on=ld=xs=Ba=ut=0,Xt=Nl=null,od=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var d=31-Fe(l),h=1<<d;t|=e[d],l&=~h}return ca=t,Lo(),s}function zg(e,t){_e=null,B.H=bl,t===ii||t===Fo?(t=em(),Pe=3):t===mu?(t=em(),Pe=4):Pe=t===Pu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,Ee===null&&(ut=1,ir(e,yn(t,e.current)))}function Ug(){var e=an.current;return e===null?!0:(je&4194048)===je?Sn===null:(je&62914560)===je||(je&536870912)!==0?e===Sn:!1}function Vg(){var e=B.H;return B.H=bl,e===null?bl:e}function Hg(){var e=B.A;return B.A=B1,e}function vr(){ut=4,Oa||(je&4194048)!==je&&an.current!==null||(hi=!0),(Ba&134217727)===0&&(xs&134217727)===0||Xe===null||za(Xe,je,on,!1)}function fd(e,t,s){var l=Ue;Ue|=2;var d=Vg(),h=Hg();(Xe!==e||je!==t)&&(mr=null,gi(e,t)),t=!1;var x=ut;e:do try{if(Pe!==0&&Ee!==null){var T=Ee,j=ln;switch(Pe){case 8:dd(),x=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var P=Pe;if(Pe=0,ln=null,vi(e,T,j,P),s&&hi){x=0;break e}break;default:P=Pe,Pe=0,ln=null,vi(e,T,j,P)}}z1(),x=ut;break}catch(K){zg(e,K)}while(!0);return t&&e.shellSuspendCounter++,Jn=ds=null,Ue=l,B.H=d,B.A=h,Ee===null&&(Xe=null,je=0,Lo()),x}function z1(){for(;Ee!==null;)Gg(Ee)}function U1(e,t){var s=Ue;Ue|=2;var l=Vg(),d=Hg();Xe!==e||je!==t?(mr=null,pr=Bt()+500,gi(e,t)):hi=Ki(e,t);e:do try{if(Pe!==0&&Ee!==null){t=Ee;var h=ln;t:switch(Pe){case 1:Pe=0,ln=null,vi(e,t,h,1);break;case 2:case 9:if(Wp(h)){Pe=0,ln=null,Pg(t);break}t=function(){Pe!==2&&Pe!==9||Xe!==e||(Pe=7),zn(e)},h.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Wp(h)?(Pe=0,ln=null,Pg(t)):(Pe=0,ln=null,vi(e,t,h,7));break;case 5:var x=null;switch(Ee.tag){case 26:x=Ee.memoizedState;case 5:case 27:var T=Ee;if(x?Av(x):T.stateNode.complete){Pe=0,ln=null;var j=T.sibling;if(j!==null)Ee=j;else{var P=T.return;P!==null?(Ee=P,yr(P)):Ee=null}break t}}Pe=0,ln=null,vi(e,t,h,5);break;case 6:Pe=0,ln=null,vi(e,t,h,6);break;case 8:dd(),ut=6;break e;default:throw Error(o(462))}}V1();break}catch(K){zg(e,K)}while(!0);return Jn=ds=null,B.H=l,B.A=d,Ue=s,Ee!==null?0:(Xe=null,je=0,Lo(),ut)}function V1(){for(;Ee!==null&&!To();)Gg(Ee)}function Gg(e){var t=fg(e.alternate,e,ca);e.memoizedProps=e.pendingProps,t===null?yr(e):Ee=t}function Pg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=lg(s,t,t.pendingProps,t.type,void 0,je);break;case 11:t=lg(s,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:Nu(t);default:pg(s,t),t=Ee=Hp(t,ca),t=fg(s,t,ca)}e.memoizedProps=e.pendingProps,t===null?yr(e):Ee=t}function vi(e,t,s,l){Jn=ds=null,Nu(t),li=null,dl=0;var d=t.return;try{if(A1(e,d,t,s,je)){ut=1,ir(e,yn(s,e.current)),Ee=null;return}}catch(h){if(d!==null)throw Ee=d,h;ut=1,ir(e,yn(s,e.current)),Ee=null;return}t.flags&32768?(De||l===1?e=!0:hi||(je&536870912)!==0?e=!1:(Oa=e=!0,(l===2||l===9||l===3||l===6)&&(l=an.current,l!==null&&l.tag===13&&(l.flags|=16384))),$g(t,e)):yr(t)}function yr(e){var t=e;do{if((t.flags&32768)!==0){$g(t,Oa);return}e=t.return;var s=D1(t.alternate,t,ca);if(s!==null){Ee=s;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);ut===0&&(ut=5)}function $g(e,t){do{var s=M1(e.alternate,e);if(s!==null){s.flags&=32767,Ee=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=s}while(e!==null);ut=6,Ee=null}function Fg(e,t,s,l,d,h,x,T,j){e.cancelPendingCommit=null;do br();while(Tt!==0);if((Ue&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=eu,b_(e,s,h,x,T,j),e===Xe&&(Ee=Xe=null,je=0),mi=t,La=e,ua=s,rd=h,cd=d,Og=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$1(ce,function(){return Xg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=B.T,B.T=null,d=q.p,q.p=2,x=Ue,Ue|=4;try{R1(e,t,s)}finally{Ue=x,q.p=d,B.T=l}}Tt=1,qg(),Yg(),Kg()}}function qg(){if(Tt===1){Tt=0;var e=La,t=mi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var l=q.p;q.p=2;var d=Ue;Ue|=4;try{Eg(t,e);var h=kd,x=Mp(e.containerInfo),T=h.focusedElem,j=h.selectionRange;if(x!==T&&T&&T.ownerDocument&&Dp(T.ownerDocument.documentElement,T)){if(j!==null&&Zc(T)){var P=j.start,K=j.end;if(K===void 0&&(K=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(K,T.value.length);else{var Q=T.ownerDocument||document,$=Q&&Q.defaultView||window;if($.getSelection){var F=$.getSelection(),ue=T.textContent.length,ge=Math.min(j.start,ue),Ke=j.end===void 0?ge:Math.min(j.end,ue);!F.extend&&ge>Ke&&(x=Ke,Ke=ge,ge=x);var L=wp(T,ge),w=wp(T,Ke);if(L&&w&&(F.rangeCount!==1||F.anchorNode!==L.node||F.anchorOffset!==L.offset||F.focusNode!==w.node||F.focusOffset!==w.offset)){var H=Q.createRange();H.setStart(L.node,L.offset),F.removeAllRanges(),ge>Ke?(F.addRange(H),F.extend(w.node,w.offset)):(H.setEnd(w.node,w.offset),F.addRange(H))}}}}for(Q=[],F=T;F=F.parentNode;)F.nodeType===1&&Q.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<Q.length;T++){var Z=Q[T];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Dr=!!Td,kd=Td=null}finally{Ue=d,q.p=l,B.T=s}}e.current=t,Tt=2}}function Yg(){if(Tt===2){Tt=0;var e=La,t=mi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var l=q.p;q.p=2;var d=Ue;Ue|=4;try{_g(e,t.alternate,t)}finally{Ue=d,q.p=l,B.T=s}}Tt=3}}function Kg(){if(Tt===4||Tt===3){Tt=0,ko();var e=La,t=mi,s=ua,l=Og;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,mi=La=null,Zg(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Ia=null),wc(s),t=t.stateNode,Ce&&typeof Ce.onCommitFiberRoot=="function")try{Ce.onCommitFiberRoot(ft,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=B.T,d=q.p,q.p=2,B.T=null;try{for(var h=e.onRecoverableError,x=0;x<l.length;x++){var T=l[x];h(T.value,{componentStack:T.stack})}}finally{B.T=t,q.p=d}}(ua&3)!==0&&br(),zn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===ud?Al++:(Al=0,ud=e):Al=0,jl(0)}}function Zg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,cl(t)))}function br(){return qg(),Yg(),Kg(),Xg()}function Xg(){if(Tt!==5)return!1;var e=La,t=rd;rd=0;var s=wc(ua),l=B.T,d=q.p;try{q.p=32>s?32:s,B.T=null,s=cd,cd=null;var h=La,x=ua;if(Tt=0,mi=La=null,ua=0,(Ue&6)!==0)throw Error(o(331));var T=Ue;if(Ue|=4,Dg(h.current),Ag(h,h.current,x,s),Ue=T,jl(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot=="function")try{Ce.onPostCommitFiberRoot(ft,h)}catch{}return!0}finally{q.p=d,B.T=l,Zg(e,t)}}function Qg(e,t,s){t=yn(s,t),t=Gu(e.stateNode,t,2),e=wa(e,t,2),e!==null&&(Zi(e,2),zn(e))}function $e(e,t,s){if(e.tag===3)Qg(e,e,s);else for(;t!==null;){if(t.tag===3){Qg(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ia===null||!Ia.has(l))){e=yn(s,e),s=Wm(2),l=wa(t,s,2),l!==null&&(Jm(s,l,t,e),Zi(l,2),zn(l));break}}t=t.return}}function hd(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new I1;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(s)||(id=!0,d.add(s),e=H1.bind(null,e,t,s),t.then(e,e))}function H1(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Xe===e&&(je&s)===s&&(ut===4||ut===3&&(je&62914560)===je&&300>Bt()-hr?(Ue&2)===0&&gi(e,0):ld|=s,pi===je&&(pi=0)),zn(e)}function Wg(e,t){t===0&&(t=qh()),e=rs(e,t),e!==null&&(Zi(e,t),zn(e))}function G1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Wg(e,s)}function P1(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Wg(e,s)}function $1(e,t){return Ls(e,t)}var xr=null,yi=null,pd=!1,_r=!1,md=!1,Ua=0;function zn(e){e!==yi&&e.next===null&&(yi===null?xr=yi=e:yi=yi.next=e),_r=!0,pd||(pd=!0,q1())}function jl(e,t){if(!md&&_r){md=!0;do for(var s=!1,l=xr;l!==null;){if(e!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var x=l.suspendedLanes,T=l.pingedLanes;h=(1<<31-Fe(42|e)+1)-1,h&=d&~(x&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,nv(l,h))}else h=je,h=Co(l,l===Xe?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Ki(l,h)||(s=!0,nv(l,h));l=l.next}while(s);md=!1}}function F1(){Jg()}function Jg(){_r=pd=!1;var e=0;Ua!==0&&nS()&&(e=Ua);for(var t=Bt(),s=null,l=xr;l!==null;){var d=l.next,h=ev(l,t);h===0?(l.next=null,s===null?xr=d:s.next=d,d===null&&(yi=s)):(s=l,(e!==0||(h&3)!==0)&&(_r=!0)),l=d}Tt!==0&&Tt!==5||jl(e),Ua!==0&&(Ua=0)}function ev(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Fe(h),T=1<<x,j=d[x];j===-1?((T&s)===0||(T&l)!==0)&&(d[x]=y_(T,t)):j<=t&&(e.expiredLanes|=T),h&=~T}if(t=Xe,s=je,s=Co(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&zs(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Ki(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&zs(l),wc(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=be;break;default:s=ce}return l=tv.bind(null,e),s=Ls(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&zs(l),e.callbackPriority=2,e.callbackNode=null,2}function tv(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(br()&&e.callbackNode!==s)return null;var l=je;return l=Co(e,e===Xe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Ig(e,l,t),ev(e,Bt()),e.callbackNode!=null&&e.callbackNode===s?tv.bind(null,e):null)}function nv(e,t){if(br())return null;Ig(e,t,!0)}function q1(){sS(function(){(Ue&6)!==0?Ls(X,F1):Jg()})}function gd(){if(Ua===0){var e=ai;e===0&&(e=xa,xa<<=1,(xa&261888)===0&&(xa=256)),Ua=e}return Ua}function av(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jo(""+e)}function sv(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function Y1(e,t,s,l,d){if(t==="submit"&&s&&s.stateNode===d){var h=av((d[Ft]||null).action),x=l.submitter;x&&(t=(t=x[Ft]||null)?av(t.formAction):x.getAttribute("formAction"),t!==null&&(h=t,x=null));var T=new Ro("action","action",null,l,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ua!==0){var j=x?sv(d,x):new FormData(d);Iu(s,{pending:!0,data:j,method:d.method,action:h},null,j)}}else typeof h=="function"&&(T.preventDefault(),j=x?sv(d,x):new FormData(d),Iu(s,{pending:!0,data:j,method:d.method,action:h},h,j))},currentTarget:d}]})}}for(var vd=0;vd<Jc.length;vd++){var yd=Jc[vd],K1=yd.toLowerCase(),Z1=yd[0].toUpperCase()+yd.slice(1);jn(K1,"on"+Z1)}jn(Bp,"onAnimationEnd"),jn(Ip,"onAnimationIteration"),jn(Lp,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(d1,"onTransitionRun"),jn(f1,"onTransitionStart"),jn(h1,"onTransitionCancel"),jn(zp,"onTransitionEnd"),Ps("onMouseEnter",["mouseout","mouseover"]),Ps("onMouseLeave",["mouseout","mouseover"]),Ps("onPointerEnter",["pointerout","pointerover"]),Ps("onPointerLeave",["pointerout","pointerover"]),ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="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(" "),X1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function iv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],d=l.event;l=l.listeners;e:{var h=void 0;if(t)for(var x=l.length-1;0<=x;x--){var T=l[x],j=T.instance,P=T.currentTarget;if(T=T.listener,j!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=P;try{h(d)}catch(K){Io(K)}d.currentTarget=null,h=j}else for(x=0;x<l.length;x++){if(T=l[x],j=T.instance,P=T.currentTarget,T=T.listener,j!==h&&d.isPropagationStopped())break e;h=T,d.currentTarget=P;try{h(d)}catch(K){Io(K)}d.currentTarget=null,h=j}}}}function Ne(e,t){var s=t[Dc];s===void 0&&(s=t[Dc]=new Set);var l=e+"__bubble";s.has(l)||(lv(t,e,2,!1),s.add(l))}function bd(e,t,s){var l=0;t&&(l|=4),lv(s,e,l,t)}var Sr="_reactListening"+Math.random().toString(36).slice(2);function xd(e){if(!e[Sr]){e[Sr]=!0,Jh.forEach(function(s){s!=="selectionchange"&&(X1.has(s)||bd(s,!1,e),bd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sr]||(t[Sr]=!0,bd("selectionchange",!1,t))}}function lv(e,t,s,l){switch(Bv(t)){case 2:var d=kS;break;case 8:d=CS;break;default:d=Bd}s=d.bind(null,t,s,e),d=void 0,!Vc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,s,{capture:!0,passive:d}):e.addEventListener(t,s,!0):d!==void 0?e.addEventListener(t,s,{passive:d}):e.addEventListener(t,s,!1)}function _d(e,t,s,l,d){var h=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var x=l.tag;if(x===3||x===4){var T=l.stateNode.containerInfo;if(T===d)break;if(x===4)for(x=l.return;x!==null;){var j=x.tag;if((j===3||j===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;T!==null;){if(x=Vs(T),x===null)return;if(j=x.tag,j===5||j===6||j===26||j===27){l=h=x;continue e}T=T.parentNode}}l=l.return}dp(function(){var P=h,K=zc(s),Q=[];e:{var $=Up.get(e);if($!==void 0){var F=Ro,ue=e;switch(e){case"keypress":if(Do(s)===0)break e;case"keydown":case"keyup":F=P_;break;case"focusin":ue="focus",F=$c;break;case"focusout":ue="blur",F=$c;break;case"beforeblur":case"afterblur":F=$c;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=pp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=D_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=q_;break;case Bp:case Ip:case Lp:F=O_;break;case zp:F=K_;break;case"scroll":case"scrollend":F=j_;break;case"wheel":F=X_;break;case"copy":case"cut":case"paste":F=I_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=gp;break;case"toggle":case"beforetoggle":F=W_}var ge=(t&4)!==0,Ke=!ge&&(e==="scroll"||e==="scrollend"),L=ge?$!==null?$+"Capture":null:$;ge=[];for(var w=P,H;w!==null;){var Z=w;if(H=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||H===null||L===null||(Z=Wi(w,L),Z!=null&&ge.push(Dl(w,Z,H))),Ke)break;w=w.return}0<ge.length&&($=new F($,ue,null,s,K),Q.push({event:$,listeners:ge}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",$&&s!==Lc&&(ue=s.relatedTarget||s.fromElement)&&(Vs(ue)||ue[Us]))break e;if((F||$)&&($=K.window===K?K:($=K.ownerDocument)?$.defaultView||$.parentWindow:window,F?(ue=s.relatedTarget||s.toElement,F=P,ue=ue?Vs(ue):null,ue!==null&&(Ke=f(ue),ge=ue.tag,ue!==Ke||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(F=null,ue=P),F!==ue)){if(ge=pp,Z="onMouseLeave",L="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ge=gp,Z="onPointerLeave",L="onPointerEnter",w="pointer"),Ke=F==null?$:Qi(F),H=ue==null?$:Qi(ue),$=new ge(Z,w+"leave",F,s,K),$.target=Ke,$.relatedTarget=H,Z=null,Vs(K)===P&&(ge=new ge(L,w+"enter",ue,s,K),ge.target=H,ge.relatedTarget=Ke,Z=ge),Ke=Z,F&&ue)t:{for(ge=Q1,L=F,w=ue,H=0,Z=L;Z;Z=ge(Z))H++;Z=0;for(var pe=w;pe;pe=ge(pe))Z++;for(;0<H-Z;)L=ge(L),H--;for(;0<Z-H;)w=ge(w),Z--;for(;H--;){if(L===w||w!==null&&L===w.alternate){ge=L;break t}L=ge(L),w=ge(w)}ge=null}else ge=null;F!==null&&ov(Q,$,F,ge,!1),ue!==null&&Ke!==null&&ov(Q,Ke,ue,ge,!0)}}e:{if($=P?Qi(P):window,F=$.nodeName&&$.nodeName.toLowerCase(),F==="select"||F==="input"&&$.type==="file")var Oe=kp;else if(Sp($))if(Cp)Oe=r1;else{Oe=l1;var fe=i1}else F=$.nodeName,!F||F.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?P&&Ic(P.elementType)&&(Oe=kp):Oe=o1;if(Oe&&(Oe=Oe(e,P))){Tp(Q,Oe,s,K);break e}fe&&fe(e,$,P),e==="focusout"&&P&&$.type==="number"&&P.memoizedProps.value!=null&&Bc($,"number",$.value)}switch(fe=P?Qi(P):window,e){case"focusin":(Sp(fe)||fe.contentEditable==="true")&&(Zs=fe,Xc=P,ll=null);break;case"focusout":ll=Xc=Zs=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,Rp(Q,s,K);break;case"selectionchange":if(u1)break;case"keydown":case"keyup":Rp(Q,s,K)}var Se;if(qc)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Ks?xp(e,s)&&(we="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(we="onCompositionStart");we&&(vp&&s.locale!=="ko"&&(Ks||we!=="onCompositionStart"?we==="onCompositionEnd"&&Ks&&(Se=fp()):(Ta=K,Hc="value"in Ta?Ta.value:Ta.textContent,Ks=!0)),fe=Tr(P,we),0<fe.length&&(we=new mp(we,e,null,s,K),Q.push({event:we,listeners:fe}),Se?we.data=Se:(Se=_p(s),Se!==null&&(we.data=Se)))),(Se=e1?t1(e,s):n1(e,s))&&(we=Tr(P,"onBeforeInput"),0<we.length&&(fe=new mp("onBeforeInput","beforeinput",null,s,K),Q.push({event:fe,listeners:we}),fe.data=Se)),Y1(Q,e,P,s,K)}iv(Q,t)})}function Dl(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Tr(e,t){for(var s=t+"Capture",l=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Wi(e,s),d!=null&&l.unshift(Dl(e,d,h)),d=Wi(e,t),d!=null&&l.push(Dl(e,d,h))),e.tag===3)return l;e=e.return}return[]}function Q1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ov(e,t,s,l,d){for(var h=t._reactName,x=[];s!==null&&s!==l;){var T=s,j=T.alternate,P=T.stateNode;if(T=T.tag,j!==null&&j===l)break;T!==5&&T!==26&&T!==27||P===null||(j=P,d?(P=Wi(s,h),P!=null&&x.unshift(Dl(s,P,j))):d||(P=Wi(s,h),P!=null&&x.push(Dl(s,P,j)))),s=s.return}x.length!==0&&e.push({event:t,listeners:x})}var W1=/\r\n?/g,J1=/\u0000|\uFFFD/g;function rv(e){return(typeof e=="string"?e:""+e).replace(W1,`
|
|
25
|
+
`).replace(J1,"")}function cv(e,t){return t=rv(t),rv(e)===t}function Ye(e,t,s,l,d,h){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Fs(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Fs(e,""+l);break;case"className":No(e,"class",l);break;case"tabIndex":No(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":No(e,s,l);break;case"style":cp(e,l,h);break;case"data":if(t!=="object"){No(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=jo(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&Ye(e,t,"name",d.name,d,null),Ye(e,t,"formEncType",d.formEncType,d,null),Ye(e,t,"formMethod",d.formMethod,d,null),Ye(e,t,"formTarget",d.formTarget,d,null)):(Ye(e,t,"encType",d.encType,d,null),Ye(e,t,"method",d.method,d,null),Ye(e,t,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=jo(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Zn);break;case"onScroll":l!=null&&Ne("scroll",e);break;case"onScrollEnd":l!=null&&Ne("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=jo(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ne("beforetoggle",e),Ne("toggle",e),Eo(e,"popover",l);break;case"xlinkActuate":Kn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Kn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Kn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Kn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Kn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Kn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Eo(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=N_.get(s)||s,Eo(e,s,l))}}function Sd(e,t,s,l,d,h){switch(s){case"style":cp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Fs(e,l):(typeof l=="number"||typeof l=="bigint")&&Fs(e,""+l);break;case"onScroll":l!=null&&Ne("scroll",e);break;case"onScrollEnd":l!=null&&Ne("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ep.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),t=s.slice(2,d?s.length-7:void 0),h=e[Ft]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,d);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Eo(e,s,l)}}}function Rt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var l=!1,d=!1,h;for(h in s)if(s.hasOwnProperty(h)){var x=s[h];if(x!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,h,x,s,null)}}d&&Ye(e,t,"srcSet",s.srcSet,s,null),l&&Ye(e,t,"src",s.src,s,null);return;case"input":Ne("invalid",e);var T=h=x=d=null,j=null,P=null;for(l in s)if(s.hasOwnProperty(l)){var K=s[l];if(K!=null)switch(l){case"name":d=K;break;case"type":x=K;break;case"checked":j=K;break;case"defaultChecked":P=K;break;case"value":h=K;break;case"defaultValue":T=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:Ye(e,t,l,K,s,null)}}ip(e,h,T,j,P,x,d,!1);return;case"select":Ne("invalid",e),l=x=h=null;for(d in s)if(s.hasOwnProperty(d)&&(T=s[d],T!=null))switch(d){case"value":h=T;break;case"defaultValue":x=T;break;case"multiple":l=T;default:Ye(e,t,d,T,s,null)}t=h,s=x,e.multiple=!!l,t!=null?$s(e,!!l,t,!1):s!=null&&$s(e,!!l,s,!0);return;case"textarea":Ne("invalid",e),h=d=l=null;for(x in s)if(s.hasOwnProperty(x)&&(T=s[x],T!=null))switch(x){case"value":l=T;break;case"defaultValue":d=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:Ye(e,t,x,T,s,null)}op(e,l,d,h);return;case"option":for(j in s)if(s.hasOwnProperty(j)&&(l=s[j],l!=null))switch(j){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ye(e,t,j,l,s,null)}return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(l=0;l<wl.length;l++)Ne(wl[l],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in s)if(s.hasOwnProperty(P)&&(l=s[P],l!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,P,l,s,null)}return;default:if(Ic(t)){for(K in s)s.hasOwnProperty(K)&&(l=s[K],l!==void 0&&Sd(e,t,K,l,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(l=s[T],l!=null&&Ye(e,t,T,l,s,null))}function eS(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,T=null,j=null,P=null,K=null;for(F in s){var Q=s[F];if(s.hasOwnProperty(F)&&Q!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":j=Q;default:l.hasOwnProperty(F)||Ye(e,t,F,null,l,Q)}}for(var $ in l){var F=l[$];if(Q=s[$],l.hasOwnProperty($)&&(F!=null||Q!=null))switch($){case"type":h=F;break;case"name":d=F;break;case"checked":P=F;break;case"defaultChecked":K=F;break;case"value":x=F;break;case"defaultValue":T=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:F!==Q&&Ye(e,t,$,F,l,Q)}}Oc(e,x,T,j,P,K,h,d);return;case"select":F=x=T=$=null;for(h in s)if(j=s[h],s.hasOwnProperty(h)&&j!=null)switch(h){case"value":break;case"multiple":F=j;default:l.hasOwnProperty(h)||Ye(e,t,h,null,l,j)}for(d in l)if(h=l[d],j=s[d],l.hasOwnProperty(d)&&(h!=null||j!=null))switch(d){case"value":$=h;break;case"defaultValue":T=h;break;case"multiple":x=h;default:h!==j&&Ye(e,t,d,h,l,j)}t=T,s=x,l=F,$!=null?$s(e,!!s,$,!1):!!l!=!!s&&(t!=null?$s(e,!!s,t,!0):$s(e,!!s,s?[]:"",!1));return;case"textarea":F=$=null;for(T in s)if(d=s[T],s.hasOwnProperty(T)&&d!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ye(e,t,T,null,l,d)}for(x in l)if(d=l[x],h=s[x],l.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":$=d;break;case"defaultValue":F=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==h&&Ye(e,t,x,d,l,h)}lp(e,$,F);return;case"option":for(var ue in s)if($=s[ue],s.hasOwnProperty(ue)&&$!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ye(e,t,ue,null,l,$)}for(j in l)if($=l[j],F=s[j],l.hasOwnProperty(j)&&$!==F&&($!=null||F!=null))switch(j){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ye(e,t,j,$,l,F)}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 ge in s)$=s[ge],s.hasOwnProperty(ge)&&$!=null&&!l.hasOwnProperty(ge)&&Ye(e,t,ge,null,l,$);for(P in l)if($=l[P],F=s[P],l.hasOwnProperty(P)&&$!==F&&($!=null||F!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:Ye(e,t,P,$,l,F)}return;default:if(Ic(t)){for(var Ke in s)$=s[Ke],s.hasOwnProperty(Ke)&&$!==void 0&&!l.hasOwnProperty(Ke)&&Sd(e,t,Ke,void 0,l,$);for(K in l)$=l[K],F=s[K],!l.hasOwnProperty(K)||$===F||$===void 0&&F===void 0||Sd(e,t,K,$,l,F);return}}for(var L in s)$=s[L],s.hasOwnProperty(L)&&$!=null&&!l.hasOwnProperty(L)&&Ye(e,t,L,null,l,$);for(Q in l)$=l[Q],F=s[Q],!l.hasOwnProperty(Q)||$===F||$==null&&F==null||Ye(e,t,Q,$,l,F)}function uv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var d=s[l],h=d.transferSize,x=d.initiatorType,T=d.duration;if(h&&T&&uv(x)){for(x=0,T=d.responseEnd,l+=1;l<s.length;l++){var j=s[l],P=j.startTime;if(P>T)break;var K=j.transferSize,Q=j.initiatorType;K&&uv(Q)&&(j=j.responseEnd,x+=K*(j<T?1:(T-P)/(j-P)))}if(--l,t+=8*(h+x)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Td=null,kd=null;function kr(e){return e.nodeType===9?e:e.ownerDocument}function dv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fv(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Cd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ed=null;function nS(){var e=window.event;return e&&e.type==="popstate"?e===Ed?!1:(Ed=e,!0):(Ed=null,!1)}var hv=typeof setTimeout=="function"?setTimeout:void 0,aS=typeof clearTimeout=="function"?clearTimeout:void 0,pv=typeof Promise=="function"?Promise:void 0,sS=typeof queueMicrotask=="function"?queueMicrotask:typeof pv<"u"?function(e){return pv.resolve(null).then(e).catch(iS)}:hv;function iS(e){setTimeout(function(){throw e})}function Va(e){return e==="head"}function mv(e,t){var s=t,l=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(d),Si(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ml(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ml(s);for(var h=s.firstChild;h;){var x=h.nextSibling,T=h.nodeName;h[Xi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=x}}else s==="body"&&Ml(e.ownerDocument.body);s=d}while(s);Si(t)}function gv(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Nd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Nd(s),Mc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function lS(e,t,s,l){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Tn(e.nextSibling),e===null)break}return null}function oS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Tn(e.nextSibling),e===null))return null;return e}function vv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Tn(e.nextSibling),e===null))return null;return e}function Ad(e){return e.data==="$?"||e.data==="$~"}function jd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var wd=null;function yv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Tn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function xv(e,t,s){switch(t=kr(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ml(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mc(e)}var kn=new Map,_v=new Set;function Cr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var da=q.d;q.d={f:cS,r:uS,D:dS,C:fS,L:hS,m:pS,X:gS,S:mS,M:vS};function cS(){var e=da.f(),t=gr();return e||t}function uS(e){var t=Hs(e);t!==null&&t.tag===5&&t.type==="form"?zm(t):da.r(e)}var bi=typeof document>"u"?null:document;function Sv(e,t,s){var l=bi;if(l&&typeof t=="string"&&t){var d=gn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),_v.has(d)||(_v.add(d),e={rel:e,crossOrigin:s,href:t},l.querySelector(d)===null&&(t=l.createElement("link"),Rt(t,"link",e),Ct(t),l.head.appendChild(t)))}}function dS(e){da.D(e),Sv("dns-prefetch",e,null)}function fS(e,t){da.C(e,t),Sv("preconnect",e,t)}function hS(e,t,s){da.L(e,t,s);var l=bi;if(l&&e&&t){var d='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+gn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+gn(s.imageSizes)+'"]')):d+='[href="'+gn(e)+'"]';var h=d;switch(t){case"style":h=xi(e);break;case"script":h=_i(e)}kn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),kn.set(h,e),l.querySelector(d)!==null||t==="style"&&l.querySelector(Rl(h))||t==="script"&&l.querySelector(Ol(h))||(t=l.createElement("link"),Rt(t,"link",e),Ct(t),l.head.appendChild(t)))}}function pS(e,t){da.m(e,t);var s=bi;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+gn(l)+'"][href="'+gn(e)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=_i(e)}if(!kn.has(h)&&(e=v({rel:"modulepreload",href:e},t),kn.set(h,e),s.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ol(h)))return}l=s.createElement("link"),Rt(l,"link",e),Ct(l),s.head.appendChild(l)}}}function mS(e,t,s){da.S(e,t,s);var l=bi;if(l&&e){var d=Gs(l).hoistableStyles,h=xi(e);t=t||"default";var x=d.get(h);if(!x){var T={loading:0,preload:null};if(x=l.querySelector(Rl(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=kn.get(h))&&Dd(e,s);var j=x=l.createElement("link");Ct(j),Rt(j,"link",e),j._p=new Promise(function(P,K){j.onload=P,j.onerror=K}),j.addEventListener("load",function(){T.loading|=1}),j.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Er(x,t,l)}x={type:"stylesheet",instance:x,count:1,state:T},d.set(h,x)}}}function gS(e,t){da.X(e,t);var s=bi;if(s&&e){var l=Gs(s).hoistableScripts,d=_i(e),h=l.get(d);h||(h=s.querySelector(Ol(d)),h||(e=v({src:e,async:!0},t),(t=kn.get(d))&&Md(e,t),h=s.createElement("script"),Ct(h),Rt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function vS(e,t){da.M(e,t);var s=bi;if(s&&e){var l=Gs(s).hoistableScripts,d=_i(e),h=l.get(d);h||(h=s.querySelector(Ol(d)),h||(e=v({src:e,async:!0,type:"module"},t),(t=kn.get(d))&&Md(e,t),h=s.createElement("script"),Ct(h),Rt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function Tv(e,t,s,l){var d=(d=$t.current)?Cr(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=xi(s.href),s=Gs(d).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=xi(s.href);var h=Gs(d).hoistableStyles,x=h.get(e);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=d.querySelector(Rl(e)))&&!h._p&&(x.instance=h,x.state.loading=5),kn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},kn.set(e,s),h||yS(d,e,s,x.state))),t&&l===null)throw Error(o(528,""));return x}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_i(s),s=Gs(d).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function xi(e){return'href="'+gn(e)+'"'}function Rl(e){return'link[rel="stylesheet"]['+e+"]"}function kv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function yS(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Rt(t,"link",s),Ct(t),e.head.appendChild(t))}function _i(e){return'[src="'+gn(e)+'"]'}function Ol(e){return"script[async]"+e}function Cv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+gn(s.href)+'"]');if(l)return t.instance=l,Ct(l),l;var d=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ct(l),Rt(l,"style",d),Er(l,s.precedence,e),t.instance=l;case"stylesheet":d=xi(s.href);var h=e.querySelector(Rl(d));if(h)return t.state.loading|=4,t.instance=h,Ct(h),h;l=kv(s),(d=kn.get(d))&&Dd(l,d),h=(e.ownerDocument||e).createElement("link"),Ct(h);var x=h;return x._p=new Promise(function(T,j){x.onload=T,x.onerror=j}),Rt(h,"link",l),t.state.loading|=4,Er(h,s.precedence,e),t.instance=h;case"script":return h=_i(s.src),(d=e.querySelector(Ol(h)))?(t.instance=d,Ct(d),d):(l=s,(d=kn.get(h))&&(l=v({},s),Md(l,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ct(d),Rt(d,"link",l),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Er(l,s.precedence,e));return t.instance}function Er(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,x=0;x<l.length;x++){var T=l[x];if(T.dataset.precedence===t)h=T;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Dd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Nr=null;function Ev(e,t,s){if(Nr===null){var l=new Map,d=Nr=new Map;d.set(s,l)}else d=Nr,l=d.get(s),l||(l=new Map,d.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var h=s[d];if(!(h[Xi]||h[jt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(t)||"";x=e+x;var T=l.get(x);T?T.push(h):l.set(x,[h])}}return l}function Nv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function bS(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Av(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xS(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=xi(l.href),h=t.querySelector(Rl(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ar.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Ct(h);return}h=t.ownerDocument||t,l=kv(l),(d=kn.get(d))&&Dd(l,d),h=h.createElement("link"),Ct(h);var x=h;x._p=new Promise(function(T,j){x.onload=T,x.onerror=j}),Rt(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ar.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Rd=0;function _S(e,t){return e.stylesheets&&e.count===0&&wr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&wr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Rd===0&&(Rd=62500*tS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Rd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jr=null;function wr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jr=new Map,t.forEach(SS,e),jr=null,Ar.call(e))}function SS(e,t){if(!(t.state.loading&4)){var s=jr.get(e);if(s)var l=s.get(null);else{s=new Map,jr.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),l=x)}l&&s.set(null,l)}d=t.instance,x=d.getAttribute("data-precedence"),h=s.get(x)||l,h===l&&s.set(null,d),s.set(x,d),this.count++,l=Ar.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Bl={$$typeof:M,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function TS(e,t,s,l,d,h,x,T,j){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ac(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.hiddenUpdates=Ac(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function jv(e,t,s,l,d,h,x,T,j,P,K,Q){return e=new TS(e,t,s,x,j,P,K,Q,T),t=1,h===!0&&(t|=24),h=nn(3,null,null,t),e.current=h,h.stateNode=e,t=fu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:t},gu(h),e}function wv(e){return e?(e=Ws,e):Ws}function Dv(e,t,s,l,d,h){d=wv(d),l.context===null?l.context=d:l.pendingContext=d,l=ja(t),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=wa(e,l,t),s!==null&&(Qt(s,e,t),hl(s,e,t))}function Mv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Od(e,t){Mv(e,t),(e=e.alternate)&&Mv(e,t)}function Rv(e){if(e.tag===13||e.tag===31){var t=rs(e,67108864);t!==null&&Qt(t,e,67108864),Od(e,67108864)}}function Ov(e){if(e.tag===13||e.tag===31){var t=rn();t=jc(t);var s=rs(e,t);s!==null&&Qt(s,e,t),Od(e,t)}}var Dr=!0;function kS(e,t,s,l){var d=B.T;B.T=null;var h=q.p;try{q.p=2,Bd(e,t,s,l)}finally{q.p=h,B.T=d}}function CS(e,t,s,l){var d=B.T;B.T=null;var h=q.p;try{q.p=8,Bd(e,t,s,l)}finally{q.p=h,B.T=d}}function Bd(e,t,s,l){if(Dr){var d=Id(l);if(d===null)_d(e,t,l,Mr,s),Iv(e,l);else if(NS(d,e,t,s,l))l.stopPropagation();else if(Iv(e,l),t&4&&-1<ES.indexOf(e)){for(;d!==null;){var h=Hs(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=as(h.pendingLanes);if(x!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;x;){var j=1<<31-Fe(x);T.entanglements[1]|=j,x&=~j}zn(h),(Ue&6)===0&&(pr=Bt()+500,jl(0))}}break;case 31:case 13:T=rs(h,2),T!==null&&Qt(T,h,2),gr(),Od(h,2)}if(h=Id(l),h===null&&_d(e,t,l,Mr,s),h===d)break;d=h}d!==null&&l.stopPropagation()}else _d(e,t,l,null,s)}}function Id(e){return e=zc(e),Ld(e)}var Mr=null;function Ld(e){if(Mr=null,e=Vs(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=u(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mr=e,null}function Bv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Nc()){case X:return 2;case le:return 8;case ce:case xe:return 32;case be:return 268435456;default:return 32}default:return 32}}var zd=!1,Ha=null,Ga=null,Pa=null,Il=new Map,Ll=new Map,$a=[],ES="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 Iv(e,t){switch(e){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":Il.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(t.pointerId)}}function zl(e,t,s,l,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Hs(t),t!==null&&Rv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function NS(e,t,s,l,d){switch(t){case"focusin":return Ha=zl(Ha,e,t,s,l,d),!0;case"dragenter":return Ga=zl(Ga,e,t,s,l,d),!0;case"mouseover":return Pa=zl(Pa,e,t,s,l,d),!0;case"pointerover":var h=d.pointerId;return Il.set(h,zl(Il.get(h)||null,e,t,s,l,d)),!0;case"gotpointercapture":return h=d.pointerId,Ll.set(h,zl(Ll.get(h)||null,e,t,s,l,d)),!0}return!1}function Lv(e){var t=Vs(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=u(s),t!==null){e.blockedOn=t,Qh(e.priority,function(){Ov(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Qh(e.priority,function(){Ov(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Id(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Lc=l,s.target.dispatchEvent(l),Lc=null}else return t=Hs(s),t!==null&&Rv(t),e.blockedOn=s,!1;t.shift()}return!0}function zv(e,t,s){Rr(e)&&s.delete(t)}function AS(){zd=!1,Ha!==null&&Rr(Ha)&&(Ha=null),Ga!==null&&Rr(Ga)&&(Ga=null),Pa!==null&&Rr(Pa)&&(Pa=null),Il.forEach(zv),Ll.forEach(zv)}function Or(e,t){e.blockedOn===t&&(e.blockedOn=null,zd||(zd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,AS)))}var Br=null;function Uv(e){Br!==e&&(Br=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Br===e&&(Br=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],d=e[t+2];if(typeof l!="function"){if(Ld(l||s)===null)continue;break}var h=Hs(s);h!==null&&(e.splice(t,3),t-=3,Iu(h,{pending:!0,data:d,method:s.method,action:l},l,d))}}))}function Si(e){function t(j){return Or(j,e)}Ha!==null&&Or(Ha,e),Ga!==null&&Or(Ga,e),Pa!==null&&Or(Pa,e),Il.forEach(t),Ll.forEach(t);for(var s=0;s<$a.length;s++){var l=$a[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<$a.length&&(s=$a[0],s.blockedOn===null);)Lv(s),s.blockedOn===null&&$a.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var d=s[l],h=s[l+1],x=d[Ft]||null;if(typeof h=="function")x||Uv(s);else if(x){var T=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[Ft]||null)T=x.formAction;else if(Ld(d)!==null)continue}else T=x.action;typeof T=="function"?s[l+1]=T:(s.splice(l,3),l-=3),Uv(s)}}}function Vv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Ud(e){this._internalRoot=e}Ir.prototype.render=Ud.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,l=rn();Dv(s,l,e,t,null,null)},Ir.prototype.unmount=Ud.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dv(e.current,2,null,e,null,null),gr(),t[Us]=null}};function Ir(e){this._internalRoot=e}Ir.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<$a.length&&t!==0&&t<$a[s].priority;s++);$a.splice(s,0,e),s===0&&Lv(e)}};var Hv=a.version;if(Hv!=="19.2.4")throw Error(o(527,Hv,"19.2.4"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var jS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lr.isDisabled&&Lr.supportsFiber)try{ft=Lr.inject(jS),Ce=Lr}catch{}}return Ul.createRoot=function(e,t){if(!r(e))throw Error(o(299));var s=!1,l="",d=Km,h=Zm,x=Xm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=jv(e,1,!1,null,null,s,l,null,d,h,x,Vv),e[Us]=t.current,xd(e),new Ud(t)},Ul.hydrateRoot=function(e,t,s){if(!r(e))throw Error(o(299));var l=!1,d="",h=Km,x=Zm,T=Xm,j=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(j=s.formState)),t=jv(e,1,!0,t,s??null,l,d,j,h,x,T,Vv),t.context=wv(null),s=t.current,l=rn(),l=jc(l),d=ja(l),d.callback=null,wa(s,d,l),s=l,t.current.lanes=s,Zi(t,s),zn(t),e[Us]=t.current,xd(e),new Ir(t)},Ul.version="19.2.4",Ul}var Kv;function FS(){if(Kv)return Vd.exports;Kv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Vd.exports=$S(),Vd.exports}var qS=FS();function Pt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function so(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function YS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Pt(n.payload)}function KS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"&&(typeof n.adapterConfig=="string"||n.adapterConfig===void 0)}function ZS(n){return{...n,adapterConfig:n.adapterConfig??"{}"}}function Zv(n){return Pt(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function Xv(n){return Pt(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}function XS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function QS(n){return Pt(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function WS(n){return Pt(n)&&typeof n.id=="string"&&typeof n.workspaceId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function JS(n){return Pt(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const eT=new Set(["off","subscription","api_key"]),Pd=new Set(["off","on"]);function Qv(n){return Pt(n)&&eT.has(n.claude)&&Pd.has(n.github)&&Pd.has(n.copilot)&&Pd.has(n.codex)}function tT(n){return Pt(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function nT(n){return Pt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"&&typeof n.type=="string"&&typeof n.script=="string"}function Gn(n,a,i,o){return Array.isArray(n)?n.filter((r,f)=>a(r)?!0:(so(i,`item at index ${f} in "${o}" has unexpected shape`),!1)):(so(i,`expected "${o}" to be an array, got ${typeof n}`),[])}function aT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Pt(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return typeof a.id=="string"&&typeof a.timestamp=="string"?{id:a.id,type:a.type,timestamp:a.timestamp,payload:Pt(a.payload)?a.payload:{}}:{type:a.type,payload:Pt(a.payload)?a.payload:void 0}}function sT(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const iT=3e3,Ti=5e3,lT=4001;/**
|
|
26
|
+
* react-router v7.13.1
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) Remix Software Inc.
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the MIT license found in the
|
|
31
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
+
*
|
|
33
|
+
* @license MIT
|
|
34
|
+
*/var Wv="popstate";function Jv(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function oT(n={}){function a(o,r){var g;let f=(g=r.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=f||o.location;return mf("",{pathname:u,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",f?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:io(r)}return cT(a,i,null,n)}function tt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Nn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function rT(){return Math.random().toString(36).substring(2,10)}function ey(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function mf(n,a,i=null,o,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?zi(a):a,state:i,key:a&&a.key||o||rT(),unstable_mask:r}}function io({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function zi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function cT(n,a,i,o={}){let{window:r=document.defaultView,v5Compat:f=!1}=o,u=r.history,p="POP",m=null,g=y();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function y(){return(u.state||{idx:null}).idx}function v(){p="POP";let N=y(),k=N==null?null:N-g;g=N,m&&m({action:p,location:E.location,delta:k})}function b(N,k){p="PUSH";let A=Jv(N)?N:mf(E.location,N,k);g=y()+1;let M=ey(A,g),D=E.createHref(A.unstable_mask||A);try{u.pushState(M,"",D)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;r.location.assign(D)}f&&m&&m({action:p,location:E.location,delta:1})}function S(N,k){p="REPLACE";let A=Jv(N)?N:mf(E.location,N,k);g=y();let M=ey(A,g),D=E.createHref(A.unstable_mask||A);u.replaceState(M,"",D),f&&m&&m({action:p,location:E.location,delta:0})}function C(N){return uT(N)}let E={get action(){return p},get location(){return n(r,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(Wv,v),m=N,()=>{r.removeEventListener(Wv,v),m=null}},createHref(N){return a(r,N)},createURL:C,encodeLocation(N){let k=C(N);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:S,go(N){return u.go(N)}};return E}function uT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),tt(i,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:io(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function q0(n,a,i="/"){return dT(n,a,i,!1)}function dT(n,a,i,o){let r=typeof a=="string"?zi(a):a,f=ga(r.pathname||"/",i);if(f==null)return null;let u=Y0(n);fT(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=Z0(f);p=_T(u[m],g,o)}return p}function Y0(n,a=[],i=[],o="",r=!1){let f=(u,p,m=r,g)=>{let y={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&m)return;tt(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Pn([o,y.relativePath]),b=i.concat(y);u.children&&u.children.length>0&&(tt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Y0(u.children,a,b,v,m)),!(u.path==null&&!u.index)&&a.push({path:v,score:bT(v,u.index),routesMeta:b})};return n.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))f(u,p);else for(let g of K0(u.path))f(u,p,!0,g)}),a}function K0(n){let a=n.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),f=i.replace(/\?$/,"");if(o.length===0)return r?[f,""]:[f];let u=K0(o.join("/")),p=[];return p.push(...u.map(m=>m===""?f:[f,m].join("/"))),r&&p.push(...u),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function fT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:xT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var hT=/^:[\w-]+$/,pT=3,mT=2,gT=1,vT=10,yT=-2,ty=n=>n==="*";function bT(n,a){let i=n.split("/"),o=i.length;return i.some(ty)&&(o+=yT),a&&(o+=mT),i.filter(r=>!ty(r)).reduce((r,f)=>r+(hT.test(f)?pT:f===""?gT:vT),o)}function xT(n,a){return n.length===a.length&&n.slice(0,-1).every((o,r)=>o===a[r])?n[n.length-1]-a[a.length-1]:0}function _T(n,a,i=!1){let{routesMeta:o}=n,r={},f="/",u=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,y=f==="/"?a:a.slice(f.length)||"/",v=lo({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),b=m.route;if(!v&&g&&i&&!o[o.length-1].route.index&&(v=lo({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),u.push({params:r,pathname:Pn([f,v.pathname]),pathnameBase:ET(Pn([f,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(f=Pn([f,v.pathnameBase]))}return u}function lo(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,o]=ST(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let f=r[0],u=f.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:y,isOptional:v},b)=>{if(y==="*"){let C=p[b]||"";u=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const S=p[b];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:u,pattern:n}}function ST(n,a=!1,i=!0){Nn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,y)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+u.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function Z0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Nn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function ga(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=n.charAt(i);return o&&o!=="/"?null:n.slice(i)||"/"}var TT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function kT(n,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof n=="string"?zi(n):n,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=ny(i.substring(1),"/"):f=ny(i,a)):f=a,{pathname:f,search:NT(o),hash:AT(r)}}function ny(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function $d(n,a,i,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function CT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Zf(n){let a=CT(n);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function mc(n,a,i,o=!1){let r;typeof n=="string"?r=zi(n):(r={...n},tt(!r.pathname||!r.pathname.includes("?"),$d("?","pathname","search",r)),tt(!r.pathname||!r.pathname.includes("#"),$d("#","pathname","hash",r)),tt(!r.search||!r.search.includes("#"),$d("#","search","hash",r)));let f=n===""||r.pathname==="",u=f?"/":r.pathname,p;if(u==null)p=i;else{let v=a.length-1;if(!o&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),v-=1;r.pathname=b.join("/")}p=v>=0?a[v]:"/"}let m=kT(r,p),g=u&&u!=="/"&&u.endsWith("/"),y=(f||u===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Pn=n=>n.join("/").replace(/\/\/+/g,"/"),ET=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),NT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,AT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,jT=class{constructor(n,a,i,o=!1){this.status=n,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function wT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function DT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var X0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Q0(n,a){let i=n;if(typeof i!="string"||!TT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(X0)try{let f=new URL(window.location.href),u=i.startsWith("//")?new URL(f.protocol+i):new URL(i),p=ga(u.pathname,a);u.origin===f.origin&&p!=null?i=p+u.search+u.hash:r=!0}catch{Nn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var W0=["POST","PUT","PATCH","DELETE"];new Set(W0);var MT=["GET",...W0];new Set(MT);var Ui=_.createContext(null);Ui.displayName="DataRouter";var gc=_.createContext(null);gc.displayName="DataRouterState";var RT=_.createContext(!1),J0=_.createContext({isTransitioning:!1});J0.displayName="ViewTransition";var OT=_.createContext(new Map);OT.displayName="Fetchers";var BT=_.createContext(null);BT.displayName="Await";var hn=_.createContext(null);hn.displayName="Navigation";var mo=_.createContext(null);mo.displayName="Location";var An=_.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName="Route";var Xf=_.createContext(null);Xf.displayName="RouteError";var eb="REACT_ROUTER_ERROR",IT="REDIRECT",LT="ROUTE_ERROR_RESPONSE";function zT(n){if(n.startsWith(`${eb}:${IT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function UT(n){if(n.startsWith(`${eb}:${LT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new jT(a.status,a.statusText,a.data)}catch{}}function VT(n,{relative:a}={}){tt(ws(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=_.useContext(hn),{hash:r,pathname:f,search:u}=go(n,{relative:a}),p=f;return i!=="/"&&(p=f==="/"?i:Pn([i,f])),o.createHref({pathname:p,search:u,hash:r})}function ws(){return _.useContext(mo)!=null}function At(){return tt(ws(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(mo).location}function Nt(n){tt(ws(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=At();return _.useMemo(()=>lo(n,Z0(a)),[a,n])}var tb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nb(n){_.useContext(hn).static||_.useLayoutEffect(n)}function vc(){let{isDataRoute:n}=_.useContext(An);return n?tk():HT()}function HT(){tt(ws(),"useNavigate() may be used only in the context of a <Router> component.");let n=_.useContext(Ui),{basename:a,navigator:i}=_.useContext(hn),{matches:o}=_.useContext(An),{pathname:r}=At(),f=JSON.stringify(Zf(o)),u=_.useRef(!1);return nb(()=>{u.current=!0}),_.useCallback((m,g={})=>{if(Nn(u.current,tb),!u.current)return;if(typeof m=="number"){i.go(m);return}let y=mc(m,JSON.parse(f),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Pn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,f,r,n])}var GT=_.createContext(null);function PT(n){let a=_.useContext(An).outlet;return _.useMemo(()=>a&&_.createElement(GT.Provider,{value:n},a),[a,n])}function Vi(){let{matches:n}=_.useContext(An),a=n[n.length-1];return a?a.params:{}}function go(n,{relative:a}={}){let{matches:i}=_.useContext(An),{pathname:o}=At(),r=JSON.stringify(Zf(i));return _.useMemo(()=>mc(n,JSON.parse(r),o,a==="path"),[n,r,o,a])}function $T(n,a){return ab(n,a)}function ab(n,a,i){var N;tt(ws(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=_.useContext(hn),{matches:r}=_.useContext(An),f=r[r.length-1],u=f?f.params:{},p=f?f.pathname:"/",m=f?f.pathnameBase:"/",g=f&&f.route;{let k=g&&g.path||"";ib(p,!g||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
35
|
+
|
|
36
|
+
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let y=At(),v;if(a){let k=typeof a=="string"?zi(a):a;tt(m==="/"||((N=k.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${k.pathname}" was given in the \`location\` prop.`),v=k}else v=y;let b=v.pathname||"/",S=b;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=q0(n,{pathname:S});Nn(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Nn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=ZT(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},u,k.params),pathname:Pn([m,o.encodeLocation?o.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:Pn([m,o.encodeLocation?o.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),r,i);return a&&E?_.createElement(mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},E):E}function FT(){let n=ek(),a=wT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:f},"ErrorBoundary")," or"," ",_.createElement("code",{style:f},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},a),i?_.createElement("pre",{style:r},i):null,u)}var qT=_.createElement(FT,null),sb=class extends _.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=UT(n.digest);i&&(n=i)}let a=n!==void 0?_.createElement(An.Provider,{value:this.props.routeContext},_.createElement(Xf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?_.createElement(YT,{error:n},a):a}};sb.contextType=RT;var Fd=new WeakMap;function YT({children:n,error:a}){let{basename:i}=_.useContext(hn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=zT(a.digest);if(o){let r=Fd.get(a);if(r)throw r;let f=Q0(o.location,i);if(X0&&!Fd.get(a))if(f.isExternal||o.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw Fd.set(a,u),u}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return n}function KT({routeContext:n,match:a,children:i}){let o=_.useContext(Ui);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),_.createElement(An.Provider,{value:n},i)}function ZT(n,a=[],i){let o=i==null?void 0:i.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let r=n,f=o==null?void 0:o.errors;if(f!=null){let y=r.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);tt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let u=!1,p=-1;if(i&&o){u=o.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:b,errors:S}=o,C=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||C){i.isStatic&&(u=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(y,v)=>{var b,S;m(y,{location:o.location,params:((S=(b=o.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:DT(o.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,b)=>{let S,C=!1,E=null,N=null;o&&(S=f&&v.route.id?f[v.route.id]:void 0,E=v.route.errorElement||qT,u&&(p<0&&b===0?(ib("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,N=null):p===b&&(C=!0,N=v.route.hydrateFallbackElement||null)));let k=a.concat(r.slice(0,b+1)),A=()=>{let M;return S?M=E:C?M=N:v.route.Component?M=_.createElement(v.route.Component,null):v.route.element?M=v.route.element:M=y,_.createElement(KT,{match:v,routeContext:{outlet:y,matches:k,isDataRoute:o!=null},children:M})};return o&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?_.createElement(sb,{location:o.location,revalidation:o.revalidation,component:E,error:S,children:A(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:g}):A()},null)}function Qf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(n){let a=_.useContext(Ui);return tt(a,Qf(n)),a}function QT(n){let a=_.useContext(gc);return tt(a,Qf(n)),a}function WT(n){let a=_.useContext(An);return tt(a,Qf(n)),a}function Wf(n){let a=WT(n),i=a.matches[a.matches.length-1];return tt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function JT(){return Wf("useRouteId")}function ek(){var o;let n=_.useContext(Xf),a=QT("useRouteError"),i=Wf("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[i]}function tk(){let{router:n}=XT("useNavigate"),a=Wf("useNavigate"),i=_.useRef(!1);return nb(()=>{i.current=!0}),_.useCallback(async(r,f={})=>{Nn(i.current,tb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...f}))},[n,a])}var ay={};function ib(n,a,i){!a&&!ay[n]&&(ay[n]=!0,Nn(!1,i))}_.memo(nk);function nk({routes:n,future:a,state:i,isStatic:o,onError:r}){return ab(n,void 0,{state:i,isStatic:o,onError:r})}function Ka({to:n,replace:a,state:i,relative:o}){tt(ws(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=_.useContext(hn);Nn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=_.useContext(An),{pathname:u}=At(),p=vc(),m=mc(n,Zf(f),u,o==="path"),g=JSON.stringify(m);return _.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Jf(n){return PT(n.context)}function Re(n){tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ak({basename:n="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:f=!1,unstable_useTransitions:u}){tt(!ws(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=_.useMemo(()=>({basename:p,navigator:r,static:f,unstable_useTransitions:u,future:{}}),[p,r,f,u]);typeof i=="string"&&(i=zi(i));let{pathname:g="/",search:y="",hash:v="",state:b=null,key:S="default",unstable_mask:C}=i,E=_.useMemo(()=>{let N=ga(g,p);return N==null?null:{location:{pathname:N,search:y,hash:v,state:b,key:S,unstable_mask:C},navigationType:o}},[p,g,y,v,b,S,o,C]);return Nn(E!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:_.createElement(hn.Provider,{value:m},_.createElement(mo.Provider,{children:a,value:E}))}function sk({children:n,location:a}){return $T(gf(n),a)}function gf(n,a=[]){let i=[];return _.Children.forEach(n,(o,r)=>{if(!_.isValidElement(o))return;let f=[...a,r];if(o.type===_.Fragment){i.push.apply(i,gf(o.props.children,f));return}tt(o.type===Re,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),tt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let u={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(u.children=gf(o.props.children,f)),i.push(u)}),i}var Zr="get",Xr="application/x-www-form-urlencoded";function yc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function ik(n){return yc(n)&&n.tagName.toLowerCase()==="button"}function lk(n){return yc(n)&&n.tagName.toLowerCase()==="form"}function ok(n){return yc(n)&&n.tagName.toLowerCase()==="input"}function rk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function ck(n,a){return n.button===0&&(!a||a==="_self")&&!rk(n)}function vf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let o=n[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function uk(n,a){let i=vf(n);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(f=>{i.append(r,f)})}),i}var Ur=null;function dk(){if(Ur===null)try{new FormData(document.createElement("form"),0),Ur=!1}catch{Ur=!0}return Ur}var fk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qd(n){return n!=null&&!fk.has(n)?(Nn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xr}"`),null):n}function hk(n,a){let i,o,r,f,u;if(lk(n)){let p=n.getAttribute("action");o=p?ga(p,a):null,i=n.getAttribute("method")||Zr,r=qd(n.getAttribute("enctype"))||Xr,f=new FormData(n)}else if(ik(n)||ok(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(o=m?ga(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Zr,r=qd(n.getAttribute("formenctype"))||qd(p.getAttribute("enctype"))||Xr,f=new FormData(p,n),!dk()){let{name:g,type:y,value:v}=n;if(y==="image"){let b=g?`${g}.`:"";f.append(`${b}x`,"0"),f.append(`${b}y`,"0")}else g&&f.append(g,v)}}else{if(yc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Zr,o=null,r=Xr,u=n}return f&&r==="text/plain"&&(u=f,f=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:f,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function eh(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function pk(n,a,i,o){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&ga(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function mk(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gk(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function vk(n,a,i){let o=await Promise.all(n.map(async r=>{let f=a.routes[r.route.id];if(f){let u=await mk(f,i);return u.links?u.links():[]}return[]}));return _k(o.flat(1).filter(gk).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function sy(n,a,i,o,r,f){let u=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return f==="assets"?a.filter((m,g)=>u(m,g)||p(m,g)):f==="data"?a.filter((m,g)=>{var v;let y=o.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function yk(n,a,{includeHydrateFallback:i}={}){return bk(n.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let f=[r.module];return r.clientActionModule&&(f=f.concat(r.clientActionModule)),r.clientLoaderModule&&(f=f.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(f=f.concat(r.hydrateFallbackModule)),r.imports&&(f=f.concat(r.imports)),f}).flat(1))}function bk(n){return[...new Set(n)]}function xk(n){let a={},i=Object.keys(n).sort();for(let o of i)a[o]=n[o];return a}function _k(n,a){let i=new Set;return new Set(a),n.reduce((o,r)=>{let f=JSON.stringify(xk(r));return i.has(f)||(i.add(f),o.push({key:f,link:r})),o},[])}function lb(){let n=_.useContext(Ui);return eh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function Sk(){let n=_.useContext(gc);return eh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var th=_.createContext(void 0);th.displayName="FrameworkContext";function ob(){let n=_.useContext(th);return eh(n,"You must render this element inside a <HydratedRouter> element"),n}function Tk(n,a){let i=_.useContext(th),[o,r]=_.useState(!1),[f,u]=_.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,b=_.useRef(null);_.useEffect(()=>{if(n==="render"&&u(!0),n==="viewport"){let E=k=>{k.forEach(A=>{u(A.isIntersecting)})},N=new IntersectionObserver(E,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[n]),_.useEffect(()=>{if(o){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[o]);let S=()=>{r(!0)},C=()=>{r(!1),u(!1)};return i?n!=="intent"?[f,b,{}]:[f,b,{onFocus:Vl(p,S),onBlur:Vl(m,C),onMouseEnter:Vl(g,S),onMouseLeave:Vl(y,C),onTouchStart:Vl(v,S)}]:[!1,b,{}]}function Vl(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function kk({page:n,...a}){let{router:i}=lb(),o=_.useMemo(()=>q0(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?_.createElement(Ek,{page:n,matches:o,...a}):null}function Ck(n){let{manifest:a,routeModules:i}=ob(),[o,r]=_.useState([]);return _.useEffect(()=>{let f=!1;return vk(n,a,i).then(u=>{f||r(u)}),()=>{f=!0}},[n,a,i]),o}function Ek({page:n,matches:a,...i}){let o=At(),{future:r,manifest:f,routeModules:u}=ob(),{basename:p}=lb(),{loaderData:m,matches:g}=Sk(),y=_.useMemo(()=>sy(n,a,g,f,o,"data"),[n,a,g,f,o]),v=_.useMemo(()=>sy(n,a,g,f,o,"assets"),[n,a,g,f,o]),b=_.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let E=new Set,N=!1;if(a.forEach(A=>{var D;let M=f.routes[A.route.id];!M||!M.hasLoader||(!y.some(z=>z.route.id===A.route.id)&&A.route.id in m&&((D=u[A.route.id])!=null&&D.shouldRevalidate)||M.hasClientLoader?N=!0:E.add(A.route.id))}),E.size===0)return[];let k=pk(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&E.size>0&&k.searchParams.set("_routes",a.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[k.pathname+k.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,f,y,a,n,u]),S=_.useMemo(()=>yk(v,f),[v,f]),C=Ck(v);return _.createElement(_.Fragment,null,b.map(E=>_.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),S.map(E=>_.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),C.map(({key:E,link:N})=>_.createElement("link",{key:E,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function Nk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Ak=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ak&&(window.__reactRouterVersion="7.13.1")}catch{}function jk({basename:n,children:a,unstable_useTransitions:i,window:o}){let r=_.useRef();r.current==null&&(r.current=oT({window:o,v5Compat:!0}));let f=r.current,[u,p]=_.useState({action:f.action,location:f.location}),m=_.useCallback(g=>{i===!1?p(g):_.startTransition(()=>p(g))},[i]);return _.useLayoutEffect(()=>f.listen(m),[f,m]),_.createElement(ak,{basename:n,children:a,location:u.location,navigationType:u.action,navigator:f,unstable_useTransitions:i})}var rb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nh=_.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:f,replace:u,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S,...C},E){let{basename:N,navigator:k,unstable_useTransitions:A}=_.useContext(hn),M=typeof y=="string"&&rb.test(y),D=Q0(y,N);y=D.to;let z=VT(y,{relative:r}),Y=At(),R=null;if(p){let te=mc(p,[],Y.unstable_mask?Y.unstable_mask.pathname:"/",!0);N!=="/"&&(te.pathname=te.pathname==="/"?N:Pn([N,te.pathname])),R=k.createHref(te)}let[O,G,ee]=Tk(o,C),ne=Rk(y,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:A});function ae(te){a&&a(te),te.defaultPrevented||ne(te)}let oe=!(D.isExternal||f),W=_.createElement("a",{...C,...ee,href:(oe?R:void 0)||D.absoluteURL||z,onClick:oe?ae:a,ref:Nk(E,G),target:g,"data-discover":!M&&i==="render"?"true":void 0});return O&&!M?_.createElement(_.Fragment,null,W,_.createElement(kk,{page:z})):W});nh.displayName="Link";var wk=_.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:f,to:u,viewTransition:p,children:m,...g},y){let v=go(u,{relative:g.relative}),b=At(),S=_.useContext(gc),{navigator:C,basename:E}=_.useContext(hn),N=S!=null&&zk(v)&&p===!0,k=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,A=b.pathname,M=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(A=A.toLowerCase(),M=M?M.toLowerCase():null,k=k.toLowerCase()),M&&E&&(M=ga(M,E)||M);const D=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=A===k||!r&&A.startsWith(k)&&A.charAt(D)==="/",Y=M!=null&&(M===k||!r&&M.startsWith(k)&&M.charAt(k.length)==="/"),R={isActive:z,isPending:Y,isTransitioning:N},O=z?a:void 0,G;typeof o=="function"?G=o(R):G=[o,z?"active":null,Y?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof f=="function"?f(R):f;return _.createElement(nh,{...g,"aria-current":O,className:G,ref:y,style:ee,to:u,viewTransition:p},typeof m=="function"?m(R):m)});wk.displayName="NavLink";var Dk=_.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:f,method:u=Zr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},C)=>{let{unstable_useTransitions:E}=_.useContext(hn),N=Ik(),k=Lk(p,{relative:g}),A=u.toLowerCase()==="get"?"get":"post",M=typeof p=="string"&&rb.test(p),D=z=>{if(m&&m(z),z.defaultPrevented)return;z.preventDefault();let Y=z.nativeEvent.submitter,R=(Y==null?void 0:Y.getAttribute("formmethod"))||u,O=()=>N(Y||z.currentTarget,{fetcherKey:a,method:R,navigate:i,replace:r,state:f,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b});E&&i!==!1?_.startTransition(()=>O()):O()};return _.createElement("form",{ref:C,method:A,action:k,onSubmit:o?m:D,...S,"data-discover":!M&&n==="render"?"true":void 0})});Dk.displayName="Form";function Mk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(n){let a=_.useContext(Ui);return tt(a,Mk(n)),a}function Rk(n,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:f,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=vc(),v=At(),b=go(n,{relative:u});return _.useCallback(S=>{if(ck(S,a)){S.preventDefault();let C=i!==void 0?i:io(v)===io(b),E=()=>y(n,{replace:C,unstable_mask:o,state:r,preventScrollReset:f,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?_.startTransition(()=>E()):E()}},[v,y,b,i,o,r,a,n,f,u,p,m,g])}function ub(n){Nn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=_.useRef(vf(n)),i=_.useRef(!1),o=At(),r=_.useMemo(()=>uk(o.search,i.current?null:a.current),[o.search]),f=vc(),u=_.useCallback((p,m)=>{const g=vf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,f("?"+g,m)},[f,r]);return[r,u]}var Ok=0,Bk=()=>`__${String(++Ok)}__`;function Ik(){let{router:n}=cb("useSubmit"),{basename:a}=_.useContext(hn),i=JT(),o=n.fetch,r=n.navigate;return _.useCallback(async(f,u={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=hk(f,a);if(u.navigate===!1){let b=u.fetcherKey||Bk();await o(b,i,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await r(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:v,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:i,flushSync:u.flushSync,viewTransition:u.viewTransition})},[o,r,a,i])}function Lk(n,{relative:a}={}){let{basename:i}=_.useContext(hn),o=_.useContext(An);tt(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),f={...go(n||".",{relative:a})},u=At();if(n==null){f.search=u.search;let p=new URLSearchParams(f.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();f.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Pn([i,f.pathname])),io(f)}function zk(n,{relative:a}={}){let i=_.useContext(J0);tt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=cb("useViewTransitionState"),r=go(n,{relative:a});if(!i.isTransitioning)return!1;let f=ga(i.currentLocation.pathname,o)||i.currentLocation.pathname,u=ga(i.nextLocation.pathname,o)||i.nextLocation.pathname;return lo(r.pathname,u)!=null||lo(r.pathname,f)!=null}function Ut(){const n=vc();return _.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function db(n){return`/sessions/${encodeURIComponent(n)}`}function Ri(n){return`/workspaces/${encodeURIComponent(n)}`}function va(n,a,i){const o=encodeURIComponent(n),r=i?`/workspaces/${encodeURIComponent(i)}/tasks/${o}`:`/tasks/${o}`;return a?`${r}/${a}`:r}function Uk(n,a){return a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function Hi(n,a){const i=new URLSearchParams;n&&i.set("workspace",n),a&&i.set("parent",a);const o=i.toString();return o?`/tasks/new?${o}`:"/tasks/new"}function fb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const oo="/environments",Vk="/environments/new";function yf(n){return`/environments/${encodeURIComponent(n)}`}function Hk(n){return`/environments/${encodeURIComponent(n)}/edit`}const Ql="/settings",Gk="/settings/credentials",Pk="/pair",$k="/chat",vo="/",Fk="/tasks";function qk(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=_.useRef(void 0),[r,f]=_.useState(!1),u=_.useRef(a.onMessage);u.current=a.onMessage;const p=_.useRef(a.onConnect);p.current=a.onConnect;const m=_.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=_.useCallback(y=>{var v;((v=o.current)==null?void 0:v.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(y))},[]);return _.useEffect(()=>{let y,v;function b(){y=new WebSocket(i),o.current=y,y.onopen=()=>{f(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const C=aT(S.data);C&&u.current(C)},y.onclose=S=>{var C;if(f(!1),o.current=void 0,(C=m.current)==null||C.call(m),clearTimeout(v),S.code===lT){window.location.href=Pk;return}v=setTimeout(b,iT)},y.onerror=()=>{y.close()}}return b(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const Yk=5e3;function Kk(n){const[a,i]=_.useState([]),[o,r]=_.useState({}),f=_.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(C=>C.filter(E=>E.id!==S)),r(C=>{const E={...C};return delete E[S],E})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const S=b.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return so("environment.provision_progress","invalid payload"),!0;if(r(C=>({...C,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const C=S.environmentId;setTimeout(()=>{r(E=>{const N={...E};return delete N[C],N})},Yk)}return!0}default:return!1}},[n]),u=_.useCallback(b=>{var S;switch(b.type){case"environments":return i(Gn((S=b.payload)==null?void 0:S.environments,KS,"environments","environments").map(ZS)),!0;default:return!1}},[]),p=_.useCallback((b,S,C)=>{n({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:C||{}}})},[n]),m=_.useCallback((b,S)=>{const C={environmentId:b,...S};n({type:"update_environment",payload:C})},[n]),g=_.useCallback(b=>{n({type:"provision_environment",payload:{environmentId:b}})},[n]),y=_.useCallback(b=>{n({type:"stop_environment",payload:{environmentId:b}})},[n]),v=_.useCallback(b=>{n({type:"remove_environment",payload:{environmentId:b}})},[n]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:y,removeEnvironment:v,handleMessage:u,handleEvent:f}}const Yd=new Set(["pending","running","idle"]),Zk=new Set(["completed","failed","interrupted","hibernating"]),iy=["pending","running","idle"];function Xk(n){const[a,i]=_.useState([]),[o,r]=_.useState([]),[f,u]=_.useState(0),[p,m]=_.useState(void 0),[g,y]=_.useState({}),v=_.useCallback(A=>{var M,D,z,Y,R;switch(A.type){case"sessions":return i(O=>{var ne;const G=Gn((ne=A.payload)==null?void 0:ne.sessions,Zv,"sessions","sessions"),ee=new Map(O.map(ae=>[ae.id,ae.status]));return G.map(ae=>{const oe=ee.get(ae.id);return!oe||oe===ae.status?ae:Zk.has(oe)&&Yd.has(ae.status)?{...ae,status:oe}:Yd.has(oe)&&Yd.has(ae.status)&&iy.indexOf(oe)>iy.indexOf(ae.status)?{...ae,status:oe}:ae})}),!0;case"session_event":{if(!Xv(A.payload))return so("session_event","payload is not a valid SessionEvent"),!0;const O=A.payload;let G=0;if(r(ee=>{const ne=[...ee,O];return ne.length>Ti?(G=ne.length-Ti,ne.slice(-Ti)):ne}),G>0&&u(ee=>ee+G),O.eventType==="status"){const ee=sT(O.content);i(ne=>ne.some(oe=>oe.id===O.sessionId)?ne.map(oe=>oe.id===O.sessionId?{...oe,status:ee}:oe):[...ne,{id:O.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:O.timestamp}])}return!0}case"session_events":{const O=Gn((M=A.payload)==null?void 0:M.events,Xv,"session_events","events"),G=(D=A.payload)==null?void 0:D.sessionId;if(typeof G!="string")return so("session_events","missing or non-string sessionId"),!0;if(O.length>0){let ee=0;r(ne=>{const ae=new Set;for(const te of ne)te.sessionId===G&&ae.add(`${te.timestamp}|${te.eventType}`);const oe=O.filter(te=>!ae.has(`${te.timestamp}|${te.eventType}`)),W=[...ne,...oe].sort((te,B)=>te.sessionId!==B.sessionId?0:te.timestamp.localeCompare(B.timestamp));return W.length>Ti?(ee=W.length-Ti,W.slice(-Ti)):W}),ee>0&&u(ne=>ne+ee)}return!0}case"spawned":{const O=(z=A.payload)==null?void 0:z.sessionId;return typeof O=="string"&&O&&m(O),n({type:"list_sessions"}),!0}case"task_sessions":{const O=(Y=A.payload)==null?void 0:Y.taskId;if(typeof O!="string"||!O)return!0;const G=Gn((R=A.payload)==null?void 0:R.sessions,Zv,"task_sessions","sessions");return y(ee=>({...ee,[O]:G})),!0}default:return!1}},[n]),b=_.useCallback((A,M,D,z)=>{n({type:"spawn",payload:{environmentId:A,prompt:M,personaId:D||"",worktreeBasePath:z||""}})},[n]),S=_.useCallback((A,M)=>{n({type:"send_input",payload:{sessionId:A,text:M}})},[n]),C=_.useCallback(A=>{n({type:"kill",payload:{sessionId:A}})},[n]),E=_.useCallback(A=>{n({type:"get_session_events",payload:{sessionId:A}})},[n]),N=_.useCallback(()=>{r([]),u(0)},[]),k=_.useCallback(A=>{n({type:"get_task_sessions",payload:{taskId:A}})},[n]);return{sessions:a,events:o,eventsDropped:f,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:C,loadSessionEvents:E,clearEvents:N,loadTaskSessions:k,handleMessage:v}}function Qk(n){const[a,i]=_.useState([]),[o,r]=_.useState(!1),f=_.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),u=_.useCallback(v=>{var b;switch(v.type){case"workspaces":return i(Gn((b=v.payload)==null?void 0:b.workspaces,XS,"workspaces","workspaces")),!0;default:return!1}},[]),p=_.useCallback(()=>{r(!1)},[]),m=_.useCallback((v,b,S,C,E)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:b||"",repoUrl:S||"",environmentId:C||"",defaultPersonaId:E||""}})},[n]),g=_.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=_.useCallback((v,b)=>{n({type:"update_workspace",payload:{workspaceId:v,...b}})},[n]);return{workspaces:a,workspaceCreating:o,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:u,handleEvent:f,onDisconnect:p}}const Wk=15e3;function Jk(n){const[a,i]=_.useState([]),[o,r]=_.useState(void 0),f=_.useRef(new Map),u=_.useCallback(A=>{const M=A.payload;switch(A.type){case"task.created":{const D=typeof M.requestId=="string"?M.requestId:"";if(D){const Y=f.current.get(D);Y&&(clearTimeout(Y.timer),f.current.delete(D),Y.onSuccess())}const z=typeof M.workspaceId=="string"?M.workspaceId:"";return z&&n({type:"list_tasks",payload:{workspaceId:z}}),!0}case"task.started":{const D=typeof M.taskId=="string"?M.taskId:"",z=typeof M.sessionId=="string"?M.sessionId:"",Y=typeof M.workspaceId=="string"?M.workspaceId:"";return r(R=>D&&R===D?void 0:R),z&&(n({type:"list_sessions"}),D&&i(R=>R.map(O=>O.id===D?{...O,latestSessionId:z}:O))),Y?n({type:"list_tasks",payload:{workspaceId:Y}}):D&&i(R=>{const O=R.find(G=>G.id===D);return O!=null&&O.workspaceId?n({type:"list_tasks",payload:{workspaceId:O.workspaceId}}):n({type:"list_tasks",payload:{}}),R}),!0}case"task.completed":case"task.deleted":case"task.updated":{const D=typeof M.workspaceId=="string"?M.workspaceId:"",z=typeof M.taskId=="string"?M.taskId:"";return D?n({type:"list_tasks",payload:{workspaceId:D}}):z&&i(Y=>{const R=Y.find(O=>O.id===z);return R!=null&&R.workspaceId?n({type:"list_tasks",payload:{workspaceId:R.workspaceId}}):n({type:"list_tasks",payload:{}}),Y}),!0}default:return!1}},[n]),p=_.useCallback(A=>{var M,D,z,Y;switch(A.type){case"tasks":{const R=Gn((M=A.payload)==null?void 0:M.tasks,QS,"tasks","tasks"),O=typeof((D=A.payload)==null?void 0:D.workspaceId)=="string"&&A.payload.workspaceId?A.payload.workspaceId:"";return O?(i(G=>[...G.filter(ee=>ee.workspaceId!==O),...R]),!0):(i(G=>{const ee=new Set(R.map(ne=>ne.id));return[...G.filter(ne=>!ee.has(ne.id)),...R]}),!0)}case"create_task_error":{const R=typeof((z=A.payload)==null?void 0:z.requestId)=="string"?A.payload.requestId:"",O=typeof((Y=A.payload)==null?void 0:Y.message)=="string"?A.payload.message:"Failed to create task";if(R){const G=f.current.get(R);G?(clearTimeout(G.timer),f.current.delete(R),G.onError(O)):console.error("[useTasks] create_task_error with unknown requestId:",O)}else console.error("[useTasks] create_task_error:",O);return!0}default:return!1}},[]),m=_.useCallback(()=>{r(void 0);for(const[,A]of f.current)clearTimeout(A.timer),A.onError("Disconnected");f.current.clear()},[]),g=_.useCallback(A=>{n({type:"list_tasks",payload:{workspaceId:A}})},[n]),y=_.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=_.useCallback((A,M,D,z,Y,R,O,G,ee)=>{const ne={workspaceId:A,title:M,description:D||"",dependsOn:z||[],parentTaskId:Y||"",defaultPersonaId:R||"",canDecompose:O||!1};if(G||ee){const ae=crypto.randomUUID();ne.requestId=ae;const oe=ee??(()=>{}),W=setTimeout(()=>{f.current.delete(ae)&&oe("Request timed out")},Wk);f.current.set(ae,{onSuccess:G??(()=>{}),onError:oe,timer:W})}n({type:"create_task",payload:ne})},[n]),b=_.useCallback((A,M,D,z)=>{r(A),n({type:"start_task",payload:{taskId:A,personaId:M||"",environmentId:D||"",notes:z||""}})},[n]),S=_.useCallback(A=>{n({type:"stop_task",payload:{taskId:A}})},[n]),C=_.useCallback(A=>{n({type:"complete_task",payload:{taskId:A}})},[n]),E=_.useCallback(A=>{n({type:"resume_task",payload:{taskId:A}})},[n]),N=_.useCallback((A,M,D,z,Y)=>{const R={taskId:A,title:M,description:D,dependsOn:z};Y!==void 0&&(R.defaultPersonaId=Y),n({type:"update_task",payload:R})},[n]),k=_.useCallback(A=>{n({type:"delete_task",payload:{taskId:A}})},[n]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:y,createTask:v,startTask:b,stopTask:S,completeTask:C,resumeTask:E,updateTask:N,deleteTask:k,handleMessage:p,handleEvent:u,onDisconnect:m}}function eC(n){const[a,i]=_.useState([]),o=_.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=_.useCallback(p=>{var m;switch(p.type){case"findings":return i(Gn((m=p.payload)==null?void 0:m.findings,WS,"findings","findings")),!0;default:return!1}},[]),f=_.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),u=_.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:f,postFinding:u,handleMessage:r,handleEvent:o}}function tC(n){const[a,i]=_.useState([]),o=_.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=_.useCallback(m=>{var g;switch(m.type){case"tokens":return i(Gn((g=m.payload)==null?void 0:g.tokens,JS,"tokens","tokens")),!0;default:return!1}},[]),f=_.useCallback(()=>{n({type:"list_tokens"})},[n]),u=_.useCallback((m,g,y,v,b)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:b}})},[n]),p=_.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:f,setToken:u,deleteToken:p,handleMessage:r,handleEvent:o}}function nC(n){const[a,i]=_.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),o=_.useCallback(u=>u.type==="credential.providers_changed"?(Qv(u.payload)&&i(u.payload),!0):!1,[]),r=_.useCallback(u=>{switch(u.type){case"credential_providers":return Qv(u.payload)&&i(u.payload),!0;default:return!1}},[]),f=_.useCallback(u=>{n({type:"set_credential_providers",payload:u})},[n]);return{credentialProviders:a,updateCredentialProviders:f,handleMessage:r,handleEvent:o}}function aC(n,a){const[i,o]=_.useState([]),[r,f]=_.useState(""),[u,p]=_.useState(""),[m,g]=_.useState(!1),y=_.useCallback(S=>{var C,E,N;switch(S.type){case"codespaces_list":{const k=Gn((C=S.payload)==null?void 0:C.codespaces,tT,"codespaces_list","codespaces"),A=typeof((E=S.payload)==null?void 0:E.error)=="string"?S.payload.error:"";return o(k),p(A),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const k=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return f(k),!0}default:return!1}},[n]),v=_.useCallback(()=>{n({type:"list_codespaces"})},[n]),b=_.useCallback((S,C)=>{if(!a){f("Not connected to server. Please try again once the connection is restored.");return}g(!0),f("");const E={repo:S};C&&(E.machine=C),n({type:"create_codespace",payload:E})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:u,codespaceCreating:m,listCodespaces:v,createCodespace:b,handleMessage:y}}function sC(n){const[a,i]=_.useState([]),o=_.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=_.useCallback(m=>{var g;switch(m.type){case"personas":{const y=Gn((g=m.payload)==null?void 0:g.personas,nT,"personas","personas");return i(y),!0}default:return!1}},[]),f=_.useCallback((m,g,y,v,b,S,C,E)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:b||"",maxTurns:S||0,type:C||"agent",script:E||""}})},[n]),u=_.useCallback((m,g,y,v,b,S,C,E,N)=>{const k={personaId:m};g!==void 0&&(k.name=g),y!==void 0&&(k.description=y),v!==void 0&&(k.systemPrompt=v),b!==void 0&&(k.runtime=b),S!==void 0&&(k.model=S),C!==void 0&&(k.maxTurns=C),E!==void 0&&(k.type=E),N!==void 0&&(k.script=N),n({type:"update_persona",payload:k})},[n]),p=_.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:f,updatePersona:u,deletePersona:p,handleMessage:r,handleEvent:o}}function iC(n){const[a,i]=_.useState(""),[o,r]=_.useState(void 0),{connected:f,send:u}=qk(n,{onMessage:z,onConnect:Y,onDisconnect:R}),p=Kk(u),m=Xk(u),g=Qk(u),y=Jk(u),v=eC(u),b=tC(u),S=nC(u),C=aC(u,f),E=sC(u),N="default_persona_id",k="onboarding_completed",A=_.useCallback(G=>{i(G),u({type:"set_setting",payload:{key:N,value:G}})},[u]),M=_.useCallback(()=>{r(!0),u({type:"set_setting",payload:{key:k,value:"true"}})},[u]);function D(G){const ee=G.payload.key,ne=G.payload.value;if(G.type==="setting.changed"){ee===N&&i(ne??""),ee===k&&r(ne==="true");return}p.handleEvent(G)||g.handleEvent(G)||y.handleEvent(G)||v.handleEvent(G)||b.handleEvent(G)||S.handleEvent(G)||E.handleEvent(G)}function z(G){var ee,ne,ae;if(YS(G)){D(G);return}if(G.type==="setting"){const oe=(ee=G.payload)==null?void 0:ee.key,W=(ne=G.payload)==null?void 0:ne.value;oe===N&&i(W??""),oe===k&&r(W==="true");return}if(!p.handleMessage(G)&&!m.handleMessage(G)&&!g.handleMessage(G)&&!y.handleMessage(G)&&!v.handleMessage(G)&&!b.handleMessage(G)&&!S.handleMessage(G)&&!C.handleMessage(G)&&!E.handleMessage(G)&&G.type==="error"){console.error("[ws]",(ae=G.payload)==null?void 0:ae.message);return}}function Y(G){G({type:"list_environments"}),G({type:"list_sessions"}),G({type:"list_workspaces"}),G({type:"list_tokens"}),G({type:"get_credential_providers"}),G({type:"list_personas"}),G({type:"get_setting",payload:{key:N}}),G({type:"get_setting",payload:{key:k}}),G({type:"list_tasks",payload:{}}),G({type:"subscribe_all"})}function R(){g.onDisconnect(),y.onDisconnect()}const O=_.useCallback(()=>{u({type:"list_environments"}),u({type:"list_sessions"}),u({type:"list_workspaces"}),u({type:"list_tokens"})},[u]);return{connected:f,environments:p.environments,sessions:m.sessions,events:m.events,eventsDropped:m.eventsDropped,lastSpawnedId:m.lastSpawnedId,workspaces:g.workspaces,tasks:y.tasks,findings:v.findings,tokens:b.tokens,spawn:m.spawn,sendInput:m.sendInput,kill:m.kill,refresh:O,loadSessionEvents:m.loadSessionEvents,clearEvents:m.clearEvents,createWorkspace:g.createWorkspace,archiveWorkspace:g.archiveWorkspace,updateWorkspace:g.updateWorkspace,loadTasks:y.loadTasks,loadAllTasks:y.loadAllTasks,createTask:y.createTask,startTask:y.startTask,stopTask:y.stopTask,completeTask:y.completeTask,resumeTask:y.resumeTask,updateTask:y.updateTask,deleteTask:y.deleteTask,loadFindings:v.loadFindings,postFinding:v.postFinding,addEnvironment:p.addEnvironment,updateEnvironment:p.updateEnvironment,loadTokens:b.loadTokens,setToken:b.setToken,deleteToken:b.deleteToken,credentialProviders:S.credentialProviders,updateCredentialProviders:S.updateCredentialProviders,provisionStatus:p.provisionStatus,provisionEnvironment:p.provisionEnvironment,stopEnvironment:p.stopEnvironment,removeEnvironment:p.removeEnvironment,codespaces:C.codespaces,codespaceError:C.codespaceError,codespaceListError:C.codespaceListError,codespaceCreating:C.codespaceCreating,listCodespaces:C.listCodespaces,createCodespace:C.createCodespace,workspaceCreating:g.workspaceCreating,taskStartingId:y.taskStartingId,personas:E.personas,createPersona:E.createPersona,updatePersona:E.updatePersona,deletePersona:E.deletePersona,taskSessions:m.taskSessions,loadTaskSessions:m.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:A,onboardingCompleted:o,completeOnboarding:M}}const ah=_.createContext(void 0);function lC({children:n}){const a=iC();return c.jsx(ah.Provider,{value:a,children:n})}function at(){const n=_.useContext(ah);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const oC=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1}],rC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation"},{id:"sess-001",environmentId:"env-local-01",runtime:"node",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z"},{id:"sess-002",environmentId:"env-docker-01",runtime:"python",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z"},{id:"sess-003",environmentId:"env-local-01",runtime:"node",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z"},{id:"sess-004",environmentId:"env-docker-01",runtime:"python",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z"}],cC=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
|
|
37
|
+
- src/middleware/auth.ts
|
|
38
|
+
- src/routes/login.ts
|
|
39
|
+
- src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
|
|
40
|
+
\`\`\`typescript
|
|
41
|
+
import jwt from "jsonwebtoken";
|
|
42
|
+
import type { Request, Response, NextFunction } from "express";
|
|
43
|
+
|
|
44
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
45
|
+
|
|
46
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
47
|
+
const header = req.headers.authorization;
|
|
48
|
+
if (!header?.startsWith("Bearer ")) {
|
|
49
|
+
res.status(401).json({ error: "Missing token" });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
54
|
+
req.user = decoded;
|
|
55
|
+
next();
|
|
56
|
+
} catch {
|
|
57
|
+
res.status(403).json({ error: "Invalid token" });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
\`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],uC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],dC=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:""},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:""},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:""},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:""},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:""}],ly=[{id:"find-001",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",workspaceId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",workspaceId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",workspaceId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",workspaceId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",workspaceId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],fC=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],hC=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:""},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:""},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:""},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:""}],pC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function kt(n){return new Date(Date.now()+n).toISOString()}const oy=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:kt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:kt(1600),content:`Found 5 endpoints that need refactoring:
|
|
61
|
+
- GET /api/users
|
|
62
|
+
- POST /api/users
|
|
63
|
+
- GET /api/users/:id
|
|
64
|
+
- PUT /api/users/:id
|
|
65
|
+
- DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:kt(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:kt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:kt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:kt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:kt(1400),content:`Found tables to modify:
|
|
66
|
+
- users (add column: last_login_at)
|
|
67
|
+
- sessions (add index on expires_at)
|
|
68
|
+
- audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:kt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
|
|
69
|
+
The table has 50,000+ rows — this may lock the table briefly.
|
|
70
|
+
|
|
71
|
+
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:kt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:kt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
|
|
72
|
+
Migration 002_sessions_index.sql applied successfully.
|
|
73
|
+
Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:kt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:kt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:kt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:kt(1800),content:`Writing test cases:
|
|
74
|
+
- should calculate monthly total
|
|
75
|
+
- should apply discount codes
|
|
76
|
+
- should handle currency conversion
|
|
77
|
+
- should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:kt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
|
|
78
|
+
The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:kt(3500),content:"failed"}}]}],ry=400;function mC({children:n}){const[a,i]=_.useState(oC),[o,r]=_.useState(rC),[f,u]=_.useState(cC),[p,m]=_.useState(void 0),[g,y]=_.useState(uC),[v,b]=_.useState(dC),[S,C]=_.useState(ly),[E,N]=_.useState(fC),[k,A]=_.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[M,D]=_.useState(hC),[z]=_.useState(pC),[Y,R]=_.useState(""),O=_.useRef(0),G=_.useRef(0),ee=_.useRef(new Set),ne=_.useRef(new Map),ae=_.useRef(v);ae.current=v;const oe=_.useRef(new Map),W=_.useRef(new Map),te=_.useCallback(X=>(O.current+=1,`mock-${X}-${String(O.current).padStart(3,"0")}`),[]),B=_.useCallback(()=>{const X=oy[G.current%oy.length];return G.current+=1,X},[]),q=_.useCallback((X,le,ce)=>{const xe=setTimeout(()=>{var be;ee.current.delete(xe),ce&&((be=ne.current.get(ce))==null||be.delete(xe)),X()},le);ee.current.add(xe),ce&&(ne.current.has(ce)||ne.current.set(ce,new Set),ne.current.get(ce).add(xe))},[]),U=_.useCallback(X=>{const le=ne.current.get(X);le&&(le.forEach(ce=>{clearTimeout(ce),ee.current.delete(ce)}),ne.current.delete(X))},[]),re=_.useCallback((X,le)=>{r(ce=>ce.map(xe=>xe.id===X?{...xe,status:le}:xe))},[]),I=_.useCallback(X=>{u(le=>[...le,X])},[]),ie=_.useCallback((X,le,ce)=>{le.forEach((xe,be)=>{q(()=>{const Ze={sessionId:X,...xe.event,timestamp:new Date().toISOString()};I(Ze),xe.event.eventType==="status"&&re(X,xe.event.content),be===le.length-1&&ce&&ce()},xe.delayMs,X)})},[q,I,re]),he=_.useCallback((X,le,ce,xe)=>{console.log("[MockGrackle] spawn",{environmentId:X,prompt:le,runtime:xe});const be=te("sess"),Ze={id:be,environmentId:X,runtime:xe||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(ft=>[...ft,Ze]),m(be);const ke=B();if(console.log(`[MockGrackle] Playing scenario: ${ke.label}`),ke.pauseForInput){const ft=ke.pauseAfterStep??ke.steps.length-1,Ce=ke.steps.slice(0,ft+1),lt=Ce.length>0?Ce[Ce.length-1].delayMs:0;ie(be,Ce),q(()=>{re(be,"idle"),I({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},lt+ry,be),ke.resumeSteps&&oe.current.set(be,ke.resumeSteps)}else ie(be,ke.steps)},[te,B,ie,q,re,I]),se=_.useCallback(X=>{console.log("[MockGrackle] kill",X),U(X),oe.current.delete(X),re(X,"interrupted"),I({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),b(le=>le.map(ce=>ce.latestSessionId===X&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[U,re,I]),He=_.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),gt=_.useCallback(X=>{console.log("[MockGrackle] loadSessionEvents",X)},[]),$t=_.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),Rn=_.useCallback((X,le,ce,xe,be)=>{console.log("[MockGrackle] createWorkspace",{name:X,description:le});const Ze={id:te("proj"),name:X,description:le||"",repoUrl:ce||"",environmentId:xe||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:be||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(ke=>[...ke,Ze])},[te]),Yn=_.useCallback(X=>{console.log("[MockGrackle] archiveWorkspace",X),y(le=>le.map(ce=>ce.id===X?{...ce,status:"archived"}:ce))},[]),Jt=_.useCallback(X=>{console.log("[MockGrackle] loadTasks",X)},[]),Te=_.useCallback((X,le,ce,xe,be,Ze,ke,ft,Ce)=>{console.log("[MockGrackle] createTask",{workspaceId:X,title:le,parentTaskId:be}),b(lt=>{const Vt=lt.filter(pn=>pn.workspaceId===X).reduce((pn,_a)=>Math.max(pn,_a.sortOrder),0),en=be?lt.find(pn=>pn.id===be):void 0;if(be&&!en)return console.warn("[MockGrackle] Parent task not found:",be),lt;if(en&&!en.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",be),lt;const It=en?en.depth+1:0,xa={id:te("task"),workspaceId:X,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:xe||[],reviewNotes:void 0,sortOrder:Vt+1,createdAt:new Date().toISOString(),parentTaskId:be||"",depth:It,childTaskIds:[],canDecompose:ke??!be,defaultPersonaId:Ze||""};return[...lt,xa]}),ft&&ft()},[te]),rt=_.useCallback((X,le,ce,xe)=>{var lt;console.log("[MockGrackle] startTask",{taskId:X});const be=ae.current.find(Fe=>Fe.id===X),Ze=(be==null?void 0:be.title)??"",ke=te("sess"),ft={id:ke,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Ze||X,startedAt:new Date().toISOString()};r(Fe=>[...Fe,ft]),b(Fe=>Fe.map(Vt=>Vt.id===X?{...Vt,status:"working",latestSessionId:ke,branch:`mock/${X.slice(0,8)}`}:Vt));const Ce=B();if(console.log(`[MockGrackle] Playing task scenario: ${Ce.label}`),Ce.pauseForInput){const Fe=Ce.pauseAfterStep??Ce.steps.length-1,Vt=Ce.steps.slice(0,Fe+1),en=Vt.length>0?Vt[Vt.length-1].delayMs:0;if(ie(ke,Vt),q(()=>{re(ke,"idle"),I({sessionId:ke,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},en+ry,ke),Ce.resumeSteps){const It=[...Ce.resumeSteps];oe.current.set(ke,It);const xa=It.reduce((pn,_a)=>Math.max(pn,_a.delayMs),0);W.current.set(ke,{taskId:X,delayAfterResume:xa+200})}}else{const Fe=Ce.steps.length>0?Ce.steps[Ce.steps.length-1].delayMs:0;ie(ke,Ce.steps);const Vt=(lt=Ce.steps[Ce.steps.length-1])==null?void 0:lt.event.content;q(()=>{Vt==="completed"?b(en=>en.map(It=>It.id===X&&It.status==="working"?{...It,status:"paused"}:It)):Vt==="failed"&&b(en=>en.map(It=>It.id===X&&It.status==="working"?{...It,status:"failed"}:It))},Fe+100,ke)}},[te,B,ie,q,re,I]),Ms=_.useCallback((X,le)=>{console.log("[MockGrackle] sendInput",{sessionId:X,text:le}),I({sessionId:X,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),re(X,"running"),I({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=oe.current.get(X);if(ce)oe.current.delete(X),ie(X,ce);else{const be=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ie(X,be)}const xe=W.current.get(X);xe&&(W.current.delete(X),q(()=>{b(be=>be.map(Ze=>Ze.id===xe.taskId&&Ze.status==="working"?{...Ze,status:"paused"}:Ze))},xe.delayAfterResume,X))},[I,re,ie,q]),Rs=_.useCallback(X=>{console.log("[MockGrackle] completeTask",X),b(le=>le.map(ce=>ce.id===X?{...ce,status:"complete"}:ce))},[]),On=_.useCallback(X=>{console.log("[MockGrackle] resumeTask",X)},[]),Os=_.useCallback((X,le,ce,xe,be)=>{console.log("[MockGrackle] updateTask",{taskId:X,title:le}),b(Ze=>Ze.map(ke=>ke.id===X?{...ke,title:le.trim()||ke.title,description:ce,dependsOn:xe,...be!==void 0?{defaultPersonaId:be}:{}}:ke))},[]),Bs=_.useCallback(X=>{console.log("[MockGrackle] deleteTask",X),b(le=>le.filter(ce=>ce.id!==X))},[]),So=_.useCallback(X=>{console.log("[MockGrackle] loadFindings",X),C(ly.filter(le=>le.workspaceId===X))},[]),Yi=_.useCallback((X,le,ce,xe,be)=>{console.log("[MockGrackle] postFinding",{workspaceId:X,title:le});const Ze={id:te("find"),workspaceId:X,taskId:"",sessionId:"",category:xe||"general",title:le,content:ce,tags:be||[],createdAt:new Date().toISOString()};C(ke=>[...ke,Ze])},[te]),Is=_.useCallback((X,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:X,adapterType:le,adapterConfig:ce})},[]),Ls=_.useCallback((X,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:X,...le}),i(ce=>ce.map(xe=>xe.id!==X?xe:{...xe,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),zs=_.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),To=_.useCallback((X,le,ce,xe,be)=>{console.log("[MockGrackle] setToken",{name:X,tokenType:ce}),N(Ze=>[...Ze.filter(ft=>ft.name!==X),{name:X,tokenType:ce,envVar:xe,filePath:be,expiresAt:""}])},[]),ko=_.useCallback(X=>{console.log("[MockGrackle] deleteToken",X),N(le=>le.filter(ce=>ce.name!==X))},[]),Bt=_.useCallback(X=>{console.log("[MockGrackle] updateCredentialProviders",X),A(X)},[]);_.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const Nc=_.useMemo(()=>({connected:!0,environments:a,sessions:o,events:f,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:v,findings:S,tokens:E,credentialProviders:k,spawn:he,sendInput:Ms,kill:se,refresh:He,loadSessionEvents:gt,clearEvents:$t,createWorkspace:Rn,archiveWorkspace:Yn,updateWorkspace:(X,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:X,...le}),y(ce=>ce.map(xe=>xe.id!==X?xe:{...xe,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Jt,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Te,startTask:rt,stopTask:X=>{console.log("[MockGrackle] stopTask",{taskId:X}),Rs(X)},completeTask:Rs,resumeTask:On,updateTask:Os,deleteTask:Bs,loadFindings:So,postFinding:Yi,addEnvironment:Is,updateEnvironment:Ls,loadTokens:zs,setToken:To,deleteToken:ko,updateCredentialProviders:Bt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:M,createPersona:(X,le,ce,xe,be,Ze,ke,ft)=>{console.log("[MockGrackle] createPersona",{name:X});const Ce={id:`mock-persona-${Date.now()}`,name:X,description:le,systemPrompt:ce,toolConfig:"{}",runtime:xe??"claude-code",model:be||"",maxTurns:Ze||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:ke||"agent",script:ft||""};D(lt=>[...lt,Ce])},updatePersona:(X,le,ce,xe,be,Ze,ke,ft,Ce)=>{console.log("[MockGrackle] updatePersona",{personaId:X,name:le}),D(lt=>lt.map(Fe=>Fe.id!==X?Fe:{...Fe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},...xe!==void 0?{systemPrompt:xe}:{},...be!==void 0?{runtime:be}:{},...Ze!==void 0?{model:Ze}:{},...ke!==void 0?{maxTurns:ke}:{},...ft!==void 0?{type:ft}:{},...Ce!==void 0?{script:Ce}:{},updatedAt:new Date().toISOString()}))},deletePersona:X=>{console.log("[MockGrackle] deletePersona",X),D(le=>le.filter(ce=>ce.id!==X))},taskSessions:z,loadTaskSessions:X=>{console.log("[MockGrackle] loadTaskSessions",X)},appDefaultPersonaId:Y,setAppDefaultPersonaId:X=>{console.log("[MockGrackle] setAppDefaultPersonaId",X),R(X)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")}}),[a,o,f,p,g,v,S,E,k,M,z,Y,he,Ms,se,He,gt,$t,Rn,Yn,Jt,Te,rt,Rs,On,Os,Bs,So,Yi,Is,Ls,zs,To,ko,Bt]);return c.jsx(ah.Provider,{value:Nc,children:n})}const hb=_.createContext(void 0),gC=4e3;function vC({children:n}){const[a,i]=_.useState([]),o=_.useRef(0),r=_.useCallback(u=>{i(p=>p.filter(m=>m.id!==u))},[]),f=_.useCallback((u,p="info",m=gC)=>{const g=`toast-${++o.current}`;i(y=>[...y,{id:g,message:u,variant:p,duration:m}])},[]);return c.jsx(hb.Provider,{value:{toasts:a,showToast:f,dismissToast:r},children:n})}function Gi(){const n=_.useContext(hb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const bc=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],pb=new Set(bc.map(n=>n.id)),cy="grackle";function bf(n){return bc.find(a=>a.id===n)}const xf="grackle-theme",mb="grackle-prefer-system",gb="(prefers-color-scheme: dark)";let ql=[],Qr;function Kd(){Qr=void 0;for(const n of ql)n()}function _f(){return typeof window>"u"?!1:window.matchMedia(gb).matches}function Wl(){if(typeof localStorage>"u")return cy;try{const n=localStorage.getItem(xf);if(n!==null&&pb.has(n))return n}catch{}return cy}function ac(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(mb)==="true"}catch{return!1}}function Sf(n){return bc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function vb(n,a){const i=bf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?_f()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Sf(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return _f()?o.variantDarkId:o.variantLightId}return n}function Ei(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=vb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ei(Wl(),ac());function yC(){return Qr===void 0&&(Qr={themeId:Wl(),systemDark:_f(),preferSystem:ac()}),Qr}function bC(n){return ql=[...ql,n],()=>{ql=ql.filter(a=>a!==n)}}function xC(){const n=_.useSyncExternalStore(bC,yC),{themeId:a,preferSystem:i}=n,o=vb(a,i),r=_.useCallback(u=>{if(pb.has(u)){try{localStorage.setItem(xf,u)}catch{}Ei(u,ac(),!0),Kd()}},[]),f=_.useCallback(u=>{try{localStorage.setItem(mb,u?"true":"false")}catch{}if(u){const p=Wl(),m=bf(p);if(m!=null&&m.hidden){const g=Sf(p);if(g)try{localStorage.setItem(xf,g.id)}catch{}}}Ei(Wl(),u,!0),Kd()},[]);return _.useEffect(()=>{Ei(a,i)},[a,i]),_.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(gb),p=()=>{const m=Wl(),g=ac();if(g){const y=bf(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ei(m,g),y!=null&&y.hidden){const v=Sf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ei(m,g)}}Kd()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:f}}const yb=_.createContext(void 0);function _C({children:n}){const a=xC();return c.jsx(yb.Provider,{value:a,children:n})}function bb(){const n=_.useContext(yb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const SC="_container_1mq5u_1",TC="_hamburger_1mq5u_33",kC="_brand_1mq5u_49",CC="_brandLogo_1mq5u_68",EC="_info_1mq5u_75",NC="_connectionLabel_1mq5u_90",AC="_connectionDot_1mq5u_103",jC="_connected_1mq5u_106",wC="_disconnected_1mq5u_110",fa={container:SC,hamburger:TC,brand:kC,brandLogo:CC,info:EC,connectionLabel:NC,connectionDot:AC,connected:jC,disconnected:wC};function DC({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=at(),f=Ut(),u=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:fa.container,children:[n&&c.jsx("button",{type:"button",className:fa.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:fa.brand,onClick:()=>f(vo),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:fa.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:fa.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${fa.connectionDot} ${i?fa.connected:fa.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:fa.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const MC="_nav_13gkc_1",RC="_tab_13gkc_35",OC="_tabIcon_13gkc_68",BC="_tabLabel_13gkc_79",IC="_tabActive_13gkc_84",Hl={nav:MC,tab:RC,tabIcon:OC,tabLabel:BC,tabActive:IC},_s=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:vo,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:$k,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:Fk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:oo,testId:"sidebar-tab-environments"},{view:"settings",label:"Settings",icon:"⚙️",route:Gk,testId:"sidebar-tab-settings"}];function xb(n){return n===vo||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(Ql)?"settings":"tasks"}function LC(){const n=At(),a=Ut(),i=_.useRef(null),o=xb(n.pathname),r=_.useCallback(u=>{a(u.route)},[a]),f=_.useCallback(u=>{var v,b;const p=(v=i.current)==null?void 0:v.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:_s.findIndex(S=>S.view===o);let y=g;if(u.key==="ArrowRight")u.preventDefault(),y=(g+1)%_s.length;else if(u.key==="ArrowLeft")u.preventDefault(),y=(g-1+_s.length)%_s.length;else if(u.key==="Home")u.preventDefault(),y=0;else if(u.key==="End")u.preventDefault(),y=_s.length-1;else return;a(_s[y].route),(b=p[y])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Hl.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:f,"data-testid":"sidebar-nav",children:_s.map(u=>{const p=u.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Hl.tab} ${p?Hl.tabActive:""}`,onClick:()=>r(u),"data-testid":u.testId,title:u.label,"aria-label":u.label,children:[c.jsx("span",{className:Hl.tabIcon,"aria-hidden":"true",children:u.icon}),c.jsx("span",{className:Hl.tabLabel,children:u.label})]},u.view)})})}const sh=_.createContext({});function ih(n){const a=_.useRef(null);return a.current===null&&(a.current=n()),a.current}const xc=_.createContext(null),lh=_.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class zC extends _.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function UC({children:n,isPresent:a}){const i=_.useId(),o=_.useRef(null),r=_.useRef({width:0,height:0,top:0,left:0}),{nonce:f}=_.useContext(lh);return _.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=r.current;if(a||!o.current||!u||!p)return;o.current.dataset.motionPopId=i;const y=document.createElement("style");return f&&(y.nonce=f),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
79
|
+
[data-motion-pop-id="${i}"] {
|
|
80
|
+
position: absolute !important;
|
|
81
|
+
width: ${u}px !important;
|
|
82
|
+
height: ${p}px !important;
|
|
83
|
+
top: ${m}px !important;
|
|
84
|
+
left: ${g}px !important;
|
|
85
|
+
}
|
|
86
|
+
`),()=>{document.head.removeChild(y)}},[a]),c.jsx(zC,{isPresent:a,childRef:o,sizeRef:r,children:_.cloneElement(n,{ref:o})})}const VC=({children:n,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:f,mode:u})=>{const p=ih(HC),m=_.useId(),g=_.useCallback(v=>{p.set(v,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),y=_.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),f?[Math.random(),g]:[i,g]);return _.useMemo(()=>{p.forEach((v,b)=>p.set(b,!1))},[i]),_.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),u==="popLayout"&&(n=c.jsx(UC,{isPresent:i,children:n})),c.jsx(xc.Provider,{value:y,children:n})};function HC(){return new Map}function _b(n=!0){const a=_.useContext(xc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,f=_.useId();_.useEffect(()=>{n&&r(f)},[n]);const u=_.useCallback(()=>n&&o&&o(f),[f,o,n]);return!i&&o?[!1,u]:[!0]}const Vr=n=>n.key||"";function uy(n){const a=[];return _.Children.forEach(n,i=>{_.isValidElement(i)&&a.push(i)}),a}const oh=typeof window<"u",Sb=oh?_.useLayoutEffect:_.useEffect,qn=({children:n,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:f="sync",propagate:u=!1})=>{const[p,m]=_b(u),g=_.useMemo(()=>uy(n),[n]),y=u&&!p?[]:g.map(Vr),v=_.useRef(!0),b=_.useRef(g),S=ih(()=>new Map),[C,E]=_.useState(g),[N,k]=_.useState(g);Sb(()=>{v.current=!1,b.current=g;for(let D=0;D<N.length;D++){const z=Vr(N[D]);y.includes(z)?S.delete(z):S.get(z)!==!0&&S.set(z,!1)}},[N,y.length,y.join("-")]);const A=[];if(g!==C){let D=[...g];for(let z=0;z<N.length;z++){const Y=N[z],R=Vr(Y);y.includes(R)||(D.splice(z,0,Y),A.push(Y))}f==="wait"&&A.length&&(D=A),k(uy(D)),E(g);return}const{forceRender:M}=_.useContext(sh);return c.jsx(c.Fragment,{children:N.map(D=>{const z=Vr(D),Y=u&&!p?!1:g===N||y.includes(z),R=()=>{if(S.has(z))S.set(z,!0);else return;let O=!0;S.forEach(G=>{G||(O=!1)}),O&&(M==null||M(),k(b.current),u&&(m==null||m()),o&&o())};return c.jsx(VC,{isPresent:Y,initial:!v.current||i?void 0:!1,custom:Y?void 0:a,presenceAffectsLayout:r,mode:f,onExitComplete:Y?void 0:R,children:D},z)})})},dn=n=>n;let Tb=dn;const GC={useManualTiming:!1};function PC(n){let a=new Set,i=new Set,o=!1,r=!1;const f=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){f.has(g)&&(m.schedule(g),n()),g(u)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&o?a:i;return y&&f.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),f.delete(g)},process:g=>{if(u=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Hr=["read","resolveKeyframes","update","preRender","render","postRender"],$C=40;function kb(n,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},f=()=>i=!0,u=Hr.reduce((k,A)=>(k[A]=PC(f),k),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:b}=u,S=()=>{const k=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(k-r.timestamp,$C),1),r.timestamp=k,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,n(S))},C=()=>{i=!0,o=!0,r.isProcessing||n(S)};return{schedule:Hr.reduce((k,A)=>{const M=u[A];return k[A]=(D,z=!1,Y=!1)=>(i||C(),M.schedule(D,z,Y)),k},{}),cancel:k=>{for(let A=0;A<Hr.length;A++)u[Hr[A]].cancel(k)},state:r,steps:u}}const{schedule:nt,cancel:Wa,state:Ot,steps:Zd}=kb(typeof requestAnimationFrame<"u"?requestAnimationFrame:dn,!0),Cb=_.createContext({strict:!1}),dy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Oi={};for(const n in dy)Oi[n]={isEnabled:a=>dy[n].some(i=>!!a[i])};function FC(n){for(const a in n)Oi[a]={...Oi[a],...n[a]}}const qC=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||qC.has(n)}let Eb=n=>!sc(n);function YC(n){n&&(Eb=a=>a.startsWith("on")?!sc(a):n(a))}try{YC(require("@emotion/is-prop-valid").default)}catch{}function KC(n,a,i){const o={};for(const r in n)r==="values"&&typeof n.values=="object"||(Eb(r)||i===!0&&sc(r)||!a&&!sc(r)||n.draggable&&r.startsWith("onDrag"))&&(o[r]=n[r]);return o}function ZC(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...o)=>n(...o);return new Proxy(i,{get:(o,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const _c=_.createContext({});function ro(n){return typeof n=="string"||Array.isArray(n)}function Sc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const rh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ch=["initial",...rh];function Tc(n){return Sc(n.animate)||ch.some(a=>ro(n[a]))}function Nb(n){return!!(Tc(n)||n.variants)}function XC(n,a){if(Tc(n)){const{initial:i,animate:o}=n;return{initial:i===!1||ro(i)?i:void 0,animate:ro(o)?o:void 0}}return n.inherit!==!1?a:{}}function QC(n){const{initial:a,animate:i}=XC(n,_.useContext(_c));return _.useMemo(()=>({initial:a,animate:i}),[fy(a),fy(i)])}function fy(n){return Array.isArray(n)?n.join(" "):n}const WC=Symbol.for("motionComponentSymbol");function Ni(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function JC(n,a,i){return _.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Ni(i)&&(i.current=o))},[a])}const uh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),eE="framerAppearId",Ab="data-"+uh(eE),{schedule:dh}=kb(queueMicrotask,!1),jb=_.createContext({});function tE(n,a,i,o,r){var f,u;const{visualElement:p}=_.useContext(_c),m=_.useContext(Cb),g=_.useContext(xc),y=_.useContext(lh).reducedMotion,v=_.useRef(null);o=o||m.renderer,!v.current&&o&&(v.current=o(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const b=v.current,S=_.useContext(jb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&nE(v.current,i,r,S);const C=_.useRef(!1);_.useInsertionEffect(()=>{b&&C.current&&b.update(i,g)});const E=i[Ab],N=_.useRef(!!E&&!(!((f=window.MotionHandoffIsComplete)===null||f===void 0)&&f.call(window,E))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,E)));return Sb(()=>{b&&(C.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),dh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),_.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,E)}),N.current=!1))}),b}function nE(n,a,i,o){const{layoutId:r,layout:f,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:wb(n.parent)),n.projection.setOptions({layoutId:r,layout:f,alwaysMeasureLayout:!!u||p&&Ni(p),visualElement:n,animationType:typeof f=="string"?f:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function wb(n){if(n)return n.options.allowProjection!==!1?n.projection:wb(n.parent)}function aE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var f,u;n&&FC(n);function p(g,y){let v;const b={..._.useContext(lh),...g,layoutId:sE(g)},{isStatic:S}=b,C=QC(g),E=o(g,S);if(!S&&oh){iE();const N=lE(b);v=N.MeasureLayout,C.visualElement=tE(r,E,b,a,N.ProjectionNode)}return c.jsxs(_c.Provider,{value:C,children:[v&&C.visualElement?c.jsx(v,{visualElement:C.visualElement,...b}):null,i(r,g,JC(E,C.visualElement,y),E,S,C.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(u=(f=r.displayName)!==null&&f!==void 0?f:r.name)!==null&&u!==void 0?u:""})`}`;const m=_.forwardRef(p);return m[WC]=r,m}function sE({layoutId:n}){const a=_.useContext(sh).id;return a&&n!==void 0?a+"-"+n:n}function iE(n,a){_.useContext(Cb).strict}function lE(n){const{drag:a,layout:i}=Oi;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const oE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fh(n){return typeof n!="string"||n.includes("-")?!1:!!(oE.indexOf(n)>-1||/[A-Z]/u.test(n))}function hy(n){const a=[{},{}];return n==null||n.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function hh(n,a,i,o){if(typeof a=="function"){const[r,f]=hy(o);a=a(i!==void 0?i:n.custom,r,f)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,f]=hy(o);a=a(i!==void 0?i:n.custom,r,f)}return a}const Tf=n=>Array.isArray(n),rE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),cE=n=>Tf(n)?n[n.length-1]||0:n,zt=n=>!!(n&&n.getVelocity);function Wr(n){const a=zt(n)?n.get():n;return rE(a)?a.toValue():a}function uE({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},o,r,f){const u={latestValues:dE(o,r,f,n),renderState:a()};return i&&(u.onMount=p=>i({props:o,current:p,...u}),u.onUpdate=p=>i(p)),u}const Db=n=>(a,i)=>{const o=_.useContext(_c),r=_.useContext(xc),f=()=>uE(n,a,o,r);return i?f():ih(f)};function dE(n,a,i,o){const r={},f=o(n,{});for(const b in f)r[b]=Wr(f[b]);let{initial:u,animate:p}=n;const m=Tc(n),g=Nb(n);a&&g&&!m&&n.inherit!==!1&&(u===void 0&&(u=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||u===!1;const v=y?p:u;if(v&&typeof v!="boolean"&&!Sc(v)){const b=Array.isArray(v)?v:[v];for(let S=0;S<b.length;S++){const C=hh(n,b[S]);if(C){const{transitionEnd:E,transition:N,...k}=C;for(const A in k){let M=k[A];if(Array.isArray(M)){const D=y?M.length-1:0;M=M[D]}M!==null&&(r[A]=M)}for(const A in E)r[A]=E[A]}}}return r}const Pi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ds=new Set(Pi),Mb=n=>a=>typeof a=="string"&&a.startsWith(n),Rb=Mb("--"),fE=Mb("var(--"),ph=n=>fE(n)?hE.test(n.split("/*")[0].trim()):!1,hE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ob=(n,a)=>a&&typeof n=="number"?a.transform(n):n,ya=(n,a,i)=>i>a?a:i<n?n:i,$i={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},co={...$i,transform:n=>ya(0,1,n)},Gr={...$i,default:1},yo=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Ya=yo("deg"),$n=yo("%"),ve=yo("px"),pE=yo("vh"),mE=yo("vw"),py={...$n,parse:n=>$n.parse(n)/100,transform:n=>$n.transform(n*100)},gE={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},vE={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:Gr,scaleX:Gr,scaleY:Gr,scaleZ:Gr,skew:Ya,skewX:Ya,skewY:Ya,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:co,originX:py,originY:py,originZ:ve},my={...$i,transform:Math.round},mh={...gE,...vE,zIndex:my,size:ve,fillOpacity:co,strokeOpacity:co,numOctaves:my},yE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bE=Pi.length;function xE(n,a,i){let o="",r=!0;for(let f=0;f<bE;f++){const u=Pi[f],p=n[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Ob(p,mh[u]);if(!m){r=!1;const y=yE[u]||u;o+=`${y}(${g}) `}i&&(a[u]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function gh(n,a,i){const{style:o,vars:r,transformOrigin:f}=n;let u=!1,p=!1;for(const m in a){const g=a[m];if(Ds.has(m)){u=!0;continue}else if(Rb(m)){r[m]=g;continue}else{const y=Ob(g,mh[m]);m.startsWith("origin")?(p=!0,f[m]=y):o[m]=y}}if(a.transform||(u||i?o.transform=xE(a,n.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=f;o.transformOrigin=`${m} ${g} ${y}`}}const _E={offset:"stroke-dashoffset",array:"stroke-dasharray"},SE={offset:"strokeDashoffset",array:"strokeDasharray"};function TE(n,a,i=1,o=0,r=!0){n.pathLength=1;const f=r?_E:SE;n[f.offset]=ve.transform(-o);const u=ve.transform(a),p=ve.transform(i);n[f.array]=`${u} ${p}`}function gy(n,a,i){return typeof n=="string"?n:ve.transform(a+i*n)}function kE(n,a,i){const o=gy(a,n.x,n.width),r=gy(i,n.y,n.height);return`${o} ${r}`}function vh(n,{attrX:a,attrY:i,attrScale:o,originX:r,originY:f,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(gh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:b,style:S,dimensions:C}=n;b.transform&&(C&&(S.transform=b.transform),delete b.transform),C&&(r!==void 0||f!==void 0||S.transform)&&(S.transformOrigin=kE(C,r!==void 0?r:.5,f!==void 0?f:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),u!==void 0&&TE(b,u,p,m,!1)}const yh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Bb=()=>({...yh(),attrs:{}}),bh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ib(n,{style:a,vars:i},o,r){Object.assign(n.style,a,r&&r.getProjectionStyles(o));for(const f in i)n.style.setProperty(f,i[f])}const Lb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function zb(n,a,i,o){Ib(n,a,void 0,o);for(const r in a.attrs)n.setAttribute(Lb.has(r)?r:uh(r),a.attrs[r])}const ic={};function CE(n){Object.assign(ic,n)}function Ub(n,{layout:a,layoutId:i}){return Ds.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!ic[n]||n==="opacity")}function xh(n,a,i){var o;const{style:r}=n,f={};for(const u in r)(zt(r[u])||a.style&&zt(a.style[u])||Ub(u,n)||((o=i==null?void 0:i.getValue(u))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(f[u]=r[u]);return f}function Vb(n,a,i){const o=xh(n,a,i);for(const r in n)if(zt(n[r])||zt(a[r])){const f=Pi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[f]=n[r]}return o}function EE(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const vy=["x","y","width","height","cx","cy","r"],NE={useVisualState:Db({scrapeMotionValuesFromProps:Vb,createRenderState:Bb,onUpdate:({props:n,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let f=!!n.drag;if(!f){for(const p in r)if(Ds.has(p)){f=!0;break}}if(!f)return;let u=!a;if(a)for(let p=0;p<vy.length;p++){const m=vy[p];n[m]!==a[m]&&(u=!0)}u&&nt.read(()=>{EE(i,o),nt.render(()=>{vh(o,r,bh(i.tagName),n.transformTemplate),zb(i,o)})})}})},AE={useVisualState:Db({scrapeMotionValuesFromProps:xh,createRenderState:yh})};function Hb(n,a,i){for(const o in a)!zt(a[o])&&!Ub(o,i)&&(n[o]=a[o])}function jE({transformTemplate:n},a){return _.useMemo(()=>{const i=yh();return gh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function wE(n,a){const i=n.style||{},o={};return Hb(o,i,n),Object.assign(o,jE(n,a)),o}function DE(n,a){const i={},o=wE(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=o,i}function ME(n,a,i,o){const r=_.useMemo(()=>{const f=Bb();return vh(f,a,bh(o),n.transformTemplate),{...f.attrs,style:{...f.style}}},[a]);if(n.style){const f={};Hb(f,n.style,n),r.style={...f,...r.style}}return r}function RE(n=!1){return(i,o,r,{latestValues:f},u)=>{const m=(fh(i)?ME:DE)(o,f,u,i),g=KC(o,typeof i=="string",n),y=i!==_.Fragment?{...g,...m,ref:r}:{},{children:v}=o,b=_.useMemo(()=>zt(v)?v.get():v,[v]);return _.createElement(i,{...y,children:b})}}function OE(n,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const u={...fh(o)?NE:AE,preloadedFeatures:n,useRender:RE(r),createVisualElement:a,Component:o};return aE(u)}}function Gb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let o=0;o<i;o++)if(a[o]!==n[o])return!1;return!0}function kc(n,a,i){const o=n.getProps();return hh(o,a,i!==void 0?i:o.custom,n)}function _h(n,a){return n?n[a]||n.default||n:void 0}const Pb=new Set(["width","height","top","left","right","bottom",...Pi]);let Jr;function BE(){Jr=void 0}const Fn={now:()=>(Jr===void 0&&Fn.set(Ot.isProcessing||GC.useManualTiming?Ot.timestamp:performance.now()),Jr),set:n=>{Jr=n,queueMicrotask(BE)}};function Sh(n,a){n.indexOf(a)===-1&&n.push(a)}function Th(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class kh{constructor(){this.subscriptions=[]}add(a){return Sh(this.subscriptions,a),()=>Th(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let f=0;f<r;f++){const u=this.subscriptions[f];u&&u(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function $b(n,a){return a?n*(1e3/a):0}const yy=30,IE=n=>!isNaN(parseFloat(n));class LE{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const f=Fn.now();this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Fn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=IE(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new kh);const o=this.events[a].add(i);return a==="change"?()=>{o(),nt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>yy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,yy);return $b(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function uo(n,a){return new LE(n,a)}function zE(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,uo(i))}function UE(n,a){const i=kc(n,a);let{transitionEnd:o={},transition:r={},...f}=i||{};f={...f,...o};for(const u in f){const p=cE(f[u]);zE(n,u,p)}}function VE(n){return!!(zt(n)&&n.add)}function kf(n,a){const i=n.getValue("willChange");if(VE(i))return i.add(a)}function Fb(n){return n.props[Ab]}function Ch(n){let a;return()=>(a===void 0&&(a=n()),a)}const HE=Ch(()=>window.ScrollTimeline!==void 0);class GE{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(HE()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,f)=>{r&&r(),this.animations[f].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class PE extends GE{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const pa=n=>n*1e3,ma=n=>n/1e3;function Eh(n){return typeof n=="function"}function by(n,a){n.timeline=a,n.onfinish=null}const Nh=n=>Array.isArray(n)&&typeof n[0]=="number",$E={linearEasing:void 0};function FE(n,a){const i=Ch(n);return()=>{var o;return(o=$E[a])!==null&&o!==void 0?o:i()}}const lc=FE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bi=(n,a,i)=>{const o=a-n;return o===0?1:(i-n)/o},qb=(n,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let f=0;f<r;f++)o+=n(Bi(0,r-1,f))+", ";return`linear(${o.substring(0,o.length-2)})`};function Yb(n){return!!(typeof n=="function"&&lc()||!n||typeof n=="string"&&(n in Cf||lc())||Nh(n)||Array.isArray(n)&&n.every(Yb))}const Yl=([n,a,i,o])=>`cubic-bezier(${n}, ${a}, ${i}, ${o})`,Cf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yl([0,.65,.55,1]),circOut:Yl([.55,0,1,.45]),backIn:Yl([.31,.01,.66,-.59]),backOut:Yl([.33,1.53,.69,.99])};function Kb(n,a){if(n)return typeof n=="function"&&lc()?qb(n,a):Nh(n)?Yl(n):Array.isArray(n)?n.map(i=>Kb(i,a)||Cf.easeOut):Cf[n]}const Zb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,qE=1e-7,YE=12;function KE(n,a,i,o,r){let f,u,p=0;do u=a+(i-a)/2,f=Zb(u,o,r)-n,f>0?i=u:a=u;while(Math.abs(f)>qE&&++p<YE);return u}function bo(n,a,i,o){if(n===a&&i===o)return dn;const r=f=>KE(f,0,1,n,i);return f=>f===0||f===1?f:Zb(r(f),a,o)}const Xb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Qb=n=>a=>1-n(1-a),Wb=bo(.33,1.53,.69,.99),Ah=Qb(Wb),Jb=Xb(Ah),ex=n=>(n*=2)<1?.5*Ah(n):.5*(2-Math.pow(2,-10*(n-1))),jh=n=>1-Math.sin(Math.acos(n)),tx=Qb(jh),nx=Xb(jh),ax=n=>/^0[^.\s]+$/u.test(n);function ZE(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||ax(n):!0}const Jl=n=>Math.round(n*1e5)/1e5,wh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function XE(n){return n==null}const QE=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dh=(n,a)=>i=>!!(typeof i=="string"&&QE.test(i)&&i.startsWith(n)||a&&!XE(i)&&Object.prototype.hasOwnProperty.call(i,a)),sx=(n,a,i)=>o=>{if(typeof o!="string")return o;const[r,f,u,p]=o.match(wh);return{[n]:parseFloat(r),[a]:parseFloat(f),[i]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},WE=n=>ya(0,255,n),Xd={...$i,transform:n=>Math.round(WE(n))},As={test:Dh("rgb","red"),parse:sx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:o=1})=>"rgba("+Xd.transform(n)+", "+Xd.transform(a)+", "+Xd.transform(i)+", "+Jl(co.transform(o))+")"};function JE(n){let a="",i="",o="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),o=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),o=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Ef={test:Dh("#"),parse:JE,transform:As.transform},Ai={test:Dh("hsl","hue"),parse:sx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(n)+", "+$n.transform(Jl(a))+", "+$n.transform(Jl(i))+", "+Jl(co.transform(o))+")"},Lt={test:n=>As.test(n)||Ef.test(n)||Ai.test(n),parse:n=>As.test(n)?As.parse(n):Ai.test(n)?Ai.parse(n):Ef.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?As.transform(n):Ai.transform(n)},eN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(wh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(eN))===null||i===void 0?void 0:i.length)||0)>0}const ix="number",lx="color",nN="var",aN="var(",xy="${}",sN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function fo(n){const a=n.toString(),i=[],o={color:[],number:[],var:[]},r=[];let f=0;const p=a.replace(sN,m=>(Lt.test(m)?(o.color.push(f),r.push(lx),i.push(Lt.parse(m))):m.startsWith(aN)?(o.var.push(f),r.push(nN),i.push(m)):(o.number.push(f),r.push(ix),i.push(parseFloat(m))),++f,xy)).split(xy);return{values:i,split:p,indexes:o,types:r}}function ox(n){return fo(n).values}function rx(n){const{split:a,types:i}=fo(n),o=a.length;return r=>{let f="";for(let u=0;u<o;u++)if(f+=a[u],r[u]!==void 0){const p=i[u];p===ix?f+=Jl(r[u]):p===lx?f+=Lt.transform(r[u]):f+=r[u]}return f}}const iN=n=>typeof n=="number"?0:n;function lN(n){const a=ox(n);return rx(n)(a.map(iN))}const Ja={test:tN,parse:ox,createTransformer:rx,getAnimatableNone:lN},oN=new Set(["brightness","contrast","saturate","opacity"]);function rN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=i.match(wh)||[];if(!o)return n;const r=i.replace(o,"");let f=oN.has(a)?1:0;return o!==i&&(f*=100),a+"("+f+r+")"}const cN=/\b([a-z-]*)\(.*?\)/gu,Nf={...Ja,getAnimatableNone:n=>{const a=n.match(cN);return a?a.map(rN).join(" "):n}},uN={...mh,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Nf,WebkitFilter:Nf},Mh=n=>uN[n];function cx(n,a){let i=Mh(n);return i!==Nf&&(i=Ja),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const dN=new Set(["auto","none","0"]);function fN(n,a,i){let o=0,r;for(;o<n.length&&!r;){const f=n[o];typeof f=="string"&&!dN.has(f)&&fo(f).values.length&&(r=n[o]),o++}if(r&&i)for(const f of a)n[f]=cx(i,r)}const _y=n=>n===$i||n===ve,Sy=(n,a)=>parseFloat(n.split(", ")[a]),Ty=(n,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Sy(r[1],a);{const f=o.match(/^matrix\((.+)\)$/u);return f?Sy(f[1],n):0}},hN=new Set(["x","y","z"]),pN=Pi.filter(n=>!hN.has(n));function mN(n){const a=[];return pN.forEach(i=>{const o=n.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Ii={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:Ty(4,13),y:Ty(5,14)};Ii.translateX=Ii.x;Ii.translateY=Ii.y;const js=new Set;let Af=!1,jf=!1;function ux(){if(jf){const n=Array.from(js).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=mN(o);r.length&&(i.set(o,r),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([f,u])=>{var p;(p=o.getValue(f))===null||p===void 0||p.set(u)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}jf=!1,Af=!1,js.forEach(n=>n.complete()),js.clear()}function dx(){js.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(jf=!0)})}function gN(){dx(),ux()}class Rh{constructor(a,i,o,r,f,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=f,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(js.add(this),Af||(Af=!0,nt.read(dx),nt.resolveKeyframes(ux))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let f=0;f<a.length;f++)if(a[f]===null)if(f===0){const u=r==null?void 0:r.get(),p=a[a.length-1];if(u!==void 0)a[0]=u;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&u===void 0&&r.set(a[0])}else a[f]=a[f-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),js.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,js.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const fx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),vN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yN(n){const a=vN.exec(n);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function hx(n,a,i=1){const[o,r]=yN(n);if(!o)return;const f=window.getComputedStyle(a).getPropertyValue(o);if(f){const u=f.trim();return fx(u)?parseFloat(u):u}return ph(r)?hx(r,a,i+1):r}const px=n=>a=>a.test(n),bN={test:n=>n==="auto",parse:n=>n},mx=[$i,ve,$n,Ya,mE,pE,bN],ky=n=>mx.find(px(n));class gx extends Rh{constructor(a,i,o,r,f){super(a,i,o,r,f,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),ph(g))){const y=hx(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Pb.has(o)||a.length!==2)return;const[r,f]=a,u=ky(r),p=ky(f);if(u!==p)if(_y(u)&&_y(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)ZE(a[r])&&o.push(r);o.length&&fN(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ii[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const f=i.getValue(o);f&&f.jump(this.measuredOrigin,!1);const u=r.length-1,p=r[u];r[u]=Ii[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Cy=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Ja.test(n)||n==="0")&&!n.startsWith("url("));function xN(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function _N(n,a,i,o){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const f=n[n.length-1],u=Cy(r,a),p=Cy(f,a);return!u||!p?!1:xN(n)||(i==="spring"||Eh(i))&&o}const SN=n=>n!==null;function Cc(n,{repeat:a,repeatType:i="loop"},o){const r=n.filter(SN),f=a&&i!=="loop"&&a%2===1?0:r.length-1;return!f||o===void 0?r[f]:o}const TN=40;class vx{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:f=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Fn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:f,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>TN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&gN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Fn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:f,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!_N(a,o,r,f))if(u)this.options.duration=0;else{m&&m(Cc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const wf=2e4;function yx(n){let a=0;const i=50;let o=n.next(a);for(;!o.done&&a<wf;)a+=i,o=n.next(a);return a>=wf?1/0:a}const ot=(n,a,i)=>n+(a-n)*i;function Qd(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function kN({hue:n,saturation:a,lightness:i,alpha:o}){n/=360,a/=100,i/=100;let r=0,f=0,u=0;if(!a)r=f=u=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Qd(m,p,n+1/3),f=Qd(m,p,n),u=Qd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(f*255),blue:Math.round(u*255),alpha:o}}function oc(n,a){return i=>i>0?a:n}const Wd=(n,a,i)=>{const o=n*n,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},CN=[Ef,As,Ai],EN=n=>CN.find(a=>a.test(n));function Ey(n){const a=EN(n);if(!a)return!1;let i=a.parse(n);return a===Ai&&(i=kN(i)),i}const Ny=(n,a)=>{const i=Ey(n),o=Ey(a);if(!i||!o)return oc(n,a);const r={...i};return f=>(r.red=Wd(i.red,o.red,f),r.green=Wd(i.green,o.green,f),r.blue=Wd(i.blue,o.blue,f),r.alpha=ot(i.alpha,o.alpha,f),As.transform(r))},NN=(n,a)=>i=>a(n(i)),xo=(...n)=>n.reduce(NN),Df=new Set(["none","hidden"]);function AN(n,a){return Df.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function jN(n,a){return i=>ot(n,a,i)}function Oh(n){return typeof n=="number"?jN:typeof n=="string"?ph(n)?oc:Lt.test(n)?Ny:MN:Array.isArray(n)?bx:typeof n=="object"?Lt.test(n)?Ny:wN:oc}function bx(n,a){const i=[...n],o=i.length,r=n.map((f,u)=>Oh(f)(f,a[u]));return f=>{for(let u=0;u<o;u++)i[u]=r[u](f);return i}}function wN(n,a){const i={...n,...a},o={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(o[r]=Oh(n[r])(n[r],a[r]));return r=>{for(const f in o)i[f]=o[f](r);return i}}function DN(n,a){var i;const o=[],r={color:0,var:0,number:0};for(let f=0;f<a.values.length;f++){const u=a.types[f],p=n.indexes[u][r[u]],m=(i=n.values[p])!==null&&i!==void 0?i:0;o[f]=m,r[u]++}return o}const MN=(n,a)=>{const i=Ja.createTransformer(a),o=fo(n),r=fo(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?Df.has(n)&&!r.values.length||Df.has(a)&&!o.values.length?AN(n,a):xo(bx(DN(o,r),r.values),i):oc(n,a)};function xx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?ot(n,a,i):Oh(n)(n,a)}const RN=5;function _x(n,a,i){const o=Math.max(a-RN,0);return $b(i-n(o),a-o)}const dt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Jd=.001;function ON({duration:n=dt.duration,bounce:a=dt.bounce,velocity:i=dt.velocity,mass:o=dt.mass}){let r,f,u=1-a;u=ya(dt.minDamping,dt.maxDamping,u),n=ya(dt.minDuration,dt.maxDuration,ma(n)),u<1?(r=g=>{const y=g*u,v=y*n,b=y-i,S=Mf(g,u),C=Math.exp(-v);return Jd-b/S*C},f=g=>{const v=g*u*n,b=v*i+i,S=Math.pow(u,2)*Math.pow(g,2)*n,C=Math.exp(-v),E=Mf(Math.pow(g,2),u);return(-r(g)+Jd>0?-1:1)*((b-S)*C)/E}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-Jd+y*v},f=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=IN(r,f,p);if(n=pa(n),isNaN(m))return{stiffness:dt.stiffness,damping:dt.damping,duration:n};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:u*2*Math.sqrt(o*g),duration:n}}}const BN=12;function IN(n,a,i){let o=i;for(let r=1;r<BN;r++)o=o-n(o)/a(o);return o}function Mf(n,a){return n*Math.sqrt(1-a*a)}const LN=["duration","bounce"],zN=["stiffness","damping","mass"];function Ay(n,a){return a.some(i=>n[i]!==void 0)}function UN(n){let a={velocity:dt.velocity,stiffness:dt.stiffness,damping:dt.damping,mass:dt.mass,isResolvedFromDuration:!1,...n};if(!Ay(n,zN)&&Ay(n,LN))if(n.visualDuration){const i=n.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,f=2*ya(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:dt.mass,stiffness:r,damping:f}}else{const i=ON(n);a={...a,...i,mass:dt.mass},a.isResolvedFromDuration=!0}return a}function Sx(n=dt.visualDuration,a=dt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:r}=i;const f=i.keyframes[0],u=i.keyframes[i.keyframes.length-1],p={done:!1,value:f},{stiffness:m,damping:g,mass:y,duration:v,velocity:b,isResolvedFromDuration:S}=UN({...i,velocity:-ma(i.velocity||0)}),C=b||0,E=g/(2*Math.sqrt(m*y)),N=u-f,k=ma(Math.sqrt(m/y)),A=Math.abs(N)<5;o||(o=A?dt.restSpeed.granular:dt.restSpeed.default),r||(r=A?dt.restDelta.granular:dt.restDelta.default);let M;if(E<1){const z=Mf(k,E);M=Y=>{const R=Math.exp(-E*k*Y);return u-R*((C+E*k*N)/z*Math.sin(z*Y)+N*Math.cos(z*Y))}}else if(E===1)M=z=>u-Math.exp(-k*z)*(N+(C+k*N)*z);else{const z=k*Math.sqrt(E*E-1);M=Y=>{const R=Math.exp(-E*k*Y),O=Math.min(z*Y,300);return u-R*((C+E*k*N)*Math.sinh(O)+z*N*Math.cosh(O))/z}}const D={calculatedDuration:S&&v||null,next:z=>{const Y=M(z);if(S)p.done=z>=v;else{let R=0;E<1&&(R=z===0?pa(C):_x(M,z,Y));const O=Math.abs(R)<=o,G=Math.abs(u-Y)<=r;p.done=O&&G}return p.value=p.done?u:Y,p},toString:()=>{const z=Math.min(yx(D),wf),Y=qb(R=>D.next(z*R).value,z,30);return z+"ms "+Y}};return D}function jy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:f=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],b={done:!1,value:v},S=O=>p!==void 0&&O<p||m!==void 0&&O>m,C=O=>p===void 0?m:m===void 0||Math.abs(p-O)<Math.abs(m-O)?p:m;let E=i*a;const N=v+E,k=u===void 0?N:u(N);k!==N&&(E=k-v);const A=O=>-E*Math.exp(-O/o),M=O=>k+A(O),D=O=>{const G=A(O),ee=M(O);b.done=Math.abs(G)<=g,b.value=b.done?k:ee};let z,Y;const R=O=>{S(b.value)&&(z=O,Y=Sx({keyframes:[b.value,C(b.value)],velocity:_x(M,O,b.value),damping:r,stiffness:f,restDelta:g,restSpeed:y}))};return R(0),{calculatedDuration:null,next:O=>{let G=!1;return!Y&&z===void 0&&(G=!0,D(O),R(O)),z!==void 0&&O>=z?Y.next(O-z):(!G&&D(O),b)}}}const VN=bo(.42,0,1,1),HN=bo(0,0,.58,1),Tx=bo(.42,0,.58,1),GN=n=>Array.isArray(n)&&typeof n[0]!="number",PN={linear:dn,easeIn:VN,easeInOut:Tx,easeOut:HN,circIn:jh,circInOut:nx,circOut:tx,backIn:Ah,backInOut:Jb,backOut:Wb,anticipate:ex},wy=n=>{if(Nh(n)){Tb(n.length===4);const[a,i,o,r]=n;return bo(a,i,o,r)}else if(typeof n=="string")return PN[n];return n};function $N(n,a,i){const o=[],r=i||xx,f=n.length-1;for(let u=0;u<f;u++){let p=r(n[u],n[u+1]);if(a){const m=Array.isArray(a)?a[u]||dn:a;p=xo(m,p)}o.push(p)}return o}function FN(n,a,{clamp:i=!0,ease:o,mixer:r}={}){const f=n.length;if(Tb(f===a.length),f===1)return()=>a[0];if(f===2&&a[0]===a[1])return()=>a[1];const u=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=$N(a,o,r),m=p.length,g=y=>{if(u&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const b=Bi(n[v],n[v+1],y);return p[v](b)};return i?y=>g(ya(n[0],n[f-1],y)):g}function qN(n,a){const i=n[n.length-1];for(let o=1;o<=a;o++){const r=Bi(0,a,o);n.push(ot(i,1,r))}}function YN(n){const a=[0];return qN(a,n.length-1),a}function KN(n,a){return n.map(i=>i*a)}function ZN(n,a){return n.map(()=>a||Tx).splice(0,n.length-1)}function rc({duration:n=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=GN(o)?o.map(wy):wy(o),f={done:!1,value:a[0]},u=KN(i&&i.length===a.length?i:YN(a),n),p=FN(u,a,{ease:Array.isArray(r)?r:ZN(a,r)});return{calculatedDuration:n,next:m=>(f.value=p(m),f.done=m>=n,f)}}const XN=n=>{const a=({timestamp:i})=>n(i);return{start:()=>nt.update(a,!0),stop:()=>Wa(a),now:()=>Ot.isProcessing?Ot.timestamp:Fn.now()}},QN={decay:jy,inertia:jy,tween:rc,keyframes:rc,spring:Sx},WN=n=>n/100;class Bh extends vx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:f}=this.options,u=(r==null?void 0:r.KeyframeResolver)||Rh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(f,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:f,velocity:u=0}=this.options,p=Eh(i)?i:QN[i]||rc;let m,g;p!==rc&&typeof a[0]!="number"&&(m=xo(WN,xx(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});f==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-u})),y.calculatedDuration===null&&(y.calculatedDuration=yx(y));const{calculatedDuration:v}=y,b=v+r,S=b*(o+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:b,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:f,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=o;if(this.startTime===null)return f.next(0);const{delay:b,repeat:S,repeatType:C,repeatDelay:E,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const k=this.currentTime-b*(this.speed>=0?1:-1),A=this.speed>=0?k<0:k>y;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let M=this.currentTime,D=f;if(S){const O=Math.min(this.currentTime,y)/v;let G=Math.floor(O),ee=O%1;!ee&&O>=1&&(ee=1),ee===1&&G--,G=Math.min(G,S+1),!!(G%2)&&(C==="reverse"?(ee=1-ee,E&&(ee-=E/v)):C==="mirror"&&(D=u)),M=ya(0,1,ee)*v}const z=A?{done:!1,value:m[0]}:D.next(M);p&&(z.value=p(z.value));let{done:Y}=z;!A&&g!==null&&(Y=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&Y);return R&&r!==void 0&&(z.value=Cc(m,this.options,r)),N&&N(z.value),R&&this.finish(),z}get duration(){const{resolved:a}=this;return a?ma(a.calculatedDuration):0}get time(){return ma(this.currentTime)}set time(a){a=pa(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=ma(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=XN,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(f=>this.tick(f))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const JN=new Set(["opacity","clipPath","filter","transform"]);function eA(n,a,i,{delay:o=0,duration:r=300,repeat:f=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Kb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:o,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:f+1,direction:u==="reverse"?"alternate":"normal"})}const tA=Ch(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),cc=10,nA=2e4;function aA(n){return Eh(n.type)||n.type==="spring"||!Yb(n.ease)}function sA(n,a){const i=new Bh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const r=[];let f=0;for(;!o.done&&f<nA;)o=i.sample(f),r.push(o.value),f+=cc;return{times:void 0,keyframes:r,duration:f-cc,ease:"linear"}}const kx={anticipate:ex,backInOut:Jb,circInOut:nx};function iA(n){return n in kx}class Dy extends vx{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:f}=this.options;this.resolver=new gx(f,(u,p)=>this.onKeyframesResolved(u,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:f,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof f=="string"&&lc()&&iA(f)&&(f=kx[f]),aA(this.options)){const{onComplete:v,onUpdate:b,motionValue:S,element:C,...E}=this.options,N=sA(a,E);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,f=N.ease,u="keyframes"}const y=eA(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:f});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(by(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Cc(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:o,times:r,type:u,ease:f,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ma(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ma(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=pa(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return dn;const{animation:o}=i;by(o,a)}return dn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:f,ease:u,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:b,...S}=this.options,C=new Bh({...S,keyframes:o,duration:r,type:f,ease:u,times:p,isGenerator:!0}),E=pa(this.time);g.setWithVelocity(C.sample(E-cc).value,C.sample(E).value,cc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:f,damping:u,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return tA()&&o&&JN.has(o)&&!m&&!g&&!r&&f!=="mirror"&&u!==0&&p!=="inertia"}}const lA={type:"spring",stiffness:500,damping:25,restSpeed:10},oA=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),rA={type:"keyframes",duration:.8},cA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uA=(n,{keyframes:a})=>a.length>2?rA:Ds.has(n)?n.startsWith("scale")?oA(a[1]):lA:cA;function dA({when:n,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:f,repeatType:u,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Ih=(n,a,i,o={},r,f)=>u=>{const p=_h(o,n)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-pa(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:f?void 0:r};dA(p)||(y={...y,...uA(n,y)}),y.duration&&(y.duration=pa(y.duration)),y.repeatDelay&&(y.repeatDelay=pa(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!f&&a.get()!==void 0){const b=Cc(y.keyframes,p);if(b!==void 0)return nt.update(()=>{y.onUpdate(b),y.onComplete()}),new PE([])}return!f&&Dy.supports(y)?new Dy(y):new Bh(y)};function fA({protectedKeys:n,needsAnimating:a},i){const o=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Cx(n,a,{delay:i=0,transitionOverride:o,type:r}={}){var f;let{transition:u=n.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(u=o);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const b=n.getValue(v,(f=n.latestValues[v])!==null&&f!==void 0?f:null),S=m[v];if(S===void 0||y&&fA(y,v))continue;const C={delay:i,..._h(u||{},v)};let E=!1;if(window.MotionHandoffAnimation){const k=Fb(n);if(k){const A=window.MotionHandoffAnimation(k,v,nt);A!==null&&(C.startTime=A,E=!0)}}kf(n,v),b.start(Ih(v,b,S,n.shouldReduceMotion&&Pb.has(v)?{type:!1}:C,n,E));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{nt.update(()=>{p&&UE(n,p)})}),g}function Rf(n,a,i={}){var o;const r=kc(n,a,i.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:f=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(f=i.transitionOverride);const u=r?()=>Promise.all(Cx(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:b}=f;return hA(n,a,y+g,v,b,i)}:()=>Promise.resolve(),{when:m}=f;if(m){const[g,y]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>y())}else return Promise.all([u(),p(i.delay)])}function hA(n,a,i=0,o=0,r=1,f){const u=[],p=(n.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(n.variantChildren).sort(pA).forEach((g,y)=>{g.notify("AnimationStart",a),u.push(Rf(g,a,{...f,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(u)}function pA(n,a){return n.sortNodePosition(a)}function mA(n,a,i={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(f=>Rf(n,f,i));o=Promise.all(r)}else if(typeof a=="string")o=Rf(n,a,i);else{const r=typeof a=="function"?kc(n,a,i.custom):a;o=Promise.all(Cx(n,r,i))}return o.then(()=>{n.notify("AnimationComplete",a)})}const gA=ch.length;function Ex(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Ex(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<gA;i++){const o=ch[i],r=n.props[o];(ro(r)||r===!1)&&(a[o]=r)}return a}const vA=[...rh].reverse(),yA=rh.length;function bA(n){return a=>Promise.all(a.map(({animation:i,options:o})=>mA(n,i,o)))}function xA(n){let a=bA(n),i=My(),o=!0;const r=m=>(g,y)=>{var v;const b=kc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(b){const{transition:S,transitionEnd:C,...E}=b;g={...g,...E,...C}}return g};function f(m){a=m(n)}function u(m){const{props:g}=n,y=Ex(n.parent)||{},v=[],b=new Set;let S={},C=1/0;for(let N=0;N<yA;N++){const k=vA[N],A=i[k],M=g[k]!==void 0?g[k]:y[k],D=ro(M),z=k===m?A.isActive:null;z===!1&&(C=N);let Y=M===y[k]&&M!==g[k]&&D;if(Y&&o&&n.manuallyAnimateOnMount&&(Y=!1),A.protectedKeys={...S},!A.isActive&&z===null||!M&&!A.prevProp||Sc(M)||typeof M=="boolean")continue;const R=_A(A.prevProp,M);let O=R||k===m&&A.isActive&&!Y&&D||N>C&&D,G=!1;const ee=Array.isArray(M)?M:[M];let ne=ee.reduce(r(k),{});z===!1&&(ne={});const{prevResolvedValues:ae={}}=A,oe={...ae,...ne},W=q=>{O=!0,b.has(q)&&(G=!0,b.delete(q)),A.needsAnimating[q]=!0;const U=n.getValue(q);U&&(U.liveStyle=!1)};for(const q in oe){const U=ne[q],re=ae[q];if(S.hasOwnProperty(q))continue;let I=!1;Tf(U)&&Tf(re)?I=!Gb(U,re):I=U!==re,I?U!=null?W(q):b.add(q):U!==void 0&&b.has(q)?W(q):A.protectedKeys[q]=!0}A.prevProp=M,A.prevResolvedValues=ne,A.isActive&&(S={...S,...ne}),o&&n.blockInitialAnimation&&(O=!1),O&&(!(Y&&R)||G)&&v.push(...ee.map(q=>({animation:q,options:{type:k}})))}if(b.size){const N={};b.forEach(k=>{const A=n.getBaseTarget(k),M=n.getValue(k);M&&(M.liveStyle=!0),N[k]=A??null}),v.push({animation:N})}let E=!!v.length;return o&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(E=!1),o=!1,E?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const v=u(m);for(const b in i)i[b].protectedKeys={};return v}return{animateChanges:u,setActive:p,setAnimateFunction:f,getState:()=>i,reset:()=>{i=My(),o=!0}}}function _A(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Gb(a,n):!1}function Ss(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function My(){return{animate:Ss(!0),whileInView:Ss(),whileHover:Ss(),whileTap:Ss(),whileDrag:Ss(),whileFocus:Ss(),exit:Ss()}}class ts{constructor(a){this.isMounted=!1,this.node=a}update(){}}class SA extends ts{constructor(a){super(a),a.animationState||(a.animationState=xA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Sc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let TA=0;class kA extends ts{constructor(){super(...arguments),this.id=TA++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const CA={animation:{Feature:SA},exit:{Feature:kA}},Mn={x:!1,y:!1};function Nx(){return Mn.x||Mn.y}function EA(n){return n==="x"||n==="y"?Mn[n]?null:(Mn[n]=!0,()=>{Mn[n]=!1}):Mn.x||Mn.y?null:(Mn.x=Mn.y=!0,()=>{Mn.x=Mn.y=!1})}const Lh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ho(n,a,i,o={passive:!0}){return n.addEventListener(a,i,o),()=>n.removeEventListener(a,i)}function _o(n){return{point:{x:n.pageX,y:n.pageY}}}const NA=n=>a=>Lh(a)&&n(a,_o(a));function eo(n,a,i,o){return ho(n,a,NA(i),o)}const Ry=(n,a)=>Math.abs(n-a);function AA(n,a){const i=Ry(n.x,a.x),o=Ry(n.y,a.y);return Math.sqrt(i**2+o**2)}class Ax{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:f=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=AA(v.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:C}=v,{timestamp:E}=Ot;this.history.push({...C,timestamp:E});const{onStart:N,onMove:k}=this.handlers;b||(N&&N(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,v)},this.handlePointerMove=(v,b)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=ef(b,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(v,b)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=tf(v.type==="pointercancel"?this.lastMoveEventInfo:ef(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,N),C&&C(v,N)},!Lh(a))return;this.dragSnapToOrigin=f,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const u=_o(a),p=ef(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ot;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,tf(p,this.history)),this.removeListeners=xo(eo(this.contextWindow,"pointermove",this.handlePointerMove),eo(this.contextWindow,"pointerup",this.handlePointerUp),eo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),Wa(this.updatePoint)}}function ef(n,a){return a?{point:a(n.point)}:n}function Oy(n,a){return{x:n.x-a.x,y:n.y-a.y}}function tf({point:n},a){return{point:n,delta:Oy(n,jx(a)),offset:Oy(n,jA(a)),velocity:wA(a,.1)}}function jA(n){return n[0]}function jx(n){return n[n.length-1]}function wA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,o=null;const r=jx(n);for(;i>=0&&(o=n[i],!(r.timestamp-o.timestamp>pa(a)));)i--;if(!o)return{x:0,y:0};const f=ma(r.timestamp-o.timestamp);if(f===0)return{x:0,y:0};const u={x:(r.x-o.x)/f,y:(r.y-o.y)/f};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const wx=1e-4,DA=1-wx,MA=1+wx,Dx=.01,RA=0-Dx,OA=0+Dx;function fn(n){return n.max-n.min}function BA(n,a,i){return Math.abs(n-a)<=i}function By(n,a,i,o=.5){n.origin=o,n.originPoint=ot(a.min,a.max,n.origin),n.scale=fn(i)/fn(a),n.translate=ot(i.min,i.max,n.origin)-n.originPoint,(n.scale>=DA&&n.scale<=MA||isNaN(n.scale))&&(n.scale=1),(n.translate>=RA&&n.translate<=OA||isNaN(n.translate))&&(n.translate=0)}function to(n,a,i,o){By(n.x,a.x,i.x,o?o.originX:void 0),By(n.y,a.y,i.y,o?o.originY:void 0)}function Iy(n,a,i){n.min=i.min+a.min,n.max=n.min+fn(a)}function IA(n,a,i){Iy(n.x,a.x,i.x),Iy(n.y,a.y,i.y)}function Ly(n,a,i){n.min=a.min-i.min,n.max=n.min+fn(a)}function no(n,a,i){Ly(n.x,a.x,i.x),Ly(n.y,a.y,i.y)}function LA(n,{min:a,max:i},o){return a!==void 0&&n<a?n=o?ot(a,n,o.min):Math.max(n,a):i!==void 0&&n>i&&(n=o?ot(i,n,o.max):Math.min(n,i)),n}function zy(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function zA(n,{top:a,left:i,bottom:o,right:r}){return{x:zy(n.x,i,r),y:zy(n.y,a,o)}}function Uy(n,a){let i=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,o]=[o,i]),{min:i,max:o}}function UA(n,a){return{x:Uy(n.x,a.x),y:Uy(n.y,a.y)}}function VA(n,a){let i=.5;const o=fn(n),r=fn(a);return r>o?i=Bi(a.min,a.max-o,n.min):o>r&&(i=Bi(n.min,n.max-r,a.min)),ya(0,1,i)}function HA(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const Of=.35;function GA(n=Of){return n===!1?n=0:n===!0&&(n=Of),{x:Vy(n,"left","right"),y:Vy(n,"top","bottom")}}function Vy(n,a,i){return{min:Hy(n,a),max:Hy(n,i)}}function Hy(n,a){return typeof n=="number"?n:n[a]||0}const Gy=()=>({translate:0,scale:1,origin:0,originPoint:0}),ji=()=>({x:Gy(),y:Gy()}),Py=()=>({min:0,max:0}),mt=()=>({x:Py(),y:Py()});function En(n){return[n("x"),n("y")]}function Mx({top:n,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:n,max:o}}}function PA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function $A(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function nf(n){return n===void 0||n===1}function Bf({scale:n,scaleX:a,scaleY:i}){return!nf(n)||!nf(a)||!nf(i)}function Cs(n){return Bf(n)||Rx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Rx(n){return $y(n.x)||$y(n.y)}function $y(n){return n&&n!=="0%"}function uc(n,a,i){const o=n-i,r=a*o;return i+r}function Fy(n,a,i,o,r){return r!==void 0&&(n=uc(n,r,o)),uc(n,i,o)+a}function If(n,a=0,i=1,o,r){n.min=Fy(n.min,a,i,o,r),n.max=Fy(n.max,a,i,o,r)}function Ox(n,{x:a,y:i}){If(n.x,a.translate,a.scale,a.originPoint),If(n.y,i.translate,i.scale,i.originPoint)}const qy=.999999999999,Yy=1.0000000000001;function FA(n,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let f,u;for(let p=0;p<r;p++){f=i[p],u=f.projectionDelta;const{visualElement:m}=f.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Di(n,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),u&&(a.x*=u.x.scale,a.y*=u.y.scale,Ox(n,u)),o&&Cs(f.latestValues)&&Di(n,f.latestValues))}a.x<Yy&&a.x>qy&&(a.x=1),a.y<Yy&&a.y>qy&&(a.y=1)}function wi(n,a){n.min=n.min+a,n.max=n.max+a}function Ky(n,a,i,o,r=.5){const f=ot(n.min,n.max,r);If(n,a,i,f,o)}function Di(n,a){Ky(n.x,a.x,a.scaleX,a.scale,a.originX),Ky(n.y,a.y,a.scaleY,a.scale,a.originY)}function Bx(n,a){return Mx($A(n.getBoundingClientRect(),a))}function qA(n,a,i){const o=Bx(n,i),{scroll:r}=a;return r&&(wi(o.x,r.offset.x),wi(o.y,r.offset.y)),o}const Ix=({current:n})=>n?n.ownerDocument.defaultView:null,YA=new WeakMap;class KA{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=mt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(_o(y).point)},f=(y,v)=>{const{drag:b,dragPropagation:S,onDragStart:C}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=EA(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),En(N=>{let k=this.getAxisMotionValue(N).get()||0;if($n.test(k)){const{projection:A}=this.visualElement;if(A&&A.layout){const M=A.layout.layoutBox[N];M&&(k=fn(M)*(parseFloat(k)/100))}}this.originPoint[N]=k}),C&&nt.postRender(()=>C(y,v)),kf(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},u=(y,v)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:C,onDrag:E}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=v;if(S&&this.currentDirection===null){this.currentDirection=ZA(N),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),E&&E(y,v)},p=(y,v)=>this.stop(y,v),m=()=>En(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Ax(a,{onSessionStart:r,onStart:f,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Ix(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:f}=this.getProps();f&&nt.postRender(()=>f(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Pr(a,r,this.currentDirection))return;const f=this.getAxisMotionValue(a);let u=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(u=LA(u,this.constraints[a],this.elastic[a])),f.set(u)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,f=this.constraints;i&&Ni(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=zA(r.layoutBox,i):this.constraints=!1,this.elastic=GA(o),f!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&En(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=HA(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ni(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const f=qA(o,r.root,this.visualElement.getTransformPagePoint());let u=UA(r.layout.layoutBox,f);if(i){const p=i(PA(u));this.hasMutatedConstraints=!!p,p&&(u=Mx(p))}return u}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:f,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=En(y=>{if(!Pr(y,i,this.currentDirection))return;let v=m&&m[y]||{};u&&(v={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,C={type:"inertia",velocity:o?a[y]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...f,...v};return this.startAxisValueAnimation(y,C)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return kf(this.visualElement,a),o.start(Ih(a,o,0,i,this.visualElement,!1))}stopAnimation(){En(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){En(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){En(i=>{const{drag:o}=this.getProps();if(!Pr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,f=this.getAxisMotionValue(i);if(r&&r.layout){const{min:u,max:p}=r.layout.layoutBox[i];f.set(a[i]-ot(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Ni(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};En(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();r[u]=VA({min:m,max:m},this.constraints[u])}});const{transformTemplate:f}=this.visualElement.getProps();this.visualElement.current.style.transform=f?f({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),En(u=>{if(!Pr(u,a,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(ot(m,g,r[u]))})}addListeners(){if(!this.visualElement.current)return;YA.set(this.visualElement,this);const a=this.visualElement.current,i=eo(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Ni(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,f=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),nt.read(o);const u=ho(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(En(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{u(),i(),f(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:f=!1,dragElastic:u=Of,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:f,dragElastic:u,dragMomentum:p}}}function Pr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function ZA(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class XA extends ts{constructor(a){super(a),this.removeGroupControls=dn,this.removeListeners=dn,this.controls=new KA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Zy=n=>(a,i)=>{n&&nt.postRender(()=>n(a,i))};class QA extends ts{constructor(){super(...arguments),this.removePointerDownListener=dn}onPointerDown(a){this.session=new Ax(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ix(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:Zy(a),onStart:Zy(i),onMove:o,onEnd:(f,u)=>{delete this.session,r&&nt.postRender(()=>r(f,u))}}}mount(){this.removePointerDownListener=eo(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ec={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Gl={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ve.test(n))n=parseFloat(n);else return n;const i=Xy(n,a.target.x),o=Xy(n,a.target.y);return`${i}% ${o}%`}},WA={correct:(n,{treeScale:a,projectionDelta:i})=>{const o=n,r=Ja.parse(n);if(r.length>5)return o;const f=Ja.createTransformer(n),u=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+u]/=p,r[1+u]/=m;const g=ot(p,m,.5);return typeof r[2+u]=="number"&&(r[2+u]/=g),typeof r[3+u]=="number"&&(r[3+u]/=g),f(r)}};class JA extends _.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:f}=a;CE(ej),f&&(i.group&&i.group.add(f),o&&o.register&&r&&o.register(f),f.root.didUpdate(),f.addEventListener("animationComplete",()=>{this.safeToRemove()}),f.setOptions({...f.options,onExitComplete:()=>this.safeToRemove()})),ec.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:f}=this.props,u=o.projection;return u&&(u.isPresent=f,r||a.layoutDependency!==i||i===void 0?u.willUpdate():this.safeToRemove(),a.isPresent!==f&&(f?u.promote():u.relegate()||nt.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),dh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Lx(n){const[a,i]=_b(),o=_.useContext(sh);return c.jsx(JA,{...n,layoutGroup:o,switchLayoutGroup:_.useContext(jb),isPresent:a,safeToRemove:i})}const ej={borderRadius:{...Gl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gl,borderTopRightRadius:Gl,borderBottomLeftRadius:Gl,borderBottomRightRadius:Gl,boxShadow:WA};function tj(n,a,i){const o=zt(n)?n:uo(n);return o.start(Ih("",o,a,i)),o.animation}function nj(n){return n instanceof SVGElement&&n.tagName!=="svg"}const aj=(n,a)=>n.depth-a.depth;class sj{constructor(){this.children=[],this.isDirty=!1}add(a){Sh(this.children,a),this.isDirty=!0}remove(a){Th(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(aj),this.isDirty=!1,this.children.forEach(a)}}function ij(n,a){const i=Fn.now(),o=({timestamp:r})=>{const f=r-i;f>=a&&(Wa(o),n(f-a))};return nt.read(o,!0),()=>Wa(o)}const zx=["TopLeft","TopRight","BottomLeft","BottomRight"],lj=zx.length,Qy=n=>typeof n=="string"?parseFloat(n):n,Wy=n=>typeof n=="number"||ve.test(n);function oj(n,a,i,o,r,f){r?(n.opacity=ot(0,i.opacity!==void 0?i.opacity:1,rj(o)),n.opacityExit=ot(a.opacity!==void 0?a.opacity:1,0,cj(o))):f&&(n.opacity=ot(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let u=0;u<lj;u++){const p=`border${zx[u]}Radius`;let m=Jy(a,p),g=Jy(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Wy(m)===Wy(g)?(n[p]=Math.max(ot(Qy(m),Qy(g),o),0),($n.test(g)||$n.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=ot(a.rotate||0,i.rotate||0,o))}function Jy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const rj=Ux(0,.5,tx),cj=Ux(.5,.95,dn);function Ux(n,a,i){return o=>o<n?0:o>a?1:i(Bi(n,a,o))}function e0(n,a){n.min=a.min,n.max=a.max}function Cn(n,a){e0(n.x,a.x),e0(n.y,a.y)}function t0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function n0(n,a,i,o,r){return n-=a,n=uc(n,1/i,o),r!==void 0&&(n=uc(n,1/r,o)),n}function uj(n,a=0,i=1,o=.5,r,f=n,u=n){if($n.test(a)&&(a=parseFloat(a),a=ot(u.min,u.max,a/100)-u.min),typeof a!="number")return;let p=ot(f.min,f.max,o);n===f&&(p-=a),n.min=n0(n.min,a,i,p,r),n.max=n0(n.max,a,i,p,r)}function a0(n,a,[i,o,r],f,u){uj(n,a[i],a[o],a[r],a.scale,f,u)}const dj=["x","scaleX","originX"],fj=["y","scaleY","originY"];function s0(n,a,i,o){a0(n.x,a,dj,i?i.x:void 0,o?o.x:void 0),a0(n.y,a,fj,i?i.y:void 0,o?o.y:void 0)}function i0(n){return n.translate===0&&n.scale===1}function Vx(n){return i0(n.x)&&i0(n.y)}function l0(n,a){return n.min===a.min&&n.max===a.max}function hj(n,a){return l0(n.x,a.x)&&l0(n.y,a.y)}function o0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Hx(n,a){return o0(n.x,a.x)&&o0(n.y,a.y)}function r0(n){return fn(n.x)/fn(n.y)}function c0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class pj{constructor(){this.members=[]}add(a){Sh(this.members,a),a.scheduleRender()}remove(a){if(Th(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const f=this.members[r];if(f.isPresent!==!1){o=f;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function mj(n,a,i){let o="";const r=n.x.translate/a.x,f=n.y.translate/a.y,u=(i==null?void 0:i.z)||0;if((r||f||u)&&(o=`translate3d(${r}px, ${f}px, ${u}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:b,skewX:S,skewY:C}=i;g&&(o=`perspective(${g}px) ${o}`),y&&(o+=`rotate(${y}deg) `),v&&(o+=`rotateX(${v}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),C&&(o+=`skewY(${C}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Es={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Kl=typeof window<"u"&&window.MotionDebug!==void 0,af=["","X","Y","Z"],gj={visibility:"hidden"},u0=1e3;let vj=0;function sf(n,a,i,o){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),o&&(o[n]=0))}function Gx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Fb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:f}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",nt,!(r||f))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&Gx(o)}function Px({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(u={},p=a==null?void 0:a()){this.id=vj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Kl&&(Es.totalNodes=Es.resolvedTargetDeltas=Es.recalculatedProjection=0),this.nodes.forEach(xj),this.nodes.forEach(Cj),this.nodes.forEach(Ej),this.nodes.forEach(_j),Kl&&window.MotionDebug.record(Es)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new sj)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new kh),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=nj(u),this.instance=u;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const b=()=>this.root.updateBlockedByResize=!1;n(u,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=ij(b,250),ec.hasAnimatedSinceResize&&(ec.hasAnimatedSinceResize=!1,this.nodes.forEach(f0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:C})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||y.getDefaultTransition()||Dj,{onLayoutAnimationStart:N,onLayoutAnimationComplete:k}=y.getProps(),A=!this.targetLayout||!Hx(this.targetLayout,C)||S,M=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||M||b&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,M);const D={..._h(E,"layout"),onPlay:N,onComplete:k};(y.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else b||f0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=C})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Nj),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Gx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(d0);return}this.isUpdating||this.nodes.forEach(Tj),this.isUpdating=!1,this.nodes.forEach(kj),this.nodes.forEach(yj),this.nodes.forEach(bj),this.clearAllSnapshots();const p=Fn.now();Ot.delta=ya(0,1e3/60,p-Ot.timestamp),Ot.timestamp=p,Ot.isProcessing=!0,Zd.update.process(Ot),Zd.preRender.process(Ot),Zd.render.process(Ot),Ot.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Sj),this.sharedNodes.forEach(Aj)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=mt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!Vx(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;u&&(p||Cs(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),Mj(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return mt();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(Rj))){const{scroll:y}=this.root;y&&(wi(m.x,y.offset.x),wi(m.y,y.offset.y))}return m}removeElementScroll(u){var p;const m=mt();if(Cn(m,u),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:b}=y;y!==this.root&&v&&b.layoutScroll&&(v.wasRoot&&Cn(m,u),wi(m.x,v.offset.x),wi(m.y,v.offset.y))}return m}applyTransform(u,p=!1){const m=mt();Cn(m,u);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Di(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Cs(y.latestValues)&&Di(m,y.latestValues)}return Cs(this.latestValues)&&Di(m,this.latestValues),m}removeTransform(u){const p=mt();Cn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Cs(g.latestValues))continue;Bf(g.latestValues)&&g.updateSnapshot();const y=mt(),v=g.measurePageBox();Cn(y,v),s0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Cs(this.latestValues)&&s0(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ot.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(u||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:b}=this.options;if(!(!this.layout||!(v||b))){if(this.resolvedRelativeTargetAt=Ot.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),no(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=mt(),this.targetWithTransforms=mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),IA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Cn(this.target,this.layout.layoutBox),Ox(this.target,this.targetDelta)):Cn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mt(),this.relativeTargetOrigin=mt(),no(this.relativeTargetOrigin,this.target,S.target),Cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Kl&&Es.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Bf(this.parent.latestValues)||Rx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Ot.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;Cn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;FA(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=mt());const{target:C}=p;if(!C){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(t0(this.prevProjectionDelta.x,this.projectionDelta.x),t0(this.prevProjectionDelta.y,this.projectionDelta.y)),to(this.projectionDelta,this.layoutCorrected,C,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!c0(this.projectionDelta.x,this.prevProjectionDelta.x)||!c0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",C)),Kl&&Es.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ji(),this.projectionDelta=ji(),this.projectionDeltaWithTransform=ji()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=ji();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=mt(),S=m?m.source:void 0,C=this.layout?this.layout.source:void 0,E=S!==C,N=this.getStack(),k=!N||N.members.length<=1,A=!!(E&&!k&&this.options.crossfade===!0&&!this.path.some(wj));this.animationProgress=0;let M;this.mixTargetDelta=D=>{const z=D/1e3;h0(v.x,u.x,z),h0(v.y,u.y,z),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(no(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jj(this.relativeTarget,this.relativeTargetOrigin,b,z),M&&hj(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=mt()),Cn(M,this.relativeTarget)),E&&(this.animationValues=y,oj(y,g,this.latestValues,z,A,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{ec.hasAnimatedSinceResize=!0,this.currentAnimation=tj(0,u0,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&$x(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||mt();const v=fn(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+v;const b=fn(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+b}Cn(p,m),Di(p,y),to(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new pj),this.sharedNodes.get(u).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&sf("z",u,g,this.animationValues);for(let y=0;y<af.length;y++)sf(`rotate${af[y]}`,u,g,this.animationValues),sf(`skew${af[y]}`,u,g,this.animationValues);u.render();for(const y in g)u.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return gj;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Wr(u==null?void 0:u.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=Wr(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!Cs(this.latestValues)&&(E.transform=y?y({},""):"none",this.hasProjected=!1),E}const b=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=mj(this.projectionDeltaWithTransform,this.treeScale,b),y&&(g.transform=y(b,g.transform));const{x:S,y:C}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${C.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=v===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const E in ic){if(b[E]===void 0)continue;const{correct:N,applyTo:k}=ic[E],A=g.transform==="none"?b[E]:N(b[E],v);if(k){const M=k.length;for(let D=0;D<M;D++)g[k[D]]=A}else g[E]=A}return this.options.layoutId&&(g.pointerEvents=v===this?Wr(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(d0),this.root.sharedNodes.clear()}}}function yj(n){n.updateLayout()}function bj(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=n.layout,{animationType:f}=n.options,u=i.source!==n.layout.source;f==="size"?En(v=>{const b=u?i.measuredBox[v]:i.layoutBox[v],S=fn(b);b.min=o[v].min,b.max=b.min+S}):$x(f,i.layoutBox,o)&&En(v=>{const b=u?i.measuredBox[v]:i.layoutBox[v],S=fn(o[v]);b.max=b.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+S)});const p=ji();to(p,o,i.layoutBox);const m=ji();u?to(m,n.applyTransform(r,!0),i.measuredBox):to(m,o,i.layoutBox);const g=!Vx(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const C=mt();no(C,i.layoutBox,b.layoutBox);const E=mt();no(E,o,S.layoutBox),Hx(C,E)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=E,n.relativeTargetOrigin=C,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function xj(n){Kl&&Es.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function _j(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Sj(n){n.clearSnapshot()}function d0(n){n.clearMeasurements()}function Tj(n){n.isLayoutDirty=!1}function kj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function f0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Cj(n){n.resolveTargetDelta()}function Ej(n){n.calcProjection()}function Nj(n){n.resetSkewAndRotation()}function Aj(n){n.removeLeadSnapshot()}function h0(n,a,i){n.translate=ot(a.translate,0,i),n.scale=ot(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function p0(n,a,i,o){n.min=ot(a.min,i.min,o),n.max=ot(a.max,i.max,o)}function jj(n,a,i,o){p0(n.x,a.x,i.x,o),p0(n.y,a.y,i.y,o)}function wj(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Dj={duration:.45,ease:[.4,0,.1,1]},m0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),g0=m0("applewebkit/")&&!m0("chrome/")?Math.round:dn;function v0(n){n.min=g0(n.min),n.max=g0(n.max)}function Mj(n){v0(n.x),v0(n.y)}function $x(n,a,i){return n==="position"||n==="preserve-aspect"&&!BA(r0(a),r0(i),.2)}function Rj(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const Oj=Px({attachResizeListener:(n,a)=>ho(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lf={current:void 0},Fx=Px({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!lf.current){const n=new Oj({});n.mount(window),n.setOptions({layoutScroll:!0}),lf.current=n}return lf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Bj={pan:{Feature:QA},drag:{Feature:XA,ProjectionNode:Fx,MeasureLayout:Lx}};function Ij(n,a,i){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const f=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(n);return f?Array.from(f):[]}return Array.from(n)}function qx(n,a){const i=Ij(n),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function y0(n){return a=>{a.pointerType==="touch"||Nx()||n(a)}}function Lj(n,a,i={}){const[o,r,f]=qx(n,i),u=y0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=y0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return o.forEach(p=>{p.addEventListener("pointerenter",u,r)}),f}function b0(n,a,i){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,f=o[r];f&&nt.postRender(()=>f(a,_o(a)))}class zj extends ts{mount(){const{current:a}=this.node;a&&(this.unmount=Lj(a,i=>(b0(this.node,i,"Start"),o=>b0(this.node,o,"End"))))}unmount(){}}class Uj extends ts{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xo(ho(this.node.current,"focus",()=>this.onFocus()),ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Yx=(n,a)=>a?n===a?!0:Yx(n,a.parentElement):!1,Vj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Hj(n){return Vj.has(n.tagName)||n.tabIndex!==-1}const Zl=new WeakSet;function x0(n){return a=>{a.key==="Enter"&&n(a)}}function of(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const Gj=(n,a)=>{const i=n.currentTarget;if(!i)return;const o=x0(()=>{if(Zl.has(i))return;of(i,"down");const r=x0(()=>{of(i,"up")}),f=()=>of(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",f,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function _0(n){return Lh(n)&&!Nx()}function Pj(n,a,i={}){const[o,r,f]=qx(n,i),u=p=>{const m=p.currentTarget;if(!_0(p)||Zl.has(m))return;Zl.add(m);const g=a(p),y=(S,C)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),!(!_0(S)||!Zl.has(m))&&(Zl.delete(m),typeof g=="function"&&g(S,{success:C}))},v=S=>{y(S,i.useGlobalTarget||Yx(m,S.target))},b=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!Hj(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",u,r),p.addEventListener("focus",g=>Gj(g,r),r)}),f}function S0(n,a,i){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),f=o[r];f&&nt.postRender(()=>f(a,_o(a)))}class $j extends ts{mount(){const{current:a}=this.node;a&&(this.unmount=Pj(a,i=>(S0(this.node,i,"Start"),(o,{success:r})=>S0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Lf=new WeakMap,rf=new WeakMap,Fj=n=>{const a=Lf.get(n.target);a&&a(n)},qj=n=>{n.forEach(Fj)};function Yj({root:n,...a}){const i=n||document;rf.has(i)||rf.set(i,{});const o=rf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(qj,{root:n,...a})),o[r]}function Kj(n,a,i){const o=Yj(a);return Lf.set(n,i),o.observe(n),()=>{Lf.delete(n),o.unobserve(n)}}const Zj={some:0,all:1};class Xj extends ts{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:f}=a,u={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:Zj[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,f&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),b=g?y:v;b&&b(m)};return Kj(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(Qj(a,i))&&this.startObserver()}unmount(){}}function Qj({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const Wj={inView:{Feature:Xj},tap:{Feature:$j},focus:{Feature:Uj},hover:{Feature:zj}},Jj={layout:{ProjectionNode:Fx,MeasureLayout:Lx}},dc={current:null},zh={current:!1};function Kx(){if(zh.current=!0,!!oh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>dc.current=n.matches;n.addListener(a),a()}else dc.current=!1}const ew=[...mx,Lt,Ja],tw=n=>ew.find(px(n)),T0=new WeakMap;function nw(n,a,i){for(const o in a){const r=a[o],f=i[o];if(zt(r))n.addValue(o,r);else if(zt(f))n.addValue(o,uo(r,{owner:n}));else if(f!==r)if(n.hasValue(o)){const u=n.getValue(o);u.liveStyle===!0?u.jump(r):u.hasAnimated||u.set(r)}else{const u=n.getStaticValue(o);n.addValue(o,uo(u!==void 0?u:r,{owner:n}))}}for(const o in i)a[o]===void 0&&n.removeValue(o);return a}const k0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class aw{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:f,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Fn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,nt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=u;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!f,this.isControllingVariants=Tc(i),this.isVariantNode=Nb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const C=b[S];m[S]!==void 0&&zt(C)&&C.set(m[S],!1)}}mount(a){this.current=a,T0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),zh.current||Kx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){T0.delete(this.current),this.projection&&this.projection.unmount(),Wa(this.notifyUpdate),Wa(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Ds.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&nt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),f=i.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),f(),u&&u(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Oi){const i=Oi[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const f=this.features[a];f.isMounted?f.update():(f.mount(),f.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<k0.length;o++){const r=k0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const f="on"+r,u=a[f];u&&(this.propEventSubscriptions[r]=this.on(r,u))}this.prevMotionValues=nw(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=uo(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(fx(r)||ax(r))?r=parseFloat(r):!tw(r)&&Ja.test(i)&&(r=cx(a,i)),this.setBaseTarget(a,zt(r)?r.get():r)),zt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const u=hh(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);u&&(r=u[a])}if(o&&r!==void 0)return r;const f=this.getBaseTargetFromProps(this.props,a);return f!==void 0&&!zt(f)?f:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new kh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Zx extends aw{constructor(){super(...arguments),this.KeyframeResolver=gx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;zt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function sw(n){return window.getComputedStyle(n)}class iw extends Zx{constructor(){super(...arguments),this.type="html",this.renderInstance=Ib}readValueFromInstance(a,i){if(Ds.has(i)){const o=Mh(i);return o&&o.default||0}else{const o=sw(a),r=(Rb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Bx(a,i)}build(a,i,o){gh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return xh(a,i,o)}}class lw extends Zx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Ds.has(i)){const o=Mh(i);return o&&o.default||0}return i=Lb.has(i)?i:uh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return Vb(a,i,o)}build(a,i,o){vh(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){zb(a,i,o,r)}mount(a){this.isSVGTag=bh(a.tagName),super.mount(a)}}const ow=(n,a)=>fh(n)?new lw(a):new iw(a,{allowProjection:n!==_.Fragment}),rw=OE({...CA,...Wj,...Bj,...Jj},ow),St=ZC(rw);function cw(){!zh.current&&Kx();const[n]=_.useState(dc.current);return n}var Qe;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT",n[n.SIGNAL=10]="SIGNAL",n[n.USAGE=11]="USAGE"})(Qe||(Qe={}));var _t;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(_t||(_t={}));var Za;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(Za||(Za={}));var Xa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(Xa||(Xa={}));var Vn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(Vn||(Vn={}));var Qa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(Qa||(Qa={}));const uw=8,C0="system",Pl="system";Object.assign(Object.create(null),{"":Qe.UNSPECIFIED,text:Qe.TEXT,tool_use:Qe.TOOL_USE,tool_result:Qe.TOOL_RESULT,error:Qe.ERROR,status:Qe.STATUS,system:Qe.SYSTEM,finding:Qe.FINDING,subtask_create:Qe.SUBTASK_CREATE,user_input:Qe.USER_INPUT,signal:Qe.SIGNAL,usage:Qe.USAGE});Qe.UNSPECIFIED+"",Qe.TEXT+"",Qe.TOOL_USE+"",Qe.TOOL_RESULT+"",Qe.ERROR+"",Qe.STATUS+"",Qe.SYSTEM+"",Qe.FINDING+"",Qe.SUBTASK_CREATE+"",Qe.USER_INPUT+"",Qe.SIGNAL+"",Qe.USAGE+"";Object.assign(Object.create(null),{"":_t.UNSPECIFIED,not_started:_t.NOT_STARTED,working:_t.WORKING,paused:_t.PAUSED,complete:_t.COMPLETE,failed:_t.FAILED,pending:_t.NOT_STARTED,assigned:_t.NOT_STARTED,in_progress:_t.WORKING,waiting_input:_t.PAUSED,review:_t.PAUSED,done:_t.COMPLETE});_t.UNSPECIFIED+"",_t.NOT_STARTED+"",_t.WORKING+"",_t.PAUSED+"",_t.COMPLETE+"",_t.FAILED+"";Object.assign(Object.create(null),{"":Za.UNSPECIFIED,active:Za.ACTIVE,archived:Za.ARCHIVED});Za.UNSPECIFIED+"",Za.ACTIVE+"",Za.ARCHIVED+"";Object.assign(Object.create(null),{"":Xa.UNSPECIFIED,open:Xa.OPEN,closed:Xa.CLOSED});Xa.UNSPECIFIED+"",Xa.OPEN+"",Xa.CLOSED+"";Object.assign(Object.create(null),{"":Vn.UNSPECIFIED,off:Vn.OFF,subscription:Vn.SUBSCRIPTION,api_key:Vn.API_KEY});Vn.UNSPECIFIED+"",Vn.OFF+"",Vn.SUBSCRIPTION+"",Vn.API_KEY+"";Object.assign(Object.create(null),{"":Qa.UNSPECIFIED,off:Qa.OFF,on:Qa.ON});Qa.UNSPECIFIED+"",Qa.OFF+"",Qa.ON+"";function ba(n){return Array.isArray?Array.isArray(n):Wx(n)==="[object Array]"}function dw(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function fw(n){return n==null?"":dw(n)}function Hn(n){return typeof n=="string"}function Xx(n){return typeof n=="number"}function hw(n){return n===!0||n===!1||pw(n)&&Wx(n)=="[object Boolean]"}function Qx(n){return typeof n=="object"}function pw(n){return Qx(n)&&n!==null}function un(n){return n!=null}function cf(n){return!n.trim().length}function Wx(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const mw="Incorrect 'index' type",gw=n=>`Invalid value for key ${n}`,vw=n=>`Pattern length exceeds max of ${n}.`,yw=n=>`Missing ${n} property in key`,bw=n=>`Property 'weight' in key '${n}' must be a positive integer`,E0=Object.prototype.hasOwnProperty;class xw{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=Jx(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Jx(n){let a=null,i=null,o=null,r=1,f=null;if(Hn(n)||ba(n))o=n,a=N0(n),i=zf(n);else{if(!E0.call(n,"name"))throw new Error(yw("name"));const u=n.name;if(o=u,E0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(bw(u));a=N0(u),i=zf(u),f=n.getFn}return{path:a,id:i,weight:r,src:o,getFn:f}}function N0(n){return ba(n)?n:n.split(".")}function zf(n){return ba(n)?n.join("."):n}function _w(n,a){let i=[],o=!1;const r=(f,u,p)=>{if(un(f))if(!u[p])i.push(f);else{let m=u[p];const g=f[m];if(!un(g))return;if(p===u.length-1&&(Hn(g)||Xx(g)||hw(g)))i.push(fw(g));else if(ba(g)){o=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],u,p+1)}else u.length&&r(g,u,p+1)}};return r(n,Hn(a)?a.split("."):a,0),o?i:i[0]}const Sw={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Tw={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},kw={location:0,threshold:.6,distance:100},Cw={useExtendedSearch:!1,getFn:_w,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ye={...Tw,...Sw,...kw,...Cw};const Ew=/[^ ]+/g;function Nw(n=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const f=r.match(Ew).length;if(i.has(f))return i.get(f);const u=1/Math.pow(f,.5*n),p=parseFloat(Math.round(u*o)/o);return i.set(f,p),p},clear(){i.clear()}}}class Uh{constructor({getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){this.norm=Nw(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Hn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();Hn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!un(a)||cf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,f)=>{let u=r.getFn?r.getFn(a):this.getFn(a,r.path);if(un(u)){if(ba(u)){let p=[];const m=[{nestedArrIndex:-1,value:u}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(un(y))if(Hn(y)&&!cf(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else ba(y)&&y.forEach((v,b)=>{m.push({nestedArrIndex:b,value:v})})}o.$[f]=p}else if(Hn(u)&&!cf(u)){let p={v:u,n:this.norm.get(u)};o.$[f]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function e_(n,a,{getFn:i=ye.getFn,fieldNormWeight:o=ye.fieldNormWeight}={}){const r=new Uh({getFn:i,fieldNormWeight:o});return r.setKeys(n.map(Jx)),r.setSources(a),r.create(),r}function Aw(n,{getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){const{keys:o,records:r}=n,f=new Uh({getFn:a,fieldNormWeight:i});return f.setKeys(o),f.setIndexRecords(r),f}function $r(n,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=ye.distance,ignoreLocation:f=ye.ignoreLocation}={}){const u=a/n.length;if(f)return u;const p=Math.abs(o-i);return r?u+p/r:p?1:u}function jw(n=[],a=ye.minMatchCharLength){let i=[],o=-1,r=-1,f=0;for(let u=n.length;f<u;f+=1){let p=n[f];p&&o===-1?o=f:!p&&o!==-1&&(r=f-1,r-o+1>=a&&i.push([o,r]),o=-1)}return n[f-1]&&f-o>=a&&i.push([o,f-1]),i}const Ns=32;function ww(n,a,i,{location:o=ye.location,distance:r=ye.distance,threshold:f=ye.threshold,findAllMatches:u=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,includeMatches:m=ye.includeMatches,ignoreLocation:g=ye.ignoreLocation}={}){if(a.length>Ns)throw new Error(vw(Ns));const y=a.length,v=n.length,b=Math.max(0,Math.min(o,v));let S=f,C=b;const E=p>1||m,N=E?Array(v):[];let k;for(;(k=n.indexOf(a,C))>-1;){let R=$r(a,{currentLocation:k,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(R,S),C=k+y,E){let O=0;for(;O<y;)N[k+O]=1,O+=1}}C=-1;let A=[],M=1,D=y+v;const z=1<<y-1;for(let R=0;R<y;R+=1){let O=0,G=D;for(;O<G;)$r(a,{errors:R,currentLocation:b+G,expectedLocation:b,distance:r,ignoreLocation:g})<=S?O=G:D=G,G=Math.floor((D-O)/2+O);D=G;let ee=Math.max(1,b-G+1),ne=u?v:Math.min(b+G,v)+y,ae=Array(ne+2);ae[ne+1]=(1<<R)-1;for(let W=ne;W>=ee;W-=1){let te=W-1,B=i[n.charAt(te)];if(E&&(N[te]=+!!B),ae[W]=(ae[W+1]<<1|1)&B,R&&(ae[W]|=(A[W+1]|A[W])<<1|1|A[W+1]),ae[W]&z&&(M=$r(a,{errors:R,currentLocation:te,expectedLocation:b,distance:r,ignoreLocation:g}),M<=S)){if(S=M,C=te,C<=b)break;ee=Math.max(1,2*b-C)}}if($r(a,{errors:R+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;A=ae}const Y={isMatch:C>=0,score:Math.max(.001,M)};if(E){const R=jw(N,p);R.length?m&&(Y.indices=R):Y.isMatch=!1}return Y}function Dw(n){let a={};for(let i=0,o=n.length;i<o;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const fc=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class t_{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:f=ye.includeMatches,findAllMatches:u=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:f,findAllMatches:u,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?fc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,C)=>{this.chunks.push({pattern:S,alphabet:Dw(S),startIndex:C})},b=this.pattern.length;if(b>Ns){let S=0;const C=b%Ns,E=b-C;for(;S<E;)v(this.pattern.substr(S,Ns),S),S+=Ns;if(C){const N=b-Ns;v(this.pattern.substr(N),N)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?fc(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:f,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],b=0,S=!1;this.chunks.forEach(({pattern:E,alphabet:N,startIndex:k})=>{const{isMatch:A,score:M,indices:D}=ww(a,E,N,{location:f+k,distance:u,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});A&&(S=!0),b+=M,A&&D&&(v=[...v,...D])});let C={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(C.indices=v),C}}class ns{constructor(a){this.pattern=a}static isMultiMatch(a){return A0(a,this.multiRegex)}static isSingleMatch(a){return A0(a,this.singleRegex)}search(){}}function A0(n,a){const i=n.match(a);return i?i[1]:null}class Mw extends ns{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Rw extends ns{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class Ow extends ns{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Bw extends ns{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class Iw extends ns{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class Lw extends ns{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class n_ extends ns{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:f=ye.includeMatches,findAllMatches:u=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){super(a),this._bitapSearch=new t_(a,{location:i,threshold:o,distance:r,includeMatches:f,findAllMatches:u,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class a_ extends ns{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],f=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+f,r.push([o,i-1]);const u=!!r.length;return{isMatch:u,score:u?0:1,indices:r}}}const Uf=[Mw,a_,Ow,Bw,Lw,Iw,Rw,n_],j0=Uf.length,zw=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Uw="|";function Vw(n,a={}){return n.split(Uw).map(i=>{let o=i.trim().split(zw).filter(f=>f&&!!f.trim()),r=[];for(let f=0,u=o.length;f<u;f+=1){const p=o[f];let m=!1,g=-1;for(;!m&&++g<j0;){const y=Uf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<j0;){const y=Uf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const Hw=new Set([n_.type,a_.type]);class Gw{constructor(a,{isCaseSensitive:i=ye.isCaseSensitive,ignoreDiacritics:o=ye.ignoreDiacritics,includeMatches:r=ye.includeMatches,minMatchCharLength:f=ye.minMatchCharLength,ignoreLocation:u=ye.ignoreLocation,findAllMatches:p=ye.findAllMatches,location:m=ye.location,threshold:g=ye.threshold,distance:y=ye.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:f,findAllMatches:p,ignoreLocation:u,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=o?fc(a):a,this.pattern=a,this.query=Vw(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:f}=this.options;a=r?a:a.toLowerCase(),a=f?fc(a):a;let u=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,u=0;for(let b=0,S=v.length;b<S;b+=1){const C=v[b],{isMatch:E,indices:N,score:k}=C.search(a);if(E){if(u+=1,m+=k,o){const A=C.constructor.type;Hw.has(A)?p=[...p,...N]:p.push(N)}}else{m=0,u=0,p.length=0;break}}if(u){let b={isMatch:!0,score:m/u};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Vf=[];function Pw(...n){Vf.push(...n)}function Hf(n,a){for(let i=0,o=Vf.length;i<o;i+=1){let r=Vf[i];if(r.condition(n,a))return new r(n,a)}return new t_(n,a)}const hc={AND:"$and",OR:"$or"},Gf={PATH:"$path",PATTERN:"$val"},Pf=n=>!!(n[hc.AND]||n[hc.OR]),$w=n=>!!n[Gf.PATH],Fw=n=>!ba(n)&&Qx(n)&&!Pf(n),w0=n=>({[hc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function s_(n,a,{auto:i=!0}={}){const o=r=>{let f=Object.keys(r);const u=$w(r);if(!u&&f.length>1&&!Pf(r))return o(w0(r));if(Fw(r)){const m=u?r[Gf.PATH]:f[0],g=u?r[Gf.PATTERN]:r[m];if(!Hn(g))throw new Error(gw(m));const y={keyId:zf(m),pattern:g};return i&&(y.searcher=Hf(g,a)),y}let p={children:[],operator:f[0]};return f.forEach(m=>{const g=r[m];ba(g)&&g.forEach(y=>{p.children.push(o(y))})}),p};return Pf(n)||(n=w0(n)),o(n)}function qw(n,{ignoreFieldNorm:a=ye.ignoreFieldNorm}){n.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:f,score:u})=>{const p=r?r.weight:null;o*=Math.pow(u===0&&p?Number.EPSILON:u,(p||1)*(a?1:f))}),i.score=o})}function Yw(n,a){const i=n.matches;a.matches=[],un(i)&&i.forEach(o=>{if(!un(o.indices)||!o.indices.length)return;const{indices:r,value:f}=o;let u={indices:r,value:f};o.key&&(u.key=o.key.src),o.idx>-1&&(u.refIndex=o.idx),a.matches.push(u)})}function Kw(n,a){a.score=n.score}function Zw(n,a,{includeMatches:i=ye.includeMatches,includeScore:o=ye.includeScore}={}){const r=[];return i&&r.push(Yw),o&&r.push(Kw),n.map(f=>{const{idx:u}=f,p={item:a[u],refIndex:u};return r.length&&r.forEach(m=>{m(f,p)}),p})}class Fi{constructor(a,i={},o){this.options={...ye,...i},this.options.useExtendedSearch,this._keyStore=new xw(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Uh))throw new Error(mw);this._myIndex=i||e_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){un(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const f=this._docs[o];a(f,o)&&(this.removeAt(o),o-=1,r-=1,i.push(f))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:f,sortFn:u,ignoreFieldNorm:p}=this.options;let m=Hn(a)?Hn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return qw(m,{ignoreFieldNorm:p}),f&&m.sort(u),Xx(i)&&i>-1&&(m=m.slice(0,i)),Zw(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Hf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:f,i:u,n:p})=>{if(!un(f))return;const{isMatch:m,score:g,indices:y}=i.searchIn(f);m&&r.push({item:f,idx:u,matches:[{score:g,value:f,norm:p,indices:y}]})}),r}_searchLogical(a){const i=s_(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const y=[];for(let v=0,b=p.children.length;v<b;v+=1){const S=p.children[v],C=o(S,m,g);if(C.length)y.push(...C);else if(p.operator===hc.AND)return[]}return y},r=this._myIndex.records,f={},u=[];return r.forEach(({$:p,i:m})=>{if(un(p)){let g=o(i,p,m);g.length&&(f[m]||(f[m]={idx:m,item:p,matches:[]},u.push(f[m])),g.forEach(({matches:y})=>{f[m].matches.push(...y)}))}}),u}_searchObjectList(a){const i=Hf(a,this.options),{keys:o,records:r}=this._myIndex,f=[];return r.forEach(({$:u,i:p})=>{if(!un(u))return;let m=[];o.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:u[y],searcher:i}))}),m.length&&f.push({idx:p,item:u,matches:m})}),f}_findMatches({key:a,value:i,searcher:o}){if(!un(i))return[];let r=[];if(ba(i))i.forEach(({v:f,i:u,n:p})=>{if(!un(f))return;const{isMatch:m,score:g,indices:y}=o.searchIn(f);m&&r.push({score:g,key:a,value:f,idx:u,norm:p,indices:y})});else{const{v:f,n:u}=i,{isMatch:p,score:m,indices:g}=o.searchIn(f);p&&r.push({score:m,key:a,value:f,norm:u,indices:g})}return r}}Fi.version="7.1.0";Fi.createIndex=e_;Fi.parseIndex=Aw;Fi.config=ye;Fi.parseQuery=s_;Pw(Gw);function Xw(n,a,i,o){if(!a.trim())return[];const r=.3;return new Fi(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const $f={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function es(n){return n==="blocked"?$f.blocked:$f[Vh(n)]}const Qw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function Ww(n){return Qw[Vh(n)]??"statusPending"}const Jw=["working","paused","failed","not_started","blocked","complete"],D0=["not_started","working","paused","complete","failed"],e2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Vh(n){return n in $f&&n!=="blocked"?n:e2[n]??"not_started"}const t2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function n2(n){if(n.length===0)return[];const a=[...n].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[f,u]=a[o];f<=r[1]+1?r[1]=Math.max(r[1],u):i.push([f,u])}return i}function i_({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const o=n2(a),r=[];let f=0;for(const[u,p]of o)u>f&&r.push(c.jsx("span",{children:n.slice(f,u)},`p${f}`)),r.push(c.jsx("mark",{className:i,children:n.slice(u,p+1)},`m${u}`)),f=p+1;return f<n.length&&r.push(c.jsx("span",{children:n.slice(f)},`p${f}`)),c.jsx(c.Fragment,{children:r})}function a2(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,f)=>r.sortOrder-f.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function s2(n,a){const i=new Map;for(const f of n){const p=f.dependsOn.length>0&&f.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":f.status,m=i.get(p);m?m.push(f):i.set(p,[f])}const o=[],r=new Set;for(const f of Jw){r.add(f);const u=i.get(f);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=es(f);o.push({status:f,label:p.label,style:p,tasks:u})}}for(const[f,u]of i)if(!r.has(f)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=es(f);o.push({status:f,label:p.label,style:p,tasks:u})}return o}const i2="_container_z4i38_1",l2="_header_z4i38_5",o2="_headerActions_z4i38_17",r2="_searchInput_z4i38_23",c2="_searchHighlight_z4i38_56",u2="_groupToggle_z4i38_62",d2="_groupToggleActive_z4i38_89",f2="_addButton_z4i38_93",h2="_taskRow_z4i38_120",p2="_selected_z4i38_140",m2="_expandArrow_z4i38_150",g2="_expanded_z4i38_157",v2="_leafSpacer_z4i38_161",y2="_taskStatusIcon_z4i38_166",b2="_taskTitle_z4i38_170",x2="_workspaceBadge_z4i38_177",_2="_childCountBadge_z4i38_195",S2="_dependencyBadge_z4i38_208",T2="_blockedBadge_z4i38_220",k2="_addChildButton_z4i38_225",C2="_emptyState_z4i38_268",E2="_statusGroupHeader_z4i38_275",N2="_statusGroupIcon_z4i38_294",A2="_statusGroupLabel_z4i38_298",j2="_statusGroupCount_z4i38_303",Me={container:i2,header:l2,headerActions:o2,searchInput:r2,searchHighlight:c2,groupToggle:u2,groupToggleActive:d2,addButton:f2,taskRow:h2,selected:p2,expandArrow:m2,expanded:g2,leafSpacer:v2,taskStatusIcon:y2,taskTitle:b2,workspaceBadge:x2,childCountBadge:_2,dependencyBadge:S2,blockedBadge:T2,addChildButton:k2,emptyState:C2,statusGroupHeader:E2,statusGroupIcon:N2,statusGroupLabel:A2,statusGroupCount:j2},w2=[{name:"title",weight:2},{name:"description",weight:1}],l_=16,D2=16,o_="grackle-task-group-by-status";function M0(){try{return localStorage.getItem(o_)==="true"}catch{return!1}}function M2(n){try{localStorage.setItem(o_,String(n))}catch{}}function R2({group:n,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:f,workspaceNames:u}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Me.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Me.expandArrow} ${a?Me.expanded:""}`,children:"▸"}),c.jsx("span",{className:Me.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Me.statusGroupLabel,children:n.label}),c.jsx("span",{className:Me.statusGroupCount,children:n.tasks.length})]}),c.jsx(qn,{children:a&&c.jsx(St.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=es(p.status),g=o===p.id,y=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(va(p.id)),className:`${Me.taskRow} ${g?Me.selected:""}`,style:{"--task-indent":`${l_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Me.leafSpacer}),c.jsx("span",{className:Me.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Me.taskTitle,title:p.title,children:c.jsx(i_,{text:p.title,indices:f.get(p.id),highlightClass:Me.searchHighlight})}),y&&c.jsx("span",{className:Me.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function r_({node:n,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:f,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=es(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(k=>u.get(k)!=="complete"),v=i.has(n.id),b=n.children.length>0,S=r===n.id,C=l_+a*D2,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>f(va(n.id)),className:`${Me.taskRow} ${S?Me.selected:""}`,style:{"--task-indent":`${C}px`},"data-task-id":n.id,children:[b&&c.jsx("span",{className:`${Me.expandArrow} ${v?Me.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),o(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),o(n.id))},children:"▸"}),!b&&c.jsx("span",{className:Me.leafSpacer}),c.jsx("span",{className:Me.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Me.taskTitle,title:n.title,children:c.jsx(i_,{text:n.title,indices:p.get(n.id),highlightClass:Me.searchHighlight})}),N&&c.jsx("span",{className:Me.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Me.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Me.dependencyBadge} ${y?Me.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<uw&&c.jsx("button",{onClick:k=>{k.stopPropagation(),f(Hi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Me.addChildButton,children:"+"})]}),c.jsx(qn,{children:b&&v&&c.jsx(St.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(k=>c.jsx(r_,{node:k,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:f,taskStatusById:u,titleHighlights:p,workspaceNames:m},k.id))})})]})}function O2(){const{workspaces:n,tasks:a}=at(),i=Ut(),[o,r]=_.useState(new Set),[f,u]=_.useState(new Set),[p,m]=_.useState(M0),[g,y]=_.useState(M0),[v,b]=_.useState(new Map),S=Nt("/tasks/:taskId/*"),C=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,E=_.useMemo(()=>new Map(a.map(W=>[W.id,W.status])),[a]),N=_.useMemo(()=>new Map(n.map(W=>[W.id,W.name])),[n]),k=()=>{const W=!p;M2(W),m(W),W&&(y(!0),b(new Map))},A=W=>{b(te=>{const B=new Map(te),q=B.has(W)?B.get(W):g;return B.set(W,!q),B})},M=W=>v.has(W)?v.get(W):g,D=W=>{r(te=>{const B=new Set(te);return B.has(W)?(B.delete(W),u(q=>new Set(q).add(W))):(B.add(W),u(q=>{const U=new Set(q);return U.delete(W),U})),B})};_.useEffect(()=>{const W=new Set(a.filter(te=>te.parentTaskId).map(te=>te.parentTaskId));W.size>0&&r(te=>{const B=new Set(te);for(const q of W)f.has(q)||B.add(q);return B})},[a,f]);const[z,Y]=_.useState(""),{directMatchTaskIds:R,treeMatchTaskIds:O,titleHighlights:G}=_.useMemo(()=>{if(!z.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const W=Xw(a,z,w2),te=new Set(W.map(re=>re.item.id)),B=new Map;for(const re of W){const I=re.matches.find(ie=>ie.key==="title");I&&B.set(re.item.id,I.indices)}const q=new Set(te),U=new Map(a.map(re=>[re.id,re]));for(const re of[...te]){let I=U.get(re);for(;I!=null&&I.parentTaskId;)q.add(I.parentTaskId),I=U.get(I.parentTaskId)}return{directMatchTaskIds:te,treeMatchTaskIds:q,titleHighlights:B}},[z,a]),ee=R!==null,ne=ee?p?R:O:null,ae=ne?a.filter(W=>ne.has(W.id)):a,oe=p?[]:a2(ae);return c.jsxs("div",{className:Me.container,children:[c.jsxs("div",{className:Me.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Me.headerActions,children:[c.jsx("button",{className:`${Me.groupToggle} ${p?Me.groupToggleActive:""}`,onClick:k,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Me.addButton,onClick:()=>i(Hi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:z,onChange:W=>Y(W.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Me.searchInput,"data-testid":"sidebar-search"}),p?s2(ae,E).map(W=>c.jsx(R2,{group:W,isExpanded:M(W.status),onToggle:()=>A(W.status),selectedTaskId:C,navigate:i,titleHighlights:G,workspaceNames:N},W.status)):oe.map(W=>c.jsx(r_,{node:W,depth:0,expandedTasks:o,toggleTask:D,selectedTaskId:C,navigate:i,taskStatusById:E,titleHighlights:G,workspaceNames:N},W.id)),ae.length===0&&!ee&&c.jsx("div",{className:Me.emptyState,children:"No tasks yet. Click + to create one."}),ae.length===0&&ee&&c.jsx("div",{className:Me.emptyState,children:"No matching tasks"})]})}const B2="_nav_14i94_1",I2="_tab_14i94_24",L2="_tabActive_14i94_62",z2="_tabLabel_14i94_75",U2="_statusDot_14i94_81",V2="_pulse_14i94_87",H2="_addButton_14i94_99",G2="_empty_14i94_132",qa={nav:B2,tab:I2,tabActive:L2,tabLabel:z2,statusDot:U2,pulse:V2,addButton:H2,empty:G2},P2={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function $2(){const{environments:n}=at(),a=Ut(),i=_.useRef(null),o=Nt("/environments/:environmentId"),r=Nt("/environments/:environmentId/edit"),f=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId),u=f==="new"?void 0:f,p=_.useCallback(y=>{a(yf(y))},[a]),m=_.useCallback(y=>{var E;const v=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!v||v.length===0)return;const b=Array.from(v).findIndex(N=>N===document.activeElement),S=b>=0?b:n.findIndex(N=>N.id===u);let C=S;if(y.key==="ArrowDown")y.preventDefault(),C=(S+1)%v.length;else if(y.key==="ArrowUp")y.preventDefault(),C=(S-1+v.length)%v.length;else if(y.key==="Home")y.preventDefault(),C=0;else if(y.key==="End")y.preventDefault(),C=v.length-1;else return;C<n.length&&a(yf(n[C].id)),v[C].focus()},[u,n,a]),g=u??(n.length>0?n[0].id:void 0);return c.jsxs("div",{className:qa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:m,children:n.map(y=>{const v=y.id===u,b=y.id===g,S=P2[y.status]||"var(--text-tertiary)",C=y.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":v,tabIndex:b?0:-1,className:`${qa.tab} ${v?qa.tabActive:""}`,onClick:()=>p(y.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${qa.statusDot} ${C?qa.pulse:""}`,style:{color:S},children:"●"}),c.jsx("span",{className:qa.tabLabel,title:y.displayName||y.id,children:y.displayName||y.id})]},y.id)})}),c.jsx("button",{type:"button",className:qa.addButton,onClick:()=>a(Vk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&c.jsx("div",{className:qa.empty,children:"No environments yet."})]})}const F2="_nav_1bhou_1",q2="_tab_1bhou_24",Y2="_tabIcon_1bhou_62",K2="_tabActive_1bhou_68",Fr={nav:F2,tab:q2,tabIcon:Y2,tabActive:K2},ha=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function Z2(){var u;const n=At(),a=Ut(),i=_.useRef(null),o=((u=ha.find(p=>n.pathname===`${Ql}/${p.path}`))==null?void 0:u.path)??ha[0].path,r=_.useCallback(p=>{a(`${Ql}/${p}`)},[a]),f=_.useCallback(p=>{var S,C;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(E=>E===document.activeElement),y=g>=0?g:ha.findIndex(E=>E.path===o);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%ha.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+ha.length)%ha.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=ha.length-1;else return;const b=ha[v].path;a(`${Ql}/${b}`),(C=m[v])==null||C.focus()},[o,a]);return c.jsx("nav",{className:Fr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:f,children:ha.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Fr.tab} ${m?Fr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Fr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const X2="_container_pi6ii_1",Q2="_content_pi6ii_66",R0={container:X2,content:Q2},W2=320,c_=220,u_=600,d_="grackle-sidebar-width";function J2(){try{const n=localStorage.getItem(d_);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=c_&&a<=u_)return a}}catch{}return W2}function eD(n){try{localStorage.setItem(d_,String(n))}catch{}}function tD(){const[n]=_.useState(J2),a=_.useRef(null),i=At(),o=xb(i.pathname);return _.useEffect(()=>{const r=a.current;if(!r)return;const f=new ResizeObserver(u=>{for(const p of u){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=c_&&g<=u_&&eD(g)}}});return f.observe(r),()=>{f.disconnect()}},[]),c.jsx("div",{className:R0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsxs("div",{className:R0.content,children:[o==="tasks"&&c.jsx(O2,{}),o==="environments"&&c.jsx($2,{}),o==="settings"&&c.jsx(Z2,{})]})})}const nD="_bar_tnfsh_1",aD="_btnPrimary_tnfsh_32",sD="_statusText_tnfsh_85",iD="_statusCompleted_tnfsh_90",lD="_statusFailed_tnfsh_94",oD="_statusBlocked_tnfsh_98",rD="_hintText_tnfsh_103",it={bar:nD,btnPrimary:aD,statusText:sD,statusCompleted:iD,statusFailed:lD,statusBlocked:oD,hintText:rD};function cD(){const{sessions:n,tasks:a,environments:i}=at(),o=Ut(),r=At(),f=Nt("/sessions/:sessionId"),u=Nt("/tasks/:taskId"),p=Nt("/tasks/:taskId/stream"),m=Nt("/tasks/:taskId/findings"),g=Nt("/tasks/:taskId/edit"),y=Nt("/workspaces/:workspaceId/tasks/:taskId"),v=Nt("/workspaces/:workspaceId/tasks/:taskId/stream"),b=Nt("/workspaces/:workspaceId/tasks/:taskId/findings"),S=Nt("/workspaces/:workspaceId/tasks/:taskId/edit"),C=Nt("/sessions/new"),E=r.pathname.startsWith("/environments"),N=Nt("/workspaces/:workspaceId"),k=Nt("/tasks/new"),A=Nt("/chat"),M=Nt("/"),D=Nt("/settings/*"),z=f==null?void 0:f.params.sessionId,Y=(u==null?void 0:u.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(y==null?void 0:y.params.taskId)??(v==null?void 0:v.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),R=!!A,O=!!C,G=!!N&&!y&&!v&&!b&&!S,ee=!!k;if(!!M&&!O&&!G&&!ee||!!D||(!!g||!!S)||ee||E||O)return c.jsx(c.Fragment,{});if(R)return i.find(te=>te.adapterType==="local"&&te.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Add a local environment to start chatting"})});if(G)return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Select a task or click + to create one"})});if(Y){const W=a.find(q=>q.id===Y);if(!W)return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Loading..."})});const te=new Map(a.map(q=>[q.id,q])),B=W.dependsOn.some(q=>{const U=te.get(q);return U!==void 0&&U.status!=="complete"});if(W.status==="not_started"){const q=B?W.dependsOn.map(U=>te.get(U)).filter(U=>U&&U.status!=="complete").map(U=>U.title):[];return c.jsx("div",{className:it.bar,children:B?c.jsxs("span",{className:it.statusBlocked,children:["Blocked by: ",q.join(", ")]}):c.jsx("span",{className:it.hintText,children:"Use the buttons above to start or manage this task"})})}if(W.status==="working"||W.status==="paused"){const q=W.latestSessionId||void 0,U=q?n.find(I=>I.id===q):void 0;return U&&!["completed","failed","interrupted","hibernating"].includes(U.status)?c.jsx(c.Fragment,{}):c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Waiting for agent..."})})}if(W.status==="complete")return c.jsxs("div",{className:it.bar,children:[c.jsx("span",{className:`${it.statusText} ${it.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Hi(W.workspaceId)),className:it.btnPrimary,children:"+ New Task"})]});if(W.status==="failed")return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:`${it.statusText} ${it.statusFailed}`,children:"Task failed"})})}if(z){const W=n.find(q=>q.id===z),te=W!==void 0&&["completed","failed","interrupted","hibernating"].includes(W.status);if(W!==void 0&&!te)return c.jsx(c.Fragment,{});if(te)return c.jsxs("div",{className:it.bar,children:[c.jsxs("span",{className:`${it.statusText} ${it.hintText}`,children:["Session ",W.status]}),c.jsx("button",{onClick:()=>o(fb(W.environmentId)),className:it.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:it.bar,children:c.jsx("span",{className:it.hintText,children:"Loading..."})})}const uD="_toast_da8ll_1",dD="_success_da8ll_18",fD="_icon_da8ll_22",hD="_error_da8ll_25",pD="_warning_da8ll_32",mD="_info_da8ll_38",gD="_message_da8ll_53",vD="_close_da8ll_60",$l={toast:uD,success:dD,icon:fD,error:hD,warning:pD,info:mD,message:gD,close:vD},yD={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function bD({toast:n,onDismiss:a}){return _.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(St.div,{className:`${$l.toast} ${$l[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:$l.icon,"aria-hidden":"true",children:yD[n.variant]}),c.jsx("span",{className:$l.message,children:n.message}),c.jsx("button",{type:"button",className:$l.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const xD="_container_qqse2_1",_D={container:xD};function SD(){const{toasts:n,dismissToast:a}=Gi();return c.jsx("div",{className:_D.container,"data-testid":"toast-container",children:c.jsx(qn,{children:n.map(i=>c.jsx(bD,{toast:i,onDismiss:a},i.id))})})}const TD="_breadcrumbs_17or2_1",kD="_list_17or2_11",CD="_item_17or2_21",ED="_separator_17or2_28",ND="_link_17or2_34",AD="_current_17or2_57",ki={breadcrumbs:TD,list:kD,item:CD,separator:ED,link:ND,current:AD},jD="›";function qi({segments:n}){return c.jsx("nav",{className:ki.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:ki.list,children:n.map((a,i)=>{const o=i===n.length-1;return c.jsxs("li",{className:ki.item,children:[i>0&&c.jsx("span",{className:ki.separator,"aria-hidden":"true",children:jD}),a.url&&!o?c.jsx(nh,{className:ki.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:ki.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Ff(){Ff=function(r,f){return new i(r,void 0,f)};var n=RegExp.prototype,a=new WeakMap;function i(r,f,u){var p=new RegExp(r,f);return a.set(p,u||a.get(r)),pc(p,i.prototype)}function o(r,f){var u=a.get(f);return Object.keys(u).reduce(function(p,m){var g=u[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(f&&f.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),f&&pc(r,f)})(i,RegExp),i.prototype.exec=function(r){var f=n.exec.call(this,r);if(f){f.groups=o(f,this);var u=f.indices;u&&(u.groups=o(u,this))}return f},i.prototype[Symbol.replace]=function(r,f){if(typeof f=="string"){var u=a.get(this);return n[Symbol.replace].call(this,r,f.replace(/\$<([^>]+)>/g,function(m,g){var y=u[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof f=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),f.apply(this,m)})}return n[Symbol.replace].call(this,r,f)},Ff.apply(this,arguments)}function pc(n,a){return pc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},pc(n,a)}function O0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=n[i];return o}function uf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(r,f){if(r){if(typeof r=="string")return O0(r,f);var u=Object.prototype.toString.call(r).slice(8,-1);return u==="Object"&&r.constructor&&(u=r.constructor.name),u==="Map"||u==="Set"?Array.from(r):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?O0(r,f):void 0}})(n))||a){i&&(n=i);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
87
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var wD=(function(n){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){MS(o,"element",i)};function i(o,r,f){var u,p;if(f&&f.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(u=o.data)==null?void 0:u.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,y,v=(function(z){for(var Y,R=uf(z.properties.className);!(Y=R()).done;){var O=Y.value;if(O.slice(0,9)==="language-")return O.slice(9).toLowerCase()}return null})(o);if(!v&&a.defaultLanguage&&o.properties.className.push("language-"+(v=a.defaultLanguage)),o.properties.className.push("code-highlight"),v)try{var b,S;S=(b=v)!=null&&b.includes("diff-")?v.split("-")[1]:v,g=n.highlight(zr(o),S),f.properties.className=(f.properties.className||[]).concat("language-"+S)}catch(z){if(!a.ignoreMissing||!/Unknown language/.test(z.message))throw z;g=o}else g=o;g.children=(y=1,function z(Y){return Y.reduce(function(R,O){if(O.type==="text"){var G=O.value,ee=(G.match(/\n/g)||"").length;if(ee===0)O.position={start:{line:y,column:1},end:{line:y,column:1}},R.push(O);else for(var ne,ae=G.split(`
|
|
88
|
+
`),oe=uf(ae.entries());!(ne=oe()).done;){var W=ne.value,te=W[0],B=W[1];R.push({type:"text",value:te===ae.length-1?B:B+`
|
|
89
|
+
`,position:{start:{line:y+te,column:1},end:{line:y+te,column:1}}})}return y+=ee,R}if(Object.prototype.hasOwnProperty.call(O,"children")){var q=y;return O.children=z(O.children),R.push(O),O.position={start:{line:q,column:1},end:{line:y,column:1}},R}return R.push(O),R},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var C,E=(function(z){var Y=/{([\d,-]+)}/,R=z.split(",").map(function(ee){return ee.trim()}).join();if(Y.test(R)){var O=Y.exec(R)[1],G=OS(O);return function(ee){return G.includes(ee+1)}}return function(){return!1}})(m),N=(function(z){var Y=Ff(/showLineNumbers=(\d+)/i,{lines:1});if(Y.test(z)){var R=Y.exec(z);return Number(R.groups.lines)}return 1})(m),k=(function(z){for(var Y=new Array(z),R=0;R<z;R++)Y[R]={type:"element",tagName:"span",properties:{className:[]},children:[]};return Y})(g.position.end.line),A=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],M=function(){var z,Y,R=C.value,O=R[0],G=R[1];G.properties.className=["code-line"];var ee=BS(g,function(ne){return ne.position.start.line<=O+1&&ne.position.end.line>=O+1});G.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!A.some(function(ne){return m.toLowerCase().includes(ne)})&&(G.properties.line=[(O+N).toString()],G.properties.className.push("line-number")),E(O)&&G.properties.className.push("highlight-line"),(v==="diff"||(z=v)!=null&&z.includes("diff-"))&&zr(G).substring(0,1)==="-"?G.properties.className.push("deleted"):(v==="diff"||(Y=v)!=null&&Y.includes("diff-"))&&zr(G).substring(0,1)==="+"&&G.properties.className.push("inserted")},D=uf(k.entries());!(C=D()).done;)M();k.length>0&&zr(k[k.length-1]).trim()===""&&k.pop(),o.children=k}}}})(RS);const DD="_systemContextEvent_5vmgk_1",MD="_systemContextHeader_5vmgk_7",RD="_systemContextBadge_5vmgk_28",OD="_systemContextToggle_5vmgk_37",BD="_systemContextPre_5vmgk_43",ID="_systemContextEllipsis_5vmgk_54",LD="_systemEvent_5vmgk_58",zD="_systemTimestamp_5vmgk_65",UD="_textEvent_5vmgk_69",VD="_toolUseEvent_5vmgk_155",HD="_toolUseHeader_5vmgk_175",GD="_toolUsePrefix_5vmgk_182",PD="_toolUseName_5vmgk_187",$D="_toolUseArgs_5vmgk_192",FD="_toolResultEvent_5vmgk_203",qD="_toolResultHeader_5vmgk_208",YD="_toolResultIndicatorOk_5vmgk_232",KD="_toolResultIndicatorError_5vmgk_239",ZD="_toolResultLabel_5vmgk_246",XD="_toolResultToggle_5vmgk_250",QD="_toolResultCommand_5vmgk_256",WD="_toolResultEllipsis_5vmgk_266",JD="_toolResultPre_5vmgk_270",eM="_errorEvent_5vmgk_291",tM="_statusEvent_5vmgk_299",nM="_userInputEvent_5vmgk_308",aM="_userInputContent_5vmgk_314",sM="_signalEvent_5vmgk_331",iM="_signalBadge_5vmgk_342",lM="_signalContent_5vmgk_351",oM="_defaultEvent_5vmgk_356",ze={systemContextEvent:DD,systemContextHeader:MD,systemContextBadge:RD,systemContextToggle:OD,systemContextPre:BD,systemContextEllipsis:ID,systemEvent:LD,systemTimestamp:zD,textEvent:UD,toolUseEvent:VD,toolUseHeader:HD,toolUsePrefix:GD,toolUseName:PD,toolUseArgs:$D,toolResultEvent:FD,toolResultHeader:qD,toolResultIndicatorOk:YD,toolResultIndicatorError:KD,toolResultLabel:ZD,toolResultToggle:XD,toolResultCommand:QD,toolResultEllipsis:WD,toolResultPre:JD,errorEvent:eM,statusEvent:tM,userInputEvent:nM,userInputContent:aM,signalEvent:sM,signalBadge:iM,signalContent:lM,defaultEvent:oM},B0=3;function rM({content:n}){const[a,i]=_.useState(!1),o=n.split(`
|
|
90
|
+
`),r=o.length>B0,f=a?n:o.slice(0,B0).join(`
|
|
91
|
+
`);return c.jsxs("div",{className:ze.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:ze.systemContextHeader,onClick:()=>{i(u=>!u)},"aria-expanded":a,children:[c.jsx("span",{className:ze.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:ze.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:ze.systemContextPre,children:[f,!a&&r&&c.jsx("span",{className:ze.systemContextEllipsis,children:"…"})]})]})}function cM({time:n,content:a}){return c.jsxs("div",{className:ze.systemEvent,children:[c.jsxs("span",{className:ze.systemTimestamp,children:["[",n,"]"]})," ",a]})}function uM({content:n}){return c.jsx("div",{className:ze.textEvent,children:c.jsx(Yf,{remarkPlugins:[Kf],rehypePlugins:[wD],children:n})})}function dM({content:n}){let a="",i=n;try{const o=JSON.parse(n);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:ze.toolUseEvent,children:[c.jsxs("div",{className:ze.toolUseHeader,children:[c.jsx("span",{className:ze.toolUsePrefix,children:">"}),a?c.jsx("span",{className:ze.toolUseName,children:a}):null]}),c.jsx("pre",{className:ze.toolUseArgs,children:i})]})}const I0=5;function fM(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function hM({content:n,raw:a,toolUseCtx:i}){const[o,r]=_.useState(!1);let f=!1;if(a)try{f=JSON.parse(a).is_error===!0}catch{}const u=n.split(`
|
|
92
|
+
`),p=u.length>I0,m=o?n:u.slice(0,I0).join(`
|
|
93
|
+
`),y=((i==null?void 0:i.tool)??"")||(f?"Tool error":"Tool output"),v=i?fM(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:f?ze.toolResultIndicatorError:ze.toolResultIndicatorOk,"aria-label":f?"error":"success","data-testid":f?"tool-result-indicator-error":"tool-result-indicator-ok",children:f?"✗":"✓"}),c.jsx("span",{className:ze.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:ze.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:ze.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:ze.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:b}):c.jsx("div",{className:ze.toolResultHeader,"data-testid":"tool-result-header",children:b}),v&&c.jsx("div",{className:ze.toolResultCommand,children:v}),c.jsxs("pre",{className:ze.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:ze.toolResultEllipsis,children:"…"})]})]})}function pM({content:n}){return c.jsxs("div",{className:ze.errorEvent,children:["Error: ",n]})}function mM({content:n}){return c.jsxs("div",{className:ze.statusEvent,children:["--- ",n," ---"]})}function gM({content:n}){return c.jsx("div",{className:ze.userInputEvent,children:c.jsx("span",{className:ze.userInputContent,children:n})})}function vM({content:n}){return c.jsxs("div",{className:ze.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:ze.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:ze.signalContent,children:n})]})}function yM({content:n}){return c.jsx("div",{className:ze.defaultEvent,children:n})}function bM({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return c.jsx(rM,{content:n.content})}catch{}return c.jsx(cM,{time:i,content:n.content})}case"text":case"output":return c.jsx(uM,{content:n.content});case"tool_use":return c.jsx(dM,{content:n.content});case"tool_result":return c.jsx(hM,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(pM,{content:n.content});case"status":return c.jsx(mM,{content:n.content});case"user_input":return c.jsx(gM,{content:n.content});case"signal":return c.jsx(vM,{content:n.content});default:return c.jsx(yM,{content:n.content})}}const xM="_overlay_cmicx_1",_M="_dialog_cmicx_11",SM="_title_cmicx_30",TM="_description_cmicx_38",kM="_actions_cmicx_45",CM="_cancelButton_cmicx_52",EM="_confirmButton_cmicx_79",Ts={overlay:xM,dialog:_M,title:SM,description:TM,actions:kM,cancelButton:CM,confirmButton:EM};function Ec({isOpen:n,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:f}){const u=_.useId(),p=_.useId();return c.jsx(qn,{children:n&&c.jsx(St.div,{className:Ts.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:f,onKeyDown:m=>{m.key==="Escape"&&f()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":i?p:void 0,children:c.jsxs(St.div,{className:Ts.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[c.jsx("h3",{id:u,className:Ts.title,children:a}),i&&c.jsx("p",{id:p,className:Ts.description,children:i}),c.jsxs("div",{className:Ts.actions,children:[c.jsx("button",{type:"button",className:Ts.cancelButton,onClick:f,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Ts.confirmButton,onClick:r,children:o})]})]})})})}const NM="_spinner_1uyt1_1",AM="_spin_1uyt1_1",jM="_sm_1uyt1_14",wM="_md_1uyt1_20",DM="_lg_1uyt1_26",MM="_xl_1uyt1_32",L0={spinner:NM,spin:AM,sm:jM,md:wM,lg:DM,xl:MM};function Hh({size:n="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${L0.spinner} ${L0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const RM="_splash_1bn1g_1",OM="_logo_1bn1g_11",z0={splash:RM,logo:OM};function BM(){return c.jsxs("div",{className:z0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:z0.logo}),c.jsx(Hh,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function IM(n,a){const i=_.useRef(null);_.useEffect(()=>{const o=i.current;if(i.current=n,o===null)return;const r=new Map;for(const u of o)r.set(u.id,u);const f=new Set;for(const u of n){f.add(u.id);const p=r.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){a("Provisioning environment…","info");continue}u.status==="connected"?a("Environment connected","success"):u.status==="error"?a("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const u of o)f.has(u.id)||a("Environment removed","info")},[n,a])}function LM(n,a,i){const o=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=f_(a),f=a.filter(m=>qf(m,r)).length,u=a.filter(m=>m.status==="paused"||m.status==="failed"||qf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:f,attentionTasks:u,unhealthyEnvironments:p}}function f_(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function qf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function zM(n,a){var u;const i=new Map;for(const p of a)i.set(p.id,p);const o=f_(n),r=[];for(const p of n){const m=p.workspaceId?((u=i.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):qf(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const f={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(f[p.reason]??3)-(f[m.reason]??3)),r}function UM(n,a){const i=new Map;for(const o of a)i.set(o.id,o);return n.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function VM(n,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let f=o.get(r.workspaceId);f||(f={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,f)),f.totalTasks+=1,r.status==="complete"?f.completedTasks+=1:r.status==="working"?f.workingTasks+=1:r.status==="failed"&&(f.failedTasks+=1)}return n.map(r=>{const f=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:f.totalTasks,completedTasks:f.completedTasks,workingTasks:f.workingTasks,failedTasks:f.failedTasks}})}const HM="_dashboard_1avpn_1",GM="_kpiStrip_1avpn_11",PM="_kpiCard_1avpn_23",$M="_kpiValue_1avpn_68",FM="_kpiLabel_1avpn_76",qM="_bodyGrid_1avpn_84",YM="_section_1avpn_96",KM="_sectionHeader_1avpn_109",ZM="_sectionIcon_1avpn_118",XM="_sectionTitle_1avpn_123",QM="_sectionCount_1avpn_131",WM="_sectionBody_1avpn_138",JM="_emptyHint_1avpn_143",eR="_sessionRow_1avpn_150",tR="_sessionPrompt_1avpn_177",nR="_sessionEnv_1avpn_186",aR="_sessionRuntime_1avpn_192",sR="_sessionStatus_1avpn_198",iR="_statusDot_1avpn_207",lR="_attentionRow_1avpn_229",oR="_attentionTitle_1avpn_255",rR="_attentionMeta_1avpn_263",cR="_reasonBadge_1avpn_270",uR="_bottomGrid_1avpn_297",dR="_envRow_1avpn_308",fR="_envName_1avpn_319",hR="_envStatusBadge_1avpn_329",pR="_workspaceRow_1avpn_365",mR="_workspaceTop_1avpn_391",gR="_workspaceName_1avpn_397",vR="_workspaceCounts_1avpn_403",yR="_progressBar_1avpn_411",bR="_progressFill_1avpn_418",me={dashboard:HM,kpiStrip:GM,kpiCard:PM,kpiValue:$M,kpiLabel:FM,bodyGrid:qM,section:YM,sectionHeader:KM,sectionIcon:ZM,sectionTitle:XM,sectionCount:QM,sectionBody:WM,emptyHint:JM,sessionRow:eR,sessionPrompt:tR,sessionEnv:nR,sessionRuntime:aR,sessionStatus:sR,statusDot:iR,attentionRow:lR,attentionTitle:oR,attentionMeta:rR,reasonBadge:cR,bottomGrid:uR,envRow:dR,envName:fR,envStatusBadge:hR,workspaceRow:pR,workspaceTop:mR,workspaceName:gR,workspaceCounts:vR,progressBar:yR,progressFill:bR},xR={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},qr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function _R(n,a,i,o){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function Yr({value:n,label:a,accent:i,index:o,testId:r}){return c.jsxs(St.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:xR,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:n}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function SR(){const{workspaces:n,tasks:a,sessions:i,environments:o,loadTasks:r}=at(),f=Ut(),u=_.useRef(new Set);_.useEffect(()=>{for(const v of n)u.current.has(v.id)||(u.current.add(v.id),r(v.id))},[n,r]);const p=_.useMemo(()=>LM(i,a,o),[i,a,o]),m=_.useMemo(()=>UM(i,o),[i,o]),g=_.useMemo(()=>zM(a,n),[a,n]),y=_.useMemo(()=>VM(n,a),[n,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(Yr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(Yr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(Yr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(Yr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(St.div,{className:me.section,variants:qr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:v,environmentName:b})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>f(db(v.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:b}),c.jsx("span",{className:me.sessionRuntime,children:v.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),c.jsxs(St.div,{className:me.section,variants:qr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:v,reason:b,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>f(va(v.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":b,children:b}),v.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},v.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(St.div,{className:me.section,variants:qr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(v=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:v.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),c.jsxs(St.div,{className:me.section,variants:qr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:n.length})]}),c.jsx("div",{className:me.sectionBody,children:y.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:b,completedTasks:S,workingTasks:C,failedTasks:E})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>f(Ri(v.id)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:v.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":_R(S,b,C,E),children:[S,"/",b,C>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",C]}),E>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",E]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},v.id)})})]})]})]})}const TR="_panelContainer_aei9x_1",kR="_emptyState_aei9x_8",CR="_fadeIn_aei9x_1",ER="_workspaceSummary_aei9x_17",NR="_workspaceSummaryTitle_aei9x_28",AR="_workspaceSummarySubtitle_aei9x_32",jR="_header_aei9x_36",wR="_headerInfo_aei9x_69",DR="_killButton_aei9x_75",MR="_headerTitle_aei9x_104",RR="_headerActions_aei9x_119",OR="_taskStatusBadge_aei9x_126",BR="_taskBranch_aei9x_135",IR="_taskBlockedBadge_aei9x_141",LR="_btnPrimary_aei9x_149",zR="_btnDanger_aei9x_180",UR="_btnGhost_aei9x_219",VR="_rejectInput_aei9x_245",HR="_tabBar_aei9x_275",GR="_tab_aei9x_275",PR="_active_aei9x_301",$R="_eventScroll_aei9x_306",FR="_tabContent_aei9x_312",qR="_noContext_aei9x_317",YR="_overviewContent_aei9x_323",KR="_overviewDashboard_aei9x_332",ZR="_overviewHero_aei9x_338",XR="_statusBadge_aei9x_345",QR="_statusPending_aei9x_357",WR="_statusAssigned_aei9x_362",JR="_statusInProgress_aei9x_367",e3="_statusReview_aei9x_372",t3="_statusDone_aei9x_377",n3="_statusFailed_aei9x_382",a3="_statusWaitingInput_aei9x_387",s3="_overviewBranchPill_aei9x_392",i3="_branchLink_aei9x_407",l3="_overviewSection_aei9x_418",o3="_overviewLabel_aei9x_424",r3="_overviewValue_aei9x_431",c3="_overviewMuted_aei9x_436",u3="_overviewMarkdown_aei9x_442",d3="_envRow_aei9x_511",f3="_envDot_aei9x_517",h3="_envDotGreen_aei9x_524",p3="_envDotYellow_aei9x_528",m3="_envDotRed_aei9x_532",g3="_envDotGray_aei9x_536",v3="_depList_aei9x_540",y3="_depItem_aei9x_546",b3="_depBlocked_aei9x_553",x3="_depDone_aei9x_557",_3="_timeline_aei9x_561",S3="_timelineRow_aei9x_567",T3="_timelineKey_aei9x_574",k3="_timelineValue_aei9x_580",C3="_timelineDelta_aei9x_584",E3="_reviewNotes_aei9x_595",N3="_overviewDescription_aei9x_606",A3="_waitingMessage_aei9x_612",j3="_errorMessage_aei9x_616",w3="_eventOverflowWarning_aei9x_620",D3="_attemptSelector_aei9x_634",M3="_attemptLabel_aei9x_650",R3="_attemptButton_aei9x_654",O3="_attemptActive_aei9x_671",B3="_attemptStatus_aei9x_677",I3="_emptyCta_aei9x_683",L3="_ctaTitle_aei9x_695",z3="_ctaDescription_aei9x_701",U3="_ctaButton_aei9x_708",V3="_ctaCreateForm_aei9x_743",H3="_ctaCreateInput_aei9x_749",G3="_ctaCreateOk_aei9x_780",P3="_ctaLink_aei9x_815",$3="_workspaceHeader_aei9x_829",F3="_workspaceName_aei9x_854",q3="_workspaceMeta_aei9x_867",Y3="_metaRow_aei9x_875",K3="_metaLabel_aei9x_888",Z3="_metaValue_aei9x_903",X3="_archiveButton_aei9x_913",Q3="_repoLink_aei9x_943",W3="_metaToggle_aei9x_953",J3="_metaToggleArrow_aei9x_974",eO="_metaToggleArrowOpen_aei9x_979",tO="_progressBarContainer_aei9x_983",nO="_progressBar_aei9x_983",aO="_progressFill_aei9x_999",sO="_progressLabel_aei9x_1006",iO="_metaTimestamps_aei9x_1013",lO="_metaTimestamp_aei9x_1013",V={panelContainer:TR,emptyState:kR,fadeIn:CR,workspaceSummary:ER,workspaceSummaryTitle:NR,workspaceSummarySubtitle:AR,header:jR,headerInfo:wR,killButton:DR,headerTitle:MR,headerActions:RR,taskStatusBadge:OR,taskBranch:BR,taskBlockedBadge:IR,btnPrimary:LR,btnDanger:zR,btnGhost:UR,rejectInput:VR,tabBar:HR,tab:GR,active:PR,eventScroll:$R,tabContent:FR,noContext:qR,overviewContent:YR,overviewDashboard:KR,overviewHero:ZR,statusBadge:XR,statusPending:QR,statusAssigned:WR,statusInProgress:JR,statusReview:e3,statusDone:t3,statusFailed:n3,statusWaitingInput:a3,overviewBranchPill:s3,branchLink:i3,overviewSection:l3,overviewLabel:o3,overviewValue:r3,overviewMuted:c3,overviewMarkdown:u3,envRow:d3,envDot:f3,envDotGreen:h3,envDotYellow:p3,envDotRed:m3,envDotGray:g3,depList:v3,depItem:y3,depBlocked:b3,depDone:x3,timeline:_3,timelineRow:S3,timelineKey:T3,timelineValue:k3,timelineDelta:C3,reviewNotes:E3,overviewDescription:N3,waitingMessage:A3,errorMessage:j3,eventOverflowWarning:w3,attemptSelector:D3,attemptLabel:M3,attemptButton:R3,attemptActive:O3,attemptStatus:B3,emptyCta:I3,ctaTitle:L3,ctaDescription:z3,ctaButton:U3,ctaCreateForm:V3,ctaCreateInput:H3,ctaCreateOk:G3,ctaLink:P3,workspaceHeader:$3,workspaceName:F3,workspaceMeta:q3,metaRow:Y3,metaLabel:K3,metaValue:Z3,archiveButton:X3,repoLink:Q3,metaToggle:W3,metaToggleArrow:J3,metaToggleArrowOpen:eO,progressBarContainer:tO,progressBar:nO,progressFill:aO,progressLabel:sO,metaTimestamps:iO,metaTimestamp:lO};function oO(){return c.jsx("div",{className:V.emptyState,children:"Select a task or click + to create one"})}function rO(){return c.jsx("div",{className:V.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function cO(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:o}=at(),[r,f]=_.useState(!1),[u,p]=_.useState(""),m=a.length>0,g=()=>{!u.trim()||o||!m||i(u.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(SR,{}):c.jsxs("div",{className:V.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:V.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:V.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:V.ctaCreateForm,children:[c.jsx("input",{type:"text",value:u,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(f(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:o,className:V.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:V.ctaCreateOk,disabled:o,"aria-label":o?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:o?c.jsx(Hh,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:V.ctaButton,onClick:()=>f(!0),disabled:o||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:V.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const h_=50;function uO(n,a,i,o,r=h_){return o?n<r:a-n-i<r}function dO(n,a){const i=a-n;return i>0?i:0}function fO({scrollRef:n,contentLength:a,isReversed:i}){const[o,r]=_.useState(!0),f=_.useRef(0),u=_.useRef(!1),p=_.useRef(0);_.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=uO(g.scrollTop,g.scrollHeight,g.clientHeight,i,h_);b!==y&&(y=b,r(b))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),_.useLayoutEffect(()=>{const g=n.current;!g||u.current||(u.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),_.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!o){const y=dO(f.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),f.current=g.scrollHeight}},[a,o,i,n]);const m=_.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:o,scrollToAnchor:m}}const hO="_wrapper_p24zt_1",pO="_scrollContainer_p24zt_9",mO="_toolbar_p24zt_15",gO="_directionToggle_p24zt_22",vO="_scrollToAnchor_p24zt_60",yO="_scrollToAnchorBottom_p24zt_84",bO="_scrollToAnchorTop_p24zt_88",ks={wrapper:hO,scrollContainer:pO,toolbar:mO,directionToggle:gO,scrollToAnchor:vO,scrollToAnchorBottom:yO,scrollToAnchorTop:bO},p_="grackle-stream-direction";function xO(){try{return localStorage.getItem(p_)==="reversed"}catch{return!1}}function _O({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.jsxs("div",{className:V.eventOverflowWarning,role:"alert",children:["⚠"," ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Gh({events:n,eventsDropped:a,emptyState:i}){const o=_.useRef(null),[r,f]=_.useState(xO),u=cw(),p=_.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=fO({scrollRef:o,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;f(S);try{localStorage.setItem(p_,S?"reversed":"default")}catch{}},v=u?0:.2,b=r?-8:8;return c.jsxs("div",{className:ks.wrapper,children:[c.jsx("div",{className:ks.toolbar,children:c.jsx("button",{className:ks.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:o,className:ks.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(_O,{eventsDropped:a}),c.jsx(qn,{initial:!1,children:p.map((S,C)=>{const E=r?n.length-1-C:C;return c.jsx(St.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(bM,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${E}`)})})]}),c.jsx(qn,{children:!m&&c.jsxs(St.button,{className:`${ks.scrollToAnchor} ${r?ks.scrollToAnchorTop:ks.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}const SO="_bar_1xhb4_1",TO="_input_1xhb4_32",kO="_select_1xhb4_67",CO="_btnPrimary_1xhb4_103",EO="_btnDanger_1xhb4_134",NO="_btnGhost_1xhb4_173",AO="_badge_1xhb4_195",jO="_disconnectHint_1xhb4_205",Wt={bar:SO,input:TO,select:kO,btnPrimary:CO,btnDanger:EO,btnGhost:NO,badge:AO,disconnectHint:jO};function wO(n,a){if(!n)return!1;const i=a.find(o=>o.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function DO({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Wt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:Wt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function po({mode:n,sessionId:a,environmentId:i,taskId:o,showStop:r,showPersonaSelect:f,onSessionKill:u}){const{sendInput:p,spawn:m,startTask:g,personas:y,environments:v,provisionEnvironment:b}=at(),{showToast:S}=Gi(),[C,E]=_.useState(""),[N,k]=_.useState(""),A=wO(i,v),M=D=>{if(D.preventDefault(),!!C.trim())if(n==="send"){if(!a||A)return;p(a,C),E("")}else if(n==="spawn"){if(!i)return;m(i,C,N),S("Session started","success"),E(""),k("")}else{if(!o)return;g(o,void 0,i,C),E("")}};return n==="spawn"?c.jsxs("form",{onSubmit:M,className:Wt.bar,children:[c.jsx("span",{className:Wt.badge,children:"new chat"}),c.jsx("input",{type:"text",value:C,onChange:D=>E(D.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Wt.input}),f&&c.jsxs("select",{value:N,onChange:D=>k(D.target.value),className:Wt.select,children:[c.jsx("option",{value:"",children:"(Default)"}),y.map(D=>c.jsx("option",{value:D.id,children:D.name},D.id))]}),c.jsx("button",{type:"submit",disabled:!C.trim()||!i,className:Wt.btnPrimary,children:"Go"})]}):n==="start"?c.jsxs("form",{onSubmit:M,className:Wt.bar,children:[c.jsx("input",{type:"text",value:C,onChange:D=>E(D.target.value),placeholder:"Type a message...",autoFocus:!0,className:Wt.input}),c.jsx("button",{type:"submit",disabled:!C.trim(),className:Wt.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:M,className:Wt.bar,children:[A&&i&&c.jsx(DO,{environmentId:i,onReconnect:b}),c.jsx("input",{type:"text",value:C,onChange:D=>E(D.target.value),placeholder:"Type a message...",autoFocus:!A,disabled:A,className:Wt.input}),c.jsx("span",{title:A?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!C.trim()||A,className:Wt.btnPrimary,children:"Send"})}),r&&u&&c.jsx("button",{type:"button",onClick:u,className:Wt.btnDanger,title:"Stop session",children:"Stop"})]})}function Ph(n){const a=[];for(const i of n){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function $h(n){const a=new Map;for(const f of n)if(f.raw)try{a.set(f,JSON.parse(f.raw))}catch{}const i=new Map;for(const f of n){if(f.eventType!=="tool_use")continue;const u=a.get(f);if(!(!u||typeof u.id!="string"))try{const p=JSON.parse(f.content);i.set(u.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return n.map(f=>{if(f.eventType!=="tool_result")return f;const u=a.get(f);if(!u||typeof u.tool_use_id!="string")return f;const p=i.get(u.tool_use_id);return p?(o.add(u.tool_use_id),{...f,toolUseCtx:p}):f}).filter(f=>{if(f.eventType!=="tool_use")return!0;const u=a.get(f);return u&&typeof u.id=="string"?!o.has(u.id):!0})}const MO="_panelContainer_pz4cr_1",RO="_emptyState_pz4cr_8",OO="_emptyTitle_pz4cr_20",BO="_emptyDescription_pz4cr_26",IO="_emptyHint_pz4cr_32",Xl={panelContainer:MO,emptyState:RO,emptyTitle:OO,emptyDescription:BO,emptyHint:IO};function LO({hasLocalEnvironment:n}){return c.jsxs("div",{className:Xl.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:Xl.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:Xl.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&c.jsx("div",{className:Xl.emptyHint,children:"Go to Settings → Environments to add one."})]})}function zO(){const{tasks:n,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:f,loadSessionEvents:u,kill:p,taskSessions:m}=at(),g=_.useRef(void 0),y=n.find(E=>E.id===Pl),v=y!=null&&y.latestSessionId?a.find(E=>E.id===y.latestSessionId)??(m[Pl]??[]).find(E=>E.id===y.latestSessionId):void 0;_.useEffect(()=>{f(Pl)},[f]),_.useEffect(()=>{y!=null&&y.latestSessionId&&f(Pl)},[y==null?void 0:y.latestSessionId,f]),_.useEffect(()=>{v&&v.id!==g.current&&(g.current=v.id,u(v.id))},[v==null?void 0:v.id,u]);const b=_.useMemo(()=>{if(!v)return[];const E=i.filter(N=>N.sessionId===v.id);return $h(Ph(E))},[i,v==null?void 0:v.id]),S=r.find(E=>E.adapterType==="local"&&E.status==="connected"),C=v!==void 0&&!["completed","failed","interrupted","hibernating"].includes(v.status);return c.jsxs("div",{className:Xl.panelContainer,"data-testid":"chat-page",children:[c.jsx(Gh,{events:b,eventsDropped:o,emptyState:c.jsx(LO,{hasLocalEnvironment:!!S})}),S&&C&&c.jsx(po,{mode:"send",sessionId:v.id,environmentId:v.environmentId,showStop:!0,onSessionKill:()=>p(v.id)}),S&&!C&&c.jsx(po,{mode:"start",taskId:Pl,environmentId:S.id})]})}function UO(n,a){const i=[];let o=n;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const f=a.get(o);i.unshift(f),o=f.parentTaskId||void 0}return i}const Li={label:"Home",url:vo};function VO(n){return n?[Li,{label:"Settings",url:Ql},{label:n,url:void 0}]:[Li,{label:"Settings",url:void 0}]}function HO(){return[Li,{label:"Environments",url:void 0}]}function GO(){return[Li,{label:"New Chat",url:void 0}]}function PO(n){return[Li,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function $O(n,a,i){const o=UO(n,i),r=i.get(n),f=r==null?void 0:r.workspaceId,u=f?a.find(g=>g.id===f):void 0,p=[Li];u&&p.push({label:u.name,url:Ri(u.id)});for(let g=0;g<o.length-1;g++)p.push({label:o[g].title,url:va(o[g].id)});const m=o[o.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function FO(){const n=GO(),[a]=ub(),i=a.get("env")??"";return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(qi,{segments:n}),c.jsx("div",{className:V.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(po,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function qO({sessionId:n,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:V.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),c.jsxs("span",{className:V.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(n),title:"Stop session",className:V.killButton,children:"×"})]})]})}function YO({session:n}){const a=n&&["completed","failed","interrupted"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?V.errorMessage:V.waitingMessage,children:i})}function KO(){const{sessionId:n}=Vi(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:f}=at(),u=_.useRef(void 0),p=PO(n),m=o.find(v=>v.id===n)??void 0,g=_.useMemo(()=>{const v=n?a.filter(b=>b.sessionId===n):[];return $h(Ph(v))},[a,n]);if(_.useEffect(()=>{n&&n!==u.current&&(u.current=n,f(n))},[n,f]),!n)return c.jsx("div",{className:V.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(qi,{segments:p}),c.jsx(qO,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx(Gh,{events:g,eventsDropped:i,emptyState:c.jsx(YO,{session:m})}),y&&c.jsx(po,{mode:"send",sessionId:n,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(n)})]})}const U0=220,V0=70,ZO=40,XO=60,QO="hierarchy",WO="dependency";function JO(n){return _.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Gv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:ZO,ranksep:XO});const i=new Map(n.map(u=>[u.id,u])),o=new Map;for(const u of n)if(u.parentTaskId&&i.has(u.parentTaskId)){const p=o.get(u.parentTaskId)||[];p.push(u),o.set(u.parentTaskId,p)}for(const u of n)a.setNode(u.id,{width:U0,height:V0});const r=[];for(const u of n){if(u.parentTaskId&&i.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;a.setEdge(u.parentTaskId,u.id,{},p),r.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:QO},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(i.has(p)){const m=`dependency-${p}-${u.id}`;a.setEdge(p,u.id,{},m),r.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:WO},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Gv.layout(a),{nodes:n.map(u=>{const p=a.node(u.id),m=o.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-U0/2,y:p.y-V0/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:r}},[n])}const eB="_dagContainer_js4w6_1",tB="_taskNode_js4w6_26",nB="_taskNodeBorder_js4w6_54",aB="_taskNodeContent_js4w6_60",sB="_taskNodeHeader_js4w6_70",iB="_taskNodeIcon_js4w6_77",lB="_taskNodeTitle_js4w6_82",oB="_taskNodeBadges_js4w6_90",rB="_childBadge_js4w6_95",cB="_depBadge_js4w6_107",uB="_handle_js4w6_119",dB="_emptyCta_js4w6_126",fB="_ctaDescription_js4w6_137",hB="_ctaButton_js4w6_144",Gt={dagContainer:eB,taskNode:tB,taskNodeBorder:nB,taskNodeContent:aB,taskNodeHeader:sB,taskNodeIcon:iB,taskNodeTitle:lB,taskNodeBadges:oB,childBadge:rB,depBadge:cB,handle:uB,emptyCta:dB,ctaDescription:fB,ctaButton:hB};function pB({data:n}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=n,f=es(a.status);return c.jsxs("div",{className:Gt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Pv,{type:"target",position:$v.Top,className:Gt.handle}),c.jsx("div",{className:Gt.taskNodeBorder,style:{backgroundColor:f.color}}),c.jsxs("div",{className:Gt.taskNodeContent,children:[c.jsxs("div",{className:Gt.taskNodeHeader,children:[c.jsx("span",{className:Gt.taskNodeIcon,style:{color:f.color},children:f.icon}),c.jsx("span",{className:Gt.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:Gt.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:Gt.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:Gt.depBadge,children:"dep"})]})]}),c.jsx(Pv,{type:"source",position:$v.Bottom,className:Gt.handle})]})}const mB=t2,gB={task:pB};function vB({workspaceId:n}){const{tasks:a}=at(),i=Ut(),{resolvedThemeId:o}=bb(),r=_.useMemo(()=>a.filter(y=>y.workspaceId===n),[a,n]),{nodes:f,edges:u}=JO(r),p=_.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[b,S]of Object.entries(mB))v[b]=y.getPropertyValue(S).trim()||"#6b7a8d";return v},[o]),m=_.useCallback((y,v)=>{i(va(v.id,void 0,n))},[i,n]),g=_.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?c.jsxs("div",{className:Gt.emptyCta,children:[c.jsx("button",{className:Gt.ctaButton,onClick:()=>i(Hi(n)),children:"Create Task"}),c.jsx("div",{className:Gt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:Gt.dagContainer,children:c.jsxs(LS,{nodes:f,edges:u,nodeTypes:gB,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(zS,{variant:US.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(VS,{showInteractive:!1}),c.jsx(HS,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function yB({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const f of n)if(f.parentTaskId){const u=o.get(f.parentTaskId);u?u.push(f):o.set(f.parentTaskId,[f])}const r=new Map(D0.map(f=>[f,[]]));for(const f of n){const u=Vh(f.status),p=f.dependsOn.length>0&&f.dependsOn.some(C=>a.get(C)!=="complete"),m=o.get(f.id)??[],g=m.length,y=m.filter(C=>C.status==="complete").length;let v;if(u==="paused"&&i){const C=i.get(f.id);C==="idle"?v="Needs input":C==="completed"&&(v="Ready to complete")}const b={task:f,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(u);S?S.push(b):r.get("not_started").push(b)}for(const f of r.values())f.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return D0.map(f=>{const u=es(f);return{status:f,label:u.label,style:u,tasks:r.get(f)??[]}})}const bB="_boardContainer_1c4y1_1",xB="_column_1c4y1_17",_B="_columnHeader_1c4y1_34",SB="_columnIcon_1c4y1_47",TB="_columnLabel_1c4y1_52",kB="_columnCount_1c4y1_57",CB="_cardList_1c4y1_67",EB="_emptyPlaceholder_1c4y1_76",NB="_card_1c4y1_67",AB="_cardHeader_1c4y1_107",jB="_cardStatusIcon_1c4y1_113",wB="_cardTitle_1c4y1_119",DB="_cardBadges_1c4y1_127",MB="_badge_1c4y1_134",RB="_blockedBadge_1c4y1_146",OB="_childBadge_1c4y1_151",BB="_depBadge_1c4y1_155",IB="_parentBadge_1c4y1_159",LB="_pausedSubBadge_1c4y1_166",zB="_personaBadge_1c4y1_170",UB="_envBadge_1c4y1_174",VB="_emptyCta_1c4y1_178",HB="_ctaButton_1c4y1_188",GB="_ctaDescription_1c4y1_204",Ge={boardContainer:bB,column:xB,columnHeader:_B,columnIcon:SB,columnLabel:TB,columnCount:kB,cardList:CB,emptyPlaceholder:EB,card:NB,cardHeader:AB,cardStatusIcon:jB,cardTitle:wB,cardBadges:DB,badge:MB,blockedBadge:RB,childBadge:OB,depBadge:BB,parentBadge:IB,pausedSubBadge:LB,personaBadge:zB,envBadge:UB,emptyCta:VB,ctaButton:HB,ctaDescription:GB};function PB({workspaceId:n}){const{tasks:a,sessions:i,personas:o,environments:r}=at(),f=Ut(),u=_.useMemo(()=>a.filter(v=>v.workspaceId===n),[a,n]),p=_.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=_.useMemo(()=>new Map(u.map(v=>[v.id,v])),[u]),g=_.useMemo(()=>{const v=new Map(i.map(k=>[k.id,k])),b=new Map(o.map(k=>[k.id,k])),S=new Map(r.map(k=>[k.id,k])),C=new Map,E=new Map,N=new Map;for(const k of u)if(k.latestSessionId){const A=v.get(k.latestSessionId);if(A){if(C.set(k.id,A.status),A.personaId){const M=b.get(A.personaId);M&&E.set(k.id,M.name)}if(A.environmentId){const M=S.get(A.environmentId);M&&N.set(k.id,M.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:E,environmentNameByTaskId:N}},[u,i,o,r]),y=_.useMemo(()=>yB({tasks:u,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[u,p,g]);return u.length===0?c.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Ge.ctaButton,onClick:()=>f(Hi(n)),children:"Create Task"}),c.jsx("div",{className:Ge.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Ge.boardContainer,"data-testid":"board-container",children:y.map(v=>c.jsxs("section",{className:Ge.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Ge.columnHeader,children:[c.jsx("span",{className:Ge.columnIcon,style:{color:v.style.color},children:v.style.icon}),c.jsx("span",{className:Ge.columnLabel,children:v.label}),c.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),c.jsx("div",{className:Ge.cardList,children:v.tasks.length===0?c.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):c.jsx(qn,{mode:"popLayout",children:v.tasks.map(b=>c.jsx(St.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx($B,{boardTask:b,tasksById:m,personaName:g.personaNameByTaskId.get(b.task.id),envName:g.environmentNameByTaskId.get(b.task.id),onClick:()=>f(va(b.task.id,void 0,n))})},b.task.id))})})]},v.status))})}function $B({boardTask:n,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:f,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=es(f.status),v=f.parentTaskId?a.get(f.parentTaskId):void 0;return c.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${f.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:Ge.cardHeader,children:[c.jsx("span",{className:Ge.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:Ge.cardTitle,children:f.title})]}),c.jsxs("div",{className:Ge.cardBadges,children:[v&&c.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:v.title,children:v.title}),p>0&&c.jsxs("span",{className:`${Ge.badge} ${Ge.childBadge}`,children:[m,"/",p]}),u&&c.jsx("span",{className:`${Ge.badge} ${Ge.blockedBadge}`,children:"blocked"}),f.dependsOn.length>0&&!u&&c.jsx("span",{className:`${Ge.badge} ${Ge.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Ge.badge} ${Ge.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Ge.badge} ${Ge.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:o})]})]})}function Fh(n){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:f,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=_.useState(""),[v,b]=_.useState(""),S=_.useRef(!1),C=f===r,E=_.useCallback(R=>{y(R),b("")},[]),N=_.useCallback(()=>{b("")},[]),k=_.useCallback(()=>{S.current=!1,u==null||u(null),y(""),b("")},[u]),A=_.useCallback(()=>{const R=m?g.trim():g;if(o){const G=o(g);if(G){b(G);return}}const O=m?a.trim():a;if(R===O){k();return}i(R),k()},[g,a,m,o,i,k]),M=_.useCallback(()=>{S.current=!0,u==null||u(r),y(a),b("")},[r,a,u]),D=_.useCallback(R=>{if(S.current){S.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===r||A()},[r,A]),z=_.useCallback(R=>{R.key==="Escape"?k():R.key==="Enter"&&p&&A()},[k,p,A]),Y=(()=>{if(!C)return!1;const R=m?a.trim():a;return(m?g.trim():g)!==R})();return _.useEffect(()=>{!C&&(g!==""||v!=="")&&(y(""),b(""))},[C,g,v]),{isEditing:C,draft:g,error:v,isDirty:Y,startEdit:M,cancelEdit:k,save:A,setDraft:E,clearError:N,handleBlur:D,handleKeyDown:z,ignoreInitialBlurRef:S}}const FB="_editFieldWrapper_yuzty_1",qB="_editInput_yuzty_10",YB="_editTextarea_yuzty_42",KB="_editSelect_yuzty_78",ZB="_editError_yuzty_111",XB="_editInputInvalid_yuzty_118",QB="_editHint_yuzty_123",WB="_unsavedDot_yuzty_132",JB="_metaValueClickable_yuzty_140",e6="_editButton_yuzty_159",t6="_metaPlaceholder_yuzty_175",n6="_worktreeToggle_yuzty_180",Le={editFieldWrapper:FB,editInput:qB,editTextarea:YB,editSelect:KB,editError:ZB,editInputInvalid:XB,editHint:QB,unsavedDot:WB,metaValueClickable:JB,editButton:e6,metaPlaceholder:t6,worktreeToggle:n6};function cn(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:f="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:b,"data-testid":S}=n,C=_.useRef(null),E=Fh({value:a,onSave:i,validate:o,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(_.useEffect(()=>{if(E.isEditing){const k=window.setTimeout(()=>{var A;(A=C.current)==null||A.focus()},0);return()=>window.clearTimeout(k)}},[E.isEditing]),r==="create"){const k=M=>{m==null||m(M.target.value)},A=o==null?void 0:o(a);return c.jsxs("div",{className:Le.editFieldWrapper,children:[c.jsx("input",{className:`${Le.editInput} ${A?Le.editInputInvalid:""}`,value:a,onChange:k,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),A&&c.jsx("span",{className:Le.editError,"data-testid":"edit-error",children:A})]})}if(E.isEditing)return c.jsxs("div",{className:Le.editFieldWrapper,children:[c.jsx("input",{ref:C,className:`${Le.editInput} ${E.error?Le.editInputInvalid:""}`,value:E.draft,onChange:k=>E.setDraft(k.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),E.isDirty&&c.jsx("span",{className:Le.unsavedDot,title:"Unsaved changes"}),E.error&&c.jsx("span",{className:Le.editError,"data-testid":"edit-error",children:E.error}),c.jsx("span",{className:Le.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Le.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:Le.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Le.editButton,"aria-hidden":"true",children:"✏️"})]})}function a6(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:f="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=_.useRef(null),C=Fh({value:a,onSave:i,validate:o,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(_.useEffect(()=>{if(C.isEditing){const N=window.setTimeout(()=>{var k;(k=S.current)==null||k.focus()},0);return()=>window.clearTimeout(N)}},[C.isEditing]),r==="create"){const N=A=>{m==null||m(A.target.value)},k=o==null?void 0:o(a);return c.jsxs("div",{className:Le.editFieldWrapper,children:[c.jsx("textarea",{className:`${Le.editTextarea} ${k?Le.editInputInvalid:""}`,value:a,onChange:N,placeholder:y,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),k&&c.jsx("span",{className:Le.editError,"data-testid":"edit-error",children:k})]})}if(C.isEditing)return c.jsxs("div",{className:Le.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${Le.editTextarea} ${C.error?Le.editInputInvalid:""}`,value:C.draft,onChange:N=>C.setDraft(N.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,title:v,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),C.isDirty&&c.jsx("span",{className:Le.unsavedDot,title:"Unsaved changes"}),C.error&&c.jsx("span",{className:Le.editError,"data-testid":"edit-error",children:C.error}),c.jsx("span",{className:Le.editHint,children:"Tab to save · Esc to cancel"})]});const E=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:Le.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[E!==void 0?E:a?c.jsx("span",{children:a}):c.jsx("span",{className:Le.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Le.editButton,"aria-hidden":"true",children:"✏️"})]})}function m_(n){var M;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:f="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=_.useRef(null),C=Fh({value:a,onSave:i,fieldId:f,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});_.useEffect(()=>{if(C.isEditing){const D=window.setTimeout(()=>{var z;(z=S.current)==null||z.focus()},0);return()=>window.clearTimeout(D)}},[C.isEditing]);const E=_.useCallback(D=>{const z=D.target.value;C.ignoreInitialBlurRef.current=!1,z!==a&&i(z),C.cancelEdit()},[a,i,C]),N=_.useCallback(D=>{if(C.ignoreInitialBlurRef.current){C.ignoreInitialBlurRef.current=!1;return}D.relatedTarget instanceof HTMLElement&&D.relatedTarget.dataset.editAction===f||C.cancelEdit()},[f,C]);if(o==="create")return c.jsx("select",{className:Le.editSelect,value:a,onChange:D=>m==null?void 0:m(D.target.value),"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(D=>c.jsx("option",{value:D.value,children:D.label},D.value))});if(C.isEditing)return c.jsx("select",{ref:S,className:Le.editSelect,value:C.draft,onChange:E,onBlur:N,title:v,"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(D=>c.jsx("option",{value:D.value,children:D.label},D.value))});const k=g==null?void 0:g(a),A=(M=r.find(D=>D.value===a))==null?void 0:M.label;return c.jsxs("button",{type:"button",className:Le.metaValueClickable,onClick:()=>C.startEdit(),title:"Click to change","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[k!==void 0?k:A?c.jsx("span",{children:A}):c.jsx("span",{className:Le.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:Le.editButton,"aria-hidden":"true",children:"✏️"})]})}function s6(n){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":f}=n;return c.jsxs("label",{className:Le.worktreeToggle,"data-testid":f,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:u=>i(u.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const i6="_envRow_1e1r5_1",l6="_envDot_1e1r5_7",o6="_envDotGreen_1e1r5_14",r6="_envDotYellow_1e1r5_18",c6="_envDotRed_1e1r5_22",u6="_envDotGray_1e1r5_26",Mi={envRow:i6,envDot:l6,envDotGreen:o6,envDotYellow:r6,envDotRed:c6,envDotGray:u6};function d6(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Mi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Mi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Mi.envDotRed:Mi.envDotGray}function f6(n){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:f="environment",activeFieldId:u,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=o.find(C=>C.id===a),b=[...r?[{value:"",label:"None"}]:[],...o.map(C=>({value:C.id,label:C.displayName}))],S=()=>{if(v)return c.jsxs("span",{className:Mi.envRow,children:[c.jsx("span",{className:`${Mi.envDot} ${d6(v.status)}`}),v.displayName]})};return c.jsx(m_,{value:a,onSave:i,options:b,fieldId:f,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function H0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const f=Math.floor(r/60);if(f<24)return`${f}h ago`;const u=Math.floor(f/24);return u<30?`${u}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const df=100;function h6(){const{workspaceId:n}=Vi(),a=Ut(),{tasks:i,environments:o,workspaces:r,personas:f,archiveWorkspace:u,updateWorkspace:p}=at(),[m,g]=_.useState("tasks"),[y,v]=_.useState(!1),[b,S]=_.useState(null),[C,E]=_.useState(!1),N=_.useRef(void 0),k=r.find(R=>R.id===n),A=[{label:"Home",url:vo},{label:(k==null?void 0:k.name)??"Workspace",url:void 0}];_.useEffect(()=>{const R=N.current;N.current=n,!(R===void 0||R===n)&&b!==null&&S(null)},[n,b]);const M=i.filter(R=>R.workspaceId===n),D=M.filter(R=>R.status==="complete").length,z=M.length,Y=z>0?Math.round(D/z*100):0;return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(qi,{segments:A}),c.jsxs("div",{className:V.workspaceHeader,children:[c.jsx("span",{className:V.workspaceName,"data-testid":"workspace-name",children:c.jsx(cn,{value:(k==null?void 0:k.name)||"",onSave:R=>{k&&p(k.id,{name:R})},validate:R=>{const O=R.trim();if(!O)return"Name is required";if(O.length>df)return`Max ${df} characters`},maxLength:df,fieldId:"name",activeFieldId:b,onActivate:S,ariaLabel:"Workspace name",renderDisplay:R=>R||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:V.archiveButton,onClick:()=>v(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:V.metaToggle,onClick:()=>E(!C),"aria-expanded":!C,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${V.metaToggleArrow} ${C?"":V.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!C&&c.jsxs("div",{className:V.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Description"}),c.jsx("div",{className:V.metaValue,children:c.jsx(a6,{value:(k==null?void 0:k.description)||"",onSave:R=>{k&&p(k.id,{description:R})},fieldId:"description",activeFieldId:b,onActivate:S,renderDisplay:R=>R?c.jsx("span",{className:V.overviewMarkdown,children:c.jsx(Yf,{remarkPlugins:[Kf],children:R})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Repository"}),c.jsx("div",{className:V.metaValue,children:c.jsx(cn,{value:(k==null?void 0:k.repoUrl)||"",onSave:R=>{k&&p(k.id,{repoUrl:R})},validate:R=>{const O=R.trim();if(O&&!/^https?:\/\/.+/.test(O))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:b,onActivate:S,renderDisplay:R=>R&&/^https?:\/\//i.test(R)?c.jsx("a",{className:V.repoLink,href:R,target:"_blank",rel:"noopener noreferrer",onClick:O=>O.stopPropagation(),children:R}):R?c.jsx("span",{children:R}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Environment"}),c.jsx("div",{className:V.metaValue,children:c.jsx(f6,{value:(k==null?void 0:k.environmentId)||"",onSave:R=>{k&&R&&p(k.id,{environmentId:R})},environments:o,fieldId:"environmentId",activeFieldId:b,onActivate:S,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Persona"}),c.jsx("div",{className:V.metaValue,children:c.jsx(m_,{value:(k==null?void 0:k.defaultPersonaId)||"",onSave:R=>{k&&p(k.id,{defaultPersonaId:R})},options:[{value:"",label:"(Inherit)"},...f.map(R=>({value:R.id,label:R.name}))],fieldId:"defaultPersonaId",activeFieldId:b,onActivate:S,renderDisplay:R=>{const O=f.find(G=>G.id===R);if(O)return c.jsx("span",{children:O.name})},placeholder:(k==null?void 0:k.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Worktrees"}),c.jsx("div",{className:V.metaValue,children:c.jsx(s6,{checked:(k==null?void 0:k.useWorktrees)??!0,onChange:R=>{k&&p(k.id,{useWorktrees:R})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:V.metaRow,children:[c.jsx("span",{className:V.metaLabel,children:"Working Dir"}),c.jsx("div",{className:V.metaValue,children:c.jsx(cn,{value:(k==null?void 0:k.worktreeBasePath)||"",onSave:R=>{k&&p(k.id,{worktreeBasePath:R})},fieldId:"worktreeBasePath",activeFieldId:b,onActivate:S,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),k&&c.jsxs("div",{className:V.metaTimestamps,children:[c.jsxs("span",{className:V.metaTimestamp,children:["Created ",H0(k.createdAt)]}),k.updatedAt&&k.updatedAt!==k.createdAt&&c.jsxs("span",{className:V.metaTimestamp,children:["· Updated ",H0(k.updatedAt)]})]})]}),z>0&&c.jsxs("div",{className:V.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:V.progressBar,children:c.jsx("div",{className:V.progressFill,style:{width:`${Y}%`}})}),c.jsxs("span",{className:V.progressLabel,children:[D,"/",z]})]}),c.jsxs("div",{className:V.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":m==="graph",className:`${V.tab} ${m==="graph"?V.active:""}`,onClick:()=>g("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":m==="board",className:`${V.tab} ${m==="board"?V.active:""}`,onClick:()=>g("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":m==="tasks",className:`${V.tab} ${m==="tasks"?V.active:""}`,onClick:()=>g("tasks"),children:"Tasks"})]}),m==="tasks"&&z>0&&c.jsxs("div",{className:V.workspaceSummary,children:[c.jsx("span",{className:V.workspaceSummaryTitle,children:`${D}/${z} tasks complete`}),c.jsx("span",{className:V.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),m==="tasks"&&z===0&&c.jsxs("div",{className:V.emptyCta,children:[c.jsx("button",{className:V.ctaButton,onClick:()=>a(Hi(n)),children:"Create Task"}),c.jsx("div",{className:V.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),m==="board"&&c.jsx(PB,{workspaceId:n}),m==="graph"&&c.jsx(vB,{workspaceId:n}),c.jsx(Ec,{isOpen:y,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{k&&(u(k.id),a("/",{replace:!0})),v(!1)},onCancel:()=>v(!1)})]})}const p6="_container_cddyd_1",m6="_header_cddyd_8",g6="_headerTitle_cddyd_35",v6="_badge_cddyd_44",y6="_headerActions_cddyd_54",b6="_body_cddyd_61",x6="_formContent_cddyd_73",_6="_section_cddyd_85",S6="_label_cddyd_91",T6="_titleInput_cddyd_98",k6="_descriptionTextarea_cddyd_131",C6="_parentContext_cddyd_167",E6="_parentLabel_cddyd_175",N6="_parentName_cddyd_182",A6="_personaSelect_cddyd_186",j6="_depList_cddyd_220",w6="_depItem_cddyd_226",D6="_depItemSelected_cddyd_248",M6="_noDeps_cddyd_252",R6="_btnPrimary_cddyd_258",O6="_btnGhost_cddyd_289",Ie={container:p6,header:m6,headerTitle:g6,badge:v6,headerActions:y6,body:b6,formContent:x6,section:_6,label:S6,titleInput:T6,descriptionTextarea:k6,parentContext:C6,parentLabel:E6,parentName:N6,personaSelect:A6,depList:j6,depItem:w6,depItemSelected:D6,noDeps:M6,btnPrimary:R6,btnGhost:O6};function g_({mode:n,taskId:a,workspaceId:i,parentTaskId:o}){const{tasks:r,workspaces:f,personas:u,createTask:p,updateTask:m}=at(),{showToast:g}=Gi(),y=Ut(),v=n==="edit",b=v&&a?r.find(se=>se.id===a):void 0,S=v?(b==null?void 0:b.workspaceId)??"":i??"",[C,E]=_.useState(S),N=S||C,k=!v&&!i,A=v?(b==null?void 0:b.parentTaskId)??"":o??"",M=A?r.find(se=>se.id===A):void 0,[D,z]=_.useState((b==null?void 0:b.title)??""),[Y,R]=_.useState((b==null?void 0:b.description)??""),[O,G]=_.useState((b==null?void 0:b.dependsOn)??[]),[ee,ne]=_.useState((b==null?void 0:b.defaultPersonaId)??""),[ae,oe]=_.useState((b==null?void 0:b.canDecompose)??!1),[W,te]=_.useState(!1),B=_.useRef(!1);_.useEffect(()=>{v&&b&&!B.current&&(B.current=!0,z(b.title),R(b.description),G(b.dependsOn),ne(b.defaultPersonaId),oe(b.canDecompose))},[v,b]);const q=r.filter(se=>se.workspaceId===N&&(!v||se.id!==a)&&se.id!==A),U=D.trim().length>0&&(!v||b!==void 0)&&N.length>0,re=se=>{G(He=>He.includes(se)?He.filter(gt=>gt!==se):[...He,se])},I=()=>{!U||W||v&&b===void 0||(v&&a?(m(a,D.trim(),Y,O,ee),g("Task updated","success"),y(va(a,void 0,N),{replace:!0})):(te(!0),p(N,D.trim(),Y,O.length>0?O:void 0,A||void 0,ee,ae,()=>{g("Task created","success"),y(i?Ri(i):"/tasks",{replace:!0})},se=>{g(se,"error"),te(!1)})))},ie=()=>{y(v&&a?va(a,void 0,N):i?Ri(i):"/tasks")},he=v?"edit task":A?"child task":"new task";return c.jsxs("div",{className:Ie.container,children:[c.jsxs("div",{className:Ie.header,children:[c.jsxs("div",{className:Ie.headerTitle,children:[c.jsx("span",{className:Ie.badge,children:he}),M&&c.jsxs("span",{className:Ie.parentContext,children:[c.jsx("span",{className:Ie.parentLabel,children:"Child of"}),c.jsx("span",{className:Ie.parentName,children:M.title})]})]}),c.jsxs("div",{className:Ie.headerActions,children:[c.jsx("button",{onClick:I,disabled:!U||W,className:Ie.btnPrimary,"data-testid":"task-edit-save",children:W?"Creating…":v?"Save Changes":"Create"}),c.jsx("button",{onClick:ie,className:Ie.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ie.body,children:c.jsxs("div",{className:Ie.formContent,children:[k&&c.jsxs("div",{className:Ie.section,children:[c.jsx("label",{className:Ie.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:C,onChange:se=>E(se.target.value),className:Ie.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),f.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),c.jsxs("div",{className:Ie.section,children:[c.jsx("label",{className:Ie.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:D,onChange:se=>z(se.target.value),placeholder:"Task title...",autoFocus:!0,className:Ie.titleInput,"data-testid":"task-edit-title",onKeyDown:se=>{se.key==="Enter"&&U&&I()}})]}),c.jsxs("div",{className:Ie.section,children:[c.jsx("label",{className:Ie.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:Y,onChange:se=>R(se.target.value),placeholder:"Describe the task... (markdown supported)",className:Ie.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ie.section,children:[c.jsx("label",{className:Ie.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:ee,onChange:se=>ne(se.target.value),className:Ie.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),u.map(se=>c.jsx("option",{value:se.id,children:se.name},se.id))]})]}),!v&&c.jsx("div",{className:Ie.section,children:c.jsxs("label",{className:Ie.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:ae,onChange:se=>oe(se.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ie.section,children:[c.jsx("div",{className:Ie.label,children:"Dependencies"}),q.length===0?c.jsx("div",{className:Ie.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ie.depList,children:q.map(se=>{const He=O.includes(se.id);return c.jsxs("label",{className:`${Ie.depItem} ${He?Ie.depItemSelected:""}`,"data-testid":`dep-option-${se.id}`,children:[c.jsx("input",{type:"checkbox",checked:He,onChange:()=>re(se.id)}),se.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",se.status,")"]})]},se.id)})})]})]})})]})}function B6(){const[n]=ub(),a=n.get("workspace")??"",i=n.get("parent")??void 0;return c.jsx(g_,{mode:"new",workspaceId:a,parentTaskId:i})}function G0(){const{taskId:n}=Vi();return c.jsx(g_,{mode:"edit",taskId:n})}const I6="_container_1pqxm_1",L6="_emptyState_1pqxm_8",z6="_card_1pqxm_14",U6="_cardHeader_1pqxm_34",V6="_categoryBadge_1pqxm_46",H6="_findingTitle_1pqxm_54",G6="_findingDate_1pqxm_60",P6="_findingContent_1pqxm_72",$6="_tags_1pqxm_78",F6="_tag_1pqxm_78",Un={container:I6,emptyState:L6,card:z6,cardHeader:U6,categoryBadge:V6,findingTitle:H6,findingDate:G6,findingContent:P6,tags:$6,tag:F6};function q6(n){const a=new Date(n),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),f=Math.floor(r/60),u=Math.floor(f/60),p=Math.floor(u/24);if(r<60)return"just now";if(f<60)return`${f}m ago`;if(u<24)return`${u}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const P0={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function Y6({workspaceId:n}){const{findings:a}=at(),i=a.filter(o=>o.workspaceId===n);return i.length===0?c.jsx("div",{className:Un.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Un.container,children:i.map((o,r)=>{const f=P0[o.category]||P0.general;return c.jsxs(St.div,{className:Un.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Un.cardHeader,children:[c.jsx("span",{className:Un.categoryBadge,style:{background:f.bg,color:f.text},children:o.category}),c.jsx("span",{className:Un.findingTitle,children:o.title}),c.jsx("span",{className:Un.findingDate,title:o.createdAt,children:q6(o.createdAt)})]}),c.jsx("div",{className:Un.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&c.jsx("div",{className:Un.tags,children:o.tags.map(u=>c.jsx("span",{className:Un.tag,style:{color:f.text,textShadow:`0 0 8px ${f.text}`},children:u},u))})]},o.id)})})}function Kr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function ff(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const f=Math.floor(o/60),u=o%60;return f===0?`${o}m ${r}s`:`${f}h ${u}m`}function $0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?V.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?V.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?V.envDotRed:V.envDotGray}function K6({status:n}){const a=es(n),i=Ww(n);return c.jsx("span",{className:`${V.statusBadge} ${V[i]??V.statusPending}`,children:a.label})}function Z6({task:n,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:f}){const u=r.length>0?r[r.length-1]:void 0,p=(u==null?void 0:u.environmentId)??"",m=p?i.find(b=>b.id===p):void 0,g=o.find(b=>b.id===n.workspaceId),y=i.find(b=>b.id===f),v=n.branch&&(g!=null&&g.repoUrl)?`${g.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:V.overviewDashboard,children:[c.jsxs("div",{className:V.overviewHero,children:[c.jsx(K6,{status:n.status}),n.branch&&c.jsx("span",{className:V.overviewBranchPill,children:v?c.jsxs("a",{href:v,target:"_blank",rel:"noreferrer noopener",className:V.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Description"}),c.jsx("div",{className:V.overviewMarkdown,children:c.jsx(Yf,{remarkPlugins:[Kf],children:n.description})})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Environment"}),p&&m?c.jsxs("div",{className:V.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${V.envDot} ${$0(m.status)}`,title:m.status,"aria-label":`Status: ${m.status}`,role:"img"}),c.jsx("span",{className:V.overviewValue,children:m.displayName})]}):y?c.jsxs("div",{className:V.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${V.envDot} ${$0(y.status)}`,title:y.status,"aria-label":`Status: ${y.status}`,role:"img"}),c.jsx("span",{className:V.overviewValue,children:y.displayName}),c.jsx("span",{className:V.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:V.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:V.overviewMuted,children:"None"}):c.jsx("div",{className:V.depList,children:n.dependsOn.map(b=>{const S=a.get(b),C=(S==null?void 0:S.status)==="complete";return c.jsxs("div",{className:`${V.depItem} ${C?V.depDone:V.depBlocked}`,children:[c.jsx("span",{children:C?"✓":"○"}),c.jsx("span",{children:(S==null?void 0:S.title)??b})]},b)})})]}),c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:V.timeline,children:[n.createdAt&&c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Created"}),c.jsx("span",{className:V.timelineValue,children:Kr(n.createdAt)})]}),n.assignedAt&&(()=>{const b=ff(n.createdAt,n.assignedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Assigned"}),c.jsx("span",{className:V.timelineValue,children:Kr(n.assignedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),n.startedAt&&(()=>{const b=ff(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Started"}),c.jsx("span",{className:V.timelineValue,children:Kr(n.startedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),n.completedAt&&(()=>{const b=ff(n.startedAt,n.completedAt);return c.jsxs("div",{className:V.timelineRow,children:[c.jsx("span",{className:V.timelineKey,children:"Completed"}),c.jsx("span",{className:V.timelineValue,children:Kr(n.completedAt)}),b!==void 0&&c.jsx("span",{className:V.timelineDelta,children:b})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:V.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&c.jsxs("div",{className:V.overviewSection,children:[c.jsx("div",{className:V.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:V.reviewNotes,children:n.reviewNotes})]})]})}function X6({task:n,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:f,onPause:u,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:m,className:V.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:o,className:V.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:V.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:f,className:V.btnDanger,children:"Stop"}),c.jsx("button",{onClick:u,disabled:!a,className:V.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:f,className:V.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:V.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:V.headerActions,children:c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:V.headerActions,children:[c.jsx("button",{onClick:o,className:V.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:V.btnDanger,children:"Delete"})]})}function Q6({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:V.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:V.attemptLabel,children:"Attempts:"}),n.map((o,r)=>{const f=o.id===a,u=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${V.attemptButton} ${f?V.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":f,"data-testid":`attempt-${r+1}`,children:["#",r+1,u&&c.jsx("span",{className:V.attemptStatus,children:u})]},o.id)})]})}function Ci(){const{taskId:n,workspaceId:a}=Vi(),i=At(),o=Ut(),{events:r,eventsDropped:f,tasks:u,sessions:p,environments:m,loadSessionEvents:g,loadFindings:y,kill:v,startTask:b,stopTask:S,resumeTask:C,deleteTask:E,workspaces:N,taskSessions:k,loadTaskSessions:A}=at(),M=_.useRef(void 0),D=_.useRef(void 0),z=_.useRef(void 0),Y=_.useRef(void 0),R=_.useRef(void 0),O=i.pathname.endsWith("/stream")?"stream":i.pathname.endsWith("/findings")?"findings":"overview",[G,ee]=_.useState(O),[ne,ae]=_.useState(!1),[oe,W]=_.useState(void 0),[te,B]=_.useState(""),q=_.useRef(O);O!==q.current&&(q.current=O,O!==G&&ee(O));const U=u.find(Te=>Te.id===n),re=(U==null?void 0:U.workspaceId)||void 0,I=N.find(Te=>Te.id===re);_.useEffect(()=>{if(te===""){if(I!=null&&I.environmentId)B(I.environmentId);else if(m.length>0){const Te=m.find(rt=>rt.status==="connected");B((Te==null?void 0:Te.id)??m[0].id)}}},[te,I==null?void 0:I.environmentId,m]);const ie=U?k[U.id]??[]:[];let he;oe&&ie.some(Te=>Te.id===oe)?he=oe:he=(U==null?void 0:U.latestSessionId)||void 0;const se=()=>{ae(!0)},He=()=>{U&&(E(U.id),ae(!1),o(U.workspaceId?Ri(U.workspaceId):"/",{replace:!0}))};if((U==null?void 0:U.id)!==D.current&&(D.current=U==null?void 0:U.id,oe!==void 0&&W(void 0),te!==""&&B("")),_.useEffect(()=>{if(!(U!=null&&U.id))return;const Te=U.id!==Y.current,rt=U.latestSessionId!==R.current;(Te||rt)&&(Y.current=U.id,R.current=U.latestSessionId,A(U.id))},[U==null?void 0:U.id,U==null?void 0:U.latestSessionId,A]),(U==null?void 0:U.status)!==z.current){const Te=z.current===void 0;z.current=U==null?void 0:U.status;const rt=(U==null?void 0:U.status)==="not_started"?"overview":(U==null?void 0:U.status)==="working"||(U==null?void 0:U.status)==="paused"?"stream":(U==null?void 0:U.status)==="complete"?"findings":void 0;rt&&rt!==G&&!(Te&&O!=="overview")&&ee(rt)}const gt=_.useMemo(()=>new Map(u.map(Te=>[Te.id,Te])),[u]),$t=_.useMemo(()=>{const Te=he?r.filter(rt=>rt.sessionId===he):[];return $h(Ph(Te))},[r,he]),Rn=U?U.dependsOn.some(Te=>{const rt=gt.get(Te);return rt!==void 0&&rt.status!=="complete"}):!1,Yn=_.useMemo(()=>$O(n,N,gt),[n,N,gt]);_.useEffect(()=>{he&&he!==M.current&&(M.current=he,g(he))},[he,g]),_.useEffect(()=>{G==="findings"&&re&&y(re)},[G,re,y]);const Jt=Te=>{ee(Te),o(va(n,Te==="overview"?void 0:Te,a))};return c.jsxs("div",{className:V.panelContainer,children:[c.jsx(qi,{segments:Yn}),c.jsxs("div",{className:V.header,children:[c.jsxs("span",{className:V.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(U==null?void 0:U.title)||n}),U&&c.jsx("span",{className:V.taskStatusBadge,"data-testid":"task-status",children:U.status}),(U==null?void 0:U.branch)&&c.jsx("span",{className:V.taskBranch,children:U.branch}),Rn&&c.jsx("span",{className:V.taskBlockedBadge,children:"blocked"})]}),U&&c.jsx(X6,{task:U,sessionId:he,isBlocked:Rn,onStart:()=>b(U.id,void 0,te),onResume:()=>C(U.id),onStop:()=>S(U.id),onPause:()=>he&&v(he),onDelete:se,onEdit:()=>o(Uk(U.id,a))})]}),c.jsxs("div",{className:V.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":G==="overview",className:`${V.tab} ${G==="overview"?V.active:""}`,onClick:()=>Jt("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":G==="stream",className:`${V.tab} ${G==="stream"?V.active:""}`,onClick:()=>Jt("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":G==="findings",className:`${V.tab} ${G==="findings"?V.active:""}`,onClick:()=>Jt("findings"),children:"Findings"})]}),c.jsxs(qn,{mode:"wait",children:[G==="overview"&&c.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:V.overviewContent,"data-testid":"task-overview",children:U?c.jsx(Z6,{task:U,tasksById:gt,environments:m,workspaces:N,taskSessions:ie,selectedEnvId:te}):c.jsx("div",{className:V.waitingMessage,children:"No additional details"})},"overview"),G==="stream"&&c.jsxs(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(Q6,{taskSessions:ie,selectedSessionId:he,onSelect:Te=>W(Te)}),c.jsx(Gh,{events:$t,eventsDropped:f,emptyState:!he&&U?c.jsxs("div",{className:V.emptyCta,children:[c.jsx("button",{className:V.ctaButton,onClick:()=>b(U.id,void 0,te),children:"Start Task"}),c.jsx("div",{className:V.ctaDescription,children:"Click to begin agent execution"})]}):he&&$t.length===0?c.jsx("div",{className:V.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),G==="findings"&&c.jsx(St.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:V.tabContent,children:re?c.jsx(Y6,{workspaceId:re}):c.jsx("div",{className:V.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!U||U.status!=="working"&&U.status!=="paused")return;const Te=he?p.find(rt=>rt.id===he):void 0;if(!(!Te||["completed","failed","interrupted","hibernating"].includes(Te.status)))return c.jsx(po,{mode:"send",sessionId:Te.id,environmentId:Te.environmentId})})(),U&&c.jsx(Ec,{isOpen:ne,title:"Delete Task?",description:`"${U.title}" will be permanently removed.`,onConfirm:He,onCancel:()=>ae(!1)})]})}const W6="_container_legrg_1",J6="_header_legrg_8",e4="_headerTitle_legrg_35",t4="_badge_legrg_44",n4="_headerActions_legrg_54",a4="_body_legrg_61",s4="_formContent_legrg_73",i4="_section_legrg_85",l4="_label_legrg_91",o4="_nameInput_legrg_98",r4="_fieldInput_legrg_131",c4="_adapterSelect_legrg_164",u4="_readOnlyValue_legrg_198",d4="_codespaceSection_legrg_204",f4="_codespaceActions_legrg_210",h4="_creatingHint_legrg_216",p4="_errorHint_legrg_222",m4="_btnPrimary_legrg_235",g4="_btnGhost_legrg_266",J={container:W6,header:J6,headerTitle:e4,badge:t4,headerActions:n4,body:a4,formContent:s4,section:i4,label:l4,nameInput:o4,fieldInput:r4,adapterSelect:c4,readOnlyValue:u4,codespaceSection:d4,codespaceActions:f4,creatingHint:h4,errorHint:p4,btnPrimary:m4,btnGhost:g4},tc=1,nc=65535;function hf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=tc&&a<=nc}function pf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function v4({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:o}){const{codespaces:r,codespaceError:f,codespaceListError:u,codespaceCreating:p,createCodespace:m}=at(),[g,y]=_.useState("pick"),[v,b]=_.useState(""),[S,C]=_.useState("");return g==="create"?c.jsxs("div",{className:J.codespaceSection,children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Repository"}),c.jsx("input",{type:"text",value:v,onChange:E=>b(E.target.value),placeholder:"owner/repo",className:J.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:E=>C(E.target.value),placeholder:"Machine type (optional)...",className:J.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:J.codespaceActions,children:[c.jsx("button",{onClick:()=>{v.trim()&&(m(v.trim(),S.trim()||void 0),y("pick"),b(""),C(""))},disabled:!v.trim(),className:J.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{y("pick"),b(""),C("")},className:J.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:J.codespaceSection,children:c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Codespace"}),!u&&c.jsxs("select",{value:n,onChange:E=>{E.target.value==="__create__"?(y("create"),a("")):(a(E.target.value),E.target.value&&!i.trim()&&o(E.target.value))},disabled:p,className:J.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(E=>c.jsxs("option",{value:E.name,children:[E.name," (",E.repository,") — ",E.state]},E.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:J.creatingHint,children:"Creating codespace..."}),u&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:J.errorHint,children:u}),c.jsx("input",{type:"text",value:n,onChange:E=>a(E.target.value),placeholder:"Or enter codespace name manually...",className:J.fieldInput,"data-testid":"env-codespace-manual"})]}),f&&!u&&c.jsx("span",{className:J.errorHint,children:f})]})})}function v_({mode:n,environmentId:a}){const{environments:i,addEnvironment:o,updateEnvironment:r,listCodespaces:f}=at(),{showToast:u}=Gi(),p=Ut(),m=n==="edit",g=m&&a?i.find(I=>I.id===a):void 0,[y,v]=_.useState(""),[b,S]=_.useState("local"),[C,E]=_.useState(""),[N,k]=_.useState(""),[A,M]=_.useState(""),[D,z]=_.useState(""),[Y,R]=_.useState(""),[O,G]=_.useState(""),[ee,ne]=_.useState(""),[ae,oe]=_.useState(null),W=_.useCallback(()=>{const I={};if(b==="local"){if(C.trim()&&(I.host=C.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(I.port=ie)}}else if(b==="ssh"){if(I.host=C.trim(),A.trim()&&(I.user=A.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(I.sshPort=ie)}D.trim()&&(I.identityFile=D.trim())}else b==="docker"?(Y.trim()&&(I.image=Y.trim()),O.trim()&&(I.repo=O.trim())):b==="codespace"&&(I.codespaceName=ee.trim());return I},[b,C,N,A,D,Y,O,ee]),te=()=>!(!y.trim()||b==="ssh"&&!C.trim()||b==="codespace"&&!ee.trim()||(b==="local"||b==="ssh")&&!hf(N)),B=()=>{te()&&(o(y.trim(),b,W()),u("Environment added successfully","success"),p(oo,{replace:!0}))},q=()=>{p(a?yf(a):oo)},U=_.useCallback((I,ie)=>{if(!g||!a)return;const he=pf(g.adapterConfig),se=ie.trim();se?he[I]=se:delete he[I],r(a,{adapterConfig:he})},[g,a,r]),re=_.useCallback((I,ie)=>{if(!g||!a)return;const he=pf(g.adapterConfig);if(ie.trim()){const se=Number(ie);Number.isInteger(se)&&se>=tc&&se<=nc&&(he[I]=se)}else delete he[I];r(a,{adapterConfig:he})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:J.container,children:[c.jsxs("div",{className:J.header,children:[c.jsx("div",{className:J.headerTitle,children:c.jsx("span",{className:J.badge,children:"edit environment"})}),c.jsx("div",{className:J.headerActions,children:c.jsx("button",{onClick:q,className:J.btnGhost,children:"Back"})})]}),c.jsx("div",{className:J.body,children:c.jsx("div",{className:J.formContent,children:c.jsx("span",{className:J.readOnlyValue,children:"Environment not found"})})})]});const I=pf(g.adapterConfig);return c.jsxs("div",{className:J.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:J.header,children:[c.jsx("div",{className:J.headerTitle,children:c.jsx("span",{className:J.badge,children:"edit environment"})}),c.jsx("div",{className:J.headerActions,children:c.jsx("button",{onClick:q,className:J.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:J.body,children:c.jsxs("div",{className:J.formContent,children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Name"}),c.jsx(cn,{value:g.displayName,onSave:ie=>{a&&r(a,{displayName:ie})},validate:ie=>ie.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:ae,onActivate:oe,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Adapter Type"}),c.jsx("span",{className:J.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Host"}),c.jsx(cn,{value:String(I.host??""),onSave:ie=>U("host",ie),mode:"edit",fieldId:"host",activeFieldId:ae,onActivate:oe,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Port"}),c.jsx(cn,{value:String(I.port??""),onSave:ie=>re("port",ie),validate:ie=>hf(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:ae,onActivate:oe,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Host"}),c.jsx(cn,{value:String(I.host??""),onSave:ie=>U("host",ie),validate:ie=>ie.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:ae,onActivate:oe,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"User"}),c.jsx(cn,{value:String(I.user??""),onSave:ie=>U("user",ie),mode:"edit",fieldId:"user",activeFieldId:ae,onActivate:oe,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"SSH Port"}),c.jsx(cn,{value:String(I.sshPort??""),onSave:ie=>re("sshPort",ie),validate:ie=>hf(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:ae,onActivate:oe,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Identity File"}),c.jsx(cn,{value:String(I.identityFile??""),onSave:ie=>U("identityFile",ie),mode:"edit",fieldId:"identityFile",activeFieldId:ae,onActivate:oe,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),g.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Image"}),c.jsx(cn,{value:String(I.image??""),onSave:ie=>U("image",ie),mode:"edit",fieldId:"image",activeFieldId:ae,onActivate:oe,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Repo"}),c.jsx(cn,{value:String(I.repo??""),onSave:ie=>U("repo",ie),mode:"edit",fieldId:"repo",activeFieldId:ae,onActivate:oe,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,children:"Codespace Name"}),c.jsx(cn,{value:String(I.codespaceName??""),onSave:ie=>U("codespaceName",ie),validate:ie=>ie.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:ae,onActivate:oe,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:J.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:J.header,children:[c.jsx("div",{className:J.headerTitle,children:c.jsx("span",{className:J.badge,children:"new environment"})}),c.jsxs("div",{className:J.headerActions,children:[c.jsx("button",{onClick:B,disabled:!te(),className:J.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:q,className:J.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:J.body,children:c.jsxs("div",{className:J.formContent,children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:y,onChange:I=>v(I.target.value),placeholder:"Environment name...",autoFocus:!0,className:J.nameInput,"data-testid":"env-create-name",onKeyDown:I=>{I.key==="Enter"&&te()&&B()}})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:I=>{S(I.target.value),I.target.value==="codespace"&&f()},className:J.adapterSelect,"data-testid":"env-create-adapter",children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]})]}),b==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:C,onChange:I=>E(I.target.value),placeholder:"Host (optional)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:tc,max:nc,value:N,onChange:I=>k(I.target.value),placeholder:"Port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:C,onChange:I=>E(I.target.value),placeholder:"Host (required)...",className:J.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:A,onChange:I=>M(I.target.value),placeholder:"User (optional)...",className:J.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:tc,max:nc,value:N,onChange:I=>k(I.target.value),placeholder:"SSH port (optional)...",className:J.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:D,onChange:I=>z(I.target.value),placeholder:"Identity file (optional)...",className:J.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:Y,onChange:I=>R(I.target.value),placeholder:"Image (optional)...",className:J.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:J.section,children:[c.jsx("label",{className:J.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:O,onChange:I=>G(I.target.value),placeholder:"Repo (optional)...",className:J.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(v4,{codespaceName:ee,onCodespaceNameChange:ne,envName:y,onEnvNameChange:v})]})})]})}function y4(){return c.jsx(v_,{mode:"new"})}function b4(){const{environmentId:n}=Vi();return c.jsx(v_,{mode:"edit",environmentId:n})}const x4="_layout_11u79_1",_4="_content_11u79_8",S4="_tabPanel_11u79_14",ao={layout:x4,content:_4,tabPanel:S4};function T4(){const n=HO();return c.jsxs("div",{className:ao.layout,children:[c.jsx(qi,{segments:n}),c.jsx("div",{className:ao.content,children:c.jsx(Jf,{})})]})}const k4="_container_13sb6_1",C4="_envHeader_13sb6_6",E4="_envTitleRow_13sb6_10",N4="_statusDot_13sb6_16",A4="_envName_13sb6_21",j4="_statusBadge_13sb6_27",w4="_envMeta_13sb6_33",D4="_metaTag_13sb6_39",M4="_actions_13sb6_51",R4="_provisionMessage_13sb6_59",O4="_errorMessage_13sb6_64",B4="_section_13sb6_69",I4="_sectionHeader_13sb6_73",L4="_createForm_13sb6_85",z4="_createInput_13sb6_92",U4="_cardList_13sb6_121",V4="_card_13sb6_121",H4="_cardHeader_13sb6_138",G4="_cardName_13sb6_144",P4="_cardActions_13sb6_149",$4="_cardDescription_13sb6_154",F4="_cardMeta_13sb6_160",q4="_repoLink_13sb6_166",Y4="_empty_13sb6_174",K4="_btnPrimary_13sb6_180",Z4="_btnOutline_13sb6_214",X4="_btnSmall_13sb6_241",Q4="_btnDanger_13sb6_267",Ae={container:k4,envHeader:C4,envTitleRow:E4,statusDot:N4,envName:A4,statusBadge:j4,envMeta:w4,metaTag:D4,actions:M4,provisionMessage:R4,errorMessage:O4,section:B4,sectionHeader:I4,createForm:L4,createInput:z4,cardList:U4,card:V4,cardHeader:H4,cardName:G4,cardActions:P4,cardDescription:$4,cardMeta:F4,repoLink:q4,empty:Y4,btnPrimary:K4,btnOutline:Z4,btnSmall:X4,btnDanger:Q4},W4={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function J4(){const{environmentId:n}=Vi(),a=Ut(),{environments:i,workspaces:o,sessions:r,provisionStatus:f,provisionEnvironment:u,stopEnvironment:p,removeEnvironment:m,createWorkspace:g,archiveWorkspace:y,workspaceCreating:v}=at(),[b,S]=_.useState(!1),[C,E]=_.useState(void 0),[N,k]=_.useState(!1),[A,M]=_.useState(""),D=i.find(B=>B.id===n);if(!n||!D)return c.jsx(Ka,{to:oo,replace:!0});const z=o.filter(B=>B.environmentId===D.id),Y=r.filter(B=>B.environmentId===D.id),R=W4[D.status]||"var(--text-tertiary)",O=D.status==="connected",G=D.status==="connecting",ee=D.status==="disconnected"||D.status==="error",ne=D.id in f?f[D.id]:void 0,ae=()=>{m(D.id),S(!1),a(oo,{replace:!0})},oe=()=>{!A.trim()||v||(g(A.trim(),void 0,void 0,D.id),M(""),k(!1))},W=B=>{B.key==="Enter"?oe():B.key==="Escape"&&(k(!1),M(""))},te=B=>{y(B),E(void 0)};return c.jsxs("div",{className:Ae.container,children:[c.jsx(Ec,{isOpen:b,title:"Delete Environment?",description:`"${D.displayName||D.id}" will be permanently removed along with all its data.`,onConfirm:ae,onCancel:()=>S(!1)}),c.jsxs("div",{className:Ae.envHeader,children:[c.jsxs("div",{className:Ae.envTitleRow,children:[c.jsx("span",{className:Ae.statusDot,style:{color:R},children:"●"}),c.jsx("h2",{className:Ae.envName,children:D.displayName||D.id}),c.jsx("span",{className:Ae.statusBadge,style:{color:R},children:D.status})]}),c.jsxs("div",{className:Ae.envMeta,children:[c.jsxs("span",{className:Ae.metaTag,children:["Adapter: ",D.adapterType]}),Y.length>0&&c.jsxs("span",{className:Ae.metaTag,children:[Y.length," session",Y.length!==1?"s":""]})]})]}),c.jsxs("div",{className:Ae.actions,children:[O&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ae.btnPrimary,onClick:()=>a(fb(D.id)),children:"New Chat"}),c.jsx("button",{className:Ae.btnOutline,onClick:()=>p(D.id),children:"Stop"})]}),ee&&c.jsx("button",{className:Ae.btnPrimary,onClick:()=>u(D.id),children:D.status==="error"?"Retry":"Connect"}),G&&ne!==void 0&&c.jsx("span",{className:Ae.provisionMessage,children:ne.message}),D.status==="error"&&(ne==null?void 0:ne.stage)==="error"&&c.jsx("span",{className:Ae.errorMessage,children:ne.message}),c.jsx("button",{className:Ae.btnOutline,onClick:()=>a(Hk(D.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:Ae.btnDanger,onClick:()=>S(!0),children:"Delete"})]}),c.jsxs("div",{className:Ae.section,children:[c.jsxs("div",{className:Ae.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:Ae.btnPrimary,onClick:()=>k(!0),disabled:v,children:"+ New Workspace"})]}),N&&c.jsxs("div",{className:Ae.createForm,children:[c.jsx("input",{type:"text",value:A,onChange:B=>M(B.target.value),onKeyDown:W,placeholder:"Workspace name...",autoFocus:!0,disabled:v,className:Ae.createInput,"data-testid":"workspace-create-input"}),c.jsx("button",{onClick:oe,className:Ae.btnPrimary,disabled:v||!A.trim(),"data-testid":"workspace-create-submit",children:v?c.jsx(Hh,{size:"sm",label:"Creating"}):"Create"}),c.jsx("button",{onClick:()=>{k(!1),M("")},className:Ae.btnOutline,children:"Cancel"})]}),z.length===0&&!N&&c.jsx("p",{className:Ae.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:Ae.cardList,children:z.map(B=>c.jsx(e5,{workspace:B,confirmArchiveId:C,onOpen:()=>a(Ri(B.id)),onArchive:()=>E(B.id),onConfirmArchive:()=>te(B.id),onCancelArchive:()=>E(void 0)},B.id))})]})]})}function e5({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:f}){const u=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return c.jsxs("div",{className:Ae.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:Ae.cardHeader,children:[c.jsx("strong",{className:Ae.cardName,children:n.name}),c.jsxs("div",{className:Ae.cardActions,children:[c.jsx("button",{className:Ae.btnSmall,onClick:i,children:"Open"}),u?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:Ae.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:Ae.btnSmall,onClick:f,children:"Cancel"})]}):c.jsx("button",{className:Ae.btnSmall,onClick:o,children:"Archive"})]})]}),n.description&&c.jsx("p",{className:Ae.cardDescription,children:n.description}),n.repoUrl&&c.jsx("div",{className:Ae.cardMeta,children:p?c.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ae.repoLink,children:n.repoUrl}):c.jsx("span",{children:n.repoUrl})})]})}const t5={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function n5(){const a=At().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=t5[a],o=VO(i);return c.jsxs("div",{className:ao.layout,children:[c.jsx(qi,{segments:o}),c.jsx("div",{className:ao.content,children:c.jsx("div",{className:ao.tabPanel,children:c.jsx(Jf,{})},a)})]})}const a5="_section_1ingb_14",s5="_sectionTitle_1ingb_26",i5="_sectionDescription_1ingb_35",l5="_tokenList_1ingb_48",o5="_tokenRow_1ingb_55",r5="_tokenBadge_1ingb_68",c5="_tokenName_1ingb_83",u5="_tokenTarget_1ingb_90",d5="_deleteButton_1ingb_99",f5="_addForm_1ingb_113",h5="_formRow_1ingb_119",p5="_input_1ingb_125",m5="_select_1ingb_155",g5="_addButton_1ingb_187",v5="_emptyStateInfo_1ingb_221",y5="_themeOptions_1ingb_229",b5="_themeOption_1ingb_229",x5="_themeOptionSelected_1ingb_254",_5="_themeOptionHeader_1ingb_259",S5="_themeOptionLabel_1ingb_266",T5="_themeOptionDesc_1ingb_273",k5="_variantToggle_1ingb_279",C5="_variantButton_1ingb_286",E5="_variantActive_1ingb_305",N5="_themeSwatches_1ingb_311",A5="_themeSwatch_1ingb_311",j5="_systemToggle_1ingb_325",w5="_systemToggleHint_1ingb_341",D5="_themeActive_1ingb_348",M5="_aboutGrid_1ingb_354",R5="_aboutItem_1ingb_360",O5="_aboutLabel_1ingb_373",B5="_aboutValue_1ingb_379",I5="_aboutDot_1ingb_387",L5="_aboutDotConnected_1ingb_394",z5="_aboutDotDisconnected_1ingb_398",de={section:a5,sectionTitle:s5,sectionDescription:i5,tokenList:l5,tokenRow:o5,tokenBadge:r5,tokenName:c5,tokenTarget:u5,deleteButton:d5,addForm:f5,formRow:h5,input:p5,select:m5,addButton:g5,emptyStateInfo:v5,themeOptions:y5,themeOption:b5,themeOptionSelected:x5,themeOptionHeader:_5,themeOptionLabel:S5,themeOptionDesc:T5,variantToggle:k5,variantButton:C5,variantActive:E5,themeSwatches:N5,themeSwatch:A5,systemToggle:j5,systemToggleHint:w5,themeActive:D5,aboutGrid:M5,aboutItem:R5,aboutLabel:O5,aboutValue:B5,aboutDot:I5,aboutDotConnected:L5,aboutDotDisconnected:z5},U5=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function V5(){const{credentialProviders:n,updateCredentialProviders:a}=at(),i=(o,r)=>{const f={...n};o==="claude"?f.claude=r:f[o]=r,a(f)};return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),c.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),c.jsx("div",{className:de.tokenList,children:U5.map(o=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:o.label}),c.jsx("span",{className:de.tokenTarget,children:o.description}),c.jsx("select",{className:de.select,value:n[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const H5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function G5(){const{tokens:n,setToken:a,deleteToken:i}=at(),{showToast:o}=Gi(),[r,f]=_.useState(""),[u,p]=_.useState(""),[m,g]=_.useState("env_var"),[y,v]=_.useState(""),[b,S]=_.useState(null),C=k=>{if(k.preventDefault(),!r||!u)return;const A=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,u,m,A,m==="file"?y:""),o("Token saved successfully","success"),f(""),p(""),v("")},E=k=>{S(k)},N=()=>{b&&(i(b),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Ec,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),c.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:n.map(k=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:k.tokenType}),c.jsx("span",{className:de.tokenName,children:k.name}),c.jsx("span",{className:de.tokenTarget,children:k.tokenType==="env_var"?k.envVar:k.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>E(k.name),title:`Delete ${k.name}`,children:"×"})]},k.name))}),c.jsxs("form",{className:de.addForm,onSubmit:C,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:k=>f(k.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:u,onChange:k=>p(k.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:k=>g(k.target.value),children:H5.map(k=>c.jsx("option",{value:k.value,children:k.label},k.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:k=>v(k.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function P5(){return c.jsxs(c.Fragment,{children:[c.jsx(V5,{}),c.jsx(G5,{})]})}const $5="_container_xb7ms_1",F5="_header_xb7ms_7",q5="_form_xb7ms_19",Y5="_formActions_xb7ms_87",K5="_list_xb7ms_93",Z5="_card_xb7ms_99",X5="_active_xb7ms_109",Q5="_cardHeader_xb7ms_113",W5="_cardTitle_xb7ms_123",J5="_defaultBadge_xb7ms_129",eI="_cardActions_xb7ms_143",tI="_description_xb7ms_148",nI="_meta_xb7ms_154",aI="_promptDetails_xb7ms_171",sI="_promptText_xb7ms_183",iI="_empty_xb7ms_200",lI="_btnPrimary_xb7ms_206",oI="_btnSecondary_xb7ms_240",rI="_btnSmall_xb7ms_267",cI="_btnDanger_xb7ms_293",uI="_typeToggle_xb7ms_336",dI="_typeBadge_xb7ms_350",fI="_scriptEditor_xb7ms_364",hI="_optional_xb7ms_371",Ve={container:$5,header:F5,form:q5,formActions:Y5,list:K5,card:Z5,active:X5,cardHeader:Q5,cardTitle:W5,defaultBadge:J5,cardActions:eI,description:tI,meta:nI,promptDetails:aI,promptText:sI,empty:iI,btnPrimary:lI,btnSecondary:oI,btnSmall:rI,btnDanger:cI,typeToggle:uI,typeBadge:dI,scriptEditor:fI,optional:hI};function pI(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:f}=at(),[u,p]=_.useState(null),[m,g]=_.useState(!1),[y,v]=_.useState(null),[b,S]=_.useState(""),[C,E]=_.useState(""),[N,k]=_.useState(""),[A,M]=_.useState("claude-code"),[D,z]=_.useState("sonnet"),[Y,R]=_.useState(0),[O,G]=_.useState("agent"),[ee,ne]=_.useState(""),ae=()=>{S(""),E(""),k(""),M("claude-code"),z("sonnet"),R(0),G("agent"),ne("")},oe=()=>{ae(),p(null),g(!0)},W=I=>{S(I.name),E(I.description),k(I.systemPrompt);const ie=I.type==="script"?"script":"agent";M(ie==="script"?I.runtime||"genaiscript":I.runtime),z(I.model),R(I.maxTurns),G(ie),ne(I.script||""),p(I),g(!1)},te=I=>{G(I),I==="script"?M("genaiscript"):A==="genaiscript"&&M("claude-code")},B=I=>{if(I.preventDefault(),!!b.trim()){if(O==="script"){if(!ee.trim())return}else if(!N.trim()||!A||!D)return;u?(i(u.id,b,C,N,A,D,Y,O,ee),p(null)):(a(b,C,N,A,D,Y,O,ee),g(!1)),ae()}},q=I=>{o(I),v(null),(u==null?void 0:u.id)===I&&(p(null),ae())},U=()=>{p(null),g(!1),ae()},re=()=>c.jsxs("form",{onSubmit:B,className:Ve.form,children:[c.jsx("h3",{children:u?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:Ve.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:O==="agent",onChange:()=>te("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:O==="script",onChange:()=>te("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:I=>S(I.target.value),placeholder:O==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:C,onChange:I=>E(I.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:A,onChange:I=>M(I.target.value),"data-testid":"persona-runtime-select",children:O==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),O==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:D,onChange:I=>z(I.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:Y,onChange:I=>R(parseInt(I.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:I=>k(I.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),O==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:Ve.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:D,onChange:I=>z(I.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:Ve.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:I=>k(I.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:ee,onChange:I=>ne(I.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
94
|
+
|
|
95
|
+
const grackle = await host.mcpServer({
|
|
96
|
+
id: "grackle",
|
|
97
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
$\`Summarize the current tasks.\`;`,rows:20,className:Ve.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:Ve.formActions,children:[c.jsx("button",{type:"submit",className:Ve.btnPrimary,children:u?"Save":"Create"}),c.jsx("button",{type:"button",onClick:U,className:Ve.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:Ve.container,children:[c.jsxs("div",{className:Ve.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:oe,className:Ve.btnPrimary,children:"+ New Persona"})]}),(m||u)&&re(),n.length===0&&!m?c.jsx("p",{className:Ve.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:Ve.list,children:n.map(I=>{const ie=r===I.id,he=I.type==="script";return c.jsxs("div",{className:`${Ve.card} ${(u==null?void 0:u.id)===I.id?Ve.active:""}`,"data-testid":`persona-card-${I.id}`,children:[c.jsxs("div",{className:Ve.cardHeader,children:[c.jsxs("span",{className:Ve.cardTitle,children:[c.jsx("strong",{children:I.name}),c.jsx("span",{className:Ve.typeBadge,"data-testid":`persona-type-badge-${I.id}`,children:he?"Script":"Agent"}),ie&&c.jsx("span",{className:Ve.defaultBadge,"data-testid":`persona-default-badge-${I.id}`,children:"App Default"})]}),c.jsxs("div",{className:Ve.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>f(I.id),className:Ve.btnSmall,"data-testid":`persona-set-default-${I.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>W(I),className:Ve.btnSmall,children:"Edit"}),y===I.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>q(I.id),className:Ve.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:Ve.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(I.id),className:Ve.btnSmall,children:"Delete"})]})]}),I.description&&c.jsx("p",{className:Ve.description,children:I.description}),c.jsxs("div",{className:Ve.meta,children:[I.runtime&&c.jsxs("span",{children:["Runtime: ",I.runtime]}),I.model&&c.jsxs("span",{children:["Model: ",I.model]}),I.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",I.maxTurns]})]}),he?c.jsxs("details",{className:Ve.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:Ve.promptText,children:I.script})]}):c.jsxs("details",{className:Ve.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:Ve.promptText,children:I.systemPrompt})]})]},I.id)})})]})}function mI(){return c.jsx(pI,{})}function gI(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=bb();return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),c.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:de.themeOptions,children:bc.filter(f=>!f.hidden).map(f=>{const u=!!(f.variantLightId&&f.variantDarkId),p=u?n===f.id||n===f.variantLightId||n===f.variantDarkId:n===f.id,m=u&&a===f.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(f.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:f.label}),c.jsx("span",{className:de.themeOptionDesc,children:f.description})]}),u&&c.jsxs("span",{className:de.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(f.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(f.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(f.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),f.swatches&&c.jsx("span",{className:de.themeSwatches,children:f.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},f.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:f=>r(f.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:de.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function vI(){return c.jsx(gI,{})}function yI(){const{connected:n,environments:a,sessions:i}=at(),o=a.filter(u=>u.status==="connected").length,r=a.length,f=i.filter(u=>["running","idle"].includes(u.status)).length;return c.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:de.sectionTitle,children:"About"}),c.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:de.aboutGrid,children:[c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Connection"}),c.jsxs("span",{className:de.aboutValue,children:[c.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:f})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.59.0"})]})]})]})}function bI(){return c.jsx(yI,{})}const xI="_wizard_1260s_1",_I="_container_1260s_10",SI="_stepContent_1260s_19",TI="_logoArea_1260s_28",kI="_logoImage_1260s_32",CI="_heading_1260s_41",EI="_tagline_1260s_49",NI="_subtitle_1260s_56",AI="_featureList_1260s_64",jI="_runtimeGrid_1260s_89",wI="_runtimeCard_1260s_101",DI="_runtimeName_1260s_133",MI="_runtimeDescription_1260s_139",RI="_buttonRow_1260s_144",OI="_primaryButton_1260s_151",BI="_ghostButton_1260s_185",II="_dots_1260s_213",LI="_dot_1260s_213",We={wizard:xI,container:_I,stepContent:SI,logoArea:TI,logoImage:kI,heading:CI,tagline:EI,subtitle:NI,featureList:AI,runtimeGrid:jI,runtimeCard:wI,runtimeName:DI,runtimeDescription:MI,buttonRow:RI,primaryButton:OI,ghostButton:BI,dots:II,dot:LI};function zI({onNext:n}){return c.jsxs("div",{className:We.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:We.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:We.logoImage})}),c.jsx("h1",{className:We.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:We.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function UI({onNext:n,onBack:a}){return c.jsxs("div",{className:We.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:We.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:We.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:We.buttonRow,children:[c.jsx("button",{type:"button",className:We.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const VI=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"}];function HI({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:o}){const[r,f]=_.useState(n||"claude-code");return _.useEffect(()=>{n&&f(n)},[n]),c.jsxs("div",{className:We.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:We.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:We.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:We.runtimeGrid,children:VI.map(u=>c.jsxs("button",{type:"button",className:We.runtimeCard,"data-selected":r===u.id,"aria-pressed":r===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>f(u.id),children:[c.jsx("span",{className:We.runtimeName,children:u.name}),c.jsx("span",{className:We.runtimeDescription,children:u.description})]},u.id))}),c.jsxs("div",{className:We.buttonRow,children:[c.jsx("button",{type:"button",className:We.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:We.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const GI=3,F0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3"};function PI(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=at(),r=Ut(),[f,u]=_.useState(0),p=n.find(g=>g.id==="claude-code"),m=_.useCallback(g=>{if(p&&g!==p.runtime){const v=F0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===C0);if(y&&g!==y.runtime){const v=F0[g]??"sonnet";a(C0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return o===!0?c.jsx(Ka,{to:"/",replace:!0}):c.jsx("div",{className:We.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:We.container,children:[c.jsx(qn,{mode:"wait",children:c.jsxs(St.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[f===0&&c.jsx(zI,{onNext:()=>u(1)}),f===1&&c.jsx(UI,{onNext:()=>u(2),onBack:()=>u(0)}),f===2&&c.jsx(HI,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>u(1),finishDisabled:!p})]},f)}),c.jsx("div",{className:We.dots,children:Array.from({length:GI},(g,y)=>c.jsx("span",{className:We.dot,"data-active":y===f},y))})]})})}const $I="_root_zndgp_1",FI="_body_zndgp_7",qI="_main_zndgp_19",YI="_sidebarWrapper_zndgp_26",KI="_overlay_zndgp_51",Fl={root:$I,body:FI,main:qI,sidebarWrapper:YI,overlay:KI},ZI=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function XI(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:o}=at(),{showToast:r}=Gi();IM(a,r);const f=Ut(),u=At(),[p,m]=_.useState(!1),g=_.useCallback(()=>m(y=>!y),[]);return _.useEffect(()=>{m(!1)},[u.pathname]),_.useEffect(()=>{if(!p)return;const y=v=>{v.key==="Escape"&&m(!1)};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[p]),_.useEffect(()=>{n&&!u.pathname.includes("/tasks/")&&f(db(n),{replace:!0})},[n,f,u.pathname]),i&&o===!1?c.jsx(Ka,{to:"/setup",replace:!0}):c.jsxs("div",{className:Fl.root,children:[c.jsx(DC,{onToggleSidebar:g,sidebarOpen:p}),c.jsx(LC,{}),c.jsxs("div",{className:Fl.body,children:[c.jsx("div",{className:Fl.sidebarWrapper,"data-sidebar-open":p,children:c.jsx(tD,{})}),p&&c.jsx("div",{className:Fl.overlay,"data-testid":"drawer-overlay",onClick:()=>m(!1)}),c.jsxs("div",{className:Fl.main,children:[c.jsx(Jf,{}),c.jsx(cD,{})]})]}),c.jsx(SD,{})]})}function QI(){return c.jsxs(sk,{children:[c.jsx(Re,{path:"setup",element:c.jsx(PI,{})}),c.jsxs(Re,{element:c.jsx(XI,{}),children:[c.jsx(Re,{index:!0,element:c.jsx(cO,{})}),c.jsx(Re,{path:"chat",element:c.jsx(zO,{})}),c.jsx(Re,{path:"tasks",element:c.jsx(oO,{})}),c.jsx(Re,{path:"tasks/new",element:c.jsx(B6,{})}),c.jsx(Re,{path:"tasks/:taskId",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"tasks/:taskId/stream",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"tasks/:taskId/findings",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(Re,{path:"workspaces",element:c.jsx(Ka,{to:"/environments",replace:!0})}),c.jsx(Re,{path:"workspaces/:workspaceId",element:c.jsx(h6,{})}),c.jsx(Re,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Ci,{})}),c.jsx(Re,{path:"workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(G0,{})}),c.jsx(Re,{path:"sessions/new",element:c.jsx(FO,{})}),c.jsx(Re,{path:"sessions/:sessionId",element:c.jsx(KO,{})}),c.jsxs(Re,{path:"environments",element:c.jsx(T4,{}),children:[c.jsx(Re,{index:!0,element:c.jsx(rO,{})}),c.jsx(Re,{path:"new",element:c.jsx(y4,{})}),c.jsx(Re,{path:":environmentId",element:c.jsx(J4,{})}),c.jsx(Re,{path:":environmentId/edit",element:c.jsx(b4,{})})]}),c.jsxs(Re,{path:"settings",element:c.jsx(n5,{}),children:[c.jsx(Re,{index:!0,element:c.jsx(Ka,{to:"credentials",replace:!0})}),c.jsx(Re,{path:"environments",element:c.jsx(Ka,{to:"/environments",replace:!0})}),c.jsx(Re,{path:"credentials",element:c.jsx(P5,{})}),c.jsx(Re,{path:"tokens",element:c.jsx(Ka,{to:"../credentials",replace:!0})}),c.jsx(Re,{path:"personas",element:c.jsx(mI,{})}),c.jsx(Re,{path:"appearance",element:c.jsx(vI,{})}),c.jsx(Re,{path:"about",element:c.jsx(bI,{})})]}),c.jsx(Re,{path:"*",element:c.jsx(Ka,{to:"/",replace:!0})})]})]})}const WI=1e4;function JI(){const{onboardingCompleted:n}=at(),[a,i]=_.useState(!1);_.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),WI);return()=>clearTimeout(r)},[n]);const o=n===void 0&&!a;return c.jsx(qn,{mode:"wait",children:o?c.jsx(St.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(BM,{})},"splash"):c.jsx(St.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(jk,{children:c.jsx(QI,{})})},"app")})}function eL(){const n=ZI?mC:lC;return c.jsx(_C,{children:c.jsx(vC,{children:c.jsx(n,{children:c.jsx(JI,{})})})})}qS.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx(eL,{})}));
|