@grackle-ai/web 0.75.12 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,112 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-C1HWFBSg.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/grpc-C9KtwZNl.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
- import{r as h1,a as b,j as r,v as m1,b as p1,t as Ar,i as v1,f as g1,M as Rf,c as Mf}from"./markdown-gcy1Jmzi.js";import{r as y1,d as jg,H as Ng,P as wg,i as b1,B as x1,a as _1,C as S1,M as T1}from"./dagview-BA5TtMAQ.js";import{c as k1,a as C1,G as j1,e as N1,w as w1,t as E1,p as Dr,b as A1,C as Of,f as D1,M as R1,R as Oo,S as Eg}from"./grpc-C9KtwZNl.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}})();var Rd={exports:{}},Bo={},Md={exports:{}},Od={};/**
3
- * @license React
4
- * scheduler.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Ag;function M1(){return Ag||(Ag=1,(function(n){function a(O,$){var se=O.length;O.push($);e:for(;0<se;){var oe=se-1>>>1,Y=O[oe];if(0<c(Y,$))O[oe]=$,O[se]=Y,se=oe;else break e}}function i(O){return O.length===0?null:O[0]}function l(O){if(O.length===0)return null;var $=O[0],se=O.pop();if(se!==$){O[0]=se;e:for(var oe=0,Y=O.length,be=Y>>>1;oe<be;){var Ne=2*(oe+1)-1,xe=O[Ne],J=Ne+1,le=O[J];if(0>c(xe,se))J<Y&&0>c(le,xe)?(O[oe]=le,O[J]=se,oe=J):(O[oe]=xe,O[Ne]=se,oe=Ne);else if(J<Y&&0>c(le,se))O[oe]=le,O[J]=se,oe=J;else break e}}return $}function c(O,$){var se=O.sortIndex-$.sortIndex;return se!==0?se:O.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],v=[],g=1,y=null,x=3,S=!1,T=!1,j=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(O){for(var $=i(v);$!==null;){if($.callback===null)l(v);else if($.startTime<=O)l(v),$.sortIndex=$.expirationTime,a(p,$);else break;$=i(v)}}function E(O){if(j=!1,R(O),!T)if(i(p)!==null)T=!0,H||(H=!0,ce());else{var $=i(v);$!==null&&ae(E,$.startTime-O)}}var H=!1,z=-1,I=5,P=-1;function ee(){return N?!0:!(n.unstable_now()-P<I)}function ne(){if(N=!1,H){var O=n.unstable_now();P=O;var $=!0;try{e:{T=!1,j&&(j=!1,w(z),z=-1),S=!0;var se=x;try{t:{for(R(O),y=i(p);y!==null&&!(y.expirationTime>O&&ee());){var oe=y.callback;if(typeof oe=="function"){y.callback=null,x=y.priorityLevel;var Y=oe(y.expirationTime<=O);if(O=n.unstable_now(),typeof Y=="function"){y.callback=Y,R(O),$=!0;break t}y===i(p)&&l(p),R(O)}else l(p);y=i(p)}if(y!==null)$=!0;else{var be=i(v);be!==null&&ae(E,be.startTime-O),$=!1}}break e}finally{y=null,x=se,S=!1}$=void 0}}finally{$?ce():H=!1}}}var ce;if(typeof A=="function")ce=function(){A(ne)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,K=re.port2;re.port1.onmessage=ne,ce=function(){K.postMessage(null)}}else ce=function(){C(ne,0)};function ae(O,$){z=C(function(){O(n.unstable_now())},$)}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(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(O){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var se=x;x=$;try{return O()}finally{x=se}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var se=x;x=O;try{return $()}finally{x=se}},n.unstable_scheduleCallback=function(O,$,se){var oe=n.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?oe+se:oe):se=oe,O){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=se+Y,O={id:g++,callback:$,priorityLevel:O,startTime:se,expirationTime:Y,sortIndex:-1},se>oe?(O.sortIndex=se,a(v,O),i(p)===null&&O===i(v)&&(j?(w(z),z=-1):j=!0,ae(E,se-oe))):(O.sortIndex=Y,a(p,O),T||S||(T=!0,H||(H=!0,ce()))),O},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(O){var $=x;return function(){var se=x;x=$;try{return O.apply(this,arguments)}finally{x=se}}}})(Od)),Od}var Dg;function O1(){return Dg||(Dg=1,Md.exports=M1()),Md.exports}/**
11
- * @license React
12
- * react-dom-client.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var Rg;function B1(){if(Rg)return Bo;Rg=1;var n=O1(),a=h1(),i=y1();function l(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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(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 f(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 m(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 p(e){if(d(e)!==e)throw Error(l(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return p(u),e;if(h===o)return p(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var _=!1,k=u.child;k;){if(k===s){_=!0,s=u,o=h;break}if(k===o){_=!0,o=u,s=h;break}k=k.sibling}if(!_){for(k=h.child;k;){if(k===s){_=!0,s=h,o=u;break}if(k===o){_=!0,o=h,s=u;break}k=k.sibling}if(!_)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case E:return"Suspense";case H:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case A:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var ae=Array.isArray,O=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},oe=[],Y=-1;function be(e){return{current:e}}function Ne(e){0>Y||(e.current=oe[Y],oe[Y]=null,Y--)}function xe(e,t){Y++,oe[Y]=e.current,e.current=t}var J=be(null),le=be(null),W=be(null),tt=be(null);function Re(e,t){switch(xe(W,t),xe(le,e),xe(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zv(t),e=Xv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ne(J),xe(J,e)}function An(){Ne(J),Ne(le),Ne(W)}function xa(e){e.memoizedState!==null&&xe(tt,e);var t=J.current,s=Xv(t,e.type);t!==s&&(xe(le,e),xe(J,s))}function fn(e){le.current===e&&(Ne(J),Ne(le)),tt.current===e&&(Ne(tt),Ao._currentValue=se)}var Fn,Ln;function hn(e){if(Fn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Fn=t&&t[1]||"",Ln=-1<s.stack.indexOf(`
19
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
- `+Fn+e+Ln}var In=!1;function Te(e,t){if(!e||In)return"";In=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={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(q){var G=q}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(q){G=q}e.call(Q.prototype)}}else{try{throw Error()}catch(q){G=q}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(q){if(q&&G&&typeof q.stack=="string")return[q.stack,G.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),_=h[0],k=h[1];if(_&&k){var D=_.split(`
21
- `),V=k.split(`
22
- `);for(u=o=0;o<D.length&&!D[o].includes("DetermineComponentFrameRoot");)o++;for(;u<V.length&&!V[u].includes("DetermineComponentFrameRoot");)u++;if(o===D.length||u===V.length)for(o=D.length-1,u=V.length-1;1<=o&&0<=u&&D[o]!==V[u];)u--;for(;1<=o&&0<=u;o--,u--)if(D[o]!==V[u]){if(o!==1||u!==1)do if(o--,u--,0>u||D[o]!==V[u]){var F=`
23
- `+D[o].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=o&&0<=u);break}}}finally{In=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?hn(s):""}function kt(e,t){switch(e.tag){case 26:case 27:case 5:return hn(e.type);case 16:return hn("Lazy");case 13:return e.child!==t&&t!==null?hn("Suspense Fallback"):hn("Suspense");case 19:return hn("SuspenseList");case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return hn("Activity");default:return""}}function Hi(e){try{var t="",s=null;do t+=kt(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
24
- Error generating stack: `+o.message+`
25
- `+o.stack}}var Rs=Object.prototype.hasOwnProperty,Ms=n.unstable_scheduleCallback,Os=n.unstable_cancelCallback,hl=n.unstable_shouldYield,ml=n.unstable_requestPaint,Ut=n.unstable_now,pl=n.unstable_getCurrentPriorityLevel,vl=n.unstable_ImmediatePriority,X=n.unstable_UserBlockingPriority,ie=n.unstable_NormalPriority,fe=n.unstable_LowPriority,_e=n.unstable_IdlePriority,ge=n.log,Je=n.unstable_setDisableYieldValue,Se=null,Ie=null;function ze(e){if(typeof ge=="function"&&Je(e),Ie&&typeof Ie.setStrictMode=="function")try{Ie.setStrictMode(Se,e)}catch{}}var Ye=Math.clz32?Math.clz32:Jt,Et=Math.log,Gt=Math.LN2;function Jt(e){return e>>>=0,e===0?32:31-(Et(e)/Gt|0)|0}var Ct=256,_a=262144,mn=4194304;function Dn(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 gl(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var k=o&134217727;return k!==0?(o=k&~h,o!==0?u=Dn(o):(_&=k,_!==0?u=Dn(_):s||(s=k&~e,s!==0&&(u=Dn(s))))):(k=o&~h,k!==0?u=Dn(k):_!==0?u=Dn(_):s||(s=o&~e,s!==0&&(u=Dn(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function Gi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function e_(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 Ah(){var e=mn;return mn<<=1,(mn&62914560)===0&&(mn=4194304),e}function xc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Pi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function t_(e,t,s,o,u,h){var _=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 k=e.entanglements,D=e.expirationTimes,V=e.hiddenUpdates;for(s=_&~s;0<s;){var F=31-Ye(s),Q=1<<F;k[F]=0,D[F]=-1;var G=V[F];if(G!==null)for(V[F]=null,F=0;F<G.length;F++){var q=G[F];q!==null&&(q.lane&=-536870913)}s&=~Q}o!==0&&Dh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Dh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ye(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Rh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ye(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Mh(e,t){var s=t&-t;return s=(s&42)!==0?1:_c(s),(s&(e.suspendedLanes|t))!==0?0:s}function _c(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 Sc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Oh(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:bg(e.type))}function Bh(e,t){var s=$.p;try{return $.p=e,t()}finally{$.p=s}}var Sa=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Sa,qt="__reactProps$"+Sa,Bs="__reactContainer$"+Sa,Tc="__reactEvents$"+Sa,n_="__reactListeners$"+Sa,a_="__reactHandles$"+Sa,Lh="__reactResources$"+Sa,$i="__reactMarker$"+Sa;function kc(e){delete e[Mt],delete e[qt],delete e[Tc],delete e[n_],delete e[a_]}function Ls(e){var t=e[Mt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Bs]||s[Mt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=ag(e);e!==null;){if(s=e[Mt])return s;e=ag(e)}return t}e=s,s=e.parentNode}return null}function Is(e){if(e=e[Mt]||e[Bs]){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(l(33))}function zs(e){var t=e[Lh];return t||(t=e[Lh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[$i]=!0}var Ih=new Set,zh={};function Ja(e,t){Us(e,t),Us(e+"Capture",t)}function Us(e,t){for(zh[e]=t,e=0;e<t.length;e++)Ih.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]*$"),Uh={},Vh={};function i_(e){return Rs.call(Vh,e)?!0:Rs.call(Uh,e)?!1:s_.test(e)?Vh[e]=!0:(Uh[e]=!0,!1)}function yl(e,t,s){if(i_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function bl(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 Zn(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}function pn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function o_(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cc(e){if(!e._valueTracker){var t=Hh(e)?"checked":"value";e._valueTracker=o_(e,t,""+e[t])}}function Gh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Hh(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function xl(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 l_=/[\n"\\]/g;function vn(e){return e.replace(l_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function jc(e,t,s,o,u,h,_,k){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+pn(t)):e.value!==""+pn(t)&&(e.value=""+pn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Nc(e,_,pn(t)):s!=null?Nc(e,_,pn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+pn(k):e.removeAttribute("name")}function Ph(e,t,s,o,u,h,_,k){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)){Cc(e);return}s=s!=null?""+pn(s):"",t=t!=null?""+pn(t):s,k||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=k?e.checked:!!o,e.defaultChecked=!!o,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Cc(e)}function Nc(e,t,s){t==="number"&&xl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Vs(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+pn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function $h(e,t,s){if(t!=null&&(t=""+pn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+pn(s):""}function qh(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(ae(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=pn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Cc(e)}function Hs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var r_=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 Yh(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||r_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Kh(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&Yh(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&Yh(e,h,t[h])}function wc(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 c_=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"]]),u_=/^[\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 _l(e){return u_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Ec=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gs=null,Ps=null;function Fh(e){var t=Is(e);if(t&&(e=t.stateNode)){var s=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(jc(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="'+vn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[qt]||null;if(!u)throw Error(l(90));jc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&Gh(o)}break e;case"textarea":$h(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Vs(e,!!s.multiple,t,!1)}}}var Dc=!1;function Zh(e,t,s){if(Dc)return e(t,s);Dc=!0;try{var o=e(t);return o}finally{if(Dc=!1,(Gs!==null||Ps!==null)&&(rr(),Gs&&(t=Gs,e=Ps,Ps=Gs=null,Fh(t),e)))for(t=0;t<e.length;t++)Fh(e[t])}}function Yi(e,t){var s=e.stateNode;if(s===null)return null;var o=s[qt]||null;if(o===null)return null;s=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=!1;if(Qn)try{var Ki={};Object.defineProperty(Ki,"passive",{get:function(){Rc=!0}}),window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{Rc=!1}var Ta=null,Mc=null,Sl=null;function Xh(){if(Sl)return Sl;var e,t=Mc,s=t.length,o,u="value"in Ta?Ta.value:Ta.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(o=1;o<=_&&t[s-o]===u[h-o];o++);return Sl=u.slice(e,1<o?1-o:void 0)}function Tl(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 kl(){return!0}function Qh(){return!1}function Yt(e){function t(s,o,u,h,_){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(h):h[k]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?kl:Qh,this.isPropagationStopped=Qh,this}return y(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=kl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),t}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cl=Yt(es),Fi=y({},es,{view:0,detail:0}),d_=Yt(Fi),Oc,Bc,Zi,jl=y({},Fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ic,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!==Zi&&(Zi&&e.type==="mousemove"?(Oc=e.screenX-Zi.screenX,Bc=e.screenY-Zi.screenY):Bc=Oc=0,Zi=e),Oc)},movementY:function(e){return"movementY"in e?e.movementY:Bc}}),Wh=Yt(jl),f_=y({},jl,{dataTransfer:0}),h_=Yt(f_),m_=y({},Fi,{relatedTarget:0}),Lc=Yt(m_),p_=y({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),v_=Yt(p_),g_=y({},es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),y_=Yt(g_),b_=y({},es,{data:0}),Jh=Yt(b_),x_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},__={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"},S_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function T_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=S_[e])?!!t[e]:!1}function Ic(){return T_}var k_=y({},Fi,{key:function(e){if(e.key){var t=x_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?__[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ic,charCode:function(e){return e.type==="keypress"?Tl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),C_=Yt(k_),j_=y({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),em=Yt(j_),N_=y({},Fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ic}),w_=Yt(N_),E_=y({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),A_=Yt(E_),D_=y({},jl,{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}),R_=Yt(D_),M_=y({},es,{newState:0,oldState:0}),O_=Yt(M_),B_=[9,13,27,32],zc=Qn&&"CompositionEvent"in window,Xi=null;Qn&&"documentMode"in document&&(Xi=document.documentMode);var L_=Qn&&"TextEvent"in window&&!Xi,tm=Qn&&(!zc||Xi&&8<Xi&&11>=Xi),nm=" ",am=!1;function sm(e,t){switch(e){case"keyup":return B_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function im(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $s=!1;function I_(e,t){switch(e){case"compositionend":return im(t);case"keypress":return t.which!==32?null:(am=!0,nm);case"textInput":return e=t.data,e===nm&&am?null:e;default:return null}}function z_(e,t){if($s)return e==="compositionend"||!zc&&sm(e,t)?(e=Xh(),Sl=Mc=Ta=null,$s=!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 tm&&t.locale!=="ko"?null:t.data;default:return null}}var U_={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 om(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!U_[e.type]:t==="textarea"}function lm(e,t,s,o){Gs?Ps?Ps.push(o):Ps=[o]:Gs=o,t=pr(t,"onChange"),0<t.length&&(s=new Cl("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var Qi=null,Wi=null;function V_(e){Pv(e,0)}function Nl(e){var t=qi(e);if(Gh(t))return e}function rm(e,t){if(e==="change")return t}var cm=!1;if(Qn){var Uc;if(Qn){var Vc="oninput"in document;if(!Vc){var um=document.createElement("div");um.setAttribute("oninput","return;"),Vc=typeof um.oninput=="function"}Uc=Vc}else Uc=!1;cm=Uc&&(!document.documentMode||9<document.documentMode)}function dm(){Qi&&(Qi.detachEvent("onpropertychange",fm),Wi=Qi=null)}function fm(e){if(e.propertyName==="value"&&Nl(Wi)){var t=[];lm(t,Wi,e,Ac(e)),Zh(V_,t)}}function H_(e,t,s){e==="focusin"?(dm(),Qi=t,Wi=s,Qi.attachEvent("onpropertychange",fm)):e==="focusout"&&dm()}function G_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nl(Wi)}function P_(e,t){if(e==="click")return Nl(t)}function $_(e,t){if(e==="input"||e==="change")return Nl(t)}function q_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:q_;function Ji(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Rs.call(t,u)||!en(e[u],t[u]))return!1}return!0}function hm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mm(e,t){var s=hm(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=hm(s)}}function pm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xl(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=xl(e.document)}return t}function Hc(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 Y_=Qn&&"documentMode"in document&&11>=document.documentMode,qs=null,Gc=null,eo=null,Pc=!1;function gm(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pc||qs==null||qs!==xl(o)||(o=qs,"selectionStart"in o&&Hc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),eo&&Ji(eo,o)||(eo=o,o=pr(Gc,"onSelect"),0<o.length&&(t=new Cl("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=qs)))}function ts(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ys={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},$c={},ym={};Qn&&(ym=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function ns(e){if($c[e])return $c[e];if(!Ys[e])return e;var t=Ys[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in ym)return $c[e]=t[s];return e}var bm=ns("animationend"),xm=ns("animationiteration"),_m=ns("animationstart"),K_=ns("transitionrun"),F_=ns("transitionstart"),Z_=ns("transitioncancel"),Sm=ns("transitionend"),Tm=new Map,qc="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(" ");qc.push("scrollEnd");function Rn(e,t){Tm.set(e,t),Ja(t,[e])}var wl=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)},gn=[],Ks=0,Yc=0;function El(){for(var e=Ks,t=Yc=Ks=0;t<e;){var s=gn[t];gn[t++]=null;var o=gn[t];gn[t++]=null;var u=gn[t];gn[t++]=null;var h=gn[t];if(gn[t++]=null,o!==null&&u!==null){var _=o.pending;_===null?u.next=u:(u.next=_.next,_.next=u),o.pending=u}h!==0&&km(s,u,h)}}function Al(e,t,s,o){gn[Ks++]=e,gn[Ks++]=t,gn[Ks++]=s,gn[Ks++]=o,Yc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Kc(e,t,s,o){return Al(e,t,s,o),Dl(e)}function as(e,t){return Al(e,null,null,t),Dl(e)}function km(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ye(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Dl(e){if(50<To)throw To=0,nd=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fs={};function X_(e,t,s,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,s,o){return new X_(e,t,s,o)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wn(e,t){var s=e.alternate;return s===null?(s=tn(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 Cm(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 Rl(e,t,s,o,u,h){var _=0;if(o=e,typeof e=="function")Fc(e)&&(_=1);else if(typeof e=="string")_=t1(e,s,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=tn(31,s,t,u),e.elementType=P,e.lanes=h,e;case j:return ss(s.children,u,h,t);case N:_=8,u|=24;break;case C:return e=tn(12,s,t,u|2),e.elementType=C,e.lanes=h,e;case E:return e=tn(13,s,t,u),e.elementType=E,e.lanes=h,e;case H:return e=tn(19,s,t,u),e.elementType=H,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:_=10;break e;case w:_=9;break e;case R:_=11;break e;case z:_=14;break e;case I:_=16,o=null;break e}_=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=tn(_,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function ss(e,t,s,o){return e=tn(7,e,o,t),e.lanes=s,e}function Zc(e,t,s){return e=tn(6,e,null,t),e.lanes=s,e}function jm(e){var t=tn(18,null,null,0);return t.stateNode=e,t}function Xc(e,t,s){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nm=new WeakMap;function yn(e,t){if(typeof e=="object"&&e!==null){var s=Nm.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Hi(t)},Nm.set(e,t),t)}return{value:e,source:t,stack:Hi(t)}}var Zs=[],Xs=0,Ml=null,to=0,bn=[],xn=0,ka=null,zn=1,Un="";function Jn(e,t){Zs[Xs++]=to,Zs[Xs++]=Ml,Ml=e,to=t}function wm(e,t,s){bn[xn++]=zn,bn[xn++]=Un,bn[xn++]=ka,ka=e;var o=zn;e=Un;var u=32-Ye(o)-1;o&=~(1<<u),s+=1;var h=32-Ye(t)+u;if(30<h){var _=u-u%5;h=(o&(1<<_)-1).toString(32),o>>=_,u-=_,zn=1<<32-Ye(t)+u|s<<u|o,Un=h+e}else zn=1<<h|s<<u|o,Un=e}function Qc(e){e.return!==null&&(Jn(e,1),wm(e,1,0))}function Wc(e){for(;e===Ml;)Ml=Zs[--Xs],Zs[Xs]=null,to=Zs[--Xs],Zs[Xs]=null;for(;e===ka;)ka=bn[--xn],bn[xn]=null,Un=bn[--xn],bn[xn]=null,zn=bn[--xn],bn[xn]=null}function Em(e,t){bn[xn++]=zn,bn[xn++]=Un,bn[xn++]=ka,zn=t.id,Un=t.overflow,ka=e}var Ot=null,at=null,Be=!1,Ca=null,_n=!1,Jc=Error(l(519));function ja(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw no(yn(t,e)),Jc}function Am(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Mt]=e,t[qt]=o,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<Co.length;s++)De(Co[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Ph(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),qh(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||Kv(t.textContent,s)?(o.popover!=null&&(De("beforetoggle",t),De("toggle",t)),o.onScroll!=null&&De("scroll",t),o.onScrollEnd!=null&&De("scrollend",t),o.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||ja(e,!0)}function Dm(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:_n=!1;return;case 27:case 3:_n=!0;return;default:Ot=Ot.return}}function Qs(e){if(e!==Ot)return!1;if(!Be)return Dm(e),Be=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||gd(e.type,e.memoizedProps)),s=!s),s&&at&&ja(e),Dm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=ng(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));at=ng(e)}else t===27?(t=at,Va(e.type)?(e=Sd,Sd=null,at=e):at=t):at=Ot?Tn(e.stateNode.nextSibling):null;return!0}function is(){at=Ot=null,Be=!1}function eu(){var e=Ca;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),Ca=null),e}function no(e){Ca===null?Ca=[e]:Ca.push(e)}var tu=be(null),os=null,ea=null;function Na(e,t,s){xe(tu,t._currentValue),t._currentValue=s}function ta(e){e._currentValue=tu.current,Ne(tu)}function nu(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function au(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var _=u.child;h=h.firstContext;e:for(;h!==null;){var k=h;h=u;for(var D=0;D<t.length;D++)if(k.context===t[D]){h.lanes|=s,k=h.alternate,k!==null&&(k.lanes|=s),nu(h.return,s,e),o||(_=null);break e}h=k.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(l(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),nu(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function Ws(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(l(387));if(_=_.memoizedProps,_!==null){var k=u.type;en(u.pendingProps.value,_.value)||(e!==null?e.push(k):e=[k])}}else if(u===tt.current){if(_=u.alternate,_===null)throw Error(l(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ao):e=[Ao])}u=u.return}e!==null&&au(t,e,s,o),t.flags|=262144}function Ol(e){for(e=e.firstContext;e!==null;){if(!en(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ls(e){os=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return Rm(os,e)}function Bl(e,t){return os===null&&ls(e),Rm(e,t)}function Rm(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ea===null){if(e===null)throw Error(l(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return s}var Q_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},W_=n.unstable_scheduleCallback,J_=n.unstable_NormalPriority,yt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function su(){return{controller:new Q_,data:new Map,refCount:0}}function ao(e){e.refCount--,e.refCount===0&&W_(J_,function(){e.controller.abort()})}var so=null,iu=0,Js=0,ei=null;function eS(e,t){if(so===null){var s=so=[];iu=0,Js=rd(),ei={status:"pending",value:void 0,then:function(o){s.push(o)}}}return iu++,t.then(Mm,Mm),t}function Mm(){if(--iu===0&&so!==null){ei!==null&&(ei.status="fulfilled");var e=so;so=null,Js=0,ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function tS(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Om=O.S;O.S=function(e,t){gv=Ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&eS(e,t),Om!==null&&Om(e,t)};var rs=be(null);function ou(){var e=rs.current;return e!==null?e:et.pooledCache}function Ll(e,t){t===null?xe(rs,rs.current):xe(rs,t.pool)}function Bm(){var e=ou();return e===null?null:{parent:yt._currentValue,pool:e}}var ti=Error(l(460)),lu=Error(l(474)),Il=Error(l(542)),zl={then:function(){}};function Lm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Im(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Xn,Xn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Um(e),e;default:if(typeof t.status=="string")t.then(Xn,Xn);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Um(e),e}throw us=t,ti}}function cs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(us=s,ti):s}}var us=null;function zm(){if(us===null)throw Error(l(459));var e=us;return us=null,e}function Um(e){if(e===ti||e===Il)throw Error(l(483))}var ni=null,io=0;function Ul(e){var t=io;return io+=1,ni===null&&(ni=[]),Im(ni,e,t)}function oo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vl(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Vm(e){function t(B,M){if(e){var U=B.deletions;U===null?(B.deletions=[M],B.flags|=16):U.push(M)}}function s(B,M){if(!e)return null;for(;M!==null;)t(B,M),M=M.sibling;return null}function o(B){for(var M=new Map;B!==null;)B.key!==null?M.set(B.key,B):M.set(B.index,B),B=B.sibling;return M}function u(B,M){return B=Wn(B,M),B.index=0,B.sibling=null,B}function h(B,M,U){return B.index=U,e?(U=B.alternate,U!==null?(U=U.index,U<M?(B.flags|=67108866,M):U):(B.flags|=67108866,M)):(B.flags|=1048576,M)}function _(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function k(B,M,U,Z){return M===null||M.tag!==6?(M=Zc(U,B.mode,Z),M.return=B,M):(M=u(M,U),M.return=B,M)}function D(B,M,U,Z){var me=U.type;return me===j?F(B,M,U.props.children,Z,U.key):M!==null&&(M.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===I&&cs(me)===M.type)?(M=u(M,U.props),oo(M,U),M.return=B,M):(M=Rl(U.type,U.key,U.props,null,B.mode,Z),oo(M,U),M.return=B,M)}function V(B,M,U,Z){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=Xc(U,B.mode,Z),M.return=B,M):(M=u(M,U.children||[]),M.return=B,M)}function F(B,M,U,Z,me){return M===null||M.tag!==7?(M=ss(U,B.mode,Z,me),M.return=B,M):(M=u(M,U),M.return=B,M)}function Q(B,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Zc(""+M,B.mode,U),M.return=B,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return U=Rl(M.type,M.key,M.props,null,B.mode,U),oo(U,M),U.return=B,U;case T:return M=Xc(M,B.mode,U),M.return=B,M;case I:return M=cs(M),Q(B,M,U)}if(ae(M)||ce(M))return M=ss(M,B.mode,U,null),M.return=B,M;if(typeof M.then=="function")return Q(B,Ul(M),U);if(M.$$typeof===A)return Q(B,Bl(B,M),U);Vl(B,M)}return null}function G(B,M,U,Z){var me=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return me!==null?null:k(B,M,""+U,Z);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return U.key===me?D(B,M,U,Z):null;case T:return U.key===me?V(B,M,U,Z):null;case I:return U=cs(U),G(B,M,U,Z)}if(ae(U)||ce(U))return me!==null?null:F(B,M,U,Z,null);if(typeof U.then=="function")return G(B,M,Ul(U),Z);if(U.$$typeof===A)return G(B,M,Bl(B,U),Z);Vl(B,U)}return null}function q(B,M,U,Z,me){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return B=B.get(U)||null,k(M,B,""+Z,me);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return B=B.get(Z.key===null?U:Z.key)||null,D(M,B,Z,me);case T:return B=B.get(Z.key===null?U:Z.key)||null,V(M,B,Z,me);case I:return Z=cs(Z),q(B,M,U,Z,me)}if(ae(Z)||ce(Z))return B=B.get(U)||null,F(M,B,Z,me,null);if(typeof Z.then=="function")return q(B,M,U,Ul(Z),me);if(Z.$$typeof===A)return q(B,M,U,Bl(M,Z),me);Vl(M,Z)}return null}function ue(B,M,U,Z){for(var me=null,He=null,he=M,we=M=0,Oe=null;he!==null&&we<U.length;we++){he.index>we?(Oe=he,he=null):Oe=he.sibling;var Ge=G(B,he,U[we],Z);if(Ge===null){he===null&&(he=Oe);break}e&&he&&Ge.alternate===null&&t(B,he),M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge,he=Oe}if(we===U.length)return s(B,he),Be&&Jn(B,we),me;if(he===null){for(;we<U.length;we++)he=Q(B,U[we],Z),he!==null&&(M=h(he,M,we),He===null?me=he:He.sibling=he,He=he);return Be&&Jn(B,we),me}for(he=o(he);we<U.length;we++)Oe=q(he,B,we,U[we],Z),Oe!==null&&(e&&Oe.alternate!==null&&he.delete(Oe.key===null?we:Oe.key),M=h(Oe,M,we),He===null?me=Oe:He.sibling=Oe,He=Oe);return e&&he.forEach(function(qa){return t(B,qa)}),Be&&Jn(B,we),me}function ve(B,M,U,Z){if(U==null)throw Error(l(151));for(var me=null,He=null,he=M,we=M=0,Oe=null,Ge=U.next();he!==null&&!Ge.done;we++,Ge=U.next()){he.index>we?(Oe=he,he=null):Oe=he.sibling;var qa=G(B,he,Ge.value,Z);if(qa===null){he===null&&(he=Oe);break}e&&he&&qa.alternate===null&&t(B,he),M=h(qa,M,we),He===null?me=qa:He.sibling=qa,He=qa,he=Oe}if(Ge.done)return s(B,he),Be&&Jn(B,we),me;if(he===null){for(;!Ge.done;we++,Ge=U.next())Ge=Q(B,Ge.value,Z),Ge!==null&&(M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge);return Be&&Jn(B,we),me}for(he=o(he);!Ge.done;we++,Ge=U.next())Ge=q(he,B,we,Ge.value,Z),Ge!==null&&(e&&Ge.alternate!==null&&he.delete(Ge.key===null?we:Ge.key),M=h(Ge,M,we),He===null?me=Ge:He.sibling=Ge,He=Ge);return e&&he.forEach(function(f1){return t(B,f1)}),Be&&Jn(B,we),me}function We(B,M,U,Z){if(typeof U=="object"&&U!==null&&U.type===j&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var me=U.key;M!==null;){if(M.key===me){if(me=U.type,me===j){if(M.tag===7){s(B,M.sibling),Z=u(M,U.props.children),Z.return=B,B=Z;break e}}else if(M.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===I&&cs(me)===M.type){s(B,M.sibling),Z=u(M,U.props),oo(Z,U),Z.return=B,B=Z;break e}s(B,M);break}else t(B,M);M=M.sibling}U.type===j?(Z=ss(U.props.children,B.mode,Z,U.key),Z.return=B,B=Z):(Z=Rl(U.type,U.key,U.props,null,B.mode,Z),oo(Z,U),Z.return=B,B=Z)}return _(B);case T:e:{for(me=U.key;M!==null;){if(M.key===me)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){s(B,M.sibling),Z=u(M,U.children||[]),Z.return=B,B=Z;break e}else{s(B,M);break}else t(B,M);M=M.sibling}Z=Xc(U,B.mode,Z),Z.return=B,B=Z}return _(B);case I:return U=cs(U),We(B,M,U,Z)}if(ae(U))return ue(B,M,U,Z);if(ce(U)){if(me=ce(U),typeof me!="function")throw Error(l(150));return U=me.call(U),ve(B,M,U,Z)}if(typeof U.then=="function")return We(B,M,Ul(U),Z);if(U.$$typeof===A)return We(B,M,Bl(B,U),Z);Vl(B,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(s(B,M.sibling),Z=u(M,U),Z.return=B,B=Z):(s(B,M),Z=Zc(U,B.mode,Z),Z.return=B,B=Z),_(B)):s(B,M)}return function(B,M,U,Z){try{io=0;var me=We(B,M,U,Z);return ni=null,me}catch(he){if(he===ti||he===Il)throw he;var He=tn(29,he,null,B.mode);return He.lanes=Z,He.return=B,He}finally{}}}var ds=Vm(!0),Hm=Vm(!1),wa=!1;function ru(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cu(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 Ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,($e&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Dl(e),km(e,null,s),t}return Al(e,o,t,s),Dl(e)}function lo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Rh(e,s)}}function uu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var du=!1;function ro(){if(du){var e=ei;if(e!==null)throw e}}function co(e,t,s,o){du=!1;var u=e.updateQueue;wa=!1;var h=u.firstBaseUpdate,_=u.lastBaseUpdate,k=u.shared.pending;if(k!==null){u.shared.pending=null;var D=k,V=D.next;D.next=null,_===null?h=V:_.next=V,_=D;var F=e.alternate;F!==null&&(F=F.updateQueue,k=F.lastBaseUpdate,k!==_&&(k===null?F.firstBaseUpdate=V:k.next=V,F.lastBaseUpdate=D))}if(h!==null){var Q=u.baseState;_=0,F=V=D=null,k=h;do{var G=k.lane&-536870913,q=G!==k.lane;if(q?(Me&G)===G:(o&G)===G){G!==0&&G===Js&&(du=!0),F!==null&&(F=F.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ue=e,ve=k;G=t;var We=s;switch(ve.tag){case 1:if(ue=ve.payload,typeof ue=="function"){Q=ue.call(We,Q,G);break e}Q=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ve.payload,G=typeof ue=="function"?ue.call(We,Q,G):ue,G==null)break e;Q=y({},Q,G);break e;case 2:wa=!0}}G=k.callback,G!==null&&(e.flags|=64,q&&(e.flags|=8192),q=u.callbacks,q===null?u.callbacks=[G]:q.push(G))}else q={lane:G,tag:k.tag,payload:k.payload,callback:k.callback,next:null},F===null?(V=F=q,D=Q):F=F.next=q,_|=G;if(k=k.next,k===null){if(k=u.shared.pending,k===null)break;q=k,k=q.next,q.next=null,u.lastBaseUpdate=q,u.shared.pending=null}}while(!0);F===null&&(D=Q),u.baseState=D,u.firstBaseUpdate=V,u.lastBaseUpdate=F,h===null&&(u.shared.lanes=0),Ba|=_,e.lanes=_,e.memoizedState=Q}}function Gm(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Pm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Gm(s[e],t)}var ai=be(null),Hl=be(0);function $m(e,t){e=ua,xe(Hl,e),xe(ai,t),ua=e|t.baseLanes}function fu(){xe(Hl,ua),xe(ai,ai.current)}function hu(){ua=Hl.current,Ne(ai),Ne(Hl)}var nn=be(null),Sn=null;function Da(e){var t=e.alternate;xe(pt,pt.current&1),xe(nn,e),Sn===null&&(t===null||ai.current!==null||t.memoizedState!==null)&&(Sn=e)}function mu(e){xe(pt,pt.current),xe(nn,e),Sn===null&&(Sn=e)}function qm(e){e.tag===22?(xe(pt,pt.current),xe(nn,e),Sn===null&&(Sn=e)):Ra()}function Ra(){xe(pt,pt.current),xe(nn,nn.current)}function an(e){Ne(nn),Sn===e&&(Sn=null),Ne(pt)}var pt=be(0);function Gl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||xd(s)||_d(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 na=0,je=null,Xe=null,bt=null,Pl=!1,si=!1,fs=!1,$l=0,uo=0,ii=null,nS=0;function ft(){throw Error(l(321))}function pu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!en(e[s],t[s]))return!1;return!0}function vu(e,t,s,o,u,h){return na=h,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?wp:Du,fs=!1,h=s(o,u),fs=!1,si&&(h=Km(t,s,o,u)),Ym(e),h}function Ym(e){O.H=mo;var t=Xe!==null&&Xe.next!==null;if(na=0,bt=Xe=je=null,Pl=!1,uo=0,ii=null,t)throw Error(l(300));e===null||xt||(e=e.dependencies,e!==null&&Ol(e)&&(xt=!0))}function Km(e,t,s,o){je=e;var u=0;do{if(si&&(ii=null),uo=0,si=!1,25<=u)throw Error(l(301));if(u+=1,bt=Xe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}O.H=Ep,h=t(s,o)}while(si);return h}function aS(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?fo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(je.flags|=1024),t}function gu(){var e=$l!==0;return $l=0,e}function yu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function bu(e){if(Pl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Pl=!1}na=0,bt=Xe=je=null,si=!1,uo=$l=0,ii=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?je.memoizedState=bt=e:bt=bt.next=e,bt}function vt(){if(Xe===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=bt===null?je.memoizedState:bt.next;if(t!==null)bt=t,Xe=e;else{if(e===null)throw je.alternate===null?Error(l(467)):Error(l(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},bt===null?je.memoizedState=bt=e:bt=bt.next=e}return bt}function ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fo(e){var t=uo;return uo+=1,ii===null&&(ii=[]),e=Im(ii,e,t),t=je,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?wp:Du),e}function Yl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fo(e);if(e.$$typeof===A)return Bt(e)}throw Error(l(438,String(e)))}function xu(e){var t=null,s=je.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=je.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=ql(),je.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ee;return t.index++,s}function aa(e,t){return typeof t=="function"?t(e):t}function Kl(e){var t=vt();return _u(t,Xe,e)}function _u(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var _=u.next;u.next=h.next,h.next=_}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var k=_=null,D=null,V=t,F=!1;do{var Q=V.lane&-536870913;if(Q!==V.lane?(Me&Q)===Q:(na&Q)===Q){var G=V.revertLane;if(G===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),Q===Js&&(F=!0);else if((na&G)===G){V=V.next,G===Js&&(F=!0);continue}else Q={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(k=D=Q,_=h):D=D.next=Q,je.lanes|=G,Ba|=G;Q=V.action,fs&&s(h,Q),h=V.hasEagerState?V.eagerState:s(h,Q)}else G={lane:Q,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(k=D=G,_=h):D=D.next=G,je.lanes|=Q,Ba|=Q;V=V.next}while(V!==null&&V!==t);if(D===null?_=h:D.next=k,!en(h,e.memoizedState)&&(xt=!0,F&&(s=ei,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=D,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Su(e){var t=vt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do h=e(h,_.action),_=_.next;while(_!==u);en(h,t.memoizedState)||(xt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function Fm(e,t,s){var o=je,u=vt(),h=Be;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var _=!en((Xe||u).memoizedState,s);if(_&&(u.memoizedState=s,xt=!0),u=u.queue,Cu(Qm.bind(null,o,u,e),[e]),u.getSnapshot!==t||_||bt!==null&&bt.memoizedState.tag&1){if(o.flags|=2048,oi(9,{destroy:void 0},Xm.bind(null,o,u,s,t),null),et===null)throw Error(l(349));h||(na&127)!==0||Zm(o,t,s)}return s}function Zm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=je.updateQueue,t===null?(t=ql(),je.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Xm(e,t,s,o){t.value=s,t.getSnapshot=o,Wm(t)&&Jm(e)}function Qm(e,t,s){return s(function(){Wm(t)&&Jm(e)})}function Wm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!en(e,s)}catch{return!0}}function Jm(e){var t=as(e,2);t!==null&&Qt(t,e,2)}function Tu(e){var t=Pt();if(typeof e=="function"){var s=e;if(e=s(),fs){ze(!0);try{s()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:e},t}function ep(e,t,s,o){return e.baseState=s,_u(e,Xe,typeof o=="function"?o:aa)}function sS(e,t,s,o,u){if(Xl(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};O.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,tp(t,h)):(h.next=s.next,t.pending=s.next=h)}}function tp(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=O.T,_={};O.T=_;try{var k=s(u,o),D=O.S;D!==null&&D(_,k),np(e,t,k)}catch(V){ku(e,t,V)}finally{h!==null&&_.types!==null&&(h.types=_.types),O.T=h}}else try{h=s(u,o),np(e,t,h)}catch(V){ku(e,t,V)}}function np(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){ap(e,t,o)},function(o){return ku(e,t,o)}):ap(e,t,s)}function ap(e,t,s){t.status="fulfilled",t.value=s,sp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,tp(e,s)))}function ku(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,sp(t),t=t.next;while(t!==o)}e.action=null}function sp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ip(e,t){return t}function op(e,t){if(Be){var s=et.formState;if(s!==null){e:{var o=je;if(Be){if(at){t:{for(var u=at,h=_n;u.nodeType!==8;){if(!h){u=null;break t}if(u=Tn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){at=Tn(u.nextSibling),o=u.data==="F!";break e}}ja(o)}o=!1}o&&(t=s[0])}}return s=Pt(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ip,lastRenderedState:t},s.queue=o,s=Cp.bind(null,je,o),o.dispatch=s,o=Tu(!1),h=Au.bind(null,je,!1,o.queue),o=Pt(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=sS.bind(null,je,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function lp(e){var t=vt();return rp(t,Xe,e)}function rp(e,t,s){if(t=_u(e,t,ip)[0],e=Kl(aa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=fo(t)}catch(_){throw _===ti?Il:_}else o=t;t=vt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(je.flags|=2048,oi(9,{destroy:void 0},iS.bind(null,u,s),null)),[o,h,e]}function iS(e,t){e.action=t}function cp(e){var t=vt(),s=Xe;if(s!==null)return rp(t,s,e);vt(),t=t.memoizedState,s=vt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function oi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=je.updateQueue,t===null&&(t=ql(),je.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function up(){return vt().memoizedState}function Fl(e,t,s,o){var u=Pt();je.flags|=e,u.memoizedState=oi(1|t,{destroy:void 0},s,o===void 0?null:o)}function Zl(e,t,s,o){var u=vt();o=o===void 0?null:o;var h=u.memoizedState.inst;Xe!==null&&o!==null&&pu(o,Xe.memoizedState.deps)?u.memoizedState=oi(t,h,s,o):(je.flags|=e,u.memoizedState=oi(1|t,h,s,o))}function dp(e,t){Fl(8390656,8,e,t)}function Cu(e,t){Zl(2048,8,e,t)}function oS(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=ql(),je.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function fp(e){var t=vt().memoizedState;return oS({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function hp(e,t){return Zl(4,2,e,t)}function mp(e,t){return Zl(4,4,e,t)}function pp(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 vp(e,t,s){s=s!=null?s.concat([e]):null,Zl(4,4,pp.bind(null,t,e),s)}function ju(){}function gp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&pu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function yp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&pu(t,o[1]))return o[0];if(o=e(),fs){ze(!0);try{e()}finally{ze(!1)}}return s.memoizedState=[o,t],o}function Nu(e,t,s){return s===void 0||(na&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=bv(),je.lanes|=e,Ba|=e,s)}function bp(e,t,s,o){return en(s,t)?s:ai.current!==null?(e=Nu(e,s,o),en(e,t)||(xt=!0),e):(na&42)===0||(na&1073741824)!==0&&(Me&261930)===0?(xt=!0,e.memoizedState=s):(e=bv(),je.lanes|=e,Ba|=e,t)}function xp(e,t,s,o,u){var h=$.p;$.p=h!==0&&8>h?h:8;var _=O.T,k={};O.T=k,Au(e,!1,t,s);try{var D=u(),V=O.S;if(V!==null&&V(k,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var F=tS(D,o);ho(e,t,F,ln(e))}else ho(e,t,o,ln(e))}catch(Q){ho(e,t,{then:function(){},status:"rejected",reason:Q},ln())}finally{$.p=h,_!==null&&k.types!==null&&(_.types=k.types),O.T=_}}function lS(){}function wu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=_p(e).queue;xp(e,u,t,se,s===null?lS:function(){return Sp(e),s(o)})}function _p(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:se},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Sp(e){var t=_p(e);t.next===null&&(t=e.alternate.memoizedState),ho(e,t.next.queue,{},ln())}function Eu(){return Bt(Ao)}function Tp(){return vt().memoizedState}function kp(){return vt().memoizedState}function rS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=ln();e=Ea(s);var o=Aa(t,e,s);o!==null&&(Qt(o,t,s),lo(o,t,s)),t={cache:su()},e.payload=t;return}t=t.return}}function cS(e,t,s){var o=ln();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Xl(e)?jp(t,s):(s=Kc(e,t,s,o),s!==null&&(Qt(s,e,o),Np(s,t,o)))}function Cp(e,t,s){var o=ln();ho(e,t,s,o)}function ho(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Xl(e))jp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,k=h(_,s);if(u.hasEagerState=!0,u.eagerState=k,en(k,_))return Al(e,t,u,0),et===null&&El(),!1}catch{}finally{}if(s=Kc(e,t,u,o),s!==null)return Qt(s,e,o),Np(s,t,o),!0}return!1}function Au(e,t,s,o){if(o={lane:2,revertLane:rd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Xl(e)){if(t)throw Error(l(479))}else t=Kc(e,s,o,2),t!==null&&Qt(t,e,2)}function Xl(e){var t=e.alternate;return e===je||t!==null&&t===je}function jp(e,t){si=Pl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Np(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Rh(e,s)}}var mo={readContext:Bt,use:Yl,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft};mo.useEffectEvent=ft;var wp={readContext:Bt,use:Yl,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:dp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Fl(4194308,4,pp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Fl(4194308,4,e,t)},useInsertionEffect:function(e,t){Fl(4,2,e,t)},useMemo:function(e,t){var s=Pt();t=t===void 0?null:t;var o=e();if(fs){ze(!0);try{e()}finally{ze(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=Pt();if(s!==void 0){var u=s(t);if(fs){ze(!0);try{s(t)}finally{ze(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=cS.bind(null,je,e),[o.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Tu(e);var t=e.queue,s=Cp.bind(null,je,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:ju,useDeferredValue:function(e,t){var s=Pt();return Nu(s,e,t)},useTransition:function(){var e=Tu(!1);return e=xp.bind(null,je,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=je,u=Pt();if(Be){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),et===null)throw Error(l(349));(Me&127)!==0||Zm(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,dp(Qm.bind(null,o,h,e),[e]),o.flags|=2048,oi(9,{destroy:void 0},Xm.bind(null,o,h,s,t),null),s},useId:function(){var e=Pt(),t=et.identifierPrefix;if(Be){var s=Un,o=zn;s=(o&~(1<<32-Ye(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=$l++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=nS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Eu,useFormState:op,useActionState:op,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Au.bind(null,je,!0,s),s.dispatch=t,[e,t]},useMemoCache:xu,useCacheRefresh:function(){return Pt().memoizedState=rS.bind(null,je)},useEffectEvent:function(e){var t=Pt(),s={impl:e};return t.memoizedState=s,function(){if(($e&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Du={readContext:Bt,use:Yl,useCallback:gp,useContext:Bt,useEffect:Cu,useImperativeHandle:vp,useInsertionEffect:hp,useLayoutEffect:mp,useMemo:yp,useReducer:Kl,useRef:up,useState:function(){return Kl(aa)},useDebugValue:ju,useDeferredValue:function(e,t){var s=vt();return bp(s,Xe.memoizedState,e,t)},useTransition:function(){var e=Kl(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Fm,useId:Tp,useHostTransitionStatus:Eu,useFormState:lp,useActionState:lp,useOptimistic:function(e,t){var s=vt();return ep(s,Xe,e,t)},useMemoCache:xu,useCacheRefresh:kp};Du.useEffectEvent=fp;var Ep={readContext:Bt,use:Yl,useCallback:gp,useContext:Bt,useEffect:Cu,useImperativeHandle:vp,useInsertionEffect:hp,useLayoutEffect:mp,useMemo:yp,useReducer:Su,useRef:up,useState:function(){return Su(aa)},useDebugValue:ju,useDeferredValue:function(e,t){var s=vt();return Xe===null?Nu(s,e,t):bp(s,Xe.memoizedState,e,t)},useTransition:function(){var e=Su(aa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Fm,useId:Tp,useHostTransitionStatus:Eu,useFormState:cp,useActionState:cp,useOptimistic:function(e,t){var s=vt();return Xe!==null?ep(s,Xe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:xu,useCacheRefresh:kp};Ep.useEffectEvent=fp;function Ru(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:y({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Mu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=ln(),u=Ea(o);u.payload=t,s!=null&&(u.callback=s),t=Aa(e,u,o),t!==null&&(Qt(t,e,o),lo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=ln(),u=Ea(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Aa(e,u,o),t!==null&&(Qt(t,e,o),lo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ln(),o=Ea(s);o.tag=2,t!=null&&(o.callback=t),t=Aa(e,o,s),t!==null&&(Qt(t,e,s),lo(t,e,s))}};function Ap(e,t,s,o,u,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,_):t.prototype&&t.prototype.isPureReactComponent?!Ji(s,o)||!Ji(u,h):!0}function Dp(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Mu.enqueueReplaceState(t,t.state,null)}function hs(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=y({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Rp(e){wl(e)}function Mp(e){console.error(e)}function Op(e){wl(e)}function Ql(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Bp(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ou(e,t,s){return s=Ea(s),s.tag=3,s.payload={element:null},s.callback=function(){Ql(e,t)},s}function Lp(e){return e=Ea(e),e.tag=3,e}function Ip(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Bp(t,s,o)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Bp(t,s,o),typeof u!="function"&&(La===null?La=new Set([this]):La.add(this));var k=o.stack;this.componentDidCatch(o.value,{componentStack:k!==null?k:""})})}function uS(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&Ws(t,s,u,!0),s=nn.current,s!==null){switch(s.tag){case 31:case 13:return Sn===null?cr():s.alternate===null&&ht===0&&(ht=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===zl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),id(e,o,u)),!1;case 22:return s.flags|=65536,o===zl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),id(e,o,u)),!1}throw Error(l(435,s.tag))}return id(e,o,u),cr(),!1}if(Be)return t=nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==Jc&&(e=Error(l(422),{cause:o}),no(yn(e,s)))):(o!==Jc&&(t=Error(l(423),{cause:o}),no(yn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=yn(o,s),u=Ou(e.stateNode,o,u),uu(e,u),ht!==4&&(ht=2)),!1;var h=Error(l(520),{cause:o});if(h=yn(h,s),So===null?So=[h]:So.push(h),ht!==4&&(ht=2),t===null)return!0;o=yn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Ou(s.stateNode,o,e),uu(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"&&(La===null||!La.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Lp(u),Ip(u,e,s,o),uu(s,u),!1}s=s.return}while(s!==null);return!1}var Bu=Error(l(461)),xt=!1;function Lt(e,t,s,o){t.child=e===null?Hm(t,null,s,o):ds(t,e.child,s,o)}function zp(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var _={};for(var k in o)k!=="ref"&&(_[k]=o[k])}else _=o;return ls(t),o=vu(e,t,s,_,h,u),k=gu(),e!==null&&!xt?(yu(e,t,u),sa(e,t,u)):(Be&&k&&Qc(t),t.flags|=1,Lt(e,t,o,u),t.child)}function Up(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Fc(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Vp(e,t,h,o,u)):(e=Rl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Pu(e,u)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:Ji,s(_,o)&&e.ref===t.ref)return sa(e,t,u)}return t.flags|=1,e=Wn(h,o),e.ref=t.ref,e.return=t,t.child=e}function Vp(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(Ji(h,o)&&e.ref===t.ref)if(xt=!1,t.pendingProps=o=h,Pu(e,u))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,sa(e,t,u)}return Lu(e,t,s,o,u)}function Hp(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return Gp(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ll(t,h!==null?h.cachePool:null),h!==null?$m(t,h):fu(),qm(t);else return o=t.lanes=536870912,Gp(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Ll(t,h.cachePool),$m(t,h),Ra(),t.memoizedState=null):(e!==null&&Ll(t,null),fu(),Ra());return Lt(e,t,u,s),t.child}function po(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gp(e,t,s,o,u){var h=ou();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Ll(t,null),fu(),qm(t),e!==null&&Ws(e,t,o,!0),t.childLanes=u,null}function Wl(e,t){return t=er({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pp(e,t,s){return ds(t,e.child,null,s),e=Wl(t,t.pendingProps),e.flags|=2,an(t),t.memoizedState=null,e}function dS(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(o.mode==="hidden")return e=Wl(t,o),t.lanes=536870912,po(null,e);if(mu(t),(e=at)?(e=tg(e,_n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:zn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=jm(e),s.return=t,t.child=s,Ot=t,at=null)):e=null,e===null)throw ja(t);return t.lanes=536870912,null}return Wl(t,o)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(mu(t),u)if(t.flags&256)t.flags&=-257,t=Pp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(xt||Ws(e,t,s,!1),u=(s&e.childLanes)!==0,xt||u){if(o=et,o!==null&&(_=Mh(o,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,as(e,_),Qt(o,e,_),Bu;cr(),t=Pp(e,t,s)}else e=h.treeContext,at=Tn(_.nextSibling),Ot=t,Be=!0,Ca=null,_n=!1,e!==null&&Em(t,e),t=Wl(t,o),t.flags|=4096;return t}return e=Wn(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Jl(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(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Lu(e,t,s,o,u){return ls(t),s=vu(e,t,s,o,void 0,u),o=gu(),e!==null&&!xt?(yu(e,t,u),sa(e,t,u)):(Be&&o&&Qc(t),t.flags|=1,Lt(e,t,s,u),t.child)}function $p(e,t,s,o,u,h){return ls(t),t.updateQueue=null,s=Km(t,o,s,u),Ym(e),o=gu(),e!==null&&!xt?(yu(e,t,h),sa(e,t,h)):(Be&&o&&Qc(t),t.flags|=1,Lt(e,t,s,h),t.child)}function qp(e,t,s,o,u){if(ls(t),t.stateNode===null){var h=Fs,_=s.contextType;typeof _=="object"&&_!==null&&(h=Bt(_)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Mu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},ru(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Bt(_):Fs,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Ru(t,s,_,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&Mu.enqueueReplaceState(h,h.state,null),co(t,o,h,u),ro(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var k=t.memoizedProps,D=hs(s,k);h.props=D;var V=h.context,F=s.contextType;_=Fs,typeof F=="object"&&F!==null&&(_=Bt(F));var Q=s.getDerivedStateFromProps;F=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",k=t.pendingProps!==k,F||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(k||V!==_)&&Dp(t,h,o,_),wa=!1;var G=t.memoizedState;h.state=G,co(t,o,h,u),ro(),V=t.memoizedState,k||G!==V||wa?(typeof Q=="function"&&(Ru(t,s,Q,o),V=t.memoizedState),(D=wa||Ap(t,s,D,o,G,V,_))?(F||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=o,t.memoizedState=V),h.props=o,h.state=V,h.context=_,o=D):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,cu(e,t),_=t.memoizedProps,F=hs(s,_),h.props=F,Q=t.pendingProps,G=h.context,V=s.contextType,D=Fs,typeof V=="object"&&V!==null&&(D=Bt(V)),k=s.getDerivedStateFromProps,(V=typeof k=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==Q||G!==D)&&Dp(t,h,o,D),wa=!1,G=t.memoizedState,h.state=G,co(t,o,h,u),ro();var q=t.memoizedState;_!==Q||G!==q||wa||e!==null&&e.dependencies!==null&&Ol(e.dependencies)?(typeof k=="function"&&(Ru(t,s,k,o),q=t.memoizedState),(F=wa||Ap(t,s,F,o,G,q,D)||e!==null&&e.dependencies!==null&&Ol(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,q,D),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,q,D)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=q),h.props=o,h.state=q,h.context=D,o=F):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,Jl(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=ds(t,e.child,null,u),t.child=ds(t,null,s,u)):Lt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=sa(e,t,u),e}function Yp(e,t,s,o){return is(),t.flags|=256,Lt(e,t,s,o),t.child}var Iu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zu(e){return{baseLanes:e,cachePool:Bm()}}function Uu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=on),e}function Kp(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(u?Da(t):Ra(),(e=at)?(e=tg(e,_n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:zn,overflow:Un}:null,retryLane:536870912,hydrationErrors:null},s=jm(e),s.return=t,t.child=s,Ot=t,at=null)):e=null,e===null)throw ja(t);return _d(e)?t.lanes=32:t.lanes=536870912,null}var k=o.children;return o=o.fallback,u?(Ra(),u=t.mode,k=er({mode:"hidden",children:k},u),o=ss(o,u,s,null),k.return=t,o.return=t,k.sibling=o,t.child=k,o=t.child,o.memoizedState=zu(s),o.childLanes=Uu(e,_,s),t.memoizedState=Iu,po(null,o)):(Da(t),Vu(t,k))}var D=e.memoizedState;if(D!==null&&(k=D.dehydrated,k!==null)){if(h)t.flags&256?(Da(t),t.flags&=-257,t=Hu(e,t,s)):t.memoizedState!==null?(Ra(),t.child=e.child,t.flags|=128,t=null):(Ra(),k=o.fallback,u=t.mode,o=er({mode:"visible",children:o.children},u),k=ss(k,u,s,null),k.flags|=2,o.return=t,k.return=t,o.sibling=k,t.child=o,ds(t,e.child,null,s),o=t.child,o.memoizedState=zu(s),o.childLanes=Uu(e,_,s),t.memoizedState=Iu,t=po(null,o));else if(Da(t),_d(k)){if(_=k.nextSibling&&k.nextSibling.dataset,_)var V=_.dgst;_=V,o=Error(l(419)),o.stack="",o.digest=_,no({value:o,source:null,stack:null}),t=Hu(e,t,s)}else if(xt||Ws(e,t,s,!1),_=(s&e.childLanes)!==0,xt||_){if(_=et,_!==null&&(o=Mh(_,s),o!==0&&o!==D.retryLane))throw D.retryLane=o,as(e,o),Qt(_,e,o),Bu;xd(k)||cr(),t=Hu(e,t,s)}else xd(k)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,at=Tn(k.nextSibling),Ot=t,Be=!0,Ca=null,_n=!1,e!==null&&Em(t,e),t=Vu(t,o.children),t.flags|=4096);return t}return u?(Ra(),k=o.fallback,u=t.mode,D=e.child,V=D.sibling,o=Wn(D,{mode:"hidden",children:o.children}),o.subtreeFlags=D.subtreeFlags&65011712,V!==null?k=Wn(V,k):(k=ss(k,u,s,null),k.flags|=2),k.return=t,o.return=t,o.sibling=k,t.child=o,po(null,o),o=t.child,k=e.child.memoizedState,k===null?k=zu(s):(u=k.cachePool,u!==null?(D=yt._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=Bm(),k={baseLanes:k.baseLanes|s,cachePool:u}),o.memoizedState=k,o.childLanes=Uu(e,_,s),t.memoizedState=Iu,po(e.child,o)):(Da(t),s=e.child,e=s.sibling,s=Wn(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function Vu(e,t){return t=er({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function er(e,t){return e=tn(22,e,null,t),e.lanes=0,e}function Hu(e,t,s){return ds(t,e.child,null,s),e=Vu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fp(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),nu(e.return,t,s)}function Gu(e,t,s,o,u,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=o,_.tail=s,_.tailMode=u,_.treeForkCount=h)}function Zp(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var _=pt.current,k=(_&2)!==0;if(k?(_=_&1|2,t.flags|=128):_&=1,xe(pt,_),Lt(e,t,o,s),o=Be?to:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fp(e,s,t);else if(e.tag===19)Fp(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(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&Gl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Gu(t,!1,u,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Gl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Gu(t,!0,s,null,h,o);break;case"together":Gu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function sa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Ws(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=Wn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Wn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Pu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ol(e)))}function fS(e,t,s){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),Na(t,yt,e.memoizedState.cache),is();break;case 27:case 5:xa(t);break;case 4:Re(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,mu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Da(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Kp(e,t,s):(Da(t),e=sa(e,t,s),e!==null?e.sibling:null);Da(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(Ws(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return Zp(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),xe(pt,pt.current),o)break;return null;case 22:return t.lanes=0,Hp(e,t,s,t.pendingProps);case 24:Na(t,yt,e.memoizedState.cache)}return sa(e,t,s)}function Xp(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!Pu(e,s)&&(t.flags&128)===0)return xt=!1,fS(e,t,s);xt=(e.flags&131072)!==0}else xt=!1,Be&&(t.flags&1048576)!==0&&wm(t,to,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=cs(t.elementType),t.type=e,typeof e=="function")Fc(e)?(o=hs(e,o),t.tag=1,t=qp(null,t,e,o,s)):(t.tag=0,t=Lu(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===R){t.tag=11,t=zp(null,t,e,o,s);break e}else if(u===z){t.tag=14,t=Up(null,t,e,o,s);break e}}throw t=K(e)||e,Error(l(306,t,""))}}return t;case 0:return Lu(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=hs(o,t.pendingProps),qp(e,t,o,u,s);case 3:e:{if(Re(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,cu(e,t),co(t,o,null,s);var _=t.memoizedState;if(o=_.cache,Na(t,yt,o),o!==h.cache&&au(t,[yt],s,!0),ro(),o=_.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Yp(e,t,o,s);break e}else if(o!==u){u=yn(Error(l(424)),t),no(u),t=Yp(e,t,o,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(at=Tn(e.firstChild),Ot=t,Be=!0,Ca=null,_n=!0,s=Hm(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(is(),o===u){t=sa(e,t,s);break e}Lt(e,t,o,s)}t=t.child}return t;case 26:return Jl(e,t),e===null?(s=lg(t.type,null,t.pendingProps,null))?t.memoizedState=s:Be||(s=t.type,e=t.pendingProps,o=vr(W.current).createElement(s),o[Mt]=t,o[qt]=e,It(o,s,e),At(o),t.stateNode=o):t.memoizedState=lg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xa(t),e===null&&Be&&(o=t.stateNode=sg(t.type,t.pendingProps,W.current),Ot=t,_n=!0,u=at,Va(t.type)?(Sd=u,at=Tn(o.firstChild)):at=u),Lt(e,t,t.pendingProps.children,s),Jl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((u=o=at)&&(o=GS(o,t.type,t.pendingProps,_n),o!==null?(t.stateNode=o,Ot=t,at=Tn(o.firstChild),_n=!1,u=!0):u=!1),u||ja(t)),xa(t),u=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,o=h.children,gd(u,h)?o=null:_!==null&&gd(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=vu(e,t,aS,null,null,s),Ao._currentValue=u),Jl(e,t),Lt(e,t,o,s),t.child;case 6:return e===null&&Be&&((e=s=at)&&(s=PS(s,t.pendingProps,_n),s!==null?(t.stateNode=s,Ot=t,at=null,e=!0):e=!1),e||ja(t)),null;case 13:return Kp(e,t,s);case 4:return Re(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=ds(t,null,o,s):Lt(e,t,o,s),t.child;case 11:return zp(e,t,t.type,t.pendingProps,s);case 7:return Lt(e,t,t.pendingProps,s),t.child;case 8:return Lt(e,t,t.pendingProps.children,s),t.child;case 12:return Lt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,Na(t,t.type,o.value),Lt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,ls(t),u=Bt(u),o=o(u),t.flags|=1,Lt(e,t,o,s),t.child;case 14:return Up(e,t,t.type,t.pendingProps,s);case 15:return Vp(e,t,t.type,t.pendingProps,s);case 19:return Zp(e,t,s);case 31:return dS(e,t,s);case 22:return Hp(e,t,s,t.pendingProps);case 24:return ls(t),o=Bt(yt),e===null?(u=ou(),u===null&&(u=et,h=su(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},ru(t),Na(t,yt,u)):((e.lanes&s)!==0&&(cu(e,t),co(t,null,null,s),ro()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Na(t,yt,o)):(o=h.cache,Na(t,yt,o),o!==u.cache&&au(t,[yt],s,!0))),Lt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ia(e){e.flags|=4}function $u(e,t,s,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Tv())e.flags|=8192;else throw us=zl,lu}else e.flags&=-16777217}function Qp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fg(t))if(Tv())e.flags|=8192;else throw us=zl,lu}function tr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ah():536870912,e.lanes|=t,ui|=t)}function vo(e,t){if(!Be)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 o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function hS(e,t,s){var o=t.pendingProps;switch(Wc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ta(yt),An(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Qs(t)?ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,eu())),st(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(ia(t),h!==null?(st(t),Qp(t,h)):(st(t),$u(t,u,null,o,s))):h?h!==e.memoizedState?(ia(t),st(t),Qp(t,h)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&ia(t),st(t),$u(t,u,e,o,s)),null;case 27:if(fn(t),s=W.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return st(t),null}e=J.current,Qs(t)?Am(t):(e=sg(u,o,s),t.stateNode=e,ia(t))}return st(t),null;case 5:if(fn(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return st(t),null}if(h=J.current,Qs(t))Am(t);else{var _=vr(W.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?_.createElement("select",{is:o.is}):_.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?_.createElement(u,{is:o.is}):_.createElement(u)}}h[Mt]=t,h[qt]=o;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=h;e:switch(It(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ia(t)}}return st(t),$u(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&ia(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=W.current,Qs(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Ot,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Kv(e.nodeValue,s)),e||ja(t,!0)}else e=vr(e).createTextNode(o),e[Mt]=t,t.stateNode=e}return st(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=Qs(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Mt]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else s=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(an(t),t):(an(t),null);if((t.flags&128)!==0)throw Error(l(558))}return st(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Qs(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[Mt]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),u=!1}else u=eu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(an(t),t):(an(t),null)}return an(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),tr(t,t.updateQueue),st(t),null);case 4:return An(),e===null&&fd(t.stateNode.containerInfo),st(t),null;case 10:return ta(t.type),st(t),null;case 19:if(Ne(pt),o=t.memoizedState,o===null)return st(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)vo(o,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Gl(e),h!==null){for(t.flags|=128,vo(o,!1),e=h.updateQueue,t.updateQueue=e,tr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Cm(s,e),s=s.sibling;return xe(pt,pt.current&1|2),Be&&Jn(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Ut()>or&&(t.flags|=128,u=!0,vo(o,!1),t.lanes=4194304)}else{if(!u)if(e=Gl(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,tr(t,e),vo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Be)return st(t),null}else 2*Ut()-o.renderingStartTime>or&&s!==536870912&&(t.flags|=128,u=!0,vo(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ut(),e.sibling=null,s=pt.current,xe(pt,u?s&1|2:s&1),Be&&Jn(t,o.treeForkCount),e):(st(t),null);case 22:case 23:return an(t),hu(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),s=t.updateQueue,s!==null&&tr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&Ne(rs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ta(yt),st(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function mS(e,t){switch(Wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(yt),An(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fn(t),null;case 31:if(t.memoizedState!==null){if(an(t),t.alternate===null)throw Error(l(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(an(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(pt),null;case 4:return An(),null;case 10:return ta(t.type),null;case 22:case 23:return an(t),hu(),e!==null&&Ne(rs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(yt),null;case 25:return null;default:return null}}function Wp(e,t){switch(Wc(t),t.tag){case 3:ta(yt),An();break;case 26:case 27:case 5:fn(t);break;case 4:An();break;case 31:t.memoizedState!==null&&an(t);break;case 13:an(t);break;case 19:Ne(pt);break;case 10:ta(t.type);break;case 22:case 23:an(t),hu(),e!==null&&Ne(rs);break;case 24:ta(yt)}}function go(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,_=s.inst;o=h(),_.destroy=o}s=s.next}while(s!==u)}}catch(k){Ze(t,t.return,k)}}function Ma(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var _=o.inst,k=_.destroy;if(k!==void 0){_.destroy=void 0,u=t;var D=s,V=k;try{V()}catch(F){Ze(u,D,F)}}}o=o.next}while(o!==h)}}catch(F){Ze(t,t.return,F)}}function Jp(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Pm(t,s)}catch(o){Ze(e,e.return,o)}}}function ev(e,t,s){s.props=hs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Ze(e,t,o)}}function yo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(u){Ze(e,t,u)}}function Vn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Ze(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Ze(e,t,u)}else s.current=null}function tv(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Ze(e,e.return,u)}}function qu(e,t,s){try{var o=e.stateNode;LS(o,e.type,s,t),o[qt]=t}catch(u){Ze(e,e.return,u)}}function nv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Va(e.type)||e.tag===4}function Yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nv(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 Ku(e,t,s){var o=e.tag;if(o===5||o===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=Xn));else if(o!==4&&(o===27&&Va(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Ku(e,t,s),e=e.sibling;e!==null;)Ku(e,t,s),e=e.sibling}function nr(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Va(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(nr(e,t,s),e=e.sibling;e!==null;)nr(e,t,s),e=e.sibling}function av(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);It(t,o,s),t[Mt]=e,t[qt]=s}catch(h){Ze(e,e.return,h)}}var oa=!1,_t=!1,Fu=!1,sv=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function pS(e,t){if(e=e.containerInfo,pd=Tr,e=vm(e),Hc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,k=-1,D=-1,V=0,F=0,Q=e,G=null;t:for(;;){for(var q;Q!==s||u!==0&&Q.nodeType!==3||(k=_+u),Q!==h||o!==0&&Q.nodeType!==3||(D=_+o),Q.nodeType===3&&(_+=Q.nodeValue.length),(q=Q.firstChild)!==null;)G=Q,Q=q;for(;;){if(Q===e)break t;if(G===s&&++V===u&&(k=_),G===h&&++F===o&&(D=_),(q=Q.nextSibling)!==null)break;Q=G,G=Q.parentNode}Q=q}s=k===-1||D===-1?null:{start:k,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(vd={focusedElem:e,selectionRange:s},Tr=!1,Dt=t;Dt!==null;)if(t=Dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Dt=e;else for(;Dt!==null;){switch(t=Dt,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++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,u=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var ue=hs(s.type,u);e=o.getSnapshotBeforeUpdate(ue,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ze(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)bd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bd(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Dt=e;break}Dt=t.return}}function iv(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ra(e,s),o&4&&go(5,s);break;case 1:if(ra(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){Ze(s,s.return,_)}else{var u=hs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Ze(s,s.return,_)}}o&64&&Jp(s),o&512&&yo(s,s.return);break;case 3:if(ra(e,s),o&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{Pm(e,t)}catch(_){Ze(s,s.return,_)}}break;case 27:t===null&&o&4&&av(s);case 26:case 5:ra(e,s),t===null&&o&4&&tv(s),o&512&&yo(s,s.return);break;case 12:ra(e,s);break;case 31:ra(e,s),o&4&&rv(e,s);break;case 13:ra(e,s),o&4&&cv(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=kS.bind(null,s),$S(e,s))));break;case 22:if(o=s.memoizedState!==null||oa,!o){t=t!==null&&t.memoizedState!==null||_t,u=oa;var h=_t;oa=o,(_t=t)&&!h?ca(e,s,(s.subtreeFlags&8772)!==0):ra(e,s),oa=u,_t=h}break;case 30:break;default:ra(e,s)}}function ov(e){var t=e.alternate;t!==null&&(e.alternate=null,ov(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kc(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 ct=null,Kt=!1;function la(e,t,s){for(s=s.child;s!==null;)lv(e,t,s),s=s.sibling}function lv(e,t,s){if(Ie&&typeof Ie.onCommitFiberUnmount=="function")try{Ie.onCommitFiberUnmount(Se,s)}catch{}switch(s.tag){case 26:_t||Vn(s,t),la(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:_t||Vn(s,t);var o=ct,u=Kt;Va(s.type)&&(ct=s.stateNode,Kt=!1),la(e,t,s),No(s.stateNode),ct=o,Kt=u;break;case 5:_t||Vn(s,t);case 6:if(o=ct,u=Kt,ct=null,la(e,t,s),ct=o,Kt=u,ct!==null)if(Kt)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(s.stateNode)}catch(h){Ze(s,t,h)}else try{ct.removeChild(s.stateNode)}catch(h){Ze(s,t,h)}break;case 18:ct!==null&&(Kt?(e=ct,Jv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),yi(e)):Jv(ct,s.stateNode));break;case 4:o=ct,u=Kt,ct=s.stateNode.containerInfo,Kt=!0,la(e,t,s),ct=o,Kt=u;break;case 0:case 11:case 14:case 15:Ma(2,s,t),_t||Ma(4,s,t),la(e,t,s);break;case 1:_t||(Vn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&ev(s,t,o)),la(e,t,s);break;case 21:la(e,t,s);break;case 22:_t=(o=_t)||s.memoizedState!==null,la(e,t,s),_t=o;break;default:la(e,t,s)}}function rv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yi(e)}catch(s){Ze(t,t.return,s)}}}function cv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yi(e)}catch(s){Ze(t,t.return,s)}}function vS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sv),t;default:throw Error(l(435,e.tag))}}function ar(e,t){var s=vS(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=CS.bind(null,e,o);o.then(u,u)}})}function Ft(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,_=t,k=_;e:for(;k!==null;){switch(k.tag){case 27:if(Va(k.type)){ct=k.stateNode,Kt=!1;break e}break;case 5:ct=k.stateNode,Kt=!1;break e;case 3:case 4:ct=k.stateNode.containerInfo,Kt=!0;break e}k=k.return}if(ct===null)throw Error(l(160));lv(h,_,u),ct=null,Kt=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)uv(t,e),t=t.sibling}var Mn=null;function uv(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ft(t,e),Zt(e),o&4&&(Ma(3,e,e.return),go(3,e),Ma(5,e,e.return));break;case 1:Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),o&64&&oa&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=Mn;if(Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[$i]||h[Mt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),It(h,o,s),h[Mt]=e,At(h),o=h;break e;case"link":var _=ug("link","href",u).get(o+(s.href||""));if(_){for(var k=0;k<_.length;k++)if(h=_[k],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)){_.splice(k,1);break t}}h=u.createElement(o),It(h,o,s),u.head.appendChild(h);break;case"meta":if(_=ug("meta","content",u).get(o+(s.content||""))){for(k=0;k<_.length;k++)if(h=_[k],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)){_.splice(k,1);break t}}h=u.createElement(o),It(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[Mt]=e,At(h),o=h}e.stateNode=o}else dg(u,e.type,e.stateNode);else e.stateNode=cg(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?dg(u,e.type,e.stateNode):cg(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&qu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),s!==null&&o&4&&qu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ft(t,e),Zt(e),o&512&&(_t||s===null||Vn(s,s.return)),e.flags&32){u=e.stateNode;try{Hs(u,"")}catch(ue){Ze(e,e.return,ue)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,qu(e,u,s!==null?s.memoizedProps:u)),o&1024&&(Fu=!0);break;case 6:if(Ft(t,e),Zt(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(ue){Ze(e,e.return,ue)}}break;case 3:if(br=null,u=Mn,Mn=gr(t.containerInfo),Ft(t,e),Mn=u,Zt(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ue){Ze(e,e.return,ue)}Fu&&(Fu=!1,dv(e));break;case 4:o=Mn,Mn=gr(e.stateNode.containerInfo),Ft(t,e),Zt(e),Mn=o;break;case 12:Ft(t,e),Zt(e);break;case 31:Ft(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 13:Ft(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ir=Ut()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,V=oa,F=_t;if(oa=V||u,_t=F||D,Ft(t,e),_t=F,oa=V,Zt(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||oa||_t||ms(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(h=D.stateNode,u)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{k=D.stateNode;var Q=D.memoizedProps.style,G=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;k.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(ue){Ze(D,D.return,ue)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(ue){Ze(D,D.return,ue)}}}else if(t.tag===18){if(s===null){D=t;try{var q=D.stateNode;u?eg(q,!0):eg(D.stateNode,!1)}catch(ue){Ze(D,D.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}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,ar(e,s))));break;case 19:Ft(t,e),Zt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 30:break;case 21:break;default:Ft(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(nv(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=Yu(e);nr(e,h,u);break;case 5:var _=s.stateNode;s.flags&32&&(Hs(_,""),s.flags&=-33);var k=Yu(e);nr(e,k,_);break;case 3:case 4:var D=s.stateNode.containerInfo,V=Yu(e);Ku(e,V,D);break;default:throw Error(l(161))}}catch(F){Ze(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)iv(e,t.alternate,t),t=t.sibling}function ms(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ma(4,t,t.return),ms(t);break;case 1:Vn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&ev(t,t.return,s),ms(t);break;case 27:No(t.stateNode);case 26:case 5:Vn(t,t.return),ms(t);break;case 22:t.memoizedState===null&&ms(t);break;case 30:ms(t);break;default:ms(t)}e=e.sibling}}function ca(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:ca(u,h,s),go(4,h);break;case 1:if(ca(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(V){Ze(o,o.return,V)}if(o=h,u=o.updateQueue,u!==null){var k=o.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)Gm(D[u],k)}catch(V){Ze(o,o.return,V)}}s&&_&64&&Jp(h),yo(h,h.return);break;case 27:av(h);case 26:case 5:ca(u,h,s),s&&o===null&&_&4&&tv(h),yo(h,h.return);break;case 12:ca(u,h,s);break;case 31:ca(u,h,s),s&&_&4&&rv(u,h);break;case 13:ca(u,h,s),s&&_&4&&cv(u,h);break;case 22:h.memoizedState===null&&ca(u,h,s),yo(h,h.return);break;case 30:break;default:ca(u,h,s)}t=t.sibling}}function Zu(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&&ao(s))}function Xu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e))}function On(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)fv(e,t,s,o),t=t.sibling}function fv(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:On(e,t,s,o),u&2048&&go(9,t);break;case 1:On(e,t,s,o);break;case 3:On(e,t,s,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e)));break;case 12:if(u&2048){On(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,k=h.onPostCommit;typeof k=="function"&&k(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){Ze(t,t.return,D)}}else On(e,t,s,o);break;case 31:On(e,t,s,o);break;case 13:On(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?On(e,t,s,o):bo(e,t):h._visibility&2?On(e,t,s,o):(h._visibility|=2,li(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Zu(_,t);break;case 24:On(e,t,s,o),u&2048&&Xu(t.alternate,t);break;default:On(e,t,s,o)}}function li(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,k=s,D=o,V=_.flags;switch(_.tag){case 0:case 11:case 15:li(h,_,k,D,u),go(8,_);break;case 23:break;case 22:var F=_.stateNode;_.memoizedState!==null?F._visibility&2?li(h,_,k,D,u):bo(h,_):(F._visibility|=2,li(h,_,k,D,u)),u&&V&2048&&Zu(_.alternate,_);break;case 24:li(h,_,k,D,u),u&&V&2048&&Xu(_.alternate,_);break;default:li(h,_,k,D,u)}t=t.sibling}}function bo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:bo(s,o),u&2048&&Zu(o.alternate,o);break;case 24:bo(s,o),u&2048&&Xu(o.alternate,o);break;default:bo(s,o)}t=t.sibling}}var xo=8192;function ri(e,t,s){if(e.subtreeFlags&xo)for(e=e.child;e!==null;)hv(e,t,s),e=e.sibling}function hv(e,t,s){switch(e.tag){case 26:ri(e,t,s),e.flags&xo&&e.memoizedState!==null&&n1(s,Mn,e.memoizedState,e.memoizedProps);break;case 5:ri(e,t,s);break;case 3:case 4:var o=Mn;Mn=gr(e.stateNode.containerInfo),ri(e,t,s),Mn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=xo,xo=16777216,ri(e,t,s),xo=o):ri(e,t,s));break;default:ri(e,t,s)}}function mv(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 _o(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Dt=o,vv(o,e)}mv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pv(e),e=e.sibling}function pv(e){switch(e.tag){case 0:case 11:case 15:_o(e),e.flags&2048&&Ma(9,e,e.return);break;case 3:_o(e);break;case 12:_o(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sr(e)):_o(e);break;default:_o(e)}}function sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Dt=o,vv(o,e)}mv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ma(8,t,t.return),sr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,sr(t));break;default:sr(t)}e=e.sibling}}function vv(e,t){for(;Dt!==null;){var s=Dt;switch(s.tag){case 0:case 11:case 15:Ma(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ao(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Dt=o;else e:for(s=e;Dt!==null;){o=Dt;var u=o.sibling,h=o.return;if(ov(o),o===s){Dt=null;break e}if(u!==null){u.return=h,Dt=u;break e}Dt=h}}}var gS={getCacheForType:function(e){var t=Bt(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Bt(yt).controller.signal}},yS=typeof WeakMap=="function"?WeakMap:Map,$e=0,et=null,Ae=null,Me=0,Fe=0,sn=null,Oa=!1,ci=!1,Qu=!1,ua=0,ht=0,Ba=0,ps=0,Wu=0,on=0,ui=0,So=null,Xt=null,Ju=!1,ir=0,gv=0,or=1/0,lr=null,La=null,jt=0,Ia=null,di=null,da=0,ed=0,td=null,yv=null,To=0,nd=null;function ln(){return($e&2)!==0&&Me!==0?Me&-Me:O.T!==null?rd():Oh()}function bv(){if(on===0)if((Me&536870912)===0||Be){var e=_a;_a<<=1,(_a&3932160)===0&&(_a=262144),on=e}else on=536870912;return e=nn.current,e!==null&&(e.flags|=32),on}function Qt(e,t,s){(e===et&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(fi(e,0),za(e,Me,on,!1)),Pi(e,s),(($e&2)===0||e!==et)&&(e===et&&(($e&2)===0&&(ps|=s),ht===4&&za(e,Me,on,!1)),Hn(e))}function xv(e,t,s){if(($e&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Gi(e,t),u=o?_S(e,t):sd(e,t,!0),h=o;do{if(u===0){ci&&!o&&za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!bS(s)){u=sd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var k=e;u=So;var D=k.current.memoizedState.isDehydrated;if(D&&(fi(k,_).flags|=256),_=sd(k,_,!1),_!==2){if(Qu&&!D){k.errorRecoveryDisabledLanes|=h,ps|=h,u=4;break e}h=Xt,Xt=u,h!==null&&(Xt===null?Xt=h:Xt.push.apply(Xt,h))}u=_}if(h=!1,u!==2)continue}}if(u===1){fi(e,0),za(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:za(o,t,on,!Oa);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=ir+300-Ut(),10<u)){if(za(o,t,on,!Oa),gl(o,0,!0)!==0)break e;da=t,o.timeoutHandle=Qv(_v.bind(null,o,s,Xt,lr,Ju,t,on,ps,ui,Oa,h,"Throttled",-0,0),u);break e}_v(o,s,Xt,lr,Ju,t,on,ps,ui,Oa,h,null,-0,0)}}break}while(!0);Hn(e)}function _v(e,t,s,o,u,h,_,k,D,V,F,Q,G,q){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:Xn},hv(t,h,Q);var ue=(h&62914560)===h?ir-Ut():(h&4194048)===h?gv-Ut():0;if(ue=a1(Q,ue),ue!==null){da=h,e.cancelPendingCommit=ue(Ev.bind(null,e,t,h,s,o,u,_,k,D,F,Q,null,G,q)),za(e,h,_,!V);return}}Ev(e,t,h,s,o,u,_,k,D)}function bS(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 o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!en(h(),u))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,o){t&=~Wu,t&=~ps,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Ye(u),_=1<<h;o[h]=-1,u&=~_}s!==0&&Dh(e,s,t)}function rr(){return($e&6)===0?(ko(0),!1):!0}function ad(){if(Ae!==null){if(Fe===0)var e=Ae.return;else e=Ae,ea=os=null,bu(e),ni=null,io=0,e=Ae;for(;e!==null;)Wp(e.alternate,e),e=e.return;Ae=null}}function fi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,US(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),da=0,ad(),et=e,Ae=s=Wn(e.current,null),Me=t,Fe=0,sn=null,Oa=!1,ci=Gi(e,t),Qu=!1,ui=on=Wu=ps=Ba=ht=0,Xt=So=null,Ju=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Ye(o),h=1<<u;t|=e[u],o&=~h}return ua=t,El(),s}function Sv(e,t){je=null,O.H=mo,t===ti||t===Il?(t=zm(),Fe=3):t===lu?(t=zm(),Fe=4):Fe=t===Bu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sn=t,Ae===null&&(ht=1,Ql(e,yn(t,e.current)))}function Tv(){var e=nn.current;return e===null?!0:(Me&4194048)===Me?Sn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Sn:!1}function kv(){var e=O.H;return O.H=mo,e===null?mo:e}function Cv(){var e=O.A;return O.A=gS,e}function cr(){ht=4,Oa||(Me&4194048)!==Me&&nn.current!==null||(ci=!0),(Ba&134217727)===0&&(ps&134217727)===0||et===null||za(et,Me,on,!1)}function sd(e,t,s){var o=$e;$e|=2;var u=kv(),h=Cv();(et!==e||Me!==t)&&(lr=null,fi(e,t)),t=!1;var _=ht;e:do try{if(Fe!==0&&Ae!==null){var k=Ae,D=sn;switch(Fe){case 8:ad(),_=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(t=!0);var V=Fe;if(Fe=0,sn=null,hi(e,k,D,V),s&&ci){_=0;break e}break;default:V=Fe,Fe=0,sn=null,hi(e,k,D,V)}}xS(),_=ht;break}catch(F){Sv(e,F)}while(!0);return t&&e.shellSuspendCounter++,ea=os=null,$e=o,O.H=u,O.A=h,Ae===null&&(et=null,Me=0,El()),_}function xS(){for(;Ae!==null;)jv(Ae)}function _S(e,t){var s=$e;$e|=2;var o=kv(),u=Cv();et!==e||Me!==t?(lr=null,or=Ut()+500,fi(e,t)):ci=Gi(e,t);e:do try{if(Fe!==0&&Ae!==null){t=Ae;var h=sn;t:switch(Fe){case 1:Fe=0,sn=null,hi(e,t,h,1);break;case 2:case 9:if(Lm(h)){Fe=0,sn=null,Nv(t);break}t=function(){Fe!==2&&Fe!==9||et!==e||(Fe=7),Hn(e)},h.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:Lm(h)?(Fe=0,sn=null,Nv(t)):(Fe=0,sn=null,hi(e,t,h,7));break;case 5:var _=null;switch(Ae.tag){case 26:_=Ae.memoizedState;case 5:case 27:var k=Ae;if(_?fg(_):k.stateNode.complete){Fe=0,sn=null;var D=k.sibling;if(D!==null)Ae=D;else{var V=k.return;V!==null?(Ae=V,ur(V)):Ae=null}break t}}Fe=0,sn=null,hi(e,t,h,5);break;case 6:Fe=0,sn=null,hi(e,t,h,6);break;case 8:ad(),ht=6;break e;default:throw Error(l(462))}}SS();break}catch(F){Sv(e,F)}while(!0);return ea=os=null,O.H=o,O.A=u,$e=s,Ae!==null?0:(et=null,Me=0,El(),ht)}function SS(){for(;Ae!==null&&!hl();)jv(Ae)}function jv(e){var t=Xp(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?ur(e):Ae=t}function Nv(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=$p(s,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=$p(s,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:bu(t);default:Wp(s,t),t=Ae=Cm(t,ua),t=Xp(s,t,ua)}e.memoizedProps=e.pendingProps,t===null?ur(e):Ae=t}function hi(e,t,s,o){ea=os=null,bu(t),ni=null,io=0;var u=t.return;try{if(uS(e,u,t,s,Me)){ht=1,Ql(e,yn(s,e.current)),Ae=null;return}}catch(h){if(u!==null)throw Ae=u,h;ht=1,Ql(e,yn(s,e.current)),Ae=null;return}t.flags&32768?(Be||o===1?e=!0:ci||(Me&536870912)!==0?e=!1:(Oa=e=!0,(o===2||o===9||o===3||o===6)&&(o=nn.current,o!==null&&o.tag===13&&(o.flags|=16384))),wv(t,e)):ur(t)}function ur(e){var t=e;do{if((t.flags&32768)!==0){wv(t,Oa);return}e=t.return;var s=hS(t.alternate,t,ua);if(s!==null){Ae=s;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ht===0&&(ht=5)}function wv(e,t){do{var s=mS(e.alternate,e);if(s!==null){s.flags&=32767,Ae=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=s}while(e!==null);ht=6,Ae=null}function Ev(e,t,s,o,u,h,_,k,D){e.cancelPendingCommit=null;do dr();while(jt!==0);if(($e&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Yc,t_(e,s,h,_,k,D),e===et&&(Ae=et=null,Me=0),di=t,Ia=e,da=s,ed=h,td=u,yv=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jS(ie,function(){return Ov(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=O.T,O.T=null,u=$.p,$.p=2,_=$e,$e|=4;try{pS(e,t,s)}finally{$e=_,$.p=u,O.T=o}}jt=1,Av(),Dv(),Rv()}}function Av(){if(jt===1){jt=0;var e=Ia,t=di,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null;var o=$.p;$.p=2;var u=$e;$e|=4;try{uv(t,e);var h=vd,_=vm(e.containerInfo),k=h.focusedElem,D=h.selectionRange;if(_!==k&&k&&k.ownerDocument&&pm(k.ownerDocument.documentElement,k)){if(D!==null&&Hc(k)){var V=D.start,F=D.end;if(F===void 0&&(F=V),"selectionStart"in k)k.selectionStart=V,k.selectionEnd=Math.min(F,k.value.length);else{var Q=k.ownerDocument||document,G=Q&&Q.defaultView||window;if(G.getSelection){var q=G.getSelection(),ue=k.textContent.length,ve=Math.min(D.start,ue),We=D.end===void 0?ve:Math.min(D.end,ue);!q.extend&&ve>We&&(_=We,We=ve,ve=_);var B=mm(k,ve),M=mm(k,We);if(B&&M&&(q.rangeCount!==1||q.anchorNode!==B.node||q.anchorOffset!==B.offset||q.focusNode!==M.node||q.focusOffset!==M.offset)){var U=Q.createRange();U.setStart(B.node,B.offset),q.removeAllRanges(),ve>We?(q.addRange(U),q.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),q.addRange(U))}}}}for(Q=[],q=k;q=q.parentNode;)q.nodeType===1&&Q.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<Q.length;k++){var Z=Q[k];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Tr=!!pd,vd=pd=null}finally{$e=u,$.p=o,O.T=s}}e.current=t,jt=2}}function Dv(){if(jt===2){jt=0;var e=Ia,t=di,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=O.T,O.T=null;var o=$.p;$.p=2;var u=$e;$e|=4;try{iv(e,t.alternate,t)}finally{$e=u,$.p=o,O.T=s}}jt=3}}function Rv(){if(jt===4||jt===3){jt=0,ml();var e=Ia,t=di,s=da,o=yv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,di=Ia=null,Mv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(La=null),Sc(s),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot=="function")try{Ie.onCommitFiberRoot(Se,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=O.T,u=$.p,$.p=2,O.T=null;try{for(var h=e.onRecoverableError,_=0;_<o.length;_++){var k=o[_];h(k.value,{componentStack:k.stack})}}finally{O.T=t,$.p=u}}(da&3)!==0&&dr(),Hn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===nd?To++:(To=0,nd=e):To=0,ko(0)}}function Mv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ao(t)))}function dr(){return Av(),Dv(),Rv(),Ov()}function Ov(){if(jt!==5)return!1;var e=Ia,t=ed;ed=0;var s=Sc(da),o=O.T,u=$.p;try{$.p=32>s?32:s,O.T=null,s=td,td=null;var h=Ia,_=da;if(jt=0,di=Ia=null,da=0,($e&6)!==0)throw Error(l(331));var k=$e;if($e|=4,pv(h.current),fv(h,h.current,_,s),$e=k,ko(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot=="function")try{Ie.onPostCommitFiberRoot(Se,h)}catch{}return!0}finally{$.p=u,O.T=o,Mv(e,t)}}function Bv(e,t,s){t=yn(s,t),t=Ou(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(Pi(e,2),Hn(e))}function Ze(e,t,s){if(e.tag===3)Bv(e,e,s);else for(;t!==null;){if(t.tag===3){Bv(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(La===null||!La.has(o))){e=yn(s,e),s=Lp(2),o=Aa(t,s,2),o!==null&&(Ip(s,o,t,e),Pi(o,2),Hn(o));break}}t=t.return}}function id(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new yS;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(Qu=!0,u.add(s),e=TS.bind(null,e,t,s),t.then(e,e))}function TS(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,et===e&&(Me&s)===s&&(ht===4||ht===3&&(Me&62914560)===Me&&300>Ut()-ir?($e&2)===0&&fi(e,0):Wu|=s,ui===Me&&(ui=0)),Hn(e)}function Lv(e,t){t===0&&(t=Ah()),e=as(e,t),e!==null&&(Pi(e,t),Hn(e))}function kS(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Lv(e,s)}function CS(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),Lv(e,s)}function jS(e,t){return Ms(e,t)}var fr=null,mi=null,od=!1,hr=!1,ld=!1,Ua=0;function Hn(e){e!==mi&&e.next===null&&(mi===null?fr=mi=e:mi=mi.next=e),hr=!0,od||(od=!0,wS())}function ko(e,t){if(!ld&&hr){ld=!0;do for(var s=!1,o=fr;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var _=o.suspendedLanes,k=o.pingedLanes;h=(1<<31-Ye(42|e)+1)-1,h&=u&~(_&~k),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Vv(o,h))}else h=Me,h=gl(o,o===et?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Gi(o,h)||(s=!0,Vv(o,h));o=o.next}while(s);ld=!1}}function NS(){Iv()}function Iv(){hr=od=!1;var e=0;Ua!==0&&zS()&&(e=Ua);for(var t=Ut(),s=null,o=fr;o!==null;){var u=o.next,h=zv(o,t);h===0?(o.next=null,s===null?fr=u:s.next=u,u===null&&(mi=s)):(s=o,(e!==0||(h&3)!==0)&&(hr=!0)),o=u}jt!==0&&jt!==5||ko(e),Ua!==0&&(Ua=0)}function zv(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Ye(h),k=1<<_,D=u[_];D===-1?((k&s)===0||(k&o)!==0)&&(u[_]=e_(k,t)):D<=t&&(e.expiredLanes|=k),h&=~k}if(t=et,s=Me,s=gl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Os(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Gi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&Os(o),Sc(s)){case 2:case 8:s=X;break;case 32:s=ie;break;case 268435456:s=_e;break;default:s=ie}return o=Uv.bind(null,e),s=Ms(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Os(o),e.callbackPriority=2,e.callbackNode=null,2}function Uv(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(dr()&&e.callbackNode!==s)return null;var o=Me;return o=gl(e,e===et?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(xv(e,o,t),zv(e,Ut()),e.callbackNode!=null&&e.callbackNode===s?Uv.bind(null,e):null)}function Vv(e,t){if(dr())return null;xv(e,t,!0)}function wS(){VS(function(){($e&6)!==0?Ms(vl,NS):Iv()})}function rd(){if(Ua===0){var e=Js;e===0&&(e=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),Ua=e}return Ua}function Hv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(""+e)}function Gv(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 ES(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Hv((u[qt]||null).action),_=o.submitter;_&&(t=(t=_[qt]||null)?Hv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var k=new Cl("action","action",null,o,u);e.push({event:k,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ua!==0){var D=_?Gv(u,_):new FormData(u);wu(s,{pending:!0,data:D,method:u.method,action:h},null,D)}}else typeof h=="function"&&(k.preventDefault(),D=_?Gv(u,_):new FormData(u),wu(s,{pending:!0,data:D,method:u.method,action:h},h,D))},currentTarget:u}]})}}for(var cd=0;cd<qc.length;cd++){var ud=qc[cd],AS=ud.toLowerCase(),DS=ud[0].toUpperCase()+ud.slice(1);Rn(AS,"on"+DS)}Rn(bm,"onAnimationEnd"),Rn(xm,"onAnimationIteration"),Rn(_m,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(K_,"onTransitionRun"),Rn(F_,"onTransitionStart"),Rn(Z_,"onTransitionCancel"),Rn(Sm,"onTransitionEnd"),Us("onMouseEnter",["mouseout","mouseover"]),Us("onMouseLeave",["mouseout","mouseover"]),Us("onPointerEnter",["pointerout","pointerover"]),Us("onPointerLeave",["pointerout","pointerover"]),Ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ja("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Co="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(" "),RS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Co));function Pv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var _=o.length-1;0<=_;_--){var k=o[_],D=k.instance,V=k.currentTarget;if(k=k.listener,D!==h&&u.isPropagationStopped())break e;h=k,u.currentTarget=V;try{h(u)}catch(F){wl(F)}u.currentTarget=null,h=D}else for(_=0;_<o.length;_++){if(k=o[_],D=k.instance,V=k.currentTarget,k=k.listener,D!==h&&u.isPropagationStopped())break e;h=k,u.currentTarget=V;try{h(u)}catch(F){wl(F)}u.currentTarget=null,h=D}}}}function De(e,t){var s=t[Tc];s===void 0&&(s=t[Tc]=new Set);var o=e+"__bubble";s.has(o)||($v(t,e,2,!1),s.add(o))}function dd(e,t,s){var o=0;t&&(o|=4),$v(s,e,o,t)}var mr="_reactListening"+Math.random().toString(36).slice(2);function fd(e){if(!e[mr]){e[mr]=!0,Ih.forEach(function(s){s!=="selectionchange"&&(RS.has(s)||dd(s,!1,e),dd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mr]||(t[mr]=!0,dd("selectionchange",!1,t))}}function $v(e,t,s,o){switch(bg(t)){case 2:var u=o1;break;case 8:u=l1;break;default:u=Nd}s=u.bind(null,t,s,e),u=void 0,!Rc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function hd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var _=o.tag;if(_===3||_===4){var k=o.stateNode.containerInfo;if(k===u)break;if(_===4)for(_=o.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;k!==null;){if(_=Ls(k),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){o=h=_;continue e}k=k.parentNode}}o=o.return}Zh(function(){var V=h,F=Ac(s),Q=[];e:{var G=Tm.get(e);if(G!==void 0){var q=Cl,ue=e;switch(e){case"keypress":if(Tl(s)===0)break e;case"keydown":case"keyup":q=C_;break;case"focusin":ue="focus",q=Lc;break;case"focusout":ue="blur",q=Lc;break;case"beforeblur":case"afterblur":q=Lc;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":q=Wh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=h_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=w_;break;case bm:case xm:case _m:q=v_;break;case Sm:q=A_;break;case"scroll":case"scrollend":q=d_;break;case"wheel":q=R_;break;case"copy":case"cut":case"paste":q=y_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=em;break;case"toggle":case"beforetoggle":q=O_}var ve=(t&4)!==0,We=!ve&&(e==="scroll"||e==="scrollend"),B=ve?G!==null?G+"Capture":null:G;ve=[];for(var M=V,U;M!==null;){var Z=M;if(U=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||U===null||B===null||(Z=Yi(M,B),Z!=null&&ve.push(jo(M,Z,U))),We)break;M=M.return}0<ve.length&&(G=new q(G,ue,null,s,F),Q.push({event:G,listeners:ve}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",G&&s!==Ec&&(ue=s.relatedTarget||s.fromElement)&&(Ls(ue)||ue[Bs]))break e;if((q||G)&&(G=F.window===F?F:(G=F.ownerDocument)?G.defaultView||G.parentWindow:window,q?(ue=s.relatedTarget||s.toElement,q=V,ue=ue?Ls(ue):null,ue!==null&&(We=d(ue),ve=ue.tag,ue!==We||ve!==5&&ve!==27&&ve!==6)&&(ue=null)):(q=null,ue=V),q!==ue)){if(ve=Wh,Z="onMouseLeave",B="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ve=em,Z="onPointerLeave",B="onPointerEnter",M="pointer"),We=q==null?G:qi(q),U=ue==null?G:qi(ue),G=new ve(Z,M+"leave",q,s,F),G.target=We,G.relatedTarget=U,Z=null,Ls(F)===V&&(ve=new ve(B,M+"enter",ue,s,F),ve.target=U,ve.relatedTarget=We,Z=ve),We=Z,q&&ue)t:{for(ve=MS,B=q,M=ue,U=0,Z=B;Z;Z=ve(Z))U++;Z=0;for(var me=M;me;me=ve(me))Z++;for(;0<U-Z;)B=ve(B),U--;for(;0<Z-U;)M=ve(M),Z--;for(;U--;){if(B===M||M!==null&&B===M.alternate){ve=B;break t}B=ve(B),M=ve(M)}ve=null}else ve=null;q!==null&&qv(Q,G,q,ve,!1),ue!==null&&We!==null&&qv(Q,We,ue,ve,!0)}}e:{if(G=V?qi(V):window,q=G.nodeName&&G.nodeName.toLowerCase(),q==="select"||q==="input"&&G.type==="file")var He=rm;else if(om(G))if(cm)He=$_;else{He=G_;var he=H_}else q=G.nodeName,!q||q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?V&&wc(V.elementType)&&(He=rm):He=P_;if(He&&(He=He(e,V))){lm(Q,He,s,F);break e}he&&he(e,G,V),e==="focusout"&&V&&G.type==="number"&&V.memoizedProps.value!=null&&Nc(G,"number",G.value)}switch(he=V?qi(V):window,e){case"focusin":(om(he)||he.contentEditable==="true")&&(qs=he,Gc=V,eo=null);break;case"focusout":eo=Gc=qs=null;break;case"mousedown":Pc=!0;break;case"contextmenu":case"mouseup":case"dragend":Pc=!1,gm(Q,s,F);break;case"selectionchange":if(Y_)break;case"keydown":case"keyup":gm(Q,s,F)}var we;if(zc)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else $s?sm(e,s)&&(Oe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Oe="onCompositionStart");Oe&&(tm&&s.locale!=="ko"&&($s||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&$s&&(we=Xh()):(Ta=F,Mc="value"in Ta?Ta.value:Ta.textContent,$s=!0)),he=pr(V,Oe),0<he.length&&(Oe=new Jh(Oe,e,null,s,F),Q.push({event:Oe,listeners:he}),we?Oe.data=we:(we=im(s),we!==null&&(Oe.data=we)))),(we=L_?I_(e,s):z_(e,s))&&(Oe=pr(V,"onBeforeInput"),0<Oe.length&&(he=new Jh("onBeforeInput","beforeinput",null,s,F),Q.push({event:he,listeners:Oe}),he.data=we)),ES(Q,e,V,s,F)}Pv(Q,t)})}function jo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function pr(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Yi(e,s),u!=null&&o.unshift(jo(e,u,h)),u=Yi(e,t),u!=null&&o.push(jo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function MS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qv(e,t,s,o,u){for(var h=t._reactName,_=[];s!==null&&s!==o;){var k=s,D=k.alternate,V=k.stateNode;if(k=k.tag,D!==null&&D===o)break;k!==5&&k!==26&&k!==27||V===null||(D=V,u?(V=Yi(s,h),V!=null&&_.unshift(jo(s,V,D))):u||(V=Yi(s,h),V!=null&&_.push(jo(s,V,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var OS=/\r\n?/g,BS=/\u0000|\uFFFD/g;function Yv(e){return(typeof e=="string"?e:""+e).replace(OS,`
26
- `).replace(BS,"")}function Kv(e,t){return t=Yv(t),Yv(e)===t}function Qe(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Hs(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Hs(e,""+o);break;case"className":bl(e,"class",o);break;case"tabIndex":bl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":bl(e,s,o);break;case"style":Kh(e,o,h);break;case"data":if(t!=="object"){bl(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=_l(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="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"&&Qe(e,t,"name",u.name,u,null),Qe(e,t,"formEncType",u.formEncType,u,null),Qe(e,t,"formMethod",u.formMethod,u,null),Qe(e,t,"formTarget",u.formTarget,u,null)):(Qe(e,t,"encType",u.encType,u,null),Qe(e,t,"method",u.method,u,null),Qe(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=_l(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"onScroll":o!=null&&De("scroll",e);break;case"onScrollEnd":o!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=_l(""+o),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":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":De("beforetoggle",e),De("toggle",e),yl(e,"popover",o);break;case"xlinkActuate":Zn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Zn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Zn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Zn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Zn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Zn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Zn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":yl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=c_.get(s)||s,yl(e,s,o))}}function md(e,t,s,o,u,h){switch(s){case"style":Kh(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?Hs(e,o):(typeof o=="number"||typeof o=="bigint")&&Hs(e,""+o);break;case"onScroll":o!=null&&De("scroll",e);break;case"onScrollEnd":o!=null&&De("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),h=e[qt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,u);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):yl(e,s,o)}}}function It(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Qe(e,t,h,_,s,null)}}u&&Qe(e,t,"srcSet",s.srcSet,s,null),o&&Qe(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var k=h=_=u=null,D=null,V=null;for(o in s)if(s.hasOwnProperty(o)){var F=s[o];if(F!=null)switch(o){case"name":u=F;break;case"type":_=F;break;case"checked":D=F;break;case"defaultChecked":V=F;break;case"value":h=F;break;case"defaultValue":k=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,t));break;default:Qe(e,t,o,F,s,null)}}Ph(e,h,k,D,V,_,u,!1);return;case"select":De("invalid",e),o=_=h=null;for(u in s)if(s.hasOwnProperty(u)&&(k=s[u],k!=null))switch(u){case"value":h=k;break;case"defaultValue":_=k;break;case"multiple":o=k;default:Qe(e,t,u,k,s,null)}t=h,s=_,e.multiple=!!o,t!=null?Vs(e,!!o,t,!1):s!=null&&Vs(e,!!o,s,!0);return;case"textarea":De("invalid",e),h=u=o=null;for(_ in s)if(s.hasOwnProperty(_)&&(k=s[_],k!=null))switch(_){case"value":o=k;break;case"defaultValue":u=k;break;case"children":h=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(l(91));break;default:Qe(e,t,_,k,s,null)}qh(e,o,u,h);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(o=s[D],o!=null))switch(D){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Qe(e,t,D,o,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(o=0;o<Co.length;o++)De(Co[o],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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(V in s)if(s.hasOwnProperty(V)&&(o=s[V],o!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Qe(e,t,V,o,s,null)}return;default:if(wc(t)){for(F in s)s.hasOwnProperty(F)&&(o=s[F],o!==void 0&&md(e,t,F,o,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(o=s[k],o!=null&&Qe(e,t,k,o,s,null))}function LS(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,_=null,k=null,D=null,V=null,F=null;for(q in s){var Q=s[q];if(s.hasOwnProperty(q)&&Q!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":D=Q;default:o.hasOwnProperty(q)||Qe(e,t,q,null,o,Q)}}for(var G in o){var q=o[G];if(Q=s[G],o.hasOwnProperty(G)&&(q!=null||Q!=null))switch(G){case"type":h=q;break;case"name":u=q;break;case"checked":V=q;break;case"defaultChecked":F=q;break;case"value":_=q;break;case"defaultValue":k=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(l(137,t));break;default:q!==Q&&Qe(e,t,G,q,o,Q)}}jc(e,_,k,D,V,F,h,u);return;case"select":q=_=k=G=null;for(h in s)if(D=s[h],s.hasOwnProperty(h)&&D!=null)switch(h){case"value":break;case"multiple":q=D;default:o.hasOwnProperty(h)||Qe(e,t,h,null,o,D)}for(u in o)if(h=o[u],D=s[u],o.hasOwnProperty(u)&&(h!=null||D!=null))switch(u){case"value":G=h;break;case"defaultValue":k=h;break;case"multiple":_=h;default:h!==D&&Qe(e,t,u,h,o,D)}t=k,s=_,o=q,G!=null?Vs(e,!!s,G,!1):!!o!=!!s&&(t!=null?Vs(e,!!s,t,!0):Vs(e,!!s,s?[]:"",!1));return;case"textarea":q=G=null;for(k in s)if(u=s[k],s.hasOwnProperty(k)&&u!=null&&!o.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Qe(e,t,k,null,o,u)}for(_ in o)if(u=o[_],h=s[_],o.hasOwnProperty(_)&&(u!=null||h!=null))switch(_){case"value":G=u;break;case"defaultValue":q=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==h&&Qe(e,t,_,u,o,h)}$h(e,G,q);return;case"option":for(var ue in s)if(G=s[ue],s.hasOwnProperty(ue)&&G!=null&&!o.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Qe(e,t,ue,null,o,G)}for(D in o)if(G=o[D],q=s[D],o.hasOwnProperty(D)&&G!==q&&(G!=null||q!=null))switch(D){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Qe(e,t,D,G,o,q)}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 ve in s)G=s[ve],s.hasOwnProperty(ve)&&G!=null&&!o.hasOwnProperty(ve)&&Qe(e,t,ve,null,o,G);for(V in o)if(G=o[V],q=s[V],o.hasOwnProperty(V)&&G!==q&&(G!=null||q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,t));break;default:Qe(e,t,V,G,o,q)}return;default:if(wc(t)){for(var We in s)G=s[We],s.hasOwnProperty(We)&&G!==void 0&&!o.hasOwnProperty(We)&&md(e,t,We,void 0,o,G);for(F in o)G=o[F],q=s[F],!o.hasOwnProperty(F)||G===q||G===void 0&&q===void 0||md(e,t,F,G,o,q);return}}for(var B in s)G=s[B],s.hasOwnProperty(B)&&G!=null&&!o.hasOwnProperty(B)&&Qe(e,t,B,null,o,G);for(Q in o)G=o[Q],q=s[Q],!o.hasOwnProperty(Q)||G===q||G==null&&q==null||Qe(e,t,Q,G,o,q)}function Fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function IS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,_=u.initiatorType,k=u.duration;if(h&&k&&Fv(_)){for(_=0,k=u.responseEnd,o+=1;o<s.length;o++){var D=s[o],V=D.startTime;if(V>k)break;var F=D.transferSize,Q=D.initiatorType;F&&Fv(Q)&&(D=D.responseEnd,_+=F*(D<k?1:(k-V)/(D-V)))}if(--o,t+=8*(h+_)/(u.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 pd=null,vd=null;function vr(e){return e.nodeType===9?e:e.ownerDocument}function Zv(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 Xv(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 gd(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 yd=null;function zS(){var e=window.event;return e&&e.type==="popstate"?e===yd?!1:(yd=e,!0):(yd=null,!1)}var Qv=typeof setTimeout=="function"?setTimeout:void 0,US=typeof clearTimeout=="function"?clearTimeout:void 0,Wv=typeof Promise=="function"?Promise:void 0,VS=typeof queueMicrotask=="function"?queueMicrotask:typeof Wv<"u"?function(e){return Wv.resolve(null).then(e).catch(HS)}:Qv;function HS(e){setTimeout(function(){throw e})}function Va(e){return e==="head"}function Jv(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),yi(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")No(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,No(s);for(var h=s.firstChild;h;){var _=h.nextSibling,k=h.nodeName;h[$i]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&No(e.ownerDocument.body);s=u}while(s);yi(t)}function eg(e,t){var s=e;e=0;do{var o=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||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function bd(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":bd(s),kc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function GS(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[$i])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!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Tn(e.nextSibling),e===null)break}return null}function PS(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 tg(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 xd(e){return e.data==="$?"||e.data==="$~"}function _d(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $S(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}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 Sd=null;function ng(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 ag(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 sg(e,t,s){switch(t=vr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function No(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kc(e)}var kn=new Map,ig=new Set;function gr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=$.d;$.d={f:qS,r:YS,D:KS,C:FS,L:ZS,m:XS,X:WS,S:QS,M:JS};function qS(){var e=fa.f(),t=rr();return e||t}function YS(e){var t=Is(e);t!==null&&t.tag===5&&t.type==="form"?Sp(t):fa.r(e)}var pi=typeof document>"u"?null:document;function og(e,t,s){var o=pi;if(o&&typeof t=="string"&&t){var u=vn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),ig.has(u)||(ig.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),It(t,"link",e),At(t),o.head.appendChild(t)))}}function KS(e){fa.D(e),og("dns-prefetch",e,null)}function FS(e,t){fa.C(e,t),og("preconnect",e,t)}function ZS(e,t,s){fa.L(e,t,s);var o=pi;if(o&&e&&t){var u='link[rel="preload"][as="'+vn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+vn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+vn(s.imageSizes)+'"]')):u+='[href="'+vn(e)+'"]';var h=u;switch(t){case"style":h=vi(e);break;case"script":h=gi(e)}kn.has(h)||(e=y({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),kn.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(wo(h))||t==="script"&&o.querySelector(Eo(h))||(t=o.createElement("link"),It(t,"link",e),At(t),o.head.appendChild(t)))}}function XS(e,t){fa.m(e,t);var s=pi;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+vn(o)+'"][href="'+vn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=gi(e)}if(!kn.has(h)&&(e=y({rel:"modulepreload",href:e},t),kn.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Eo(h)))return}o=s.createElement("link"),It(o,"link",e),At(o),s.head.appendChild(o)}}}function QS(e,t,s){fa.S(e,t,s);var o=pi;if(o&&e){var u=zs(o).hoistableStyles,h=vi(e);t=t||"default";var _=u.get(h);if(!_){var k={loading:0,preload:null};if(_=o.querySelector(wo(h)))k.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},s),(s=kn.get(h))&&Td(e,s);var D=_=o.createElement("link");At(D),It(D,"link",e),D._p=new Promise(function(V,F){D.onload=V,D.onerror=F}),D.addEventListener("load",function(){k.loading|=1}),D.addEventListener("error",function(){k.loading|=2}),k.loading|=4,yr(_,t,o)}_={type:"stylesheet",instance:_,count:1,state:k},u.set(h,_)}}}function WS(e,t){fa.X(e,t);var s=pi;if(s&&e){var o=zs(s).hoistableScripts,u=gi(e),h=o.get(u);h||(h=s.querySelector(Eo(u)),h||(e=y({src:e,async:!0},t),(t=kn.get(u))&&kd(e,t),h=s.createElement("script"),At(h),It(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function JS(e,t){fa.M(e,t);var s=pi;if(s&&e){var o=zs(s).hoistableScripts,u=gi(e),h=o.get(u);h||(h=s.querySelector(Eo(u)),h||(e=y({src:e,async:!0,type:"module"},t),(t=kn.get(u))&&kd(e,t),h=s.createElement("script"),At(h),It(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function lg(e,t,s,o){var u=(u=W.current)?gr(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=vi(s.href),s=zs(u).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=vi(s.href);var h=zs(u).hoistableStyles,_=h.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=u.querySelector(wo(e)))&&!h._p&&(_.instance=h,_.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||e1(u,e,s,_.state))),t&&o===null)throw Error(l(528,""));return _}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gi(s),s=zs(u).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function vi(e){return'href="'+vn(e)+'"'}function wo(e){return'link[rel="stylesheet"]['+e+"]"}function rg(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function e1(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),It(t,"link",s),At(t),e.head.appendChild(t))}function gi(e){return'[src="'+vn(e)+'"]'}function Eo(e){return"script[async]"+e}function cg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+vn(s.href)+'"]');if(o)return t.instance=o,At(o),o;var u=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),At(o),It(o,"style",u),yr(o,s.precedence,e),t.instance=o;case"stylesheet":u=vi(s.href);var h=e.querySelector(wo(u));if(h)return t.state.loading|=4,t.instance=h,At(h),h;o=rg(s),(u=kn.get(u))&&Td(o,u),h=(e.ownerDocument||e).createElement("link"),At(h);var _=h;return _._p=new Promise(function(k,D){_.onload=k,_.onerror=D}),It(h,"link",o),t.state.loading|=4,yr(h,s.precedence,e),t.instance=h;case"script":return h=gi(s.src),(u=e.querySelector(Eo(h)))?(t.instance=u,At(u),u):(o=s,(u=kn.get(h))&&(o=y({},s),kd(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),At(u),It(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,yr(o,s.precedence,e));return t.instance}function yr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,_=0;_<o.length;_++){var k=o[_];if(k.dataset.precedence===t)h=k;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function kd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var br=null;function ug(e,t,s){if(br===null){var o=new Map,u=br=new Map;u.set(s,o)}else u=br,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[$i]||h[Mt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var k=o.get(_);k?k.push(h):o.set(_,[h])}}return o}function dg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function t1(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 fg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function n1(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=vi(o.href),h=t.querySelector(wo(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,At(h);return}h=t.ownerDocument||t,o=rg(o),(u=kn.get(u))&&Td(o,u),h=h.createElement("link"),At(h);var _=h;_._p=new Promise(function(k,D){_.onload=k,_.onerror=D}),It(h,"link",o),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=xr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Cd=0;function a1(e,t){return e.stylesheets&&e.count===0&&Sr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Sr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Cd===0&&(Cd=62500*IS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Sr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Cd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function xr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _r=null;function Sr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_r=new Map,t.forEach(s1,e),_r=null,xr.call(e))}function s1(e,t){if(!(t.state.loading&4)){var s=_r.get(e);if(s)var o=s.get(null);else{s=new Map,_r.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var _=u[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),o=_)}o&&s.set(null,o)}u=t.instance,_=u.getAttribute("data-precedence"),h=s.get(_)||o,h===o&&s.set(null,u),s.set(_,u),this.count++,o=xr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Ao={$$typeof:A,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function i1(e,t,s,o,u,h,_,k,D){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=xc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xc(0),this.hiddenUpdates=xc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function hg(e,t,s,o,u,h,_,k,D,V,F,Q){return e=new i1(e,t,s,_,D,V,F,Q,k),t=1,h===!0&&(t|=24),h=tn(3,null,null,t),e.current=h,h.stateNode=e,t=su(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},ru(h),e}function mg(e){return e?(e=Fs,e):Fs}function pg(e,t,s,o,u,h){u=mg(u),o.context===null?o.context=u:o.pendingContext=u,o=Ea(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Aa(e,o,t),s!==null&&(Qt(s,e,t),lo(s,e,t))}function vg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function jd(e,t){vg(e,t),(e=e.alternate)&&vg(e,t)}function gg(e){if(e.tag===13||e.tag===31){var t=as(e,67108864);t!==null&&Qt(t,e,67108864),jd(e,67108864)}}function yg(e){if(e.tag===13||e.tag===31){var t=ln();t=_c(t);var s=as(e,t);s!==null&&Qt(s,e,t),jd(e,t)}}var Tr=!0;function o1(e,t,s,o){var u=O.T;O.T=null;var h=$.p;try{$.p=2,Nd(e,t,s,o)}finally{$.p=h,O.T=u}}function l1(e,t,s,o){var u=O.T;O.T=null;var h=$.p;try{$.p=8,Nd(e,t,s,o)}finally{$.p=h,O.T=u}}function Nd(e,t,s,o){if(Tr){var u=wd(o);if(u===null)hd(e,t,o,kr,s),xg(e,o);else if(c1(u,e,t,s,o))o.stopPropagation();else if(xg(e,o),t&4&&-1<r1.indexOf(e)){for(;u!==null;){var h=Is(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=Dn(h.pendingLanes);if(_!==0){var k=h;for(k.pendingLanes|=2,k.entangledLanes|=2;_;){var D=1<<31-Ye(_);k.entanglements[1]|=D,_&=~D}Hn(h),($e&6)===0&&(or=Ut()+500,ko(0))}}break;case 31:case 13:k=as(h,2),k!==null&&Qt(k,h,2),rr(),jd(h,2)}if(h=wd(o),h===null&&hd(e,t,o,kr,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else hd(e,t,o,null,s)}}function wd(e){return e=Ac(e),Ed(e)}var kr=null;function Ed(e){if(kr=null,e=Ls(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=m(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 kr=e,null}function bg(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(pl()){case vl:return 2;case X:return 8;case ie:case fe:return 32;case _e:return 268435456;default:return 32}default:return 32}}var Ad=!1,Ha=null,Ga=null,Pa=null,Do=new Map,Ro=new Map,$a=[],r1="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 xg(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":Do.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ro.delete(t.pointerId)}}function Mo(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Is(t),t!==null&&gg(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function c1(e,t,s,o,u){switch(t){case"focusin":return Ha=Mo(Ha,e,t,s,o,u),!0;case"dragenter":return Ga=Mo(Ga,e,t,s,o,u),!0;case"mouseover":return Pa=Mo(Pa,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Do.set(h,Mo(Do.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Ro.set(h,Mo(Ro.get(h)||null,e,t,s,o,u)),!0}return!1}function _g(e){var t=Ls(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,Bh(e.priority,function(){yg(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Bh(e.priority,function(){yg(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 Cr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=wd(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Ec=o,s.target.dispatchEvent(o),Ec=null}else return t=Is(s),t!==null&&gg(t),e.blockedOn=s,!1;t.shift()}return!0}function Sg(e,t,s){Cr(e)&&s.delete(t)}function u1(){Ad=!1,Ha!==null&&Cr(Ha)&&(Ha=null),Ga!==null&&Cr(Ga)&&(Ga=null),Pa!==null&&Cr(Pa)&&(Pa=null),Do.forEach(Sg),Ro.forEach(Sg)}function jr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ad||(Ad=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,u1)))}var Nr=null;function Tg(e){Nr!==e&&(Nr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Nr===e&&(Nr=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Ed(o||s)===null)continue;break}var h=Is(s);h!==null&&(e.splice(t,3),t-=3,wu(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function yi(e){function t(D){return jr(D,e)}Ha!==null&&jr(Ha,e),Ga!==null&&jr(Ga,e),Pa!==null&&jr(Pa,e),Do.forEach(t),Ro.forEach(t);for(var s=0;s<$a.length;s++){var o=$a[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<$a.length&&(s=$a[0],s.blockedOn===null);)_g(s),s.blockedOn===null&&$a.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],_=u[qt]||null;if(typeof h=="function")_||Tg(s);else if(_){var k=null;if(h&&h.hasAttribute("formAction")){if(u=h,_=h[qt]||null)k=_.formAction;else if(Ed(u)!==null)continue}else k=_.action;typeof k=="function"?s[o+1]=k:(s.splice(o,3),o-=3),Tg(s)}}}function kg(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!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 o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Dd(e){this._internalRoot=e}wr.prototype.render=Dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=ln();pg(s,o,e,t,null,null)},wr.prototype.unmount=Dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pg(e.current,2,null,e,null,null),rr(),t[Bs]=null}};function wr(e){this._internalRoot=e}wr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oh();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&&_g(e)}};var Cg=a.version;if(Cg!=="19.2.4")throw Error(l(527,Cg,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var d1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Er=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Er.isDisabled&&Er.supportsFiber)try{Se=Er.inject(d1),Ie=Er}catch{}}return Bo.createRoot=function(e,t){if(!c(e))throw Error(l(299));var s=!1,o="",u=Rp,h=Mp,_=Op;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=hg(e,1,!1,null,null,s,o,null,u,h,_,kg),e[Bs]=t.current,fd(e),new Dd(t)},Bo.hydrateRoot=function(e,t,s){if(!c(e))throw Error(l(299));var o=!1,u="",h=Rp,_=Mp,k=Op,D=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=hg(e,1,!0,t,s??null,o,u,D,h,_,k,kg),t.context=mg(null),s=t.current,o=ln(),o=_c(o),u=Ea(o),u.callback=null,Aa(s,u,o),s=o,t.current.lanes=s,Pi(t,s),Hn(t),e[Bs]=t.current,fd(e),new wr(t)},Bo.version="19.2.4",Bo}var Mg;function L1(){if(Mg)return Rd.exports;Mg=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(),Rd.exports=B1(),Rd.exports}var I1=L1();const z1="modulepreload",U1=function(n){return"/"+n},Og={},V1=function(a,i,l){let c=Promise.resolve();if(i&&i.length>0){let f=function(v){return Promise.all(v.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));c=f(i.map(v=>{if(v=U1(v),v in Og)return;Og[v]=!0;const g=v.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${y}`))return;const x=document.createElement("link");if(x.rel=g?"stylesheet":z1,g||(x.as="script"),x.crossOrigin="",x.href=v,p&&x.setAttribute("nonce",p),document.head.appendChild(x),g)return new Promise((S,T)=>{x.addEventListener("load",S),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${v}`)))})}))}function d(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return c.then(f=>{for(const m of f||[])m.status==="rejected"&&d(m.reason);return a().catch(d)})};function Ts(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function N0(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function H1(n){return Ts(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Ts(n.payload)}function G1(n){return Ts(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")}const P1=new Set(["off","subscription","api_key"]),Rr=new Set(["off","on"]);function $1(n){return Ts(n)&&P1.has(n.claude)&&Rr.has(n.github)&&Rr.has(n.copilot)&&Rr.has(n.codex)&&Rr.has(n.goose)}function q1(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Ts(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:Ts(a.payload)?a.payload:{}}:{type:a.type,payload:Ts(a.payload)?a.payload:void 0}}function w0(n){switch(n){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";default:return n}}function E0(n){switch(n){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";default:return}}const Y1=3e3,bi=5e3,K1=4001;/**
27
- * react-router v7.13.2
28
- *
29
- * Copyright (c) Remix Software Inc.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE.md file in the root directory of this source tree.
33
- *
34
- * @license MIT
35
- */var Bg="popstate";function Lg(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function F1(n={}){function a(l,c){var v;let d=(v=c.state)==null?void 0:v.masked,{pathname:f,search:m,hash:p}=d||l.location;return lf("",{pathname:f,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,c){return typeof c=="string"?c:Jo(c)}return X1(a,i,null,n)}function ot(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function wn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Z1(){return Math.random().toString(36).substring(2,10)}function Ig(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 lf(n,a,i=null,l,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Li(a):a,state:i,key:a&&a.key||l||Z1(),unstable_mask:c}}function Jo({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 Li(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function X1(n,a,i,l={}){let{window:c=document.defaultView,v5Compat:d=!1}=l,f=c.history,m="POP",p=null,v=g();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function g(){return(f.state||{idx:null}).idx}function y(){m="POP";let N=g(),C=N==null?null:N-v;v=N,p&&p({action:m,location:j.location,delta:C})}function x(N,C){m="PUSH";let w=Lg(N)?N:lf(j.location,N,C);v=g()+1;let A=Ig(w,v),R=j.createHref(w.unstable_mask||w);try{f.pushState(A,"",R)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(R)}d&&p&&p({action:m,location:j.location,delta:1})}function S(N,C){m="REPLACE";let w=Lg(N)?N:lf(j.location,N,C);v=g();let A=Ig(w,v),R=j.createHref(w.unstable_mask||w);f.replaceState(A,"",R),d&&p&&p({action:m,location:j.location,delta:0})}function T(N){return Q1(N)}let j={get action(){return m},get location(){return n(c,f)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Bg,y),p=N,()=>{c.removeEventListener(Bg,y),p=null}},createHref(N){return a(c,N)},createURL:T,encodeLocation(N){let C=T(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:x,replace:S,go(N){return f.go(N)}};return j}function Q1(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ot(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:Jo(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function A0(n,a,i="/"){return W1(n,a,i,!1)}function W1(n,a,i,l){let c=typeof a=="string"?Li(a):a,d=ga(c.pathname||"/",i);if(d==null)return null;let f=D0(n);J1(f);let m=null;for(let p=0;m==null&&p<f.length;++p){let v=M0(d);m=rT(f[p],v,l)}return m}function D0(n,a=[],i=[],l="",c=!1){let d=(f,m,p=c,v)=>{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(l)&&p)return;ot(g.relativePath.startsWith(l),`Absolute route path "${g.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(l.length)}let y=$n([l,g.relativePath]),x=i.concat(g);f.children&&f.children.length>0&&(ot(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),D0(f.children,a,x,y,p)),!(f.path==null&&!f.index)&&a.push({path:y,score:oT(y,f.index),routesMeta:x})};return n.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let v of R0(f.path))d(f,m,!0,v)}),a}function R0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,c=i.endsWith("?"),d=i.replace(/\?$/,"");if(l.length===0)return c?[d,""]:[d];let f=R0(l.join("/")),m=[];return m.push(...f.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...f),m.map(p=>n.startsWith("/")&&p===""?"/":p)}function J1(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:lT(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var eT=/^:[\w-]+$/,tT=3,nT=2,aT=1,sT=10,iT=-2,zg=n=>n==="*";function oT(n,a){let i=n.split("/"),l=i.length;return i.some(zg)&&(l+=iT),a&&(l+=nT),i.filter(c=>!zg(c)).reduce((c,d)=>c+(eT.test(d)?tT:d===""?aT:sT),l)}function lT(n,a){return n.length===a.length&&n.slice(0,-1).every((l,c)=>l===a[c])?n[n.length-1]-a[a.length-1]:0}function rT(n,a,i=!1){let{routesMeta:l}=n,c={},d="/",f=[];for(let m=0;m<l.length;++m){let p=l[m],v=m===l.length-1,g=d==="/"?a:a.slice(d.length)||"/",y=el({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),x=p.route;if(!y&&v&&i&&!l[l.length-1].route.index&&(y=el({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!y)return null;Object.assign(c,y.params),f.push({params:c,pathname:$n([d,y.pathname]),pathnameBase:hT($n([d,y.pathnameBase])),route:x}),y.pathnameBase!=="/"&&(d=$n([d,y.pathnameBase]))}return f}function el(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=cT(n.path,n.caseSensitive,n.end),c=a.match(i);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:l.reduce((v,{paramName:g,isOptional:y},x)=>{if(g==="*"){let T=m[x]||"";f=d.slice(0,d.length-T.length).replace(/(.)\/+$/,"$1")}const S=m[x];return y&&!S?v[g]=void 0:v[g]=(S||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:n}}function cT(n,a=!1,i=!0){wn(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 l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,v,g)=>{if(l.push({paramName:m,isOptional:p!=null}),p){let y=g.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),l]}function M0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wn(!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,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var uT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function dT(n,a="/"){let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Li(n):n,d;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?d=Ug(i.substring(1),"/"):d=Ug(i,a)):d=a,{pathname:d,search:mT(l),hash:pT(c)}}function Ug(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function Bd(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. 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 fT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Bf(n){let a=fT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function lc(n,a,i,l=!1){let c;typeof n=="string"?c=Li(n):(c={...n},ot(!c.pathname||!c.pathname.includes("?"),Bd("?","pathname","search",c)),ot(!c.pathname||!c.pathname.includes("#"),Bd("#","pathname","hash",c)),ot(!c.search||!c.search.includes("#"),Bd("#","search","hash",c)));let d=n===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=i;else{let y=a.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),y-=1;c.pathname=x.join("/")}m=y>=0?a[y]:"/"}let p=dT(c,m),v=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var $n=n=>n.join("/").replace(/\/\/+/g,"/"),hT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),mT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,pT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,vT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function gT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function yT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var O0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function B0(n,a){let i=n;if(typeof i!="string"||!uT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,c=!1;if(O0)try{let d=new URL(window.location.href),f=i.startsWith("//")?new URL(d.protocol+i):new URL(i),m=ga(f.pathname,a);f.origin===d.origin&&m!=null?i=m+f.search+f.hash:c=!0}catch{wn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var L0=["POST","PUT","PATCH","DELETE"];new Set(L0);var bT=["GET",...L0];new Set(bT);var Ii=b.createContext(null);Ii.displayName="DataRouter";var rc=b.createContext(null);rc.displayName="DataRouterState";var xT=b.createContext(!1),I0=b.createContext({isTransitioning:!1});I0.displayName="ViewTransition";var _T=b.createContext(new Map);_T.displayName="Fetchers";var ST=b.createContext(null);ST.displayName="Await";var dn=b.createContext(null);dn.displayName="Navigation";var ll=b.createContext(null);ll.displayName="Location";var En=b.createContext({outlet:null,matches:[],isDataRoute:!1});En.displayName="Route";var Lf=b.createContext(null);Lf.displayName="RouteError";var z0="REACT_ROUTER_ERROR",TT="REDIRECT",kT="ROUTE_ERROR_RESPONSE";function CT(n){if(n.startsWith(`${z0}:${TT}:{`))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 jT(n){if(n.startsWith(`${z0}:${kT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new vT(a.status,a.statusText,a.data)}catch{}}function NT(n,{relative:a}={}){ot(Ns(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=b.useContext(dn),{hash:c,pathname:d,search:f}=rl(n,{relative:a}),m=d;return i!=="/"&&(m=d==="/"?i:$n([i,d])),l.createHref({pathname:m,search:f,hash:c})}function Ns(){return b.useContext(ll)!=null}function wt(){return ot(Ns(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(ll).location}function St(n){ot(Ns(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=wt();return b.useMemo(()=>el(n,M0(a)),[a,n])}var U0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function V0(n){b.useContext(dn).static||b.useLayoutEffect(n)}function cc(){let{isDataRoute:n}=b.useContext(En);return n?GT():wT()}function wT(){ot(Ns(),"useNavigate() may be used only in the context of a <Router> component.");let n=b.useContext(Ii),{basename:a,navigator:i}=b.useContext(dn),{matches:l}=b.useContext(En),{pathname:c}=wt(),d=JSON.stringify(Bf(l)),f=b.useRef(!1);return V0(()=>{f.current=!0}),b.useCallback((p,v={})=>{if(wn(f.current,U0),!f.current)return;if(typeof p=="number"){i.go(p);return}let g=lc(p,JSON.parse(d),c,v.relative==="path");n==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:$n([a,g.pathname])),(v.replace?i.replace:i.push)(g,v.state,v)},[a,i,d,c,n])}var ET=b.createContext(null);function AT(n){let a=b.useContext(En).outlet;return b.useMemo(()=>a&&b.createElement(ET.Provider,{value:n},a),[a,n])}function Qa(){let{matches:n}=b.useContext(En),a=n[n.length-1];return a?a.params:{}}function rl(n,{relative:a}={}){let{matches:i}=b.useContext(En),{pathname:l}=wt(),c=JSON.stringify(Bf(i));return b.useMemo(()=>lc(n,JSON.parse(c),l,a==="path"),[n,c,l,a])}function DT(n,a){return H0(n,a)}function H0(n,a,i){var N;ot(Ns(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=b.useContext(dn),{matches:c}=b.useContext(En),d=c[c.length-1],f=d?d.params:{},m=d?d.pathname:"/",p=d?d.pathnameBase:"/",v=d&&d.route;{let C=v&&v.path||"";P0(m,!v||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${C}">) 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.
36
-
37
- Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let g=wt(),y;if(a){let C=typeof a=="string"?Li(a):a;ot(p==="/"||((N=C.pathname)==null?void 0:N.startsWith(p)),`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 "${p}" but pathname "${C.pathname}" was given in the \`location\` prop.`),y=C}else y=g;let x=y.pathname||"/",S=x;if(p!=="/"){let C=p.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let T=A0(n,{pathname:S});wn(v||T!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),wn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 j=LT(T&&T.map(C=>Object.assign({},C,{params:Object.assign({},f,C.params),pathname:$n([p,l.encodeLocation?l.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?p:$n([p,l.encodeLocation?l.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),c,i);return a&&j?b.createElement(ll.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},j):j}function RT(){let n=HT(),a=gT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:d},"ErrorBoundary")," or"," ",b.createElement("code",{style:d},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},a),i?b.createElement("pre",{style:c},i):null,f)}var MT=b.createElement(RT,null),G0=class extends b.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=jT(n.digest);i&&(n=i)}let a=n!==void 0?b.createElement(En.Provider,{value:this.props.routeContext},b.createElement(Lf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?b.createElement(OT,{error:n},a):a}};G0.contextType=xT;var Ld=new WeakMap;function OT({children:n,error:a}){let{basename:i}=b.useContext(dn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=CT(a.digest);if(l){let c=Ld.get(a);if(c)throw c;let d=B0(l.location,i);if(O0&&!Ld.get(a))if(d.isExternal||l.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw Ld.set(a,f),f}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function BT({routeContext:n,match:a,children:i}){let l=b.useContext(Ii);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),b.createElement(En.Provider,{value:n},i)}function LT(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let c=n,d=l==null?void 0:l.errors;if(d!=null){let g=c.findIndex(y=>y.route.id&&(d==null?void 0:d[y.route.id])!==void 0);ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let f=!1,m=-1;if(i&&l){f=l.renderFallback;for(let g=0;g<c.length;g++){let y=c[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=g),y.route.id){let{loaderData:x,errors:S}=l,T=y.route.loader&&!x.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||T){i.isStatic&&(f=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=i==null?void 0:i.onError,v=l&&p?(g,y)=>{var x,S;p(g,{location:l.location,params:((S=(x=l.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:yT(l.matches),errorInfo:y})}:void 0;return c.reduceRight((g,y,x)=>{let S,T=!1,j=null,N=null;l&&(S=d&&y.route.id?d[y.route.id]:void 0,j=y.route.errorElement||MT,f&&(m<0&&x===0?(P0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,N=null):m===x&&(T=!0,N=y.route.hydrateFallbackElement||null)));let C=a.concat(c.slice(0,x+1)),w=()=>{let A;return S?A=j:T?A=N:y.route.Component?A=b.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=g,b.createElement(BT,{match:y,routeContext:{outlet:g,matches:C,isDataRoute:l!=null},children:A})};return l&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?b.createElement(G0,{location:l.location,revalidation:l.revalidation,component:j,error:S,children:w(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:v}):w()},null)}function If(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IT(n){let a=b.useContext(Ii);return ot(a,If(n)),a}function zT(n){let a=b.useContext(rc);return ot(a,If(n)),a}function UT(n){let a=b.useContext(En);return ot(a,If(n)),a}function zf(n){let a=UT(n),i=a.matches[a.matches.length-1];return ot(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function VT(){return zf("useRouteId")}function HT(){var l;let n=b.useContext(Lf),a=zT("useRouteError"),i=zf("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function GT(){let{router:n}=IT("useNavigate"),a=zf("useNavigate"),i=b.useRef(!1);return V0(()=>{i.current=!0}),b.useCallback(async(c,d={})=>{wn(i.current,U0),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...d}))},[n,a])}var Vg={};function P0(n,a,i){!a&&!Vg[n]&&(Vg[n]=!0,wn(!1,i))}b.memo(PT);function PT({routes:n,future:a,state:i,isStatic:l,onError:c}){return H0(n,void 0,{state:i,isStatic:l,onError:c})}function Pn({to:n,replace:a,state:i,relative:l}){ot(Ns(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=b.useContext(dn);wn(!c,"<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:d}=b.useContext(En),{pathname:f}=wt(),m=cc(),p=lc(n,Bf(d),f,l==="path"),v=JSON.stringify(p);return b.useEffect(()=>{m(JSON.parse(v),{replace:a,state:i,relative:l})},[m,v,l,a,i]),null}function ws(n){return AT(n.context)}function ke(n){ot(!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 $T({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:c,static:d=!1,unstable_useTransitions:f}){ot(!Ns(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:c,static:d,unstable_useTransitions:f,future:{}}),[m,c,d,f]);typeof i=="string"&&(i=Li(i));let{pathname:v="/",search:g="",hash:y="",state:x=null,key:S="default",unstable_mask:T}=i,j=b.useMemo(()=>{let N=ga(v,m);return N==null?null:{location:{pathname:N,search:g,hash:y,state:x,key:S,unstable_mask:T},navigationType:l}},[m,v,g,y,x,S,l,T]);return wn(j!=null,`<Router basename="${m}"> is not able to match the URL "${v}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:b.createElement(dn.Provider,{value:p},b.createElement(ll.Provider,{children:a,value:j}))}function qT({children:n,location:a}){return DT(rf(n),a)}function rf(n,a=[]){let i=[];return b.Children.forEach(n,(l,c)=>{if(!b.isValidElement(l))return;let d=[...a,c];if(l.type===b.Fragment){i.push.apply(i,rf(l.props.children,d));return}ot(l.type===ke,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=rf(l.props.children,d)),i.push(f)}),i}var Pr="get",$r="application/x-www-form-urlencoded";function uc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function YT(n){return uc(n)&&n.tagName.toLowerCase()==="button"}function KT(n){return uc(n)&&n.tagName.toLowerCase()==="form"}function FT(n){return uc(n)&&n.tagName.toLowerCase()==="input"}function ZT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function XT(n,a){return n.button===0&&(!a||a==="_self")&&!ZT(n)}function cf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(c=>[i,c]):[[i,l]])},[]))}function QT(n,a){let i=cf(n);return a&&a.forEach((l,c)=>{i.has(c)||a.getAll(c).forEach(d=>{i.append(c,d)})}),i}var Mr=null;function WT(){if(Mr===null)try{new FormData(document.createElement("form"),0),Mr=!1}catch{Mr=!0}return Mr}var JT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Id(n){return n!=null&&!JT.has(n)?(wn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$r}"`),null):n}function ek(n,a){let i,l,c,d,f;if(KT(n)){let m=n.getAttribute("action");l=m?ga(m,a):null,i=n.getAttribute("method")||Pr,c=Id(n.getAttribute("enctype"))||$r,d=new FormData(n)}else if(YT(n)||FT(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||m.getAttribute("action");if(l=p?ga(p,a):null,i=n.getAttribute("formmethod")||m.getAttribute("method")||Pr,c=Id(n.getAttribute("formenctype"))||Id(m.getAttribute("enctype"))||$r,d=new FormData(m,n),!WT()){let{name:v,type:g,value:y}=n;if(g==="image"){let x=v?`${v}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else v&&d.append(v,y)}}else{if(uc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Pr,l=null,c=$r,f=n}return d&&c==="text/plain"&&(f=d,d=void 0),{action:l,method:i.toLowerCase(),encType:c,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Uf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function tk(n,a,i,l){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${l}`:c.pathname=`${c.pathname}.${l}`:c.pathname==="/"?c.pathname=`_root.${l}`:a&&ga(c.pathname,a)==="/"?c.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${l}`,c}async function nk(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 ak(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 sk(n,a,i){let l=await Promise.all(n.map(async c=>{let d=a.routes[c.route.id];if(d){let f=await nk(d,i);return f.links?f.links():[]}return[]}));return rk(l.flat(1).filter(ak).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Hg(n,a,i,l,c,d){let f=(p,v)=>i[v]?p.route.id!==i[v].route.id:!0,m=(p,v)=>{var g;return i[v].pathname!==p.pathname||((g=i[v].route.path)==null?void 0:g.endsWith("*"))&&i[v].params["*"]!==p.params["*"]};return d==="assets"?a.filter((p,v)=>f(p,v)||m(p,v)):d==="data"?a.filter((p,v)=>{var y;let g=l.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(f(p,v)||m(p,v))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=i[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function ik(n,a,{includeHydrateFallback:i}={}){return ok(n.map(l=>{let c=a.routes[l.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),i&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function ok(n){return[...new Set(n)]}function lk(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function rk(n,a){let i=new Set;return new Set(a),n.reduce((l,c)=>{let d=JSON.stringify(lk(c));return i.has(d)||(i.add(d),l.push({key:d,link:c})),l},[])}function $0(){let n=b.useContext(Ii);return Uf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function ck(){let n=b.useContext(rc);return Uf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Vf=b.createContext(void 0);Vf.displayName="FrameworkContext";function q0(){let n=b.useContext(Vf);return Uf(n,"You must render this element inside a <HydratedRouter> element"),n}function uk(n,a){let i=b.useContext(Vf),[l,c]=b.useState(!1),[d,f]=b.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:y}=a,x=b.useRef(null);b.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let j=C=>{C.forEach(w=>{f(w.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[n]),b.useEffect(()=>{if(l){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[l]);let S=()=>{c(!0)},T=()=>{c(!1),f(!1)};return i?n!=="intent"?[d,x,{}]:[d,x,{onFocus:Lo(m,S),onBlur:Lo(p,T),onMouseEnter:Lo(v,S),onMouseLeave:Lo(g,T),onTouchStart:Lo(y,S)}]:[!1,x,{}]}function Lo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function dk({page:n,...a}){let{router:i}=$0(),l=b.useMemo(()=>A0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?b.createElement(hk,{page:n,matches:l,...a}):null}function fk(n){let{manifest:a,routeModules:i}=q0(),[l,c]=b.useState([]);return b.useEffect(()=>{let d=!1;return sk(n,a,i).then(f=>{d||c(f)}),()=>{d=!0}},[n,a,i]),l}function hk({page:n,matches:a,...i}){let l=wt(),{future:c,manifest:d,routeModules:f}=q0(),{basename:m}=$0(),{loaderData:p,matches:v}=ck(),g=b.useMemo(()=>Hg(n,a,v,d,l,"data"),[n,a,v,d,l]),y=b.useMemo(()=>Hg(n,a,v,d,l,"assets"),[n,a,v,d,l]),x=b.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let j=new Set,N=!1;if(a.forEach(w=>{var R;let A=d.routes[w.route.id];!A||!A.hasLoader||(!g.some(E=>E.route.id===w.route.id)&&w.route.id in p&&((R=f[w.route.id])!=null&&R.shouldRevalidate)||A.hasClientLoader?N=!0:j.add(w.route.id))}),j.size===0)return[];let C=tk(n,m,c.unstable_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&C.searchParams.set("_routes",a.filter(w=>j.has(w.route.id)).map(w=>w.route.id).join(",")),[C.pathname+C.search]},[m,c.unstable_trailingSlashAwareDataRequests,p,l,d,g,a,n,f]),S=b.useMemo(()=>ik(y,d),[y,d]),T=fk(y);return b.createElement(b.Fragment,null,x.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...i})),S.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...i})),T.map(({key:j,link:N})=>b.createElement("link",{key:j,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function mk(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var pk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pk&&(window.__reactRouterVersion="7.13.2")}catch{}function vk({basename:n,children:a,unstable_useTransitions:i,window:l}){let c=b.useRef();c.current==null&&(c.current=F1({window:l,v5Compat:!0}));let d=c.current,[f,m]=b.useState({action:d.action,location:d.location}),p=b.useCallback(v=>{i===!1?m(v):b.startTransition(()=>m(v))},[i]);return b.useLayoutEffect(()=>d.listen(p),[d,p]),b.createElement($T,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:i})}var Y0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hf=b.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:c,reloadDocument:d,replace:f,unstable_mask:m,state:p,target:v,to:g,preventScrollReset:y,viewTransition:x,unstable_defaultShouldRevalidate:S,...T},j){let{basename:N,navigator:C,unstable_useTransitions:w}=b.useContext(dn),A=typeof g=="string"&&Y0.test(g),R=B0(g,N);g=R.to;let E=NT(g,{relative:c}),H=wt(),z=null;if(m){let ae=lc(m,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);N!=="/"&&(ae.pathname=ae.pathname==="/"?N:$n([N,ae.pathname])),z=C.createHref(ae)}let[I,P,ee]=uk(l,T),ne=xk(g,{replace:f,unstable_mask:m,state:p,target:v,preventScrollReset:y,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:w});function ce(ae){a&&a(ae),ae.defaultPrevented||ne(ae)}let re=!(R.isExternal||d),K=b.createElement("a",{...T,...ee,href:(re?z:void 0)||R.absoluteURL||E,onClick:re?ce:a,ref:mk(j,P),target:v,"data-discover":!A&&i==="render"?"true":void 0});return I&&!A?b.createElement(b.Fragment,null,K,b.createElement(dk,{page:E})):K});Hf.displayName="Link";var gk=b.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:c=!1,style:d,to:f,viewTransition:m,children:p,...v},g){let y=rl(f,{relative:v.relative}),x=wt(),S=b.useContext(rc),{navigator:T,basename:j}=b.useContext(dn),N=S!=null&&Ck(y)&&m===!0,C=T.encodeLocation?T.encodeLocation(y).pathname:y.pathname,w=x.pathname,A=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(w=w.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&j&&(A=ga(A,j)||A);const R=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let E=w===C||!c&&w.startsWith(C)&&w.charAt(R)==="/",H=A!=null&&(A===C||!c&&A.startsWith(C)&&A.charAt(C.length)==="/"),z={isActive:E,isPending:H,isTransitioning:N},I=E?a:void 0,P;typeof l=="function"?P=l(z):P=[l,E?"active":null,H?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let ee=typeof d=="function"?d(z):d;return b.createElement(Hf,{...v,"aria-current":I,className:P,ref:g,style:ee,to:f,viewTransition:m},typeof p=="function"?p(z):p)});gk.displayName="NavLink";var yk=b.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:c,state:d,method:f=Pr,action:m,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:x,...S},T)=>{let{unstable_useTransitions:j}=b.useContext(dn),N=Tk(),C=kk(m,{relative:v}),w=f.toLowerCase()==="get"?"get":"post",A=typeof m=="string"&&Y0.test(m),R=E=>{if(p&&p(E),E.defaultPrevented)return;E.preventDefault();let H=E.nativeEvent.submitter,z=(H==null?void 0:H.getAttribute("formmethod"))||f,I=()=>N(H||E.currentTarget,{fetcherKey:a,method:z,navigate:i,replace:c,state:d,relative:v,preventScrollReset:g,viewTransition:y,unstable_defaultShouldRevalidate:x});j&&i!==!1?b.startTransition(()=>I()):I()};return b.createElement("form",{ref:T,method:w,action:C,onSubmit:l?p:R,...S,"data-discover":!A&&n==="render"?"true":void 0})});yk.displayName="Form";function bk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K0(n){let a=b.useContext(Ii);return ot(a,bk(n)),a}function xk(n,{target:a,replace:i,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v}={}){let g=cc(),y=wt(),x=rl(n,{relative:f});return b.useCallback(S=>{if(XT(S,a)){S.preventDefault();let T=i!==void 0?i:Jo(y)===Jo(x),j=()=>g(n,{replace:T,unstable_mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:m,unstable_defaultShouldRevalidate:p});v?b.startTransition(()=>j()):j()}},[y,g,x,i,l,c,a,n,d,f,m,p,v])}function Gf(n){wn(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=b.useRef(cf(n)),i=b.useRef(!1),l=wt(),c=b.useMemo(()=>QT(l.search,i.current?null:a.current),[l.search]),d=cc(),f=b.useCallback((m,p)=>{const v=cf(typeof m=="function"?m(new URLSearchParams(c)):m);i.current=!0,d("?"+v,p)},[d,c]);return[c,f]}var _k=0,Sk=()=>`__${String(++_k)}__`;function Tk(){let{router:n}=K0("useSubmit"),{basename:a}=b.useContext(dn),i=VT(),l=n.fetch,c=n.navigate;return b.useCallback(async(d,f={})=>{let{action:m,method:p,encType:v,formData:g,body:y}=ek(d,a);if(f.navigate===!1){let x=f.fetcherKey||Sk();await l(x,i,f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:y,formMethod:f.method||p,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||m,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:y,formMethod:f.method||p,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:i,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,c,a,i])}function kk(n,{relative:a}={}){let{basename:i}=b.useContext(dn),l=b.useContext(En);ot(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),d={...rl(n||".",{relative:a})},f=wt();if(n==null){d.search=f.search;let m=new URLSearchParams(d.search),p=m.getAll("index");if(p.some(g=>g==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let g=m.toString();d.search=g?`?${g}`:""}}return(!n||n===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(d.pathname=d.pathname==="/"?i:$n([i,d.pathname])),Jo(d)}function Ck(n,{relative:a}={}){let i=b.useContext(I0);ot(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=K0("useViewTransitionState"),c=rl(n,{relative:a});if(!i.isTransitioning)return!1;let d=ga(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=ga(i.nextLocation.pathname,l)||i.nextLocation.pathname;return el(c.pathname,f)!=null||el(c.pathname,d)!=null}function Rt(){const n=cc();return b.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function F0(n){return`/sessions/${encodeURIComponent(n)}`}function Ei(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function ya(n,a,i,l){const c=encodeURIComponent(n);let d;return i&&l?d=`/environments/${encodeURIComponent(l)}/workspaces/${encodeURIComponent(i)}/tasks/${c}`:i?d=`/workspaces/${encodeURIComponent(i)}/tasks/${c}`:d=`/tasks/${c}`,a?`${d}/${a}`:d}function jk(n,a,i){return a&&i?`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:a?`/workspaces/${encodeURIComponent(a)}/tasks/${encodeURIComponent(n)}/edit`:`/tasks/${encodeURIComponent(n)}/edit`}function zi(n,a,i){const l=new URLSearchParams;n&&l.set("workspace",n),a&&l.set("parent",a);const c=l.toString();if(n&&i){const d=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${d}?parent=${encodeURIComponent(a)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function Z0(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Ai="/environments",Nk="/environments/new";function Di(n){return`/environments/${encodeURIComponent(n)}`}function wk(n){return`/environments/${encodeURIComponent(n)}/edit`}const Yo="/settings",Ek="/settings/credentials",Ak="/pair",Dk="/chat",Cs="/",Rk="/tasks",X0="/workspaces/new",Q0="/knowledge";function Mk(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=b.useRef(void 0),[c,d]=b.useState(!1),f=b.useRef(a.onMessage);f.current=a.onMessage;const m=b.useRef(a.onConnect);m.current=a.onConnect;const p=b.useRef(a.onDisconnect);p.current=a.onDisconnect;const v=b.useCallback(g=>{var y;((y=l.current)==null?void 0:y.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(g))},[]);return b.useEffect(()=>{let g,y;function x(){g=new WebSocket(i),l.current=g,g.onopen=()=>{d(!0),m.current(v)},g.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const T=q1(S.data);T&&f.current(T)},g.onclose=S=>{var T;if(d(!1),l.current=void 0,(T=p.current)==null||T.call(p),clearTimeout(y),S.code===K1){window.location.href=Ak;return}y=setTimeout(x,Y1)},g.onerror=()=>{g.close()}}return x(),()=>{clearTimeout(y),g==null||g.close()}},[i,v]),{connected:c,send:v}}const Ok=new Proxy(globalThis.fetch,{apply(n,a,i){return Reflect.apply(globalThis.fetch,a,i)}}),Bk=k1({baseUrl:"/",fetch:Ok}),Ce=C1(j1,Bk);function Lk(n){return{id:n.id,displayName:n.displayName,adapterType:n.adapterType,adapterConfig:n.adapterConfig||"{}",status:n.status,bootstrapped:n.bootstrapped}}function Gg(n){return{id:n.id,environmentId:n.environmentId,runtime:n.runtime,status:n.status,prompt:n.prompt,startedAt:n.startedAt,endedAt:n.endedAt||void 0,error:n.error||void 0,endReason:n.endReason||void 0,personaId:n.personaId||void 0,inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd}}function Ik(n){return{sessionId:n.sessionId,eventType:N1(n.type),timestamp:n.timestamp,content:n.content,raw:n.raw||void 0}}function zk(n){return{id:n.id,name:n.name,description:n.description,repoUrl:n.repoUrl,environmentId:n.environmentId,status:w1(n.status),workingDirectory:n.workingDirectory,useWorktrees:n.useWorktrees,defaultPersonaId:n.defaultPersonaId,createdAt:n.createdAt,updatedAt:n.updatedAt}}function Pg(n){return{id:n.id,workspaceId:n.workspaceId??void 0,title:n.title,description:n.description,status:E1(n.status),branch:n.branch,latestSessionId:n.latestSessionId,dependsOn:[...n.dependsOn],sortOrder:n.sortOrder,createdAt:n.createdAt,startedAt:n.startedAt||void 0,completedAt:n.completedAt||void 0,parentTaskId:n.parentTaskId,depth:n.depth,childTaskIds:[...n.childTaskIds],canDecompose:n.canDecompose,defaultPersonaId:n.defaultPersonaId}}function Uk(n){return{id:n.id,workspaceId:n.workspaceId,taskId:n.taskId,sessionId:n.sessionId,category:n.category,title:n.title,content:n.content,tags:[...n.tags],createdAt:n.createdAt}}function Vk(n){return{name:n.name,tokenType:n.type,envVar:n.envVar,filePath:n.filePath,expiresAt:n.expiresAt}}function Hk(n){return{claude:A1(n.claude),github:Dr(n.github),copilot:Dr(n.copilot),codex:Dr(n.codex),goose:Dr(n.goose)}}function Gk(n){return{name:n.name,repository:n.repository,state:n.state,gitStatus:n.gitStatus}}function Pk(n){return{id:n.id,name:n.name,description:n.description,systemPrompt:n.systemPrompt,toolConfig:n.toolConfig?JSON.stringify({allowedTools:[...n.toolConfig.allowedTools],disallowedTools:[...n.toolConfig.disallowedTools]}):"{}",runtime:n.runtime,model:n.model,maxTurns:n.maxTurns,mcpServers:JSON.stringify(n.mcpServers.map(a=>({name:a.name,command:a.command,args:[...a.args],tools:[...a.tools]}))),createdAt:n.createdAt,updatedAt:n.updatedAt,type:n.type||"agent",script:n.script}}function $k(n){return{inputTokens:n.inputTokens,outputTokens:n.outputTokens,costUsd:n.costUsd,sessionCount:n.sessionCount}}const $g=5e3;function qk(){const[n,a]=b.useState([]),[i,l]=b.useState({}),c=b.useCallback(()=>{Ce.listEnvironments({}).then(x=>{a(x.environments.map(Lk))},()=>{})},[]),d=b.useCallback(x=>{switch(x.type){case"environment.added":return!0;case"environment.removed":{const S=x.payload.environmentId;return S&&(a(T=>T.filter(j=>j.id!==S)),l(T=>{const j={...T};return delete j[S],j})),!0}case"environment.changed":return c(),!0;case"environment.provision_progress":{const S=x.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return N0("environment.provision_progress","invalid payload"),!0;if(l(T=>({...T,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const T=S.environmentId;setTimeout(()=>{l(j=>{const N={...j};return delete N[T],N})},$g)}return!0}default:return!1}},[c]),f=b.useCallback(x=>{var S;if(x.type==="environments"){const T=Array.isArray((S=x.payload)==null?void 0:S.environments)?x.payload.environments:[];return a(T),!0}return!1},[]),m=b.useCallback((x,S,T)=>{Ce.addEnvironment({displayName:x,adapterType:S,adapterConfig:JSON.stringify(T??{})}).catch(()=>{})},[]),p=b.useCallback((x,S)=>{Ce.updateEnvironment({id:x,displayName:S.displayName,adapterConfig:S.adapterConfig?JSON.stringify(S.adapterConfig):void 0}).catch(()=>{})},[]),v=b.useCallback(x=>{(async()=>{try{const T=Ce.provisionEnvironment({id:x});for await(const j of T)l(N=>({...N,[x]:{stage:j.stage,message:j.message,progress:j.progress}})),j.stage==="ready"&&setTimeout(()=>{l(N=>{const C={...N};return delete C[x],C})},$g)}catch{l(T=>{const j={...T};return delete j[x],j})}})().catch(()=>{})},[]),g=b.useCallback(x=>{Ce.stopEnvironment({id:x}).catch(()=>{})},[]),y=b.useCallback(x=>{Ce.removeEnvironment({id:x}).catch(()=>{})},[]);return{environments:n,provisionStatus:i,loadEnvironments:c,addEnvironment:m,updateEnvironment:p,provisionEnvironment:v,stopEnvironment:g,removeEnvironment:y,handleEvent:d,handleLegacyMessage:f}}const zd=new Set(["pending","running","idle"]),Yk=new Set(["completed","failed","interrupted","hibernating","suspended"]),qg=["pending","running","idle"];function Kk(){const[n,a]=b.useState([]),[i,l]=b.useState([]),[c,d]=b.useState(0),[f,m]=b.useState(void 0),[p,v]=b.useState({}),g=b.useCallback(()=>{Ce.listSessions({}).then(A=>{const R=A.sessions.map(Gg);a(E=>{const H=new Map(E.map(z=>[z.id,z]));return R.map(z=>{const I=H.get(z.id),P=I==null?void 0:I.status;return!P||P===z.status?z:Yk.has(P)&&zd.has(z.status)?{...z,status:P,...I.endReason!==void 0?{endReason:I.endReason}:{}}:zd.has(P)&&zd.has(z.status)&&qg.indexOf(P)>qg.indexOf(z.status)?{...z,status:P}:z})})},()=>{})},[]),y=b.useCallback(A=>{if(A.type!=="session_event")return!1;if(!G1(A.payload))return N0("session_event","payload is not a valid SessionEvent"),!0;const R=A.payload;let E=0;if(l(H=>{const z=[...H,R];return z.length>bi?(E=z.length-bi,z.slice(-bi)):z}),E>0&&d(H=>H+E),R.eventType==="usage")try{const H=JSON.parse(R.content),z=Number(H.input_tokens)||0,I=Number(H.output_tokens)||0,P=Number(H.cost_usd)||0;(z>0||I>0||P>0)&&a(ee=>ee.map(ne=>ne.id===R.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+z,outputTokens:(ne.outputTokens??0)+I,costUsd:(ne.costUsd??0)+P}:ne))}catch{}if(R.eventType==="status"){const H=w0(R.content),z=E0(R.content);a(I=>I.some(ee=>ee.id===R.sessionId)?I.map(ee=>ee.id===R.sessionId?{...ee,status:H,...z!==void 0?{endReason:z}:{}}:ee):[...I,{id:R.sessionId,environmentId:"",runtime:"",status:H,prompt:"",startedAt:R.timestamp,...z!==void 0?{endReason:z}:{}}])}return!0},[]),x=b.useCallback(A=>{var R,E,H,z,I;switch(A.type){case"sessions":{const P=Array.isArray((R=A.payload)==null?void 0:R.sessions)?A.payload.sessions:[];return a(P),!0}case"spawned":{const P=(E=A.payload)==null?void 0:E.sessionId;return typeof P=="string"&&P&&m(P),g(),!0}case"session_events":{const P=Array.isArray((H=A.payload)==null?void 0:H.events)?A.payload.events:[];return P.length>0&&l(P),!0}case"task_sessions":{const P=(z=A.payload)==null?void 0:z.taskId;if(typeof P=="string"&&P){const ee=Array.isArray((I=A.payload)==null?void 0:I.sessions)?A.payload.sessions:[];v(ne=>({...ne,[P]:ee}))}return!0}default:return!1}},[g]),S=b.useCallback((A,R,E,H)=>{Ce.spawnAgent({environmentId:A,prompt:R,personaId:E||"",workingDirectory:H||""}).then(z=>{m(z.id),g()},()=>{})},[g]),T=b.useCallback((A,R)=>{Ce.sendInput({sessionId:A,text:R}).catch(()=>{})},[]),j=b.useCallback(A=>{Ce.killAgent({id:A}).catch(()=>{})},[]),N=b.useCallback(A=>{Ce.getSessionEvents({id:A}).then(R=>{const E=R.events.map(Ik);if(E.length>0){let H=0;l(z=>{const I=new Set;for(const ne of z)ne.sessionId===A&&I.add(`${ne.timestamp}|${ne.eventType}`);const P=E.filter(ne=>!I.has(`${ne.timestamp}|${ne.eventType}`)),ee=[...z,...P].sort((ne,ce)=>ne.sessionId!==ce.sessionId?0:ne.timestamp.localeCompare(ce.timestamp));return ee.length>bi?(H=ee.length-bi,ee.slice(-bi)):ee}),H>0&&d(z=>z+H)}},()=>{})},[]),C=b.useCallback(()=>{l([]),d(0)},[]),w=b.useCallback(A=>{Ce.getTaskSessions({id:A}).then(R=>{const E=R.sessions.map(Gg);v(H=>({...H,[A]:E}))},()=>{})},[]);return{sessions:n,events:i,eventsDropped:c,lastSpawnedId:f,taskSessions:p,loadSessions:g,spawn:S,sendInput:T,kill:j,loadSessionEvents:N,clearEvents:C,loadTaskSessions:w,handleMessage:y,handleLegacyMessage:x}}function Fk(){const[n,a]=b.useState([]),[i,l]=b.useState(!1),c=b.useCallback(()=>{Ce.listWorkspaces({}).then(g=>{a(g.workspaces.map(zk))},()=>{})},[]),d=b.useCallback(g=>{switch(g.type){case"workspace.created":return l(!1),c(),!0;case"workspace.archived":case"workspace.updated":return c(),!0;default:return!1}},[c]),f=b.useCallback(()=>{l(!1)},[]),m=b.useCallback((g,y,x,S,T,j,N,C,w)=>{l(!0),Ce.createWorkspace({name:g,description:y||"",repoUrl:x||"",environmentId:S||"",defaultPersonaId:T||void 0,useWorktrees:j??!0,workingDirectory:N||void 0}).then(()=>{l(!1),C==null||C()},A=>{l(!1);const R=A instanceof Of?A.message:"Failed to create workspace";w==null||w(R)})},[]),p=b.useCallback(g=>{Ce.archiveWorkspace({id:g}).catch(()=>{})},[]),v=b.useCallback((g,y)=>{Ce.updateWorkspace({id:g,...y}).catch(()=>{})},[]);return{workspaces:n,workspaceCreating:i,loadWorkspaces:c,createWorkspace:m,archiveWorkspace:p,updateWorkspace:v,handleEvent:d,onDisconnect:f}}function Zk(){const[n,a]=b.useState([]),[i,l]=b.useState(void 0),c=b.useCallback(C=>{Ce.listTasks({workspaceId:C}).then(w=>{const A=w.tasks.map(Pg);a(R=>[...R.filter(E=>E.workspaceId!==C),...A])},()=>{})},[]),d=b.useCallback(()=>{Ce.listTasks({}).then(C=>{const w=C.tasks.map(Pg);a(A=>{const R=new Set(w.map(E=>E.id));return[...A.filter(E=>!R.has(E.id)),...w]})},()=>{})},[]),f=b.useCallback((C,w)=>{C?c(C):w&&a(A=>{const R=A.find(E=>E.id===w);return R!=null&&R.workspaceId?c(R.workspaceId):d(),A})},[c,d]),m=b.useCallback(C=>{const w=C.payload;switch(C.type){case"task.created":{const A=typeof w.workspaceId=="string"?w.workspaceId:"";return A&&c(A),!0}case"task.started":{const A=typeof w.taskId=="string"?w.taskId:"",R=typeof w.sessionId=="string"?w.sessionId:"",E=typeof w.workspaceId=="string"?w.workspaceId:"";return l(H=>A&&H===A?void 0:H),R&&A&&a(H=>H.map(z=>z.id===A?{...z,latestSessionId:R}:z)),f(E,A),!0}case"task.completed":case"task.deleted":case"task.updated":{const A=typeof w.workspaceId=="string"?w.workspaceId:"",R=typeof w.taskId=="string"?w.taskId:"";return f(A,R),!0}default:return!1}},[c,f]),p=b.useCallback(()=>{l(void 0)},[]),v=b.useCallback(C=>{var w,A;if(C.type==="tasks"){const R=Array.isArray((w=C.payload)==null?void 0:w.tasks)?C.payload.tasks:[],E=typeof((A=C.payload)==null?void 0:A.workspaceId)=="string"&&C.payload.workspaceId?C.payload.workspaceId:"";return a(E?H=>[...H.filter(z=>z.workspaceId!==E),...R]:H=>{const z=new Set(R.map(I=>I.id));return[...H.filter(I=>!z.has(I.id)),...R]}),!0}return!1},[]),g=b.useCallback((C,w,A,R,E,H,z,I,P)=>{Ce.createTask({workspaceId:C,title:w,description:A||"",dependsOn:R||[],parentTaskId:E||"",defaultPersonaId:H||void 0,canDecompose:z??void 0}).then(()=>{I==null||I()},ee=>{const ne=ee instanceof Of?ee.message:"Failed to create task";P==null||P(ne)})},[]),y=b.useCallback((C,w,A,R)=>{l(C),Ce.startTask({taskId:C,personaId:w||"",environmentId:A||"",notes:R||""}).catch(()=>{l(void 0)})},[]),x=b.useCallback(C=>{Ce.stopTask({id:C}).catch(()=>{})},[]),S=b.useCallback(C=>{Ce.completeTask({id:C}).catch(()=>{})},[]),T=b.useCallback(C=>{Ce.resumeTask({id:C}).catch(()=>{})},[]),j=b.useCallback((C,w,A,R,E)=>{Ce.updateTask({id:C,title:w,description:A,dependsOn:R,...E!==void 0?{defaultPersonaId:E}:{}}).catch(()=>{})},[]),N=b.useCallback(C=>{Ce.deleteTask({id:C}).catch(()=>{})},[]);return{tasks:n,taskStartingId:i,loadTasks:c,loadAllTasks:d,createTask:g,startTask:y,stopTask:x,completeTask:S,resumeTask:T,updateTask:j,deleteTask:N,handleEvent:m,onDisconnect:p,handleLegacyMessage:v}}function Xk(){const[n,a]=b.useState([]),i=b.useCallback(d=>{Ce.queryFindings({workspaceId:d}).then(f=>{a(f.findings.map(Uk))},()=>{})},[]),l=b.useCallback(d=>{if(d.type==="finding.posted"){const f=typeof d.payload.workspaceId=="string"?d.payload.workspaceId:"";return f&&i(f),!0}return!1},[i]),c=b.useCallback((d,f,m,p,v)=>{Ce.postFinding({workspaceId:d,title:f,content:m,category:p??"general",tags:v??[]}).catch(()=>{})},[]);return{findings:n,loadFindings:i,postFinding:c,handleEvent:l}}function Qk(){const[n,a]=b.useState([]),i=b.useCallback(()=>{Ce.listTokens({}).then(f=>{a(f.tokens.map(Vk))},()=>{})},[]),l=b.useCallback(f=>f.type==="token.changed"?(i(),!0):!1,[i]),c=b.useCallback((f,m,p,v,g)=>{Ce.setToken({name:f,value:m,type:p,envVar:v,filePath:g}).catch(()=>{})},[]),d=b.useCallback(f=>{Ce.deleteToken({name:f}).catch(()=>{})},[]);return{tokens:n,loadTokens:i,setToken:c,deleteToken:d,handleEvent:l}}function Wk(){const[n,a]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),i=b.useCallback(()=>{Ce.getCredentialProviders({}).then(d=>{a(Hk(d))},()=>{})},[]),l=b.useCallback(d=>d.type==="credential.providers_changed"?($1(d.payload)&&a(d.payload),!0):!1,[]),c=b.useCallback(d=>{const f=[{provider:"claude",value:d.claude},{provider:"github",value:d.github},{provider:"copilot",value:d.copilot},{provider:"codex",value:d.codex},{provider:"goose",value:d.goose}];for(const{provider:m,value:p}of f)Ce.setCredentialProvider({provider:m,value:p}).catch(()=>{})},[]);return{credentialProviders:n,loadCredentials:i,updateCredentialProviders:c,handleEvent:l}}function Jk(){const[n,a]=b.useState([]),[i,l]=b.useState(""),[c,d]=b.useState(""),[f,m]=b.useState(!1),p=b.useCallback(()=>{Ce.listCodespaces({}).then(g=>{a(g.codespaces.map(Gk)),d(g.error)},()=>{})},[]),v=b.useCallback((g,y)=>{m(!0),l(""),Ce.createCodespace({repo:g,machine:y??""}).then(()=>{m(!1),p()},x=>{m(!1);const S=x instanceof Of?x.message:"Failed to create codespace";l(S)})},[p]);return{codespaces:n,codespaceError:i,codespaceListError:c,codespaceCreating:f,listCodespaces:p,createCodespace:v}}function eC(){const[n,a]=b.useState([]),i=b.useCallback(()=>{Ce.listPersonas({}).then(m=>{a(m.personas.map(Pk))},()=>{})},[]),l=b.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return i(),!0;default:return!1}},[i]),c=b.useCallback((m,p,v,g,y,x,S,T)=>{Ce.createPersona({name:m,description:p,systemPrompt:v,runtime:g||"",model:y||"",maxTurns:x||0,type:S||"agent",script:T||""}).catch(()=>{})},[]),d=b.useCallback((m,p,v,g,y,x,S,T,j)=>{const N={id:m};p!==void 0&&(N.name=p),v!==void 0&&(N.description=v),g!==void 0&&(N.systemPrompt=g),y!==void 0&&(N.runtime=y),x!==void 0&&(N.model=x),S!==void 0&&(N.maxTurns=S),T!==void 0&&(N.type=T),j!==void 0&&(N.script=j),Ce.updatePersona(N).catch(()=>{})},[]),f=b.useCallback(m=>{Ce.deletePersona({id:m}).catch(()=>{})},[]);return{personas:n,loadPersonas:i,createPersona:c,updatePersona:d,deletePersona:f,handleEvent:l}}function Or(n,a=0){return{id:n.id,label:n.title||n.label||n.id,kind:n.kind,category:n.category,sourceType:n.sourceType,sourceId:n.sourceId,content:n.content,tags:n.tags,workspaceId:n.workspaceId,createdAt:n.createdAt,updatedAt:n.updatedAt,val:a}}function Ud(n){return{source:n.fromId,target:n.toId,type:n.type}}const tC=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function nC(n){const[a,i]=b.useState(new Map),[l,c]=b.useState([]),[d,f]=b.useState(void 0),[m,p]=b.useState(void 0),[v,g]=b.useState(!1),[y,x]=b.useState(""),S=b.useCallback(R=>{g(!0),n({type:"knowledge.listRecent",payload:{limit:30,workspaceId:R}})},[n]),T=b.useCallback(R=>{R.trim()&&(x(R),p(void 0),f(void 0),g(!0),n({type:"knowledge.search",payload:{query:R,limit:20}}))},[n]),j=b.useCallback(()=>{x(""),S()},[S]),N=b.useCallback(R=>{p(R),n({type:"knowledge.getNode",payload:{id:R}})},[n]),C=b.useCallback(()=>{p(void 0),f(void 0)},[]),w=b.useCallback(R=>{n({type:"knowledge.expand",payload:{id:R,depth:1}})},[n]),A=b.useCallback(R=>{if(!tC.has(R.type))return!1;const E=R.payload??{};switch(R.type){case"knowledge.listRecent.result":{if(E.error)return g(!1),!0;const H=E.nodes??[],z=E.edges??[],I=new Map,P=[];for(const ee of H)I.set(ee.id,Or(ee));for(const ee of z)P.push(Ud(ee));for(const ee of P){const ne=I.get(ee.source);ne&&(ne.val+=1);const ce=I.get(ee.target);ce&&(ce.val+=1)}return i(I),c(P),g(!1),!0}case"knowledge.search.result":{if(E.error)return g(!1),!0;const H=E.results??[],z=new Map,I=[];for(const P of H){const ee=P.node,ne=P.edges??[];z.set(ee.id,Or(ee,ne.length));for(const ce of ne)I.push(Ud(ce))}return i(z),c(I),g(!1),!0}case"knowledge.getNode.result":{if(E.error)return f(void 0),!0;const H=E.node,z=E.edges??[];return f({node:Or(H,z.length),edges:z.map(I=>({fromId:I.fromId,toId:I.toId,type:I.type,metadata:I.metadata}))}),!0}case"knowledge.expand.result":{const H=E.nodes??[],z=E.edges??[];return i(I=>{const P=new Map(I);for(const ee of H)P.has(ee.id)||P.set(ee.id,Or(ee));return P}),c(I=>{const P=new Set(I.map(ne=>`${ne.source}:${ne.target}:${ne.type}`)),ee=[];for(const ne of z){const ce=Ud(ne),re=`${ce.source}:${ce.target}:${ce.type}`;P.has(re)||ee.push(ce)}return[...I,...ee]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:l},selectedNode:d,selectedId:m,loading:v,searchQuery:y,search:T,clearSearch:j,selectNode:N,clearSelection:C,expandNode:w,loadRecent:S,handleMessage:A}}function aC(n){const[a,i]=b.useState(""),[l,c]=b.useState(void 0),[d,f]=b.useState({}),{connected:m,send:p}=Mk(n,{onMessage:P,onConnect:ee,onDisconnect:ne}),v=qk(),g=Kk(),y=Fk(),x=Zk(),S=Xk(),T=Qk(),j=Wk(),N=Jk(),C=eC(),w=nC(p),A="default_persona_id",R="onboarding_completed",E=b.useCallback(re=>{i(re),Ce.setSetting({key:A,value:re}).catch(()=>{})},[]),H=b.useCallback(()=>{c(!0),Ce.setSetting({key:R,value:"true"}).catch(()=>{})},[]),z=b.useCallback((re,K)=>{Ce.getUsage({scope:re,id:K}).then(ae=>{const O=`${re}:${K}`;f($=>({...$,[O]:$k(ae)}))},()=>{})},[]);function I(re){const K=re.payload.key,ae=re.payload.value;if(re.type==="setting.changed"){K===A&&i(ae??""),K===R&&c(ae==="true");return}if(v.handleEvent(re)){(re.type==="environment.removed"||re.type==="environment.changed")&&g.loadSessions();return}if(!y.handleEvent(re)){if(x.handleEvent(re)){re.type==="task.started"&&g.loadSessions();return}S.handleEvent(re)||T.handleEvent(re)||j.handleEvent(re)||C.handleEvent(re)}}function P(re){var K,ae,O,$;if(H1(re)){I(re);return}if(!g.handleMessage(re)&&!w.handleMessage(re)&&!((K=g.handleLegacyMessage)!=null&&K.call(g,re))&&!((ae=v.handleLegacyMessage)!=null&&ae.call(v,re))&&!((O=x.handleLegacyMessage)!=null&&O.call(x,re))&&re.type==="error"){console.error("[ws]",($=re.payload)==null?void 0:$.message);return}}function ee(re){v.loadEnvironments(),g.loadSessions(),y.loadWorkspaces(),T.loadTokens(),j.loadCredentials(),C.loadPersonas(),Ce.getSetting({key:A}).then(K=>{i(K.value)},()=>{}),Ce.getSetting({key:R}).then(K=>{c(K.value==="true")},()=>{}),x.loadAllTasks(),re({type:"subscribe_all"})}function ne(){y.onDisconnect(),x.onDisconnect()}const ce=b.useCallback(()=>{v.loadEnvironments(),g.loadSessions(),y.loadWorkspaces(),T.loadTokens()},[v.loadEnvironments,g.loadSessions,y.loadWorkspaces,T.loadTokens]);return{connected:m,send:p,environments:v.environments,sessions:g.sessions,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,workspaces:y.workspaces,tasks:x.tasks,findings:S.findings,tokens:T.tokens,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,refresh:ce,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadWorkspaces:y.loadWorkspaces,createWorkspace:y.createWorkspace,archiveWorkspace:y.archiveWorkspace,updateWorkspace:y.updateWorkspace,loadTasks:x.loadTasks,loadAllTasks:x.loadAllTasks,createTask:x.createTask,startTask:x.startTask,stopTask:x.stopTask,completeTask:x.completeTask,resumeTask:x.resumeTask,updateTask:x.updateTask,deleteTask:x.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,loadEnvironments:v.loadEnvironments,addEnvironment:v.addEnvironment,updateEnvironment:v.updateEnvironment,loadTokens:T.loadTokens,setToken:T.setToken,deleteToken:T.deleteToken,credentialProviders:j.credentialProviders,updateCredentialProviders:j.updateCredentialProviders,provisionStatus:v.provisionStatus,provisionEnvironment:v.provisionEnvironment,stopEnvironment:v.stopEnvironment,removeEnvironment:v.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:y.workspaceCreating,taskStartingId:x.taskStartingId,personas:C.personas,createPersona:C.createPersona,updatePersona:C.updatePersona,deletePersona:C.deletePersona,taskSessions:g.taskSessions,loadTaskSessions:g.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:E,onboardingCompleted:l,completeOnboarding:H,usageCache:d,loadUsage:z,knowledge:w}}const Pf=b.createContext(void 0);function sC({children:n}){const a=aC();return r.jsx(Pf.Provider,{value:a,children:n})}function rt(){const n=b.useContext(Pf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const iC=[{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}],oC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costUsd:.41},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costUsd:.22},{id:"sess-002",environmentId:"env-docker-01",runtime:"claude-code",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costUsd:.18},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costUsd:.31},{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costUsd:.1},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costUsd:.38}],lC=[{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:
38
- - src/middleware/auth.ts
39
- - src/routes/login.ts
40
- - 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:
41
- \`\`\`typescript
42
- import jwt from "jsonwebtoken";
43
- import type { Request, Response, NextFunction } from "express";
44
-
45
- const JWT_SECRET = process.env.JWT_SECRET || "change-me";
46
-
47
- export function verifyToken(req: Request, res: Response, next: NextFunction): void {
48
- const header = req.headers.authorization;
49
- if (!header?.startsWith("Bearer ")) {
50
- res.status(401).json({ error: "Missing token" });
51
- return;
52
- }
53
- try {
54
- const decoded = jwt.verify(header.slice(7), JWT_SECRET);
55
- req.user = decoded;
56
- next();
57
- } catch {
58
- res.status(403).json({ error: "Invalid token" });
59
- }
60
- }
61
- \`\`\``},{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"}],rC=[{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",workingDirectory:"",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",workingDirectory:"",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",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],cC=[{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:""}],Yg=[{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"}],uC=[{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:""}],dC=[{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:""},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
62
- for (const f of files) {
63
- const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
64
- if (eslintResult.exitCode !== 0) {
65
- env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
66
- }
67
- const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
68
- if (prettierResult.exitCode !== 0) {
69
- env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
70
- }
71
- }
72
- env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`}],fC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",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 Nt(n){return new Date(Date.now()+n).toISOString()}const Kg=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Nt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Nt(1600),content:`Found 5 endpoints that need refactoring:
73
- - GET /api/users
74
- - POST /api/users
75
- - GET /api/users/:id
76
- - PUT /api/users/:id
77
- - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Nt(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:Nt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Nt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Nt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Nt(1400),content:`Found tables to modify:
78
- - users (add column: last_login_at)
79
- - sessions (add index on expires_at)
80
- - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Nt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
81
- The table has 50,000+ rows — this may lock the table briefly.
82
-
83
- Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Nt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Nt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
84
- Migration 002_sessions_index.sql applied successfully.
85
- Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Nt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Nt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Nt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Nt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Nt(1800),content:`Writing test cases:
86
- - should calculate monthly total
87
- - should apply discount codes
88
- - should handle currency conversion
89
- - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Nt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
90
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Nt(3500),content:"failed"}}]}],Fg=400;function hC({children:n}){const[a,i]=b.useState(iC),[l,c]=b.useState(oC),[d,f]=b.useState(lC),[m,p]=b.useState(void 0),[v,g]=b.useState(rC),[y,x]=b.useState(cC),[S,T]=b.useState(Yg),[j,N]=b.useState(uC),[C,w]=b.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[A,R]=b.useState(dC),[E]=b.useState(fC),[H,z]=b.useState(""),I=b.useRef(0),P=b.useRef(0),ee=b.useRef(new Set),ne=b.useRef(new Map),ce=b.useRef(y);ce.current=y;const re=b.useRef(new Map),K=b.useRef(new Map),ae=b.useCallback(X=>(I.current+=1,`mock-${X}-${String(I.current).padStart(3,"0")}`),[]),O=b.useCallback(()=>{const X=Kg[P.current%Kg.length];return P.current+=1,X},[]),$=b.useCallback((X,ie,fe)=>{const _e=setTimeout(()=>{var ge;ee.current.delete(_e),fe&&((ge=ne.current.get(fe))==null||ge.delete(_e)),X()},ie);ee.current.add(_e),fe&&(ne.current.has(fe)||ne.current.set(fe,new Set),ne.current.get(fe).add(_e))},[]),se=b.useCallback(X=>{const ie=ne.current.get(X);ie&&(ie.forEach(fe=>{clearTimeout(fe),ee.current.delete(fe)}),ne.current.delete(X))},[]),oe=b.useCallback((X,ie,fe)=>{c(_e=>_e.map(ge=>ge.id===X?{...ge,status:ie,...fe!==void 0?{endReason:fe}:{}}:ge))},[]),Y=b.useCallback(X=>{f(ie=>[...ie,X])},[]),be=b.useCallback((X,ie,fe)=>{ie.forEach((_e,ge)=>{$(()=>{const Je={sessionId:X,..._e.event,timestamp:new Date().toISOString()};if(Y(Je),_e.event.eventType==="status"){const Se=w0(_e.event.content),Ie=E0(_e.event.content);oe(X,Se,Ie)}ge===ie.length-1&&fe&&fe()},_e.delayMs,X)})},[$,Y,oe]),Ne=b.useCallback((X,ie,fe,_e)=>{console.log("[MockGrackle] spawn",{environmentId:X,prompt:ie,runtime:_e});const ge=ae("sess"),Je={id:ge,environmentId:X,runtime:_e||"claude-code",status:"running",prompt:ie,startedAt:new Date().toISOString()};c(Ie=>[...Ie,Je]),p(ge);const Se=O();if(console.log(`[MockGrackle] Playing scenario: ${Se.label}`),Se.pauseForInput){const Ie=Se.pauseAfterStep??Se.steps.length-1,ze=Se.steps.slice(0,Ie+1),Ye=ze.length>0?ze[ze.length-1].delayMs:0;be(ge,ze),$(()=>{oe(ge,"idle"),Y({sessionId:ge,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ye+Fg,ge),Se.resumeSteps&&re.current.set(ge,Se.resumeSteps)}else be(ge,Se.steps)},[ae,O,be,$,oe,Y]),xe=b.useCallback(X=>{console.log("[MockGrackle] kill",X),se(X),re.current.delete(X),oe(X,"stopped","killed"),Y({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),x(ie=>ie.map(fe=>fe.latestSessionId===X&&fe.status==="working"?{...fe,status:"not_started"}:fe))},[se,oe,Y]),J=b.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),le=b.useCallback(X=>{console.log("[MockGrackle] loadSessionEvents",X)},[]),W=b.useCallback(()=>{console.log("[MockGrackle] clearEvents"),f([])},[]),tt=b.useCallback((X,ie,fe,_e,ge,Je,Se,Ie,ze)=>{console.log("[MockGrackle] createWorkspace",{name:X,description:ie});const Ye={id:ae("proj"),name:X,description:ie||"",repoUrl:fe||"",environmentId:_e||"",status:"active",workingDirectory:Se||"",useWorktrees:Je??!0,defaultPersonaId:ge||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(Et=>[...Et,Ye]),Ie&&Ie()},[ae]),Re=b.useCallback(X=>{console.log("[MockGrackle] archiveWorkspace",X),g(ie=>ie.map(fe=>fe.id===X?{...fe,status:"archived"}:fe))},[]),An=b.useCallback(X=>{console.log("[MockGrackle] loadTasks",X)},[]),xa=b.useCallback((X,ie,fe,_e,ge,Je,Se,Ie,ze)=>{console.log("[MockGrackle] createTask",{workspaceId:X,title:ie,parentTaskId:ge}),x(Ye=>{const Gt=Ye.filter(mn=>mn.workspaceId===X).reduce((mn,Dn)=>Math.max(mn,Dn.sortOrder),0),Jt=ge?Ye.find(mn=>mn.id===ge):void 0;if(ge&&!Jt)return console.warn("[MockGrackle] Parent task not found:",ge),Ye;if(Jt&&!Jt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ge),Ye;const Ct=Jt?Jt.depth+1:0,_a={id:ae("task"),workspaceId:X,title:ie,description:fe||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:ge||"",depth:Ct,childTaskIds:[],canDecompose:Se??!ge,defaultPersonaId:Je||""};return[...Ye,_a]}),Ie&&Ie()},[ae]),fn=b.useCallback((X,ie,fe,_e)=>{var Ye;console.log("[MockGrackle] startTask",{taskId:X});const ge=ce.current.find(Et=>Et.id===X),Je=(ge==null?void 0:ge.title)??"",Se=ae("sess"),Ie={id:Se,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Je||X,startedAt:new Date().toISOString()};c(Et=>[...Et,Ie]),x(Et=>Et.map(Gt=>Gt.id===X?{...Gt,status:"working",latestSessionId:Se,branch:`mock/${X.slice(0,8)}`}:Gt));const ze=O();if(console.log(`[MockGrackle] Playing task scenario: ${ze.label}`),ze.pauseForInput){const Et=ze.pauseAfterStep??ze.steps.length-1,Gt=ze.steps.slice(0,Et+1),Jt=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(be(Se,Gt),$(()=>{oe(Se,"idle"),Y({sessionId:Se,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Jt+Fg,Se),ze.resumeSteps){const Ct=[...ze.resumeSteps];re.current.set(Se,Ct);const _a=Ct.reduce((mn,Dn)=>Math.max(mn,Dn.delayMs),0);K.current.set(Se,{taskId:X,delayAfterResume:_a+200})}}else{const Et=ze.steps.length>0?ze.steps[ze.steps.length-1].delayMs:0;be(Se,ze.steps);const Gt=(Ye=ze.steps[ze.steps.length-1])==null?void 0:Ye.event.content;$(()=>{Gt==="completed"?x(Jt=>Jt.map(Ct=>Ct.id===X&&Ct.status==="working"?{...Ct,status:"paused"}:Ct)):Gt==="failed"&&x(Jt=>Jt.map(Ct=>Ct.id===X&&Ct.status==="working"?{...Ct,status:"failed"}:Ct))},Et+100,Se)}},[ae,O,be,$,oe,Y]),Fn=b.useCallback((X,ie)=>{console.log("[MockGrackle] sendInput",{sessionId:X,text:ie}),Y({sessionId:X,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ie}`}),oe(X,"running"),Y({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const fe=re.current.get(X);if(fe)re.current.delete(X),be(X,fe);else{const ge=[{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"}}];be(X,ge)}const _e=K.current.get(X);_e&&(K.current.delete(X),$(()=>{x(ge=>ge.map(Je=>Je.id===_e.taskId&&Je.status==="working"?{...Je,status:"paused"}:Je))},_e.delayAfterResume,X))},[Y,oe,be,$]),Ln=b.useCallback(X=>{console.log("[MockGrackle] completeTask",X),x(ie=>ie.map(fe=>fe.id===X?{...fe,status:"complete"}:fe))},[]),hn=b.useCallback(X=>{console.log("[MockGrackle] resumeTask",X)},[]),In=b.useCallback((X,ie,fe,_e,ge)=>{console.log("[MockGrackle] updateTask",{taskId:X,title:ie}),x(Je=>Je.map(Se=>Se.id===X?{...Se,title:ie.trim()||Se.title,description:fe,dependsOn:_e,...ge!==void 0?{defaultPersonaId:ge}:{}}:Se))},[]),Te=b.useCallback(X=>{console.log("[MockGrackle] deleteTask",X),x(ie=>ie.filter(fe=>fe.id!==X))},[]),kt=b.useCallback(X=>{console.log("[MockGrackle] loadFindings",X),T(Yg.filter(ie=>ie.workspaceId===X))},[]),Hi=b.useCallback((X,ie,fe,_e,ge)=>{console.log("[MockGrackle] postFinding",{workspaceId:X,title:ie});const Je={id:ae("find"),workspaceId:X,taskId:"",sessionId:"",category:_e||"general",title:ie,content:fe,tags:ge||[],createdAt:new Date().toISOString()};T(Se=>[...Se,Je])},[ae]),Rs=b.useCallback(()=>{console.log("[MockGrackle] loadEnvironments")},[]),Ms=b.useCallback((X,ie,fe)=>{console.log("[MockGrackle] addEnvironment",{displayName:X,adapterType:ie,adapterConfig:fe})},[]),Os=b.useCallback((X,ie)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:X,...ie}),i(fe=>fe.map(_e=>_e.id!==X?_e:{..._e,...ie.displayName!==void 0?{displayName:ie.displayName}:{},...ie.adapterConfig!==void 0?{adapterConfig:JSON.stringify(ie.adapterConfig)}:{}}))},[]),hl=b.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),ml=b.useCallback((X,ie,fe,_e,ge)=>{console.log("[MockGrackle] setToken",{name:X,tokenType:fe}),N(Je=>[...Je.filter(Ie=>Ie.name!==X),{name:X,tokenType:fe,envVar:_e,filePath:ge,expiresAt:""}])},[]),Ut=b.useCallback(X=>{console.log("[MockGrackle] deleteToken",X),N(ie=>ie.filter(fe=>fe.name!==X))},[]),pl=b.useCallback(X=>{console.log("[MockGrackle] updateCredentialProviders",X),w(X)},[]);b.useEffect(()=>()=>{ee.current.forEach(clearTimeout),ee.current.clear()},[]);const vl=b.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:l,events:d,eventsDropped:0,lastSpawnedId:m,workspaces:v,tasks:y,findings:S,tokens:j,credentialProviders:C,spawn:Ne,sendInput:Fn,kill:xe,refresh:J,loadSessionEvents:le,clearEvents:W,loadWorkspaces:()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:tt,archiveWorkspace:Re,updateWorkspace:(X,ie)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:X,...ie}),g(fe=>fe.map(_e=>_e.id!==X?_e:{..._e,...ie.name!==void 0?{name:ie.name}:{},...ie.description!==void 0?{description:ie.description}:{},...ie.repoUrl!==void 0?{repoUrl:ie.repoUrl}:{},...ie.environmentId!==void 0?{environmentId:ie.environmentId}:{},...ie.workingDirectory!==void 0?{workingDirectory:ie.workingDirectory}:{},...ie.useWorktrees!==void 0?{useWorktrees:ie.useWorktrees}:{},...ie.defaultPersonaId!==void 0?{defaultPersonaId:ie.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:An,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:xa,startTask:fn,stopTask:X=>{console.log("[MockGrackle] stopTask",{taskId:X}),Ln(X)},completeTask:Ln,resumeTask:hn,updateTask:In,deleteTask:Te,loadFindings:kt,postFinding:Hi,loadEnvironments:Rs,addEnvironment:Ms,updateEnvironment:Os,loadTokens:hl,setToken:ml,deleteToken:Ut,updateCredentialProviders:pl,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:A,createPersona:(X,ie,fe,_e,ge,Je,Se,Ie)=>{console.log("[MockGrackle] createPersona",{name:X});const ze={id:`mock-persona-${Date.now()}`,name:X,description:ie,systemPrompt:fe,toolConfig:"{}",runtime:_e??"claude-code",model:ge||"",maxTurns:Je||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Se||"agent",script:Ie||""};R(Ye=>[...Ye,ze])},updatePersona:(X,ie,fe,_e,ge,Je,Se,Ie,ze)=>{console.log("[MockGrackle] updatePersona",{personaId:X,name:ie}),R(Ye=>Ye.map(Et=>Et.id!==X?Et:{...Et,...ie!==void 0?{name:ie}:{},...fe!==void 0?{description:fe}:{},..._e!==void 0?{systemPrompt:_e}:{},...ge!==void 0?{runtime:ge}:{},...Je!==void 0?{model:Je}:{},...Se!==void 0?{maxTurns:Se}:{},...Ie!==void 0?{type:Ie}:{},...ze!==void 0?{script:ze}:{},updatedAt:new Date().toISOString()}))},deletePersona:X=>{console.log("[MockGrackle] deletePersona",X),R(ie=>ie.filter(fe=>fe.id!==X))},taskSessions:E,loadTaskSessions:X=>{console.log("[MockGrackle] loadTaskSessions",X)},appDefaultPersonaId:H,setAppDefaultPersonaId:X=>{console.log("[MockGrackle] setAppDefaultPersonaId",X),z(X)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(X,ie)=>{console.log(`[MockGrackle] loadUsage(${X}, ${ie})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,l,d,m,v,y,S,j,C,A,E,H,Ne,Fn,xe,J,le,W,tt,Re,An,xa,fn,Ln,hn,In,Te,kt,Hi,Rs,Ms,Os,hl,ml,Ut,pl]);return r.jsx(Pf.Provider,{value:vl,children:n})}const W0=b.createContext(void 0),mC=4e3;function pC({children:n}){const[a,i]=b.useState([]),l=b.useRef(0),c=b.useCallback(f=>{i(m=>m.filter(p=>p.id!==f))},[]),d=b.useCallback((f,m="info",p=mC)=>{const v=`toast-${++l.current}`;i(g=>[...g,{id:v,message:f,variant:m,duration:p}])},[]);return r.jsx(W0.Provider,{value:{toasts:a,showToast:d,dismissToast:c},children:n})}function Es(){const n=b.useContext(W0);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const dc=[{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"]}],J0=new Set(dc.map(n=>n.id)),Zg="grackle";function uf(n){return dc.find(a=>a.id===n)}const df="grackle-theme",eb="grackle-prefer-system",tb="(prefers-color-scheme: dark)";let Vo=[],qr;function Vd(){qr=void 0;for(const n of Vo)n()}function ff(){return typeof window>"u"?!1:window.matchMedia(tb).matches}function Ko(){if(typeof localStorage>"u")return Zg;try{const n=localStorage.getItem(df);if(n!==null&&J0.has(n))return n}catch{}return Zg}function Qr(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(eb)==="true"}catch{return!1}}function hf(n){return dc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function nb(n,a){const i=uf(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?ff()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=hf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return ff()?l.variantDarkId:l.variantLightId}return n}function Si(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=nb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Si(Ko(),Qr());function vC(){return qr===void 0&&(qr={themeId:Ko(),systemDark:ff(),preferSystem:Qr()}),qr}function gC(n){return Vo=[...Vo,n],()=>{Vo=Vo.filter(a=>a!==n)}}function yC(){const n=b.useSyncExternalStore(gC,vC),{themeId:a,preferSystem:i}=n,l=nb(a,i),c=b.useCallback(f=>{if(J0.has(f)){try{localStorage.setItem(df,f)}catch{}Si(f,Qr(),!0),Vd()}},[]),d=b.useCallback(f=>{try{localStorage.setItem(eb,f?"true":"false")}catch{}if(f){const m=Ko(),p=uf(m);if(p!=null&&p.hidden){const v=hf(m);if(v)try{localStorage.setItem(df,v.id)}catch{}}}Si(Ko(),f,!0),Vd()},[]);return b.useEffect(()=>{Si(a,i)},[a,i]),b.useEffect(()=>{if(typeof window>"u")return;const f=window.matchMedia(tb),m=()=>{const p=Ko(),v=Qr();if(v){const g=uf(p);if(g!=null&&g.variantDarkId&&g.variantLightId&&Si(p,v),g!=null&&g.hidden){const y=hf(p);y!=null&&y.variantDarkId&&y.variantLightId&&Si(p,v)}}Vd()};return f.addEventListener("change",m),()=>{f.removeEventListener("change",m)}},[]),{themeId:a,setTheme:c,resolvedThemeId:l,preferSystem:i,setPreferSystem:d}}const ab=b.createContext(void 0);function bC({children:n}){const a=yC();return r.jsx(ab.Provider,{value:a,children:n})}function sb(){const n=b.useContext(ab);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const xC="_container_1mq5u_1",_C="_hamburger_1mq5u_33",SC="_brand_1mq5u_49",TC="_brandLogo_1mq5u_68",kC="_info_1mq5u_75",CC="_connectionLabel_1mq5u_90",jC="_connectionDot_1mq5u_103",NC="_connected_1mq5u_106",wC="_disconnected_1mq5u_110",ha={container:xC,hamburger:_C,brand:SC,brandLogo:TC,info:kC,connectionLabel:CC,connectionDot:jC,connected:NC,disconnected:wC};function EC({connected:n,environments:a,sessions:i,onToggleSidebar:l,sidebarOpen:c}){const d=Rt(),f=a.length,m=a.filter(v=>v.status==="connected").length,p=i.filter(v=>["running","idle"].includes(v.status)).length;return r.jsxs("div",{className:ha.container,children:[l&&r.jsx("button",{type:"button",className:ha.hamburger,onClick:l,"aria-label":"Toggle sidebar","aria-expanded":c,children:"☰"}),r.jsxs("button",{type:"button",className:ha.brand,onClick:()=>d(Cs),title:"Home",children:[r.jsx("img",{src:"/icon-192x192.png",alt:"",className:ha.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),r.jsxs("div",{className:ha.info,children:[r.jsxs("span",{"aria-label":n?"Connected":"Disconnected",children:[r.jsx("span",{className:`${ha.connectionDot} ${n?ha.connected:ha.disconnected}`,"aria-hidden":"true",children:"●"})," ",r.jsx("span",{className:ha.connectionLabel,"aria-hidden":"true",children:n?"Connected":"Disconnected"})]}),r.jsxs("span",{children:[m,"/",f," env",f!==1?"s":""]}),r.jsxs("span",{children:[p," active"]})]})]})}const AC="_nav_13gkc_1",DC="_tab_13gkc_35",RC="_tabIcon_13gkc_68",MC="_tabLabel_13gkc_79",OC="_tabActive_13gkc_84",Io={nav:AC,tab:DC,tabIcon:RC,tabLabel:MC,tabActive:OC},vs=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Cs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:Dk,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:Rk,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Ai,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:Q0,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:Ek,testId:"sidebar-tab-settings"}];function BC(n){return n===Cs||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(Q0)?"knowledge":n.startsWith(Yo)?"settings":"tasks"}function LC(){const n=wt(),a=Rt(),i=b.useRef(null),l=BC(n.pathname),c=b.useCallback(f=>{a(f.route)},[a]),d=b.useCallback(f=>{var y,x;const m=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!m)return;const p=Array.from(m).findIndex(S=>S===document.activeElement),v=p>=0?p:vs.findIndex(S=>S.view===l);let g=v;if(f.key==="ArrowRight")f.preventDefault(),g=(v+1)%vs.length;else if(f.key==="ArrowLeft")f.preventDefault(),g=(v-1+vs.length)%vs.length;else if(f.key==="Home")f.preventDefault(),g=0;else if(f.key==="End")f.preventDefault(),g=vs.length-1;else return;a(vs[g].route),(x=m[g])==null||x.focus()},[l,a]);return r.jsx("nav",{className:Io.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:d,"data-testid":"sidebar-nav",children:vs.map(f=>{const m=f.view===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Io.tab} ${m?Io.tabActive:""}`,onClick:()=>c(f),"data-testid":f.testId,title:f.label,"aria-label":f.label,children:[r.jsx("span",{className:Io.tabIcon,"aria-hidden":"true",children:f.icon}),r.jsx("span",{className:Io.tabLabel,children:f.label})]},f.view)})})}const ib=b.createContext(void 0),ob=b.createContext(void 0);function IC({children:n}){const[a,i]=b.useState(void 0),l=b.useCallback(c=>{i(c)},[]);return r.jsx(ob.Provider,{value:l,children:r.jsx(ib.Provider,{value:a,children:n})})}function lb(){return b.useContext(ib)}function zC(){const n=b.useContext(ob);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const UC="_container_pi6ii_1",VC="_content_pi6ii_66",Xg={container:UC,content:VC},HC=320,rb=220,cb=600,ub="grackle-sidebar-width";function GC(){try{const n=localStorage.getItem(ub);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=rb&&a<=cb)return a}}catch{}return HC}function PC(n){try{localStorage.setItem(ub,String(n))}catch{}}function $C(){const[n]=b.useState(GC),a=b.useRef(null),i=lb();if(b.useEffect(()=>{const l=a.current;if(!l)return;const c=new ResizeObserver(d=>{for(const f of d){const m=f.borderBoxSize[0];if(m){const p=Math.round(m.inlineSize);p>=rb&&p<=cb&&PC(p)}}});return c.observe(l),()=>{c.disconnect()}},[]),i!==void 0)return r.jsx("div",{className:Xg.container,ref:a,"data-testid":"sidebar",style:{width:n},children:r.jsx("div",{className:Xg.content,children:i})})}function fc(n){const a=zC();b.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const $f=b.createContext({});function qf(n){const a=b.useRef(null);return a.current===null&&(a.current=n()),a.current}const hc=b.createContext(null),Yf=b.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class qC extends b.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function YC({children:n,isPresent:a}){const i=b.useId(),l=b.useRef(null),c=b.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=b.useContext(Yf);return b.useInsertionEffect(()=>{const{width:f,height:m,top:p,left:v}=c.current;if(a||!l.current||!f||!m)return;l.current.dataset.motionPopId=i;const g=document.createElement("style");return d&&(g.nonce=d),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
91
- [data-motion-pop-id="${i}"] {
92
- position: absolute !important;
93
- width: ${f}px !important;
94
- height: ${m}px !important;
95
- top: ${p}px !important;
96
- left: ${v}px !important;
97
- }
98
- `),()=>{document.head.removeChild(g)}},[a]),r.jsx(qC,{isPresent:a,childRef:l,sizeRef:c,children:b.cloneElement(n,{ref:l})})}const KC=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:c,presenceAffectsLayout:d,mode:f})=>{const m=qf(FC),p=b.useId(),v=b.useCallback(y=>{m.set(y,!0);for(const x of m.values())if(!x)return;l&&l()},[m,l]),g=b.useMemo(()=>({id:p,initial:a,isPresent:i,custom:c,onExitComplete:v,register:y=>(m.set(y,!1),()=>m.delete(y))}),d?[Math.random(),v]:[i,v]);return b.useMemo(()=>{m.forEach((y,x)=>m.set(x,!1))},[i]),b.useEffect(()=>{!i&&!m.size&&l&&l()},[i]),f==="popLayout"&&(n=r.jsx(YC,{isPresent:i,children:n})),r.jsx(hc.Provider,{value:g,children:n})};function FC(){return new Map}function db(n=!0){const a=b.useContext(hc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:c}=a,d=b.useId();b.useEffect(()=>{n&&c(d)},[n]);const f=b.useCallback(()=>n&&l&&l(d),[d,l,n]);return!i&&l?[!1,f]:[!0]}const Br=n=>n.key||"";function Qg(n){const a=[];return b.Children.forEach(n,i=>{b.isValidElement(i)&&a.push(i)}),a}const Kf=typeof window<"u",fb=Kf?b.useLayoutEffect:b.useEffect,Kn=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:f=!1})=>{const[m,p]=db(f),v=b.useMemo(()=>Qg(n),[n]),g=f&&!m?[]:v.map(Br),y=b.useRef(!0),x=b.useRef(v),S=qf(()=>new Map),[T,j]=b.useState(v),[N,C]=b.useState(v);fb(()=>{y.current=!1,x.current=v;for(let R=0;R<N.length;R++){const E=Br(N[R]);g.includes(E)?S.delete(E):S.get(E)!==!0&&S.set(E,!1)}},[N,g.length,g.join("-")]);const w=[];if(v!==T){let R=[...v];for(let E=0;E<N.length;E++){const H=N[E],z=Br(H);g.includes(z)||(R.splice(E,0,H),w.push(H))}d==="wait"&&w.length&&(R=w),C(Qg(R)),j(v);return}const{forceRender:A}=b.useContext($f);return r.jsx(r.Fragment,{children:N.map(R=>{const E=Br(R),H=f&&!m?!1:v===N||g.includes(E),z=()=>{if(S.has(E))S.set(E,!0);else return;let I=!0;S.forEach(P=>{P||(I=!1)}),I&&(A==null||A(),C(x.current),f&&(p==null||p()),l&&l())};return r.jsx(KC,{isPresent:H,initial:!y.current||i?void 0:!1,custom:H?void 0:a,presenceAffectsLayout:c,mode:d,onExitComplete:H?void 0:z,children:R},E)})})},cn=n=>n;let hb=cn;const ZC={useManualTiming:!1};function XC(n){let a=new Set,i=new Set,l=!1,c=!1;const d=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function m(v){d.has(v)&&(p.schedule(v),n()),v(f)}const p={schedule:(v,g=!1,y=!1)=>{const S=y&&l?a:i;return g&&d.add(v),S.has(v)||S.add(v),v},cancel:v=>{i.delete(v),d.delete(v)},process:v=>{if(f=v,l){c=!0;return}l=!0,[a,i]=[i,a],a.forEach(m),a.clear(),l=!1,c&&(c=!1,p.process(v))}};return p}const Lr=["read","resolveKeyframes","update","preRender","render","postRender"],QC=40;function mb(n,a){let i=!1,l=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>i=!0,f=Lr.reduce((C,w)=>(C[w]=XC(d),C),{}),{read:m,resolveKeyframes:p,update:v,preRender:g,render:y,postRender:x}=f,S=()=>{const C=performance.now();i=!1,c.delta=l?1e3/60:Math.max(Math.min(C-c.timestamp,QC),1),c.timestamp=C,c.isProcessing=!0,m.process(c),p.process(c),v.process(c),g.process(c),y.process(c),x.process(c),c.isProcessing=!1,i&&a&&(l=!1,n(S))},T=()=>{i=!0,l=!0,c.isProcessing||n(S)};return{schedule:Lr.reduce((C,w)=>{const A=f[w];return C[w]=(R,E=!1,H=!1)=>(i||T(),A.schedule(R,E,H)),C},{}),cancel:C=>{for(let w=0;w<Lr.length;w++)f[Lr[w]].cancel(C)},state:c,steps:f}}const{schedule:lt,cancel:Fa,state:zt,steps:Hd}=mb(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0),pb=b.createContext({strict:!1}),Wg={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"]},Ri={};for(const n in Wg)Ri[n]={isEnabled:a=>Wg[n].some(i=>!!a[i])};function WC(n){for(const a in n)Ri[a]={...Ri[a],...n[a]}}const JC=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 Wr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||JC.has(n)}let vb=n=>!Wr(n);function ej(n){n&&(vb=a=>a.startsWith("on")?!Wr(a):n(a))}try{ej(require("@emotion/is-prop-valid").default)}catch{}function tj(n,a,i){const l={};for(const c in n)c==="values"&&typeof n.values=="object"||(vb(c)||i===!0&&Wr(c)||!a&&!Wr(c)||n.draggable&&c.startsWith("onDrag"))&&(l[c]=n[c]);return l}function nj(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,c)=>c==="create"?n:(a.has(c)||a.set(c,n(c)),a.get(c))})}const mc=b.createContext({});function tl(n){return typeof n=="string"||Array.isArray(n)}function pc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const Ff=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zf=["initial",...Ff];function vc(n){return pc(n.animate)||Zf.some(a=>tl(n[a]))}function gb(n){return!!(vc(n)||n.variants)}function aj(n,a){if(vc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||tl(i)?i:void 0,animate:tl(l)?l:void 0}}return n.inherit!==!1?a:{}}function sj(n){const{initial:a,animate:i}=aj(n,b.useContext(mc));return b.useMemo(()=>({initial:a,animate:i}),[Jg(a),Jg(i)])}function Jg(n){return Array.isArray(n)?n.join(" "):n}const ij=Symbol.for("motionComponentSymbol");function Ti(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function oj(n,a,i){return b.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):Ti(i)&&(i.current=l))},[a])}const Xf=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),lj="framerAppearId",yb="data-"+Xf(lj),{schedule:Qf}=mb(queueMicrotask,!1),bb=b.createContext({});function rj(n,a,i,l,c){var d,f;const{visualElement:m}=b.useContext(mc),p=b.useContext(pb),v=b.useContext(hc),g=b.useContext(Yf).reducedMotion,y=b.useRef(null);l=l||p.renderer,!y.current&&l&&(y.current=l(n,{visualState:a,parent:m,props:i,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g}));const x=y.current,S=b.useContext(bb);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&cj(y.current,i,c,S);const T=b.useRef(!1);b.useInsertionEffect(()=>{x&&T.current&&x.update(i,v)});const j=i[yb],N=b.useRef(!!j&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,j))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,j)));return fb(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Qf.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,j)}),N.current=!1))}),x}function cj(n,a,i,l){const{layoutId:c,layout:d,drag:f,dragConstraints:m,layoutScroll:p,layoutRoot:v}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:xb(n.parent)),n.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!f||m&&Ti(m),visualElement:n,animationType:typeof d=="string"?d:"both",initialPromotionConfig:l,layoutScroll:p,layoutRoot:v})}function xb(n){if(n)return n.options.allowProjection!==!1?n.projection:xb(n.parent)}function uj({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:c}){var d,f;n&&WC(n);function m(v,g){let y;const x={...b.useContext(Yf),...v,layoutId:dj(v)},{isStatic:S}=x,T=sj(v),j=l(v,S);if(!S&&Kf){fj();const N=hj(x);y=N.MeasureLayout,T.visualElement=rj(c,j,x,a,N.ProjectionNode)}return r.jsxs(mc.Provider,{value:T,children:[y&&T.visualElement?r.jsx(y,{visualElement:T.visualElement,...x}):null,i(c,v,oj(j,T.visualElement,g),j,S,T.visualElement)]})}m.displayName=`motion.${typeof c=="string"?c:`create(${(f=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&f!==void 0?f:""})`}`;const p=b.forwardRef(m);return p[ij]=c,p}function dj({layoutId:n}){const a=b.useContext($f).id;return a&&n!==void 0?a+"-"+n:n}function fj(n,a){b.useContext(pb).strict}function hj(n){const{drag:a,layout:i}=Ri;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const mj=["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 Wf(n){return typeof n!="string"||n.includes("-")?!1:!!(mj.indexOf(n)>-1||/[A-Z]/u.test(n))}function ey(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function Jf(n,a,i,l){if(typeof a=="function"){const[c,d]=ey(l);a=a(i!==void 0?i:n.custom,c,d)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[c,d]=ey(l);a=a(i!==void 0?i:n.custom,c,d)}return a}const mf=n=>Array.isArray(n),pj=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),vj=n=>mf(n)?n[n.length-1]||0:n,Ht=n=>!!(n&&n.getVelocity);function Yr(n){const a=Ht(n)?n.get():n;return pj(a)?a.toValue():a}function gj({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,c,d){const f={latestValues:yj(l,c,d,n),renderState:a()};return i&&(f.onMount=m=>i({props:l,current:m,...f}),f.onUpdate=m=>i(m)),f}const _b=n=>(a,i)=>{const l=b.useContext(mc),c=b.useContext(hc),d=()=>gj(n,a,l,c);return i?d():qf(d)};function yj(n,a,i,l){const c={},d=l(n,{});for(const x in d)c[x]=Yr(d[x]);let{initial:f,animate:m}=n;const p=vc(n),v=gb(n);a&&v&&!p&&n.inherit!==!1&&(f===void 0&&(f=a.initial),m===void 0&&(m=a.animate));let g=i?i.initial===!1:!1;g=g||f===!1;const y=g?m:f;if(y&&typeof y!="boolean"&&!pc(y)){const x=Array.isArray(y)?y:[y];for(let S=0;S<x.length;S++){const T=Jf(n,x[S]);if(T){const{transitionEnd:j,transition:N,...C}=T;for(const w in C){let A=C[w];if(Array.isArray(A)){const R=g?A.length-1:0;A=A[R]}A!==null&&(c[w]=A)}for(const w in j)c[w]=j[w]}}}return c}const Ui=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],As=new Set(Ui),Sb=n=>a=>typeof a=="string"&&a.startsWith(n),Tb=Sb("--"),bj=Sb("var(--"),eh=n=>bj(n)?xj.test(n.split("/*")[0].trim()):!1,xj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,ba=(n,a,i)=>i>a?a:i<n?n:i,Vi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},nl={...Vi,transform:n=>ba(0,1,n)},Ir={...Vi,default:1},cl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Ka=cl("deg"),qn=cl("%"),ye=cl("px"),_j=cl("vh"),Sj=cl("vw"),ty={...qn,parse:n=>qn.parse(n)/100,transform:n=>qn.transform(n*100)},Tj={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,radius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,backgroundPositionX:ye,backgroundPositionY:ye},kj={rotate:Ka,rotateX:Ka,rotateY:Ka,rotateZ:Ka,scale:Ir,scaleX:Ir,scaleY:Ir,scaleZ:Ir,skew:Ka,skewX:Ka,skewY:Ka,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:nl,originX:ty,originY:ty,originZ:ye},ny={...Vi,transform:Math.round},th={...Tj,...kj,zIndex:ny,size:ye,fillOpacity:nl,strokeOpacity:nl,numOctaves:ny},Cj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jj=Ui.length;function Nj(n,a,i){let l="",c=!0;for(let d=0;d<jj;d++){const f=Ui[d],m=n[f];if(m===void 0)continue;let p=!0;if(typeof m=="number"?p=m===(f.startsWith("scale")?1:0):p=parseFloat(m)===0,!p||i){const v=kb(m,th[f]);if(!p){c=!1;const g=Cj[f]||f;l+=`${g}(${v}) `}i&&(a[f]=v)}}return l=l.trim(),i?l=i(a,c?"":l):c&&(l="none"),l}function nh(n,a,i){const{style:l,vars:c,transformOrigin:d}=n;let f=!1,m=!1;for(const p in a){const v=a[p];if(As.has(p)){f=!0;continue}else if(Tb(p)){c[p]=v;continue}else{const g=kb(v,th[p]);p.startsWith("origin")?(m=!0,d[p]=g):l[p]=g}}if(a.transform||(f||i?l.transform=Nj(a,n.transform,i):l.transform&&(l.transform="none")),m){const{originX:p="50%",originY:v="50%",originZ:g=0}=d;l.transformOrigin=`${p} ${v} ${g}`}}const wj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ej={offset:"strokeDashoffset",array:"strokeDasharray"};function Aj(n,a,i=1,l=0,c=!0){n.pathLength=1;const d=c?wj:Ej;n[d.offset]=ye.transform(-l);const f=ye.transform(a),m=ye.transform(i);n[d.array]=`${f} ${m}`}function ay(n,a,i){return typeof n=="string"?n:ye.transform(a+i*n)}function Dj(n,a,i){const l=ay(a,n.x,n.width),c=ay(i,n.y,n.height);return`${l} ${c}`}function ah(n,{attrX:a,attrY:i,attrScale:l,originX:c,originY:d,pathLength:f,pathSpacing:m=1,pathOffset:p=0,...v},g,y){if(nh(n,v,y),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:S,dimensions:T}=n;x.transform&&(T&&(S.transform=x.transform),delete x.transform),T&&(c!==void 0||d!==void 0||S.transform)&&(S.transformOrigin=Dj(T,c!==void 0?c:.5,d!==void 0?d:.5)),a!==void 0&&(x.x=a),i!==void 0&&(x.y=i),l!==void 0&&(x.scale=l),f!==void 0&&Aj(x,f,m,p,!1)}const sh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Cb=()=>({...sh(),attrs:{}}),ih=n=>typeof n=="string"&&n.toLowerCase()==="svg";function jb(n,{style:a,vars:i},l,c){Object.assign(n.style,a,c&&c.getProjectionStyles(l));for(const d in i)n.style.setProperty(d,i[d])}const Nb=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 wb(n,a,i,l){jb(n,a,void 0,l);for(const c in a.attrs)n.setAttribute(Nb.has(c)?c:Xf(c),a.attrs[c])}const Jr={};function Rj(n){Object.assign(Jr,n)}function Eb(n,{layout:a,layoutId:i}){return As.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!Jr[n]||n==="opacity")}function oh(n,a,i){var l;const{style:c}=n,d={};for(const f in c)(Ht(c[f])||a.style&&Ht(a.style[f])||Eb(f,n)||((l=i==null?void 0:i.getValue(f))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(d[f]=c[f]);return d}function Ab(n,a,i){const l=oh(n,a,i);for(const c in n)if(Ht(n[c])||Ht(a[c])){const d=Ui.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;l[d]=n[c]}return l}function Mj(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 sy=["x","y","width","height","cx","cy","r"],Oj={useVisualState:_b({scrapeMotionValuesFromProps:Ab,createRenderState:Cb,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:c})=>{if(!i)return;let d=!!n.drag;if(!d){for(const m in c)if(As.has(m)){d=!0;break}}if(!d)return;let f=!a;if(a)for(let m=0;m<sy.length;m++){const p=sy[m];n[p]!==a[p]&&(f=!0)}f&&lt.read(()=>{Mj(i,l),lt.render(()=>{ah(l,c,ih(i.tagName),n.transformTemplate),wb(i,l)})})}})},Bj={useVisualState:_b({scrapeMotionValuesFromProps:oh,createRenderState:sh})};function Db(n,a,i){for(const l in a)!Ht(a[l])&&!Eb(l,i)&&(n[l]=a[l])}function Lj({transformTemplate:n},a){return b.useMemo(()=>{const i=sh();return nh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function Ij(n,a){const i=n.style||{},l={};return Db(l,i,n),Object.assign(l,Lj(n,a)),l}function zj(n,a){const i={},l=Ij(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.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=l,i}function Uj(n,a,i,l){const c=b.useMemo(()=>{const d=Cb();return ah(d,a,ih(l),n.transformTemplate),{...d.attrs,style:{...d.style}}},[a]);if(n.style){const d={};Db(d,n.style,n),c.style={...d,...c.style}}return c}function Vj(n=!1){return(i,l,c,{latestValues:d},f)=>{const p=(Wf(i)?Uj:zj)(l,d,f,i),v=tj(l,typeof i=="string",n),g=i!==b.Fragment?{...v,...p,ref:c}:{},{children:y}=l,x=b.useMemo(()=>Ht(y)?y.get():y,[y]);return b.createElement(i,{...g,children:x})}}function Hj(n,a){return function(l,{forwardMotionProps:c}={forwardMotionProps:!1}){const f={...Wf(l)?Oj:Bj,preloadedFeatures:n,useRender:Vj(c),createVisualElement:a,Component:l};return uj(f)}}function Rb(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function gc(n,a,i){const l=n.getProps();return Jf(l,a,i!==void 0?i:l.custom,n)}function lh(n,a){return n?n[a]||n.default||n:void 0}const Mb=new Set(["width","height","top","left","right","bottom",...Ui]);let Kr;function Gj(){Kr=void 0}const Yn={now:()=>(Kr===void 0&&Yn.set(zt.isProcessing||ZC.useManualTiming?zt.timestamp:performance.now()),Kr),set:n=>{Kr=n,queueMicrotask(Gj)}};function rh(n,a){n.indexOf(a)===-1&&n.push(a)}function ch(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class uh{constructor(){this.subscriptions=[]}add(a){return rh(this.subscriptions,a),()=>ch(this.subscriptions,a)}notify(a,i,l){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](a,i,l);else for(let d=0;d<c;d++){const f=this.subscriptions[d];f&&f(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ob(n,a){return a?n*(1e3/a):0}const iy=30,Pj=n=>!isNaN(parseFloat(n));class $j{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,c=!0)=>{const d=Yn.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&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=Yn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=Pj(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 uh);const l=this.events[a].add(i);return a==="change"?()=>{l(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:l}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,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}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=Yn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>iy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,iy);return Ob(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 al(n,a){return new $j(n,a)}function qj(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,al(i))}function Yj(n,a){const i=gc(n,a);let{transitionEnd:l={},transition:c={},...d}=i||{};d={...d,...l};for(const f in d){const m=vj(d[f]);qj(n,f,m)}}function Kj(n){return!!(Ht(n)&&n.add)}function pf(n,a){const i=n.getValue("willChange");if(Kj(i))return i.add(a)}function Bb(n){return n.props[yb]}function dh(n){let a;return()=>(a===void 0&&(a=n()),a)}const Fj=dh(()=>window.ScrollTimeline!==void 0);class Zj{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 l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(c=>{if(Fj()&&c.attachTimeline)return c.attachTimeline(a);if(typeof i=="function")return i(c)});return()=>{l.forEach((c,d)=>{c&&c(),this.animations[d].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 Xj extends Zj{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const pa=n=>n*1e3,va=n=>n/1e3;function fh(n){return typeof n=="function"}function oy(n,a){n.timeline=a,n.onfinish=null}const hh=n=>Array.isArray(n)&&typeof n[0]=="number",Qj={linearEasing:void 0};function Wj(n,a){const i=dh(n);return()=>{var l;return(l=Qj[a])!==null&&l!==void 0?l:i()}}const ec=Wj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},Lb=(n,a,i=10)=>{let l="";const c=Math.max(Math.round(a/i),2);for(let d=0;d<c;d++)l+=n(Mi(0,c-1,d))+", ";return`linear(${l.substring(0,l.length-2)})`};function Ib(n){return!!(typeof n=="function"&&ec()||!n||typeof n=="string"&&(n in vf||ec())||hh(n)||Array.isArray(n)&&n.every(Ib))}const Ho=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,vf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ho([0,.65,.55,1]),circOut:Ho([.55,0,1,.45]),backIn:Ho([.31,.01,.66,-.59]),backOut:Ho([.33,1.53,.69,.99])};function zb(n,a){if(n)return typeof n=="function"&&ec()?Lb(n,a):hh(n)?Ho(n):Array.isArray(n)?n.map(i=>zb(i,a)||vf.easeOut):vf[n]}const Ub=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,Jj=1e-7,eN=12;function tN(n,a,i,l,c){let d,f,m=0;do f=a+(i-a)/2,d=Ub(f,l,c)-n,d>0?i=f:a=f;while(Math.abs(d)>Jj&&++m<eN);return f}function ul(n,a,i,l){if(n===a&&i===l)return cn;const c=d=>tN(d,0,1,n,i);return d=>d===0||d===1?d:Ub(c(d),a,l)}const Vb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Hb=n=>a=>1-n(1-a),Gb=ul(.33,1.53,.69,.99),mh=Hb(Gb),Pb=Vb(mh),$b=n=>(n*=2)<1?.5*mh(n):.5*(2-Math.pow(2,-10*(n-1))),ph=n=>1-Math.sin(Math.acos(n)),qb=Hb(ph),Yb=Vb(ph),Kb=n=>/^0[^.\s]+$/u.test(n);function nN(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Kb(n):!0}const Fo=n=>Math.round(n*1e5)/1e5,vh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function aN(n){return n==null}const sN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gh=(n,a)=>i=>!!(typeof i=="string"&&sN.test(i)&&i.startsWith(n)||a&&!aN(i)&&Object.prototype.hasOwnProperty.call(i,a)),Fb=(n,a,i)=>l=>{if(typeof l!="string")return l;const[c,d,f,m]=l.match(vh);return{[n]:parseFloat(c),[a]:parseFloat(d),[i]:parseFloat(f),alpha:m!==void 0?parseFloat(m):1}},iN=n=>ba(0,255,n),Gd={...Vi,transform:n=>Math.round(iN(n))},Ss={test:gh("rgb","red"),parse:Fb("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Gd.transform(n)+", "+Gd.transform(a)+", "+Gd.transform(i)+", "+Fo(nl.transform(l))+")"};function oN(n){let a="",i="",l="",c="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),c=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),c=n.substring(4,5),a+=a,i+=i,l+=l,c+=c),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:c?parseInt(c,16)/255:1}}const gf={test:gh("#"),parse:oN,transform:Ss.transform},ki={test:gh("hsl","hue"),parse:Fb("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+qn.transform(Fo(a))+", "+qn.transform(Fo(i))+", "+Fo(nl.transform(l))+")"},Vt={test:n=>Ss.test(n)||gf.test(n)||ki.test(n),parse:n=>Ss.test(n)?Ss.parse(n):ki.test(n)?ki.parse(n):gf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Ss.transform(n):ki.transform(n)},lN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(vh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(lN))===null||i===void 0?void 0:i.length)||0)>0}const Zb="number",Xb="color",cN="var",uN="var(",ly="${}",dN=/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 sl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},c=[];let d=0;const m=a.replace(dN,p=>(Vt.test(p)?(l.color.push(d),c.push(Xb),i.push(Vt.parse(p))):p.startsWith(uN)?(l.var.push(d),c.push(cN),i.push(p)):(l.number.push(d),c.push(Zb),i.push(parseFloat(p))),++d,ly)).split(ly);return{values:i,split:m,indexes:l,types:c}}function Qb(n){return sl(n).values}function Wb(n){const{split:a,types:i}=sl(n),l=a.length;return c=>{let d="";for(let f=0;f<l;f++)if(d+=a[f],c[f]!==void 0){const m=i[f];m===Zb?d+=Fo(c[f]):m===Xb?d+=Vt.transform(c[f]):d+=c[f]}return d}}const fN=n=>typeof n=="number"?0:n;function hN(n){const a=Qb(n);return Wb(n)(a.map(fN))}const Za={test:rN,parse:Qb,createTransformer:Wb,getAnimatableNone:hN},mN=new Set(["brightness","contrast","saturate","opacity"]);function pN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(vh)||[];if(!l)return n;const c=i.replace(l,"");let d=mN.has(a)?1:0;return l!==i&&(d*=100),a+"("+d+c+")"}const vN=/\b([a-z-]*)\(.*?\)/gu,yf={...Za,getAnimatableNone:n=>{const a=n.match(vN);return a?a.map(pN).join(" "):n}},gN={...th,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:yf,WebkitFilter:yf},yh=n=>gN[n];function Jb(n,a){let i=yh(n);return i!==yf&&(i=Za),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const yN=new Set(["auto","none","0"]);function bN(n,a,i){let l=0,c;for(;l<n.length&&!c;){const d=n[l];typeof d=="string"&&!yN.has(d)&&sl(d).values.length&&(c=n[l]),l++}if(c&&i)for(const d of a)n[d]=Jb(i,c)}const ry=n=>n===Vi||n===ye,cy=(n,a)=>parseFloat(n.split(", ")[a]),uy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const c=l.match(/^matrix3d\((.+)\)$/u);if(c)return cy(c[1],a);{const d=l.match(/^matrix\((.+)\)$/u);return d?cy(d[1],n):0}},xN=new Set(["x","y","z"]),_N=Ui.filter(n=>!xN.has(n));function SN(n){const a=[];return _N.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const Oi={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:uy(4,13),y:uy(5,14)};Oi.translateX=Oi.x;Oi.translateY=Oi.y;const ks=new Set;let bf=!1,xf=!1;function ex(){if(xf){const n=Array.from(ks).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const c=SN(l);c.length&&(i.set(l,c),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const c=i.get(l);c&&c.forEach(([d,f])=>{var m;(m=l.getValue(d))===null||m===void 0||m.set(f)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}xf=!1,bf=!1,ks.forEach(n=>n.complete()),ks.clear()}function tx(){ks.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(xf=!0)})}function TN(){tx(),ex()}class bh{constructor(a,i,l,c,d,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=c,this.element=d,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ks.add(this),bf||(bf=!0,lt.read(tx),lt.resolveKeyframes(ex))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:c}=this;for(let d=0;d<a.length;d++)if(a[d]===null)if(d===0){const f=c==null?void 0:c.get(),m=a[a.length-1];if(f!==void 0)a[0]=f;else if(l&&i){const p=l.readValue(i,m);p!=null&&(a[0]=p)}a[0]===void 0&&(a[0]=m),c&&f===void 0&&c.set(a[0])}else a[d]=a[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ks.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ks.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const nx=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),kN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function CN(n){const a=kN.exec(n);if(!a)return[,];const[,i,l,c]=a;return[`--${i??l}`,c]}function ax(n,a,i=1){const[l,c]=CN(n);if(!l)return;const d=window.getComputedStyle(a).getPropertyValue(l);if(d){const f=d.trim();return nx(f)?parseFloat(f):f}return eh(c)?ax(c,a,i+1):c}const sx=n=>a=>a.test(n),jN={test:n=>n==="auto",parse:n=>n},ix=[Vi,ye,qn,Ka,Sj,_j,jN],dy=n=>ix.find(sx(n));class ox extends bh{constructor(a,i,l,c,d){super(a,i,l,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<a.length;p++){let v=a[p];if(typeof v=="string"&&(v=v.trim(),eh(v))){const g=ax(v,i.current);g!==void 0&&(a[p]=g),p===a.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!Mb.has(l)||a.length!==2)return;const[c,d]=a,f=dy(c),m=dy(d);if(f!==m)if(ry(f)&&ry(m))for(let p=0;p<a.length;p++){const v=a[p];typeof v=="string"&&(a[p]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,l=[];for(let c=0;c<a.length;c++)nN(a[c])&&l.push(c);l.length&&bN(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oi[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const c=i[i.length-1];c!==void 0&&a.getValue(l,c).jump(c,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:c}=this;if(!i||!i.current)return;const d=i.getValue(l);d&&d.jump(this.measuredOrigin,!1);const f=c.length-1,m=c[f];c[f]=Oi[l](i.measureViewportBox(),window.getComputedStyle(i.current)),m!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=m),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([p,v])=>{i.getValue(p).set(v)}),this.resolveNoneKeyframes()}}const fy=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Za.test(n)||n==="0")&&!n.startsWith("url("));function NN(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 wN(n,a,i,l){const c=n[0];if(c===null)return!1;if(a==="display"||a==="visibility")return!0;const d=n[n.length-1],f=fy(c,a),m=fy(d,a);return!f||!m?!1:NN(n)||(i==="spring"||fh(i))&&l}const EN=n=>n!==null;function yc(n,{repeat:a,repeatType:i="loop"},l){const c=n.filter(EN),d=a&&i!=="loop"&&a%2===1?0:c.length-1;return!d||l===void 0?c[d]:l}const AN=40;class lx{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:f="loop",...m}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Yn.now(),this.options={autoplay:a,delay:i,type:l,repeat:c,repeatDelay:d,repeatType:f,...m},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>AN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&TN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Yn.now(),this.hasAttemptedResolve=!0;const{name:l,type:c,velocity:d,delay:f,onComplete:m,onUpdate:p,isGenerator:v}=this.options;if(!v&&!wN(a,l,c,d))if(f)this.options.duration=0;else{p&&p(yc(a,this.options,i)),m&&m(),this.resolveFinishedPromise();return}const g=this.initPlayback(a,i);g!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...g},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 _f=2e4;function rx(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<_f;)a+=i,l=n.next(a);return a>=_f?1/0:a}const dt=(n,a,i)=>n+(a-n)*i;function Pd(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 DN({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let c=0,d=0,f=0;if(!a)c=d=f=i;else{const m=i<.5?i*(1+a):i+a-i*a,p=2*i-m;c=Pd(p,m,n+1/3),d=Pd(p,m,n),f=Pd(p,m,n-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(f*255),alpha:l}}function tc(n,a){return i=>i>0?a:n}const $d=(n,a,i)=>{const l=n*n,c=i*(a*a-l)+l;return c<0?0:Math.sqrt(c)},RN=[gf,Ss,ki],MN=n=>RN.find(a=>a.test(n));function hy(n){const a=MN(n);if(!a)return!1;let i=a.parse(n);return a===ki&&(i=DN(i)),i}const my=(n,a)=>{const i=hy(n),l=hy(a);if(!i||!l)return tc(n,a);const c={...i};return d=>(c.red=$d(i.red,l.red,d),c.green=$d(i.green,l.green,d),c.blue=$d(i.blue,l.blue,d),c.alpha=dt(i.alpha,l.alpha,d),Ss.transform(c))},ON=(n,a)=>i=>a(n(i)),dl=(...n)=>n.reduce(ON),Sf=new Set(["none","hidden"]);function BN(n,a){return Sf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function LN(n,a){return i=>dt(n,a,i)}function xh(n){return typeof n=="number"?LN:typeof n=="string"?eh(n)?tc:Vt.test(n)?my:UN:Array.isArray(n)?cx:typeof n=="object"?Vt.test(n)?my:IN:tc}function cx(n,a){const i=[...n],l=i.length,c=n.map((d,f)=>xh(d)(d,a[f]));return d=>{for(let f=0;f<l;f++)i[f]=c[f](d);return i}}function IN(n,a){const i={...n,...a},l={};for(const c in i)n[c]!==void 0&&a[c]!==void 0&&(l[c]=xh(n[c])(n[c],a[c]));return c=>{for(const d in l)i[d]=l[d](c);return i}}function zN(n,a){var i;const l=[],c={color:0,var:0,number:0};for(let d=0;d<a.values.length;d++){const f=a.types[d],m=n.indexes[f][c[f]],p=(i=n.values[m])!==null&&i!==void 0?i:0;l[d]=p,c[f]++}return l}const UN=(n,a)=>{const i=Za.createTransformer(a),l=sl(n),c=sl(a);return l.indexes.var.length===c.indexes.var.length&&l.indexes.color.length===c.indexes.color.length&&l.indexes.number.length>=c.indexes.number.length?Sf.has(n)&&!c.values.length||Sf.has(a)&&!l.values.length?BN(n,a):dl(cx(zN(l,c),c.values),i):tc(n,a)};function ux(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?dt(n,a,i):xh(n)(n,a)}const VN=5;function dx(n,a,i){const l=Math.max(a-VN,0);return Ob(i-n(l),a-l)}const mt={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},qd=.001;function HN({duration:n=mt.duration,bounce:a=mt.bounce,velocity:i=mt.velocity,mass:l=mt.mass}){let c,d,f=1-a;f=ba(mt.minDamping,mt.maxDamping,f),n=ba(mt.minDuration,mt.maxDuration,va(n)),f<1?(c=v=>{const g=v*f,y=g*n,x=g-i,S=Tf(v,f),T=Math.exp(-y);return qd-x/S*T},d=v=>{const y=v*f*n,x=y*i+i,S=Math.pow(f,2)*Math.pow(v,2)*n,T=Math.exp(-y),j=Tf(Math.pow(v,2),f);return(-c(v)+qd>0?-1:1)*((x-S)*T)/j}):(c=v=>{const g=Math.exp(-v*n),y=(v-i)*n+1;return-qd+g*y},d=v=>{const g=Math.exp(-v*n),y=(i-v)*(n*n);return g*y});const m=5/n,p=PN(c,d,m);if(n=pa(n),isNaN(p))return{stiffness:mt.stiffness,damping:mt.damping,duration:n};{const v=Math.pow(p,2)*l;return{stiffness:v,damping:f*2*Math.sqrt(l*v),duration:n}}}const GN=12;function PN(n,a,i){let l=i;for(let c=1;c<GN;c++)l=l-n(l)/a(l);return l}function Tf(n,a){return n*Math.sqrt(1-a*a)}const $N=["duration","bounce"],qN=["stiffness","damping","mass"];function py(n,a){return a.some(i=>n[i]!==void 0)}function YN(n){let a={velocity:mt.velocity,stiffness:mt.stiffness,damping:mt.damping,mass:mt.mass,isResolvedFromDuration:!1,...n};if(!py(n,qN)&&py(n,$N))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),c=l*l,d=2*ba(.05,1,1-(n.bounce||0))*Math.sqrt(c);a={...a,mass:mt.mass,stiffness:c,damping:d}}else{const i=HN(n);a={...a,...i,mass:mt.mass},a.isResolvedFromDuration=!0}return a}function fx(n=mt.visualDuration,a=mt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:c}=i;const d=i.keyframes[0],f=i.keyframes[i.keyframes.length-1],m={done:!1,value:d},{stiffness:p,damping:v,mass:g,duration:y,velocity:x,isResolvedFromDuration:S}=YN({...i,velocity:-va(i.velocity||0)}),T=x||0,j=v/(2*Math.sqrt(p*g)),N=f-d,C=va(Math.sqrt(p/g)),w=Math.abs(N)<5;l||(l=w?mt.restSpeed.granular:mt.restSpeed.default),c||(c=w?mt.restDelta.granular:mt.restDelta.default);let A;if(j<1){const E=Tf(C,j);A=H=>{const z=Math.exp(-j*C*H);return f-z*((T+j*C*N)/E*Math.sin(E*H)+N*Math.cos(E*H))}}else if(j===1)A=E=>f-Math.exp(-C*E)*(N+(T+C*N)*E);else{const E=C*Math.sqrt(j*j-1);A=H=>{const z=Math.exp(-j*C*H),I=Math.min(E*H,300);return f-z*((T+j*C*N)*Math.sinh(I)+E*N*Math.cosh(I))/E}}const R={calculatedDuration:S&&y||null,next:E=>{const H=A(E);if(S)m.done=E>=y;else{let z=0;j<1&&(z=E===0?pa(T):dx(A,E,H));const I=Math.abs(z)<=l,P=Math.abs(f-H)<=c;m.done=I&&P}return m.value=m.done?f:H,m},toString:()=>{const E=Math.min(rx(R),_f),H=Lb(z=>R.next(E*z).value,E,30);return E+"ms "+H}};return R}function vy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:f,min:m,max:p,restDelta:v=.5,restSpeed:g}){const y=n[0],x={done:!1,value:y},S=I=>m!==void 0&&I<m||p!==void 0&&I>p,T=I=>m===void 0?p:p===void 0||Math.abs(m-I)<Math.abs(p-I)?m:p;let j=i*a;const N=y+j,C=f===void 0?N:f(N);C!==N&&(j=C-y);const w=I=>-j*Math.exp(-I/l),A=I=>C+w(I),R=I=>{const P=w(I),ee=A(I);x.done=Math.abs(P)<=v,x.value=x.done?C:ee};let E,H;const z=I=>{S(x.value)&&(E=I,H=fx({keyframes:[x.value,T(x.value)],velocity:dx(A,I,x.value),damping:c,stiffness:d,restDelta:v,restSpeed:g}))};return z(0),{calculatedDuration:null,next:I=>{let P=!1;return!H&&E===void 0&&(P=!0,R(I),z(I)),E!==void 0&&I>=E?H.next(I-E):(!P&&R(I),x)}}}const KN=ul(.42,0,1,1),FN=ul(0,0,.58,1),hx=ul(.42,0,.58,1),ZN=n=>Array.isArray(n)&&typeof n[0]!="number",XN={linear:cn,easeIn:KN,easeInOut:hx,easeOut:FN,circIn:ph,circInOut:Yb,circOut:qb,backIn:mh,backInOut:Pb,backOut:Gb,anticipate:$b},gy=n=>{if(hh(n)){hb(n.length===4);const[a,i,l,c]=n;return ul(a,i,l,c)}else if(typeof n=="string")return XN[n];return n};function QN(n,a,i){const l=[],c=i||ux,d=n.length-1;for(let f=0;f<d;f++){let m=c(n[f],n[f+1]);if(a){const p=Array.isArray(a)?a[f]||cn:a;m=dl(p,m)}l.push(m)}return l}function WN(n,a,{clamp:i=!0,ease:l,mixer:c}={}){const d=n.length;if(hb(d===a.length),d===1)return()=>a[0];if(d===2&&a[0]===a[1])return()=>a[1];const f=n[0]===n[1];n[0]>n[d-1]&&(n=[...n].reverse(),a=[...a].reverse());const m=QN(a,l,c),p=m.length,v=g=>{if(f&&g<n[0])return a[0];let y=0;if(p>1)for(;y<n.length-2&&!(g<n[y+1]);y++);const x=Mi(n[y],n[y+1],g);return m[y](x)};return i?g=>v(ba(n[0],n[d-1],g)):v}function JN(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const c=Mi(0,a,l);n.push(dt(i,1,c))}}function ew(n){const a=[0];return JN(a,n.length-1),a}function tw(n,a){return n.map(i=>i*a)}function nw(n,a){return n.map(()=>a||hx).splice(0,n.length-1)}function nc({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const c=ZN(l)?l.map(gy):gy(l),d={done:!1,value:a[0]},f=tw(i&&i.length===a.length?i:ew(a),n),m=WN(f,a,{ease:Array.isArray(c)?c:nw(a,c)});return{calculatedDuration:n,next:p=>(d.value=m(p),d.done=p>=n,d)}}const aw=n=>{const a=({timestamp:i})=>n(i);return{start:()=>lt.update(a,!0),stop:()=>Fa(a),now:()=>zt.isProcessing?zt.timestamp:Yn.now()}},sw={decay:vy,inertia:vy,tween:nc,keyframes:nc,spring:fx},iw=n=>n/100;class _h extends lx{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:p}=this.options;p&&p()};const{name:i,motionValue:l,element:c,keyframes:d}=this.options,f=(c==null?void 0:c.KeyframeResolver)||bh,m=(p,v)=>this.onKeyframesResolved(p,v);this.resolver=new f(d,m,i,l,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:l=0,repeatDelay:c=0,repeatType:d,velocity:f=0}=this.options,m=fh(i)?i:sw[i]||nc;let p,v;m!==nc&&typeof a[0]!="number"&&(p=dl(iw,ux(a[0],a[1])),a=[0,100]);const g=m({...this.options,keyframes:a});d==="mirror"&&(v=m({...this.options,keyframes:[...a].reverse(),velocity:-f})),g.calculatedDuration===null&&(g.calculatedDuration=rx(g));const{calculatedDuration:y}=g,x=y+c,S=x*(l+1)-c;return{generator:g,mirroredGenerator:v,mapPercentToKeyframes:p,calculatedDuration:y,resolvedDuration:x,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:l}=this;if(!l){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:f,mapPercentToKeyframes:m,keyframes:p,calculatedDuration:v,totalDuration:g,resolvedDuration:y}=l;if(this.startTime===null)return d.next(0);const{delay:x,repeat:S,repeatType:T,repeatDelay:j,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-g/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 C=this.currentTime-x*(this.speed>=0?1:-1),w=this.speed>=0?C<0:C>g;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let A=this.currentTime,R=d;if(S){const I=Math.min(this.currentTime,g)/y;let P=Math.floor(I),ee=I%1;!ee&&I>=1&&(ee=1),ee===1&&P--,P=Math.min(P,S+1),!!(P%2)&&(T==="reverse"?(ee=1-ee,j&&(ee-=j/y)):T==="mirror"&&(R=f)),A=ba(0,1,ee)*y}const E=w?{done:!1,value:p[0]}:R.next(A);m&&(E.value=m(E.value));let{done:H}=E;!w&&v!==null&&(H=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&H);return z&&c!==void 0&&(E.value=yc(p,this.options,c)),N&&N(E.value),z&&this.finish(),E}get duration(){const{resolved:a}=this;return a?va(a.calculatedDuration):0}get time(){return va(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=va(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=aw,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(d=>this.tick(d))),i&&i();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=l??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 ow=new Set(["opacity","clipPath","filter","transform"]);function lw(n,a,i,{delay:l=0,duration:c=300,repeat:d=0,repeatType:f="loop",ease:m="easeInOut",times:p}={}){const v={[a]:i};p&&(v.offset=p);const g=zb(m,c);return Array.isArray(g)&&(v.easing=g),n.animate(v,{delay:l,duration:c,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:d+1,direction:f==="reverse"?"alternate":"normal"})}const rw=dh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ac=10,cw=2e4;function uw(n){return fh(n.type)||n.type==="spring"||!Ib(n.ease)}function dw(n,a){const i=new _h({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const c=[];let d=0;for(;!l.done&&d<cw;)l=i.sample(d),c.push(l.value),d+=ac;return{times:void 0,keyframes:c,duration:d-ac,ease:"linear"}}const mx={anticipate:$b,backInOut:Pb,circInOut:Yb};function fw(n){return n in mx}class yy extends lx{constructor(a){super(a);const{name:i,motionValue:l,element:c,keyframes:d}=this.options;this.resolver=new ox(d,(f,m)=>this.onKeyframesResolved(f,m),i,l,c),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:c,ease:d,type:f,motionValue:m,name:p,startTime:v}=this.options;if(!m.owner||!m.owner.current)return!1;if(typeof d=="string"&&ec()&&fw(d)&&(d=mx[d]),uw(this.options)){const{onComplete:y,onUpdate:x,motionValue:S,element:T,...j}=this.options,N=dw(a,j);a=N.keyframes,a.length===1&&(a[1]=a[0]),l=N.duration,c=N.times,d=N.ease,f="keyframes"}const g=lw(m.owner.current,p,a,{...this.options,duration:l,times:c,ease:d});return g.startTime=v??this.calcStartTime(),this.pendingTimeline?(oy(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:y}=this.options;m.set(yc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:l,times:c,type:f,ease:d,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return va(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return va(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.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:l}=i;l.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 cn;const{animation:l}=i;oy(l,a)}return cn}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:l,duration:c,type:d,ease:f,times:m}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:g,onComplete:y,element:x,...S}=this.options,T=new _h({...S,keyframes:l,duration:c,type:d,ease:f,times:m,isGenerator:!0}),j=pa(this.time);v.setWithVelocity(T.sample(j-ac).value,T.sample(j).value,ac)}const{onStop:p}=this.options;p&&p(),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:l,repeatDelay:c,repeatType:d,damping:f,type:m}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:p,transformTemplate:v}=i.owner.getProps();return rw()&&l&&ow.has(l)&&!p&&!v&&!c&&d!=="mirror"&&f!==0&&m!=="inertia"}}const hw={type:"spring",stiffness:500,damping:25,restSpeed:10},mw=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),pw={type:"keyframes",duration:.8},vw={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gw=(n,{keyframes:a})=>a.length>2?pw:As.has(n)?n.startsWith("scale")?mw(a[1]):hw:vw;function yw({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:c,repeat:d,repeatType:f,repeatDelay:m,from:p,elapsed:v,...g}){return!!Object.keys(g).length}const Sh=(n,a,i,l={},c,d)=>f=>{const m=lh(l,n)||{},p=m.delay||l.delay||0;let{elapsed:v=0}=l;v=v-pa(p);let g={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...m,delay:-v,onUpdate:x=>{a.set(x),m.onUpdate&&m.onUpdate(x)},onComplete:()=>{f(),m.onComplete&&m.onComplete()},name:n,motionValue:a,element:d?void 0:c};yw(m)||(g={...g,...gw(n,g)}),g.duration&&(g.duration=pa(g.duration)),g.repeatDelay&&(g.repeatDelay=pa(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(y=!0)),y&&!d&&a.get()!==void 0){const x=yc(g.keyframes,m);if(x!==void 0)return lt.update(()=>{g.onUpdate(x),g.onComplete()}),new Xj([])}return!d&&yy.supports(g)?new yy(g):new _h(g)};function bw({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function px(n,a,{delay:i=0,transitionOverride:l,type:c}={}){var d;let{transition:f=n.getDefaultTransition(),transitionEnd:m,...p}=a;l&&(f=l);const v=[],g=c&&n.animationState&&n.animationState.getState()[c];for(const y in p){const x=n.getValue(y,(d=n.latestValues[y])!==null&&d!==void 0?d:null),S=p[y];if(S===void 0||g&&bw(g,y))continue;const T={delay:i,...lh(f||{},y)};let j=!1;if(window.MotionHandoffAnimation){const C=Bb(n);if(C){const w=window.MotionHandoffAnimation(C,y,lt);w!==null&&(T.startTime=w,j=!0)}}pf(n,y),x.start(Sh(y,x,S,n.shouldReduceMotion&&Mb.has(y)?{type:!1}:T,n,j));const N=x.animation;N&&v.push(N)}return m&&Promise.all(v).then(()=>{lt.update(()=>{m&&Yj(n,m)})}),v}function kf(n,a,i={}){var l;const c=gc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:d=n.getDefaultTransition()||{}}=c||{};i.transitionOverride&&(d=i.transitionOverride);const f=c?()=>Promise.all(px(n,c,i)):()=>Promise.resolve(),m=n.variantChildren&&n.variantChildren.size?(v=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:x}=d;return xw(n,a,g+v,y,x,i)}:()=>Promise.resolve(),{when:p}=d;if(p){const[v,g]=p==="beforeChildren"?[f,m]:[m,f];return v().then(()=>g())}else return Promise.all([f(),m(i.delay)])}function xw(n,a,i=0,l=0,c=1,d){const f=[],m=(n.variantChildren.size-1)*l,p=c===1?(v=0)=>v*l:(v=0)=>m-v*l;return Array.from(n.variantChildren).sort(_w).forEach((v,g)=>{v.notify("AnimationStart",a),f.push(kf(v,a,{...d,delay:i+p(g)}).then(()=>v.notify("AnimationComplete",a)))}),Promise.all(f)}function _w(n,a){return n.sortNodePosition(a)}function Sw(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const c=a.map(d=>kf(n,d,i));l=Promise.all(c)}else if(typeof a=="string")l=kf(n,a,i);else{const c=typeof a=="function"?gc(n,a,i.custom):a;l=Promise.all(px(n,c,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const Tw=Zf.length;function vx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?vx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<Tw;i++){const l=Zf[i],c=n.props[l];(tl(c)||c===!1)&&(a[l]=c)}return a}const kw=[...Ff].reverse(),Cw=Ff.length;function jw(n){return a=>Promise.all(a.map(({animation:i,options:l})=>Sw(n,i,l)))}function Nw(n){let a=jw(n),i=by(),l=!0;const c=p=>(v,g)=>{var y;const x=gc(n,g,p==="exit"?(y=n.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(x){const{transition:S,transitionEnd:T,...j}=x;v={...v,...j,...T}}return v};function d(p){a=p(n)}function f(p){const{props:v}=n,g=vx(n.parent)||{},y=[],x=new Set;let S={},T=1/0;for(let N=0;N<Cw;N++){const C=kw[N],w=i[C],A=v[C]!==void 0?v[C]:g[C],R=tl(A),E=C===p?w.isActive:null;E===!1&&(T=N);let H=A===g[C]&&A!==v[C]&&R;if(H&&l&&n.manuallyAnimateOnMount&&(H=!1),w.protectedKeys={...S},!w.isActive&&E===null||!A&&!w.prevProp||pc(A)||typeof A=="boolean")continue;const z=ww(w.prevProp,A);let I=z||C===p&&w.isActive&&!H&&R||N>T&&R,P=!1;const ee=Array.isArray(A)?A:[A];let ne=ee.reduce(c(C),{});E===!1&&(ne={});const{prevResolvedValues:ce={}}=w,re={...ce,...ne},K=$=>{I=!0,x.has($)&&(P=!0,x.delete($)),w.needsAnimating[$]=!0;const se=n.getValue($);se&&(se.liveStyle=!1)};for(const $ in re){const se=ne[$],oe=ce[$];if(S.hasOwnProperty($))continue;let Y=!1;mf(se)&&mf(oe)?Y=!Rb(se,oe):Y=se!==oe,Y?se!=null?K($):x.add($):se!==void 0&&x.has($)?K($):w.protectedKeys[$]=!0}w.prevProp=A,w.prevResolvedValues=ne,w.isActive&&(S={...S,...ne}),l&&n.blockInitialAnimation&&(I=!1),I&&(!(H&&z)||P)&&y.push(...ee.map($=>({animation:$,options:{type:C}})))}if(x.size){const N={};x.forEach(C=>{const w=n.getBaseTarget(C),A=n.getValue(C);A&&(A.liveStyle=!0),N[C]=w??null}),y.push({animation:N})}let j=!!y.length;return l&&(v.initial===!1||v.initial===v.animate)&&!n.manuallyAnimateOnMount&&(j=!1),l=!1,j?a(y):Promise.resolve()}function m(p,v){var g;if(i[p].isActive===v)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(p,v)}),i[p].isActive=v;const y=f(p);for(const x in i)i[x].protectedKeys={};return y}return{animateChanges:f,setActive:m,setAnimateFunction:d,getState:()=>i,reset:()=>{i=by(),l=!0}}}function ww(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Rb(a,n):!1}function gs(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function by(){return{animate:gs(!0),whileInView:gs(),whileHover:gs(),whileTap:gs(),whileDrag:gs(),whileFocus:gs(),exit:gs()}}class Wa{constructor(a){this.isMounted=!1,this.node=a}update(){}}class Ew extends Wa{constructor(a){super(a),a.animationState||(a.animationState=Nw(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();pc(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 Aw=0;class Dw extends Wa{constructor(){super(...arguments),this.id=Aw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)return;const c=this.node.animationState.setActive("exit",!a);i&&!a&&c.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const Rw={animation:{Feature:Ew},exit:{Feature:Dw}},Bn={x:!1,y:!1};function gx(){return Bn.x||Bn.y}function Mw(n){return n==="x"||n==="y"?Bn[n]?null:(Bn[n]=!0,()=>{Bn[n]=!1}):Bn.x||Bn.y?null:(Bn.x=Bn.y=!0,()=>{Bn.x=Bn.y=!1})}const Th=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function il(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function fl(n){return{point:{x:n.pageX,y:n.pageY}}}const Ow=n=>a=>Th(a)&&n(a,fl(a));function Zo(n,a,i,l){return il(n,a,Ow(i),l)}const xy=(n,a)=>Math.abs(n-a);function Bw(n,a){const i=xy(n.x,a.x),l=xy(n.y,a.y);return Math.sqrt(i**2+l**2)}class yx{constructor(a,i,{transformPagePoint:l,contextWindow:c,dragSnapToOrigin:d=!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 y=Kd(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=Bw(y.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:T}=y,{timestamp:j}=zt;this.history.push({...T,timestamp:j});const{onStart:N,onMove:C}=this.handlers;x||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=Yd(x,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:j}=this.handlers;if(this.dragSnapToOrigin&&j&&j(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Kd(y.type==="pointercancel"?this.lastMoveEventInfo:Yd(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Th(a))return;this.dragSnapToOrigin=d,this.handlers=i,this.transformPagePoint=l,this.contextWindow=c||window;const f=fl(a),m=Yd(f,this.transformPagePoint),{point:p}=m,{timestamp:v}=zt;this.history=[{...p,timestamp:v}];const{onSessionStart:g}=i;g&&g(a,Kd(m,this.history)),this.removeListeners=dl(Zo(this.contextWindow,"pointermove",this.handlePointerMove),Zo(this.contextWindow,"pointerup",this.handlePointerUp),Zo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),Fa(this.updatePoint)}}function Yd(n,a){return a?{point:a(n.point)}:n}function _y(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Kd({point:n},a){return{point:n,delta:_y(n,bx(a)),offset:_y(n,Lw(a)),velocity:Iw(a,.1)}}function Lw(n){return n[0]}function bx(n){return n[n.length-1]}function Iw(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const c=bx(n);for(;i>=0&&(l=n[i],!(c.timestamp-l.timestamp>pa(a)));)i--;if(!l)return{x:0,y:0};const d=va(c.timestamp-l.timestamp);if(d===0)return{x:0,y:0};const f={x:(c.x-l.x)/d,y:(c.y-l.y)/d};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const xx=1e-4,zw=1-xx,Uw=1+xx,_x=.01,Vw=0-_x,Hw=0+_x;function un(n){return n.max-n.min}function Gw(n,a,i){return Math.abs(n-a)<=i}function Sy(n,a,i,l=.5){n.origin=l,n.originPoint=dt(a.min,a.max,n.origin),n.scale=un(i)/un(a),n.translate=dt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=zw&&n.scale<=Uw||isNaN(n.scale))&&(n.scale=1),(n.translate>=Vw&&n.translate<=Hw||isNaN(n.translate))&&(n.translate=0)}function Xo(n,a,i,l){Sy(n.x,a.x,i.x,l?l.originX:void 0),Sy(n.y,a.y,i.y,l?l.originY:void 0)}function Ty(n,a,i){n.min=i.min+a.min,n.max=n.min+un(a)}function Pw(n,a,i){Ty(n.x,a.x,i.x),Ty(n.y,a.y,i.y)}function ky(n,a,i){n.min=a.min-i.min,n.max=n.min+un(a)}function Qo(n,a,i){ky(n.x,a.x,i.x),ky(n.y,a.y,i.y)}function $w(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?dt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?dt(i,n,l.max):Math.min(n,i)),n}function Cy(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 qw(n,{top:a,left:i,bottom:l,right:c}){return{x:Cy(n.x,i,c),y:Cy(n.y,a,l)}}function jy(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function Yw(n,a){return{x:jy(n.x,a.x),y:jy(n.y,a.y)}}function Kw(n,a){let i=.5;const l=un(n),c=un(a);return c>l?i=Mi(a.min,a.max-l,n.min):l>c&&(i=Mi(n.min,n.max-c,a.min)),ba(0,1,i)}function Fw(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 Cf=.35;function Zw(n=Cf){return n===!1?n=0:n===!0&&(n=Cf),{x:Ny(n,"left","right"),y:Ny(n,"top","bottom")}}function Ny(n,a,i){return{min:wy(n,a),max:wy(n,i)}}function wy(n,a){return typeof n=="number"?n:n[a]||0}const Ey=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ci=()=>({x:Ey(),y:Ey()}),Ay=()=>({min:0,max:0}),gt=()=>({x:Ay(),y:Ay()});function Nn(n){return[n("x"),n("y")]}function Sx({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function Xw({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function Qw(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function Fd(n){return n===void 0||n===1}function jf({scale:n,scaleX:a,scaleY:i}){return!Fd(n)||!Fd(a)||!Fd(i)}function xs(n){return jf(n)||Tx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Tx(n){return Dy(n.x)||Dy(n.y)}function Dy(n){return n&&n!=="0%"}function sc(n,a,i){const l=n-i,c=a*l;return i+c}function Ry(n,a,i,l,c){return c!==void 0&&(n=sc(n,c,l)),sc(n,i,l)+a}function Nf(n,a=0,i=1,l,c){n.min=Ry(n.min,a,i,l,c),n.max=Ry(n.max,a,i,l,c)}function kx(n,{x:a,y:i}){Nf(n.x,a.translate,a.scale,a.originPoint),Nf(n.y,i.translate,i.scale,i.originPoint)}const My=.999999999999,Oy=1.0000000000001;function Ww(n,a,i,l=!1){const c=i.length;if(!c)return;a.x=a.y=1;let d,f;for(let m=0;m<c;m++){d=i[m],f=d.projectionDelta;const{visualElement:p}=d.options;p&&p.props.style&&p.props.style.display==="contents"||(l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Ni(n,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),f&&(a.x*=f.x.scale,a.y*=f.y.scale,kx(n,f)),l&&xs(d.latestValues)&&Ni(n,d.latestValues))}a.x<Oy&&a.x>My&&(a.x=1),a.y<Oy&&a.y>My&&(a.y=1)}function ji(n,a){n.min=n.min+a,n.max=n.max+a}function By(n,a,i,l,c=.5){const d=dt(n.min,n.max,c);Nf(n,a,i,d,l)}function Ni(n,a){By(n.x,a.x,a.scaleX,a.scale,a.originX),By(n.y,a.y,a.scaleY,a.scale,a.originY)}function Cx(n,a){return Sx(Qw(n.getBoundingClientRect(),a))}function Jw(n,a,i){const l=Cx(n,i),{scroll:c}=a;return c&&(ji(l.x,c.offset.x),ji(l.y,c.offset.y)),l}const jx=({current:n})=>n?n.ownerDocument.defaultView:null,eE=new WeakMap;class tE{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=gt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const c=g=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(fl(g).point)},d=(g,y)=>{const{drag:x,dragPropagation:S,onDragStart:T}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Mw(x),!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),Nn(N=>{let C=this.getAxisMotionValue(N).get()||0;if(qn.test(C)){const{projection:w}=this.visualElement;if(w&&w.layout){const A=w.layout.layoutBox[N];A&&(C=un(A)*(parseFloat(C)/100))}}this.originPoint[N]=C}),T&&lt.postRender(()=>T(g,y)),pf(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},f=(g,y)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:T,onDrag:j}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=nE(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),j&&j(g,y)},m=(g,y)=>this.stop(g,y),p=()=>Nn(g=>{var y;return this.getAnimationState(g)==="paused"&&((y=this.getAxisMotionValue(g).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new yx(a,{onSessionStart:c,onStart:d,onMove:f,onSessionEnd:m,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:jx(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&lt.postRender(()=>d(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:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:c}=this.getProps();if(!l||!zr(a,c,this.currentDirection))return;const d=this.getAxisMotionValue(a);let f=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(f=$w(f,this.constraints[a],this.elastic[a])),d.set(f)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,d=this.constraints;i&&Ti(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&c?this.constraints=qw(c.layoutBox,i):this.constraints=!1,this.elastic=Zw(l),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Nn(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=Fw(c.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ti(a))return!1;const l=a.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=Jw(l,c.root,this.visualElement.getTransformPagePoint());let f=Yw(c.layout.layoutBox,d);if(i){const m=i(Xw(f));this.hasMutatedConstraints=!!m,m&&(f=Sx(m))}return f}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:c,dragTransition:d,dragSnapToOrigin:f,onDragTransitionEnd:m}=this.getProps(),p=this.constraints||{},v=Nn(g=>{if(!zr(g,i,this.currentDirection))return;let y=p&&p[g]||{};f&&(y={min:0,max:0});const x=c?200:1e6,S=c?40:1e7,T={type:"inertia",velocity:l?a[g]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...d,...y};return this.startAxisValueAnimation(g,T)});return Promise.all(v).then(m)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return pf(this.visualElement,a),l.start(Sh(a,l,0,i,this.visualElement,!1))}stopAnimation(){Nn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Nn(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()}`,l=this.visualElement.getProps(),c=l[i];return c||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){Nn(i=>{const{drag:l}=this.getProps();if(!zr(i,l,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(i);if(c&&c.layout){const{min:f,max:m}=c.layout.layoutBox[i];d.set(a[i]-dt(f,m,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!Ti(i)||!l||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Nn(f=>{const m=this.getAxisMotionValue(f);if(m&&this.constraints!==!1){const p=m.get();c[f]=Kw({min:p,max:p},this.constraints[f])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),Nn(f=>{if(!zr(f,a,null))return;const m=this.getAxisMotionValue(f),{min:p,max:v}=this.constraints[f];m.set(dt(p,v,c[f]))})}addListeners(){if(!this.visualElement.current)return;eE.set(this.visualElement,this);const a=this.visualElement.current,i=Zo(a,"pointerdown",p=>{const{drag:v,dragListener:g=!0}=this.getProps();v&&g&&this.start(p)}),l=()=>{const{dragConstraints:p}=this.getProps();Ti(p)&&p.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",l);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),lt.read(l);const f=il(window,"resize",()=>this.scalePositionWithinConstraints()),m=c.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:v})=>{this.isDragging&&v&&(Nn(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=p[g].translate,y.set(y.get()+p[g].translate))}),this.visualElement.render())}));return()=>{f(),i(),d(),m&&m()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:f=Cf,dragMomentum:m=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:c,dragConstraints:d,dragElastic:f,dragMomentum:m}}}function zr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function nE(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class aE extends Wa{constructor(a){super(a),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new tE(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ly=n=>(a,i)=>{n&&lt.postRender(()=>n(a,i))};class sE extends Wa{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(a){this.session=new yx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:c}=this.node.getProps();return{onSessionStart:Ly(a),onStart:Ly(i),onMove:l,onEnd:(d,f)=>{delete this.session,c&&lt.postRender(()=>c(d,f))}}}mount(){this.removePointerDownListener=Zo(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 Fr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Iy(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const zo={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ye.test(n))n=parseFloat(n);else return n;const i=Iy(n,a.target.x),l=Iy(n,a.target.y);return`${i}% ${l}%`}},iE={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,c=Za.parse(n);if(c.length>5)return l;const d=Za.createTransformer(n),f=typeof c[0]!="number"?1:0,m=i.x.scale*a.x,p=i.y.scale*a.y;c[0+f]/=m,c[1+f]/=p;const v=dt(m,p,.5);return typeof c[2+f]=="number"&&(c[2+f]/=v),typeof c[3+f]=="number"&&(c[3+f]/=v),d(c)}};class oE extends b.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:c}=this.props,{projection:d}=a;Rj(lE),d&&(i.group&&i.group.add(d),l&&l.register&&c&&l.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Fr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:c,isPresent:d}=this.props,f=l.projection;return f&&(f.isPresent=d,c||a.layoutDependency!==i||i===void 0?f.willUpdate():this.safeToRemove(),a.isPresent!==d&&(d?f.promote():f.relegate()||lt.postRender(()=>{const m=f.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),Qf.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:c}=a;c&&(c.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(c),l&&l.deregister&&l.deregister(c))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Nx(n){const[a,i]=db(),l=b.useContext($f);return r.jsx(oE,{...n,layoutGroup:l,switchLayoutGroup:b.useContext(bb),isPresent:a,safeToRemove:i})}const lE={borderRadius:{...zo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zo,borderTopRightRadius:zo,borderBottomLeftRadius:zo,borderBottomRightRadius:zo,boxShadow:iE};function rE(n,a,i){const l=Ht(n)?n:al(n);return l.start(Sh("",l,a,i)),l.animation}function cE(n){return n instanceof SVGElement&&n.tagName!=="svg"}const uE=(n,a)=>n.depth-a.depth;class dE{constructor(){this.children=[],this.isDirty=!1}add(a){rh(this.children,a),this.isDirty=!0}remove(a){ch(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(uE),this.isDirty=!1,this.children.forEach(a)}}function fE(n,a){const i=Yn.now(),l=({timestamp:c})=>{const d=c-i;d>=a&&(Fa(l),n(d-a))};return lt.read(l,!0),()=>Fa(l)}const wx=["TopLeft","TopRight","BottomLeft","BottomRight"],hE=wx.length,zy=n=>typeof n=="string"?parseFloat(n):n,Uy=n=>typeof n=="number"||ye.test(n);function mE(n,a,i,l,c,d){c?(n.opacity=dt(0,i.opacity!==void 0?i.opacity:1,pE(l)),n.opacityExit=dt(a.opacity!==void 0?a.opacity:1,0,vE(l))):d&&(n.opacity=dt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let f=0;f<hE;f++){const m=`border${wx[f]}Radius`;let p=Vy(a,m),v=Vy(i,m);if(p===void 0&&v===void 0)continue;p||(p=0),v||(v=0),p===0||v===0||Uy(p)===Uy(v)?(n[m]=Math.max(dt(zy(p),zy(v),l),0),(qn.test(v)||qn.test(p))&&(n[m]+="%")):n[m]=v}(a.rotate||i.rotate)&&(n.rotate=dt(a.rotate||0,i.rotate||0,l))}function Vy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const pE=Ex(0,.5,qb),vE=Ex(.5,.95,cn);function Ex(n,a,i){return l=>l<n?0:l>a?1:i(Mi(n,a,l))}function Hy(n,a){n.min=a.min,n.max=a.max}function Cn(n,a){Hy(n.x,a.x),Hy(n.y,a.y)}function Gy(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Py(n,a,i,l,c){return n-=a,n=sc(n,1/i,l),c!==void 0&&(n=sc(n,1/c,l)),n}function gE(n,a=0,i=1,l=.5,c,d=n,f=n){if(qn.test(a)&&(a=parseFloat(a),a=dt(f.min,f.max,a/100)-f.min),typeof a!="number")return;let m=dt(d.min,d.max,l);n===d&&(m-=a),n.min=Py(n.min,a,i,m,c),n.max=Py(n.max,a,i,m,c)}function $y(n,a,[i,l,c],d,f){gE(n,a[i],a[l],a[c],a.scale,d,f)}const yE=["x","scaleX","originX"],bE=["y","scaleY","originY"];function qy(n,a,i,l){$y(n.x,a,yE,i?i.x:void 0,l?l.x:void 0),$y(n.y,a,bE,i?i.y:void 0,l?l.y:void 0)}function Yy(n){return n.translate===0&&n.scale===1}function Ax(n){return Yy(n.x)&&Yy(n.y)}function Ky(n,a){return n.min===a.min&&n.max===a.max}function xE(n,a){return Ky(n.x,a.x)&&Ky(n.y,a.y)}function Fy(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Dx(n,a){return Fy(n.x,a.x)&&Fy(n.y,a.y)}function Zy(n){return un(n.x)/un(n.y)}function Xy(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class _E{constructor(){this.members=[]}add(a){rh(this.members,a),a.scheduleRender()}remove(a){if(ch(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(c=>a===c);if(i===0)return!1;let l;for(let c=i;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){l=d;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:c}=a.options;c===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function SE(n,a,i){let l="";const c=n.x.translate/a.x,d=n.y.translate/a.y,f=(i==null?void 0:i.z)||0;if((c||d||f)&&(l=`translate3d(${c}px, ${d}px, ${f}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:v,rotate:g,rotateX:y,rotateY:x,skewX:S,skewY:T}=i;v&&(l=`perspective(${v}px) ${l}`),g&&(l+=`rotate(${g}deg) `),y&&(l+=`rotateX(${y}deg) `),x&&(l+=`rotateY(${x}deg) `),S&&(l+=`skewX(${S}deg) `),T&&(l+=`skewY(${T}deg) `)}const m=n.x.scale*a.x,p=n.y.scale*a.y;return(m!==1||p!==1)&&(l+=`scale(${m}, ${p})`),l||"none"}const _s={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Go=typeof window<"u"&&window.MotionDebug!==void 0,Zd=["","X","Y","Z"],TE={visibility:"hidden"},Qy=1e3;let kE=0;function Xd(n,a,i,l){const{latestValues:c}=a;c[n]&&(i[n]=c[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Rx(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Bb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:c,layoutId:d}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",lt,!(c||d))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Rx(l)}function Mx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:c}){return class{constructor(f={},m=a==null?void 0:a()){this.id=kE++,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,Go&&(_s.totalNodes=_s.resolvedTargetDeltas=_s.recalculatedProjection=0),this.nodes.forEach(NE),this.nodes.forEach(RE),this.nodes.forEach(ME),this.nodes.forEach(wE),Go&&window.MotionDebug.record(_s)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,this.root=m?m.root||m:this,this.path=m?[...m.path,m]:[],this.parent=m,this.depth=m?m.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new dE)}addEventListener(f,m){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new uh),this.eventHandlers.get(f).add(m)}notifyListeners(f,...m){const p=this.eventHandlers.get(f);p&&p.notify(...m)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,m=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=cE(f),this.instance=f;const{layoutId:p,layout:v,visualElement:g}=this.options;if(g&&!g.current&&g.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),m&&(v||p)&&(this.isLayoutDirty=!0),n){let y;const x=()=>this.root.updateBlockedByResize=!1;n(f,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=fE(x,250),Fr.hasAnimatedSinceResize&&(Fr.hasAnimatedSinceResize=!1,this.nodes.forEach(Jy))})}p&&this.root.registerSharedNode(p,this),this.options.animate!==!1&&g&&(p||v)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const j=this.options.transition||g.getDefaultTransition()||zE,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=g.getProps(),w=!this.targetLayout||!Dx(this.targetLayout,T)||S,A=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||x&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,A);const R={...lh(j,"layout"),onPlay:N,onComplete:C};(g.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else x||Jy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Fa(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(OE),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:m,layout:p}=this.options;if(m===void 0&&!p)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Wy);return}this.isUpdating||this.nodes.forEach(AE),this.isUpdating=!1,this.nodes.forEach(DE),this.nodes.forEach(CE),this.nodes.forEach(jE),this.clearAllSnapshots();const m=Yn.now();zt.delta=ba(0,1e3/60,m-zt.timestamp),zt.timestamp=m,zt.isProcessing=!0,Hd.update.process(zt),Hd.preRender.process(zt),Hd.render.process(zt),zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(EE),this.sharedNodes.forEach(BE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.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 p=0;p<this.path.length;p++)this.path[p].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=gt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:m}=this.options;m&&m.notify("LayoutMeasure",this.layout.layoutBox,f?f.layoutBox:void 0)}updateScroll(f="measure"){let m=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(m=!1),m){const p=l(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:p,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!c)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,m=this.projectionDelta&&!Ax(this.projectionDelta),p=this.getTransformTemplate(),v=p?p(this.latestValues,""):void 0,g=v!==this.prevTransformTemplateValue;f&&(m||xs(this.latestValues)||g)&&(c(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const m=this.measurePageBox();let p=this.removeElementScroll(m);return f&&(p=this.removeTransform(p)),UE(p),{animationId:this.root.animationId,measuredBox:m,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:m}=this.options;if(!m)return gt();const p=m.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(VE))){const{scroll:g}=this.root;g&&(ji(p.x,g.offset.x),ji(p.y,g.offset.y))}return p}removeElementScroll(f){var m;const p=gt();if(Cn(p,f),!((m=this.scroll)===null||m===void 0)&&m.wasRoot)return p;for(let v=0;v<this.path.length;v++){const g=this.path[v],{scroll:y,options:x}=g;g!==this.root&&y&&x.layoutScroll&&(y.wasRoot&&Cn(p,f),ji(p.x,y.offset.x),ji(p.y,y.offset.y))}return p}applyTransform(f,m=!1){const p=gt();Cn(p,f);for(let v=0;v<this.path.length;v++){const g=this.path[v];!m&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ni(p,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),xs(g.latestValues)&&Ni(p,g.latestValues)}return xs(this.latestValues)&&Ni(p,this.latestValues),p}removeTransform(f){const m=gt();Cn(m,f);for(let p=0;p<this.path.length;p++){const v=this.path[p];if(!v.instance||!xs(v.latestValues))continue;jf(v.latestValues)&&v.updateSnapshot();const g=gt(),y=v.measurePageBox();Cn(g,y),qy(m,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,g)}return xs(this.latestValues)&&qy(m,this.latestValues),m}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.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!==zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var m;const p=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=p.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=p.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=p.isSharedProjectionDirty);const v=!!this.resumingFrom||this!==p;if(!(f||v&&this.isSharedProjectionDirty||this.isProjectionDirty||!((m=this.parent)===null||m===void 0)&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:x}=this.options;if(!(!this.layout||!(y||x))){if(this.resolvedRelativeTargetAt=zt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=gt(),this.relativeTargetOrigin=gt(),Qo(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=gt(),this.targetWithTransforms=gt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Cn(this.target,this.layout.layoutBox),kx(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=gt(),this.relativeTargetOrigin=gt(),Qo(this.relativeTargetOrigin,this.target,S.target),Cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Go&&_s.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||jf(this.parent.latestValues)||Tx(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 f;const m=this.getLead(),p=!!this.resumingFrom||this!==m;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),p&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===zt.timestamp&&(v=!1),v)return;const{layout:g,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||y))return;Cn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;Ww(this.layoutCorrected,this.treeScale,this.path,p),m.layout&&!m.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(m.target=m.layout.layoutBox,m.targetWithTransforms=gt());const{target:T}=m;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gy(this.prevProjectionDelta.x,this.projectionDelta.x),Gy(this.prevProjectionDelta.y,this.projectionDelta.y)),Xo(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!Xy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),Go&&_s.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var m;if((m=this.options.visualElement)===null||m===void 0||m.scheduleRender(),f){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ci(),this.projectionDelta=Ci(),this.projectionDeltaWithTransform=Ci()}setAnimationOrigin(f,m=!1){const p=this.snapshot,v=p?p.latestValues:{},g={...this.latestValues},y=Ci();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!m;const x=gt(),S=p?p.source:void 0,T=this.layout?this.layout.source:void 0,j=S!==T,N=this.getStack(),C=!N||N.members.length<=1,w=!!(j&&!C&&this.options.crossfade===!0&&!this.path.some(IE));this.animationProgress=0;let A;this.mixTargetDelta=R=>{const E=R/1e3;e0(y.x,f.x,E),e0(y.y,f.y,E),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qo(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),LE(this.relativeTarget,this.relativeTargetOrigin,x,E),A&&xE(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=gt()),Cn(A,this.relativeTarget)),j&&(this.animationValues=g,mE(g,v,this.latestValues,E,w,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Fa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{Fr.hasAnimatedSinceResize=!0,this.currentAnimation=rE(0,Qy,{...f,onUpdate:m=>{this.mixTargetDelta(m),f.onUpdate&&f.onUpdate(m)},onComplete:()=>{f.onComplete&&f.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 f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qy),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:m,target:p,layout:v,latestValues:g}=f;if(!(!m||!p||!v)){if(this!==f&&this.layout&&v&&Ox(this.options.animationType,this.layout.layoutBox,v.layoutBox)){p=this.target||gt();const y=un(this.layout.layoutBox.x);p.x.min=f.target.x.min,p.x.max=p.x.min+y;const x=un(this.layout.layoutBox.y);p.y.min=f.target.y.min,p.y.max=p.y.min+x}Cn(m,p),Ni(m,g),Xo(this.projectionDeltaWithTransform,this.layoutCorrected,m,g)}}registerSharedNode(f,m){this.sharedNodes.has(f)||this.sharedNodes.set(f,new _E),this.sharedNodes.get(f).add(m);const v=m.options.initialPromotionConfig;m.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(m):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:m}=this.options;return m?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:m}=this.options;return m?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:m,preserveFollowOpacity:p}={}){const v=this.getStack();v&&v.promote(this,p),f&&(this.projectionDelta=void 0,this.needsReset=!0),m&&this.setOptions({transition:m})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let m=!1;const{latestValues:p}=f;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(m=!0),!m)return;const v={};p.z&&Xd("z",f,v,this.animationValues);for(let g=0;g<Zd.length;g++)Xd(`rotate${Zd[g]}`,f,v,this.animationValues),Xd(`skew${Zd[g]}`,f,v,this.animationValues);f.render();for(const g in v)f.setStaticValue(g,v[g]),this.animationValues&&(this.animationValues[g]=v[g]);f.scheduleRender()}getProjectionStyles(f){var m,p;if(!this.instance||this.isSVG)return;if(!this.isVisible)return TE;const v={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=Yr(f==null?void 0:f.pointerEvents)||"",v.transform=g?g(this.latestValues,""):"none",v;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const j={};return this.options.layoutId&&(j.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,j.pointerEvents=Yr(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!xs(this.latestValues)&&(j.transform=g?g({},""):"none",this.hasProjected=!1),j}const x=y.animationValues||y.latestValues;this.applyTransformsToTarget(),v.transform=SE(this.projectionDeltaWithTransform,this.treeScale,x),g&&(v.transform=g(x,v.transform));const{x:S,y:T}=this.projectionDelta;v.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?v.opacity=y===this?(p=(m=x.opacity)!==null&&m!==void 0?m:this.latestValues.opacity)!==null&&p!==void 0?p:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:v.opacity=y===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const j in Jr){if(x[j]===void 0)continue;const{correct:N,applyTo:C}=Jr[j],w=v.transform==="none"?x[j]:N(x[j],y);if(C){const A=C.length;for(let R=0;R<A;R++)v[C[R]]=w}else v[j]=w}return this.options.layoutId&&(v.pointerEvents=y===this?Yr(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var m;return(m=f.currentAnimation)===null||m===void 0?void 0:m.stop()}),this.root.nodes.forEach(Wy),this.root.sharedNodes.clear()}}}function CE(n){n.updateLayout()}function jE(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:l,measuredBox:c}=n.layout,{animationType:d}=n.options,f=i.source!==n.layout.source;d==="size"?Nn(y=>{const x=f?i.measuredBox[y]:i.layoutBox[y],S=un(x);x.min=l[y].min,x.max=x.min+S}):Ox(d,i.layoutBox,l)&&Nn(y=>{const x=f?i.measuredBox[y]:i.layoutBox[y],S=un(l[y]);x.max=x.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[y].max=n.relativeTarget[y].min+S)});const m=Ci();Xo(m,l,i.layoutBox);const p=Ci();f?Xo(p,n.applyTransform(c,!0),i.measuredBox):Xo(p,l,i.layoutBox);const v=!Ax(m);let g=!1;if(!n.resumeFrom){const y=n.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:x,layout:S}=y;if(x&&S){const T=gt();Qo(T,i.layoutBox,x.layoutBox);const j=gt();Qo(j,l,S.layoutBox),Dx(T,j)||(g=!0),y.options.layoutRoot&&(n.relativeTarget=j,n.relativeTargetOrigin=T,n.relativeParent=y)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:p,layoutDelta:m,hasLayoutChanged:v,hasRelativeTargetChanged:g})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function NE(n){Go&&_s.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 wE(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function EE(n){n.clearSnapshot()}function Wy(n){n.clearMeasurements()}function AE(n){n.isLayoutDirty=!1}function DE(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function Jy(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function RE(n){n.resolveTargetDelta()}function ME(n){n.calcProjection()}function OE(n){n.resetSkewAndRotation()}function BE(n){n.removeLeadSnapshot()}function e0(n,a,i){n.translate=dt(a.translate,0,i),n.scale=dt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function t0(n,a,i,l){n.min=dt(a.min,i.min,l),n.max=dt(a.max,i.max,l)}function LE(n,a,i,l){t0(n.x,a.x,i.x,l),t0(n.y,a.y,i.y,l)}function IE(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const zE={duration:.45,ease:[.4,0,.1,1]},n0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),a0=n0("applewebkit/")&&!n0("chrome/")?Math.round:cn;function s0(n){n.min=a0(n.min),n.max=a0(n.max)}function UE(n){s0(n.x),s0(n.y)}function Ox(n,a,i){return n==="position"||n==="preserve-aspect"&&!Gw(Zy(a),Zy(i),.2)}function VE(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const HE=Mx({attachResizeListener:(n,a)=>il(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qd={current:void 0},Bx=Mx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Qd.current){const n=new HE({});n.mount(window),n.setOptions({layoutScroll:!0}),Qd.current=n}return Qd.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),GE={pan:{Feature:sE},drag:{Feature:aE,ProjectionNode:Bx,MeasureLayout:Nx}};function PE(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let c=document;const d=(l=void 0)!==null&&l!==void 0?l:c.querySelectorAll(n);return d?Array.from(d):[]}return Array.from(n)}function Lx(n,a){const i=PE(n),l=new AbortController,c={passive:!0,...a,signal:l.signal};return[i,c,()=>l.abort()]}function i0(n){return a=>{a.pointerType==="touch"||gx()||n(a)}}function $E(n,a,i={}){const[l,c,d]=Lx(n,i),f=i0(m=>{const{target:p}=m,v=a(m);if(typeof v!="function"||!p)return;const g=i0(y=>{v(y),p.removeEventListener("pointerleave",g)});p.addEventListener("pointerleave",g,c)});return l.forEach(m=>{m.addEventListener("pointerenter",f,c)}),d}function o0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const c="onHover"+i,d=l[c];d&&lt.postRender(()=>d(a,fl(a)))}class qE extends Wa{mount(){const{current:a}=this.node;a&&(this.unmount=$E(a,i=>(o0(this.node,i,"Start"),l=>o0(this.node,l,"End"))))}unmount(){}}class YE extends Wa{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=dl(il(this.node.current,"focus",()=>this.onFocus()),il(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Ix=(n,a)=>a?n===a?!0:Ix(n,a.parentElement):!1,KE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function FE(n){return KE.has(n.tagName)||n.tabIndex!==-1}const Po=new WeakSet;function l0(n){return a=>{a.key==="Enter"&&n(a)}}function Wd(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const ZE=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=l0(()=>{if(Po.has(i))return;Wd(i,"down");const c=l0(()=>{Wd(i,"up")}),d=()=>Wd(i,"cancel");i.addEventListener("keyup",c,a),i.addEventListener("blur",d,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function r0(n){return Th(n)&&!gx()}function XE(n,a,i={}){const[l,c,d]=Lx(n,i),f=m=>{const p=m.currentTarget;if(!r0(m)||Po.has(p))return;Po.add(p);const v=a(m),g=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",x),!(!r0(S)||!Po.has(p))&&(Po.delete(p),typeof v=="function"&&v(S,{success:T}))},y=S=>{g(S,i.useGlobalTarget||Ix(p,S.target))},x=S=>{g(S,!1)};window.addEventListener("pointerup",y,c),window.addEventListener("pointercancel",x,c)};return l.forEach(m=>{!FE(m)&&m.getAttribute("tabindex")===null&&(m.tabIndex=0),(i.useGlobalTarget?window:m).addEventListener("pointerdown",f,c),m.addEventListener("focus",v=>ZE(v,c),c)}),d}function c0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const c="onTap"+(i==="End"?"":i),d=l[c];d&&lt.postRender(()=>d(a,fl(a)))}class QE extends Wa{mount(){const{current:a}=this.node;a&&(this.unmount=XE(a,i=>(c0(this.node,i,"Start"),(l,{success:c})=>c0(this.node,l,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wf=new WeakMap,Jd=new WeakMap,WE=n=>{const a=wf.get(n.target);a&&a(n)},JE=n=>{n.forEach(WE)};function e2({root:n,...a}){const i=n||document;Jd.has(i)||Jd.set(i,{});const l=Jd.get(i),c=JSON.stringify(a);return l[c]||(l[c]=new IntersectionObserver(JE,{root:n,...a})),l[c]}function t2(n,a,i){const l=e2(a);return wf.set(n,i),l.observe(n),()=>{wf.delete(n),l.unobserve(n)}}const n2={some:0,all:1};class a2 extends Wa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:c="some",once:d}=a,f={root:i?i.current:void 0,rootMargin:l,threshold:typeof c=="number"?c:n2[c]},m=p=>{const{isIntersecting:v}=p;if(this.isInView===v||(this.isInView=v,d&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),x=v?g:y;x&&x(p)};return t2(this.node.current,f,m)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(s2(a,i))&&this.startObserver()}unmount(){}}function s2({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const i2={inView:{Feature:a2},tap:{Feature:QE},focus:{Feature:YE},hover:{Feature:qE}},o2={layout:{ProjectionNode:Bx,MeasureLayout:Nx}},ic={current:null},kh={current:!1};function zx(){if(kh.current=!0,!!Kf)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>ic.current=n.matches;n.addListener(a),a()}else ic.current=!1}const l2=[...ix,Vt,Za],r2=n=>l2.find(sx(n)),u0=new WeakMap;function c2(n,a,i){for(const l in a){const c=a[l],d=i[l];if(Ht(c))n.addValue(l,c);else if(Ht(d))n.addValue(l,al(c,{owner:n}));else if(d!==c)if(n.hasValue(l)){const f=n.getValue(l);f.liveStyle===!0?f.jump(c):f.hasAnimated||f.set(c)}else{const f=n.getStaticValue(l);n.addValue(l,al(f!==void 0?f:c,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const d0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class u2{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:c,blockInitialAnimation:d,visualState:f},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bh,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=Yn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,lt.render(this.render,!1,!0))};const{latestValues:p,renderState:v,onUpdate:g}=f;this.onUpdate=g,this.latestValues=p,this.baseTarget={...p},this.initialValues=i.initial?{...p}:{},this.renderState=v,this.parent=a,this.props=i,this.presenceContext=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=c,this.options=m,this.blockInitialAnimation=!!d,this.isControllingVariants=vc(i),this.isVariantNode=gb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...x}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in x){const T=x[S];p[S]!==void 0&&Ht(T)&&T.set(p[S],!1)}}mount(a){this.current=a,u0.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,l)=>this.bindToMotionValue(l,i)),kh.current||zx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ic.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){u0.delete(this.current),this.projection&&this.projection.unmount(),Fa(this.notifyUpdate),Fa(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 l=As.has(a),c=i.on("change",m=>{this.latestValues[a]=m,this.props.onUpdate&&lt.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),d=i.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{c(),d(),f&&f(),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 Ri){const i=Ri[a];if(!i)continue;const{isEnabled:l,Feature:c}=i;if(!this.features[a]&&c&&l(this.props)&&(this.features[a]=new c(this)),this.features[a]){const d=this.features[a];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):gt()}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 l=0;l<d0.length;l++){const c=d0[l];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,f=a[d];f&&(this.propEventSubscriptions[c]=this.on(c,f))}this.prevMotionValues=c2(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 l=this.values.get(a);i!==l&&(l&&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 l=this.values.get(a);return l===void 0&&i!==void 0&&(l=al(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let c=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return c!=null&&(typeof c=="string"&&(nx(c)||Kb(c))?c=parseFloat(c):!r2(c)&&Za.test(i)&&(c=Jb(a,i)),this.setBaseTarget(a,Ht(c)?c.get():c)),Ht(c)?c.get():c}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let c;if(typeof l=="string"||typeof l=="object"){const f=Jf(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);f&&(c=f[a])}if(l&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,a);return d!==void 0&&!Ht(d)?d:this.initialValues[a]!==void 0&&c===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new uh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Ux extends u2{constructor(){super(...arguments),this.KeyframeResolver=ox}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:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Ht(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function d2(n){return window.getComputedStyle(n)}class f2 extends Ux{constructor(){super(...arguments),this.type="html",this.renderInstance=jb}readValueFromInstance(a,i){if(As.has(i)){const l=yh(i);return l&&l.default||0}else{const l=d2(a),c=(Tb(i)?l.getPropertyValue(i):l[i])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Cx(a,i)}build(a,i,l){nh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return oh(a,i,l)}}class h2 extends Ux{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(As.has(i)){const l=yh(i);return l&&l.default||0}return i=Nb.has(i)?i:Xf(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Ab(a,i,l)}build(a,i,l){ah(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,c){wb(a,i,l,c)}mount(a){this.isSVGTag=ih(a.tagName),super.mount(a)}}const m2=(n,a)=>Wf(n)?new h2(a):new f2(a,{allowProjection:n!==b.Fragment}),p2=Hj({...Rw,...i2,...GE,...o2},m2),Tt=nj(p2);function v2(){!kh.current&&zx();const[n]=b.useState(ic.current);return n}const Ef={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 Xa(n){return n==="blocked"?Ef.blocked:Ef[Ch(n)]}const g2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function y2(n){return g2[Ch(n)]??"statusPending"}const b2=["working","paused","failed","not_started","blocked","complete"],f0=["not_started","working","paused","complete","failed"],x2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Ch(n){return n in Ef&&n!=="blocked"?n:x2[n]??"not_started"}const _2={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 S2(n){if(n.length===0)return[];const a=[...n].sort((l,c)=>l[0]-c[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const c=i[i.length-1],[d,f]=a[l];d<=c[1]+1?c[1]=Math.max(c[1],f):i.push([d,f])}return i}function Vx({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return r.jsx(r.Fragment,{children:n});const l=S2(a),c=[];let d=0;for(const[f,m]of l)f>d&&c.push(r.jsx("span",{children:n.slice(d,f)},`p${d}`)),c.push(r.jsx("mark",{className:i,children:n.slice(f,m+1)},`m${f}`)),d=m+1;return d<n.length&&c.push(r.jsx("span",{children:n.slice(d)},`p${d}`)),r.jsx(r.Fragment,{children:c})}function T2(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((c,d)=>c.sortOrder-d.sortOrder);return i.sort((l,c)=>l.sortOrder-c.sortOrder)}function k2(n,a){const i=new Map;for(const d of n){const m=d.dependsOn.length>0&&d.dependsOn.some(v=>a.get(v)!=="complete")?"blocked":d.status,p=i.get(m);p?p.push(d):i.set(m,[d])}const l=[],c=new Set;for(const d of b2){c.add(d);const f=i.get(d);if(f&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=Xa(d);l.push({status:d,label:m.label,style:m,tasks:f})}}for(const[d,f]of i)if(!c.has(d)&&f.length>0){f.sort((p,v)=>p.sortOrder-v.sortOrder);const m=Xa(d);l.push({status:d,label:m.label,style:m,tasks:f})}return l}const C2="_container_z4i38_1",j2="_header_z4i38_5",N2="_headerActions_z4i38_17",w2="_searchInput_z4i38_23",E2="_searchHighlight_z4i38_56",A2="_groupToggle_z4i38_62",D2="_groupToggleActive_z4i38_89",R2="_addButton_z4i38_93",M2="_taskRow_z4i38_120",O2="_selected_z4i38_140",B2="_expandArrow_z4i38_150",L2="_expanded_z4i38_157",I2="_leafSpacer_z4i38_161",z2="_taskStatusIcon_z4i38_166",U2="_taskTitle_z4i38_170",V2="_workspaceBadge_z4i38_177",H2="_childCountBadge_z4i38_195",G2="_dependencyBadge_z4i38_208",P2="_blockedBadge_z4i38_220",$2="_addChildButton_z4i38_225",q2="_emptyState_z4i38_268",Y2="_statusGroupHeader_z4i38_275",K2="_statusGroupIcon_z4i38_294",F2="_statusGroupLabel_z4i38_298",Z2="_statusGroupCount_z4i38_303",Le={container:C2,header:j2,headerActions:N2,searchInput:w2,searchHighlight:E2,groupToggle:A2,groupToggleActive:D2,addButton:R2,taskRow:M2,selected:O2,expandArrow:B2,expanded:L2,leafSpacer:I2,taskStatusIcon:z2,taskTitle:U2,workspaceBadge:V2,childCountBadge:H2,dependencyBadge:G2,blockedBadge:P2,addChildButton:$2,emptyState:q2,statusGroupHeader:Y2,statusGroupIcon:K2,statusGroupLabel:F2,statusGroupCount:Z2},X2=[{name:"title",weight:2},{name:"description",weight:1}],Hx=16,Q2=16,Gx="grackle-task-group-by-status";function h0(){try{return localStorage.getItem(Gx)==="true"}catch{return!1}}function W2(n){try{localStorage.setItem(Gx,String(n))}catch{}}function J2({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:c,titleHighlights:d,workspaceNames:f}){return r.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[r.jsxs("div",{className:Le.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())},children:[r.jsx("span",{className:`${Le.expandArrow} ${a?Le.expanded:""}`,children:"▸"}),r.jsx("span",{className:Le.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),r.jsx("span",{className:Le.statusGroupLabel,children:n.label}),r.jsx("span",{className:Le.statusGroupCount,children:n.tasks.length})]}),r.jsx(Kn,{children:a&&r.jsx(Tt.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(m=>{const p=Xa(m.status),v=l===m.id,g=m.parentTaskId||!m.workspaceId?void 0:f.get(m.workspaceId);return r.jsxs("div",{onClick:()=>c(ya(m.id)),className:`${Le.taskRow} ${v?Le.selected:""}`,style:{"--task-indent":`${Hx}px`},"data-task-id":m.id,children:[r.jsx("span",{className:Le.leafSpacer}),r.jsx("span",{className:Le.taskStatusIcon,style:{color:p.color},children:p.icon}),r.jsx("span",{className:Le.taskTitle,title:m.title,children:r.jsx(Vx,{text:m.title,indices:d.get(m.id),highlightClass:Le.searchHighlight})}),g&&r.jsx("span",{className:Le.workspaceBadge,title:g,children:g})]},m.id)})})})]})}function Px({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p}){const v=Xa(n.status),g=n.dependsOn.length>0&&n.dependsOn.some(C=>f.get(C)!=="complete"),y=i.has(n.id),x=n.children.length>0,S=c===n.id,T=Hx+a*Q2,N=a===0&&!n.parentTaskId&&n.workspaceId?p.get(n.workspaceId):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:()=>d(ya(n.id)),className:`${Le.taskRow} ${S?Le.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":n.id,children:[x&&r.jsx("span",{className:`${Le.expandArrow} ${y?Le.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:C=>{C.stopPropagation(),l(n.id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),l(n.id))},children:"▸"}),!x&&r.jsx("span",{className:Le.leafSpacer}),r.jsx("span",{className:Le.taskStatusIcon,style:{color:v.color},children:v.icon}),r.jsx("span",{className:Le.taskTitle,title:n.title,children:r.jsx(Vx,{text:n.title,indices:m.get(n.id),highlightClass:Le.searchHighlight})}),N&&r.jsx("span",{className:Le.workspaceBadge,title:N,children:N}),x&&r.jsxs("span",{className:Le.childCountBadge,children:[n.children.filter(C=>C.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&r.jsx("span",{className:`${Le.dependencyBadge} ${g?Le.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:g?"blocked":"dep"}),a<R1&&r.jsx("button",{onClick:C=>{C.stopPropagation(),d(zi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Le.addChildButton,children:"+"})]}),r.jsx(Kn,{children:x&&y&&r.jsx(Tt.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(C=>r.jsx(Px,{node:C,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:c,navigate:d,taskStatusById:f,titleHighlights:m,workspaceNames:p},C.id))})})]})}function eA({workspaces:n,tasks:a}){const i=Rt(),[l,c]=b.useState(new Set),[d,f]=b.useState(new Set),[m,p]=b.useState(h0),[v,g]=b.useState(h0),[y,x]=b.useState(new Map),S=St("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,j=b.useMemo(()=>new Map(a.map(K=>[K.id,K.status])),[a]),N=b.useMemo(()=>new Map(n.map(K=>[K.id,K.name])),[n]),C=()=>{const K=!m;W2(K),p(K),K&&(g(!0),x(new Map))},w=K=>{x(ae=>{const O=new Map(ae),$=O.has(K)?O.get(K):v;return O.set(K,!$),O})},A=K=>y.has(K)?y.get(K):v,R=K=>{c(ae=>{const O=new Set(ae);return O.has(K)?(O.delete(K),f($=>new Set($).add(K))):(O.add(K),f($=>{const se=new Set($);return se.delete(K),se})),O})};b.useEffect(()=>{const K=new Set(a.filter(ae=>ae.parentTaskId).map(ae=>ae.parentTaskId));K.size>0&&c(ae=>{const O=new Set(ae);for(const $ of K)d.has($)||O.add($);return O})},[a,d]);const[E,H]=b.useState(""),{directMatchTaskIds:z,treeMatchTaskIds:I,titleHighlights:P}=b.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const K=D1(a,E,X2),ae=new Set(K.map(oe=>oe.item.id)),O=new Map;for(const oe of K){const Y=oe.matches.find(be=>be.key==="title");Y&&O.set(oe.item.id,Y.indices)}const $=new Set(ae),se=new Map(a.map(oe=>[oe.id,oe]));for(const oe of[...ae]){let Y=se.get(oe);for(;Y!=null&&Y.parentTaskId;)$.add(Y.parentTaskId),Y=se.get(Y.parentTaskId)}return{directMatchTaskIds:ae,treeMatchTaskIds:$,titleHighlights:O}},[E,a]),ee=z!==null,ne=ee?m?z:I:null,ce=ne?a.filter(K=>ne.has(K.id)):a,re=m?[]:T2(ce);return r.jsxs("div",{className:Le.container,children:[r.jsxs("div",{className:Le.header,children:[r.jsx("span",{children:"Tasks"}),r.jsxs("div",{className:Le.headerActions,children:[r.jsx("button",{className:`${Le.groupToggle} ${m?Le.groupToggleActive:""}`,onClick:C,"aria-label":m?"Switch to tree view":"Group tasks by status","aria-pressed":m,title:m?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),r.jsx("button",{className:Le.addButton,onClick:()=>i(zi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&r.jsx("input",{type:"text",value:E,onChange:K=>H(K.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Le.searchInput,"data-testid":"sidebar-search"}),m?k2(ce,j).map(K=>r.jsx(J2,{group:K,isExpanded:A(K.status),onToggle:()=>w(K.status),selectedTaskId:T,navigate:i,titleHighlights:P,workspaceNames:N},K.status)):re.map(K=>r.jsx(Px,{node:K,depth:0,expandedTasks:l,toggleTask:R,selectedTaskId:T,navigate:i,taskStatusById:j,titleHighlights:P,workspaceNames:N},K.id)),ce.length===0&&!ee&&r.jsx("div",{className:Le.emptyState,children:"No tasks yet. Click + to create one."}),ce.length===0&&ee&&r.jsx("div",{className:Le.emptyState,children:"No matching tasks"})]})}const tA="_nav_14i94_1",nA="_tab_14i94_24",aA="_tabActive_14i94_62",sA="_tabLabel_14i94_75",iA="_statusDot_14i94_81",oA="_pulse_14i94_87",lA="_addButton_14i94_99",rA="_empty_14i94_132",Ya={nav:tA,tab:nA,tabActive:aA,tabLabel:sA,statusDot:iA,pulse:oA,addButton:lA,empty:rA},cA={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function uA({environments:n}){const a=Rt(),i=b.useRef(null),l=St("/environments/:environmentId"),c=St("/environments/:environmentId/edit"),d=St("/environments/:environmentId/workspaces/:workspaceId"),f=St("/environments/:environmentId/workspaces/:workspaceId/*"),m=(l==null?void 0:l.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(f==null?void 0:f.params.environmentId),p=m==="new"?void 0:m,v=b.useCallback(x=>{a(Di(x))},[a]),g=b.useCallback(x=>{var C;const S=(C=i.current)==null?void 0:C.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(w=>w===document.activeElement),j=T>=0?T:n.findIndex(w=>w.id===p);let N=j;if(x.key==="ArrowDown")x.preventDefault(),N=(j+1)%S.length;else if(x.key==="ArrowUp")x.preventDefault(),N=(j-1+S.length)%S.length;else if(x.key==="Home")x.preventDefault(),N=0;else if(x.key==="End")x.preventDefault(),N=S.length-1;else return;N<n.length&&a(Di(n[N].id)),S[N].focus()},[p,n,a]),y=p??(n.length>0?n[0].id:void 0);return r.jsxs("div",{className:Ya.nav,"data-testid":"environment-nav",children:[r.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:g,children:n.map(x=>{const S=x.id===p,T=x.id===y,j=cA[x.status]||"var(--text-tertiary)",N=x.status==="connected";return r.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${Ya.tab} ${S?Ya.tabActive:""}`,onClick:()=>v(x.id),"data-testid":"env-nav-item",children:[r.jsx("span",{className:`${Ya.statusDot} ${N?Ya.pulse:""}`,style:{color:j},children:"●"}),r.jsx("span",{className:Ya.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),r.jsx("button",{type:"button",className:Ya.addButton,onClick:()=>a(Nk),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&r.jsx("div",{className:Ya.empty,children:"No environments yet."})]})}const dA="_nav_1bhou_1",fA="_tab_1bhou_24",hA="_tabIcon_1bhou_62",mA="_tabActive_1bhou_68",Ur={nav:dA,tab:fA,tabIcon:hA,tabActive:mA},ma=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function pA(){var f;const n=wt(),a=Rt(),i=b.useRef(null),l=((f=ma.find(m=>n.pathname===`${Yo}/${m.path}`))==null?void 0:f.path)??ma[0].path,c=b.useCallback(m=>{a(`${Yo}/${m}`)},[a]),d=b.useCallback(m=>{var S,T;const p=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!p)return;const v=Array.from(p).findIndex(j=>j===document.activeElement),g=v>=0?v:ma.findIndex(j=>j.path===l);let y=g;if(m.key==="ArrowDown")m.preventDefault(),y=(g+1)%ma.length;else if(m.key==="ArrowUp")m.preventDefault(),y=(g-1+ma.length)%ma.length;else if(m.key==="Home")m.preventDefault(),y=0;else if(m.key==="End")m.preventDefault(),y=ma.length-1;else return;const x=ma[y].path;a(`${Yo}/${x}`),(T=p[y])==null||T.focus()},[l,a]);return r.jsx("nav",{className:Ur.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:ma.map(m=>{const p=m.path===l;return r.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Ur.tab} ${p?Ur.tabActive:""}`,onClick:()=>c(m.path),children:[r.jsx("span",{className:Ur.tabIcon,"aria-hidden":"true",children:m.icon}),m.label]},m.path)})})}const vA="_nav_1snmp_1",gA="_searchForm_1snmp_8",yA="_searchInput_1snmp_15",bA="_searchButton_1snmp_33",xA="_clearButton_1snmp_68",_A="_workspaceSelect_1snmp_85",SA="_listHeader_1snmp_99",TA="_nodeList_1snmp_108",kA="_nodeItem_1snmp_116",CA="_indicator_1snmp_129",jA="_label_1snmp_136",NA="_badge_1snmp_145",jn={nav:vA,searchForm:gA,searchInput:yA,searchButton:bA,clearButton:xA,workspaceSelect:_A,listHeader:SA,nodeList:TA,nodeItem:kA,indicator:CA,label:jA,badge:NA};function wA(){const{knowledge:n,workspaces:a}=rt(),[i,l]=b.useState(""),c=b.useCallback(p=>{p.preventDefault(),i.trim()&&n.search(i.trim())},[i,n]),d=b.useCallback(()=>{l(""),n.clearSearch()},[n]),f=b.useCallback(p=>{n.selectNode(p)},[n]),m=b.useCallback(p=>{l(""),n.loadRecent(p||void 0)},[n]);return r.jsxs("div",{className:jn.nav,"data-testid":"knowledge-nav",children:[r.jsxs("form",{className:jn.searchForm,onSubmit:c,children:[r.jsx("input",{className:jn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:p=>{l(p.target.value)},"data-testid":"knowledge-search-input"}),r.jsx("button",{type:"submit",className:jn.searchButton,disabled:n.loading,children:"Go"})]}),n.searchQuery&&r.jsx("button",{type:"button",className:jn.clearButton,onClick:d,children:"Clear search"}),r.jsxs("select",{className:jn.workspaceSelect,onChange:p=>{m(p.target.value)},"data-testid":"knowledge-workspace-filter",children:[r.jsx("option",{value:"",children:"All workspaces"}),a.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]}),r.jsxs("div",{className:jn.listHeader,children:["Nodes (",n.graphData.nodes.length,")"]}),r.jsx("ul",{className:jn.nodeList,children:n.graphData.nodes.map(p=>r.jsxs("li",{className:jn.nodeItem,onClick:()=>{f(p.id)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),f(p.id))},role:"button",tabIndex:0,children:[r.jsx("span",{className:jn.indicator,style:{backgroundColor:p.kind==="reference"?"#4A9EFF":p.category==="decision"?"#22C55E":p.category==="concept"?"#A855F7":p.category==="snippet"?"#6B7280":"#EAB308"}}),r.jsx("span",{className:jn.label,children:p.label}),r.jsx("span",{className:jn.badge,children:p.kind==="reference"?p.sourceType:p.category})]},p.id))})]})}function EA(){const{workspaces:n,tasks:a}=rt(),i=b.useMemo(()=>r.jsx(eA,{workspaces:n,tasks:a}),[n,a]);return fc(i),r.jsx(ws,{})}function AA(){const{environments:n}=rt(),a=b.useMemo(()=>r.jsx(uA,{environments:n}),[n]);return fc(a),r.jsx(ws,{})}function DA(){const n=b.useMemo(()=>r.jsx(pA,{}),[]);return fc(n),r.jsx(ws,{})}function RA(){const n=b.useMemo(()=>r.jsx(wA,{}),[]);return fc(n),r.jsx(ws,{})}const MA="_bar_tnfsh_1",OA="_btnPrimary_tnfsh_32",BA="_statusText_tnfsh_85",LA="_statusCompleted_tnfsh_90",IA="_statusFailed_tnfsh_94",zA="_statusBlocked_tnfsh_98",UA="_hintText_tnfsh_103",ut={bar:MA,btnPrimary:OA,statusText:BA,statusCompleted:LA,statusFailed:IA,statusBlocked:zA,hintText:UA};function VA({sessions:n,tasks:a,environments:i}){const l=Rt(),c=wt(),d=St("/sessions/:sessionId"),f=St("/tasks/:taskId"),m=St("/tasks/:taskId/stream"),p=St("/tasks/:taskId/findings"),v=St("/tasks/:taskId/edit"),g=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=St("/sessions/new"),j=St("/environments/:environmentId/workspaces/:workspaceId"),N=St("/tasks/new"),C=St("/chat"),w=St("/"),A=St("/settings/*"),R=d==null?void 0:d.params.sessionId,E=(f==null?void 0:f.params.taskId)??(m==null?void 0:m.params.taskId)??(p==null?void 0:p.params.taskId)??(g==null?void 0:g.params.taskId)??(y==null?void 0:y.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),H=g??y??x??S,z=(H==null?void 0:H.params.environmentId)??(j==null?void 0:j.params.environmentId),I=c.pathname.startsWith("/environments")&&!j&&!H,P=!!C,ee=!!T,ne=!!j&&!g&&!y&&!x&&!S,ce=!!N;if(!!w&&!ee&&!ne&&!ce||!!A||(!!v||!!S)||ce||I||ee)return r.jsx(r.Fragment,{});if(P)return i.find($=>$.adapterType==="local"&&$.status==="connected")?r.jsx(r.Fragment,{}):r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Add a local environment to start chatting"})});if(ne)return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Select a task or click + to create one"})});if(E){const O=a.find(oe=>oe.id===E);if(!O)return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Loading..."})});const $=new Map(a.map(oe=>[oe.id,oe])),se=O.dependsOn.some(oe=>{const Y=$.get(oe);return Y!==void 0&&Y.status!=="complete"});if(O.status==="not_started"){const oe=se?O.dependsOn.map(Y=>$.get(Y)).filter(Y=>Y&&Y.status!=="complete").map(Y=>Y.title):[];return r.jsx("div",{className:ut.bar,children:se?r.jsxs("span",{className:ut.statusBlocked,children:["Blocked by: ",oe.join(", ")]}):r.jsx("span",{className:ut.hintText,children:"Use the buttons above to start or manage this task"})})}if(O.status==="working"||O.status==="paused"){const oe=O.latestSessionId||void 0,Y=oe?n.find(Ne=>Ne.id===oe):void 0;return Y&&Y.status!=="stopped"?r.jsx(r.Fragment,{}):r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Waiting for agent..."})})}if(O.status==="complete")return r.jsxs("div",{className:ut.bar,children:[r.jsx("span",{className:`${ut.statusText} ${ut.statusCompleted}`,children:"Task completed"}),r.jsx("button",{onClick:()=>l(zi(O.workspaceId,void 0,z)),className:ut.btnPrimary,children:"+ New Task"})]});if(O.status==="failed")return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:`${ut.statusText} ${ut.statusFailed}`,children:"Task failed"})})}if(R){const O=n.find(oe=>oe.id===R),$=(O==null?void 0:O.status)==="stopped";if(O!==void 0&&!$)return r.jsx(r.Fragment,{});if($)return r.jsxs("div",{className:ut.bar,children:[r.jsxs("span",{className:`${ut.statusText} ${ut.hintText}`,children:["Session ",O.endReason||O.status]}),r.jsx("button",{onClick:()=>l(Z0(O.environmentId)),className:ut.btnPrimary,children:"+ New Chat"})]})}return r.jsx("div",{className:ut.bar,children:r.jsx("span",{className:ut.hintText,children:"Loading..."})})}const HA="_toast_da8ll_1",GA="_success_da8ll_18",PA="_icon_da8ll_22",$A="_error_da8ll_25",qA="_warning_da8ll_32",YA="_info_da8ll_38",KA="_message_da8ll_53",FA="_close_da8ll_60",Uo={toast:HA,success:GA,icon:PA,error:$A,warning:qA,info:YA,message:KA,close:FA},ZA={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function XA({toast:n,onDismiss:a}){return b.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),r.jsxs(Tt.div,{className:`${Uo.toast} ${Uo[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:[r.jsx("span",{className:Uo.icon,"aria-hidden":"true",children:ZA[n.variant]}),r.jsx("span",{className:Uo.message,children:n.message}),r.jsx("button",{type:"button",className:Uo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const QA="_container_qqse2_1",WA={container:QA};function JA(){const{toasts:n,dismissToast:a}=Es();return r.jsx("div",{className:WA.container,"data-testid":"toast-container",children:r.jsx(Kn,{children:n.map(i=>r.jsx(XA,{toast:i,onDismiss:a},i.id))})})}const eD="_breadcrumbs_17or2_1",tD="_list_17or2_11",nD="_item_17or2_21",aD="_separator_17or2_28",sD="_link_17or2_34",iD="_current_17or2_57",xi={breadcrumbs:eD,list:tD,item:nD,separator:aD,link:sD,current:iD},oD="›";function Ds({segments:n}){return r.jsx("nav",{className:xi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:r.jsx("ol",{className:xi.list,children:n.map((a,i)=>{const l=i===n.length-1;return r.jsxs("li",{className:xi.item,children:[i>0&&r.jsx("span",{className:xi.separator,"aria-hidden":"true",children:oD}),a.url&&!l?r.jsx(Hf,{className:xi.link,to:a.url,title:a.label,children:a.label}):r.jsx("span",{className:xi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Af(){Af=function(c,d){return new i(c,void 0,d)};var n=RegExp.prototype,a=new WeakMap;function i(c,d,f){var m=new RegExp(c,d);return a.set(m,f||a.get(c)),oc(m,i.prototype)}function l(c,d){var f=a.get(d);return Object.keys(f).reduce(function(m,p){var v=f[p];if(typeof v=="number")m[p]=c[v];else{for(var g=0;c[v[g]]===void 0&&g+1<v.length;)g++;m[p]=c[v[g]]}return m},Object.create(null))}return(function(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),d&&oc(c,d)})(i,RegExp),i.prototype.exec=function(c){var d=n.exec.call(this,c);if(d){d.groups=l(d,this);var f=d.indices;f&&(f.groups=l(f,this))}return d},i.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var f=a.get(this);return n[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(p,v){var g=f[v];return"$"+(Array.isArray(g)?g.join("$"):g)}))}if(typeof d=="function"){var m=this;return n[Symbol.replace].call(this,c,function(){var p=arguments;return typeof p[p.length-1]!="object"&&(p=[].slice.call(p)).push(l(p,m)),d.apply(this,p)})}return n[Symbol.replace].call(this,c,d)},Af.apply(this,arguments)}function oc(n,a){return oc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},oc(n,a)}function m0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function ef(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(c,d){if(c){if(typeof c=="string")return m0(c,d);var f=Object.prototype.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?m0(c,d):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var lD=(function(n){return function(a){return a===void 0&&(a={}),(function(l,c){if(c&&!l.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){m1(l,"element",i)};function i(l,c,d){var f,m;if(d&&d.tagName==="pre"&&l.tagName==="code"){var p=(l==null||(f=l.data)==null?void 0:f.meta)||(l==null||(m=l.properties)==null?void 0:m.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var v,g,y=(function(E){for(var H,z=ef(E.properties.className);!(H=z()).done;){var I=H.value;if(I.slice(0,9)==="language-")return I.slice(9).toLowerCase()}return null})(l);if(!y&&a.defaultLanguage&&l.properties.className.push("language-"+(y=a.defaultLanguage)),l.properties.className.push("code-highlight"),y)try{var x,S;S=(x=y)!=null&&x.includes("diff-")?y.split("-")[1]:y,v=n.highlight(Ar(l),S),d.properties.className=(d.properties.className||[]).concat("language-"+S)}catch(E){if(!a.ignoreMissing||!/Unknown language/.test(E.message))throw E;v=l}else v=l;v.children=(g=1,function E(H){return H.reduce(function(z,I){if(I.type==="text"){var P=I.value,ee=(P.match(/\n/g)||"").length;if(ee===0)I.position={start:{line:g,column:1},end:{line:g,column:1}},z.push(I);else for(var ne,ce=P.split(`
100
- `),re=ef(ce.entries());!(ne=re()).done;){var K=ne.value,ae=K[0],O=K[1];z.push({type:"text",value:ae===ce.length-1?O:O+`
101
- `,position:{start:{line:g+ae,column:1},end:{line:g+ae,column:1}}})}return g+=ee,z}if(Object.prototype.hasOwnProperty.call(I,"children")){var $=g;return I.children=E(I.children),z.push(I),I.position={start:{line:$,column:1},end:{line:g,column:1}},z}return z.push(I),z},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,j=(function(E){var H=/{([\d,-]+)}/,z=E.split(",").map(function(ee){return ee.trim()}).join();if(H.test(z)){var I=H.exec(z)[1],P=v1(I);return function(ee){return P.includes(ee+1)}}return function(){return!1}})(p),N=(function(E){var H=Af(/showLineNumbers=(\d+)/i,{lines:1});if(H.test(E)){var z=H.exec(E);return Number(z.groups.lines)}return 1})(p),C=(function(E){for(var H=new Array(E),z=0;z<E;z++)H[z]={type:"element",tagName:"span",properties:{className:[]},children:[]};return H})(v.position.end.line),w=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],A=function(){var E,H,z=T.value,I=z[0],P=z[1];P.properties.className=["code-line"];var ee=g1(v,function(ne){return ne.position.start.line<=I+1&&ne.position.end.line>=I+1});P.children=ee.children,(p.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(y))&&!w.some(function(ne){return p.toLowerCase().includes(ne)})&&(P.properties.line=[(I+N).toString()],P.properties.className.push("line-number")),j(I)&&P.properties.className.push("highlight-line"),(y==="diff"||(E=y)!=null&&E.includes("diff-"))&&Ar(P).substring(0,1)==="-"?P.properties.className.push("deleted"):(y==="diff"||(H=y)!=null&&H.includes("diff-"))&&Ar(P).substring(0,1)==="+"&&P.properties.className.push("inserted")},R=ef(C.entries());!(T=R()).done;)A();C.length>0&&Ar(C[C.length-1]).trim()===""&&C.pop(),l.children=C}}}})(p1);function $x(n){if(n>=1e6)return`${(n/1e6).toFixed(1)}M`;if(n>=1e3){const a=Number((n/1e3).toFixed(1));return a>=1e3?`${(n/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(n)}function Bi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const rD="_systemContextEvent_1qbiw_1",cD="_systemContextHeader_1qbiw_7",uD="_systemContextBadge_1qbiw_28",dD="_systemContextToggle_1qbiw_37",fD="_systemContextPre_1qbiw_43",hD="_systemContextEllipsis_1qbiw_54",mD="_systemEvent_1qbiw_58",pD="_systemTimestamp_1qbiw_65",vD="_textEvent_1qbiw_69",gD="_toolUseEvent_1qbiw_155",yD="_toolUseHeader_1qbiw_175",bD="_toolUsePrefix_1qbiw_182",xD="_toolUseName_1qbiw_187",_D="_toolUseArgs_1qbiw_192",SD="_toolResultEvent_1qbiw_203",TD="_toolResultHeader_1qbiw_208",kD="_toolResultIndicatorOk_1qbiw_232",CD="_toolResultIndicatorError_1qbiw_239",jD="_toolResultLabel_1qbiw_246",ND="_toolResultToggle_1qbiw_250",wD="_toolResultCommand_1qbiw_256",ED="_toolResultEllipsis_1qbiw_266",AD="_toolResultPre_1qbiw_270",DD="_errorEvent_1qbiw_291",RD="_statusEvent_1qbiw_299",MD="_userInputEvent_1qbiw_308",OD="_userInputContent_1qbiw_314",BD="_signalEvent_1qbiw_331",LD="_signalBadge_1qbiw_342",ID="_signalContent_1qbiw_351",zD="_usageEvent_1qbiw_356",UD="_usageBadge_1qbiw_363",VD="_defaultEvent_1qbiw_372",Ve={systemContextEvent:rD,systemContextHeader:cD,systemContextBadge:uD,systemContextToggle:dD,systemContextPre:fD,systemContextEllipsis:hD,systemEvent:mD,systemTimestamp:pD,textEvent:vD,toolUseEvent:gD,toolUseHeader:yD,toolUsePrefix:bD,toolUseName:xD,toolUseArgs:_D,toolResultEvent:SD,toolResultHeader:TD,toolResultIndicatorOk:kD,toolResultIndicatorError:CD,toolResultLabel:jD,toolResultToggle:ND,toolResultCommand:wD,toolResultEllipsis:ED,toolResultPre:AD,errorEvent:DD,statusEvent:RD,userInputEvent:MD,userInputContent:OD,signalEvent:BD,signalBadge:LD,signalContent:ID,usageEvent:zD,usageBadge:UD,defaultEvent:VD},p0=3;function HD({content:n}){const[a,i]=b.useState(!1),l=n.split(`
102
- `),c=l.length>p0,d=a?n:l.slice(0,p0).join(`
103
- `);return r.jsxs("div",{className:Ve.systemContextEvent,"data-testid":"system-context-event",children:[r.jsxs("button",{type:"button",className:Ve.systemContextHeader,onClick:()=>{i(f=>!f)},"aria-expanded":a,children:[r.jsx("span",{className:Ve.systemContextBadge,children:"SYSTEM PROMPT"}),c&&r.jsx("span",{className:Ve.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),r.jsxs("pre",{className:Ve.systemContextPre,children:[d,!a&&c&&r.jsx("span",{className:Ve.systemContextEllipsis,children:"…"})]})]})}function GD({time:n,content:a}){return r.jsxs("div",{className:Ve.systemEvent,children:[r.jsxs("span",{className:Ve.systemTimestamp,children:["[",n,"]"]})," ",a]})}function PD({content:n}){return r.jsx("div",{className:Ve.textEvent,children:r.jsx(Rf,{remarkPlugins:[Mf],rehypePlugins:[lD],children:n})})}function $D({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return r.jsxs("div",{className:Ve.toolUseEvent,children:[r.jsxs("div",{className:Ve.toolUseHeader,children:[r.jsx("span",{className:Ve.toolUsePrefix,children:">"}),a?r.jsx("span",{className:Ve.toolUseName,children:a}):null]}),r.jsx("pre",{className:Ve.toolUseArgs,children:i})]})}const v0=5;function qD(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 l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function YD({content:n,raw:a,toolUseCtx:i}){const[l,c]=b.useState(!1);let d=!1;if(a)try{d=JSON.parse(a).is_error===!0}catch{}const f=n.split(`
104
- `),m=f.length>v0,p=l?n:f.slice(0,v0).join(`
105
- `),g=((i==null?void 0:i.tool)??"")||(d?"Tool error":"Tool output"),y=i?qD(i.tool,i.args):"",x=r.jsxs(r.Fragment,{children:[r.jsx("span",{className:d?Ve.toolResultIndicatorError:Ve.toolResultIndicatorOk,"aria-label":d?"error":"success","data-testid":d?"tool-result-indicator-error":"tool-result-indicator-ok",children:d?"✗":"✓"}),r.jsx("span",{className:Ve.toolResultLabel,"data-testid":"tool-result-label",children:g}),m&&r.jsx("span",{className:Ve.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return r.jsxs("div",{className:Ve.toolResultEvent,"data-testid":"tool-result",children:[m?r.jsx("button",{className:Ve.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{c(S=>!S)},"aria-expanded":l,children:x}):r.jsx("div",{className:Ve.toolResultHeader,"data-testid":"tool-result-header",children:x}),y&&r.jsx("div",{className:Ve.toolResultCommand,children:y}),r.jsxs("pre",{className:Ve.toolResultPre,"data-testid":"tool-result-content",children:[p,!l&&m&&r.jsx("span",{className:Ve.toolResultEllipsis,children:"…"})]})]})}function KD({content:n}){return r.jsxs("div",{className:Ve.errorEvent,children:["Error: ",n]})}function FD({content:n}){return r.jsxs("div",{className:Ve.statusEvent,children:["--- ",n," ---"]})}function ZD({content:n}){return r.jsx("div",{className:Ve.userInputEvent,children:r.jsx("span",{className:Ve.userInputContent,children:n})})}function XD({content:n}){return r.jsxs("div",{className:Ve.signalEvent,"data-testid":"signal-event",children:[r.jsx("span",{className:Ve.signalBadge,children:"SIGNAL"}),r.jsx("span",{className:Ve.signalContent,children:n})]})}function QD({content:n}){let a=n;try{const i=JSON.parse(n),l=Number(i.input_tokens)||0,c=Number(i.output_tokens)||0,d=$x(l+c),f=Bi(Number(i.cost_usd)||0);a=`${d} tokens · ${f}`}catch{}return r.jsx("div",{className:Ve.usageEvent,"data-testid":"usage-event",children:r.jsx("span",{className:Ve.usageBadge,children:a})})}function WD({content:n}){return r.jsx("div",{className:Ve.defaultEvent,children:n})}function JD({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 r.jsx(HD,{content:n.content})}catch{}return r.jsx(GD,{time:i,content:n.content})}case"text":case"output":return r.jsx(PD,{content:n.content});case"tool_use":return r.jsx($D,{content:n.content});case"tool_result":return r.jsx(YD,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return r.jsx(KD,{content:n.content});case"status":return r.jsx(FD,{content:n.content});case"user_input":return r.jsx(ZD,{content:n.content});case"signal":return r.jsx(XD,{content:n.content});case"usage":return r.jsx(QD,{content:n.content});default:return r.jsx(WD,{content:n.content})}}const eR="_overlay_cmicx_1",tR="_dialog_cmicx_11",nR="_title_cmicx_30",aR="_description_cmicx_38",sR="_actions_cmicx_45",iR="_cancelButton_cmicx_52",oR="_confirmButton_cmicx_79",ys={overlay:eR,dialog:tR,title:nR,description:aR,actions:sR,cancelButton:iR,confirmButton:oR};function bc({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:c,onCancel:d}){const f=b.useId(),m=b.useId();return r.jsx(Kn,{children:n&&r.jsx(Tt.div,{className:ys.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:p=>{p.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":i?m:void 0,children:r.jsxs(Tt.div,{className:ys.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:p=>p.stopPropagation(),children:[r.jsx("h3",{id:f,className:ys.title,children:a}),i&&r.jsx("p",{id:m,className:ys.description,children:i}),r.jsxs("div",{className:ys.actions,children:[r.jsx("button",{type:"button",className:ys.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:ys.confirmButton,onClick:c,children:l})]})]})})})}const lR="_spinner_1uyt1_1",rR="_spin_1uyt1_1",cR="_sm_1uyt1_14",uR="_md_1uyt1_20",dR="_lg_1uyt1_26",fR="_xl_1uyt1_32",g0={spinner:lR,spin:rR,sm:cR,md:uR,lg:dR,xl:fR};function qx({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return r.jsx("span",{className:`${g0.spinner} ${g0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const hR="_splash_1bn1g_1",mR="_logo_1bn1g_11",y0={splash:hR,logo:mR};function Yx(){return r.jsxs("div",{className:y0.splash,"data-testid":"splash-screen",children:[r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:y0.logo}),r.jsx(qx,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function pR(n,a){const i=b.useRef(null);b.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const c=new Map;for(const f of l)c.set(f.id,f);const d=new Set;for(const f of n){d.add(f.id);const m=c.get(f.id);if(m&&m.status!==f.status&&f.status!=="sleeping"){if(f.status==="connecting"){a("Provisioning environment…","info");continue}f.status==="connected"?a("Environment connected","success"):f.status==="error"?a("Environment provision failed","error"):f.status==="disconnected"&&(m.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const f of l)d.has(f.id)||a("Environment removed","info")},[n,a])}function vR(n,a,i){const l=n.filter(p=>p.status==="running"||p.status==="idle"||p.status==="waiting").length,c=Kx(a),d=a.filter(p=>Df(p,c)).length,f=a.filter(p=>p.status==="paused"||p.status==="failed"||Df(p,c)).length,m=i.filter(p=>p.status==="disconnected"||p.status==="error").length;return{activeSessions:l,blockedTasks:d,attentionTasks:f,unhealthyEnvironments:m}}function Kx(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Df(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function gR(n,a){var f;const i=new Map;for(const m of a)i.set(m.id,m);const l=Kx(n),c=[];for(const m of n){const p=m.workspaceId?((f=i.get(m.workspaceId))==null?void 0:f.name)??"Unknown":"Unknown";m.status==="failed"?c.push({task:m,reason:"failed",workspaceName:p}):Df(m,l)?c.push({task:m,reason:"blocked",workspaceName:p}):m.status==="paused"&&c.push({task:m,reason:"paused",workspaceName:p})}const d={failed:0,blocked:1,paused:2};return c.sort((m,p)=>(d[m.reason]??3)-(d[p.reason]??3)),c}function yR(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var c;return{session:l,environmentName:((c=i.get(l.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function bR(n,a,i){const l=new Map;for(const c of a){if(!c.workspaceId)continue;let d=l.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(c.workspaceId,d)),d.totalTasks+=1,c.status==="complete"?d.completedTasks+=1:c.status==="working"?d.workingTasks+=1:c.status==="failed"&&(d.failedTasks+=1)}return n.map(c=>{const d=l.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const xR="_dashboard_16pzm_1",_R="_kpiStrip_16pzm_11",SR="_kpiCard_16pzm_23",TR="_kpiValue_16pzm_68",kR="_kpiLabel_16pzm_76",CR="_bodyGrid_16pzm_84",jR="_section_16pzm_96",NR="_sectionHeader_16pzm_109",wR="_sectionIcon_16pzm_118",ER="_sectionTitle_16pzm_123",AR="_sectionCount_16pzm_131",DR="_sectionBody_16pzm_138",RR="_emptyHint_16pzm_143",MR="_sessionRow_16pzm_150",OR="_sessionPrompt_16pzm_177",BR="_sessionEnv_16pzm_186",LR="_sessionRuntime_16pzm_192",IR="_sessionStatus_16pzm_198",zR="_statusDot_16pzm_207",UR="_attentionRow_16pzm_233",VR="_attentionTitle_16pzm_259",HR="_attentionMeta_16pzm_267",GR="_reasonBadge_16pzm_274",PR="_bottomGrid_16pzm_301",$R="_envRow_16pzm_312",qR="_envName_16pzm_323",YR="_envStatusBadge_16pzm_333",KR="_workspaceRow_16pzm_369",FR="_workspaceTop_16pzm_395",ZR="_workspaceName_16pzm_401",XR="_workspaceCounts_16pzm_407",QR="_progressBar_16pzm_415",WR="_progressFill_16pzm_422",pe={dashboard:xR,kpiStrip:_R,kpiCard:SR,kpiValue:TR,kpiLabel:kR,bodyGrid:CR,section:jR,sectionHeader:NR,sectionIcon:wR,sectionTitle:ER,sectionCount:AR,sectionBody:DR,emptyHint:RR,sessionRow:MR,sessionPrompt:OR,sessionEnv:BR,sessionRuntime:LR,sessionStatus:IR,statusDot:zR,attentionRow:UR,attentionTitle:VR,attentionMeta:HR,reasonBadge:GR,bottomGrid:PR,envRow:$R,envName:qR,envStatusBadge:YR,workspaceRow:KR,workspaceTop:FR,workspaceName:ZR,workspaceCounts:XR,progressBar:QR,progressFill:WR},JR={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Vr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function eM(n,a,i,l){const c=[`${n} of ${a} tasks completed`];return i>0&&c.push(`${i} in progress`),l>0&&c.push(`${l} failed`),c.join(", ")}function Hr({value:n,label:a,accent:i,index:l,testId:c}){return r.jsxs(Tt.div,{className:pe.kpiCard,"data-accent":i,"data-testid":c,variants:JR,initial:"hidden",animate:"visible",custom:l,children:[r.jsx("span",{className:pe.kpiValue,children:n}),r.jsx("span",{className:pe.kpiLabel,children:a})]})}function tM(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:c}=rt(),d=Rt(),f=b.useRef(new Set);b.useEffect(()=>{for(const y of n)f.current.has(y.id)||(f.current.add(y.id),c(y.id))},[n,c]);const m=b.useMemo(()=>vR(i,a,l),[i,a,l]),p=b.useMemo(()=>yR(i,l),[i,l]),v=b.useMemo(()=>gR(a,n),[a,n]),g=b.useMemo(()=>bR(n,a),[n,a,l]);return r.jsxs("div",{className:pe.dashboard,"data-testid":"dashboard",children:[r.jsxs("div",{className:pe.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[r.jsx(Hr,{value:m.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),r.jsx(Hr,{value:m.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),r.jsx(Hr,{value:m.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),r.jsx(Hr,{value:m.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),r.jsxs("div",{className:pe.bodyGrid,children:[r.jsxs(Tt.div,{className:pe.section,variants:Vr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"●"}),r.jsx("span",{className:pe.sectionTitle,children:"Active Sessions"}),r.jsx("span",{className:pe.sectionCount,children:p.length})]}),r.jsx("div",{className:pe.sectionBody,children:p.length===0?r.jsx("div",{className:pe.emptyHint,children:"No active sessions"}):p.map(({session:y,environmentName:x})=>r.jsxs("button",{type:"button",className:pe.sessionRow,onClick:()=>d(F0(y.id)),"data-testid":"session-row",children:[r.jsx("span",{className:pe.sessionPrompt,title:y.prompt,children:y.prompt||"—"}),r.jsx("span",{className:pe.sessionEnv,children:x}),r.jsx("span",{className:pe.sessionRuntime,children:y.runtime}),r.jsxs("span",{className:pe.sessionStatus,children:[r.jsx("span",{className:pe.statusDot,"data-status":y.status}),y.status]})]},y.id))})]}),r.jsxs(Tt.div,{className:pe.section,variants:Vr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"⚑"}),r.jsx("span",{className:pe.sectionTitle,children:"Needs Attention"}),r.jsx("span",{className:pe.sectionCount,children:v.length})]}),r.jsx("div",{className:pe.sectionBody,children:v.length===0?r.jsx("div",{className:pe.emptyHint,children:"All clear"}):v.map(({task:y,reason:x,workspaceName:S})=>r.jsxs("button",{type:"button",className:pe.attentionRow,onClick:()=>d(ya(y.id)),"data-testid":"attention-row",children:[r.jsxs("div",{className:pe.attentionTitle,children:[r.jsx("span",{className:pe.reasonBadge,"data-reason":x,children:x}),y.title]}),r.jsx("div",{className:pe.attentionMeta,children:r.jsx("span",{children:S})})]},y.id))})]})]}),r.jsxs("div",{className:pe.bottomGrid,children:[r.jsxs(Tt.div,{className:pe.section,variants:Vr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"◈"}),r.jsx("span",{className:pe.sectionTitle,children:"Environment Health"}),r.jsx("span",{className:pe.sectionCount,children:l.length})]}),r.jsx("div",{className:pe.sectionBody,children:l.length===0?r.jsx("div",{className:pe.emptyHint,children:"No environments configured"}):l.map(y=>r.jsxs("div",{className:pe.envRow,"data-testid":"dashboard-env-row",children:[r.jsx("span",{className:pe.envName,children:y.displayName}),r.jsx("span",{className:pe.envStatusBadge,"data-status":y.status,children:y.status})]},y.id))})]}),r.jsxs(Tt.div,{className:pe.section,variants:Vr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[r.jsxs("div",{className:pe.sectionHeader,children:[r.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"▦"}),r.jsx("span",{className:pe.sectionTitle,children:"Workspaces"}),r.jsx("span",{className:pe.sectionCount,children:n.length})]}),r.jsx("div",{className:pe.sectionBody,children:g.length===0?r.jsx("div",{className:pe.emptyHint,children:"No workspaces yet"}):g.map(({workspace:y,totalTasks:x,completedTasks:S,workingTasks:T,failedTasks:j})=>{const N=x>0?Math.round(S/x*100):0;return r.jsxs("button",{type:"button",className:pe.workspaceRow,onClick:()=>d(Ei(y.id,y.environmentId)),"data-testid":"workspace-row",children:[r.jsxs("div",{className:pe.workspaceTop,children:[r.jsx("span",{className:pe.workspaceName,children:y.name}),r.jsxs("span",{className:pe.workspaceCounts,"aria-label":eM(S,x,T,j),children:[S,"/",x,T>0&&r.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",T]}),j>0&&r.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",j]})]})]}),x>0&&r.jsx("div",{className:pe.progressBar,children:r.jsx("div",{className:pe.progressFill,style:{width:`${N}%`}})})]},y.id)})})]})]})]})}const nM="_panelContainer_aei9x_1",aM="_emptyState_aei9x_8",sM="_fadeIn_aei9x_1",iM="_workspaceSummary_aei9x_17",oM="_workspaceSummaryTitle_aei9x_28",lM="_workspaceSummarySubtitle_aei9x_32",rM="_header_aei9x_36",cM="_headerInfo_aei9x_69",uM="_killButton_aei9x_75",dM="_headerTitle_aei9x_104",fM="_headerActions_aei9x_119",hM="_taskStatusBadge_aei9x_126",mM="_taskBranch_aei9x_135",pM="_taskBlockedBadge_aei9x_141",vM="_btnPrimary_aei9x_149",gM="_btnDanger_aei9x_180",yM="_btnGhost_aei9x_219",bM="_rejectInput_aei9x_245",xM="_tabBar_aei9x_275",_M="_tab_aei9x_275",SM="_active_aei9x_301",TM="_eventScroll_aei9x_306",kM="_tabContent_aei9x_312",CM="_noContext_aei9x_317",jM="_overviewContent_aei9x_323",NM="_overviewDashboard_aei9x_332",wM="_overviewHero_aei9x_338",EM="_statusBadge_aei9x_345",AM="_statusPending_aei9x_357",DM="_statusAssigned_aei9x_362",RM="_statusInProgress_aei9x_367",MM="_statusReview_aei9x_372",OM="_statusDone_aei9x_377",BM="_statusFailed_aei9x_382",LM="_statusWaitingInput_aei9x_387",IM="_overviewBranchPill_aei9x_392",zM="_branchLink_aei9x_407",UM="_overviewSection_aei9x_418",VM="_overviewLabel_aei9x_424",HM="_overviewValue_aei9x_431",GM="_overviewMuted_aei9x_436",PM="_overviewMarkdown_aei9x_442",$M="_envRow_aei9x_511",qM="_envDot_aei9x_517",YM="_envDotGreen_aei9x_524",KM="_envDotYellow_aei9x_528",FM="_envDotRed_aei9x_532",ZM="_envDotGray_aei9x_536",XM="_depList_aei9x_540",QM="_depItem_aei9x_546",WM="_depBlocked_aei9x_553",JM="_depDone_aei9x_557",e3="_timeline_aei9x_561",t3="_timelineRow_aei9x_567",n3="_timelineKey_aei9x_574",a3="_timelineValue_aei9x_580",s3="_timelineDelta_aei9x_584",i3="_reviewNotes_aei9x_595",o3="_overviewDescription_aei9x_606",l3="_waitingMessage_aei9x_612",r3="_errorMessage_aei9x_616",c3="_eventOverflowWarning_aei9x_620",u3="_attemptSelector_aei9x_634",d3="_attemptLabel_aei9x_650",f3="_attemptButton_aei9x_654",h3="_attemptActive_aei9x_671",m3="_attemptStatus_aei9x_677",p3="_emptyCta_aei9x_683",v3="_ctaTitle_aei9x_695",g3="_ctaDescription_aei9x_701",y3="_ctaButton_aei9x_708",b3="_ctaCreateForm_aei9x_743",x3="_ctaCreateInput_aei9x_749",_3="_ctaCreateOk_aei9x_780",S3="_ctaLink_aei9x_815",T3="_workspaceHeader_aei9x_829",k3="_workspaceName_aei9x_854",C3="_workspaceMeta_aei9x_867",j3="_metaRow_aei9x_875",N3="_metaLabel_aei9x_888",w3="_metaValue_aei9x_903",E3="_archiveButton_aei9x_913",A3="_repoLink_aei9x_943",D3="_metaToggle_aei9x_953",R3="_metaToggleArrow_aei9x_974",M3="_metaToggleArrowOpen_aei9x_979",O3="_progressBarContainer_aei9x_983",B3="_progressBar_aei9x_983",L3="_progressFill_aei9x_999",I3="_progressLabel_aei9x_1006",z3="_metaTimestamps_aei9x_1013",U3="_metaTimestamp_aei9x_1013",L={panelContainer:nM,emptyState:aM,fadeIn:sM,workspaceSummary:iM,workspaceSummaryTitle:oM,workspaceSummarySubtitle:lM,header:rM,headerInfo:cM,killButton:uM,headerTitle:dM,headerActions:fM,taskStatusBadge:hM,taskBranch:mM,taskBlockedBadge:pM,btnPrimary:vM,btnDanger:gM,btnGhost:yM,rejectInput:bM,tabBar:xM,tab:_M,active:SM,eventScroll:TM,tabContent:kM,noContext:CM,overviewContent:jM,overviewDashboard:NM,overviewHero:wM,statusBadge:EM,statusPending:AM,statusAssigned:DM,statusInProgress:RM,statusReview:MM,statusDone:OM,statusFailed:BM,statusWaitingInput:LM,overviewBranchPill:IM,branchLink:zM,overviewSection:UM,overviewLabel:VM,overviewValue:HM,overviewMuted:GM,overviewMarkdown:PM,envRow:$M,envDot:qM,envDotGreen:YM,envDotYellow:KM,envDotRed:FM,envDotGray:ZM,depList:XM,depItem:QM,depBlocked:WM,depDone:JM,timeline:e3,timelineRow:t3,timelineKey:n3,timelineValue:a3,timelineDelta:s3,reviewNotes:i3,overviewDescription:o3,waitingMessage:l3,errorMessage:r3,eventOverflowWarning:c3,attemptSelector:u3,attemptLabel:d3,attemptButton:f3,attemptActive:h3,attemptStatus:m3,emptyCta:p3,ctaTitle:v3,ctaDescription:g3,ctaButton:y3,ctaCreateForm:b3,ctaCreateInput:x3,ctaCreateOk:_3,ctaLink:S3,workspaceHeader:T3,workspaceName:k3,workspaceMeta:C3,metaRow:j3,metaLabel:N3,metaValue:w3,archiveButton:E3,repoLink:A3,metaToggle:D3,metaToggleArrow:R3,metaToggleArrowOpen:M3,progressBarContainer:O3,progressBar:B3,progressFill:L3,progressLabel:I3,metaTimestamps:z3,metaTimestamp:U3};function V3(){return r.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function H3(){return r.jsx("div",{className:L.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function G3(){const{workspaces:n,environments:a}=rt(),i=Rt(),l=a.length>0;return n.length>0?r.jsx(tM,{}):r.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[r.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r.jsx("button",{className:L.ctaButton,onClick:()=>i(X0),disabled:!l,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!l&&r.jsx("div",{className:L.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const Fx=50;function P3(n,a,i,l,c=Fx){return l?n<c:a-n-i<c}function $3(n,a){const i=a-n;return i>0?i:0}function q3({scrollRef:n,contentLength:a,isReversed:i}){const[l,c]=b.useState(!0),d=b.useRef(0),f=b.useRef(!1),m=b.useRef(0);b.useEffect(()=>{const v=n.current;if(!v)return;let g=!0;const y=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const x=P3(v.scrollTop,v.scrollHeight,v.clientHeight,i,Fx);x!==g&&(g=x,c(x))}))};return v.addEventListener("scroll",y,{passive:!0}),()=>{v.removeEventListener("scroll",y),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[n,i]),b.useLayoutEffect(()=>{const v=n.current;!v||f.current||(f.current=!0,i?v.scrollTop=0:v.scrollTop=v.scrollHeight,c(!0))},[n,i]),b.useLayoutEffect(()=>{const v=n.current;if(v){if(i&&!l){const g=$3(d.current,v.scrollHeight);g>0&&(v.scrollTop+=g)}l&&(i?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),d.current=v.scrollHeight}},[a,l,i,n]);const p=b.useCallback(()=>{const v=n.current;if(!v)return;const g=i?0:v.scrollHeight;v.scrollTo({top:g,behavior:"smooth"}),c(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:p}}const Y3="_wrapper_p24zt_1",K3="_scrollContainer_p24zt_9",F3="_toolbar_p24zt_15",Z3="_directionToggle_p24zt_22",X3="_scrollToAnchor_p24zt_60",Q3="_scrollToAnchorBottom_p24zt_84",W3="_scrollToAnchorTop_p24zt_88",bs={wrapper:Y3,scrollContainer:K3,toolbar:F3,directionToggle:Z3,scrollToAnchor:X3,scrollToAnchorBottom:Q3,scrollToAnchorTop:W3},Zx="grackle-stream-direction";function J3(){try{return localStorage.getItem(Zx)==="reversed"}catch{return!1}}function e6({eventsDropped:n}){return n<=0?r.jsx(r.Fragment,{}):r.jsxs("div",{className:L.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 jh({events:n,eventsDropped:a,emptyState:i}){const l=b.useRef(null),[c,d]=b.useState(J3),f=v2(),m=b.useMemo(()=>c?[...n].reverse():n,[n,c]),{isAtAnchor:p,scrollToAnchor:v}=q3({scrollRef:l,contentLength:n.length,isReversed:c}),g=()=>{const S=!c;d(S);try{localStorage.setItem(Zx,S?"reversed":"default")}catch{}},y=f?0:.2,x=c?-8:8;return r.jsxs("div",{className:bs.wrapper,children:[r.jsx("div",{className:bs.toolbar,children:r.jsx("button",{className:bs.directionToggle,onClick:g,title:c?"Showing newest first":"Showing oldest first","aria-label":c?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:c?"↓":"↑"})}),r.jsxs("div",{ref:l,className:bs.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,r.jsx(e6,{eventsDropped:a}),r.jsx(Kn,{initial:!1,children:m.map((S,T)=>{const j=c?n.length-1-T:T;return r.jsx(Tt.div,{initial:{opacity:0,y:x},animate:{opacity:1,y:0},transition:{duration:y,ease:"easeOut"},children:r.jsx(JD,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${j}`)})})]}),r.jsx(Kn,{children:!p&&r.jsxs(Tt.button,{className:`${bs.scrollToAnchor} ${c?bs.scrollToAnchorTop:bs.scrollToAnchorBottom}`,onClick:v,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:[c?"↑":"↓"," New events"]})})]})}const t6="_bar_1xhb4_1",n6="_input_1xhb4_32",a6="_select_1xhb4_67",s6="_btnPrimary_1xhb4_103",i6="_btnDanger_1xhb4_134",o6="_btnGhost_1xhb4_173",l6="_badge_1xhb4_195",r6="_disconnectHint_1xhb4_205",Wt={bar:t6,input:n6,select:a6,btnPrimary:s6,btnDanger:i6,btnGhost:o6,badge:l6,disconnectHint:r6};function c6(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function u6({environmentId:n,onReconnect:a}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:Wt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),r.jsx("button",{type:"button",onClick:()=>a(n),className:Wt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function ol({mode:n,sessionId:a,environmentId:i,taskId:l,showStop:c,showPersonaSelect:d,onSessionKill:f,personas:m,environments:p,onSendInput:v,onSpawn:g,onStartTask:y,onProvisionEnvironment:x}){const{showToast:S}=Es(),[T,j]=b.useState(""),[N,C]=b.useState(""),w=c6(i,p),A=R=>{if(R.preventDefault(),!!T.trim())if(n==="send"){if(!a||w)return;v(a,T),j("")}else if(n==="spawn"){if(!i)return;g(i,T,N),S("Session started","success"),j(""),C("")}else{if(!l)return;y(l,void 0,i,T),j("")}};return n==="spawn"?r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[r.jsx("span",{className:Wt.badge,children:"new chat"}),r.jsx("input",{type:"text",value:T,onChange:R=>j(R.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Wt.input}),d&&r.jsxs("select",{value:N,onChange:R=>C(R.target.value),className:Wt.select,children:[r.jsx("option",{value:"",children:"(Default)"}),m.map(R=>r.jsx("option",{value:R.id,children:R.name},R.id))]}),r.jsx("button",{type:"submit",disabled:!T.trim()||!i,className:Wt.btnPrimary,children:"Go"})]}):n==="start"?r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[r.jsx("input",{type:"text",value:T,onChange:R=>j(R.target.value),placeholder:"Type a message...",autoFocus:!0,className:Wt.input}),r.jsx("button",{type:"submit",disabled:!T.trim(),className:Wt.btnPrimary,children:"Send"})]}):r.jsxs("form",{onSubmit:A,className:Wt.bar,children:[w&&i&&r.jsx(u6,{environmentId:i,onReconnect:x}),r.jsx("input",{type:"text",value:T,onChange:R=>j(R.target.value),placeholder:"Type a message...",autoFocus:!w,disabled:w,className:Wt.input}),r.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:r.jsx("button",{type:"submit",disabled:!T.trim()||w,className:Wt.btnPrimary,children:"Send"})}),c&&f&&r.jsx("button",{type:"button",onClick:f,className:Wt.btnDanger,title:"Stop session",children:"Stop"})]})}function Nh(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function wh(n){const a=new Map;for(const d of n)if(d.raw)try{a.set(d,JSON.parse(d.raw))}catch{}const i=new Map;for(const d of n){if(d.eventType!=="tool_use")continue;const f=a.get(d);if(!(!f||typeof f.id!="string"))try{const m=JSON.parse(d.content);i.set(f.id,{tool:m.tool,args:m.args})}catch{}}const l=new Set;return n.map(d=>{if(d.eventType!=="tool_result")return d;const f=a.get(d);if(!f||typeof f.tool_use_id!="string")return d;const m=i.get(f.tool_use_id);return m?(l.add(f.tool_use_id),{...d,toolUseCtx:m}):d}).filter(d=>{if(d.eventType!=="tool_use")return!0;const f=a.get(d);return f&&typeof f.id=="string"?!l.has(f.id):!0})}const d6="_panelContainer_pz4cr_1",f6="_emptyState_pz4cr_8",h6="_emptyTitle_pz4cr_20",m6="_emptyDescription_pz4cr_26",p6="_emptyHint_pz4cr_32",$o={panelContainer:d6,emptyState:f6,emptyTitle:h6,emptyDescription:m6,emptyHint:p6};function v6({hasLocalEnvironment:n}){return r.jsxs("div",{className:$o.emptyState,"data-testid":"chat-empty-state",children:[r.jsx("div",{className:$o.emptyTitle,children:"Welcome to Grackle"}),r.jsx("div",{className:$o.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&&r.jsx("div",{className:$o.emptyHint,children:"Go to Settings → Environments to add one."})]})}function g6(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:c,loadTaskSessions:d,loadSessionEvents:f,kill:m,taskSessions:p,sendInput:v,spawn:g,startTask:y,personas:x,provisionEnvironment:S}=rt(),T=b.useRef(void 0),[j,N]=b.useState(),C=n.find(I=>I.id===Oo),w=C!=null&&C.latestSessionId?a.find(I=>I.id===C.latestSessionId)??(p[Oo]??[]).find(I=>I.id===C.latestSessionId):void 0;b.useEffect(()=>{d(Oo)},[d]),b.useEffect(()=>{C!=null&&C.latestSessionId&&d(Oo)},[C==null?void 0:C.latestSessionId,d]),b.useEffect(()=>{w&&w.id!==T.current&&(T.current=w.id,f(w.id))},[w==null?void 0:w.id,f]);const A=b.useMemo(()=>{if(!w)return[];const I=i.filter(P=>P.sessionId===w.id);return wh(Nh(I))},[i,w==null?void 0:w.id]),R=c.find(I=>I.adapterType==="local"&&I.status==="connected"),E=w!==void 0&&w.status!=="stopped"&&w.status!=="suspended",H=(w==null?void 0:w.status)==="idle";b.useEffect(()=>{j&&w&&H&&(v(w.id,j),N(void 0))},[j,H,w==null?void 0:w.id,v]);const z=b.useCallback((I,P,ee,ne)=>{ne&&N(ne),y(I,P,ee)},[y]);return r.jsxs("div",{className:$o.panelContainer,"data-testid":"chat-page",children:[r.jsx(jh,{events:A,eventsDropped:l,emptyState:r.jsx(v6,{hasLocalEnvironment:!!R})}),R&&E&&r.jsx(ol,{mode:"send",sessionId:w.id,environmentId:w.environmentId,showStop:!0,onSessionKill:()=>m(w.id),personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:y,onProvisionEnvironment:S}),R&&!E&&r.jsx(ol,{mode:"start",taskId:Oo,environmentId:R.id,personas:x,environments:c,onSendInput:v,onSpawn:g,onStartTask:z,onProvisionEnvironment:S})]})}function y6(n,a){const i=[];let l=n;const c=new Set;for(;l&&a.has(l)&&!c.has(l);){c.add(l);const d=a.get(l);i.unshift(d),l=d.parentTaskId||void 0}return i}const js={label:"Home",url:Cs};function b6(n){return n?[js,{label:"Settings",url:Yo},{label:n,url:void 0}]:[js,{label:"Settings",url:void 0}]}const Xx={label:"Environments",url:Ai};function x6(){return[js,{label:"Environments",url:void 0}]}function _6(){return[js,{label:"New Chat",url:void 0}]}function S6(n){return[js,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function T6(n,a,i,l){const c=i.find(f=>f.id===n),d=l.find(f=>f.id===a);return[js,Xx,{label:(d==null?void 0:d.displayName)??"Environment",url:Di(a)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function k6(n,a,i,l,c){const d=y6(n,c),f=c.get(n),m=f==null?void 0:f.workspaceId,p=m?i.find(S=>S.id===m):void 0,v=a??(p==null?void 0:p.environmentId),g=v?l.find(S=>S.id===v):void 0,y=[js];g&&v&&(y.push(Xx),y.push({label:g.displayName,url:Di(v)})),p&&v&&y.push({label:p.name,url:Ei(p.id,v)});for(let S=0;S<d.length-1;S++)y.push({label:d[S].title,url:ya(d[S].id,void 0,m,v)});const x=d[d.length-1];return y.push({label:(x==null?void 0:x.title)??n,url:void 0}),y}function C6(){const n=_6(),[a]=Gf(),i=a.get("env")??"",{sendInput:l,spawn:c,startTask:d,personas:f,environments:m,provisionEnvironment:p}=rt();return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Ds,{segments:n}),r.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"}),r.jsx(ol,{mode:"spawn",environmentId:i,showPersonaSelect:!0,personas:f,environments:m,onSendInput:l,onSpawn:c,onStartTask:d,onProvisionEnvironment:p})]})}function j6({sessionId:n,session:a,isActive:i,onKill:l}){return r.jsxs("div",{className:L.header,children:[r.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.endReason||a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${$x((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Bi(a.costUsd??0)}`:""]}),r.jsxs("span",{className:L.headerInfo,children:[a&&r.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&r.jsx("button",{onClick:()=>l(n),title:"Stop session",className:L.killButton,children:"×"})]})]})}function N6({session:n}){const a=n&&(n.status==="stopped"||n.status==="suspended"),i=a?`Session ${n.endReason||n.status} with no events recorded.`:"Waiting for events...";return r.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function w6(){const{sessionId:n}=Qa(),{events:a,eventsDropped:i,sessions:l,kill:c,loadSessionEvents:d,sendInput:f,spawn:m,startTask:p,personas:v,environments:g,provisionEnvironment:y}=rt(),x=b.useRef(void 0),S=S6(n),T=l.find(C=>C.id===n)??void 0,j=b.useMemo(()=>{const C=n?a.filter(w=>w.sessionId===n):[];return wh(Nh(C))},[a,n]);if(b.useEffect(()=>{n&&n!==x.current&&(x.current=n,d(n))},[n,d]),!n)return r.jsx("div",{className:L.emptyState,children:"No session selected"});const N=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Ds,{segments:S}),r.jsx(j6,{sessionId:n,session:T,isActive:N,onKill:c}),r.jsx(jh,{events:j,eventsDropped:i,emptyState:r.jsx(N6,{session:T})}),N&&r.jsx(ol,{mode:"send",sessionId:n,environmentId:T.environmentId,showStop:!0,onSessionKill:()=>c(n),personas:v,environments:g,onSendInput:f,onSpawn:m,onStartTask:p,onProvisionEnvironment:y})]})}const b0=220,x0=70,E6=40,A6=60,D6="hierarchy",R6="dependency";function M6(n){return b.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new jg.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:E6,ranksep:A6});const i=new Map(n.map(f=>[f.id,f])),l=new Map;for(const f of n)if(f.parentTaskId&&i.has(f.parentTaskId)){const m=l.get(f.parentTaskId)||[];m.push(f),l.set(f.parentTaskId,m)}for(const f of n)a.setNode(f.id,{width:b0,height:x0});const c=[];for(const f of n){if(f.parentTaskId&&i.has(f.parentTaskId)){const m=`hierarchy-${f.parentTaskId}-${f.id}`;a.setEdge(f.parentTaskId,f.id,{},m),c.push({id:m,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:D6},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const m of f.dependsOn)if(i.has(m)){const p=`dependency-${m}-${f.id}`;a.setEdge(m,f.id,{},p),c.push({id:p,source:m,target:f.id,type:"smoothstep",data:{edgeType:R6},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return jg.layout(a),{nodes:n.map(f=>{const m=a.node(f.id),p=l.get(f.id)||[];return{id:f.id,type:"task",position:{x:m.x-b0/2,y:m.y-x0/2},data:{task:f,childCount:p.length,doneChildCount:p.filter(v=>v.status==="complete").length,hasDependencies:f.dependsOn.length>0}}}),edges:c}},[n])}const O6="_dagContainer_js4w6_1",B6="_taskNode_js4w6_26",L6="_taskNodeBorder_js4w6_54",I6="_taskNodeContent_js4w6_60",z6="_taskNodeHeader_js4w6_70",U6="_taskNodeIcon_js4w6_77",V6="_taskNodeTitle_js4w6_82",H6="_taskNodeBadges_js4w6_90",G6="_childBadge_js4w6_95",P6="_depBadge_js4w6_107",$6="_handle_js4w6_119",q6="_emptyCta_js4w6_126",Y6="_ctaDescription_js4w6_137",K6="_ctaButton_js4w6_144",$t={dagContainer:O6,taskNode:B6,taskNodeBorder:L6,taskNodeContent:I6,taskNodeHeader:z6,taskNodeIcon:U6,taskNodeTitle:V6,taskNodeBadges:H6,childBadge:G6,depBadge:P6,handle:$6,emptyCta:q6,ctaDescription:Y6,ctaButton:K6};function F6({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:c}=n,d=Xa(a.status);return r.jsxs("div",{className:$t.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[r.jsx(Ng,{type:"target",position:wg.Top,className:$t.handle}),r.jsx("div",{className:$t.taskNodeBorder,style:{backgroundColor:d.color}}),r.jsxs("div",{className:$t.taskNodeContent,children:[r.jsxs("div",{className:$t.taskNodeHeader,children:[r.jsx("span",{className:$t.taskNodeIcon,style:{color:d.color},children:d.icon}),r.jsx("span",{className:$t.taskNodeTitle,children:a.title})]}),r.jsxs("div",{className:$t.taskNodeBadges,children:[i>0&&r.jsxs("span",{className:$t.childBadge,children:[l,"/",i]}),c&&r.jsx("span",{className:$t.depBadge,children:"dep"})]})]}),r.jsx(Ng,{type:"source",position:wg.Bottom,className:$t.handle})]})}const Z6=_2,X6={task:F6};function Q6({workspaceId:n,environmentId:a,tasks:i}){const l=Rt(),{resolvedThemeId:c}=sb(),d=b.useMemo(()=>i.filter(y=>y.workspaceId===n),[i,n]),{nodes:f,edges:m}=M6(d),p=b.useMemo(()=>{const y=getComputedStyle(document.documentElement),x={};for(const[S,T]of Object.entries(Z6))x[S]=y.getPropertyValue(T).trim()||"#6b7a8d";return x},[c]),v=b.useCallback((y,x)=>{l(ya(x.id,void 0,n,a))},[l,n,a]),g=b.useCallback(y=>{const x=y.data;return p[x.task.status]||p.pending},[p]);return d.length===0?r.jsxs("div",{className:$t.emptyCta,children:[r.jsx("button",{className:$t.ctaButton,onClick:()=>l(zi(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:$t.ctaDescription,children:"Create tasks to see the dependency graph"})]}):r.jsx("div",{className:$t.dagContainer,children:r.jsxs(b1,{nodes:f,edges:m,nodeTypes:X6,onNodeClick:v,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[r.jsx(x1,{variant:_1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),r.jsx(S1,{showInteractive:!1}),r.jsx(T1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function W6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const d of n)if(d.parentTaskId){const f=l.get(d.parentTaskId);f?f.push(d):l.set(d.parentTaskId,[d])}const c=new Map(f0.map(d=>[d,[]]));for(const d of n){const f=Ch(d.status),m=d.dependsOn.length>0&&d.dependsOn.some(T=>a.get(T)!=="complete"),p=l.get(d.id)??[],v=p.length,g=p.filter(T=>T.status==="complete").length;let y;if(f==="paused"&&i){const T=i.get(d.id);T==="idle"?y="Needs input":T==="completed"&&(y="Ready to complete")}const x={task:d,isBlocked:m,childCount:v,doneChildCount:g,pausedSubBadge:y},S=c.get(f);S?S.push(x):c.get("not_started").push(x)}for(const d of c.values())d.sort((f,m)=>f.task.sortOrder-m.task.sortOrder);return f0.map(d=>{const f=Xa(d);return{status:d,label:f.label,style:f,tasks:c.get(d)??[]}})}const J6="_boardContainer_1c4y1_1",eO="_column_1c4y1_17",tO="_columnHeader_1c4y1_34",nO="_columnIcon_1c4y1_47",aO="_columnLabel_1c4y1_52",sO="_columnCount_1c4y1_57",iO="_cardList_1c4y1_67",oO="_emptyPlaceholder_1c4y1_76",lO="_card_1c4y1_67",rO="_cardHeader_1c4y1_107",cO="_cardStatusIcon_1c4y1_113",uO="_cardTitle_1c4y1_119",dO="_cardBadges_1c4y1_127",fO="_badge_1c4y1_134",hO="_blockedBadge_1c4y1_146",mO="_childBadge_1c4y1_151",pO="_depBadge_1c4y1_155",vO="_parentBadge_1c4y1_159",gO="_pausedSubBadge_1c4y1_166",yO="_personaBadge_1c4y1_170",bO="_envBadge_1c4y1_174",xO="_emptyCta_1c4y1_178",_O="_ctaButton_1c4y1_188",SO="_ctaDescription_1c4y1_204",Ke={boardContainer:J6,column:eO,columnHeader:tO,columnIcon:nO,columnLabel:aO,columnCount:sO,cardList:iO,emptyPlaceholder:oO,card:lO,cardHeader:rO,cardStatusIcon:cO,cardTitle:uO,cardBadges:dO,badge:fO,blockedBadge:hO,childBadge:mO,depBadge:pO,parentBadge:vO,pausedSubBadge:gO,personaBadge:yO,envBadge:bO,emptyCta:xO,ctaButton:_O,ctaDescription:SO};function TO({workspaceId:n,environmentId:a,tasks:i,sessions:l,personas:c,environments:d}){const f=Rt(),m=b.useMemo(()=>i.filter(x=>x.workspaceId===n),[i,n]),p=b.useMemo(()=>new Map(i.map(x=>[x.id,x.status])),[i]),v=b.useMemo(()=>new Map(m.map(x=>[x.id,x])),[m]),g=b.useMemo(()=>{const x=new Map(l.map(w=>[w.id,w])),S=new Map(c.map(w=>[w.id,w])),T=new Map(d.map(w=>[w.id,w])),j=new Map,N=new Map,C=new Map;for(const w of m)if(w.latestSessionId){const A=x.get(w.latestSessionId);if(A){if(j.set(w.id,A.endReason||A.status),A.personaId){const R=S.get(A.personaId);R&&N.set(w.id,R.name)}if(A.environmentId){const R=T.get(A.environmentId);R&&C.set(w.id,R.displayName)}}}return{sessionStatusByTaskId:j,personaNameByTaskId:N,environmentNameByTaskId:C}},[m,l,c,d]),y=b.useMemo(()=>W6({tasks:m,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[m,p,g]);return m.length===0?r.jsxs("div",{className:Ke.emptyCta,"data-testid":"board-empty-cta",children:[r.jsx("button",{className:Ke.ctaButton,onClick:()=>f(zi(n,void 0,a)),children:"Create Task"}),r.jsx("div",{className:Ke.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):r.jsx("div",{className:Ke.boardContainer,"data-testid":"board-container",children:y.map(x=>r.jsxs("section",{className:Ke.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[r.jsxs("div",{className:Ke.columnHeader,children:[r.jsx("span",{className:Ke.columnIcon,style:{color:x.style.color},children:x.style.icon}),r.jsx("span",{className:Ke.columnLabel,children:x.label}),r.jsx("span",{className:Ke.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),r.jsx("div",{className:Ke.cardList,children:x.tasks.length===0?r.jsx("div",{className:Ke.emptyPlaceholder,children:"No tasks"}):r.jsx(Kn,{mode:"popLayout",children:x.tasks.map(S=>r.jsx(Tt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:r.jsx(kO,{boardTask:S,tasksById:v,personaName:g.personaNameByTaskId.get(S.task.id),envName:g.environmentNameByTaskId.get(S.task.id),onClick:()=>f(ya(S.task.id,void 0,n,a))})},S.task.id))})})]},x.status))})}function kO({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:c}){const{task:d,isBlocked:f,childCount:m,doneChildCount:p,pausedSubBadge:v}=n,g=Xa(d.status),y=d.parentTaskId?a.get(d.parentTaskId):void 0;return r.jsxs("div",{className:Ke.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[r.jsxs("div",{className:Ke.cardHeader,children:[r.jsx("span",{className:Ke.cardStatusIcon,style:{color:g.color},children:g.icon}),r.jsx("span",{className:Ke.cardTitle,children:d.title})]}),r.jsxs("div",{className:Ke.cardBadges,children:[y&&r.jsx("span",{className:`${Ke.badge} ${Ke.parentBadge}`,title:y.title,children:y.title}),m>0&&r.jsxs("span",{className:`${Ke.badge} ${Ke.childBadge}`,children:[p,"/",m]}),f&&r.jsx("span",{className:`${Ke.badge} ${Ke.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!f&&r.jsx("span",{className:`${Ke.badge} ${Ke.depBadge}`,children:"dep"}),v&&r.jsx("span",{className:`${Ke.badge} ${Ke.pausedSubBadge}`,children:v}),i&&r.jsx("span",{className:`${Ke.badge} ${Ke.personaBadge}`,children:i}),l&&r.jsx("span",{className:`${Ke.badge} ${Ke.envBadge}`,children:l})]})]})}function Eh(n){const{value:a,onSave:i,validate:l,fieldId:c,activeFieldId:d,onActivate:f,enterToSave:m=!0,trimOnSave:p=!0}=n,[v,g]=b.useState(""),[y,x]=b.useState(""),S=b.useRef(!1),T=d===c,j=b.useCallback(z=>{g(z),x("")},[]),N=b.useCallback(()=>{x("")},[]),C=b.useCallback(()=>{S.current=!1,f==null||f(null),g(""),x("")},[f]),w=b.useCallback(()=>{const z=p?v.trim():v;if(l){const P=l(v);if(P){x(P);return}}const I=p?a.trim():a;if(z===I){C();return}i(z),C()},[v,a,p,l,i,C]),A=b.useCallback(()=>{S.current=!0,f==null||f(c),g(a),x("")},[c,a,f]),R=b.useCallback(z=>{if(S.current){S.current=!1;return}z.relatedTarget instanceof HTMLElement&&z.relatedTarget.dataset.editAction===c||w()},[c,w]),E=b.useCallback(z=>{z.key==="Escape"?C():z.key==="Enter"&&m&&w()},[C,m,w]),H=(()=>{if(!T)return!1;const z=p?a.trim():a;return(p?v.trim():v)!==z})();return b.useEffect(()=>{!T&&(v!==""||y!=="")&&(g(""),x(""))},[T,v,y]),{isEditing:T,draft:v,error:y,isDirty:H,startEdit:A,cancelEdit:C,save:w,setDraft:j,clearError:N,handleBlur:R,handleKeyDown:E,ignoreInitialBlurRef:S}}const CO="_editFieldWrapper_yuzty_1",jO="_editInput_yuzty_10",NO="_editTextarea_yuzty_42",wO="_editSelect_yuzty_78",EO="_editError_yuzty_111",AO="_editInputInvalid_yuzty_118",DO="_editHint_yuzty_123",RO="_unsavedDot_yuzty_132",MO="_metaValueClickable_yuzty_140",OO="_editButton_yuzty_159",BO="_metaPlaceholder_yuzty_175",LO="_worktreeToggle_yuzty_180",Pe={editFieldWrapper:CO,editInput:jO,editTextarea:NO,editSelect:wO,editError:EO,editInputInvalid:AO,editHint:DO,unsavedDot:RO,metaValueClickable:MO,editButton:OO,metaPlaceholder:BO,worktreeToggle:LO};function rn(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="text",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,maxLength:y,ariaLabel:x,"data-testid":S}=n,T=b.useRef(null),j=Eh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!0,trimOnSave:!0});if(b.useEffect(()=>{if(j.isEditing){const C=window.setTimeout(()=>{var w;(w=T.current)==null||w.focus()},0);return()=>window.clearTimeout(C)}},[j.isEditing]),c==="create"){const C=A=>{p==null||p(A.target.value)},w=l==null?void 0:l(a);return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("input",{className:`${Pe.editInput} ${w?Pe.editInputInvalid:""}`,value:a,onChange:C,maxLength:y,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:w})]})}if(j.isEditing)return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("input",{ref:T,className:`${Pe.editInput} ${j.error?Pe.editInputInvalid:""}`,value:j.draft,onChange:C=>j.setDraft(C.target.value),onBlur:j.handleBlur,onKeyDown:j.handleKeyDown,maxLength:y,placeholder:g,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),j.isDirty&&r.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),j.error&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:j.error}),r.jsx("span",{className:Pe.editHint,children:"Enter to save · Esc to cancel"})]});const N=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>j.startEdit(),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),j.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?r.jsx("span",{children:a}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function IO(n){const{value:a,onSave:i,validate:l,mode:c="edit",fieldId:d="textarea",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:y,"data-testid":x}=n,S=b.useRef(null),T=Eh({value:a,onSave:i,validate:l,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});if(b.useEffect(()=>{if(T.isEditing){const N=window.setTimeout(()=>{var C;(C=S.current)==null||C.focus()},0);return()=>window.clearTimeout(N)}},[T.isEditing]),c==="create"){const N=w=>{p==null||p(w.target.value)},C=l==null?void 0:l(a);return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("textarea",{className:`${Pe.editTextarea} ${C?Pe.editInputInvalid:""}`,value:a,onChange:N,placeholder:g,"aria-label":y,"data-testid":x?`${x}-input`:void 0}),C&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:C})]})}if(T.isEditing)return r.jsxs("div",{className:Pe.editFieldWrapper,children:[r.jsx("textarea",{ref:S,className:`${Pe.editTextarea} ${T.error?Pe.editInputInvalid:""}`,value:T.draft,onChange:N=>T.setDraft(N.target.value),onBlur:T.handleBlur,onKeyDown:T.handleKeyDown,title:y,"aria-label":y,"data-testid":x?`${x}-input`:void 0}),T.isDirty&&r.jsx("span",{className:Pe.unsavedDot,title:"Unsaved changes"}),T.error&&r.jsx("span",{className:Pe.editError,"data-testid":"edit-error",children:T.error}),r.jsx("span",{className:Pe.editHint,children:"Tab to save · Esc to cancel"})]});const j=v==null?void 0:v(a);return r.jsxs("span",{role:"button",tabIndex:0,className:Pe.metaValueClickable,onClick:()=>T.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),T.startEdit())},title:"Click to edit","aria-label":y,"data-testid":x?`${x}-button`:void 0,children:[j!==void 0?j:a?r.jsx("span",{children:a}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function Qx(n){var A;const{value:a,onSave:i,mode:l="edit",options:c,fieldId:d="select",activeFieldId:f,onActivate:m,onChange:p,renderDisplay:v,placeholder:g,ariaLabel:y,"data-testid":x}=n,S=b.useRef(null),T=Eh({value:a,onSave:i,fieldId:d,activeFieldId:f,onActivate:m,enterToSave:!1,trimOnSave:!1});b.useEffect(()=>{if(T.isEditing){const R=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(R)}},[T.isEditing]);const j=b.useCallback(R=>{const E=R.target.value;T.ignoreInitialBlurRef.current=!1,E!==a&&i(E),T.cancelEdit()},[a,i,T]),N=b.useCallback(R=>{if(T.ignoreInitialBlurRef.current){T.ignoreInitialBlurRef.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===d||T.cancelEdit()},[d,T]);if(l==="create")return r.jsx("select",{className:Pe.editSelect,value:a,onChange:R=>p==null?void 0:p(R.target.value),"aria-label":y,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});if(T.isEditing)return r.jsx("select",{ref:S,className:Pe.editSelect,value:T.draft,onChange:j,onBlur:N,title:y,"aria-label":y,"data-testid":x?`${x}-select`:void 0,children:c.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))});const C=v==null?void 0:v(a),w=(A=c.find(R=>R.value===a))==null?void 0:A.label;return r.jsxs("button",{type:"button",className:Pe.metaValueClickable,onClick:()=>T.startEdit(),title:"Click to change","aria-label":y,"data-testid":x?`${x}-button`:void 0,children:[C!==void 0?C:w?r.jsx("span",{children:w}):r.jsx("span",{className:Pe.metaPlaceholder,children:g||"None"}),r.jsx("span",{className:Pe.editButton,"aria-hidden":"true",children:"✏️"})]})}function zO(n){const{checked:a,onChange:i,label:l,ariaLabel:c,"data-testid":d}=n;return r.jsxs("label",{className:Pe.worktreeToggle,"data-testid":d,children:[r.jsx("input",{type:"checkbox",checked:a,onChange:f=>i(f.target.checked),"aria-label":c}),r.jsx("span",{children:l})]})}const UO="_envRow_1e1r5_1",VO="_envDot_1e1r5_7",HO="_envDotGreen_1e1r5_14",GO="_envDotYellow_1e1r5_18",PO="_envDotRed_1e1r5_22",$O="_envDotGray_1e1r5_26",wi={envRow:UO,envDot:VO,envDotGreen:HO,envDotYellow:GO,envDotRed:PO,envDotGray:$O};function qO(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?wi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?wi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?wi.envDotRed:wi.envDotGray}function YO(n){const{value:a,onSave:i,environments:l,allowNone:c=!1,fieldId:d="environment",activeFieldId:f,onActivate:m,placeholder:p="No environment",ariaLabel:v="Environment","data-testid":g}=n,y=l.find(T=>T.id===a),x=[...c?[{value:"",label:"None"}]:[],...l.map(T=>({value:T.id,label:T.displayName}))],S=()=>{if(y)return r.jsxs("span",{className:wi.envRow,children:[r.jsx("span",{className:`${wi.envDot} ${qO(y.status)}`}),y.displayName]})};return r.jsx(Qx,{value:a,onSave:i,options:x,fieldId:d,activeFieldId:f,onActivate:m,renderDisplay:S,placeholder:p,ariaLabel:v,"data-testid":g})}function _0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const f=Math.floor(d/24);return f<30?`${f}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const tf=100;function KO(){const{workspaceId:n,environmentId:a}=Qa(),i=Rt(),{tasks:l,environments:c,workspaces:d,personas:f,sessions:m,archiveWorkspace:p,updateWorkspace:v,usageCache:g,loadUsage:y}=rt(),[x,S]=b.useState("tasks"),[T,j]=b.useState(!1),[N,C]=b.useState(null),[w,A]=b.useState(!1),R=b.useRef(void 0),E=d.find(K=>K.id===n),H=a??(E==null?void 0:E.environmentId)??"",z=T6(n,H,d,c);b.useEffect(()=>{const K=R.current;R.current=n,!(K===void 0||K===n)&&N!==null&&C(null)},[n,N]);const I=m.reduce((K,ae)=>K+(ae.costUsd??0),0);b.useEffect(()=>{n&&y("workspace",n)},[n,y,I]);const P=n?g[`workspace:${n}`]:void 0,ee=l.filter(K=>K.workspaceId===n),ne=ee.filter(K=>K.status==="complete").length,ce=ee.length,re=ce>0?Math.round(ne/ce*100):0;return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Ds,{segments:z}),r.jsxs("div",{className:L.workspaceHeader,children:[r.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:r.jsx(rn,{value:(E==null?void 0:E.name)||"",onSave:K=>{E&&v(E.id,{name:K})},validate:K=>{const ae=K.trim();if(!ae)return"Name is required";if(ae.length>tf)return`Max ${tf} characters`},maxLength:tf,fieldId:"name",activeFieldId:N,onActivate:C,ariaLabel:"Workspace name",renderDisplay:K=>K||n||void 0,"data-testid":"edit-name"})}),r.jsx("button",{className:L.archiveButton,onClick:()=>j(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),r.jsxs("button",{className:L.metaToggle,onClick:()=>A(!w),"aria-expanded":!w,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[r.jsx("span",{className:`${L.metaToggleArrow} ${w?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!w&&r.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Description"}),r.jsx("div",{className:L.metaValue,children:r.jsx(IO,{value:(E==null?void 0:E.description)||"",onSave:K=>{E&&v(E.id,{description:K})},fieldId:"description",activeFieldId:N,onActivate:C,renderDisplay:K=>K?r.jsx("span",{className:L.overviewMarkdown,children:r.jsx(Rf,{remarkPlugins:[Mf],children:K})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Repository"}),r.jsx("div",{className:L.metaValue,children:r.jsx(rn,{value:(E==null?void 0:E.repoUrl)||"",onSave:K=>{E&&v(E.id,{repoUrl:K})},validate:K=>{const ae=K.trim();if(ae&&!/^https?:\/\/.+/.test(ae))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:C,renderDisplay:K=>K&&/^https?:\/\//i.test(K)?r.jsx("a",{className:L.repoLink,href:K,target:"_blank",rel:"noopener noreferrer",onClick:ae=>ae.stopPropagation(),children:K}):K?r.jsx("span",{children:K}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Environment"}),r.jsx("div",{className:L.metaValue,children:r.jsx(YO,{value:(E==null?void 0:E.environmentId)||"",onSave:K=>{E&&K&&v(E.id,{environmentId:K})},environments:c,fieldId:"environmentId",activeFieldId:N,onActivate:C,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Persona"}),r.jsx("div",{className:L.metaValue,children:r.jsx(Qx,{value:(E==null?void 0:E.defaultPersonaId)||"",onSave:K=>{E&&v(E.id,{defaultPersonaId:K})},options:[{value:"",label:"(Inherit)"},...f.map(K=>({value:K.id,label:K.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:C,renderDisplay:K=>{const ae=f.find(O=>O.id===K);if(ae)return r.jsx("span",{children:ae.name})},placeholder:(E==null?void 0:E.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Worktrees"}),r.jsx("div",{className:L.metaValue,children:r.jsx(zO,{checked:(E==null?void 0:E.useWorktrees)??!0,onChange:K=>{E&&v(E.id,{useWorktrees:K})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),r.jsxs("div",{className:L.metaRow,children:[r.jsx("span",{className:L.metaLabel,children:"Working Dir"}),r.jsx("div",{className:L.metaValue,children:r.jsx(rn,{value:(E==null?void 0:E.workingDirectory)||"",onSave:K=>{E&&v(E.id,{workingDirectory:K})},fieldId:"workingDirectory",activeFieldId:N,onActivate:C,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),E&&r.jsxs("div",{className:L.metaTimestamps,children:[r.jsxs("span",{className:L.metaTimestamp,children:["Created ",_0(E.createdAt)]}),E.updatedAt&&E.updatedAt!==E.createdAt&&r.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",_0(E.updatedAt)]})]})]}),ce>0&&r.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[r.jsx("div",{className:L.progressBar,children:r.jsx("div",{className:L.progressFill,style:{width:`${re}%`}})}),r.jsxs("span",{className:L.progressLabel,children:[ne,"/",ce]})]}),P&&P.costUsd>0&&r.jsx("div",{className:L.progressBarContainer,children:r.jsxs("span",{className:L.progressLabel,children:["Usage: ",Bi(P.costUsd)," (",P.sessionCount," session",P.sessionCount!==1?"s":"",")"]})}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[r.jsx("button",{role:"tab","aria-selected":x==="graph",className:`${L.tab} ${x==="graph"?L.active:""}`,onClick:()=>S("graph"),children:"Graph"}),r.jsx("button",{role:"tab","aria-selected":x==="board",className:`${L.tab} ${x==="board"?L.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),r.jsx("button",{role:"tab","aria-selected":x==="tasks",className:`${L.tab} ${x==="tasks"?L.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),x==="tasks"&&ce>0&&r.jsxs("div",{className:L.workspaceSummary,children:[r.jsx("span",{className:L.workspaceSummaryTitle,children:`${ne}/${ce} tasks complete`}),r.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),x==="tasks"&&ce===0&&r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{className:L.ctaButton,onClick:()=>i(zi(n,void 0,H)),children:"Create Task"}),r.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),x==="board"&&r.jsx(TO,{workspaceId:n,environmentId:H,tasks:l,sessions:m,personas:f,environments:c}),x==="graph"&&r.jsx(Q6,{workspaceId:n,environmentId:H,tasks:l}),r.jsx(bc,{isOpen:T,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{E&&(p(E.id),i("/",{replace:!0})),j(!1)},onCancel:()=>j(!1)})]})}const FO="_formContent_ymnez_1",ZO="_section_ymnez_13",XO="_label_ymnez_19",QO="_titleInput_ymnez_26",WO="_descriptionTextarea_ymnez_58",JO="_selectField_ymnez_94",e4="_checkboxRow_ymnez_128",t4="_checkboxLabel_ymnez_141",n4="_fieldError_ymnez_146",it={formContent:FO,section:ZO,label:XO,titleInput:QO,descriptionTextarea:WO,selectField:JO,checkboxRow:e4,checkboxLabel:t4,fieldError:n4};function a4(n,a){return{name:(n==null?void 0:n.name)??"",description:(n==null?void 0:n.description)??"",repoUrl:(n==null?void 0:n.repoUrl)??"",environmentId:(n==null?void 0:n.environmentId)??a??"",defaultPersonaId:(n==null?void 0:n.defaultPersonaId)??"",useWorktrees:(n==null?void 0:n.useWorktrees)??!0,workingDirectory:(n==null?void 0:n.workingDirectory)??""}}const s4=100;function i4({values:n,onChange:a,environments:i,personas:l,errors:c,disabled:d,autoFocusName:f}){const m=(p,v)=>{a({...n,[p]:v})};return r.jsxs("div",{className:it.formContent,children:[r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-name",children:"Name"}),r.jsx("input",{id:"ws-name",className:it.titleInput,type:"text",value:n.name,onChange:p=>m("name",p.target.value),placeholder:"Workspace name",maxLength:s4,autoFocus:f,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-description",children:"Description"}),r.jsx("textarea",{id:"ws-description",className:it.descriptionTextarea,value:n.description,onChange:p=>m("description",p.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-repo",children:"Repository URL"}),r.jsx("input",{id:"ws-repo",className:it.titleInput,type:"text",value:n.repoUrl,onChange:p=>m("repoUrl",p.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-environment",children:"Environment"}),r.jsxs("select",{id:"ws-environment",className:it.selectField,value:n.environmentId,onChange:p=>m("environmentId",p.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[r.jsx("option",{value:"",children:"Select environment…"}),i.map(p=>r.jsx("option",{value:p.id,children:p.displayName||p.id},p.id))]}),(c==null?void 0:c.environmentId)&&r.jsx("span",{className:it.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-persona",children:"Default Persona"}),r.jsxs("select",{id:"ws-persona",className:it.selectField,value:n.defaultPersonaId,onChange:p=>m("defaultPersonaId",p.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),l.map(p=>r.jsx("option",{value:p.id,children:p.name},p.id))]})]}),r.jsx("div",{className:it.section,children:r.jsxs("label",{className:it.checkboxRow,children:[r.jsx("input",{type:"checkbox",checked:n.useWorktrees,onChange:p=>m("useWorktrees",p.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),r.jsx("span",{className:it.checkboxLabel,children:"Enable worktree isolation"})]})}),r.jsxs("div",{className:it.section,children:[r.jsx("label",{className:it.label,htmlFor:"ws-workdir",children:"Working Directory"}),r.jsx("input",{id:"ws-workdir",className:it.titleInput,type:"text",value:n.workingDirectory,onChange:p=>m("workingDirectory",p.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const o4="_container_cddyd_1",l4="_header_cddyd_8",r4="_headerTitle_cddyd_35",c4="_badge_cddyd_44",u4="_headerActions_cddyd_54",d4="_body_cddyd_61",f4="_formContent_cddyd_73",h4="_section_cddyd_85",m4="_label_cddyd_91",p4="_titleInput_cddyd_98",v4="_descriptionTextarea_cddyd_131",g4="_parentContext_cddyd_167",y4="_parentLabel_cddyd_175",b4="_parentName_cddyd_182",x4="_personaSelect_cddyd_186",_4="_depList_cddyd_220",S4="_depItem_cddyd_226",T4="_depItemSelected_cddyd_248",k4="_noDeps_cddyd_252",C4="_btnPrimary_cddyd_258",j4="_btnGhost_cddyd_289",Ee={container:o4,header:l4,headerTitle:r4,badge:c4,headerActions:u4,body:d4,formContent:f4,section:h4,label:m4,titleInput:p4,descriptionTextarea:v4,parentContext:g4,parentLabel:y4,parentName:b4,personaSelect:x4,depList:_4,depItem:S4,depItemSelected:T4,noDeps:k4,btnPrimary:C4,btnGhost:j4};function N4(n){const a={};return n.name.trim()||(a.name="Name is required"),n.repoUrl.trim()&&!/^https?:\/\/.+/i.test(n.repoUrl.trim())&&(a.repoUrl="Must be a valid http(s) URL"),n.environmentId||(a.environmentId="Environment is required"),Object.keys(a).length>0?a:void 0}const w4=[{label:"Home",url:Cs},{label:"New Workspace",url:void 0}];function E4(){const[n]=Gf(),a=n.get("environment")??void 0,{environments:i,personas:l,createWorkspace:c,workspaceCreating:d}=rt(),{showToast:f}=Es(),m=Rt(),[p,v]=b.useState(()=>{var N;return a4(void 0,a||((N=i[0])==null?void 0:N.id))}),[g,y]=b.useState(),[x,S]=b.useState();b.useEffect(()=>{a||p.environmentId||i.length===0||v(N=>{var C;return N.environmentId?N:{...N,environmentId:((C=i[0])==null?void 0:C.id)??""}})},[i,a,p.environmentId]);const T=()=>{const N=N4(p);if(N){y(N),S(void 0);return}y(void 0),S(void 0),c(p.name.trim(),p.description,p.repoUrl.trim(),p.environmentId,p.defaultPersonaId,p.useWorktrees,p.workingDirectory,()=>{f("Workspace created","success"),m(Cs,{replace:!0})},C=>{S(C)})},j=()=>{m(a?Di(a):Cs,{replace:!0})};return r.jsxs("div",{className:Ee.container,children:[r.jsxs("div",{className:Ee.header,children:[r.jsx("div",{className:Ee.headerTitle,children:r.jsx(Ds,{segments:w4})}),r.jsxs("div",{className:Ee.headerActions,children:[r.jsx("button",{className:Ee.btnGhost,onClick:j,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),r.jsx("button",{className:Ee.btnPrimary,onClick:T,disabled:d||!p.name.trim()||!p.environmentId,"data-testid":"workspace-create-save",children:d?r.jsx(qx,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),r.jsxs("div",{className:Ee.body,children:[r.jsx(i4,{values:p,onChange:N=>{v(N),y(void 0),S(void 0)},environments:i,personas:l,errors:g,disabled:d,autoFocusName:!0}),x&&r.jsx("div",{className:Ee.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function Wx({mode:n,taskId:a,workspaceId:i,parentTaskId:l,environmentId:c,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v}){const{showToast:g}=Es(),y=Rt(),x=n==="edit",S=x&&a?d.find(W=>W.id===a):void 0,T=x?(S==null?void 0:S.workspaceId)??"":i??"",[j,N]=b.useState(T),C=T||j,w=f.find(W=>W.id===C),A=c??(w==null?void 0:w.environmentId),R=!x&&!i,E=x?(S==null?void 0:S.parentTaskId)??"":l??"",H=E?d.find(W=>W.id===E):void 0,[z,I]=b.useState((S==null?void 0:S.title)??""),[P,ee]=b.useState((S==null?void 0:S.description)??""),[ne,ce]=b.useState((S==null?void 0:S.dependsOn)??[]),[re,K]=b.useState((S==null?void 0:S.defaultPersonaId)??""),[ae,O]=b.useState((S==null?void 0:S.canDecompose)??!1),[$,se]=b.useState(!1),oe=b.useRef(!1);b.useEffect(()=>{x&&S&&!oe.current&&(oe.current=!0,I(S.title),ee(S.description),ce(S.dependsOn),K(S.defaultPersonaId),O(S.canDecompose))},[x,S]);const Y=d.filter(W=>W.workspaceId===C&&(!x||W.id!==a)&&W.id!==E),be=z.trim().length>0&&(!x||S!==void 0)&&C.length>0,Ne=W=>{ce(tt=>tt.includes(W)?tt.filter(Re=>Re!==W):[...tt,W])},xe=()=>{!be||$||x&&S===void 0||(x&&a?(v(a,z.trim(),P,ne,re),g("Task updated","success"),y(ya(a,void 0,C,A),{replace:!0})):(se(!0),p(C,z.trim(),P,ne.length>0?ne:void 0,E||void 0,re,ae,()=>{g("Task created","success"),y(i?Ei(i,A):"/tasks",{replace:!0})},W=>{g(W,"error"),se(!1)})))},J=()=>{y(x&&a?ya(a,void 0,C,A):i?Ei(i,A):"/tasks")},le=x?"edit task":E?"child task":"new task";return r.jsxs("div",{className:Ee.container,children:[r.jsxs("div",{className:Ee.header,children:[r.jsxs("div",{className:Ee.headerTitle,children:[r.jsx("span",{className:Ee.badge,children:le}),H&&r.jsxs("span",{className:Ee.parentContext,children:[r.jsx("span",{className:Ee.parentLabel,children:"Child of"}),r.jsx("span",{className:Ee.parentName,children:H.title})]})]}),r.jsxs("div",{className:Ee.headerActions,children:[r.jsx("button",{onClick:xe,disabled:!be||$,className:Ee.btnPrimary,"data-testid":"task-edit-save",children:$?"Creating…":x?"Save Changes":"Create"}),r.jsx("button",{onClick:J,className:Ee.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:Ee.body,children:r.jsxs("div",{className:Ee.formContent,children:[R&&r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-workspace",children:"Workspace"}),r.jsxs("select",{id:"task-edit-workspace",value:j,onChange:W=>N(W.target.value),className:Ee.personaSelect,"data-testid":"task-edit-workspace",children:[r.jsx("option",{value:"",children:"Select a workspace..."}),f.map(W=>r.jsx("option",{value:W.id,children:W.name},W.id))]})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-title",children:"Title"}),r.jsx("input",{id:"task-edit-title",type:"text",value:z,onChange:W=>I(W.target.value),placeholder:"Task title...",autoFocus:!0,className:Ee.titleInput,"data-testid":"task-edit-title",onKeyDown:W=>{W.key==="Enter"&&be&&xe()}})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-description",children:"Description"}),r.jsx("textarea",{id:"task-edit-description",value:P,onChange:W=>ee(W.target.value),placeholder:"Describe the task... (markdown supported)",className:Ee.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),r.jsxs("div",{className:Ee.section,children:[r.jsx("label",{className:Ee.label,htmlFor:"task-edit-persona",children:"Default Persona"}),r.jsxs("select",{id:"task-edit-persona",value:re,onChange:W=>K(W.target.value),className:Ee.personaSelect,"data-testid":"task-edit-persona",children:[r.jsx("option",{value:"",children:"(Inherit)"}),m.map(W=>r.jsx("option",{value:W.id,children:W.name},W.id))]})]}),!x&&r.jsx("div",{className:Ee.section,children:r.jsxs("label",{className:Ee.depItem,"data-testid":"task-edit-can-decompose",children:[r.jsx("input",{type:"checkbox",checked:ae,onChange:W=>O(W.target.checked)}),"Can spawn subtasks"]})}),r.jsxs("div",{className:Ee.section,children:[r.jsx("div",{className:Ee.label,children:"Dependencies"}),Y.length===0?r.jsx("div",{className:Ee.noDeps,children:"No other tasks in this workspace"}):r.jsx("div",{className:Ee.depList,children:Y.map(W=>{const tt=ne.includes(W.id);return r.jsxs("label",{className:`${Ee.depItem} ${tt?Ee.depItemSelected:""}`,"data-testid":`dep-option-${W.id}`,children:[r.jsx("input",{type:"checkbox",checked:tt,onChange:()=>Ne(W.id)}),W.title,r.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",W.status,")"]})]},W.id)})})]})]})})]})}function S0(){const{workspaceId:n,environmentId:a}=Qa(),[i]=Gf(),l=n??i.get("workspace")??"",c=i.get("parent")??void 0,{tasks:d,workspaces:f,personas:m,createTask:p,updateTask:v}=rt();return r.jsx(Wx,{mode:"new",workspaceId:l,parentTaskId:c,environmentId:a,tasks:d,workspaces:f,personas:m,onCreateTask:p,onUpdateTask:v})}function T0(){const{taskId:n,workspaceId:a,environmentId:i}=Qa(),{tasks:l,workspaces:c,personas:d,createTask:f,updateTask:m}=rt();return r.jsx(Wx,{mode:"edit",taskId:n,workspaceId:a,environmentId:i,tasks:l,workspaces:c,personas:d,onCreateTask:f,onUpdateTask:m})}const A4="_container_1pqxm_1",D4="_emptyState_1pqxm_8",R4="_card_1pqxm_14",M4="_cardHeader_1pqxm_34",O4="_categoryBadge_1pqxm_46",B4="_findingTitle_1pqxm_54",L4="_findingDate_1pqxm_60",I4="_findingContent_1pqxm_72",z4="_tags_1pqxm_78",U4="_tag_1pqxm_78",Gn={container:A4,emptyState:D4,card:R4,cardHeader:M4,categoryBadge:O4,findingTitle:B4,findingDate:L4,findingContent:I4,tags:z4,tag:U4};function V4(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),c=Math.floor(l/1e3),d=Math.floor(c/60),f=Math.floor(d/60),m=Math.floor(f/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(f<24)return`${f}h ago`;if(m===1)return"yesterday";if(m<7)return`${m} days ago`;const p=a.getFullYear()===i.getFullYear(),v=a.toLocaleString("en-US",{month:"short"}),g=a.getDate();return p?`${v} ${g}`:`${v} ${g} ${a.getFullYear()}`}const k0={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 H4({findings:n}){return n.length===0?r.jsx("div",{className:Gn.emptyState,children:"No findings yet. Agents will post discoveries here."}):r.jsx("div",{className:Gn.container,children:n.map((a,i)=>{const l=k0[a.category]||k0.general;return r.jsxs(Tt.div,{className:Gn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:i*.05,duration:.2},children:[r.jsxs("div",{className:Gn.cardHeader,children:[r.jsx("span",{className:Gn.categoryBadge,style:{background:l.bg,color:l.text},children:a.category}),r.jsx("span",{className:Gn.findingTitle,children:a.title}),r.jsx("span",{className:Gn.findingDate,title:a.createdAt,children:V4(a.createdAt)})]}),r.jsx("div",{className:Gn.findingContent,children:a.content.length>300?a.content.slice(0,300)+"...":a.content}),a.tags.length>0&&r.jsx("div",{className:Gn.tags,children:a.tags.map(c=>r.jsx("span",{className:Gn.tag,style:{color:l.text,textShadow:`0 0 8px ${l.text}`},children:c},c))})]},a.id)})})}function Gr(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 nf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),c=Math.floor(i%6e4/1e3);if(l===0)return`${c}s`;const d=Math.floor(l/60),f=l%60;return d===0?`${l}m ${c}s`:`${d}h ${f}m`}function C0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?L.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?L.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?L.envDotRed:L.envDotGray}function G4({status:n}){const a=Xa(n),i=y2(n);return r.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function P4({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:c,selectedEnvId:d}){const{loadUsage:f,usageCache:m}=rt(),p=c.reduce((A,R)=>A+(R.costUsd??0),0);b.useEffect(()=>{f("task",n.id),n.childTaskIds.length>0&&f("task_tree",n.id)},[n.id,n.childTaskIds.length,f,p]);const v=`task:${n.id}`,g=v in m?m[v]:void 0,y=`task_tree:${n.id}`,x=n.childTaskIds.length>0&&y in m?m[y]:void 0,S=c.length>0?c[c.length-1]:void 0,T=(S==null?void 0:S.environmentId)??"",j=T?i.find(A=>A.id===T):void 0,N=l.find(A=>A.id===n.workspaceId),C=i.find(A=>A.id===d),w=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return r.jsxs("div",{className:L.overviewDashboard,children:[r.jsxs("div",{className:L.overviewHero,children:[r.jsx(G4,{status:n.status}),n.branch&&r.jsx("span",{className:L.overviewBranchPill,children:w?r.jsxs("a",{href:w,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",n.branch]}):r.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Description"}),r.jsx("div",{className:L.overviewMarkdown,children:r.jsx(Rf,{remarkPlugins:[Mf],children:n.description})})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Environment"}),T&&j?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${C0(j.status)}`,title:j.status,"aria-label":`Status: ${j.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:j.displayName})]}):C?r.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[r.jsx("span",{className:`${L.envDot} ${C0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),r.jsx("span",{className:L.overviewValue,children:C.displayName}),r.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):r.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?r.jsx("div",{className:L.overviewMuted,children:"None"}):r.jsx("div",{className:L.depList,children:n.dependsOn.map(A=>{const R=a.get(A),E=(R==null?void 0:R.status)==="complete";return r.jsxs("div",{className:`${L.depItem} ${E?L.depDone:L.depBlocked}`,children:[r.jsx("span",{children:E?"✓":"○"}),r.jsx("span",{children:(R==null?void 0:R.title)??A})]},A)})})]}),r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Timeline"}),r.jsxs("div",{className:L.timeline,children:[n.createdAt&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Created"}),r.jsx("span",{className:L.timelineValue,children:Gr(n.createdAt)})]}),n.assignedAt&&(()=>{const A=nf(n.createdAt,n.assignedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Assigned"}),r.jsx("span",{className:L.timelineValue,children:Gr(n.assignedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.startedAt&&(()=>{const A=nf(n.assignedAt??n.createdAt,n.startedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Started"}),r.jsx("span",{className:L.timelineValue,children:Gr(n.startedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),n.completedAt&&(()=>{const A=nf(n.startedAt,n.completedAt);return r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Completed"}),r.jsx("span",{className:L.timelineValue,children:Gr(n.completedAt)}),A!==void 0&&r.jsx("span",{className:L.timelineDelta,children:A})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&r.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),g&&g.costUsd>0&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Usage"}),r.jsxs("div",{className:L.timeline,children:[r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Cost"}),r.jsx("span",{className:L.timelineValue,children:Bi(g.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[g.sessionCount," session",g.sessionCount!==1?"s":""]})]}),x&&x.costUsd>g.costUsd&&r.jsxs("div",{className:L.timelineRow,children:[r.jsx("span",{className:L.timelineKey,children:"Total (incl. subtasks)"}),r.jsx("span",{className:L.timelineValue,children:Bi(x.costUsd)}),r.jsxs("span",{className:L.timelineDelta,children:[x.sessionCount," session",x.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&r.jsxs("div",{className:L.overviewSection,children:[r.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),r.jsx("div",{className:L.reviewNotes,children:n.reviewNotes})]})]})}function $4({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:c,onStop:d,onPause:f,onDelete:m,onEdit:p}){if(n.status==="not_started")return i?r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]}):r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Start"}),r.jsx("button",{onClick:p,className:L.btnGhost,children:"Edit"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="working")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnDanger,children:"Stop"}),r.jsx("button",{onClick:f,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(n.status==="paused")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:d,className:L.btnPrimary,children:"Stop"}),r.jsx("button",{onClick:c,className:L.btnGhost,children:"Resume"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]});if(n.status==="complete")return r.jsx("div",{className:L.headerActions,children:r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})});if(n.status==="failed")return r.jsxs("div",{className:L.headerActions,children:[r.jsx("button",{onClick:l,className:L.btnPrimary,children:"Retry"}),r.jsx("button",{onClick:m,className:L.btnDanger,children:"Delete"})]})}function q4({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return r.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[r.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),n.map((l,c)=>{const d=l.id===a,f=l.status==="stopped"&&l.endReason==="completed"?"✓":l.status==="stopped"?"✗":l.status==="running"||l.status==="idle"?"●":"";return r.jsxs("button",{className:`${L.attemptButton} ${d?L.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${c+1} — ${l.status}`,"aria-label":`Attempt #${c+1}, ${l.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,f&&r.jsx("span",{className:L.attemptStatus,children:f})]},l.id)})]})}function _i(){const{taskId:n,workspaceId:a,environmentId:i}=Qa(),l=wt(),c=Rt(),{events:d,eventsDropped:f,tasks:m,sessions:p,environments:v,findings:g,loadSessionEvents:y,loadFindings:x,kill:S,startTask:T,stopTask:j,resumeTask:N,deleteTask:C,workspaces:w,taskSessions:A,loadTaskSessions:R,sendInput:E,spawn:H,personas:z,provisionEnvironment:I}=rt(),P=b.useRef(void 0),ee=b.useRef(void 0),ne=b.useRef(void 0),ce=b.useRef(void 0),re=b.useRef(void 0),K=l.pathname.endsWith("/stream")?"stream":l.pathname.endsWith("/findings")?"findings":"overview",[ae,O]=b.useState(K),[$,se]=b.useState(!1),[oe,Y]=b.useState(void 0),[be,Ne]=b.useState(""),xe=b.useRef(K);K!==xe.current&&(xe.current=K,K!==ae&&O(K));const J=m.find(Te=>Te.id===n),le=(J==null?void 0:J.workspaceId)||void 0,W=w.find(Te=>Te.id===le);b.useEffect(()=>{if(be===""){if(W!=null&&W.environmentId)Ne(W.environmentId);else if(v.length>0){const Te=v.find(kt=>kt.status==="connected");Ne((Te==null?void 0:Te.id)??v[0].id)}}},[be,W==null?void 0:W.environmentId,v]);const tt=J?A[J.id]??[]:[];let Re;oe&&tt.some(Te=>Te.id===oe)?Re=oe:Re=(J==null?void 0:J.latestSessionId)||void 0;const An=()=>{se(!0)},xa=()=>{if(!J)return;C(J.id),se(!1);const Te=i??(W==null?void 0:W.environmentId);c(J.workspaceId&&Te?Ei(J.workspaceId,Te):"/",{replace:!0})};if((J==null?void 0:J.id)!==ee.current&&(ee.current=J==null?void 0:J.id,oe!==void 0&&Y(void 0),be!==""&&Ne("")),b.useEffect(()=>{if(!(J!=null&&J.id))return;const Te=J.id!==ce.current,kt=J.latestSessionId!==re.current;(Te||kt)&&(ce.current=J.id,re.current=J.latestSessionId,R(J.id))},[J==null?void 0:J.id,J==null?void 0:J.latestSessionId,R]),(J==null?void 0:J.status)!==ne.current){const Te=ne.current===void 0;ne.current=J==null?void 0:J.status;const kt=(J==null?void 0:J.status)==="not_started"?"overview":(J==null?void 0:J.status)==="working"||(J==null?void 0:J.status)==="paused"?"stream":(J==null?void 0:J.status)==="complete"?"findings":void 0;kt&&kt!==ae&&!(Te&&K!=="overview")&&O(kt)}const fn=b.useMemo(()=>new Map(m.map(Te=>[Te.id,Te])),[m]),Fn=b.useMemo(()=>{const Te=Re?d.filter(kt=>kt.sessionId===Re):[];return wh(Nh(Te))},[d,Re]),Ln=J?J.dependsOn.some(Te=>{const kt=fn.get(Te);return kt!==void 0&&kt.status!=="complete"}):!1,hn=b.useMemo(()=>k6(n,i,w,v,fn),[n,i,w,v,fn]);b.useEffect(()=>{Re&&Re!==P.current&&(P.current=Re,y(Re))},[Re,y]),b.useEffect(()=>{ae==="findings"&&le&&x(le)},[ae,le,x]);const In=Te=>{O(Te),c(ya(n,Te==="overview"?void 0:Te,a,i))};return r.jsxs("div",{className:L.panelContainer,children:[r.jsx(Ds,{segments:hn}),r.jsxs("div",{className:L.header,children:[r.jsxs("span",{className:L.headerTitle,children:[r.jsx("span",{"data-testid":"task-title",children:(J==null?void 0:J.title)||n}),J&&r.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:J.status}),(J==null?void 0:J.branch)&&r.jsx("span",{className:L.taskBranch,children:J.branch}),Ln&&r.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),J&&r.jsx($4,{task:J,sessionId:Re,isBlocked:Ln,onStart:()=>T(J.id,void 0,be),onResume:()=>N(J.id),onStop:()=>j(J.id),onPause:()=>Re&&S(Re),onDelete:An,onEdit:()=>c(jk(J.id,a,i))})]}),r.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[r.jsx("button",{role:"tab","aria-selected":ae==="overview",className:`${L.tab} ${ae==="overview"?L.active:""}`,onClick:()=>In("overview"),children:"Overview"}),r.jsx("button",{role:"tab","aria-selected":ae==="stream",className:`${L.tab} ${ae==="stream"?L.active:""}`,onClick:()=>In("stream"),children:"Stream"}),r.jsx("button",{role:"tab","aria-selected":ae==="findings",className:`${L.tab} ${ae==="findings"?L.active:""}`,onClick:()=>In("findings"),children:"Findings"})]}),r.jsxs(Kn,{mode:"wait",children:[ae==="overview"&&r.jsx(Tt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.overviewContent,"data-testid":"task-overview",children:J?r.jsx(P4,{task:J,tasksById:fn,environments:v,workspaces:w,taskSessions:tt,selectedEnvId:be}):r.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),ae==="stream"&&r.jsxs(Tt.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:[r.jsx(q4,{taskSessions:tt,selectedSessionId:Re,onSelect:Te=>Y(Te)}),r.jsx(jh,{events:Fn,eventsDropped:f,emptyState:!Re&&J?Ln?r.jsx("div",{className:L.emptyCta,"data-testid":"stream-blocked-message",children:r.jsx("div",{className:L.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):r.jsxs("div",{className:L.emptyCta,children:[r.jsx("button",{"data-testid":"stream-start-cta",className:L.ctaButton,onClick:()=>T(J.id,void 0,be),children:"Start Task"}),r.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):Re&&Fn.length===0?r.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),ae==="findings"&&r.jsx(Tt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:le?r.jsx(H4,{findings:g.filter(Te=>Te.workspaceId===le)}):r.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!J||J.status!=="working"&&J.status!=="paused")return;const Te=Re?p.find(kt=>kt.id===Re):void 0;if(!(!Te||Te.status==="stopped"))return r.jsx(ol,{mode:"send",sessionId:Te.id,environmentId:Te.environmentId,personas:z,environments:v,onSendInput:E,onSpawn:H,onStartTask:T,onProvisionEnvironment:I})})(),J&&r.jsx(bc,{isOpen:$,title:"Delete Task?",description:`"${J.title}" will be permanently removed.`,onConfirm:xa,onCancel:()=>se(!1)})]})}const Y4="_container_legrg_1",K4="_header_legrg_8",F4="_headerTitle_legrg_35",Z4="_badge_legrg_44",X4="_headerActions_legrg_54",Q4="_body_legrg_61",W4="_formContent_legrg_73",J4="_section_legrg_85",eB="_label_legrg_91",tB="_nameInput_legrg_98",nB="_fieldInput_legrg_131",aB="_adapterSelect_legrg_164",sB="_readOnlyValue_legrg_198",iB="_codespaceSection_legrg_204",oB="_codespaceActions_legrg_210",lB="_creatingHint_legrg_216",rB="_errorHint_legrg_222",cB="_btnPrimary_legrg_235",uB="_btnGhost_legrg_266",te={container:Y4,header:K4,headerTitle:F4,badge:Z4,headerActions:X4,body:Q4,formContent:W4,section:J4,label:eB,nameInput:tB,fieldInput:nB,adapterSelect:aB,readOnlyValue:sB,codespaceSection:iB,codespaceActions:oB,creatingHint:lB,errorHint:rB,btnPrimary:cB,btnGhost:uB},Zr=1,Xr=65535;function af(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=Zr&&a<=Xr}function sf(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function dB({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p}){const[v,g]=b.useState("pick"),[y,x]=b.useState(""),[S,T]=b.useState("");return v==="create"?r.jsxs("div",{className:te.codespaceSection,children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Repository"}),r.jsx("input",{type:"text",value:y,onChange:j=>x(j.target.value),placeholder:"owner/repo",className:te.fieldInput,"data-testid":"env-codespace-repo"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Machine Type"}),r.jsx("input",{type:"text",value:S,onChange:j=>T(j.target.value),placeholder:"Machine type (optional)...",className:te.fieldInput,"data-testid":"env-codespace-machine"})]}),r.jsxs("div",{className:te.codespaceActions,children:[r.jsx("button",{onClick:()=>{y.trim()&&(p(y.trim(),S.trim()||void 0),g("pick"),x(""),T(""))},disabled:!y.trim(),className:te.btnPrimary,children:"Create"}),r.jsx("button",{onClick:()=>{g("pick"),x(""),T("")},className:te.btnGhost,children:"Cancel"})]})]}):r.jsx("div",{className:te.codespaceSection,children:r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Codespace"}),!f&&r.jsxs("select",{value:n,onChange:j=>{j.target.value==="__create__"?(g("create"),a("")):(a(j.target.value),j.target.value&&!i.trim()&&l(j.target.value))},disabled:m,className:te.adapterSelect,"data-testid":"env-codespace-select",children:[r.jsx("option",{value:"",children:"Select a codespace..."}),c.map(j=>r.jsxs("option",{value:j.name,children:[j.name," (",j.repository,") — ",j.state]},j.name)),r.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),m&&r.jsx("span",{className:te.creatingHint,children:"Creating codespace..."}),f&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:te.errorHint,children:f}),r.jsx("input",{type:"text",value:n,onChange:j=>a(j.target.value),placeholder:"Or enter codespace name manually...",className:te.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!f&&r.jsx("span",{className:te.errorHint,children:d})]})})}function Jx({mode:n,environmentId:a,environments:i,onAddEnvironment:l,onUpdateEnvironment:c,onListCodespaces:d,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g}){const{showToast:y}=Es(),x=Rt(),S=n==="edit",T=S&&a?i.find(le=>le.id===a):void 0,[j,N]=b.useState(""),[C,w]=b.useState("local"),[A,R]=b.useState(""),[E,H]=b.useState(""),[z,I]=b.useState(""),[P,ee]=b.useState(""),[ne,ce]=b.useState(""),[re,K]=b.useState(""),[ae,O]=b.useState(""),[$,se]=b.useState(null),oe=b.useCallback(()=>{const le={};if(C==="local"){if(A.trim()&&(le.host=A.trim()),E.trim()){const W=Number(E);Number.isInteger(W)&&(le.port=W)}}else if(C==="ssh"){if(le.host=A.trim(),z.trim()&&(le.user=z.trim()),E.trim()){const W=Number(E);Number.isInteger(W)&&(le.sshPort=W)}P.trim()&&(le.identityFile=P.trim())}else C==="docker"?(ne.trim()&&(le.image=ne.trim()),re.trim()&&(le.repo=re.trim())):C==="codespace"&&(le.codespaceName=ae.trim());return le},[C,A,E,z,P,ne,re,ae]),Y=()=>!(!j.trim()||C==="ssh"&&!A.trim()||C==="codespace"&&!ae.trim()||(C==="local"||C==="ssh")&&!af(E)),be=()=>{Y()&&(l(j.trim(),C,oe()),y("Environment added successfully","success"),x(Ai,{replace:!0}))},Ne=()=>{x(a?Di(a):Ai)},xe=b.useCallback((le,W)=>{if(!T||!a)return;const tt=sf(T.adapterConfig),Re=W.trim();Re?tt[le]=Re:delete tt[le],c(a,{adapterConfig:tt})},[T,a,c]),J=b.useCallback((le,W)=>{if(!T||!a)return;const tt=sf(T.adapterConfig);if(W.trim()){const Re=Number(W);Number.isInteger(Re)&&Re>=Zr&&Re<=Xr&&(tt[le]=Re)}else delete tt[le];c(a,{adapterConfig:tt})},[T,a,c]);if(S){if(!T)return r.jsxs("div",{className:te.container,children:[r.jsxs("div",{className:te.header,children:[r.jsx("div",{className:te.headerTitle,children:r.jsx("span",{className:te.badge,children:"edit environment"})}),r.jsx("div",{className:te.headerActions,children:r.jsx("button",{onClick:Ne,className:te.btnGhost,children:"Back"})})]}),r.jsx("div",{className:te.body,children:r.jsx("div",{className:te.formContent,children:r.jsx("span",{className:te.readOnlyValue,children:"Environment not found"})})})]});const le=sf(T.adapterConfig);return r.jsxs("div",{className:te.container,"data-testid":"env-edit-panel",children:[r.jsxs("div",{className:te.header,children:[r.jsx("div",{className:te.headerTitle,children:r.jsx("span",{className:te.badge,children:"edit environment"})}),r.jsx("div",{className:te.headerActions,children:r.jsx("button",{onClick:Ne,className:te.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),r.jsx("div",{className:te.body,children:r.jsxs("div",{className:te.formContent,children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Name"}),r.jsx(rn,{value:T.displayName,onSave:W=>{a&&c(a,{displayName:W})},validate:W=>W.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:$,onActivate:se,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Adapter Type"}),r.jsx("span",{className:te.readOnlyValue,"data-testid":"env-edit-adapter-type",children:T.adapterType})]}),T.adapterType==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Host"}),r.jsx(rn,{value:String(le.host??""),onSave:W=>xe("host",W),mode:"edit",fieldId:"host",activeFieldId:$,onActivate:se,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Port"}),r.jsx(rn,{value:String(le.port??""),onSave:W=>J("port",W),validate:W=>af(W)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:$,onActivate:se,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),T.adapterType==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Host"}),r.jsx(rn,{value:String(le.host??""),onSave:W=>xe("host",W),validate:W=>W.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:$,onActivate:se,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"User"}),r.jsx(rn,{value:String(le.user??""),onSave:W=>xe("user",W),mode:"edit",fieldId:"user",activeFieldId:$,onActivate:se,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"SSH Port"}),r.jsx(rn,{value:String(le.sshPort??""),onSave:W=>J("sshPort",W),validate:W=>af(W)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:$,onActivate:se,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Identity File"}),r.jsx(rn,{value:String(le.identityFile??""),onSave:W=>xe("identityFile",W),mode:"edit",fieldId:"identityFile",activeFieldId:$,onActivate:se,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),T.adapterType==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Image"}),r.jsx(rn,{value:String(le.image??""),onSave:W=>xe("image",W),mode:"edit",fieldId:"image",activeFieldId:$,onActivate:se,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Repo"}),r.jsx(rn,{value:String(le.repo??""),onSave:W=>xe("repo",W),mode:"edit",fieldId:"repo",activeFieldId:$,onActivate:se,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),T.adapterType==="codespace"&&r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,children:"Codespace Name"}),r.jsx(rn,{value:String(le.codespaceName??""),onSave:W=>xe("codespaceName",W),validate:W=>W.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:$,onActivate:se,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return r.jsxs("div",{className:te.container,"data-testid":"env-create-panel",children:[r.jsxs("div",{className:te.header,children:[r.jsx("div",{className:te.headerTitle,children:r.jsx("span",{className:te.badge,children:"new environment"})}),r.jsxs("div",{className:te.headerActions,children:[r.jsx("button",{onClick:be,disabled:!Y(),className:te.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),r.jsx("button",{onClick:Ne,className:te.btnGhost,children:"Cancel"})]})]}),r.jsx("div",{className:te.body,children:r.jsxs("div",{className:te.formContent,children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-name",children:"Name"}),r.jsx("input",{id:"env-create-name",type:"text",value:j,onChange:le=>N(le.target.value),placeholder:"Environment name...",autoFocus:!0,className:te.nameInput,"data-testid":"env-create-name",onKeyDown:le=>{le.key==="Enter"&&Y()&&be()}})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),r.jsxs("select",{id:"env-create-adapter",value:C,onChange:le=>{w(le.target.value),le.target.value==="codespace"&&d()},className:te.adapterSelect,"data-testid":"env-create-adapter",children:[r.jsx("option",{value:"local",children:"local"}),r.jsx("option",{value:"ssh",children:"ssh"}),r.jsx("option",{value:"docker",children:"docker"}),r.jsx("option",{value:"codespace",children:"codespace"})]})]}),C==="local"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:le=>R(le.target.value),placeholder:"Host (optional)...",className:te.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-port",children:"Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:Zr,max:Xr,value:E,onChange:le=>H(le.target.value),placeholder:"Port (optional)...",className:te.fieldInput,"data-testid":"env-create-port"})]})]}),C==="ssh"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-host",children:"Host"}),r.jsx("input",{id:"env-create-host",type:"text",value:A,onChange:le=>R(le.target.value),placeholder:"Host (required)...",className:te.fieldInput,"data-testid":"env-create-host"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-user",children:"User"}),r.jsx("input",{id:"env-create-user",type:"text",value:z,onChange:le=>I(le.target.value),placeholder:"User (optional)...",className:te.fieldInput,"data-testid":"env-create-user"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-port",children:"SSH Port"}),r.jsx("input",{id:"env-create-port",type:"number",min:Zr,max:Xr,value:E,onChange:le=>H(le.target.value),placeholder:"SSH port (optional)...",className:te.fieldInput,"data-testid":"env-create-port"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-identity",children:"Identity File"}),r.jsx("input",{id:"env-create-identity",type:"text",value:P,onChange:le=>ee(le.target.value),placeholder:"Identity file (optional)...",className:te.fieldInput,"data-testid":"env-create-identity"})]})]}),C==="docker"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-image",children:"Image"}),r.jsx("input",{id:"env-create-image",type:"text",value:ne,onChange:le=>ce(le.target.value),placeholder:"Image (optional)...",className:te.fieldInput,"data-testid":"env-create-image"})]}),r.jsxs("div",{className:te.section,children:[r.jsx("label",{className:te.label,htmlFor:"env-create-repo",children:"Repo"}),r.jsx("input",{id:"env-create-repo",type:"text",value:re,onChange:le=>K(le.target.value),placeholder:"Repo (optional)...",className:te.fieldInput,"data-testid":"env-create-repo"})]})]}),C==="codespace"&&r.jsx(dB,{codespaceName:ae,onCodespaceNameChange:O,envName:j,onEnvNameChange:N,codespaces:f,codespaceError:m,codespaceListError:p,codespaceCreating:v,onCreateCodespace:g})]})})]})}function fB(){const{environments:n,addEnvironment:a,updateEnvironment:i,listCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,createCodespace:p}=rt();return r.jsx(Jx,{mode:"new",environments:n,onAddEnvironment:a,onUpdateEnvironment:i,onListCodespaces:l,codespaces:c,codespaceError:d,codespaceListError:f,codespaceCreating:m,onCreateCodespace:p})}function hB(){const{environmentId:n}=Qa(),{environments:a,addEnvironment:i,updateEnvironment:l,listCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,createCodespace:v}=rt();return r.jsx(Jx,{mode:"edit",environmentId:n,environments:a,onAddEnvironment:i,onUpdateEnvironment:l,onListCodespaces:c,codespaces:d,codespaceError:f,codespaceListError:m,codespaceCreating:p,onCreateCodespace:v})}const mB="_layout_11u79_1",pB="_content_11u79_8",vB="_tabPanel_11u79_14",Wo={layout:mB,content:pB,tabPanel:vB};function gB(){const n=x6();return r.jsxs("div",{className:Wo.layout,children:[r.jsx(Ds,{segments:n}),r.jsx("div",{className:Wo.content,children:r.jsx(ws,{})})]})}const yB="_container_13sb6_1",bB="_envHeader_13sb6_6",xB="_envTitleRow_13sb6_10",_B="_statusDot_13sb6_16",SB="_envName_13sb6_21",TB="_statusBadge_13sb6_27",kB="_envMeta_13sb6_33",CB="_metaTag_13sb6_39",jB="_actions_13sb6_51",NB="_provisionMessage_13sb6_59",wB="_errorMessage_13sb6_64",EB="_section_13sb6_69",AB="_sectionHeader_13sb6_73",DB="_cardList_13sb6_121",RB="_card_13sb6_121",MB="_cardHeader_13sb6_138",OB="_cardName_13sb6_144",BB="_cardActions_13sb6_149",LB="_cardDescription_13sb6_154",IB="_cardMeta_13sb6_160",zB="_repoLink_13sb6_166",UB="_empty_13sb6_174",VB="_btnPrimary_13sb6_180",HB="_btnOutline_13sb6_214",GB="_btnSmall_13sb6_241",PB="_btnDanger_13sb6_267",Ue={container:yB,envHeader:bB,envTitleRow:xB,statusDot:_B,envName:SB,statusBadge:TB,envMeta:kB,metaTag:CB,actions:jB,provisionMessage:NB,errorMessage:wB,section:EB,sectionHeader:AB,cardList:DB,card:RB,cardHeader:MB,cardName:OB,cardActions:BB,cardDescription:LB,cardMeta:IB,repoLink:zB,empty:UB,btnPrimary:VB,btnOutline:HB,btnSmall:GB,btnDanger:PB},$B={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function qB(){const{environmentId:n}=Qa(),a=Rt(),{environments:i,workspaces:l,sessions:c,provisionStatus:d,provisionEnvironment:f,stopEnvironment:m,removeEnvironment:p,archiveWorkspace:v}=rt(),[g,y]=b.useState(!1),[x,S]=b.useState(void 0),T=i.find(P=>P.id===n);if(!n||!T)return r.jsx(Pn,{to:Ai,replace:!0});const j=l.filter(P=>P.environmentId===T.id),N=c.filter(P=>P.environmentId===T.id),C=N.reduce((P,ee)=>P+(ee.costUsd??0),0),w=$B[T.status]||"var(--text-tertiary)",A=T.status==="connected",R=T.status==="connecting",E=T.status==="disconnected"||T.status==="error",H=T.id in d?d[T.id]:void 0,z=()=>{p(T.id),y(!1),a(Ai,{replace:!0})},I=P=>{v(P),S(void 0)};return r.jsxs("div",{className:Ue.container,children:[r.jsx(bc,{isOpen:g,title:"Delete Environment?",description:`"${T.displayName||T.id}" will be permanently removed along with all its data.`,onConfirm:z,onCancel:()=>y(!1)}),r.jsxs("div",{className:Ue.envHeader,children:[r.jsxs("div",{className:Ue.envTitleRow,children:[r.jsx("span",{className:Ue.statusDot,style:{color:w},children:"●"}),r.jsx("h2",{className:Ue.envName,children:T.displayName||T.id}),r.jsx("span",{className:Ue.statusBadge,style:{color:w},children:T.status})]}),r.jsxs("div",{className:Ue.envMeta,children:[r.jsxs("span",{className:Ue.metaTag,children:["Adapter: ",T.adapterType]}),N.length>0&&r.jsxs("span",{className:Ue.metaTag,children:[N.length," session",N.length!==1?"s":""]}),C>0&&r.jsxs("span",{className:Ue.metaTag,children:["Cost: ",Bi(C)]})]})]}),r.jsxs("div",{className:Ue.actions,children:[A&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(Z0(T.id)),children:"New Chat"}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>m(T.id),children:"Stop"})]}),E&&r.jsx("button",{className:Ue.btnPrimary,onClick:()=>f(T.id),children:T.status==="error"?"Retry":"Connect"}),R&&H!==void 0&&r.jsx("span",{className:Ue.provisionMessage,children:H.message}),T.status==="error"&&(H==null?void 0:H.stage)==="error"&&r.jsx("span",{className:Ue.errorMessage,children:H.message}),r.jsx("button",{className:Ue.btnOutline,onClick:()=>a(wk(T.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),r.jsx("button",{className:Ue.btnDanger,onClick:()=>y(!0),children:"Delete"})]}),r.jsxs("div",{className:Ue.section,children:[r.jsxs("div",{className:Ue.sectionHeader,children:[r.jsx("h3",{children:"Workspaces"}),r.jsx("button",{className:Ue.btnPrimary,onClick:()=>a(`${X0}?environment=${encodeURIComponent(T.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),j.length===0&&r.jsx("p",{className:Ue.empty,children:"No workspaces yet. Create one to get started."}),r.jsx("div",{className:Ue.cardList,children:j.map(P=>r.jsx(YB,{workspace:P,confirmArchiveId:x,onOpen:()=>a(Ei(P.id,T.id)),onArchive:()=>S(P.id),onConfirmArchive:()=>I(P.id),onCancelArchive:()=>S(void 0)},P.id))})]})]})}function YB({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:l,onConfirmArchive:c,onCancelArchive:d}){const f=a===n.id,m=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return r.jsxs("div",{className:Ue.card,"data-testid":"workspace-card",children:[r.jsxs("div",{className:Ue.cardHeader,children:[r.jsx("strong",{className:Ue.cardName,children:n.name}),r.jsxs("div",{className:Ue.cardActions,children:[r.jsx("button",{className:Ue.btnSmall,onClick:i,children:"Open"}),f?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:Ue.btnDanger,onClick:c,children:"Confirm"}),r.jsx("button",{className:Ue.btnSmall,onClick:d,children:"Cancel"})]}):r.jsx("button",{className:Ue.btnSmall,onClick:l,children:"Archive"})]})]}),n.description&&r.jsx("p",{className:Ue.cardDescription,children:n.description}),n.repoUrl&&r.jsx("div",{className:Ue.cardMeta,children:m?r.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Ue.repoLink,children:n.repoUrl}):r.jsx("span",{children:n.repoUrl})})]})}const KB={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function FB(){const a=wt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=KB[a],l=b6(i);return r.jsxs("div",{className:Wo.layout,children:[r.jsx(Ds,{segments:l}),r.jsx("div",{className:Wo.content,children:r.jsx("div",{className:Wo.tabPanel,children:r.jsx(ws,{})},a)})]})}const ZB="_section_1ingb_14",XB="_sectionTitle_1ingb_26",QB="_sectionDescription_1ingb_35",WB="_tokenList_1ingb_48",JB="_tokenRow_1ingb_55",e5="_tokenBadge_1ingb_68",t5="_tokenName_1ingb_83",n5="_tokenTarget_1ingb_90",a5="_deleteButton_1ingb_99",s5="_addForm_1ingb_113",i5="_formRow_1ingb_119",o5="_input_1ingb_125",l5="_select_1ingb_155",r5="_addButton_1ingb_187",c5="_emptyStateInfo_1ingb_221",u5="_themeOptions_1ingb_229",d5="_themeOption_1ingb_229",f5="_themeOptionSelected_1ingb_254",h5="_themeOptionHeader_1ingb_259",m5="_themeOptionLabel_1ingb_266",p5="_themeOptionDesc_1ingb_273",v5="_variantToggle_1ingb_279",g5="_variantButton_1ingb_286",y5="_variantActive_1ingb_305",b5="_themeSwatches_1ingb_311",x5="_themeSwatch_1ingb_311",_5="_systemToggle_1ingb_325",S5="_systemToggleHint_1ingb_341",T5="_themeActive_1ingb_348",k5="_aboutGrid_1ingb_354",C5="_aboutItem_1ingb_360",j5="_aboutLabel_1ingb_373",N5="_aboutValue_1ingb_379",w5="_aboutDot_1ingb_387",E5="_aboutDotConnected_1ingb_394",A5="_aboutDotDisconnected_1ingb_398",de={section:ZB,sectionTitle:XB,sectionDescription:QB,tokenList:WB,tokenRow:JB,tokenBadge:e5,tokenName:t5,tokenTarget:n5,deleteButton:a5,addForm:s5,formRow:i5,input:o5,select:l5,addButton:r5,emptyStateInfo:c5,themeOptions:u5,themeOption:d5,themeOptionSelected:f5,themeOptionHeader:h5,themeOptionLabel:m5,themeOptionDesc:p5,variantToggle:v5,variantButton:g5,variantActive:y5,themeSwatches:b5,themeSwatch:x5,systemToggle:_5,systemToggleHint:S5,themeActive:T5,aboutGrid:k5,aboutItem:C5,aboutLabel:j5,aboutValue:N5,aboutDot:w5,aboutDotConnected:E5,aboutDotDisconnected:A5},D5=[{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"}]},{key:"goose",label:"Goose",description:"Forward Goose config and API keys for Goose agent access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function R5({credentialProviders:n,onUpdateCredentialProviders:a}){const i=(l,c)=>{const d={...n};l==="claude"?d.claude=c:d[l]=c,a(d)};return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),r.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."}),r.jsx("div",{className:de.tokenList,children:D5.map(l=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenName,children:l.label}),r.jsx("span",{className:de.tokenTarget,children:l.description}),r.jsx("select",{className:de.select,value:n[l.key],onChange:c=>i(l.key,c.target.value),children:l.options.map(c=>r.jsx("option",{value:c.value,children:c.label},c.value))})]},l.key))})]})}const M5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function O5({tokens:n,onSetToken:a,onDeleteToken:i}){const{showToast:l}=Es(),[c,d]=b.useState(""),[f,m]=b.useState(""),[p,v]=b.useState("env_var"),[g,y]=b.useState(""),[x,S]=b.useState(null),T=C=>{if(C.preventDefault(),!c||!f)return;const w=p==="env_var"?g||c.toUpperCase()+"_TOKEN":"";a(c,f,p,w,p==="file"?g:""),l("Token saved successfully","success"),d(""),m(""),y("")},j=C=>{S(C)},N=()=>{x&&(i(x),l("Token deleted","info")),S(null)};return r.jsxs(r.Fragment,{children:[r.jsx(bc,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),r.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?r.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):r.jsx("div",{className:de.tokenList,children:n.map(C=>r.jsxs("div",{className:de.tokenRow,children:[r.jsx("span",{className:de.tokenBadge,children:C.tokenType}),r.jsx("span",{className:de.tokenName,children:C.name}),r.jsx("span",{className:de.tokenTarget,children:C.tokenType==="env_var"?C.envVar:C.filePath}),r.jsx("button",{className:de.deleteButton,onClick:()=>j(C.name),title:`Delete ${C.name}`,children:"×"})]},C.name))}),r.jsxs("form",{className:de.addForm,onSubmit:T,children:[r.jsxs("div",{className:de.formRow,children:[r.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:c,onChange:C=>d(C.target.value)}),r.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:f,onChange:C=>m(C.target.value)})]}),r.jsxs("div",{className:de.formRow,children:[r.jsx("select",{className:de.select,value:p,onChange:C=>v(C.target.value),children:M5.map(C=>r.jsx("option",{value:C.value,children:C.label},C.value))}),r.jsx("input",{className:de.input,type:"text",placeholder:p==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:g,onChange:C=>y(C.target.value)}),r.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function B5(){const{tokens:n,setToken:a,deleteToken:i,credentialProviders:l,updateCredentialProviders:c}=rt();return r.jsxs(r.Fragment,{children:[r.jsx(R5,{credentialProviders:l,onUpdateCredentialProviders:c}),r.jsx(O5,{tokens:n,onSetToken:a,onDeleteToken:i})]})}const L5="_container_xb7ms_1",I5="_header_xb7ms_7",z5="_form_xb7ms_19",U5="_formActions_xb7ms_87",V5="_list_xb7ms_93",H5="_card_xb7ms_99",G5="_active_xb7ms_109",P5="_cardHeader_xb7ms_113",$5="_cardTitle_xb7ms_123",q5="_defaultBadge_xb7ms_129",Y5="_cardActions_xb7ms_143",K5="_description_xb7ms_148",F5="_meta_xb7ms_154",Z5="_promptDetails_xb7ms_171",X5="_promptText_xb7ms_183",Q5="_empty_xb7ms_200",W5="_btnPrimary_xb7ms_206",J5="_btnSecondary_xb7ms_240",eL="_btnSmall_xb7ms_267",tL="_btnDanger_xb7ms_293",nL="_typeToggle_xb7ms_336",aL="_typeBadge_xb7ms_350",sL="_scriptEditor_xb7ms_364",iL="_optional_xb7ms_371",qe={container:L5,header:I5,form:z5,formActions:U5,list:V5,card:H5,active:G5,cardHeader:P5,cardTitle:$5,defaultBadge:q5,cardActions:Y5,description:K5,meta:F5,promptDetails:Z5,promptText:X5,empty:Q5,btnPrimary:W5,btnSecondary:J5,btnSmall:eL,btnDanger:tL,typeToggle:nL,typeBadge:aL,scriptEditor:sL,optional:iL};function oL({personas:n,appDefaultPersonaId:a,onCreatePersona:i,onUpdatePersona:l,onDeletePersona:c,onSetAppDefaultPersonaId:d}){const[f,m]=b.useState(null),[p,v]=b.useState(!1),[g,y]=b.useState(null),[x,S]=b.useState(""),[T,j]=b.useState(""),[N,C]=b.useState(""),[w,A]=b.useState("claude-code"),[R,E]=b.useState("sonnet"),[H,z]=b.useState(0),[I,P]=b.useState("agent"),[ee,ne]=b.useState(""),ce=()=>{S(""),j(""),C(""),A("claude-code"),E("sonnet"),z(0),P("agent"),ne("")},re=()=>{ce(),m(null),v(!0)},K=Y=>{S(Y.name),j(Y.description),C(Y.systemPrompt);const be=Y.type==="script"?"script":"agent";A(be==="script"?Y.runtime||"genaiscript":Y.runtime),E(Y.model),z(Y.maxTurns),P(be),ne(Y.script||""),m(Y),v(!1)},ae=Y=>{P(Y),Y==="script"?A("genaiscript"):w==="genaiscript"&&A("claude-code")},O=Y=>{if(Y.preventDefault(),!!x.trim()){if(I==="script"){if(!ee.trim())return}else if(!N.trim()||!w||!R)return;f?(l(f.id,x,T,N,w,R,H,I,ee),m(null)):(i(x,T,N,w,R,H,I,ee),v(!1)),ce()}},$=Y=>{c(Y),y(null),(f==null?void 0:f.id)===Y&&(m(null),ce())},se=()=>{m(null),v(!1),ce()},oe=()=>r.jsxs("form",{onSubmit:O,className:qe.form,children:[r.jsx("h3",{children:f?"Edit Persona":"Create Persona"}),r.jsxs("div",{className:qe.typeToggle,"data-testid":"persona-type-toggle",children:[r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:I==="agent",onChange:()=>ae("agent")}),"Agent"]}),r.jsxs("label",{children:[r.jsx("input",{type:"radio",name:"personaType",value:"script",checked:I==="script",onChange:()=>ae("script")}),"Script"]})]}),r.jsxs("label",{children:["Name",r.jsx("input",{type:"text",value:x,onChange:Y=>S(Y.target.value),placeholder:I==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),r.jsxs("label",{children:["Description",r.jsx("input",{type:"text",value:T,onChange:Y=>j(Y.target.value),placeholder:"Brief description..."})]}),r.jsxs("label",{children:["Runtime",r.jsx("select",{value:w,onChange:Y=>A(Y.target.value),"data-testid":"persona-runtime-select",children:I==="script"?r.jsx("option",{value:"genaiscript",children:"genaiscript"}):r.jsxs(r.Fragment,{children:[r.jsx("option",{value:"claude-code",children:"claude-code"}),r.jsx("option",{value:"codex",children:"codex"}),r.jsx("option",{value:"copilot",children:"copilot"}),r.jsx("option",{value:"goose",children:"goose"}),r.jsx("option",{value:"stub",children:"stub"}),r.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),r.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),r.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),I==="agent"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model",r.jsx("input",{type:"text",value:R,onChange:Y=>E(Y.target.value),placeholder:"e.g. sonnet"})]}),r.jsxs("label",{children:["Max Turns",r.jsx("input",{type:"number",value:H,onChange:Y=>z(parseInt(Y.target.value,10)||0),min:0})]}),r.jsxs("label",{children:["System Prompt",r.jsx("textarea",{value:N,onChange:Y=>C(Y.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),I==="script"&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{children:["Model ",r.jsx("span",{className:qe.optional,children:"(optional)"}),r.jsx("input",{type:"text",value:R,onChange:Y=>E(Y.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),r.jsxs("label",{children:["System Prompt ",r.jsx("span",{className:qe.optional,children:"(optional)"}),r.jsx("textarea",{value:N,onChange:Y=>C(Y.target.value),placeholder:"Optional context for the script...",rows:4})]}),r.jsxs("label",{children:["Script",r.jsx("textarea",{value:ee,onChange:Y=>ne(Y.target.value),placeholder:`script({ model: "openai:gpt-4o" });
106
-
107
- const grackle = await host.mcpServer({
108
- id: "grackle",
109
- url: env.vars.GRACKLE_MCP_URL,
110
- });
111
-
112
- $\`Summarize the current tasks.\`;`,rows:20,className:qe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),r.jsxs("div",{className:qe.formActions,children:[r.jsx("button",{type:"submit",className:qe.btnPrimary,children:f?"Save":"Create"}),r.jsx("button",{type:"button",onClick:se,className:qe.btnSecondary,children:"Cancel"})]})]});return r.jsxs("div",{className:qe.container,children:[r.jsxs("div",{className:qe.header,children:[r.jsx("h2",{children:"Personas"}),r.jsx("button",{onClick:re,className:qe.btnPrimary,children:"+ New Persona"})]}),(p||f)&&oe(),n.length===0&&!p?r.jsx("p",{className:qe.empty,children:"No personas yet. Create one to get started."}):r.jsx("div",{className:qe.list,children:n.map(Y=>{const be=a===Y.id,Ne=Y.type==="script";return r.jsxs("div",{className:`${qe.card} ${(f==null?void 0:f.id)===Y.id?qe.active:""}`,"data-testid":`persona-card-${Y.id}`,children:[r.jsxs("div",{className:qe.cardHeader,children:[r.jsxs("span",{className:qe.cardTitle,children:[r.jsx("strong",{children:Y.name}),r.jsx("span",{className:qe.typeBadge,"data-testid":`persona-type-badge-${Y.id}`,children:Ne?"Script":"Agent"}),be&&r.jsx("span",{className:qe.defaultBadge,"data-testid":`persona-default-badge-${Y.id}`,children:"App Default"})]}),r.jsxs("div",{className:qe.cardActions,children:[!be&&r.jsx("button",{onClick:()=>d(Y.id),className:qe.btnSmall,"data-testid":`persona-set-default-${Y.id}`,title:"Set as app default persona",children:"Set Default"}),r.jsx("button",{onClick:()=>K(Y),className:qe.btnSmall,children:"Edit"}),g===Y.id?r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>$(Y.id),className:qe.btnDanger,children:"Confirm"}),r.jsx("button",{onClick:()=>y(null),className:qe.btnSmall,children:"Cancel"})]}):r.jsx("button",{onClick:()=>y(Y.id),className:qe.btnSmall,children:"Delete"})]})]}),Y.description&&r.jsx("p",{className:qe.description,children:Y.description}),r.jsxs("div",{className:qe.meta,children:[Y.runtime&&r.jsxs("span",{children:["Runtime: ",Y.runtime]}),Y.model&&r.jsxs("span",{children:["Model: ",Y.model]}),Y.maxTurns>0&&r.jsxs("span",{children:["Max turns: ",Y.maxTurns]})]}),Ne?r.jsxs("details",{className:qe.promptDetails,children:[r.jsx("summary",{children:"Script"}),r.jsx("pre",{className:qe.promptText,children:Y.script})]}):r.jsxs("details",{className:qe.promptDetails,children:[r.jsx("summary",{children:"System Prompt"}),r.jsx("pre",{className:qe.promptText,children:Y.systemPrompt})]})]},Y.id)})})]})}function lL(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:c,setAppDefaultPersonaId:d}=rt();return r.jsx(oL,{personas:n,appDefaultPersonaId:c,onCreatePersona:a,onUpdatePersona:i,onDeletePersona:l,onSetAppDefaultPersonaId:d})}function rL(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:c}=sb();return r.jsxs("section",{className:de.section,children:[r.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),r.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),r.jsx("div",{className:de.themeOptions,children:dc.filter(d=>!d.hidden).map(d=>{const f=!!(d.variantLightId&&d.variantDarkId),m=f?n===d.id||n===d.variantLightId||n===d.variantDarkId:n===d.id,p=f&&a===d.variantLightId;return r.jsxs("button",{type:"button",className:`${de.themeOption} ${m?de.themeOptionSelected:""}`,"aria-pressed":m,onClick:()=>i(d.id),children:[r.jsxs("span",{className:de.themeOptionHeader,children:[r.jsxs("span",{children:[r.jsx("span",{className:de.themeOptionLabel,children:d.label}),r.jsx("span",{className:de.themeOptionDesc,children:d.description})]}),f&&r.jsxs("span",{className:de.variantToggle,children:[r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${m&&p?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantLightId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantLightId))},"aria-label":"Light variant","aria-pressed":m&&p,children:"☼"}),r.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${m&&!p?de.variantActive:""}`,onClick:v=>{v.stopPropagation(),c(!1),i(d.variantDarkId)},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),c(!1),i(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":m&&!p,children:"☾"})]})]}),d.swatches&&r.jsx("span",{className:de.themeSwatches,children:d.swatches.map((v,g)=>r.jsx("span",{className:de.themeSwatch,style:{background:v}},g))})]},d.id)})}),r.jsxs("label",{className:de.systemToggle,children:[r.jsx("input",{type:"checkbox",checked:l,onChange:d=>c(d.target.checked)}),r.jsx("span",{children:"Match system light/dark preference"})]}),r.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),r.jsxs("p",{className:de.themeActive,children:["Active theme: ",r.jsx("strong",{children:a})]})]})}function cL(){return r.jsx(rL,{})}function uL({connected:n,environments:a,sessions:i}){const l=a.filter(f=>f.status==="connected").length,c=a.length,d=i.filter(f=>["running","idle"].includes(f.status)).length;return r.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[r.jsx("h3",{className:de.sectionTitle,children:"About"}),r.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),r.jsxs("div",{className:de.aboutGrid,children:[r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Connection"}),r.jsxs("span",{className:de.aboutValue,children:[r.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Environments"}),r.jsxs("span",{className:de.aboutValue,children:[l,"/",c," connected"]})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),r.jsx("span",{className:de.aboutValue,children:d})]}),r.jsxs("div",{className:de.aboutItem,children:[r.jsx("span",{className:de.aboutLabel,children:"Version"}),r.jsx("span",{className:de.aboutValue,children:"0.75.11"})]})]})]})}function dL(){const{connected:n,environments:a,sessions:i}=rt();return r.jsx(uL,{connected:n,environments:a,sessions:i})}const fL="_wizard_1260s_1",hL="_container_1260s_10",mL="_stepContent_1260s_19",pL="_logoArea_1260s_28",vL="_logoImage_1260s_32",gL="_heading_1260s_41",yL="_tagline_1260s_49",bL="_subtitle_1260s_56",xL="_featureList_1260s_64",_L="_runtimeGrid_1260s_89",SL="_runtimeCard_1260s_101",TL="_runtimeName_1260s_133",kL="_runtimeDescription_1260s_139",CL="_buttonRow_1260s_144",jL="_primaryButton_1260s_151",NL="_ghostButton_1260s_185",wL="_dots_1260s_213",EL="_dot_1260s_213",nt={wizard:fL,container:hL,stepContent:mL,logoArea:pL,logoImage:vL,heading:gL,tagline:yL,subtitle:bL,featureList:xL,runtimeGrid:_L,runtimeCard:SL,runtimeName:TL,runtimeDescription:kL,buttonRow:CL,primaryButton:jL,ghostButton:NL,dots:wL,dot:EL};function AL({onNext:n}){return r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-welcome",children:[r.jsx("div",{className:nt.logoArea,children:r.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:nt.logoImage})}),r.jsx("h1",{className:nt.heading,children:"Welcome to Grackle"}),r.jsx("p",{className:nt.tagline,children:"Multi-agent orchestration for software teams"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function DL({onNext:n,onBack:a}){return r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-about",children:[r.jsx("h2",{className:nt.heading,children:"What is Grackle?"}),r.jsxs("ul",{className:nt.featureList,children:[r.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),r.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),r.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),r.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),r.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),r.jsxs("div",{className:nt.buttonRow,children:[r.jsx("button",{type:"button",className:nt.ghostButton,onClick:a,children:"Back"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const RL=[{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"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function ML({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[c,d]=b.useState(n||"claude-code");return b.useEffect(()=>{n&&d(n)},[n]),r.jsxs("div",{className:nt.stepContent,"data-testid":"setup-runtime",children:[r.jsx("h2",{className:nt.heading,children:"Choose Your Runtime"}),r.jsx("p",{className:nt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),r.jsx("div",{className:nt.runtimeGrid,children:RL.map(f=>r.jsxs("button",{type:"button",className:nt.runtimeCard,"data-selected":c===f.id,"aria-pressed":c===f.id,"data-testid":`runtime-card-${f.id}`,onClick:()=>d(f.id),children:[r.jsx("span",{className:nt.runtimeName,children:f.name}),r.jsx("span",{className:nt.runtimeDescription,children:f.description})]},f.id))}),r.jsxs("div",{className:nt.buttonRow,children:[r.jsx("button",{type:"button",className:nt.ghostButton,onClick:i,children:"Back"}),r.jsx("button",{type:"button",className:nt.primaryButton,onClick:()=>a(c),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const OL=3,j0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function BL(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=rt(),c=Rt(),[d,f]=b.useState(0),m=n.find(v=>v.id==="claude-code"),p=b.useCallback(v=>{if(m&&v!==m.runtime){const y=j0[v]??"sonnet";a(m.id,void 0,void 0,void 0,v,y)}const g=n.find(y=>y.id===Eg);if(g&&v!==g.runtime){const y=j0[v]??"sonnet";a(Eg,void 0,void 0,void 0,v,y)}i(),c("/",{replace:!0})},[m,n,a,i,c]);return l===!0?r.jsx(Pn,{to:"/",replace:!0}):r.jsx("div",{className:nt.wizard,"data-testid":"setup-wizard",children:r.jsxs("div",{className:nt.container,children:[r.jsx(Kn,{mode:"wait",children:r.jsxs(Tt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[d===0&&r.jsx(AL,{onNext:()=>f(1)}),d===1&&r.jsx(DL,{onNext:()=>f(2),onBack:()=>f(0)}),d===2&&r.jsx(ML,{currentRuntime:(m==null?void 0:m.runtime)??"claude-code",onFinish:p,onBack:()=>f(1),finishDisabled:!m})]},d)}),r.jsx("div",{className:nt.dots,children:Array.from({length:OL},(v,g)=>r.jsx("span",{className:nt.dot,"data-active":g===d},g))})]})})}const LL="_root_zndgp_1",IL="_body_zndgp_7",zL="_main_zndgp_19",UL="_sidebarWrapper_zndgp_26",VL="_overlay_zndgp_51",qo={root:LL,body:IL,main:zL,sidebarWrapper:UL,overlay:VL},HL=b.lazy(()=>V1(()=>import("./KnowledgePage-C1HWFBSg.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.KnowledgePage}))),GL=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function PL(){const{connected:n,environments:a,sessions:i,tasks:l}=rt(),c=wt(),f=lb()!==void 0,[m,p]=b.useState(!1),v=b.useCallback(()=>p(g=>!g),[]);return b.useEffect(()=>{p(!1)},[c.pathname]),b.useEffect(()=>{if(!m)return;const g=y=>{y.key==="Escape"&&p(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[m]),r.jsxs(r.Fragment,{children:[r.jsx(EC,{connected:n,environments:a,sessions:i,onToggleSidebar:f?v:void 0,sidebarOpen:m}),r.jsx(LC,{}),r.jsxs("div",{className:qo.body,children:[f&&r.jsx("div",{className:qo.sidebarWrapper,"data-sidebar-open":m,children:r.jsx($C,{})}),f&&m&&r.jsx("div",{className:qo.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),r.jsxs("div",{className:qo.main,children:[r.jsx(ws,{}),r.jsx(VA,{sessions:i,tasks:l,environments:a})]})]}),r.jsx(JA,{})]})}function $L(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:l}=rt(),{showToast:c}=Es();pR(a,c);const d=Rt(),f=wt();return b.useEffect(()=>{n&&!f.pathname.includes("/tasks/")&&d(F0(n),{replace:!0})},[n,d,f.pathname]),i&&l===!1?r.jsx(Pn,{to:"/setup",replace:!0}):r.jsx(IC,{children:r.jsx("div",{className:qo.root,children:r.jsx(PL,{})})})}function of(){const{workspaceId:n}=Qa(),{workspaces:a}=rt(),i=wt(),l=a.find(p=>p.id===n);if(!(l!=null&&l.environmentId))return a.length===0?void 0:r.jsx(Pn,{to:"/environments",replace:!0});const c=encodeURIComponent(n),d=`/workspaces/${c}`,f=i.pathname.startsWith(d)?i.pathname.slice(d.length):"",m=`/environments/${encodeURIComponent(l.environmentId)}/workspaces/${c}${f}${i.search}${i.hash}`;return r.jsx(Pn,{to:m,replace:!0})}function qL(){return r.jsxs(qT,{children:[r.jsx(ke,{path:"setup",element:r.jsx(BL,{})}),r.jsxs(ke,{element:r.jsx($L,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(G3,{})}),r.jsx(ke,{path:"chat",element:r.jsx(g6,{})}),r.jsx(ke,{path:"sessions/new",element:r.jsx(C6,{})}),r.jsx(ke,{path:"sessions/:sessionId",element:r.jsx(w6,{})}),r.jsx(ke,{element:r.jsx(RA,{}),children:r.jsx(ke,{path:"knowledge",element:r.jsx(b.Suspense,{fallback:r.jsx(Yx,{}),children:r.jsx(HL,{})})})}),r.jsxs(ke,{element:r.jsx(EA,{}),children:[r.jsx(ke,{path:"tasks",element:r.jsx(V3,{})}),r.jsx(ke,{path:"tasks/new",element:r.jsx(S0,{})}),r.jsx(ke,{path:"tasks/:taskId",element:r.jsx(_i,{})}),r.jsx(ke,{path:"tasks/:taskId/stream",element:r.jsx(_i,{})}),r.jsx(ke,{path:"tasks/:taskId/findings",element:r.jsx(_i,{})}),r.jsx(ke,{path:"tasks/:taskId/edit",element:r.jsx(T0,{})})]}),r.jsxs(ke,{element:r.jsx(AA,{}),children:[r.jsx(ke,{path:"workspaces",element:r.jsx(Pn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"workspaces/new",element:r.jsx(E4,{})}),r.jsx(ke,{path:"workspaces/:workspaceId",element:r.jsx(of,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:r.jsx(of,{})}),r.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:r.jsx(of,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:r.jsx(KO,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:r.jsx(S0,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:r.jsx(_i,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:r.jsx(_i,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:r.jsx(_i,{})}),r.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:r.jsx(T0,{})}),r.jsxs(ke,{path:"environments",element:r.jsx(gB,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(H3,{})}),r.jsx(ke,{path:"new",element:r.jsx(fB,{})}),r.jsx(ke,{path:":environmentId",element:r.jsx(qB,{})}),r.jsx(ke,{path:":environmentId/edit",element:r.jsx(hB,{})})]})]}),r.jsx(ke,{element:r.jsx(DA,{}),children:r.jsxs(ke,{path:"settings",element:r.jsx(FB,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(Pn,{to:"credentials",replace:!0})}),r.jsx(ke,{path:"environments",element:r.jsx(Pn,{to:"/environments",replace:!0})}),r.jsx(ke,{path:"credentials",element:r.jsx(B5,{})}),r.jsx(ke,{path:"tokens",element:r.jsx(Pn,{to:"../credentials",replace:!0})}),r.jsx(ke,{path:"personas",element:r.jsx(lL,{})}),r.jsx(ke,{path:"appearance",element:r.jsx(cL,{})}),r.jsx(ke,{path:"about",element:r.jsx(dL,{})})]})}),r.jsx(ke,{path:"*",element:r.jsx(Pn,{to:"/",replace:!0})})]})]})}const YL=1e4;function KL(){const{onboardingCompleted:n}=rt(),[a,i]=b.useState(!1);b.useEffect(()=>{if(n!==void 0)return;const c=setTimeout(()=>i(!0),YL);return()=>clearTimeout(c)},[n]);const l=n===void 0&&!a;return r.jsx(Kn,{mode:"wait",children:l?r.jsx(Tt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:r.jsx(Yx,{})},"splash"):r.jsx(Tt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:r.jsx(vk,{children:r.jsx(qL,{})})},"app")})}function FL(){const n=GL?hC:sC;return r.jsx(bC,{children:r.jsx(pC,{children:r.jsx(n,{children:r.jsx(KL,{})})})})}I1.createRoot(document.getElementById("root")).render(r.jsx(b.StrictMode,{children:r.jsx(FL,{})}));export{Ds as B,Q0 as K,rt as a,F0 as s,ya as t,Rt as u};