@grackle-ai/web 0.70.6 → 0.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,112 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-B96DoL0R.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
+ import{r as FS,a as x,j as c,v as qS,b as KS,t as Hr,i as YS,f as ZS,M as eh,c as th}from"./markdown-gcy1Jmzi.js";import{r as XS,d as Yv,H as Zv,P as Xv,i as QS,B as WS,a as JS,C as eT,M as tT}from"./dagview-BA5TtMAQ.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Kd={exports:{}},$o={},Yd={exports:{}},Zd={};/**
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 Qv;function nT(){return Qv||(Qv=1,(function(n){function a(I,H){var oe=I.length;I.push(H);e:for(;0<oe;){var G=oe-1>>>1,O=I[G];if(0<r(O,H))I[G]=H,I[oe]=O,oe=G;else break e}}function i(I){return I.length===0?null:I[0]}function o(I){if(I.length===0)return null;var H=I[0],oe=I.pop();if(oe!==H){I[0]=oe;e:for(var G=0,O=I.length,ie=O>>>1;G<ie;){var be=2*(G+1)-1,re=I[be],Fe=be+1,vt=I[Fe];if(0>r(re,oe))Fe<O&&0>r(vt,re)?(I[G]=vt,I[Fe]=oe,G=Fe):(I[G]=re,I[be]=oe,G=be);else if(Fe<O&&0>r(vt,oe))I[G]=vt,I[Fe]=oe,G=Fe;else break e}}return H}function r(I,H){var oe=I.sortIndex-H.sortIndex;return oe!==0?oe:I.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],g=[],y=1,v=null,b=3,S=!1,k=!1,C=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var H=i(g);H!==null;){if(H.callback===null)o(g);else if(H.startTime<=I)o(g),H.sortIndex=H.expirationTime,a(m,H);else break;H=i(g)}}function j(I){if(C=!1,D(I),!k)if(i(m)!==null)k=!0,q||(q=!0,te());else{var H=i(g);H!==null&&ne(j,H.startTime-I)}}var q=!1,P=-1,B=5,Y=-1;function X(){return N?!0:!(n.unstable_now()-Y<B)}function ae(){if(N=!1,q){var I=n.unstable_now();Y=I;var H=!0;try{e:{k=!1,C&&(C=!1,w(P),P=-1),S=!0;var oe=b;try{t:{for(D(I),v=i(m);v!==null&&!(v.expirationTime>I&&X());){var G=v.callback;if(typeof G=="function"){v.callback=null,b=v.priorityLevel;var O=G(v.expirationTime<=I);if(I=n.unstable_now(),typeof O=="function"){v.callback=O,D(I),H=!0;break t}v===i(m)&&o(m),D(I)}else o(m);v=i(m)}if(v!==null)H=!0;else{var ie=i(g);ie!==null&&ne(j,ie.startTime-I),H=!1}}break e}finally{v=null,b=oe,S=!1}H=void 0}}finally{H?te():q=!1}}}var te;if(typeof M=="function")te=function(){M(ae)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,F=Q.port2;Q.port1.onmessage=ae,te=function(){F.postMessage(null)}}else te=function(){E(ae,0)};function ne(I,H){P=E(function(){I(n.unstable_now())},H)}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(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(I){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var oe=b;b=H;try{return I()}finally{b=oe}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(I,H){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var oe=b;b=I;try{return H()}finally{b=oe}},n.unstable_scheduleCallback=function(I,H,oe){var G=n.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?G+oe:G):oe=G,I){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=oe+O,I={id:y++,callback:H,priorityLevel:I,startTime:oe,expirationTime:O,sortIndex:-1},oe>G?(I.sortIndex=oe,a(g,I),i(m)===null&&I===i(g)&&(C?(w(P),P=-1):C=!0,ne(j,oe-G))):(I.sortIndex=O,a(m,I),k||S||(k=!0,q||(q=!0,te()))),I},n.unstable_shouldYield=X,n.unstable_wrapCallback=function(I){var H=b;return function(){var oe=b;b=H;try{return I.apply(this,arguments)}finally{b=oe}}}})(Zd)),Zd}var Wv;function aT(){return Wv||(Wv=1,Yd.exports=nT()),Yd.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 Jv;function sT(){if(Jv)return $o;Jv=1;var n=aT(),a=FS(),i=XS();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(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 d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,l=t;;){var f=s.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===s)return m(f),e;if(h===l)return m(f),t;h=h.sibling}throw Error(o(188))}if(s.return!==l.return)s=f,l=h;else{for(var _=!1,T=f.child;T;){if(T===s){_=!0,s=f,l=h;break}if(T===l){_=!0,l=f,s=h;break}T=T.sibling}if(!_){for(T=h.child;T;){if(T===s){_=!0,s=h,l=f;break}if(T===l){_=!0,l=h,s=f;break}T=T.sibling}if(!_)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),M=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function te(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case j:return"Suspense";case q:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case M:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return t=e.displayName||null,t!==null?t:F(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return F(e(t))}catch{}}return null}var ne=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},G=[],O=-1;function ie(e){return{current:e}}function be(e){0>O||(e.current=G[O],G[O]=null,O--)}function re(e,t){O++,G[O]=e.current,e.current=t}var Fe=ie(null),vt=ie(null),fe=ie(null),At=ie(null);function pn(e,t){switch(re(fe,t),re(vt,e),re(Fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vv(t),e=yv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}be(Fe),re(Fe,e)}function Dn(){be(Fe),be(vt),be(fe)}function In(e){e.memoizedState!==null&&re(At,e);var t=Fe.current,s=yv(t,e.type);t!==s&&(re(vt,e),re(Fe,s))}function Se(e){vt.current===e&&(be(Fe),be(vt)),At.current===e&&(be(At),Vo._currentValue=oe)}var ft,Ls;function Ln(e){if(ft===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);ft=t&&t[1]||"",Ls=-1<s.stack.indexOf(`
19
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
20
+ `+ft+e+Ls}var Us=!1;function zs(e,t){if(!e||Us)return"";Us=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(K){var $=K}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(K){$=K}e.call(ee.prototype)}}else{try{throw Error()}catch(K){$=K}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(K){if(K&&$&&typeof K.stack=="string")return[K.stack,$.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],T=h[1];if(_&&T){var A=_.split(`
21
+ `),V=T.split(`
22
+ `);for(f=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;if(l===A.length||f===V.length)for(l=A.length-1,f=V.length-1;1<=l&&0<=f&&A[l]!==V[f];)f--;for(;1<=l&&0<=f;l--,f--)if(A[l]!==V[f]){if(l!==1||f!==1)do if(l--,f--,0>f||A[l]!==V[f]){var Z=`
23
+ `+A[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=f);break}}}finally{Us=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ln(s):""}function Cl(e,t){switch(e.tag){case 26:case 27:case 5:return Ln(e.type);case 16:return Ln("Lazy");case 13:return e.child!==t&&t!==null?Ln("Suspense Fallback"):Ln("Suspense");case 19:return Ln("SuspenseList");case 0:case 15:return zs(e.type,!1);case 11:return zs(e.type.render,!1);case 1:return zs(e.type,!0);case 31:return Ln("Activity");default:return""}}function Qi(e){try{var t="",s=null;do t+=Cl(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
24
+ Error generating stack: `+l.message+`
25
+ `+l.stack}}var Vs=Object.prototype.hasOwnProperty,Hs=n.unstable_scheduleCallback,Ps=n.unstable_cancelCallback,El=n.unstable_shouldYield,Nl=n.unstable_requestPaint,Lt=n.unstable_now,Oc=n.unstable_getCurrentPriorityLevel,J=n.unstable_ImmediatePriority,le=n.unstable_UserBlockingPriority,ce=n.unstable_NormalPriority,_e=n.unstable_LowPriority,xe=n.unstable_IdlePriority,Qe=n.log,Ee=n.unstable_setDisableYieldValue,ht=null,Ne=null;function lt(e){if(typeof Qe=="function"&&Ee(e),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(ht,e)}catch{}}var qe=Math.clz32?Math.clz32:Ut,Pt=Math.log,en=Math.LN2;function Ut(e){return e>>>=0,e===0?32:31-(Pt(e)/en|0)|0}var Ta=256,mn=262144,ka=4194304;function os(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 wl(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var T=l&134217727;return T!==0?(l=T&~h,l!==0?f=os(l):(_&=T,_!==0?f=os(_):s||(s=T&~e,s!==0&&(f=os(s))))):(T=l&~h,T!==0?f=os(T):_!==0?f=os(_):s||(s=l&~e,s!==0&&(f=os(s)))),f===0?0:t!==0&&t!==f&&(t&h)===0&&(h=f&-f,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:f}function Wi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function M_(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 Wh(){var e=ka;return ka<<=1,(ka&62914560)===0&&(ka=4194304),e}function Bc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ji(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function R_(e,t,s,l,f,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 T=e.entanglements,A=e.expirationTimes,V=e.hiddenUpdates;for(s=_&~s;0<s;){var Z=31-qe(s),ee=1<<Z;T[Z]=0,A[Z]=-1;var $=V[Z];if($!==null)for(V[Z]=null,Z=0;Z<$.length;Z++){var K=$[Z];K!==null&&(K.lane&=-536870913)}s&=~ee}l!==0&&Jh(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~t))}function Jh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-qe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function ep(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-qe(s),f=1<<l;f&t|e[l]&t&&(e[l]|=t),s&=~f}}function tp(e,t){var s=t&-t;return s=(s&42)!==0?1:Ic(s),(s&(e.suspendedLanes|t))!==0?0:s}function Ic(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 Lc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function np(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Hv(e.type))}function ap(e,t){var s=H.p;try{return H.p=e,t()}finally{H.p=s}}var Ca=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Ca,qt="__reactProps$"+Ca,Gs="__reactContainer$"+Ca,Uc="__reactEvents$"+Ca,O_="__reactListeners$"+Ca,B_="__reactHandles$"+Ca,sp="__reactResources$"+Ca,eo="__reactMarker$"+Ca;function zc(e){delete e[Dt],delete e[qt],delete e[Uc],delete e[O_],delete e[B_]}function $s(e){var t=e[Dt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gs]||s[Dt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Cv(e);e!==null;){if(s=e[Dt])return s;e=Cv(e)}return t}e=s,s=e.parentNode}return null}function Fs(e){if(e=e[Dt]||e[Gs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function to(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function qs(e){var t=e[sp];return t||(t=e[sp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[eo]=!0}var ip=new Set,op={};function ls(e,t){Ks(e,t),Ks(e+"Capture",t)}function Ks(e,t){for(op[e]=t,e=0;e<t.length;e++)ip.add(t[e])}var I_=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]*$"),lp={},rp={};function L_(e){return Vs.call(rp,e)?!0:Vs.call(lp,e)?!1:I_.test(e)?rp[e]=!0:(lp[e]=!0,!1)}function jl(e,t,s){if(L_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Al(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 Qn(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U_(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(_){s=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vc(e){if(!e._valueTracker){var t=cp(e)?"checked":"value";e._valueTracker=U_(e,t,""+e[t])}}function up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=cp(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function Dl(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 z_=/[\n"\\]/g;function vn(e){return e.replace(z_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hc(e,t,s,l,f,h,_,T){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=""+gn(t)):e.value!==""+gn(t)&&(e.value=""+gn(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?Pc(e,_,gn(t)):s!=null?Pc(e,_,gn(s)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+gn(T):e.removeAttribute("name")}function dp(e,t,s,l,f,h,_,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Vc(e);return}s=s!=null?""+gn(s):"",t=t!=null?""+gn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=T?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Vc(e)}function Pc(e,t,s){t==="number"&&Dl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ys(e,t,s,l){if(e=e.options,t){t={};for(var f=0;f<s.length;f++)t["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=t.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&l&&(e[s].defaultSelected=!0)}else{for(s=""+gn(s),t=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function fp(e,t,s){if(t!=null&&(t=""+gn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+gn(s):""}function hp(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(o(92));if(ne(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=gn(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Vc(e)}function Zs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var V_=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 pp(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||V_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function mp(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in t)l=t[f],t.hasOwnProperty(f)&&s[f]!==l&&pp(e,f,l)}else for(var h in t)t.hasOwnProperty(h)&&pp(e,h,t[h])}function Gc(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 H_=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"]]),P_=/^[\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 Ml(e){return P_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wn(){}var $c=null;function Fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xs=null,Qs=null;function gp(e){var t=Fs(e);if(t&&(e=t.stateNode)){var s=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hc(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 l=s[t];if(l!==e&&l.form===e.form){var f=l[qt]||null;if(!f)throw Error(o(90));Hc(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&up(l)}break e;case"textarea":fp(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ys(e,!!s.multiple,t,!1)}}}var qc=!1;function vp(e,t,s){if(qc)return e(t,s);qc=!0;try{var l=e(t);return l}finally{if(qc=!1,(Xs!==null||Qs!==null)&&(br(),Xs&&(t=Xs,e=Qs,Qs=Xs=null,gp(t),e)))for(t=0;t<e.length;t++)gp(e[t])}}function no(e,t){var s=e.stateNode;if(s===null)return null;var l=s[qt]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kc=!1;if(Jn)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){Kc=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{Kc=!1}var Ea=null,Yc=null,Rl=null;function yp(){if(Rl)return Rl;var e,t=Yc,s=t.length,l,f="value"in Ea?Ea.value:Ea.textContent,h=f.length;for(e=0;e<s&&t[e]===f[e];e++);var _=s-e;for(l=1;l<=_&&t[s-l]===f[h-l];l++);return Rl=f.slice(e,1<l?1-l:void 0)}function Ol(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 Bl(){return!0}function bp(){return!1}function Kt(e){function t(s,l,f,h,_){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Bl:bp,this.isPropagationStopped=bp,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Bl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Bl)},persist:function(){},isPersistent:Bl}),t}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=Kt(rs),so=v({},rs,{view:0,detail:0}),G_=Kt(so),Zc,Xc,io,Ll=v({},so,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wc,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!==io&&(io&&e.type==="mousemove"?(Zc=e.screenX-io.screenX,Xc=e.screenY-io.screenY):Xc=Zc=0,io=e),Zc)},movementY:function(e){return"movementY"in e?e.movementY:Xc}}),xp=Kt(Ll),$_=v({},Ll,{dataTransfer:0}),F_=Kt($_),q_=v({},so,{relatedTarget:0}),Qc=Kt(q_),K_=v({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),Y_=Kt(K_),Z_=v({},rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X_=Kt(Z_),Q_=v({},rs,{data:0}),_p=Kt(Q_),W_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J_={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"},e1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=e1[e])?!!t[e]:!1}function Wc(){return t1}var n1=v({},so,{key:function(e){if(e.key){var t=W_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wc,charCode:function(e){return e.type==="keypress"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),a1=Kt(n1),s1=v({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sp=Kt(s1),i1=v({},so,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),o1=Kt(i1),l1=v({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),r1=Kt(l1),c1=v({},Ll,{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}),u1=Kt(c1),d1=v({},rs,{newState:0,oldState:0}),f1=Kt(d1),h1=[9,13,27,32],Jc=Jn&&"CompositionEvent"in window,oo=null;Jn&&"documentMode"in document&&(oo=document.documentMode);var p1=Jn&&"TextEvent"in window&&!oo,Tp=Jn&&(!Jc||oo&&8<oo&&11>=oo),kp=" ",Cp=!1;function Ep(e,t){switch(e){case"keyup":return h1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Np(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ws=!1;function m1(e,t){switch(e){case"compositionend":return Np(t);case"keypress":return t.which!==32?null:(Cp=!0,kp);case"textInput":return e=t.data,e===kp&&Cp?null:e;default:return null}}function g1(e,t){if(Ws)return e==="compositionend"||!Jc&&Ep(e,t)?(e=yp(),Rl=Yc=Ea=null,Ws=!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 Tp&&t.locale!=="ko"?null:t.data;default:return null}}var v1={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 wp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!v1[e.type]:t==="textarea"}function jp(e,t,s,l){Xs?Qs?Qs.push(l):Qs=[l]:Xs=l,t=Er(t,"onChange"),0<t.length&&(s=new Il("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var lo=null,ro=null;function y1(e){dv(e,0)}function Ul(e){var t=to(e);if(up(t))return e}function Ap(e,t){if(e==="change")return t}var Dp=!1;if(Jn){var eu;if(Jn){var tu="oninput"in document;if(!tu){var Mp=document.createElement("div");Mp.setAttribute("oninput","return;"),tu=typeof Mp.oninput=="function"}eu=tu}else eu=!1;Dp=eu&&(!document.documentMode||9<document.documentMode)}function Rp(){lo&&(lo.detachEvent("onpropertychange",Op),ro=lo=null)}function Op(e){if(e.propertyName==="value"&&Ul(ro)){var t=[];jp(t,ro,e,Fc(e)),vp(y1,t)}}function b1(e,t,s){e==="focusin"?(Rp(),lo=t,ro=s,lo.attachEvent("onpropertychange",Op)):e==="focusout"&&Rp()}function x1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ul(ro)}function _1(e,t){if(e==="click")return Ul(t)}function S1(e,t){if(e==="input"||e==="change")return Ul(t)}function T1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tn=typeof Object.is=="function"?Object.is:T1;function co(e,t){if(tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!Vs.call(t,f)||!tn(e[f],t[f]))return!1}return!0}function Bp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ip(e,t){var s=Bp(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Bp(s)}}function Lp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Up(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dl(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=Dl(e.document)}return t}function nu(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 k1=Jn&&"documentMode"in document&&11>=document.documentMode,Js=null,au=null,uo=null,su=!1;function zp(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;su||Js==null||Js!==Dl(l)||(l=Js,"selectionStart"in l&&nu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),uo&&co(uo,l)||(uo=l,l=Er(au,"onSelect"),0<l.length&&(t=new Il("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Js)))}function cs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ei={animationend:cs("Animation","AnimationEnd"),animationiteration:cs("Animation","AnimationIteration"),animationstart:cs("Animation","AnimationStart"),transitionrun:cs("Transition","TransitionRun"),transitionstart:cs("Transition","TransitionStart"),transitioncancel:cs("Transition","TransitionCancel"),transitionend:cs("Transition","TransitionEnd")},iu={},Vp={};Jn&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function us(e){if(iu[e])return iu[e];if(!ei[e])return e;var t=ei[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Vp)return iu[e]=t[s];return e}var Hp=us("animationend"),Pp=us("animationiteration"),Gp=us("animationstart"),C1=us("transitionrun"),E1=us("transitionstart"),N1=us("transitioncancel"),$p=us("transitionend"),Fp=new Map,ou="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(" ");ou.push("scrollEnd");function Mn(e,t){Fp.set(e,t),ls(t,[e])}var zl=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)},yn=[],ti=0,lu=0;function Vl(){for(var e=ti,t=lu=ti=0;t<e;){var s=yn[t];yn[t++]=null;var l=yn[t];yn[t++]=null;var f=yn[t];yn[t++]=null;var h=yn[t];if(yn[t++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&qp(s,f,h)}}function Hl(e,t,s,l){yn[ti++]=e,yn[ti++]=t,yn[ti++]=s,yn[ti++]=l,lu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ru(e,t,s,l){return Hl(e,t,s,l),Pl(e)}function ds(e,t){return Hl(e,null,null,t),Pl(e)}function qp(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var f=!1,h=e.return;h!==null;)h.childLanes|=s,l=h.alternate,l!==null&&(l.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&t!==null&&(f=31-qe(s),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[t]:l.push(t),t.lane=s|536870912),h):null}function Pl(e){if(50<Ro)throw Ro=0,vd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function w1(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,s,l){return new w1(e,t,s,l)}function cu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ea(e,t){var s=e.alternate;return s===null?(s=nn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Kp(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 Gl(e,t,s,l,f,h){var _=0;if(l=e,typeof e=="function")cu(e)&&(_=1);else if(typeof e=="string")_=RS(e,s,Fe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=nn(31,s,t,f),e.elementType=Y,e.lanes=h,e;case C:return fs(s.children,f,h,t);case N:_=8,f|=24;break;case E:return e=nn(12,s,t,f|2),e.elementType=E,e.lanes=h,e;case j:return e=nn(13,s,t,f),e.elementType=j,e.lanes=h,e;case q:return e=nn(19,s,t,f),e.elementType=q,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:_=10;break e;case w:_=9;break e;case D:_=11;break e;case P:_=14;break e;case B:_=16,l=null;break e}_=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=nn(_,s,t,f),t.elementType=e,t.type=l,t.lanes=h,t}function fs(e,t,s,l){return e=nn(7,e,l,t),e.lanes=s,e}function uu(e,t,s){return e=nn(6,e,null,t),e.lanes=s,e}function Yp(e){var t=nn(18,null,null,0);return t.stateNode=e,t}function du(e,t,s){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zp=new WeakMap;function bn(e,t){if(typeof e=="object"&&e!==null){var s=Zp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Qi(t)},Zp.set(e,t),t)}return{value:e,source:t,stack:Qi(t)}}var ai=[],si=0,$l=null,fo=0,xn=[],_n=0,Na=null,Un=1,zn="";function ta(e,t){ai[si++]=fo,ai[si++]=$l,$l=e,fo=t}function Xp(e,t,s){xn[_n++]=Un,xn[_n++]=zn,xn[_n++]=Na,Na=e;var l=Un;e=zn;var f=32-qe(l)-1;l&=~(1<<f),s+=1;var h=32-qe(t)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,Un=1<<32-qe(t)+f|s<<f|l,zn=h+e}else Un=1<<h|s<<f|l,zn=e}function fu(e){e.return!==null&&(ta(e,1),Xp(e,1,0))}function hu(e){for(;e===$l;)$l=ai[--si],ai[si]=null,fo=ai[--si],ai[si]=null;for(;e===Na;)Na=xn[--_n],xn[_n]=null,zn=xn[--_n],xn[_n]=null,Un=xn[--_n],xn[_n]=null}function Qp(e,t){xn[_n++]=Un,xn[_n++]=zn,xn[_n++]=Na,Un=t.id,zn=t.overflow,Na=e}var Mt=null,tt=null,Re=!1,wa=null,Sn=!1,pu=Error(o(519));function ja(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ho(bn(t,e)),pu}function Wp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Dt]=e,t[qt]=l,s){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(s=0;s<Bo.length;s++)Ae(Bo[s],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),dp(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),hp(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||mv(t.textContent,s)?(l.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),l.onScroll!=null&&Ae("scroll",t),l.onScrollEnd!=null&&Ae("scrollend",t),l.onClick!=null&&(t.onclick=Wn),t=!0):t=!1,t||ja(e,!0)}function Jp(e){for(Mt=e.return;Mt;)switch(Mt.tag){case 5:case 31:case 13:Sn=!1;return;case 27:case 3:Sn=!0;return;default:Mt=Mt.return}}function ii(e){if(e!==Mt)return!1;if(!Re)return Jp(e),Re=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Md(e.type,e.memoizedProps)),s=!s),s&&tt&&ja(e),Jp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=kv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=kv(e)}else t===27?(t=tt,Ga(e.type)?(e=Ld,Ld=null,tt=e):tt=t):tt=Mt?kn(e.stateNode.nextSibling):null;return!0}function hs(){tt=Mt=null,Re=!1}function mu(){var e=wa;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),wa=null),e}function ho(e){wa===null?wa=[e]:wa.push(e)}var gu=ie(null),ps=null,na=null;function Aa(e,t,s){re(gu,t._currentValue),t._currentValue=s}function aa(e){e._currentValue=gu.current,be(gu)}function vu(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function yu(e,t,s,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var A=0;A<t.length;A++)if(T.context===t[A]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),vu(h.return,s,e),l||(_=null);break e}h=T.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(o(341));_.lanes|=s,h=_.alternate,h!==null&&(h.lanes|=s),vu(_,s,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function oi(e,t,s,l){e=null;for(var f=t,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(o(387));if(_=_.memoizedProps,_!==null){var T=f.type;tn(f.pendingProps.value,_.value)||(e!==null?e.push(T):e=[T])}}else if(f===At.current){if(_=f.alternate,_===null)throw Error(o(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}f=f.return}e!==null&&yu(t,e,s,l),t.flags|=262144}function Fl(e){for(e=e.firstContext;e!==null;){if(!tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ms(e){ps=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Rt(e){return em(ps,e)}function ql(e,t){return ps===null&&ms(e),em(e,t)}function em(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},na===null){if(e===null)throw Error(o(308));na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else na=na.next=t;return s}var j1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},A1=n.unstable_scheduleCallback,D1=n.unstable_NormalPriority,yt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bu(){return{controller:new j1,data:new Map,refCount:0}}function po(e){e.refCount--,e.refCount===0&&A1(D1,function(){e.controller.abort()})}var mo=null,xu=0,li=0,ri=null;function M1(e,t){if(mo===null){var s=mo=[];xu=0,li=Td(),ri={status:"pending",value:void 0,then:function(l){s.push(l)}}}return xu++,t.then(tm,tm),t}function tm(){if(--xu===0&&mo!==null){ri!==null&&(ri.status="fulfilled");var e=mo;mo=null,li=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function R1(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var f=0;f<s.length;f++)(0,s[f])(t)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var nm=I.S;I.S=function(e,t){zg=Lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&M1(e,t),nm!==null&&nm(e,t)};var gs=ie(null);function _u(){var e=gs.current;return e!==null?e:We.pooledCache}function Kl(e,t){t===null?re(gs,gs.current):re(gs,t.pool)}function am(){var e=_u();return e===null?null:{parent:yt._currentValue,pool:e}}var ci=Error(o(460)),Su=Error(o(474)),Yl=Error(o(542)),Zl={then:function(){}};function sm(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(Wn,Wn),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lm(e),e;default:if(typeof t.status=="string")t.then(Wn,Wn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=l}},function(l){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lm(e),e}throw ys=t,ci}}function vs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ys=s,ci):s}}var ys=null;function om(){if(ys===null)throw Error(o(459));var e=ys;return ys=null,e}function lm(e){if(e===ci||e===Yl)throw Error(o(483))}var ui=null,go=0;function Xl(e){var t=go;return go+=1,ui===null&&(ui=[]),im(ui,e,t)}function vo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ql(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rm(e){function t(U,R){if(e){var z=U.deletions;z===null?(U.deletions=[R],U.flags|=16):z.push(R)}}function s(U,R){if(!e)return null;for(;R!==null;)t(U,R),R=R.sibling;return null}function l(U){for(var R=new Map;U!==null;)U.key!==null?R.set(U.key,U):R.set(U.index,U),U=U.sibling;return R}function f(U,R){return U=ea(U,R),U.index=0,U.sibling=null,U}function h(U,R,z){return U.index=z,e?(z=U.alternate,z!==null?(z=z.index,z<R?(U.flags|=67108866,R):z):(U.flags|=67108866,R)):(U.flags|=1048576,R)}function _(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function T(U,R,z,W){return R===null||R.tag!==6?(R=uu(z,U.mode,W),R.return=U,R):(R=f(R,z),R.return=U,R)}function A(U,R,z,W){var pe=z.type;return pe===C?Z(U,R,z.props.children,W,z.key):R!==null&&(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&vs(pe)===R.type)?(R=f(R,z.props),vo(R,z),R.return=U,R):(R=Gl(z.type,z.key,z.props,null,U.mode,W),vo(R,z),R.return=U,R)}function V(U,R,z,W){return R===null||R.tag!==4||R.stateNode.containerInfo!==z.containerInfo||R.stateNode.implementation!==z.implementation?(R=du(z,U.mode,W),R.return=U,R):(R=f(R,z.children||[]),R.return=U,R)}function Z(U,R,z,W,pe){return R===null||R.tag!==7?(R=fs(z,U.mode,W,pe),R.return=U,R):(R=f(R,z),R.return=U,R)}function ee(U,R,z){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=uu(""+R,U.mode,z),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return z=Gl(R.type,R.key,R.props,null,U.mode,z),vo(z,R),z.return=U,z;case k:return R=du(R,U.mode,z),R.return=U,R;case B:return R=vs(R),ee(U,R,z)}if(ne(R)||te(R))return R=fs(R,U.mode,z,null),R.return=U,R;if(typeof R.then=="function")return ee(U,Xl(R),z);if(R.$$typeof===M)return ee(U,ql(U,R),z);Ql(U,R)}return null}function $(U,R,z,W){var pe=R!==null?R.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return pe!==null?null:T(U,R,""+z,W);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===pe?A(U,R,z,W):null;case k:return z.key===pe?V(U,R,z,W):null;case B:return z=vs(z),$(U,R,z,W)}if(ne(z)||te(z))return pe!==null?null:Z(U,R,z,W,null);if(typeof z.then=="function")return $(U,R,Xl(z),W);if(z.$$typeof===M)return $(U,R,ql(U,z),W);Ql(U,z)}return null}function K(U,R,z,W,pe){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return U=U.get(z)||null,T(R,U,""+W,pe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return U=U.get(W.key===null?z:W.key)||null,A(R,U,W,pe);case k:return U=U.get(W.key===null?z:W.key)||null,V(R,U,W,pe);case B:return W=vs(W),K(U,R,z,W,pe)}if(ne(W)||te(W))return U=U.get(z)||null,Z(R,U,W,pe,null);if(typeof W.then=="function")return K(U,R,z,Xl(W),pe);if(W.$$typeof===M)return K(U,R,z,ql(R,W),pe);Ql(R,W)}return null}function ue(U,R,z,W){for(var pe=null,Ie=null,he=R,Ce=R=0,Me=null;he!==null&&Ce<z.length;Ce++){he.index>Ce?(Me=he,he=null):Me=he.sibling;var Le=$(U,he,z[Ce],W);if(Le===null){he===null&&(he=Me);break}e&&he&&Le.alternate===null&&t(U,he),R=h(Le,R,Ce),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le,he=Me}if(Ce===z.length)return s(U,he),Re&&ta(U,Ce),pe;if(he===null){for(;Ce<z.length;Ce++)he=ee(U,z[Ce],W),he!==null&&(R=h(he,R,Ce),Ie===null?pe=he:Ie.sibling=he,Ie=he);return Re&&ta(U,Ce),pe}for(he=l(he);Ce<z.length;Ce++)Me=K(he,U,Ce,z[Ce],W),Me!==null&&(e&&Me.alternate!==null&&he.delete(Me.key===null?Ce:Me.key),R=h(Me,R,Ce),Ie===null?pe=Me:Ie.sibling=Me,Ie=Me);return e&&he.forEach(function(Ya){return t(U,Ya)}),Re&&ta(U,Ce),pe}function ge(U,R,z,W){if(z==null)throw Error(o(151));for(var pe=null,Ie=null,he=R,Ce=R=0,Me=null,Le=z.next();he!==null&&!Le.done;Ce++,Le=z.next()){he.index>Ce?(Me=he,he=null):Me=he.sibling;var Ya=$(U,he,Le.value,W);if(Ya===null){he===null&&(he=Me);break}e&&he&&Ya.alternate===null&&t(U,he),R=h(Ya,R,Ce),Ie===null?pe=Ya:Ie.sibling=Ya,Ie=Ya,he=Me}if(Le.done)return s(U,he),Re&&ta(U,Ce),pe;if(he===null){for(;!Le.done;Ce++,Le=z.next())Le=ee(U,Le.value,W),Le!==null&&(R=h(Le,R,Ce),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return Re&&ta(U,Ce),pe}for(he=l(he);!Le.done;Ce++,Le=z.next())Le=K(he,U,Ce,Le.value,W),Le!==null&&(e&&Le.alternate!==null&&he.delete(Le.key===null?Ce:Le.key),R=h(Le,R,Ce),Ie===null?pe=Le:Ie.sibling=Le,Ie=Le);return e&&he.forEach(function($S){return t(U,$S)}),Re&&ta(U,Ce),pe}function Ze(U,R,z,W){if(typeof z=="object"&&z!==null&&z.type===C&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:e:{for(var pe=z.key;R!==null;){if(R.key===pe){if(pe=z.type,pe===C){if(R.tag===7){s(U,R.sibling),W=f(R,z.props.children),W.return=U,U=W;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===B&&vs(pe)===R.type){s(U,R.sibling),W=f(R,z.props),vo(W,z),W.return=U,U=W;break e}s(U,R);break}else t(U,R);R=R.sibling}z.type===C?(W=fs(z.props.children,U.mode,W,z.key),W.return=U,U=W):(W=Gl(z.type,z.key,z.props,null,U.mode,W),vo(W,z),W.return=U,U=W)}return _(U);case k:e:{for(pe=z.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===z.containerInfo&&R.stateNode.implementation===z.implementation){s(U,R.sibling),W=f(R,z.children||[]),W.return=U,U=W;break e}else{s(U,R);break}else t(U,R);R=R.sibling}W=du(z,U.mode,W),W.return=U,U=W}return _(U);case B:return z=vs(z),Ze(U,R,z,W)}if(ne(z))return ue(U,R,z,W);if(te(z)){if(pe=te(z),typeof pe!="function")throw Error(o(150));return z=pe.call(z),ge(U,R,z,W)}if(typeof z.then=="function")return Ze(U,R,Xl(z),W);if(z.$$typeof===M)return Ze(U,R,ql(U,z),W);Ql(U,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,R!==null&&R.tag===6?(s(U,R.sibling),W=f(R,z),W.return=U,U=W):(s(U,R),W=uu(z,U.mode,W),W.return=U,U=W),_(U)):s(U,R)}return function(U,R,z,W){try{go=0;var pe=Ze(U,R,z,W);return ui=null,pe}catch(he){if(he===ci||he===Yl)throw he;var Ie=nn(29,he,null,U.mode);return Ie.lanes=W,Ie.return=U,Ie}finally{}}}var bs=rm(!0),cm=rm(!1),Da=!1;function Tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ku(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 Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ve&2)!==0){var f=l.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),l.pending=t,t=Pl(e),qp(e,null,s),t}return Hl(e,l,t,s),Pl(e)}function yo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ep(e,s)}}function Cu(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=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?f=h=_:h=h.next=_,s=s.next}while(s!==null);h===null?f=h=t:h=h.next=t}else f=h=t;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Eu=!1;function bo(){if(Eu){var e=ri;if(e!==null)throw e}}function xo(e,t,s,l){Eu=!1;var f=e.updateQueue;Da=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var A=T,V=A.next;A.next=null,_===null?h=V:_.next=V,_=A;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,T=Z.lastBaseUpdate,T!==_&&(T===null?Z.firstBaseUpdate=V:T.next=V,Z.lastBaseUpdate=A))}if(h!==null){var ee=f.baseState;_=0,Z=V=A=null,T=h;do{var $=T.lane&-536870913,K=$!==T.lane;if(K?(De&$)===$:(l&$)===$){$!==0&&$===li&&(Eu=!0),Z!==null&&(Z=Z.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ue=e,ge=T;$=t;var Ze=s;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){ee=ue.call(Ze,ee,$);break e}ee=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,$=typeof ue=="function"?ue.call(Ze,ee,$):ue,$==null)break e;ee=v({},ee,$);break e;case 2:Da=!0}}$=T.callback,$!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[$]:K.push($))}else K={lane:$,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Z===null?(V=Z=K,A=ee):Z=Z.next=K,_|=$;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;K=T,T=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);Z===null&&(A=ee),f.baseState=A,f.firstBaseUpdate=V,f.lastBaseUpdate=Z,h===null&&(f.shared.lanes=0),Ua|=_,e.lanes=_,e.memoizedState=ee}}function um(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function dm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)um(s[e],t)}var di=ie(null),Wl=ie(0);function fm(e,t){e=fa,re(Wl,e),re(di,t),fa=e|t.baseLanes}function Nu(){re(Wl,fa),re(di,di.current)}function wu(){fa=Wl.current,be(di),be(Wl)}var an=ie(null),Tn=null;function Oa(e){var t=e.alternate;re(pt,pt.current&1),re(an,e),Tn===null&&(t===null||di.current!==null||t.memoizedState!==null)&&(Tn=e)}function ju(e){re(pt,pt.current),re(an,e),Tn===null&&(Tn=e)}function hm(e){e.tag===22?(re(pt,pt.current),re(an,e),Tn===null&&(Tn=e)):Ba()}function Ba(){re(pt,pt.current),re(an,an.current)}function sn(e){be(an),Tn===e&&(Tn=null),be(pt)}var pt=ie(0);function Jl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bd(s)||Id(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 sa=0,Te=null,Ke=null,bt=null,er=!1,fi=!1,xs=!1,tr=0,_o=0,hi=null,O1=0;function ct(){throw Error(o(321))}function Au(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!tn(e[s],t[s]))return!1;return!0}function Du(e,t,s,l,f,h){return sa=h,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Xm:qu,xs=!1,h=s(l,f),xs=!1,fi&&(h=mm(t,s,l,f)),pm(e),h}function pm(e){I.H=ko;var t=Ke!==null&&Ke.next!==null;if(sa=0,bt=Ke=Te=null,er=!1,_o=0,hi=null,t)throw Error(o(300));e===null||xt||(e=e.dependencies,e!==null&&Fl(e)&&(xt=!0))}function mm(e,t,s,l){Te=e;var f=0;do{if(fi&&(hi=null),_o=0,fi=!1,25<=f)throw Error(o(301));if(f+=1,bt=Ke=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=Qm,h=t(s,l)}while(fi);return h}function B1(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?So(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(Te.flags|=1024),t}function Mu(){var e=tr!==0;return tr=0,e}function Ru(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Ou(e){if(er){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}er=!1}sa=0,bt=Ke=Te=null,fi=!1,_o=tr=0,hi=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Te.memoizedState=bt=e:bt=bt.next=e,bt}function mt(){if(Ke===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=bt===null?Te.memoizedState:bt.next;if(t!==null)bt=t,Ke=e;else{if(e===null)throw Te.alternate===null?Error(o(467)):Error(o(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},bt===null?Te.memoizedState=bt=e:bt=bt.next=e}return bt}function nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(e){var t=_o;return _o+=1,hi===null&&(hi=[]),e=im(hi,e,t),t=Te,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Xm:qu),e}function ar(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return So(e);if(e.$$typeof===M)return Rt(e)}throw Error(o(438,String(e)))}function Bu(e){var t=null,s=Te.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=nr(),Te.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=X;return t.index++,s}function ia(e,t){return typeof t=="function"?t(e):t}function sr(e){var t=mt();return Iu(t,Ke,e)}function Iu(e,t,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}t.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{t=f.next;var T=_=null,A=null,V=t,Z=!1;do{var ee=V.lane&-536870913;if(ee!==V.lane?(De&ee)===ee:(sa&ee)===ee){var $=V.revertLane;if($===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ee===li&&(Z=!0);else if((sa&$)===$){V=V.next,$===li&&(Z=!0);continue}else ee={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},A===null?(T=A=ee,_=h):A=A.next=ee,Te.lanes|=$,Ua|=$;ee=V.action,xs&&s(h,ee),h=V.hasEagerState?V.eagerState:s(h,ee)}else $={lane:ee,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},A===null?(T=A=$,_=h):A=A.next=$,Te.lanes|=ee,Ua|=ee;V=V.next}while(V!==null&&V!==t);if(A===null?_=h:A.next=T,!tn(h,e.memoizedState)&&(xt=!0,Z&&(s=ri,s!==null)))throw s;e.memoizedState=h,e.baseState=_,e.baseQueue=A,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Lu(e){var t=mt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,f=s.pending,h=t.memoizedState;if(f!==null){s.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);tn(h,t.memoizedState)||(xt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,l]}function gm(e,t,s){var l=Te,f=mt(),h=Re;if(h){if(s===void 0)throw Error(o(407));s=s()}else s=t();var _=!tn((Ke||f).memoizedState,s);if(_&&(f.memoizedState=s,xt=!0),f=f.queue,Vu(bm.bind(null,l,f,e),[e]),f.getSnapshot!==t||_||bt!==null&&bt.memoizedState.tag&1){if(l.flags|=2048,pi(9,{destroy:void 0},ym.bind(null,l,f,s,t),null),We===null)throw Error(o(349));h||(sa&127)!==0||vm(l,t,s)}return s}function vm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Te.updateQueue,t===null?(t=nr(),Te.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function ym(e,t,s,l){t.value=s,t.getSnapshot=l,xm(t)&&_m(e)}function bm(e,t,s){return s(function(){xm(t)&&_m(e)})}function xm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!tn(e,s)}catch{return!0}}function _m(e){var t=ds(e,2);t!==null&&Wt(t,e,2)}function Uu(e){var t=Gt();if(typeof e=="function"){var s=e;if(e=s(),xs){lt(!0);try{s()}finally{lt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:e},t}function Sm(e,t,s,l){return e.baseState=s,Iu(e,Ke,typeof l=="function"?l:ia)}function I1(e,t,s,l,f){if(lr(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};I.T!==null?s(!0):h.isTransition=!1,l(h),s=t.pending,s===null?(h.next=t.pending=h,Tm(t,h)):(h.next=s.next,t.pending=s.next=h)}}function Tm(e,t){var s=t.action,l=t.payload,f=e.state;if(t.isTransition){var h=I.T,_={};I.T=_;try{var T=s(f,l),A=I.S;A!==null&&A(_,T),km(e,t,T)}catch(V){zu(e,t,V)}finally{h!==null&&_.types!==null&&(h.types=_.types),I.T=h}}else try{h=s(f,l),km(e,t,h)}catch(V){zu(e,t,V)}}function km(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Cm(e,t,l)},function(l){return zu(e,t,l)}):Cm(e,t,s)}function Cm(e,t,s){t.status="fulfilled",t.value=s,Em(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Tm(e,s)))}function zu(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,Em(t),t=t.next;while(t!==l)}e.action=null}function Em(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Nm(e,t){return t}function wm(e,t){if(Re){var s=We.formState;if(s!==null){e:{var l=Te;if(Re){if(tt){t:{for(var f=tt,h=Sn;f.nodeType!==8;){if(!h){f=null;break t}if(f=kn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){tt=kn(f.nextSibling),l=f.data==="F!";break e}}ja(l)}l=!1}l&&(t=s[0])}}return s=Gt(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nm,lastRenderedState:t},s.queue=l,s=Km.bind(null,Te,l),l.dispatch=s,l=Uu(!1),h=Fu.bind(null,Te,!1,l.queue),l=Gt(),f={state:t,dispatch:null,action:e,pending:null},l.queue=f,s=I1.bind(null,Te,f,h,s),f.dispatch=s,l.memoizedState=e,[t,s,!1]}function jm(e){var t=mt();return Am(t,Ke,e)}function Am(e,t,s){if(t=Iu(e,t,Nm)[0],e=sr(ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=So(t)}catch(_){throw _===ci?Yl:_}else l=t;t=mt();var f=t.queue,h=f.dispatch;return s!==t.memoizedState&&(Te.flags|=2048,pi(9,{destroy:void 0},L1.bind(null,f,s),null)),[l,h,e]}function L1(e,t){e.action=t}function Dm(e){var t=mt(),s=Ke;if(s!==null)return Am(t,s,e);mt(),t=t.memoizedState,s=mt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function pi(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=Te.updateQueue,t===null&&(t=nr(),Te.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Mm(){return mt().memoizedState}function ir(e,t,s,l){var f=Gt();Te.flags|=e,f.memoizedState=pi(1|t,{destroy:void 0},s,l===void 0?null:l)}function or(e,t,s,l){var f=mt();l=l===void 0?null:l;var h=f.memoizedState.inst;Ke!==null&&l!==null&&Au(l,Ke.memoizedState.deps)?f.memoizedState=pi(t,h,s,l):(Te.flags|=e,f.memoizedState=pi(1|t,h,s,l))}function Rm(e,t){ir(8390656,8,e,t)}function Vu(e,t){or(2048,8,e,t)}function U1(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=nr(),Te.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Om(e){var t=mt().memoizedState;return U1({ref:t,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Bm(e,t){return or(4,2,e,t)}function Im(e,t){return or(4,4,e,t)}function Lm(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 Um(e,t,s){s=s!=null?s.concat([e]):null,or(4,4,Lm.bind(null,t,e),s)}function Hu(){}function zm(e,t){var s=mt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&Au(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Vm(e,t){var s=mt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&Au(t,l[1]))return l[0];if(l=e(),xs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[l,t],l}function Pu(e,t,s){return s===void 0||(sa&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Hg(),Te.lanes|=e,Ua|=e,s)}function Hm(e,t,s,l){return tn(s,t)?s:di.current!==null?(e=Pu(e,s,l),tn(e,t)||(xt=!0),e):(sa&42)===0||(sa&1073741824)!==0&&(De&261930)===0?(xt=!0,e.memoizedState=s):(e=Hg(),Te.lanes|=e,Ua|=e,t)}function Pm(e,t,s,l,f){var h=H.p;H.p=h!==0&&8>h?h:8;var _=I.T,T={};I.T=T,Fu(e,!1,t,s);try{var A=f(),V=I.S;if(V!==null&&V(T,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var Z=R1(A,l);To(e,t,Z,rn(e))}else To(e,t,l,rn(e))}catch(ee){To(e,t,{then:function(){},status:"rejected",reason:ee},rn())}finally{H.p=h,_!==null&&T.types!==null&&(_.types=T.types),I.T=_}}function z1(){}function Gu(e,t,s,l){if(e.tag!==5)throw Error(o(476));var f=Gm(e).queue;Pm(e,f,t,oe,s===null?z1:function(){return $m(e),s(l)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:oe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $m(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),To(e,t.next.queue,{},rn())}function $u(){return Rt(Vo)}function Fm(){return mt().memoizedState}function qm(){return mt().memoizedState}function V1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=rn();e=Ma(s);var l=Ra(t,e,s);l!==null&&(Wt(l,t,s),yo(l,t,s)),t={cache:bu()},e.payload=t;return}t=t.return}}function H1(e,t,s){var l=rn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lr(e)?Ym(t,s):(s=ru(e,t,s,l),s!==null&&(Wt(s,e,l),Zm(s,t,l)))}function Km(e,t,s){var l=rn();To(e,t,s,l)}function To(e,t,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lr(e))Ym(t,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,T=h(_,s);if(f.hasEagerState=!0,f.eagerState=T,tn(T,_))return Hl(e,t,f,0),We===null&&Vl(),!1}catch{}finally{}if(s=ru(e,t,f,l),s!==null)return Wt(s,e,l),Zm(s,t,l),!0}return!1}function Fu(e,t,s,l){if(l={lane:2,revertLane:Td(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},lr(e)){if(t)throw Error(o(479))}else t=ru(e,s,l,2),t!==null&&Wt(t,e,2)}function lr(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Ym(e,t){fi=er=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Zm(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ep(e,s)}}var ko={readContext:Rt,use:ar,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};ko.useEffectEvent=ct;var Xm={readContext:Rt,use:ar,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Rm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ir(4194308,4,Lm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ir(4194308,4,e,t)},useInsertionEffect:function(e,t){ir(4,2,e,t)},useMemo:function(e,t){var s=Gt();t=t===void 0?null:t;var l=e();if(xs){lt(!0);try{e()}finally{lt(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Gt();if(s!==void 0){var f=s(t);if(xs){lt(!0);try{s(t)}finally{lt(!1)}}}else f=t;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=H1.bind(null,Te,e),[l.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Uu(e);var t=e.queue,s=Km.bind(null,Te,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Hu,useDeferredValue:function(e,t){var s=Gt();return Pu(s,e,t)},useTransition:function(){var e=Uu(!1);return e=Pm.bind(null,Te,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=Te,f=Gt();if(Re){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),We===null)throw Error(o(349));(De&127)!==0||vm(l,t,s)}f.memoizedState=s;var h={value:s,getSnapshot:t};return f.queue=h,Rm(bm.bind(null,l,h,e),[e]),l.flags|=2048,pi(9,{destroy:void 0},ym.bind(null,l,h,s,t),null),s},useId:function(){var e=Gt(),t=We.identifierPrefix;if(Re){var s=zn,l=Un;s=(l&~(1<<32-qe(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=tr++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=O1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$u,useFormState:wm,useActionState:wm,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Fu.bind(null,Te,!0,s),s.dispatch=t,[e,t]},useMemoCache:Bu,useCacheRefresh:function(){return Gt().memoizedState=V1.bind(null,Te)},useEffectEvent:function(e){var t=Gt(),s={impl:e};return t.memoizedState=s,function(){if((Ve&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},qu={readContext:Rt,use:ar,useCallback:zm,useContext:Rt,useEffect:Vu,useImperativeHandle:Um,useInsertionEffect:Bm,useLayoutEffect:Im,useMemo:Vm,useReducer:sr,useRef:Mm,useState:function(){return sr(ia)},useDebugValue:Hu,useDeferredValue:function(e,t){var s=mt();return Hm(s,Ke.memoizedState,e,t)},useTransition:function(){var e=sr(ia)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:So(e),t]},useSyncExternalStore:gm,useId:Fm,useHostTransitionStatus:$u,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var s=mt();return Sm(s,Ke,e,t)},useMemoCache:Bu,useCacheRefresh:qm};qu.useEffectEvent=Om;var Qm={readContext:Rt,use:ar,useCallback:zm,useContext:Rt,useEffect:Vu,useImperativeHandle:Um,useInsertionEffect:Bm,useLayoutEffect:Im,useMemo:Vm,useReducer:Lu,useRef:Mm,useState:function(){return Lu(ia)},useDebugValue:Hu,useDeferredValue:function(e,t){var s=mt();return Ke===null?Pu(s,e,t):Hm(s,Ke.memoizedState,e,t)},useTransition:function(){var e=Lu(ia)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:So(e),t]},useSyncExternalStore:gm,useId:Fm,useHostTransitionStatus:$u,useFormState:Dm,useActionState:Dm,useOptimistic:function(e,t){var s=mt();return Ke!==null?Sm(s,Ke,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Bu,useCacheRefresh:qm};Qm.useEffectEvent=Om;function Ku(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Yu={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=rn(),f=Ma(l);f.payload=t,s!=null&&(f.callback=s),t=Ra(e,f,l),t!==null&&(Wt(t,e,l),yo(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=rn(),f=Ma(l);f.tag=1,f.payload=t,s!=null&&(f.callback=s),t=Ra(e,f,l),t!==null&&(Wt(t,e,l),yo(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=rn(),l=Ma(s);l.tag=2,t!=null&&(l.callback=t),t=Ra(e,l,s),t!==null&&(Wt(t,e,s),yo(t,e,s))}};function Wm(e,t,s,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):t.prototype&&t.prototype.isPureReactComponent?!co(s,l)||!co(f,h):!0}function Jm(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Yu.enqueueReplaceState(t,t.state,null)}function _s(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function eg(e){zl(e)}function tg(e){console.error(e)}function ng(e){zl(e)}function rr(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ag(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Zu(e,t,s){return s=Ma(s),s.tag=3,s.payload={element:null},s.callback=function(){rr(e,t)},s}function sg(e){return e=Ma(e),e.tag=3,e}function ig(e,t,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){ag(t,s,l)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){ag(t,s,l),typeof f!="function"&&(za===null?za=new Set([this]):za.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function P1(e,t,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&oi(t,s,f,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return Tn===null?xr():s.alternate===null&&ut===0&&(ut=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===Zl?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),xd(e,l,f)),!1;case 22:return s.flags|=65536,l===Zl?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),xd(e,l,f)),!1}throw Error(o(435,s.tag))}return xd(e,l,f),xr(),!1}if(Re)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,l!==pu&&(e=Error(o(422),{cause:l}),ho(bn(e,s)))):(l!==pu&&(t=Error(o(423),{cause:l}),ho(bn(t,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=bn(l,s),f=Zu(e.stateNode,l,f),Cu(e,f),ut!==4&&(ut=2)),!1;var h=Error(o(520),{cause:l});if(h=bn(h,s),Mo===null?Mo=[h]:Mo.push(h),ut!==4&&(ut=2),t===null)return!0;l=bn(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Zu(s.stateNode,l,e),Cu(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"&&(za===null||!za.has(h))))return s.flags|=65536,f&=-f,s.lanes|=f,f=sg(f),ig(f,e,s,l),Cu(s,f),!1}s=s.return}while(s!==null);return!1}var Xu=Error(o(461)),xt=!1;function Ot(e,t,s,l){t.child=e===null?cm(t,null,s,l):bs(t,e.child,s,l)}function og(e,t,s,l,f){s=s.render;var h=t.ref;if("ref"in l){var _={};for(var T in l)T!=="ref"&&(_[T]=l[T])}else _=l;return ms(t),l=Du(e,t,s,_,h,f),T=Mu(),e!==null&&!xt?(Ru(e,t,f),oa(e,t,f)):(Re&&T&&fu(t),t.flags|=1,Ot(e,t,l,f),t.child)}function lg(e,t,s,l,f){if(e===null){var h=s.type;return typeof h=="function"&&!cu(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,rg(e,t,h,l,f)):(e=Gl(s.type,null,l,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!sd(e,f)){var _=h.memoizedProps;if(s=s.compare,s=s!==null?s:co,s(_,l)&&e.ref===t.ref)return oa(e,t,f)}return t.flags|=1,e=ea(h,l),e.ref=t.ref,e.return=t,t.child=e}function rg(e,t,s,l,f){if(e!==null){var h=e.memoizedProps;if(co(h,l)&&e.ref===t.ref)if(xt=!1,t.pendingProps=l=h,sd(e,f))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,oa(e,t,f)}return Qu(e,t,s,l,f)}function cg(e,t,s,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(l=t.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,t.child=null;return ug(e,t,h,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Kl(t,h!==null?h.cachePool:null),h!==null?fm(t,h):Nu(),hm(t);else return l=t.lanes=536870912,ug(e,t,h!==null?h.baseLanes|s:s,s,l)}else h!==null?(Kl(t,h.cachePool),fm(t,h),Ba(),t.memoizedState=null):(e!==null&&Kl(t,null),Nu(),Ba());return Ot(e,t,f,s),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ug(e,t,s,l,f){var h=_u();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Kl(t,null),Nu(),hm(t),e!==null&&oi(e,t,l,!0),t.childLanes=f,null}function cr(e,t){return t=dr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dg(e,t,s){return bs(t,e.child,null,s),e=cr(t,t.pendingProps),e.flags|=2,sn(t),t.memoizedState=null,e}function G1(e,t,s){var l=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Re){if(l.mode==="hidden")return e=cr(t,l),t.lanes=536870912,Co(null,e);if(ju(t),(e=tt)?(e=Tv(e,Sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Un,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},s=Yp(e),s.return=t,t.child=s,Mt=t,tt=null)):e=null,e===null)throw ja(t);return t.lanes=536870912,null}return cr(t,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(ju(t),f)if(t.flags&256)t.flags&=-257,t=dg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(xt||oi(e,t,s,!1),f=(s&e.childLanes)!==0,xt||f){if(l=We,l!==null&&(_=tp(l,s),_!==0&&_!==h.retryLane))throw h.retryLane=_,ds(e,_),Wt(l,e,_),Xu;xr(),t=dg(e,t,s)}else e=h.treeContext,tt=kn(_.nextSibling),Mt=t,Re=!0,wa=null,Sn=!1,e!==null&&Qp(t,e),t=cr(t,l),t.flags|=4096;return t}return e=ea(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ur(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Qu(e,t,s,l,f){return ms(t),s=Du(e,t,s,l,void 0,f),l=Mu(),e!==null&&!xt?(Ru(e,t,f),oa(e,t,f)):(Re&&l&&fu(t),t.flags|=1,Ot(e,t,s,f),t.child)}function fg(e,t,s,l,f,h){return ms(t),t.updateQueue=null,s=mm(t,l,s,f),pm(e),l=Mu(),e!==null&&!xt?(Ru(e,t,h),oa(e,t,h)):(Re&&l&&fu(t),t.flags|=1,Ot(e,t,s,h),t.child)}function hg(e,t,s,l,f){if(ms(t),t.stateNode===null){var h=ni,_=s.contextType;typeof _=="object"&&_!==null&&(h=Rt(_)),h=new s(l,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Yu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=l,h.state=t.memoizedState,h.refs={},Tu(t),_=s.contextType,h.context=typeof _=="object"&&_!==null?Rt(_):ni,h.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Ku(t,s,_,l),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&&Yu.enqueueReplaceState(h,h.state,null),xo(t,l,h,f),bo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,A=_s(s,T);h.props=A;var V=h.context,Z=s.contextType;_=ni,typeof Z=="object"&&Z!==null&&(_=Rt(Z));var ee=s.getDerivedStateFromProps;Z=typeof ee=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,Z||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||V!==_)&&Jm(t,h,l,_),Da=!1;var $=t.memoizedState;h.state=$,xo(t,l,h,f),bo(),V=t.memoizedState,T||$!==V||Da?(typeof ee=="function"&&(Ku(t,s,ee,l),V=t.memoizedState),(A=Da||Wm(t,s,A,l,$,V,_))?(Z||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=V),h.props=l,h.state=V,h.context=_,l=A):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,ku(e,t),_=t.memoizedProps,Z=_s(s,_),h.props=Z,ee=t.pendingProps,$=h.context,V=s.contextType,A=ni,typeof V=="object"&&V!==null&&(A=Rt(V)),T=s.getDerivedStateFromProps,(V=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==ee||$!==A)&&Jm(t,h,l,A),Da=!1,$=t.memoizedState,h.state=$,xo(t,l,h,f),bo();var K=t.memoizedState;_!==ee||$!==K||Da||e!==null&&e.dependencies!==null&&Fl(e.dependencies)?(typeof T=="function"&&(Ku(t,s,T,l),K=t.memoizedState),(Z=Da||Wm(t,s,Z,l,$,K,A)||e!==null&&e.dependencies!==null&&Fl(e.dependencies))?(V||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,A),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,A)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=K),h.props=l,h.state=K,h.context=A,l=Z):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),l=!1)}return h=l,ur(e,t),l=(t.flags&128)!==0,h||l?(h=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&l?(t.child=bs(t,e.child,null,f),t.child=bs(t,null,s,f)):Ot(e,t,s,f),t.memoizedState=h.state,e=t.child):e=oa(e,t,f),e}function pg(e,t,s,l){return hs(),t.flags|=256,Ot(e,t,s,l),t.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ju(e){return{baseLanes:e,cachePool:am()}}function ed(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=ln),e}function mg(e,t,s){var l=t.pendingProps,f=!1,h=(t.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),_&&(f=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(Re){if(f?Oa(t):Ba(),(e=tt)?(e=Tv(e,Sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Un,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},s=Yp(e),s.return=t,t.child=s,Mt=t,tt=null)):e=null,e===null)throw ja(t);return Id(e)?t.lanes=32:t.lanes=536870912,null}var T=l.children;return l=l.fallback,f?(Ba(),f=t.mode,T=dr({mode:"hidden",children:T},f),l=fs(l,f,s,null),T.return=t,l.return=t,T.sibling=l,t.child=T,l=t.child,l.memoizedState=Ju(s),l.childLanes=ed(e,_,s),t.memoizedState=Wu,Co(null,l)):(Oa(t),td(t,T))}var A=e.memoizedState;if(A!==null&&(T=A.dehydrated,T!==null)){if(h)t.flags&256?(Oa(t),t.flags&=-257,t=nd(e,t,s)):t.memoizedState!==null?(Ba(),t.child=e.child,t.flags|=128,t=null):(Ba(),T=l.fallback,f=t.mode,l=dr({mode:"visible",children:l.children},f),T=fs(T,f,s,null),T.flags|=2,l.return=t,T.return=t,l.sibling=T,t.child=l,bs(t,e.child,null,s),l=t.child,l.memoizedState=Ju(s),l.childLanes=ed(e,_,s),t.memoizedState=Wu,t=Co(null,l));else if(Oa(t),Id(T)){if(_=T.nextSibling&&T.nextSibling.dataset,_)var V=_.dgst;_=V,l=Error(o(419)),l.stack="",l.digest=_,ho({value:l,source:null,stack:null}),t=nd(e,t,s)}else if(xt||oi(e,t,s,!1),_=(s&e.childLanes)!==0,xt||_){if(_=We,_!==null&&(l=tp(_,s),l!==0&&l!==A.retryLane))throw A.retryLane=l,ds(e,l),Wt(_,e,l),Xu;Bd(T)||xr(),t=nd(e,t,s)}else Bd(T)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,tt=kn(T.nextSibling),Mt=t,Re=!0,wa=null,Sn=!1,e!==null&&Qp(t,e),t=td(t,l.children),t.flags|=4096);return t}return f?(Ba(),T=l.fallback,f=t.mode,A=e.child,V=A.sibling,l=ea(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,V!==null?T=ea(V,T):(T=fs(T,f,s,null),T.flags|=2),T.return=t,l.return=t,l.sibling=T,t.child=l,Co(null,l),l=t.child,T=e.child.memoizedState,T===null?T=Ju(s):(f=T.cachePool,f!==null?(A=yt._currentValue,f=f.parent!==A?{parent:A,pool:A}:f):f=am(),T={baseLanes:T.baseLanes|s,cachePool:f}),l.memoizedState=T,l.childLanes=ed(e,_,s),t.memoizedState=Wu,Co(e.child,l)):(Oa(t),s=e.child,e=s.sibling,s=ea(s,{mode:"visible",children:l.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 td(e,t){return t=dr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dr(e,t){return e=nn(22,e,null,t),e.lanes=0,e}function nd(e,t,s){return bs(t,e.child,null,s),e=td(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gg(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vu(e.return,t,s)}function ad(e,t,s,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=s,_.tailMode=f,_.treeForkCount=h)}function vg(e,t,s){var l=t.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=pt.current,T=(_&2)!==0;if(T?(_=_&1|2,t.flags|=128):_&=1,re(pt,_),Ot(e,t,l,s),l=Re?fo:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gg(e,s,t);else if(e.tag===19)gg(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(f){case"forwards":for(s=t.child,f=null;s!==null;)e=s.alternate,e!==null&&Jl(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=t.child,t.child=null):(f=s.sibling,s.sibling=null),ad(t,!1,f,s,h,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&Jl(e)===null){t.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}ad(t,!0,s,null,h,l);break;case"together":ad(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function oa(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ua|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(oi(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=ea(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ea(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function sd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fl(e)))}function $1(e,t,s){switch(t.tag){case 3:pn(t,t.stateNode.containerInfo),Aa(t,yt,e.memoizedState.cache),hs();break;case 27:case 5:In(t);break;case 4:pn(t,t.stateNode.containerInfo);break;case 10:Aa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Oa(t),t.flags|=128,null):(s&t.child.childLanes)!==0?mg(e,t,s):(Oa(t),e=oa(e,t,s),e!==null?e.sibling:null);Oa(t);break;case 19:var f=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(oi(e,t,s,!1),l=(s&t.childLanes)!==0),f){if(l)return vg(e,t,s);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),re(pt,pt.current),l)break;return null;case 22:return t.lanes=0,cg(e,t,s,t.pendingProps);case 24:Aa(t,yt,e.memoizedState.cache)}return oa(e,t,s)}function yg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!sd(e,s)&&(t.flags&128)===0)return xt=!1,$1(e,t,s);xt=(e.flags&131072)!==0}else xt=!1,Re&&(t.flags&1048576)!==0&&Xp(t,fo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=vs(t.elementType),t.type=e,typeof e=="function")cu(e)?(l=_s(e,l),t.tag=1,t=hg(null,t,e,l,s)):(t.tag=0,t=Qu(null,t,e,l,s));else{if(e!=null){var f=e.$$typeof;if(f===D){t.tag=11,t=og(null,t,e,l,s);break e}else if(f===P){t.tag=14,t=lg(null,t,e,l,s);break e}}throw t=F(e)||e,Error(o(306,t,""))}}return t;case 0:return Qu(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,f=_s(l,t.pendingProps),hg(e,t,l,f,s);case 3:e:{if(pn(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var h=t.memoizedState;f=h.element,ku(e,t),xo(t,l,null,s);var _=t.memoizedState;if(l=_.cache,Aa(t,yt,l),l!==h.cache&&yu(t,[yt],s,!0),bo(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=pg(e,t,l,s);break e}else if(l!==f){f=bn(Error(o(424)),t),ho(f),t=pg(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(tt=kn(e.firstChild),Mt=t,Re=!0,wa=null,Sn=!0,s=cm(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(hs(),l===f){t=oa(e,t,s);break e}Ot(e,t,l,s)}t=t.child}return t;case 26:return ur(e,t),e===null?(s=jv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Re||(s=t.type,e=t.pendingProps,l=Nr(fe.current).createElement(s),l[Dt]=t,l[qt]=e,Bt(l,s,e),wt(l),t.stateNode=l):t.memoizedState=jv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return In(t),e===null&&Re&&(l=t.stateNode=Ev(t.type,t.pendingProps,fe.current),Mt=t,Sn=!0,f=tt,Ga(t.type)?(Ld=f,tt=kn(l.firstChild)):tt=f),Ot(e,t,t.pendingProps.children,s),ur(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Re&&((f=l=tt)&&(l=xS(l,t.type,t.pendingProps,Sn),l!==null?(t.stateNode=l,Mt=t,tt=kn(l.firstChild),Sn=!1,f=!0):f=!1),f||ja(t)),In(t),f=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Md(f,h)?l=null:_!==null&&Md(f,_)&&(t.flags|=32),t.memoizedState!==null&&(f=Du(e,t,B1,null,null,s),Vo._currentValue=f),ur(e,t),Ot(e,t,l,s),t.child;case 6:return e===null&&Re&&((e=s=tt)&&(s=_S(s,t.pendingProps,Sn),s!==null?(t.stateNode=s,Mt=t,tt=null,e=!0):e=!1),e||ja(t)),null;case 13:return mg(e,t,s);case 4:return pn(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=bs(t,null,l,s):Ot(e,t,l,s),t.child;case 11:return og(e,t,t.type,t.pendingProps,s);case 7:return Ot(e,t,t.pendingProps,s),t.child;case 8:return Ot(e,t,t.pendingProps.children,s),t.child;case 12:return Ot(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Aa(t,t.type,l.value),Ot(e,t,l.children,s),t.child;case 9:return f=t.type._context,l=t.pendingProps.children,ms(t),f=Rt(f),l=l(f),t.flags|=1,Ot(e,t,l,s),t.child;case 14:return lg(e,t,t.type,t.pendingProps,s);case 15:return rg(e,t,t.type,t.pendingProps,s);case 19:return vg(e,t,s);case 31:return G1(e,t,s);case 22:return cg(e,t,s,t.pendingProps);case 24:return ms(t),l=Rt(yt),e===null?(f=_u(),f===null&&(f=We,h=bu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=s),f=h),t.memoizedState={parent:l,cache:f},Tu(t),Aa(t,yt,f)):((e.lanes&s)!==0&&(ku(e,t),xo(t,null,null,s),bo()),f=e.memoizedState,h=t.memoizedState,f.parent!==l?(f={parent:l,cache:l},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),Aa(t,yt,l)):(l=h.cache,Aa(t,yt,l),l!==f.cache&&yu(t,[yt],s,!0))),Ot(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function la(e){e.flags|=4}function id(e,t,s,l,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Fg())e.flags|=8192;else throw ys=Zl,Su}else e.flags&=-16777217}function bg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ov(t))if(Fg())e.flags|=8192;else throw ys=Zl,Su}function fr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Wh():536870912,e.lanes|=t,yi|=t)}function Eo(e,t){if(!Re)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function F1(e,t,s){var l=t.pendingProps;switch(hu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return nt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),aa(yt),Dn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ii(t)?la(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mu())),nt(t),null;case 26:var f=t.type,h=t.memoizedState;return e===null?(la(t),h!==null?(nt(t),bg(t,h)):(nt(t),id(t,f,null,l,s))):h?h!==e.memoizedState?(la(t),nt(t),bg(t,h)):(nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&la(t),nt(t),id(t,f,e,l,s)),null;case 27:if(Se(t),s=fe.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return nt(t),null}e=Fe.current,ii(t)?Wp(t):(e=Ev(f,l,s),t.stateNode=e,la(t))}return nt(t),null;case 5:if(Se(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return nt(t),null}if(h=Fe.current,ii(t))Wp(t);else{var _=Nr(fe.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Dt]=t,h[qt]=l;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(Bt(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&la(t)}}return nt(t),id(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=fe.current,ii(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,f=Mt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||mv(e.nodeValue,s)),e||ja(t,!0)}else e=Nr(e).createTextNode(l),e[Dt]=t,t.stateNode=e}return nt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ii(t),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Dt]=t}else hs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),e=!1}else s=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(sn(t),t):(sn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return nt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ii(t),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(o(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(o(317));f[Dt]=t}else hs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),f=!1}else f=mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(sn(t),t):(sn(t),null)}return sn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),fr(t,t.updateQueue),nt(t),null);case 4:return Dn(),e===null&&Nd(t.stateNode.containerInfo),nt(t),null;case 10:return aa(t.type),nt(t),null;case 19:if(be(pt),l=t.memoizedState,l===null)return nt(t),null;if(f=(t.flags&128)!==0,h=l.rendering,h===null)if(f)Eo(l,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Jl(e),h!==null){for(t.flags|=128,Eo(l,!1),e=h.updateQueue,t.updateQueue=e,fr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Kp(s,e),s=s.sibling;return re(pt,pt.current&1|2),Re&&ta(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Lt()>vr&&(t.flags|=128,f=!0,Eo(l,!1),t.lanes=4194304)}else{if(!f)if(e=Jl(h),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,fr(t,e),Eo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Re)return nt(t),null}else 2*Lt()-l.renderingStartTime>vr&&s!==536870912&&(t.flags|=128,f=!0,Eo(l,!1),t.lanes=4194304);l.isBackwards?(h.sibling=t.child,t.child=h):(e=l.last,e!==null?e.sibling=h:t.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Lt(),e.sibling=null,s=pt.current,re(pt,f?s&1|2:s&1),Re&&ta(t,l.treeForkCount),e):(nt(t),null);case 22:case 23:return sn(t),wu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),s=t.updateQueue,s!==null&&fr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&be(gs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),aa(yt),nt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function q1(e,t){switch(hu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(yt),Dn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(sn(t),t.alternate===null)throw Error(o(340));hs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));hs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(pt),null;case 4:return Dn(),null;case 10:return aa(t.type),null;case 22:case 23:return sn(t),wu(),e!==null&&be(gs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(yt),null;case 25:return null;default:return null}}function xg(e,t){switch(hu(t),t.tag){case 3:aa(yt),Dn();break;case 26:case 27:case 5:Se(t);break;case 4:Dn();break;case 31:t.memoizedState!==null&&sn(t);break;case 13:sn(t);break;case 19:be(pt);break;case 10:aa(t.type);break;case 22:case 23:sn(t),wu(),e!==null&&be(gs);break;case 24:aa(yt)}}function No(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&e)===e){l=void 0;var h=s.create,_=s.inst;l=h(),_.destroy=l}s=s.next}while(s!==f)}}catch(T){$e(t,t.return,T)}}function Ia(e,t,s){try{var l=t.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,T=_.destroy;if(T!==void 0){_.destroy=void 0,f=t;var A=s,V=T;try{V()}catch(Z){$e(f,A,Z)}}}l=l.next}while(l!==h)}}catch(Z){$e(t,t.return,Z)}}function _g(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{dm(t,s)}catch(l){$e(e,e.return,l)}}}function Sg(e,t,s){s.props=_s(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){$e(e,t,l)}}function wo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(f){$e(e,t,f)}}function Vn(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){$e(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){$e(e,t,f)}else s.current=null}function Tg(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){$e(e,e.return,f)}}function od(e,t,s){try{var l=e.stateNode;pS(l,e.type,s,t),l[qt]=t}catch(f){$e(e,e.return,f)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ga(e.type)||e.tag===4}function ld(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kg(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&&Ga(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 rd(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Wn));else if(l!==4&&(l===27&&Ga(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(rd(e,t,s),e=e.sibling;e!==null;)rd(e,t,s),e=e.sibling}function hr(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Ga(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(hr(e,t,s),e=e.sibling;e!==null;)hr(e,t,s),e=e.sibling}function Cg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);Bt(t,l,s),t[Dt]=e,t[qt]=s}catch(h){$e(e,e.return,h)}}var ra=!1,_t=!1,cd=!1,Eg=typeof WeakSet=="function"?WeakSet:Set,jt=null;function K1(e,t){if(e=e.containerInfo,Ad=Or,e=Up(e),nu(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var _=0,T=-1,A=-1,V=0,Z=0,ee=e,$=null;t:for(;;){for(var K;ee!==s||f!==0&&ee.nodeType!==3||(T=_+f),ee!==h||l!==0&&ee.nodeType!==3||(A=_+l),ee.nodeType===3&&(_+=ee.nodeValue.length),(K=ee.firstChild)!==null;)$=ee,ee=K;for(;;){if(ee===e)break t;if($===s&&++V===f&&(T=_),$===h&&++Z===l&&(A=_),(K=ee.nextSibling)!==null)break;ee=$,$=ee.parentNode}ee=K}s=T===-1||A===-1?null:{start:T,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Dd={focusedElem:e,selectionRange:s},Or=!1,jt=t;jt!==null;)if(t=jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jt=e;else for(;jt!==null;){switch(t=jt,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++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,f=h.memoizedProps,h=h.memoizedState,l=s.stateNode;try{var ue=_s(s.type,f);e=l.getSnapshotBeforeUpdate(ue,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(ge){$e(s,s.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Od(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,jt=e;break}jt=t.return}}function Ng(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:ua(e,s),l&4&&No(5,s);break;case 1:if(ua(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){$e(s,s.return,_)}else{var f=_s(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){$e(s,s.return,_)}}l&64&&_g(s),l&512&&wo(s,s.return);break;case 3:if(ua(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{dm(e,t)}catch(_){$e(s,s.return,_)}}break;case 27:t===null&&l&4&&Cg(s);case 26:case 5:ua(e,s),t===null&&l&4&&Tg(s),l&512&&wo(s,s.return);break;case 12:ua(e,s);break;case 31:ua(e,s),l&4&&Ag(e,s);break;case 13:ua(e,s),l&4&&Dg(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=nS.bind(null,s),SS(e,s))));break;case 22:if(l=s.memoizedState!==null||ra,!l){t=t!==null&&t.memoizedState!==null||_t,f=ra;var h=_t;ra=l,(_t=t)&&!h?da(e,s,(s.subtreeFlags&8772)!==0):ua(e,s),ra=f,_t=h}break;case 30:break;default:ua(e,s)}}function wg(e){var t=e.alternate;t!==null&&(e.alternate=null,wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zc(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 it=null,Yt=!1;function ca(e,t,s){for(s=s.child;s!==null;)jg(e,t,s),s=s.sibling}function jg(e,t,s){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(ht,s)}catch{}switch(s.tag){case 26:_t||Vn(s,t),ca(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 l=it,f=Yt;Ga(s.type)&&(it=s.stateNode,Yt=!1),ca(e,t,s),Lo(s.stateNode),it=l,Yt=f;break;case 5:_t||Vn(s,t);case 6:if(l=it,f=Yt,it=null,ca(e,t,s),it=l,Yt=f,it!==null)if(Yt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(s.stateNode)}catch(h){$e(s,t,h)}else try{it.removeChild(s.stateNode)}catch(h){$e(s,t,h)}break;case 18:it!==null&&(Yt?(e=it,_v(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ei(e)):_v(it,s.stateNode));break;case 4:l=it,f=Yt,it=s.stateNode.containerInfo,Yt=!0,ca(e,t,s),it=l,Yt=f;break;case 0:case 11:case 14:case 15:Ia(2,s,t),_t||Ia(4,s,t),ca(e,t,s);break;case 1:_t||(Vn(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Sg(s,t,l)),ca(e,t,s);break;case 21:ca(e,t,s);break;case 22:_t=(l=_t)||s.memoizedState!==null,ca(e,t,s),_t=l;break;default:ca(e,t,s)}}function Ag(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ei(e)}catch(s){$e(t,t.return,s)}}}function Dg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ei(e)}catch(s){$e(t,t.return,s)}}function Y1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Eg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Eg),t;default:throw Error(o(435,e.tag))}}function pr(e,t){var s=Y1(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var f=aS.bind(null,e,l);l.then(f,f)}})}function Zt(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l],h=e,_=t,T=_;e:for(;T!==null;){switch(T.tag){case 27:if(Ga(T.type)){it=T.stateNode,Yt=!1;break e}break;case 5:it=T.stateNode,Yt=!1;break e;case 3:case 4:it=T.stateNode.containerInfo,Yt=!0;break e}T=T.return}if(it===null)throw Error(o(160));jg(h,_,f),it=null,Yt=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mg(t,e),t=t.sibling}var Rn=null;function Mg(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Xt(e),l&4&&(Ia(3,e,e.return),No(3,e),Ia(5,e,e.return));break;case 1:Zt(t,e),Xt(e),l&512&&(_t||s===null||Vn(s,s.return)),l&64&&ra&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var f=Rn;if(Zt(t,e),Xt(e),l&512&&(_t||s===null||Vn(s,s.return)),l&4){var h=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[eo]||h[Dt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),Bt(h,l,s),h[Dt]=e,wt(h),l=h;break e;case"link":var _=Mv("link","href",f).get(l+(s.href||""));if(_){for(var T=0;T<_.length;T++)if(h=_[T],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(T,1);break t}}h=f.createElement(l),Bt(h,l,s),f.head.appendChild(h);break;case"meta":if(_=Mv("meta","content",f).get(l+(s.content||""))){for(T=0;T<_.length;T++)if(h=_[T],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(T,1);break t}}h=f.createElement(l),Bt(h,l,s),f.head.appendChild(h);break;default:throw Error(o(468,l))}h[Dt]=e,wt(h),l=h}e.stateNode=l}else Rv(f,e.type,e.stateNode);else e.stateNode=Dv(f,l,e.memoizedProps);else h!==l?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,l===null?Rv(f,e.type,e.stateNode):Dv(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&od(e,e.memoizedProps,s.memoizedProps)}break;case 27:Zt(t,e),Xt(e),l&512&&(_t||s===null||Vn(s,s.return)),s!==null&&l&4&&od(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Zt(t,e),Xt(e),l&512&&(_t||s===null||Vn(s,s.return)),e.flags&32){f=e.stateNode;try{Zs(f,"")}catch(ue){$e(e,e.return,ue)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,od(e,f,s!==null?s.memoizedProps:f)),l&1024&&(cd=!0);break;case 6:if(Zt(t,e),Xt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(ue){$e(e,e.return,ue)}}break;case 3:if(Ar=null,f=Rn,Rn=wr(t.containerInfo),Zt(t,e),Rn=f,Xt(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ei(t.containerInfo)}catch(ue){$e(e,e.return,ue)}cd&&(cd=!1,Rg(e));break;case 4:l=Rn,Rn=wr(e.stateNode.containerInfo),Zt(t,e),Xt(e),Rn=l;break;case 12:Zt(t,e),Xt(e);break;case 31:Zt(t,e),Xt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 13:Zt(t,e),Xt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(gr=Lt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 22:f=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,V=ra,Z=_t;if(ra=V||f,_t=Z||A,Zt(t,e),_t=Z,ra=V,Xt(e),l&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(s===null||A||ra||_t||Ss(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){A=s=t;try{if(h=A.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{T=A.stateNode;var ee=A.memoizedProps.style,$=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;T.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ue){$e(A,A.return,ue)}}}else if(t.tag===6){if(s===null){A=t;try{A.stateNode.nodeValue=f?"":A.memoizedProps}catch(ue){$e(A,A.return,ue)}}}else if(t.tag===18){if(s===null){A=t;try{var K=A.stateNode;f?Sv(K,!0):Sv(A.stateNode,!1)}catch(ue){$e(A,A.return,ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,pr(e,s))));break;case 19:Zt(t,e),Xt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pr(e,l)));break;case 30:break;case 21:break;default:Zt(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(kg(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var f=s.stateNode,h=ld(e);hr(e,h,f);break;case 5:var _=s.stateNode;s.flags&32&&(Zs(_,""),s.flags&=-33);var T=ld(e);hr(e,T,_);break;case 3:case 4:var A=s.stateNode.containerInfo,V=ld(e);rd(e,V,A);break;default:throw Error(o(161))}}catch(Z){$e(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ua(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ng(e,t.alternate,t),t=t.sibling}function Ss(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ia(4,t,t.return),Ss(t);break;case 1:Vn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Sg(t,t.return,s),Ss(t);break;case 27:Lo(t.stateNode);case 26:case 5:Vn(t,t.return),Ss(t);break;case 22:t.memoizedState===null&&Ss(t);break;case 30:Ss(t);break;default:Ss(t)}e=e.sibling}}function da(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,f=e,h=t,_=h.flags;switch(h.tag){case 0:case 11:case 15:da(f,h,s),No(4,h);break;case 1:if(da(f,h,s),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(V){$e(l,l.return,V)}if(l=h,f=l.updateQueue,f!==null){var T=l.stateNode;try{var A=f.shared.hiddenCallbacks;if(A!==null)for(f.shared.hiddenCallbacks=null,f=0;f<A.length;f++)um(A[f],T)}catch(V){$e(l,l.return,V)}}s&&_&64&&_g(h),wo(h,h.return);break;case 27:Cg(h);case 26:case 5:da(f,h,s),s&&l===null&&_&4&&Tg(h),wo(h,h.return);break;case 12:da(f,h,s);break;case 31:da(f,h,s),s&&_&4&&Ag(f,h);break;case 13:da(f,h,s),s&&_&4&&Dg(f,h);break;case 22:h.memoizedState===null&&da(f,h,s),wo(h,h.return);break;case 30:break;default:da(f,h,s)}t=t.sibling}}function ud(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&&po(s))}function dd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&po(e))}function On(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Og(e,t,s,l),t=t.sibling}function Og(e,t,s,l){var f=t.flags;switch(t.tag){case 0:case 11:case 15:On(e,t,s,l),f&2048&&No(9,t);break;case 1:On(e,t,s,l);break;case 3:On(e,t,s,l),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&po(e)));break;case 12:if(f&2048){On(e,t,s,l),e=t.stateNode;try{var h=t.memoizedProps,_=h.id,T=h.onPostCommit;typeof T=="function"&&T(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){$e(t,t.return,A)}}else On(e,t,s,l);break;case 31:On(e,t,s,l);break;case 13:On(e,t,s,l);break;case 23:break;case 22:h=t.stateNode,_=t.alternate,t.memoizedState!==null?h._visibility&2?On(e,t,s,l):jo(e,t):h._visibility&2?On(e,t,s,l):(h._visibility|=2,mi(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),f&2048&&ud(_,t);break;case 24:On(e,t,s,l),f&2048&&dd(t.alternate,t);break;default:On(e,t,s,l)}}function mi(e,t,s,l,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,_=t,T=s,A=l,V=_.flags;switch(_.tag){case 0:case 11:case 15:mi(h,_,T,A,f),No(8,_);break;case 23:break;case 22:var Z=_.stateNode;_.memoizedState!==null?Z._visibility&2?mi(h,_,T,A,f):jo(h,_):(Z._visibility|=2,mi(h,_,T,A,f)),f&&V&2048&&ud(_.alternate,_);break;case 24:mi(h,_,T,A,f),f&&V&2048&&dd(_.alternate,_);break;default:mi(h,_,T,A,f)}t=t.sibling}}function jo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,f=l.flags;switch(l.tag){case 22:jo(s,l),f&2048&&ud(l.alternate,l);break;case 24:jo(s,l),f&2048&&dd(l.alternate,l);break;default:jo(s,l)}t=t.sibling}}var Ao=8192;function gi(e,t,s){if(e.subtreeFlags&Ao)for(e=e.child;e!==null;)Bg(e,t,s),e=e.sibling}function Bg(e,t,s){switch(e.tag){case 26:gi(e,t,s),e.flags&Ao&&e.memoizedState!==null&&OS(s,Rn,e.memoizedState,e.memoizedProps);break;case 5:gi(e,t,s);break;case 3:case 4:var l=Rn;Rn=wr(e.stateNode.containerInfo),gi(e,t,s),Rn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ao,Ao=16777216,gi(e,t,s),Ao=l):gi(e,t,s));break;default:gi(e,t,s)}}function Ig(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 Do(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];jt=l,Ug(l,e)}Ig(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lg(e),e=e.sibling}function Lg(e){switch(e.tag){case 0:case 11:case 15:Do(e),e.flags&2048&&Ia(9,e,e.return);break;case 3:Do(e);break;case 12:Do(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,mr(e)):Do(e);break;default:Do(e)}}function mr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];jt=l,Ug(l,e)}Ig(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ia(8,t,t.return),mr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,mr(t));break;default:mr(t)}e=e.sibling}}function Ug(e,t){for(;jt!==null;){var s=jt;switch(s.tag){case 0:case 11:case 15:Ia(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:po(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,jt=l;else e:for(s=e;jt!==null;){l=jt;var f=l.sibling,h=l.return;if(wg(l),l===s){jt=null;break e}if(f!==null){f.return=h,jt=f;break e}jt=h}}}var Z1={getCacheForType:function(e){var t=Rt(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Rt(yt).controller.signal}},X1=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,je=null,De=0,Ge=0,on=null,La=!1,vi=!1,fd=!1,fa=0,ut=0,Ua=0,Ts=0,hd=0,ln=0,yi=0,Mo=null,Qt=null,pd=!1,gr=0,zg=0,vr=1/0,yr=null,za=null,Ct=0,Va=null,bi=null,ha=0,md=0,gd=null,Vg=null,Ro=0,vd=null;function rn(){return(Ve&2)!==0&&De!==0?De&-De:I.T!==null?Td():np()}function Hg(){if(ln===0)if((De&536870912)===0||Re){var e=mn;mn<<=1,(mn&3932160)===0&&(mn=262144),ln=e}else ln=536870912;return e=an.current,e!==null&&(e.flags|=32),ln}function Wt(e,t,s){(e===We&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(xi(e,0),Ha(e,De,ln,!1)),Ji(e,s),((Ve&2)===0||e!==We)&&(e===We&&((Ve&2)===0&&(Ts|=s),ut===4&&Ha(e,De,ln,!1)),Hn(e))}function Pg(e,t,s){if((Ve&6)!==0)throw Error(o(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Wi(e,t),f=l?J1(e,t):bd(e,t,!0),h=l;do{if(f===0){vi&&!l&&Ha(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!Q1(s)){f=bd(e,t,!1),h=!1;continue}if(f===2){if(h=t,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var T=e;f=Mo;var A=T.current.memoizedState.isDehydrated;if(A&&(xi(T,_).flags|=256),_=bd(T,_,!1),_!==2){if(fd&&!A){T.errorRecoveryDisabledLanes|=h,Ts|=h,f=4;break e}h=Qt,Qt=f,h!==null&&(Qt===null?Qt=h:Qt.push.apply(Qt,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){xi(e,0),Ha(e,t,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Ha(l,t,ln,!La);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(f=gr+300-Lt(),10<f)){if(Ha(l,t,ln,!La),wl(l,0,!0)!==0)break e;ha=t,l.timeoutHandle=bv(Gg.bind(null,l,s,Qt,yr,pd,t,ln,Ts,yi,La,h,"Throttled",-0,0),f);break e}Gg(l,s,Qt,yr,pd,t,ln,Ts,yi,La,h,null,-0,0)}}break}while(!0);Hn(e)}function Gg(e,t,s,l,f,h,_,T,A,V,Z,ee,$,K){if(e.timeoutHandle=-1,ee=t.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wn},Bg(t,h,ee);var ue=(h&62914560)===h?gr-Lt():(h&4194048)===h?zg-Lt():0;if(ue=BS(ee,ue),ue!==null){ha=h,e.cancelPendingCommit=ue(Qg.bind(null,e,t,h,s,l,f,_,T,A,Z,ee,null,$,K)),Ha(e,h,_,!V);return}}Qg(e,t,h,s,l,f,_,T,A)}function Q1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],h=f.getSnapshot;f=f.value;try{if(!tn(h(),f))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 Ha(e,t,s,l){t&=~hd,t&=~Ts,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var f=t;0<f;){var h=31-qe(f),_=1<<h;l[h]=-1,f&=~_}s!==0&&Jh(e,s,t)}function br(){return(Ve&6)===0?(Oo(0),!1):!0}function yd(){if(je!==null){if(Ge===0)var e=je.return;else e=je,na=ps=null,Ou(e),ui=null,go=0,e=je;for(;e!==null;)xg(e.alternate,e),e=e.return;je=null}}function xi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,vS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ha=0,yd(),We=e,je=s=ea(e.current,null),De=t,Ge=0,on=null,La=!1,vi=Wi(e,t),fd=!1,yi=ln=hd=Ts=Ua=ut=0,Qt=Mo=null,pd=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var f=31-qe(l),h=1<<f;t|=e[f],l&=~h}return fa=t,Vl(),s}function $g(e,t){Te=null,I.H=ko,t===ci||t===Yl?(t=om(),Ge=3):t===Su?(t=om(),Ge=4):Ge=t===Xu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,on=t,je===null&&(ut=1,rr(e,bn(t,e.current)))}function Fg(){var e=an.current;return e===null?!0:(De&4194048)===De?Tn===null:(De&62914560)===De||(De&536870912)!==0?e===Tn:!1}function qg(){var e=I.H;return I.H=ko,e===null?ko:e}function Kg(){var e=I.A;return I.A=Z1,e}function xr(){ut=4,La||(De&4194048)!==De&&an.current!==null||(vi=!0),(Ua&134217727)===0&&(Ts&134217727)===0||We===null||Ha(We,De,ln,!1)}function bd(e,t,s){var l=Ve;Ve|=2;var f=qg(),h=Kg();(We!==e||De!==t)&&(yr=null,xi(e,t)),t=!1;var _=ut;e:do try{if(Ge!==0&&je!==null){var T=je,A=on;switch(Ge){case 8:yd(),_=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var V=Ge;if(Ge=0,on=null,_i(e,T,A,V),s&&vi){_=0;break e}break;default:V=Ge,Ge=0,on=null,_i(e,T,A,V)}}W1(),_=ut;break}catch(Z){$g(e,Z)}while(!0);return t&&e.shellSuspendCounter++,na=ps=null,Ve=l,I.H=f,I.A=h,je===null&&(We=null,De=0,Vl()),_}function W1(){for(;je!==null;)Yg(je)}function J1(e,t){var s=Ve;Ve|=2;var l=qg(),f=Kg();We!==e||De!==t?(yr=null,vr=Lt()+500,xi(e,t)):vi=Wi(e,t);e:do try{if(Ge!==0&&je!==null){t=je;var h=on;t:switch(Ge){case 1:Ge=0,on=null,_i(e,t,h,1);break;case 2:case 9:if(sm(h)){Ge=0,on=null,Zg(t);break}t=function(){Ge!==2&&Ge!==9||We!==e||(Ge=7),Hn(e)},h.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:sm(h)?(Ge=0,on=null,Zg(t)):(Ge=0,on=null,_i(e,t,h,7));break;case 5:var _=null;switch(je.tag){case 26:_=je.memoizedState;case 5:case 27:var T=je;if(_?Ov(_):T.stateNode.complete){Ge=0,on=null;var A=T.sibling;if(A!==null)je=A;else{var V=T.return;V!==null?(je=V,_r(V)):je=null}break t}}Ge=0,on=null,_i(e,t,h,5);break;case 6:Ge=0,on=null,_i(e,t,h,6);break;case 8:yd(),ut=6;break e;default:throw Error(o(462))}}eS();break}catch(Z){$g(e,Z)}while(!0);return na=ps=null,I.H=l,I.A=f,Ve=s,je!==null?0:(We=null,De=0,Vl(),ut)}function eS(){for(;je!==null&&!El();)Yg(je)}function Yg(e){var t=yg(e.alternate,e,fa);e.memoizedProps=e.pendingProps,t===null?_r(e):je=t}function Zg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=fg(s,t,t.pendingProps,t.type,void 0,De);break;case 11:t=fg(s,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:Ou(t);default:xg(s,t),t=je=Kp(t,fa),t=yg(s,t,fa)}e.memoizedProps=e.pendingProps,t===null?_r(e):je=t}function _i(e,t,s,l){na=ps=null,Ou(t),ui=null,go=0;var f=t.return;try{if(P1(e,f,t,s,De)){ut=1,rr(e,bn(s,e.current)),je=null;return}}catch(h){if(f!==null)throw je=f,h;ut=1,rr(e,bn(s,e.current)),je=null;return}t.flags&32768?(Re||l===1?e=!0:vi||(De&536870912)!==0?e=!1:(La=e=!0,(l===2||l===9||l===3||l===6)&&(l=an.current,l!==null&&l.tag===13&&(l.flags|=16384))),Xg(t,e)):_r(t)}function _r(e){var t=e;do{if((t.flags&32768)!==0){Xg(t,La);return}e=t.return;var s=F1(t.alternate,t,fa);if(s!==null){je=s;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);ut===0&&(ut=5)}function Xg(e,t){do{var s=q1(e.alternate,e);if(s!==null){s.flags&=32767,je=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){je=e;return}je=e=s}while(e!==null);ut=6,je=null}function Qg(e,t,s,l,f,h,_,T,A){e.cancelPendingCommit=null;do Sr();while(Ct!==0);if((Ve&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=lu,R_(e,s,h,_,T,A),e===We&&(je=We=null,De=0),bi=t,Va=e,ha=s,md=h,gd=f,Vg=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,sS(ce,function(){return nv(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=I.T,I.T=null,f=H.p,H.p=2,_=Ve,Ve|=4;try{K1(e,t,s)}finally{Ve=_,H.p=f,I.T=l}}Ct=1,Wg(),Jg(),ev()}}function Wg(){if(Ct===1){Ct=0;var e=Va,t=bi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=I.T,I.T=null;var l=H.p;H.p=2;var f=Ve;Ve|=4;try{Mg(t,e);var h=Dd,_=Up(e.containerInfo),T=h.focusedElem,A=h.selectionRange;if(_!==T&&T&&T.ownerDocument&&Lp(T.ownerDocument.documentElement,T)){if(A!==null&&nu(T)){var V=A.start,Z=A.end;if(Z===void 0&&(Z=V),"selectionStart"in T)T.selectionStart=V,T.selectionEnd=Math.min(Z,T.value.length);else{var ee=T.ownerDocument||document,$=ee&&ee.defaultView||window;if($.getSelection){var K=$.getSelection(),ue=T.textContent.length,ge=Math.min(A.start,ue),Ze=A.end===void 0?ge:Math.min(A.end,ue);!K.extend&&ge>Ze&&(_=Ze,Ze=ge,ge=_);var U=Ip(T,ge),R=Ip(T,Ze);if(U&&R&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==R.node||K.focusOffset!==R.offset)){var z=ee.createRange();z.setStart(U.node,U.offset),K.removeAllRanges(),ge>Ze?(K.addRange(z),K.extend(R.node,R.offset)):(z.setEnd(R.node,R.offset),K.addRange(z))}}}}for(ee=[],K=T;K=K.parentNode;)K.nodeType===1&&ee.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ee.length;T++){var W=ee[T];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Or=!!Ad,Dd=Ad=null}finally{Ve=f,H.p=l,I.T=s}}e.current=t,Ct=2}}function Jg(){if(Ct===2){Ct=0;var e=Va,t=bi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=I.T,I.T=null;var l=H.p;H.p=2;var f=Ve;Ve|=4;try{Ng(e,t.alternate,t)}finally{Ve=f,H.p=l,I.T=s}}Ct=3}}function ev(){if(Ct===4||Ct===3){Ct=0,Nl();var e=Va,t=bi,s=ha,l=Vg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ct=5:(Ct=0,bi=Va=null,tv(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(za=null),Lc(s),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(ht,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=I.T,f=H.p,H.p=2,I.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var T=l[_];h(T.value,{componentStack:T.stack})}}finally{I.T=t,H.p=f}}(ha&3)!==0&&Sr(),Hn(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===vd?Ro++:(Ro=0,vd=e):Ro=0,Oo(0)}}function tv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,po(t)))}function Sr(){return Wg(),Jg(),ev(),nv()}function nv(){if(Ct!==5)return!1;var e=Va,t=md;md=0;var s=Lc(ha),l=I.T,f=H.p;try{H.p=32>s?32:s,I.T=null,s=gd,gd=null;var h=Va,_=ha;if(Ct=0,bi=Va=null,ha=0,(Ve&6)!==0)throw Error(o(331));var T=Ve;if(Ve|=4,Lg(h.current),Og(h,h.current,_,s),Ve=T,Oo(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(ht,h)}catch{}return!0}finally{H.p=f,I.T=l,tv(e,t)}}function av(e,t,s){t=bn(s,t),t=Zu(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ji(e,2),Hn(e))}function $e(e,t,s){if(e.tag===3)av(e,e,s);else for(;t!==null;){if(t.tag===3){av(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(za===null||!za.has(l))){e=bn(s,e),s=sg(2),l=Ra(t,s,2),l!==null&&(ig(s,l,t,e),Ji(l,2),Hn(l));break}}t=t.return}}function xd(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new X1;var f=new Set;l.set(t,f)}else f=l.get(t),f===void 0&&(f=new Set,l.set(t,f));f.has(s)||(fd=!0,f.add(s),e=tS.bind(null,e,t,s),t.then(e,e))}function tS(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,We===e&&(De&s)===s&&(ut===4||ut===3&&(De&62914560)===De&&300>Lt()-gr?(Ve&2)===0&&xi(e,0):hd|=s,yi===De&&(yi=0)),Hn(e)}function sv(e,t){t===0&&(t=Wh()),e=ds(e,t),e!==null&&(Ji(e,t),Hn(e))}function nS(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),sv(e,s)}function aS(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),sv(e,s)}function sS(e,t){return Hs(e,t)}var Tr=null,Si=null,_d=!1,kr=!1,Sd=!1,Pa=0;function Hn(e){e!==Si&&e.next===null&&(Si===null?Tr=Si=e:Si=Si.next=e),kr=!0,_d||(_d=!0,oS())}function Oo(e,t){if(!Sd&&kr){Sd=!0;do for(var s=!1,l=Tr;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,T=l.pingedLanes;h=(1<<31-qe(42|e)+1)-1,h&=f&~(_&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,rv(l,h))}else h=De,h=wl(l,l===We?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Wi(l,h)||(s=!0,rv(l,h));l=l.next}while(s);Sd=!1}}function iS(){iv()}function iv(){kr=_d=!1;var e=0;Pa!==0&&gS()&&(e=Pa);for(var t=Lt(),s=null,l=Tr;l!==null;){var f=l.next,h=ov(l,t);h===0?(l.next=null,s===null?Tr=f:s.next=f,f===null&&(Si=s)):(s=l,(e!==0||(h&3)!==0)&&(kr=!0)),l=f}Ct!==0&&Ct!==5||Oo(e),Pa!==0&&(Pa=0)}function ov(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-qe(h),T=1<<_,A=f[_];A===-1?((T&s)===0||(T&l)!==0)&&(f[_]=M_(T,t)):A<=t&&(e.expiredLanes|=T),h&=~T}if(t=We,s=De,s=wl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ps(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Wi(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&Ps(l),Lc(s)){case 2:case 8:s=le;break;case 32:s=ce;break;case 268435456:s=xe;break;default:s=ce}return l=lv.bind(null,e),s=Hs(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&Ps(l),e.callbackPriority=2,e.callbackNode=null,2}function lv(e,t){if(Ct!==0&&Ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Sr()&&e.callbackNode!==s)return null;var l=De;return l=wl(e,e===We?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Pg(e,l,t),ov(e,Lt()),e.callbackNode!=null&&e.callbackNode===s?lv.bind(null,e):null)}function rv(e,t){if(Sr())return null;Pg(e,t,!0)}function oS(){yS(function(){(Ve&6)!==0?Hs(J,iS):iv()})}function Td(){if(Pa===0){var e=li;e===0&&(e=Ta,Ta<<=1,(Ta&261888)===0&&(Ta=256)),Pa=e}return Pa}function cv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function uv(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 lS(e,t,s,l,f){if(t==="submit"&&s&&s.stateNode===f){var h=cv((f[qt]||null).action),_=l.submitter;_&&(t=(t=_[qt]||null)?cv(t.formAction):_.getAttribute("formAction"),t!==null&&(h=t,_=null));var T=new Il("action","action",null,l,f);e.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Pa!==0){var A=_?uv(f,_):new FormData(f);Gu(s,{pending:!0,data:A,method:f.method,action:h},null,A)}}else typeof h=="function"&&(T.preventDefault(),A=_?uv(f,_):new FormData(f),Gu(s,{pending:!0,data:A,method:f.method,action:h},h,A))},currentTarget:f}]})}}for(var kd=0;kd<ou.length;kd++){var Cd=ou[kd],rS=Cd.toLowerCase(),cS=Cd[0].toUpperCase()+Cd.slice(1);Mn(rS,"on"+cS)}Mn(Hp,"onAnimationEnd"),Mn(Pp,"onAnimationIteration"),Mn(Gp,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(C1,"onTransitionRun"),Mn(E1,"onTransitionStart"),Mn(N1,"onTransitionCancel"),Mn($p,"onTransitionEnd"),Ks("onMouseEnter",["mouseout","mouseover"]),Ks("onMouseLeave",["mouseout","mouseover"]),Ks("onPointerEnter",["pointerout","pointerover"]),Ks("onPointerLeave",["pointerout","pointerover"]),ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ls("onBeforeInput",["compositionend","keypress","textInput","paste"]),ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="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(" "),uS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bo));function dv(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],f=l.event;l=l.listeners;e:{var h=void 0;if(t)for(var _=l.length-1;0<=_;_--){var T=l[_],A=T.instance,V=T.currentTarget;if(T=T.listener,A!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=V;try{h(f)}catch(Z){zl(Z)}f.currentTarget=null,h=A}else for(_=0;_<l.length;_++){if(T=l[_],A=T.instance,V=T.currentTarget,T=T.listener,A!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=V;try{h(f)}catch(Z){zl(Z)}f.currentTarget=null,h=A}}}}function Ae(e,t){var s=t[Uc];s===void 0&&(s=t[Uc]=new Set);var l=e+"__bubble";s.has(l)||(fv(t,e,2,!1),s.add(l))}function Ed(e,t,s){var l=0;t&&(l|=4),fv(s,e,l,t)}var Cr="_reactListening"+Math.random().toString(36).slice(2);function Nd(e){if(!e[Cr]){e[Cr]=!0,ip.forEach(function(s){s!=="selectionchange"&&(uS.has(s)||Ed(s,!1,e),Ed(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cr]||(t[Cr]=!0,Ed("selectionchange",!1,t))}}function fv(e,t,s,l){switch(Hv(t)){case 2:var f=US;break;case 8:f=zS;break;default:f=Pd}s=f.bind(null,t,s,e),f=void 0,!Kc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(t,s,{capture:!0,passive:f}):e.addEventListener(t,s,!0):f!==void 0?e.addEventListener(t,s,{passive:f}):e.addEventListener(t,s,!1)}function wd(e,t,s,l,f){var h=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var T=l.stateNode.containerInfo;if(T===f)break;if(_===4)for(_=l.return;_!==null;){var A=_.tag;if((A===3||A===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;T!==null;){if(_=$s(T),_===null)return;if(A=_.tag,A===5||A===6||A===26||A===27){l=h=_;continue e}T=T.parentNode}}l=l.return}vp(function(){var V=h,Z=Fc(s),ee=[];e:{var $=Fp.get(e);if($!==void 0){var K=Il,ue=e;switch(e){case"keypress":if(Ol(s)===0)break e;case"keydown":case"keyup":K=a1;break;case"focusin":ue="focus",K=Qc;break;case"focusout":ue="blur",K=Qc;break;case"beforeblur":case"afterblur":K=Qc;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":K=xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=F_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=o1;break;case Hp:case Pp:case Gp:K=Y_;break;case $p:K=r1;break;case"scroll":case"scrollend":K=G_;break;case"wheel":K=u1;break;case"copy":case"cut":case"paste":K=X_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Sp;break;case"toggle":case"beforetoggle":K=f1}var ge=(t&4)!==0,Ze=!ge&&(e==="scroll"||e==="scrollend"),U=ge?$!==null?$+"Capture":null:$;ge=[];for(var R=V,z;R!==null;){var W=R;if(z=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||z===null||U===null||(W=no(R,U),W!=null&&ge.push(Io(R,W,z))),Ze)break;R=R.return}0<ge.length&&($=new K($,ue,null,s,Z),ee.push({event:$,listeners:ge}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",$&&s!==$c&&(ue=s.relatedTarget||s.fromElement)&&($s(ue)||ue[Gs]))break e;if((K||$)&&($=Z.window===Z?Z:($=Z.ownerDocument)?$.defaultView||$.parentWindow:window,K?(ue=s.relatedTarget||s.toElement,K=V,ue=ue?$s(ue):null,ue!==null&&(Ze=u(ue),ge=ue.tag,ue!==Ze||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):(K=null,ue=V),K!==ue)){if(ge=xp,W="onMouseLeave",U="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Sp,W="onPointerLeave",U="onPointerEnter",R="pointer"),Ze=K==null?$:to(K),z=ue==null?$:to(ue),$=new ge(W,R+"leave",K,s,Z),$.target=Ze,$.relatedTarget=z,W=null,$s(Z)===V&&(ge=new ge(U,R+"enter",ue,s,Z),ge.target=z,ge.relatedTarget=Ze,W=ge),Ze=W,K&&ue)t:{for(ge=dS,U=K,R=ue,z=0,W=U;W;W=ge(W))z++;W=0;for(var pe=R;pe;pe=ge(pe))W++;for(;0<z-W;)U=ge(U),z--;for(;0<W-z;)R=ge(R),W--;for(;z--;){if(U===R||R!==null&&U===R.alternate){ge=U;break t}U=ge(U),R=ge(R)}ge=null}else ge=null;K!==null&&hv(ee,$,K,ge,!1),ue!==null&&Ze!==null&&hv(ee,Ze,ue,ge,!0)}}e:{if($=V?to(V):window,K=$.nodeName&&$.nodeName.toLowerCase(),K==="select"||K==="input"&&$.type==="file")var Ie=Ap;else if(wp($))if(Dp)Ie=S1;else{Ie=x1;var he=b1}else K=$.nodeName,!K||K.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?V&&Gc(V.elementType)&&(Ie=Ap):Ie=_1;if(Ie&&(Ie=Ie(e,V))){jp(ee,Ie,s,Z);break e}he&&he(e,$,V),e==="focusout"&&V&&$.type==="number"&&V.memoizedProps.value!=null&&Pc($,"number",$.value)}switch(he=V?to(V):window,e){case"focusin":(wp(he)||he.contentEditable==="true")&&(Js=he,au=V,uo=null);break;case"focusout":uo=au=Js=null;break;case"mousedown":su=!0;break;case"contextmenu":case"mouseup":case"dragend":su=!1,zp(ee,s,Z);break;case"selectionchange":if(k1)break;case"keydown":case"keyup":zp(ee,s,Z)}var Ce;if(Jc)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Ws?Ep(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(Tp&&s.locale!=="ko"&&(Ws||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Ws&&(Ce=yp()):(Ea=Z,Yc="value"in Ea?Ea.value:Ea.textContent,Ws=!0)),he=Er(V,Me),0<he.length&&(Me=new _p(Me,e,null,s,Z),ee.push({event:Me,listeners:he}),Ce?Me.data=Ce:(Ce=Np(s),Ce!==null&&(Me.data=Ce)))),(Ce=p1?m1(e,s):g1(e,s))&&(Me=Er(V,"onBeforeInput"),0<Me.length&&(he=new _p("onBeforeInput","beforeinput",null,s,Z),ee.push({event:he,listeners:Me}),he.data=Ce)),lS(ee,e,V,s,Z)}dv(ee,t)})}function Io(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Er(e,t){for(var s=t+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=no(e,s),f!=null&&l.unshift(Io(e,f,h)),f=no(e,t),f!=null&&l.push(Io(e,f,h))),e.tag===3)return l;e=e.return}return[]}function dS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hv(e,t,s,l,f){for(var h=t._reactName,_=[];s!==null&&s!==l;){var T=s,A=T.alternate,V=T.stateNode;if(T=T.tag,A!==null&&A===l)break;T!==5&&T!==26&&T!==27||V===null||(A=V,f?(V=no(s,h),V!=null&&_.unshift(Io(s,V,A))):f||(V=no(s,h),V!=null&&_.push(Io(s,V,A)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var fS=/\r\n?/g,hS=/\u0000|\uFFFD/g;function pv(e){return(typeof e=="string"?e:""+e).replace(fS,`
26
+ `).replace(hS,"")}function mv(e,t){return t=pv(t),pv(e)===t}function Ye(e,t,s,l,f,h){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Zs(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Zs(e,""+l);break;case"className":Al(e,"class",l);break;case"tabIndex":Al(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Al(e,s,l);break;case"style":mp(e,l,h);break;case"data":if(t!=="object"){Al(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ml(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(t!=="input"&&Ye(e,t,"name",f.name,f,null),Ye(e,t,"formEncType",f.formEncType,f,null),Ye(e,t,"formMethod",f.formMethod,f,null),Ye(e,t,"formTarget",f.formTarget,f,null)):(Ye(e,t,"encType",f.encType,f,null),Ye(e,t,"method",f.method,f,null),Ye(e,t,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ml(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=Wn);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Ml(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),jl(e,"popover",l);break;case"xlinkActuate":Qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":jl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=H_.get(s)||s,jl(e,s,l))}}function jd(e,t,s,l,f,h){switch(s){case"style":mp(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Zs(e,l):(typeof l=="number"||typeof l=="bigint")&&Zs(e,""+l);break;case"onScroll":l!=null&&Ae("scroll",e);break;case"onScrollEnd":l!=null&&Ae("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Wn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!op.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),t=s.slice(2,f?s.length-7:void 0),h=e[qt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,f);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):jl(e,s,l)}}}function Bt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var l=!1,f=!1,h;for(h in s)if(s.hasOwnProperty(h)){var _=s[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,h,_,s,null)}}f&&Ye(e,t,"srcSet",s.srcSet,s,null),l&&Ye(e,t,"src",s.src,s,null);return;case"input":Ae("invalid",e);var T=h=_=f=null,A=null,V=null;for(l in s)if(s.hasOwnProperty(l)){var Z=s[l];if(Z!=null)switch(l){case"name":f=Z;break;case"type":_=Z;break;case"checked":A=Z;break;case"defaultChecked":V=Z;break;case"value":h=Z;break;case"defaultValue":T=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(o(137,t));break;default:Ye(e,t,l,Z,s,null)}}dp(e,h,T,A,V,_,f,!1);return;case"select":Ae("invalid",e),l=_=h=null;for(f in s)if(s.hasOwnProperty(f)&&(T=s[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":_=T;break;case"multiple":l=T;default:Ye(e,t,f,T,s,null)}t=h,s=_,e.multiple=!!l,t!=null?Ys(e,!!l,t,!1):s!=null&&Ys(e,!!l,s,!0);return;case"textarea":Ae("invalid",e),h=f=l=null;for(_ in s)if(s.hasOwnProperty(_)&&(T=s[_],T!=null))switch(_){case"value":l=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:Ye(e,t,_,T,s,null)}hp(e,l,f,h);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(l=s[A],l!=null))switch(A){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ye(e,t,A,l,s,null)}return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(l=0;l<Bo.length;l++)Ae(Bo[l],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("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)&&(l=s[V],l!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ye(e,t,V,l,s,null)}return;default:if(Gc(t)){for(Z in s)s.hasOwnProperty(Z)&&(l=s[Z],l!==void 0&&jd(e,t,Z,l,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(l=s[T],l!=null&&Ye(e,t,T,l,s,null))}function pS(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,T=null,A=null,V=null,Z=null;for(K in s){var ee=s[K];if(s.hasOwnProperty(K)&&ee!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":A=ee;default:l.hasOwnProperty(K)||Ye(e,t,K,null,l,ee)}}for(var $ in l){var K=l[$];if(ee=s[$],l.hasOwnProperty($)&&(K!=null||ee!=null))switch($){case"type":h=K;break;case"name":f=K;break;case"checked":V=K;break;case"defaultChecked":Z=K;break;case"value":_=K;break;case"defaultValue":T=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:K!==ee&&Ye(e,t,$,K,l,ee)}}Hc(e,_,T,A,V,Z,h,f);return;case"select":K=_=T=$=null;for(h in s)if(A=s[h],s.hasOwnProperty(h)&&A!=null)switch(h){case"value":break;case"multiple":K=A;default:l.hasOwnProperty(h)||Ye(e,t,h,null,l,A)}for(f in l)if(h=l[f],A=s[f],l.hasOwnProperty(f)&&(h!=null||A!=null))switch(f){case"value":$=h;break;case"defaultValue":T=h;break;case"multiple":_=h;default:h!==A&&Ye(e,t,f,h,l,A)}t=T,s=_,l=K,$!=null?Ys(e,!!s,$,!1):!!l!=!!s&&(t!=null?Ys(e,!!s,t,!0):Ys(e,!!s,s?[]:"",!1));return;case"textarea":K=$=null;for(T in s)if(f=s[T],s.hasOwnProperty(T)&&f!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ye(e,t,T,null,l,f)}for(_ in l)if(f=l[_],h=s[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":$=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:f!==h&&Ye(e,t,_,f,l,h)}fp(e,$,K);return;case"option":for(var ue in s)if($=s[ue],s.hasOwnProperty(ue)&&$!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ye(e,t,ue,null,l,$)}for(A in l)if($=l[A],K=s[A],l.hasOwnProperty(A)&&$!==K&&($!=null||K!=null))switch(A){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ye(e,t,A,$,l,K)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in s)$=s[ge],s.hasOwnProperty(ge)&&$!=null&&!l.hasOwnProperty(ge)&&Ye(e,t,ge,null,l,$);for(V in l)if($=l[V],K=s[V],l.hasOwnProperty(V)&&$!==K&&($!=null||K!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(o(137,t));break;default:Ye(e,t,V,$,l,K)}return;default:if(Gc(t)){for(var Ze in s)$=s[Ze],s.hasOwnProperty(Ze)&&$!==void 0&&!l.hasOwnProperty(Ze)&&jd(e,t,Ze,void 0,l,$);for(Z in l)$=l[Z],K=s[Z],!l.hasOwnProperty(Z)||$===K||$===void 0&&K===void 0||jd(e,t,Z,$,l,K);return}}for(var U in s)$=s[U],s.hasOwnProperty(U)&&$!=null&&!l.hasOwnProperty(U)&&Ye(e,t,U,null,l,$);for(ee in l)$=l[ee],K=s[ee],!l.hasOwnProperty(ee)||$===K||$==null&&K==null||Ye(e,t,ee,$,l,K)}function gv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],h=f.transferSize,_=f.initiatorType,T=f.duration;if(h&&T&&gv(_)){for(_=0,T=f.responseEnd,l+=1;l<s.length;l++){var A=s[l],V=A.startTime;if(V>T)break;var Z=A.transferSize,ee=A.initiatorType;Z&&gv(ee)&&(A=A.responseEnd,_+=Z*(A<T?1:(T-V)/(A-V)))}if(--l,t+=8*(h+_)/(f.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 Ad=null,Dd=null;function Nr(e){return e.nodeType===9?e:e.ownerDocument}function vv(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 yv(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 Md(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 Rd=null;function gS(){var e=window.event;return e&&e.type==="popstate"?e===Rd?!1:(Rd=e,!0):(Rd=null,!1)}var bv=typeof setTimeout=="function"?setTimeout:void 0,vS=typeof clearTimeout=="function"?clearTimeout:void 0,xv=typeof Promise=="function"?Promise:void 0,yS=typeof queueMicrotask=="function"?queueMicrotask:typeof xv<"u"?function(e){return xv.resolve(null).then(e).catch(bS)}:bv;function bS(e){setTimeout(function(){throw e})}function Ga(e){return e==="head"}function _v(e,t){var s=t,l=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(f),Ei(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Lo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Lo(s);for(var h=s.firstChild;h;){var _=h.nextSibling,T=h.nodeName;h[eo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=_}}else s==="body"&&Lo(e.ownerDocument.body);s=f}while(s);Ei(t)}function Sv(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Od(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":Od(s),zc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function xS(e,t,s,l){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[eo])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!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function _S(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=kn(e.nextSibling),e===null))return null;return e}function Tv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function Bd(e){return e.data==="$?"||e.data==="$~"}function Id(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function SS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function kn(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 Ld=null;function kv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return kn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Cv(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 Ev(e,t,s){switch(t=Nr(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zc(e)}var Cn=new Map,Nv=new Set;function wr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var pa=H.d;H.d={f:TS,r:kS,D:CS,C:ES,L:NS,m:wS,X:AS,S:jS,M:DS};function TS(){var e=pa.f(),t=br();return e||t}function kS(e){var t=Fs(e);t!==null&&t.tag===5&&t.type==="form"?$m(t):pa.r(e)}var Ti=typeof document>"u"?null:document;function wv(e,t,s){var l=Ti;if(l&&typeof t=="string"&&t){var f=vn(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),Nv.has(f)||(Nv.add(f),e={rel:e,crossOrigin:s,href:t},l.querySelector(f)===null&&(t=l.createElement("link"),Bt(t,"link",e),wt(t),l.head.appendChild(t)))}}function CS(e){pa.D(e),wv("dns-prefetch",e,null)}function ES(e,t){pa.C(e,t),wv("preconnect",e,t)}function NS(e,t,s){pa.L(e,t,s);var l=Ti;if(l&&e&&t){var f='link[rel="preload"][as="'+vn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+vn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+vn(s.imageSizes)+'"]')):f+='[href="'+vn(e)+'"]';var h=f;switch(t){case"style":h=ki(e);break;case"script":h=Ci(e)}Cn.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Cn.set(h,e),l.querySelector(f)!==null||t==="style"&&l.querySelector(Uo(h))||t==="script"&&l.querySelector(zo(h))||(t=l.createElement("link"),Bt(t,"link",e),wt(t),l.head.appendChild(t)))}}function wS(e,t){pa.m(e,t);var s=Ti;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+vn(l)+'"][href="'+vn(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ci(e)}if(!Cn.has(h)&&(e=v({rel:"modulepreload",href:e},t),Cn.set(h,e),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(zo(h)))return}l=s.createElement("link"),Bt(l,"link",e),wt(l),s.head.appendChild(l)}}}function jS(e,t,s){pa.S(e,t,s);var l=Ti;if(l&&e){var f=qs(l).hoistableStyles,h=ki(e);t=t||"default";var _=f.get(h);if(!_){var T={loading:0,preload:null};if(_=l.querySelector(Uo(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Cn.get(h))&&Ud(e,s);var A=_=l.createElement("link");wt(A),Bt(A,"link",e),A._p=new Promise(function(V,Z){A.onload=V,A.onerror=Z}),A.addEventListener("load",function(){T.loading|=1}),A.addEventListener("error",function(){T.loading|=2}),T.loading|=4,jr(_,t,l)}_={type:"stylesheet",instance:_,count:1,state:T},f.set(h,_)}}}function AS(e,t){pa.X(e,t);var s=Ti;if(s&&e){var l=qs(s).hoistableScripts,f=Ci(e),h=l.get(f);h||(h=s.querySelector(zo(f)),h||(e=v({src:e,async:!0},t),(t=Cn.get(f))&&zd(e,t),h=s.createElement("script"),wt(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function DS(e,t){pa.M(e,t);var s=Ti;if(s&&e){var l=qs(s).hoistableScripts,f=Ci(e),h=l.get(f);h||(h=s.querySelector(zo(f)),h||(e=v({src:e,async:!0,type:"module"},t),(t=Cn.get(f))&&zd(e,t),h=s.createElement("script"),wt(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function jv(e,t,s,l){var f=(f=fe.current)?wr(f):null;if(!f)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=ki(s.href),s=qs(f).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=ki(s.href);var h=qs(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(Uo(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Cn.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},Cn.set(e,s),h||MS(f,e,s,_.state))),t&&l===null)throw Error(o(528,""));return _}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ci(s),s=qs(f).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ki(e){return'href="'+vn(e)+'"'}function Uo(e){return'link[rel="stylesheet"]['+e+"]"}function Av(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function MS(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Bt(t,"link",s),wt(t),e.head.appendChild(t))}function Ci(e){return'[src="'+vn(e)+'"]'}function zo(e){return"script[async]"+e}function Dv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+vn(s.href)+'"]');if(l)return t.instance=l,wt(l),l;var f=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Bt(l,"style",f),jr(l,s.precedence,e),t.instance=l;case"stylesheet":f=ki(s.href);var h=e.querySelector(Uo(f));if(h)return t.state.loading|=4,t.instance=h,wt(h),h;l=Av(s),(f=Cn.get(f))&&Ud(l,f),h=(e.ownerDocument||e).createElement("link"),wt(h);var _=h;return _._p=new Promise(function(T,A){_.onload=T,_.onerror=A}),Bt(h,"link",l),t.state.loading|=4,jr(h,s.precedence,e),t.instance=h;case"script":return h=Ci(s.src),(f=e.querySelector(zo(h)))?(t.instance=f,wt(f),f):(l=s,(f=Cn.get(h))&&(l=v({},s),zd(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),wt(f),Bt(f,"link",l),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,jr(l,s.precedence,e));return t.instance}function jr(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var T=l[_];if(T.dataset.precedence===t)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function zd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ar=null;function Mv(e,t,s){if(Ar===null){var l=new Map,f=Ar=new Map;f.set(s,l)}else f=Ar,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var h=s[f];if(!(h[eo]||h[Dt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(t)||"";_=e+_;var T=l.get(_);T?T.push(h):l.set(_,[h])}}return l}function Rv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function RS(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 Ov(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function OS(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=ki(l.href),h=t.querySelector(Uo(f));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Dr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,wt(h);return}h=t.ownerDocument||t,l=Av(l),(f=Cn.get(f))&&Ud(l,f),h=h.createElement("link"),wt(h);var _=h;_._p=new Promise(function(T,A){_.onload=T,_.onerror=A}),Bt(h,"link",l),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Dr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Vd=0;function BS(e,t){return e.stylesheets&&e.count===0&&Rr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&Rr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Vd===0&&(Vd=62500*mS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Rr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Vd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Dr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mr=null;function Rr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mr=new Map,t.forEach(IS,e),Mr=null,Dr.call(e))}function IS(e,t){if(!(t.state.loading&4)){var s=Mr.get(e);if(s)var l=s.get(null);else{s=new Map,Mr.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),l=_)}l&&s.set(null,l)}f=t.instance,_=f.getAttribute("data-precedence"),h=s.get(_)||l,h===l&&s.set(null,f),s.set(_,f),this.count++,l=Dr.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var Vo={$$typeof:M,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function LS(e,t,s,l,f,h,_,T,A){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=Bc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bc(0),this.hiddenUpdates=Bc(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Bv(e,t,s,l,f,h,_,T,A,V,Z,ee){return e=new LS(e,t,s,_,A,V,Z,ee,T),t=1,h===!0&&(t|=24),h=nn(3,null,null,t),e.current=h,h.stateNode=e,t=bu(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:l,isDehydrated:s,cache:t},Tu(h),e}function Iv(e){return e?(e=ni,e):ni}function Lv(e,t,s,l,f,h){f=Iv(f),l.context===null?l.context=f:l.pendingContext=f,l=Ma(t),l.payload={element:s},h=h===void 0?null:h,h!==null&&(l.callback=h),s=Ra(e,l,t),s!==null&&(Wt(s,e,t),yo(s,e,t))}function Uv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Hd(e,t){Uv(e,t),(e=e.alternate)&&Uv(e,t)}function zv(e){if(e.tag===13||e.tag===31){var t=ds(e,67108864);t!==null&&Wt(t,e,67108864),Hd(e,67108864)}}function Vv(e){if(e.tag===13||e.tag===31){var t=rn();t=Ic(t);var s=ds(e,t);s!==null&&Wt(s,e,t),Hd(e,t)}}var Or=!0;function US(e,t,s,l){var f=I.T;I.T=null;var h=H.p;try{H.p=2,Pd(e,t,s,l)}finally{H.p=h,I.T=f}}function zS(e,t,s,l){var f=I.T;I.T=null;var h=H.p;try{H.p=8,Pd(e,t,s,l)}finally{H.p=h,I.T=f}}function Pd(e,t,s,l){if(Or){var f=Gd(l);if(f===null)wd(e,t,l,Br,s),Pv(e,l);else if(HS(f,e,t,s,l))l.stopPropagation();else if(Pv(e,l),t&4&&-1<VS.indexOf(e)){for(;f!==null;){var h=Fs(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=os(h.pendingLanes);if(_!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;_;){var A=1<<31-qe(_);T.entanglements[1]|=A,_&=~A}Hn(h),(Ve&6)===0&&(vr=Lt()+500,Oo(0))}}break;case 31:case 13:T=ds(h,2),T!==null&&Wt(T,h,2),br(),Hd(h,2)}if(h=Gd(l),h===null&&wd(e,t,l,Br,s),h===f)break;f=h}f!==null&&l.stopPropagation()}else wd(e,t,l,null,s)}}function Gd(e){return e=Fc(e),$d(e)}var Br=null;function $d(e){if(Br=null,e=$s(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=d(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Br=e,null}function Hv(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(Oc()){case J:return 2;case le:return 8;case ce:case _e:return 32;case xe:return 268435456;default:return 32}default:return 32}}var Fd=!1,$a=null,Fa=null,qa=null,Ho=new Map,Po=new Map,Ka=[],VS="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 Pv(e,t){switch(e){case"focusin":case"focusout":$a=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(t.pointerId)}}function Go(e,t,s,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},t!==null&&(t=Fs(t),t!==null&&zv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function HS(e,t,s,l,f){switch(t){case"focusin":return $a=Go($a,e,t,s,l,f),!0;case"dragenter":return Fa=Go(Fa,e,t,s,l,f),!0;case"mouseover":return qa=Go(qa,e,t,s,l,f),!0;case"pointerover":var h=f.pointerId;return Ho.set(h,Go(Ho.get(h)||null,e,t,s,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Po.set(h,Go(Po.get(h)||null,e,t,s,l,f)),!0}return!1}function Gv(e){var t=$s(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=d(s),t!==null){e.blockedOn=t,ap(e.priority,function(){Vv(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,ap(e.priority,function(){Vv(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 Ir(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Gd(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);$c=l,s.target.dispatchEvent(l),$c=null}else return t=Fs(s),t!==null&&zv(t),e.blockedOn=s,!1;t.shift()}return!0}function $v(e,t,s){Ir(e)&&s.delete(t)}function PS(){Fd=!1,$a!==null&&Ir($a)&&($a=null),Fa!==null&&Ir(Fa)&&(Fa=null),qa!==null&&Ir(qa)&&(qa=null),Ho.forEach($v),Po.forEach($v)}function Lr(e,t){e.blockedOn===t&&(e.blockedOn=null,Fd||(Fd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,PS)))}var Ur=null;function Fv(e){Ur!==e&&(Ur=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ur===e&&(Ur=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],f=e[t+2];if(typeof l!="function"){if($d(l||s)===null)continue;break}var h=Fs(s);h!==null&&(e.splice(t,3),t-=3,Gu(h,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function Ei(e){function t(A){return Lr(A,e)}$a!==null&&Lr($a,e),Fa!==null&&Lr(Fa,e),qa!==null&&Lr(qa,e),Ho.forEach(t),Po.forEach(t);for(var s=0;s<Ka.length;s++){var l=Ka[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ka.length&&(s=Ka[0],s.blockedOn===null);)Gv(s),s.blockedOn===null&&Ka.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],h=s[l+1],_=f[qt]||null;if(typeof h=="function")_||Fv(s);else if(_){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[qt]||null)T=_.formAction;else if($d(f)!==null)continue}else T=_.action;typeof T=="function"?s[l+1]=T:(s.splice(l,3),l-=3),Fv(s)}}}function qv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function qd(e){this._internalRoot=e}zr.prototype.render=qd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,l=rn();Lv(s,l,e,t,null,null)},zr.prototype.unmount=qd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lv(e.current,2,null,e,null,null),br(),t[Gs]=null}};function zr(e){this._internalRoot=e}zr.prototype.unstable_scheduleHydration=function(e){if(e){var t=np();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ka.length&&t!==0&&t<Ka[s].priority;s++);Ka.splice(s,0,e),s===0&&Gv(e)}};var Kv=a.version;if(Kv!=="19.2.4")throw Error(o(527,Kv,"19.2.4"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var GS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vr.isDisabled&&Vr.supportsFiber)try{ht=Vr.inject(GS),Ne=Vr}catch{}}return $o.createRoot=function(e,t){if(!r(e))throw Error(o(299));var s=!1,l="",f=eg,h=tg,_=ng;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Bv(e,1,!1,null,null,s,l,null,f,h,_,qv),e[Gs]=t.current,Nd(e),new qd(t)},$o.hydrateRoot=function(e,t,s){if(!r(e))throw Error(o(299));var l=!1,f="",h=eg,_=tg,T=ng,A=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),t=Bv(e,1,!0,t,s??null,l,f,A,h,_,T,qv),t.context=Iv(null),s=t.current,l=rn(),l=Ic(l),f=Ma(l),f.callback=null,Ra(s,f,l),s=l,t.current.lanes=s,Ji(t,s),Hn(t),e[Gs]=t.current,Nd(e),new zr(t)},$o.version="19.2.4",$o}var ey;function iT(){if(ey)return Kd.exports;ey=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(),Kd.exports=sT(),Kd.exports}var oT=iT();const lT="modulepreload",rT=function(n){return"/"+n},ty={},cT=function(a,i,o){let r=Promise.resolve();if(i&&i.length>0){let d=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));r=d(i.map(g=>{if(g=rT(g),g in ty)return;ty[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${v}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":lT,y||(b.as="script"),b.crossOrigin="",b.href=g,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((S,k)=>{b.addEventListener("load",S),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return r.then(d=>{for(const p of d||[])p.status==="rejected"&&u(p.reason);return a().catch(u)})};function Ft(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function cl(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function uT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.type=="string"&&typeof n.timestamp=="string"&&Ft(n.payload)}function dT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"&&(typeof n.adapterConfig=="string"||n.adapterConfig===void 0)}function fT(n){return{...n,adapterConfig:n.adapterConfig??"{}"}}function ny(n){return Ft(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function ay(n){return Ft(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}function hT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function pT(n){return Ft(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function mT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.workspaceId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function gT(n){return Ft(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const vT=new Set(["off","subscription","api_key"]),Pr=new Set(["off","on"]);function sy(n){return Ft(n)&&vT.has(n.claude)&&Pr.has(n.github)&&Pr.has(n.copilot)&&Pr.has(n.codex)&&Pr.has(n.goose)}function yT(n){return Ft(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function bT(n){return Ft(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"&&typeof n.type=="string"&&typeof n.script=="string"}function qn(n,a,i,o){return Array.isArray(n)?n.filter((r,u)=>a(r)?!0:(cl(i,`item at index ${u} in "${o}" has unexpected shape`),!1)):(cl(i,`expected "${o}" to be an array, got ${typeof n}`),[])}function xT(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Ft(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:Ft(a.payload)?a.payload:{}}:{type:a.type,payload:Ft(a.payload)?a.payload:void 0}}function _T(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const ST=3e3,Ni=5e3,TT=4001;/**
27
+ * react-router v7.13.1
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 iy="popstate";function oy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function kT(n={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=u||o.location;return Tf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:ul(r)}return ET(a,i,null,n)}function at(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function jn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function CT(){return Math.random().toString(36).substring(2,10)}function ly(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 Tf(n,a,i=null,o,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Gi(a):a,state:i,key:a&&a.key||o||CT(),unstable_mask:r}}function ul({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 Gi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function ET(n,a,i,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,p="POP",m=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function v(){p="POP";let N=y(),E=N==null?null:N-g;g=N,m&&m({action:p,location:C.location,delta:E})}function b(N,E){p="PUSH";let w=oy(N)?N:Tf(C.location,N,E);g=y()+1;let M=ly(w,g),D=C.createHref(w.unstable_mask||w);try{d.pushState(M,"",D)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(D)}u&&m&&m({action:p,location:C.location,delta:1})}function S(N,E){p="REPLACE";let w=oy(N)?N:Tf(C.location,N,E);g=y();let M=ly(w,g),D=C.createHref(w.unstable_mask||w);d.replaceState(M,"",D),u&&m&&m({action:p,location:C.location,delta:0})}function k(N){return NT(N)}let C={get action(){return p},get location(){return n(r,d)},listen(N){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(iy,v),m=N,()=>{r.removeEventListener(iy,v),m=null}},createHref(N){return a(r,N)},createURL:k,encodeLocation(N){let E=k(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:S,go(N){return d.go(N)}};return C}function NT(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),at(i,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:ul(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function eb(n,a,i="/"){return wT(n,a,i,!1)}function wT(n,a,i,o){let r=typeof a=="string"?Gi(a):a,u=ba(r.pathname||"/",i);if(u==null)return null;let d=tb(n);jT(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=ab(u);p=UT(d[m],g,o)}return p}function tb(n,a=[],i=[],o="",r=!1){let u=(d,p,m=r,g)=>{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&m)return;at(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Kn([o,y.relativePath]),b=i.concat(y);d.children&&d.children.length>0&&(at(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),tb(d.children,a,b,v,m)),!(d.path==null&&!d.index)&&a.push({path:v,score:IT(v,d.index),routesMeta:b})};return n.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,p);else for(let g of nb(d.path))u(d,p,!0,g)}),a}function nb(n){let a=n.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=nb(o.join("/")),p=[];return p.push(...d.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...d),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function jT(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:LT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var AT=/^:[\w-]+$/,DT=3,MT=2,RT=1,OT=10,BT=-2,ry=n=>n==="*";function IT(n,a){let i=n.split("/"),o=i.length;return i.some(ry)&&(o+=BT),a&&(o+=MT),i.filter(r=>!ry(r)).reduce((r,u)=>r+(AT.test(u)?DT:u===""?RT:OT),o)}function LT(n,a){return n.length===a.length&&n.slice(0,-1).every((o,r)=>o===a[r])?n[n.length-1]-a[a.length-1]:0}function UT(n,a,i=!1){let{routesMeta:o}=n,r={},u="/",d=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,y=u==="/"?a:a.slice(u.length)||"/",v=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),b=m.route;if(!v&&g&&i&&!o[o.length-1].route.index&&(v=dl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),d.push({params:r,pathname:Kn([u,v.pathname]),pathnameBase:GT(Kn([u,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(u=Kn([u,v.pathnameBase]))}return d}function dl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,o]=zT(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:y,isOptional:v},b)=>{if(y==="*"){let k=p[b]||"";d=u.slice(0,u.length-k.length).replace(/(.)\/+$/,"$1")}const S=p[b];return v&&!S?g[y]=void 0:g[y]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:n}}function zT(n,a=!1,i=!0){jn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,y)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function ab(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return jn(!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 ba(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=n.charAt(i);return o&&o!=="/"?null:n.slice(i)||"/"}var VT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function HT(n,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof n=="string"?Gi(n):n,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=cy(i.substring(1),"/"):u=cy(i,a)):u=a,{pathname:u,search:$T(o),hash:FT(r)}}function cy(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function Xd(n,a,i,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function PT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function nh(n){let a=PT(n);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function xc(n,a,i,o=!1){let r;typeof n=="string"?r=Gi(n):(r={...n},at(!r.pathname||!r.pathname.includes("?"),Xd("?","pathname","search",r)),at(!r.pathname||!r.pathname.includes("#"),Xd("#","pathname","hash",r)),at(!r.search||!r.search.includes("#"),Xd("#","search","hash",r)));let u=n===""||r.pathname==="",d=u?"/":r.pathname,p;if(d==null)p=i;else{let v=a.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),v-=1;r.pathname=b.join("/")}p=v>=0?a[v]:"/"}let m=HT(r,p),g=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Kn=n=>n.join("/").replace(/\/\/+/g,"/"),GT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),$T=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,FT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,qT=class{constructor(n,a,i,o=!1){this.status=n,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function KT(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 sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ib(n,a){let i=n;if(typeof i!="string"||!VT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(sb)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=ba(d.pathname,a);d.origin===u.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{jn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ob=["POST","PUT","PATCH","DELETE"];new Set(ob);var ZT=["GET",...ob];new Set(ZT);var $i=x.createContext(null);$i.displayName="DataRouter";var _c=x.createContext(null);_c.displayName="DataRouterState";var XT=x.createContext(!1),lb=x.createContext({isTransitioning:!1});lb.displayName="ViewTransition";var QT=x.createContext(new Map);QT.displayName="Fetchers";var WT=x.createContext(null);WT.displayName="Await";var hn=x.createContext(null);hn.displayName="Navigation";var bl=x.createContext(null);bl.displayName="Location";var An=x.createContext({outlet:null,matches:[],isDataRoute:!1});An.displayName="Route";var ah=x.createContext(null);ah.displayName="RouteError";var rb="REACT_ROUTER_ERROR",JT="REDIRECT",ek="ROUTE_ERROR_RESPONSE";function tk(n){if(n.startsWith(`${rb}:${JT}:{`))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 nk(n){if(n.startsWith(`${rb}:${ek}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new qT(a.status,a.statusText,a.data)}catch{}}function ak(n,{relative:a}={}){at(Os(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=x.useContext(hn),{hash:r,pathname:u,search:d}=xl(n,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Kn([i,u])),o.createHref({pathname:p,search:d,hash:r})}function Os(){return x.useContext(bl)!=null}function Nt(){return at(Os(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(bl).location}function St(n){at(Os(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Nt();return x.useMemo(()=>dl(n,ab(a)),[a,n])}var cb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ub(n){x.useContext(hn).static||x.useLayoutEffect(n)}function Sc(){let{isDataRoute:n}=x.useContext(An);return n?yk():sk()}function sk(){at(Os(),"useNavigate() may be used only in the context of a <Router> component.");let n=x.useContext($i),{basename:a,navigator:i}=x.useContext(hn),{matches:o}=x.useContext(An),{pathname:r}=Nt(),u=JSON.stringify(nh(o)),d=x.useRef(!1);return ub(()=>{d.current=!0}),x.useCallback((m,g={})=>{if(jn(d.current,cb),!d.current)return;if(typeof m=="number"){i.go(m);return}let y=xc(m,JSON.parse(u),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Kn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,u,r,n])}var ik=x.createContext(null);function ok(n){let a=x.useContext(An).outlet;return x.useMemo(()=>a&&x.createElement(ik.Provider,{value:n},a),[a,n])}function as(){let{matches:n}=x.useContext(An),a=n[n.length-1];return a?a.params:{}}function xl(n,{relative:a}={}){let{matches:i}=x.useContext(An),{pathname:o}=Nt(),r=JSON.stringify(nh(i));return x.useMemo(()=>xc(n,JSON.parse(r),o,a==="path"),[n,r,o,a])}function lk(n,a){return db(n,a)}function db(n,a,i){var N;at(Os(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=x.useContext(hn),{matches:r}=x.useContext(An),u=r[r.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let E=g&&g.path||"";hb(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Nt(),v;if(a){let E=typeof a=="string"?Gi(a):a;at(m==="/"||((N=E.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),v=E}else v=y;let b=v.pathname||"/",S=b;if(m!=="/"){let E=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=eb(n,{pathname:S});jn(g||k!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),jn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=fk(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Kn([m,o.encodeLocation?o.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Kn([m,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),r,i);return a&&C?x.createElement(bl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},C):C}function rk(){let n=vk(),a=KT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),i?x.createElement("pre",{style:r},i):null,d)}var ck=x.createElement(rk,null),fb=class extends x.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=nk(n.digest);i&&(n=i)}let a=n!==void 0?x.createElement(An.Provider,{value:this.props.routeContext},x.createElement(ah.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?x.createElement(uk,{error:n},a):a}};fb.contextType=XT;var Qd=new WeakMap;function uk({children:n,error:a}){let{basename:i}=x.useContext(hn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=tk(a.digest);if(o){let r=Qd.get(a);if(r)throw r;let u=ib(o.location,i);if(sb&&!Qd.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Qd.set(a,d),d}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function dk({routeContext:n,match:a,children:i}){let o=x.useContext($i);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),x.createElement(An.Provider,{value:n},i)}function fk(n,a=[],i){let o=i==null?void 0:i.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let r=n,u=o==null?void 0:o.errors;if(u!=null){let y=r.findIndex(v=>v.route.id&&(u==null?void 0:u[v.route.id])!==void 0);at(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let d=!1,p=-1;if(i&&o){d=o.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:b,errors:S}=o,k=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!S||S[v.route.id]===void 0);if(v.route.lazy||k){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(y,v)=>{var b,S;m(y,{location:o.location,params:((S=(b=o.matches)==null?void 0:b[0])==null?void 0:S.params)??{},unstable_pattern:YT(o.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,b)=>{let S,k=!1,C=null,N=null;o&&(S=u&&v.route.id?u[v.route.id]:void 0,C=v.route.errorElement||ck,d&&(p<0&&b===0?(hb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):p===b&&(k=!0,N=v.route.hydrateFallbackElement||null)));let E=a.concat(r.slice(0,b+1)),w=()=>{let M;return S?M=C:k?M=N:v.route.Component?M=x.createElement(v.route.Component,null):v.route.element?M=v.route.element:M=y,x.createElement(dk,{match:v,routeContext:{outlet:y,matches:E,isDataRoute:o!=null},children:M})};return o&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?x.createElement(fb,{location:o.location,revalidation:o.revalidation,component:C,error:S,children:w(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:g}):w()},null)}function sh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hk(n){let a=x.useContext($i);return at(a,sh(n)),a}function pk(n){let a=x.useContext(_c);return at(a,sh(n)),a}function mk(n){let a=x.useContext(An);return at(a,sh(n)),a}function ih(n){let a=mk(n),i=a.matches[a.matches.length-1];return at(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function gk(){return ih("useRouteId")}function vk(){var o;let n=x.useContext(ah),a=pk("useRouteError"),i=ih("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[i]}function yk(){let{router:n}=hk("useNavigate"),a=ih("useNavigate"),i=x.useRef(!1);return ub(()=>{i.current=!0}),x.useCallback(async(r,u={})=>{jn(i.current,cb),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...u}))},[n,a])}var uy={};function hb(n,a,i){!a&&!uy[n]&&(uy[n]=!0,jn(!1,i))}x.memo(bk);function bk({routes:n,future:a,state:i,isStatic:o,onError:r}){return db(n,void 0,{state:i,isStatic:o,onError:r})}function Gn({to:n,replace:a,state:i,relative:o}){at(Os(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=x.useContext(hn);jn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=x.useContext(An),{pathname:d}=Nt(),p=Sc(),m=xc(n,nh(u),d,o==="path"),g=JSON.stringify(m);return x.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function Bs(n){return ok(n.context)}function ke(n){at(!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 xk({basename:n="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){at(!Os(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[p,r,u,d]);typeof i=="string"&&(i=Gi(i));let{pathname:g="/",search:y="",hash:v="",state:b=null,key:S="default",unstable_mask:k}=i,C=x.useMemo(()=>{let N=ba(g,p);return N==null?null:{location:{pathname:N,search:y,hash:v,state:b,key:S,unstable_mask:k},navigationType:o}},[p,g,y,v,b,S,o,k]);return jn(C!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:x.createElement(hn.Provider,{value:m},x.createElement(bl.Provider,{children:a,value:C}))}function _k({children:n,location:a}){return lk(kf(n),a)}function kf(n,a=[]){let i=[];return x.Children.forEach(n,(o,r)=>{if(!x.isValidElement(o))return;let u=[...a,r];if(o.type===x.Fragment){i.push.apply(i,kf(o.props.children,u));return}at(o.type===ke,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),at(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=kf(o.props.children,u)),i.push(d)}),i}var ec="get",tc="application/x-www-form-urlencoded";function Tc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function Sk(n){return Tc(n)&&n.tagName.toLowerCase()==="button"}function Tk(n){return Tc(n)&&n.tagName.toLowerCase()==="form"}function kk(n){return Tc(n)&&n.tagName.toLowerCase()==="input"}function Ck(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Ek(n,a){return n.button===0&&(!a||a==="_self")&&!Ck(n)}function Cf(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let o=n[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function Nk(n,a){let i=Cf(n);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var Gr=null;function wk(){if(Gr===null)try{new FormData(document.createElement("form"),0),Gr=!1}catch{Gr=!0}return Gr}var jk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wd(n){return n!=null&&!jk.has(n)?(jn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tc}"`),null):n}function Ak(n,a){let i,o,r,u,d;if(Tk(n)){let p=n.getAttribute("action");o=p?ba(p,a):null,i=n.getAttribute("method")||ec,r=Wd(n.getAttribute("enctype"))||tc,u=new FormData(n)}else if(Sk(n)||kk(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(o=m?ba(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||ec,r=Wd(n.getAttribute("formenctype"))||Wd(p.getAttribute("enctype"))||tc,u=new FormData(p,n),!wk()){let{name:g,type:y,value:v}=n;if(y==="image"){let b=g?`${g}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else g&&u.append(g,v)}}else{if(Tc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=ec,o=null,r=tc,d=n}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oh(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Dk(n,a,i,o){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&ba(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function Mk(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rk(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 Ok(n,a,i){let o=await Promise.all(n.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await Mk(u,i);return d.links?d.links():[]}return[]}));return Uk(o.flat(1).filter(Rk).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function dy(n,a,i,o,r,u){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var v;let y=o.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Bk(n,a,{includeHydrateFallback:i}={}){return Ik(n.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function Ik(n){return[...new Set(n)]}function Lk(n){let a={},i=Object.keys(n).sort();for(let o of i)a[o]=n[o];return a}function Uk(n,a){let i=new Set;return new Set(a),n.reduce((o,r)=>{let u=JSON.stringify(Lk(r));return i.has(u)||(i.add(u),o.push({key:u,link:r})),o},[])}function pb(){let n=x.useContext($i);return oh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function zk(){let n=x.useContext(_c);return oh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var lh=x.createContext(void 0);lh.displayName="FrameworkContext";function mb(){let n=x.useContext(lh);return oh(n,"You must render this element inside a <HydratedRouter> element"),n}function Vk(n,a){let i=x.useContext(lh),[o,r]=x.useState(!1),[u,d]=x.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,b=x.useRef(null);x.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let C=E=>{E.forEach(w=>{d(w.isIntersecting)})},N=new IntersectionObserver(C,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[n]),x.useEffect(()=>{if(o){let C=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(C)}}},[o]);let S=()=>{r(!0)},k=()=>{r(!1),d(!1)};return i?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Fo(p,S),onBlur:Fo(m,k),onMouseEnter:Fo(g,S),onMouseLeave:Fo(y,k),onTouchStart:Fo(v,S)}]:[!1,b,{}]}function Fo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function Hk({page:n,...a}){let{router:i}=pb(),o=x.useMemo(()=>eb(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?x.createElement(Gk,{page:n,matches:o,...a}):null}function Pk(n){let{manifest:a,routeModules:i}=mb(),[o,r]=x.useState([]);return x.useEffect(()=>{let u=!1;return Ok(n,a,i).then(d=>{u||r(d)}),()=>{u=!0}},[n,a,i]),o}function Gk({page:n,matches:a,...i}){let o=Nt(),{future:r,manifest:u,routeModules:d}=mb(),{basename:p}=pb(),{loaderData:m,matches:g}=zk(),y=x.useMemo(()=>dy(n,a,g,u,o,"data"),[n,a,g,u,o]),v=x.useMemo(()=>dy(n,a,g,u,o,"assets"),[n,a,g,u,o]),b=x.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let C=new Set,N=!1;if(a.forEach(w=>{var D;let M=u.routes[w.route.id];!M||!M.hasLoader||(!y.some(j=>j.route.id===w.route.id)&&w.route.id in m&&((D=d[w.route.id])!=null&&D.shouldRevalidate)||M.hasClientLoader?N=!0:C.add(w.route.id))}),C.size===0)return[];let E=Dk(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return N&&C.size>0&&E.searchParams.set("_routes",a.filter(w=>C.has(w.route.id)).map(w=>w.route.id).join(",")),[E.pathname+E.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,u,y,a,n,d]),S=x.useMemo(()=>Bk(v,u),[v,u]),k=Pk(v);return x.createElement(x.Fragment,null,b.map(C=>x.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),S.map(C=>x.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),k.map(({key:C,link:N})=>x.createElement("link",{key:C,nonce:i.nonce,...N,crossOrigin:N.crossOrigin??i.crossOrigin})))}function $k(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var Fk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Fk&&(window.__reactRouterVersion="7.13.1")}catch{}function qk({basename:n,children:a,unstable_useTransitions:i,window:o}){let r=x.useRef();r.current==null&&(r.current=kT({window:o,v5Compat:!0}));let u=r.current,[d,p]=x.useState({action:u.action,location:u.location}),m=x.useCallback(g=>{i===!1?p(g):x.startTransition(()=>p(g))},[i]);return x.useLayoutEffect(()=>u.listen(m),[u,m]),x.createElement(xk,{basename:n,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:i})}var gb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rh=x.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:S,...k},C){let{basename:N,navigator:E,unstable_useTransitions:w}=x.useContext(hn),M=typeof y=="string"&&gb.test(y),D=ib(y,N);y=D.to;let j=ak(y,{relative:r}),q=Nt(),P=null;if(p){let ne=xc(p,[],q.unstable_mask?q.unstable_mask.pathname:"/",!0);N!=="/"&&(ne.pathname=ne.pathname==="/"?N:Kn([N,ne.pathname])),P=E.createHref(ne)}let[B,Y,X]=Vk(o,k),ae=Xk(y,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:S,unstable_useTransitions:w});function te(ne){a&&a(ne),ne.defaultPrevented||ae(ne)}let Q=!(D.isExternal||u),F=x.createElement("a",{...k,...X,href:(Q?P:void 0)||D.absoluteURL||j,onClick:Q?te:a,ref:$k(C,Y),target:g,"data-discover":!M&&i==="render"?"true":void 0});return B&&!M?x.createElement(x.Fragment,null,F,x.createElement(Hk,{page:j})):F});rh.displayName="Link";var Kk=x.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:p,children:m,...g},y){let v=xl(d,{relative:g.relative}),b=Nt(),S=x.useContext(_c),{navigator:k,basename:C}=x.useContext(hn),N=S!=null&&tC(v)&&p===!0,E=k.encodeLocation?k.encodeLocation(v).pathname:v.pathname,w=b.pathname,M=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(w=w.toLowerCase(),M=M?M.toLowerCase():null,E=E.toLowerCase()),M&&C&&(M=ba(M,C)||M);const D=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let j=w===E||!r&&w.startsWith(E)&&w.charAt(D)==="/",q=M!=null&&(M===E||!r&&M.startsWith(E)&&M.charAt(E.length)==="/"),P={isActive:j,isPending:q,isTransitioning:N},B=j?a:void 0,Y;typeof o=="function"?Y=o(P):Y=[o,j?"active":null,q?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let X=typeof u=="function"?u(P):u;return x.createElement(rh,{...g,"aria-current":B,className:Y,ref:y,style:X,to:d,viewTransition:p},typeof m=="function"?m(P):m)});Kk.displayName="NavLink";var Yk=x.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:u,method:d=ec,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b,...S},k)=>{let{unstable_useTransitions:C}=x.useContext(hn),N=Jk(),E=eC(p,{relative:g}),w=d.toLowerCase()==="get"?"get":"post",M=typeof p=="string"&&gb.test(p),D=j=>{if(m&&m(j),j.defaultPrevented)return;j.preventDefault();let q=j.nativeEvent.submitter,P=(q==null?void 0:q.getAttribute("formmethod"))||d,B=()=>N(q||j.currentTarget,{fetcherKey:a,method:P,navigate:i,replace:r,state:u,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:b});C&&i!==!1?x.startTransition(()=>B()):B()};return x.createElement("form",{ref:k,method:w,action:E,onSubmit:o?m:D,...S,"data-discover":!M&&n==="render"?"true":void 0})});Yk.displayName="Form";function Zk(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vb(n){let a=x.useContext($i);return at(a,Zk(n)),a}function Xk(n,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=Sc(),v=Nt(),b=xl(n,{relative:d});return x.useCallback(S=>{if(Ek(S,a)){S.preventDefault();let k=i!==void 0?i:ul(v)===ul(b),C=()=>y(n,{replace:k,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?x.startTransition(()=>C()):C()}},[v,y,b,i,o,r,a,n,u,d,p,m,g])}function yb(n){jn(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=x.useRef(Cf(n)),i=x.useRef(!1),o=Nt(),r=x.useMemo(()=>Nk(o.search,i.current?null:a.current),[o.search]),u=Sc(),d=x.useCallback((p,m)=>{const g=Cf(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,d]}var Qk=0,Wk=()=>`__${String(++Qk)}__`;function Jk(){let{router:n}=vb("useSubmit"),{basename:a}=x.useContext(hn),i=gk(),o=n.fetch,r=n.navigate;return x.useCallback(async(u,d={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=Ak(u,a);if(d.navigate===!1){let b=d.fetcherKey||Wk();await o(b,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:v,formMethod:d.method||m,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:v,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,i])}function eC(n,{relative:a}={}){let{basename:i}=x.useContext(hn),o=x.useContext(An);at(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...xl(n||".",{relative:a})},d=Nt();if(n==null){u.search=d.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();u.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Kn([i,u.pathname])),ul(u)}function tC(n,{relative:a}={}){let i=x.useContext(lb);at(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=vb("useViewTransitionState"),r=xl(n,{relative:a});if(!i.isTransitioning)return!1;let u=ba(i.currentLocation.pathname,o)||i.currentLocation.pathname,d=ba(i.nextLocation.pathname,o)||i.nextLocation.pathname;return dl(r.pathname,d)!=null||dl(r.pathname,u)!=null}function Ht(){const n=Sc();return x.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function bb(n){return`/sessions/${encodeURIComponent(n)}`}function Li(n,a){return a?`/environments/${encodeURIComponent(a)}/workspaces/${encodeURIComponent(n)}`:`/workspaces/${encodeURIComponent(n)}`}function xa(n,a,i,o){const r=encodeURIComponent(n);let u;return i&&o?u=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(i)}/tasks/${r}`:i?u=`/workspaces/${encodeURIComponent(i)}/tasks/${r}`:u=`/tasks/${r}`,a?`${u}/${a}`:u}function nC(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 Fi(n,a,i){const o=new URLSearchParams;n&&o.set("workspace",n),a&&o.set("parent",a);const r=o.toString();if(n&&i){const u=`/environments/${encodeURIComponent(i)}/workspaces/${encodeURIComponent(n)}/tasks/new`;return a?`${u}?parent=${encodeURIComponent(a)}`:u}return r?`/tasks/new?${r}`:"/tasks/new"}function xb(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Ui="/environments",aC="/environments/new";function fl(n){return`/environments/${encodeURIComponent(n)}`}function sC(n){return`/environments/${encodeURIComponent(n)}/edit`}const nl="/settings",iC="/settings/credentials",oC="/pair",lC="/chat",kc="/",rC="/tasks",_b="/knowledge";function cC(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=x.useRef(void 0),[r,u]=x.useState(!1),d=x.useRef(a.onMessage);d.current=a.onMessage;const p=x.useRef(a.onConnect);p.current=a.onConnect;const m=x.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=x.useCallback(y=>{var v;((v=o.current)==null?void 0:v.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(y))},[]);return x.useEffect(()=>{let y,v;function b(){y=new WebSocket(i),o.current=y,y.onopen=()=>{u(!0),p.current(g)},y.onmessage=S=>{if(typeof S.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const k=xT(S.data);k&&d.current(k)},y.onclose=S=>{var k;if(u(!1),o.current=void 0,(k=m.current)==null||k.call(m),clearTimeout(v),S.code===TT){window.location.href=oC;return}v=setTimeout(b,ST)},y.onerror=()=>{y.close()}}return b(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const uC=5e3;function dC(n){const[a,i]=x.useState([]),[o,r]=x.useState({}),u=x.useCallback(b=>{switch(b.type){case"environment.added":return!0;case"environment.removed":{const S=b.payload.environmentId;return S&&(i(k=>k.filter(C=>C.id!==S)),r(k=>{const C={...k};return delete C[S],C})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const S=b.payload;if(typeof S.environmentId!="string"||typeof S.stage!="string"||typeof S.message!="string"||typeof S.progress!="number")return cl("environment.provision_progress","invalid payload"),!0;if(r(k=>({...k,[S.environmentId]:{stage:S.stage,message:S.message,progress:S.progress}})),S.stage==="ready"){const k=S.environmentId;setTimeout(()=>{r(C=>{const N={...C};return delete N[k],N})},uC)}return!0}default:return!1}},[n]),d=x.useCallback(b=>{var S;switch(b.type){case"environments":return i(qn((S=b.payload)==null?void 0:S.environments,dT,"environments","environments").map(fT)),!0;default:return!1}},[]),p=x.useCallback((b,S,k)=>{n({type:"add_environment",payload:{displayName:b,adapterType:S,adapterConfig:k||{}}})},[n]),m=x.useCallback((b,S)=>{const k={environmentId:b,...S};n({type:"update_environment",payload:k})},[n]),g=x.useCallback(b=>{n({type:"provision_environment",payload:{environmentId:b}})},[n]),y=x.useCallback(b=>{n({type:"stop_environment",payload:{environmentId:b}})},[n]),v=x.useCallback(b=>{n({type:"remove_environment",payload:{environmentId:b}})},[n]);return{environments:a,provisionStatus:o,addEnvironment:p,updateEnvironment:m,provisionEnvironment:g,stopEnvironment:y,removeEnvironment:v,handleMessage:d,handleEvent:u}}const Jd=new Set(["pending","running","idle"]),fC=new Set(["completed","failed","interrupted","hibernating","suspended"]),fy=["pending","running","idle"];function hC(n){const[a,i]=x.useState([]),[o,r]=x.useState([]),[u,d]=x.useState(0),[p,m]=x.useState(void 0),[g,y]=x.useState({}),v=x.useCallback(w=>{var M,D,j,q,P;switch(w.type){case"sessions":return i(B=>{var ae;const Y=qn((ae=w.payload)==null?void 0:ae.sessions,ny,"sessions","sessions"),X=new Map(B.map(te=>[te.id,te.status]));return Y.map(te=>{const Q=X.get(te.id);return!Q||Q===te.status?te:fC.has(Q)&&Jd.has(te.status)?{...te,status:Q}:Jd.has(Q)&&Jd.has(te.status)&&fy.indexOf(Q)>fy.indexOf(te.status)?{...te,status:Q}:te})}),!0;case"session_event":{if(!ay(w.payload))return cl("session_event","payload is not a valid SessionEvent"),!0;const B=w.payload;let Y=0;if(r(X=>{const ae=[...X,B];return ae.length>Ni?(Y=ae.length-Ni,ae.slice(-Ni)):ae}),Y>0&&d(X=>X+Y),B.eventType==="usage")try{const X=JSON.parse(B.content),ae=Number(X.input_tokens)||0,te=Number(X.output_tokens)||0,Q=Number(X.cost_usd)||0;(ae>0||te>0||Q>0)&&i(F=>F.map(ne=>ne.id===B.sessionId?{...ne,inputTokens:(ne.inputTokens??0)+ae,outputTokens:(ne.outputTokens??0)+te,costUsd:(ne.costUsd??0)+Q}:ne))}catch{}if(B.eventType==="status"){const X=_T(B.content);i(ae=>ae.some(Q=>Q.id===B.sessionId)?ae.map(Q=>Q.id===B.sessionId?{...Q,status:X}:Q):[...ae,{id:B.sessionId,environmentId:"",runtime:"",status:X,prompt:"",startedAt:B.timestamp}])}return!0}case"session_events":{const B=qn((M=w.payload)==null?void 0:M.events,ay,"session_events","events"),Y=(D=w.payload)==null?void 0:D.sessionId;if(typeof Y!="string")return cl("session_events","missing or non-string sessionId"),!0;if(B.length>0){let X=0;r(ae=>{const te=new Set;for(const ne of ae)ne.sessionId===Y&&te.add(`${ne.timestamp}|${ne.eventType}`);const Q=B.filter(ne=>!te.has(`${ne.timestamp}|${ne.eventType}`)),F=[...ae,...Q].sort((ne,I)=>ne.sessionId!==I.sessionId?0:ne.timestamp.localeCompare(I.timestamp));return F.length>Ni?(X=F.length-Ni,F.slice(-Ni)):F}),X>0&&d(ae=>ae+X)}return!0}case"spawned":{const B=(j=w.payload)==null?void 0:j.sessionId;return typeof B=="string"&&B&&m(B),n({type:"list_sessions"}),!0}case"task_sessions":{const B=(q=w.payload)==null?void 0:q.taskId;if(typeof B!="string"||!B)return!0;const Y=qn((P=w.payload)==null?void 0:P.sessions,ny,"task_sessions","sessions");return y(X=>({...X,[B]:Y})),!0}default:return!1}},[n]),b=x.useCallback((w,M,D,j)=>{n({type:"spawn",payload:{environmentId:w,prompt:M,personaId:D||"",worktreeBasePath:j||""}})},[n]),S=x.useCallback((w,M)=>{n({type:"send_input",payload:{sessionId:w,text:M}})},[n]),k=x.useCallback(w=>{n({type:"kill",payload:{sessionId:w}})},[n]),C=x.useCallback(w=>{n({type:"get_session_events",payload:{sessionId:w}})},[n]),N=x.useCallback(()=>{r([]),d(0)},[]),E=x.useCallback(w=>{n({type:"get_task_sessions",payload:{taskId:w}})},[n]);return{sessions:a,events:o,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:b,sendInput:S,kill:k,loadSessionEvents:C,clearEvents:N,loadTaskSessions:E,handleMessage:v}}function pC(n){const[a,i]=x.useState([]),[o,r]=x.useState(!1),u=x.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),d=x.useCallback(v=>{var b;switch(v.type){case"workspaces":return i(qn((b=v.payload)==null?void 0:b.workspaces,hT,"workspaces","workspaces")),!0;default:return!1}},[]),p=x.useCallback(()=>{r(!1)},[]),m=x.useCallback((v,b,S,k,C)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:b||"",repoUrl:S||"",environmentId:k||"",defaultPersonaId:C||""}})},[n]),g=x.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=x.useCallback((v,b)=>{n({type:"update_workspace",payload:{workspaceId:v,...b}})},[n]);return{workspaces:a,workspaceCreating:o,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:d,handleEvent:u,onDisconnect:p}}const mC=15e3;function gC(n){const[a,i]=x.useState([]),[o,r]=x.useState(void 0),u=x.useRef(new Map),d=x.useCallback(w=>{const M=w.payload;switch(w.type){case"task.created":{const D=typeof M.requestId=="string"?M.requestId:"";if(D){const q=u.current.get(D);q&&(clearTimeout(q.timer),u.current.delete(D),q.onSuccess())}const j=typeof M.workspaceId=="string"?M.workspaceId:"";return j&&n({type:"list_tasks",payload:{workspaceId:j}}),!0}case"task.started":{const D=typeof M.taskId=="string"?M.taskId:"",j=typeof M.sessionId=="string"?M.sessionId:"",q=typeof M.workspaceId=="string"?M.workspaceId:"";return r(P=>D&&P===D?void 0:P),j&&(n({type:"list_sessions"}),D&&i(P=>P.map(B=>B.id===D?{...B,latestSessionId:j}:B))),q?n({type:"list_tasks",payload:{workspaceId:q}}):D&&i(P=>{const B=P.find(Y=>Y.id===D);return B!=null&&B.workspaceId?n({type:"list_tasks",payload:{workspaceId:B.workspaceId}}):n({type:"list_tasks",payload:{}}),P}),!0}case"task.completed":case"task.deleted":case"task.updated":{const D=typeof M.workspaceId=="string"?M.workspaceId:"",j=typeof M.taskId=="string"?M.taskId:"";return D?n({type:"list_tasks",payload:{workspaceId:D}}):j&&i(q=>{const P=q.find(B=>B.id===j);return P!=null&&P.workspaceId?n({type:"list_tasks",payload:{workspaceId:P.workspaceId}}):n({type:"list_tasks",payload:{}}),q}),!0}default:return!1}},[n]),p=x.useCallback(w=>{var M,D,j,q;switch(w.type){case"tasks":{const P=qn((M=w.payload)==null?void 0:M.tasks,pT,"tasks","tasks"),B=typeof((D=w.payload)==null?void 0:D.workspaceId)=="string"&&w.payload.workspaceId?w.payload.workspaceId:"";return B?(i(Y=>[...Y.filter(X=>X.workspaceId!==B),...P]),!0):(i(Y=>{const X=new Set(P.map(ae=>ae.id));return[...Y.filter(ae=>!X.has(ae.id)),...P]}),!0)}case"create_task_error":{const P=typeof((j=w.payload)==null?void 0:j.requestId)=="string"?w.payload.requestId:"",B=typeof((q=w.payload)==null?void 0:q.message)=="string"?w.payload.message:"Failed to create task";if(P){const Y=u.current.get(P);Y?(clearTimeout(Y.timer),u.current.delete(P),Y.onError(B)):console.error("[useTasks] create_task_error with unknown requestId:",B)}else console.error("[useTasks] create_task_error:",B);return!0}default:return!1}},[]),m=x.useCallback(()=>{r(void 0);for(const[,w]of u.current)clearTimeout(w.timer),w.onError("Disconnected");u.current.clear()},[]),g=x.useCallback(w=>{n({type:"list_tasks",payload:{workspaceId:w}})},[n]),y=x.useCallback(()=>{n({type:"list_tasks",payload:{}})},[n]),v=x.useCallback((w,M,D,j,q,P,B,Y,X)=>{const ae={workspaceId:w,title:M,description:D||"",dependsOn:j||[],parentTaskId:q||"",defaultPersonaId:P||"",canDecompose:B||!1};if(Y||X){const te=crypto.randomUUID();ae.requestId=te;const Q=X??(()=>{}),F=setTimeout(()=>{u.current.delete(te)&&Q("Request timed out")},mC);u.current.set(te,{onSuccess:Y??(()=>{}),onError:Q,timer:F})}n({type:"create_task",payload:ae})},[n]),b=x.useCallback((w,M,D,j)=>{r(w),n({type:"start_task",payload:{taskId:w,personaId:M||"",environmentId:D||"",notes:j||""}})},[n]),S=x.useCallback(w=>{n({type:"stop_task",payload:{taskId:w}})},[n]),k=x.useCallback(w=>{n({type:"complete_task",payload:{taskId:w}})},[n]),C=x.useCallback(w=>{n({type:"resume_task",payload:{taskId:w}})},[n]),N=x.useCallback((w,M,D,j,q)=>{const P={taskId:w,title:M,description:D,dependsOn:j};q!==void 0&&(P.defaultPersonaId=q),n({type:"update_task",payload:P})},[n]),E=x.useCallback(w=>{n({type:"delete_task",payload:{taskId:w}})},[n]);return{tasks:a,taskStartingId:o,loadTasks:g,loadAllTasks:y,createTask:v,startTask:b,stopTask:S,completeTask:k,resumeTask:C,updateTask:N,deleteTask:E,handleMessage:p,handleEvent:d,onDisconnect:m}}function vC(n){const[a,i]=x.useState([]),o=x.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=x.useCallback(p=>{var m;switch(p.type){case"findings":return i(qn((m=p.payload)==null?void 0:m.findings,mT,"findings","findings")),!0;default:return!1}},[]),u=x.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),d=x.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:u,postFinding:d,handleMessage:r,handleEvent:o}}function yC(n){const[a,i]=x.useState([]),o=x.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=x.useCallback(m=>{var g;switch(m.type){case"tokens":return i(qn((g=m.payload)==null?void 0:g.tokens,gT,"tokens","tokens")),!0;default:return!1}},[]),u=x.useCallback(()=>{n({type:"list_tokens"})},[n]),d=x.useCallback((m,g,y,v,b)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:b}})},[n]),p=x.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:u,setToken:d,deleteToken:p,handleMessage:r,handleEvent:o}}function bC(n){const[a,i]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),o=x.useCallback(d=>d.type==="credential.providers_changed"?(sy(d.payload)&&i(d.payload),!0):!1,[]),r=x.useCallback(d=>{switch(d.type){case"credential_providers":return sy(d.payload)&&i(d.payload),!0;default:return!1}},[]),u=x.useCallback(d=>{n({type:"set_credential_providers",payload:d})},[n]);return{credentialProviders:a,updateCredentialProviders:u,handleMessage:r,handleEvent:o}}function xC(n,a){const[i,o]=x.useState([]),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState(!1),y=x.useCallback(S=>{var k,C,N;switch(S.type){case"codespaces_list":{const E=qn((k=S.payload)==null?void 0:k.codespaces,yT,"codespaces_list","codespaces"),w=typeof((C=S.payload)==null?void 0:C.error)=="string"?S.payload.error:"";return o(E),p(w),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const E=typeof((N=S.payload)==null?void 0:N.message)=="string"?S.payload.message:"Failed to create codespace";return u(E),!0}default:return!1}},[n]),v=x.useCallback(()=>{n({type:"list_codespaces"})},[n]),b=x.useCallback((S,k)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const C={repo:S};k&&(C.machine=k),n({type:"create_codespace",payload:C})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:v,createCodespace:b,handleMessage:y}}function _C(n){const[a,i]=x.useState([]),o=x.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=x.useCallback(m=>{var g;switch(m.type){case"personas":{const y=qn((g=m.payload)==null?void 0:g.personas,bT,"personas","personas");return i(y),!0}default:return!1}},[]),u=x.useCallback((m,g,y,v,b,S,k,C)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:b||"",maxTurns:S||0,type:k||"agent",script:C||""}})},[n]),d=x.useCallback((m,g,y,v,b,S,k,C,N)=>{const E={personaId:m};g!==void 0&&(E.name=g),y!==void 0&&(E.description=y),v!==void 0&&(E.systemPrompt=v),b!==void 0&&(E.runtime=b),S!==void 0&&(E.model=S),k!==void 0&&(E.maxTurns=k),C!==void 0&&(E.type=C),N!==void 0&&(E.script=N),n({type:"update_persona",payload:E})},[n]),p=x.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:u,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:o}}function $r(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 ef(n){return{source:n.fromId,target:n.toId,type:n.type}}const SC=new Set(["knowledge.listRecent.result","knowledge.search.result","knowledge.getNode.result","knowledge.expand.result"]);function TC(n){const[a,i]=x.useState(new Map),[o,r]=x.useState([]),[u,d]=x.useState(void 0),[p,m]=x.useState(void 0),[g,y]=x.useState(!1),[v,b]=x.useState(""),S=x.useCallback(D=>{y(!0),n({type:"knowledge.listRecent",payload:{limit:30,workspaceId:D}})},[n]),k=x.useCallback(D=>{D.trim()&&(b(D),m(void 0),d(void 0),y(!0),n({type:"knowledge.search",payload:{query:D,limit:20}}))},[n]),C=x.useCallback(()=>{b(""),S()},[S]),N=x.useCallback(D=>{m(D),n({type:"knowledge.getNode",payload:{id:D}})},[n]),E=x.useCallback(()=>{m(void 0),d(void 0)},[]),w=x.useCallback(D=>{n({type:"knowledge.expand",payload:{id:D,depth:1}})},[n]),M=x.useCallback(D=>{if(!SC.has(D.type))return!1;const j=D.payload??{};switch(D.type){case"knowledge.listRecent.result":{if(j.error)return y(!1),!0;const q=j.nodes??[],P=j.edges??[],B=new Map,Y=[];for(const X of q)B.set(X.id,$r(X));for(const X of P)Y.push(ef(X));for(const X of Y){const ae=B.get(X.source);ae&&(ae.val+=1);const te=B.get(X.target);te&&(te.val+=1)}return i(B),r(Y),y(!1),!0}case"knowledge.search.result":{if(j.error)return y(!1),!0;const q=j.results??[],P=new Map,B=[];for(const Y of q){const X=Y.node,ae=Y.edges??[];P.set(X.id,$r(X,ae.length));for(const te of ae)B.push(ef(te))}return i(P),r(B),y(!1),!0}case"knowledge.getNode.result":{if(j.error)return d(void 0),!0;const q=j.node,P=j.edges??[];return d({node:$r(q,P.length),edges:P.map(B=>({fromId:B.fromId,toId:B.toId,type:B.type,metadata:B.metadata}))}),!0}case"knowledge.expand.result":{const q=j.nodes??[],P=j.edges??[];return i(B=>{const Y=new Map(B);for(const X of q)Y.has(X.id)||Y.set(X.id,$r(X));return Y}),r(B=>{const Y=new Set(B.map(ae=>`${ae.source}:${ae.target}:${ae.type}`)),X=[];for(const ae of P){const te=ef(ae),Q=`${te.source}:${te.target}:${te.type}`;Y.has(Q)||X.push(te)}return[...B,...X]}),!0}}return!1},[]);return{graphData:{nodes:[...a.values()],links:o},selectedNode:u,selectedId:p,loading:g,searchQuery:v,search:k,clearSearch:C,selectNode:N,clearSelection:E,expandNode:w,loadRecent:S,handleMessage:M}}function kC(n){const[a,i]=x.useState(""),[o,r]=x.useState(void 0),[u,d]=x.useState({}),{connected:p,send:m}=cC(n,{onMessage:Y,onConnect:X,onDisconnect:ae}),g=dC(m),y=hC(m),v=pC(m),b=gC(m),S=vC(m),k=yC(m),C=bC(m),N=xC(m,p),E=_C(m),w=TC(m),M="default_persona_id",D="onboarding_completed",j=x.useCallback(Q=>{i(Q),m({type:"set_setting",payload:{key:M,value:Q}})},[m]),q=x.useCallback(()=>{r(!0),m({type:"set_setting",payload:{key:D,value:"true"}})},[m]),P=x.useCallback((Q,F)=>{m({type:"get_usage",payload:{scope:Q,id:F}})},[m]);function B(Q){const F=Q.payload.key,ne=Q.payload.value;if(Q.type==="setting.changed"){F===M&&i(ne??""),F===D&&r(ne==="true");return}g.handleEvent(Q)||v.handleEvent(Q)||b.handleEvent(Q)||S.handleEvent(Q)||k.handleEvent(Q)||C.handleEvent(Q)||E.handleEvent(Q)}function Y(Q){var F,ne,I,H,oe;if(uT(Q)){B(Q);return}if(Q.type==="usage_stats"){const G=((F=Q.payload)==null?void 0:F.scope)||"",O=((ne=Q.payload)==null?void 0:ne.id)||"";if(G&&O){const ie=`${G}:${O}`;d(be=>{var re,Fe,vt,fe;return{...be,[ie]:{inputTokens:Number((re=Q.payload)==null?void 0:re.inputTokens)||0,outputTokens:Number((Fe=Q.payload)==null?void 0:Fe.outputTokens)||0,costUsd:Number((vt=Q.payload)==null?void 0:vt.costUsd)||0,sessionCount:Number((fe=Q.payload)==null?void 0:fe.sessionCount)||0}}})}return}if(Q.type==="setting"){const G=(I=Q.payload)==null?void 0:I.key,O=(H=Q.payload)==null?void 0:H.value;G===M&&i(O??""),G===D&&r(O==="true");return}if(!g.handleMessage(Q)&&!y.handleMessage(Q)&&!v.handleMessage(Q)&&!b.handleMessage(Q)&&!S.handleMessage(Q)&&!k.handleMessage(Q)&&!C.handleMessage(Q)&&!N.handleMessage(Q)&&!E.handleMessage(Q)&&!w.handleMessage(Q)&&Q.type==="error"){console.error("[ws]",(oe=Q.payload)==null?void 0:oe.message);return}}function X(Q){Q({type:"list_environments"}),Q({type:"list_sessions"}),Q({type:"list_workspaces"}),Q({type:"list_tokens"}),Q({type:"get_credential_providers"}),Q({type:"list_personas"}),Q({type:"get_setting",payload:{key:M}}),Q({type:"get_setting",payload:{key:D}}),Q({type:"list_tasks",payload:{}}),Q({type:"subscribe_all"})}function ae(){v.onDisconnect(),b.onDisconnect()}const te=x.useCallback(()=>{m({type:"list_environments"}),m({type:"list_sessions"}),m({type:"list_workspaces"}),m({type:"list_tokens"})},[m]);return{connected:p,send:m,environments:g.environments,sessions:y.sessions,events:y.events,eventsDropped:y.eventsDropped,lastSpawnedId:y.lastSpawnedId,workspaces:v.workspaces,tasks:b.tasks,findings:S.findings,tokens:k.tokens,spawn:y.spawn,sendInput:y.sendInput,kill:y.kill,refresh:te,loadSessionEvents:y.loadSessionEvents,clearEvents:y.clearEvents,createWorkspace:v.createWorkspace,archiveWorkspace:v.archiveWorkspace,updateWorkspace:v.updateWorkspace,loadTasks:b.loadTasks,loadAllTasks:b.loadAllTasks,createTask:b.createTask,startTask:b.startTask,stopTask:b.stopTask,completeTask:b.completeTask,resumeTask:b.resumeTask,updateTask:b.updateTask,deleteTask:b.deleteTask,loadFindings:S.loadFindings,postFinding:S.postFinding,addEnvironment:g.addEnvironment,updateEnvironment:g.updateEnvironment,loadTokens:k.loadTokens,setToken:k.setToken,deleteToken:k.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:g.provisionStatus,provisionEnvironment:g.provisionEnvironment,stopEnvironment:g.stopEnvironment,removeEnvironment:g.removeEnvironment,codespaces:N.codespaces,codespaceError:N.codespaceError,codespaceListError:N.codespaceListError,codespaceCreating:N.codespaceCreating,listCodespaces:N.listCodespaces,createCodespace:N.createCodespace,workspaceCreating:v.workspaceCreating,taskStartingId:b.taskStartingId,personas:E.personas,createPersona:E.createPersona,updatePersona:E.updatePersona,deletePersona:E.deletePersona,taskSessions:y.taskSessions,loadTaskSessions:y.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:j,onboardingCompleted:o,completeOnboarding:q,usageCache:u,loadUsage:P,knowledge:w}}const ch=x.createContext(void 0);function CC({children:n}){const a=kC();return c.jsx(ch.Provider,{value:a,children:n})}function Xe(){const n=x.useContext(ch);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const EC=[{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}],NC=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",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:"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:"failed",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}],wC=[{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"}],jC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],AC=[{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:""}],hy=[{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"}],DC=[{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:""}],MC=[{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\` });`}],RC={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Et(n){return new Date(Date.now()+n).toISOString()}const py=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Et(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Et(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:Et(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:Et(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Et(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Et(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Et(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:Et(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:Et(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Et(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:Et(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Et(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Et(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Et(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Et(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:Et(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:Et(3500),content:"failed"}}]}],my=400;function OC({children:n}){const[a,i]=x.useState(EC),[o,r]=x.useState(NC),[u,d]=x.useState(wC),[p,m]=x.useState(void 0),[g,y]=x.useState(jC),[v,b]=x.useState(AC),[S,k]=x.useState(hy),[C,N]=x.useState(DC),[E,w]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[M,D]=x.useState(MC),[j]=x.useState(RC),[q,P]=x.useState(""),B=x.useRef(0),Y=x.useRef(0),X=x.useRef(new Set),ae=x.useRef(new Map),te=x.useRef(v);te.current=v;const Q=x.useRef(new Map),F=x.useRef(new Map),ne=x.useCallback(J=>(B.current+=1,`mock-${J}-${String(B.current).padStart(3,"0")}`),[]),I=x.useCallback(()=>{const J=py[Y.current%py.length];return Y.current+=1,J},[]),H=x.useCallback((J,le,ce)=>{const _e=setTimeout(()=>{var xe;X.current.delete(_e),ce&&((xe=ae.current.get(ce))==null||xe.delete(_e)),J()},le);X.current.add(_e),ce&&(ae.current.has(ce)||ae.current.set(ce,new Set),ae.current.get(ce).add(_e))},[]),oe=x.useCallback(J=>{const le=ae.current.get(J);le&&(le.forEach(ce=>{clearTimeout(ce),X.current.delete(ce)}),ae.current.delete(J))},[]),G=x.useCallback((J,le)=>{r(ce=>ce.map(_e=>_e.id===J?{..._e,status:le}:_e))},[]),O=x.useCallback(J=>{d(le=>[...le,J])},[]),ie=x.useCallback((J,le,ce)=>{le.forEach((_e,xe)=>{H(()=>{const Qe={sessionId:J,..._e.event,timestamp:new Date().toISOString()};O(Qe),_e.event.eventType==="status"&&G(J,_e.event.content),xe===le.length-1&&ce&&ce()},_e.delayMs,J)})},[H,O,G]),be=x.useCallback((J,le,ce,_e)=>{console.log("[MockGrackle] spawn",{environmentId:J,prompt:le,runtime:_e});const xe=ne("sess"),Qe={id:xe,environmentId:J,runtime:_e||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(ht=>[...ht,Qe]),m(xe);const Ee=I();if(console.log(`[MockGrackle] Playing scenario: ${Ee.label}`),Ee.pauseForInput){const ht=Ee.pauseAfterStep??Ee.steps.length-1,Ne=Ee.steps.slice(0,ht+1),lt=Ne.length>0?Ne[Ne.length-1].delayMs:0;ie(xe,Ne),H(()=>{G(xe,"idle"),O({sessionId:xe,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},lt+my,xe),Ee.resumeSteps&&Q.current.set(xe,Ee.resumeSteps)}else ie(xe,Ee.steps)},[ne,I,ie,H,G,O]),re=x.useCallback(J=>{console.log("[MockGrackle] kill",J),oe(J),Q.current.delete(J),G(J,"interrupted"),O({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),b(le=>le.map(ce=>ce.latestSessionId===J&&ce.status==="working"?{...ce,status:"not_started"}:ce))},[oe,G,O]),Fe=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),vt=x.useCallback(J=>{console.log("[MockGrackle] loadSessionEvents",J)},[]),fe=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),At=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] createWorkspace",{name:J,description:le});const Qe={id:ne("proj"),name:J,description:le||"",repoUrl:ce||"",environmentId:_e||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:xe||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(Ee=>[...Ee,Qe])},[ne]),pn=x.useCallback(J=>{console.log("[MockGrackle] archiveWorkspace",J),y(le=>le.map(ce=>ce.id===J?{...ce,status:"archived"}:ce))},[]),Dn=x.useCallback(J=>{console.log("[MockGrackle] loadTasks",J)},[]),In=x.useCallback((J,le,ce,_e,xe,Qe,Ee,ht,Ne)=>{console.log("[MockGrackle] createTask",{workspaceId:J,title:le,parentTaskId:xe}),b(lt=>{const Pt=lt.filter(mn=>mn.workspaceId===J).reduce((mn,ka)=>Math.max(mn,ka.sortOrder),0),en=xe?lt.find(mn=>mn.id===xe):void 0;if(xe&&!en)return console.warn("[MockGrackle] Parent task not found:",xe),lt;if(en&&!en.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",xe),lt;const Ut=en?en.depth+1:0,Ta={id:ne("task"),workspaceId:J,title:le,description:ce||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:_e||[],reviewNotes:void 0,sortOrder:Pt+1,createdAt:new Date().toISOString(),parentTaskId:xe||"",depth:Ut,childTaskIds:[],canDecompose:Ee??!xe,defaultPersonaId:Qe||""};return[...lt,Ta]}),ht&&ht()},[ne]),Se=x.useCallback((J,le,ce,_e)=>{var lt;console.log("[MockGrackle] startTask",{taskId:J});const xe=te.current.find(qe=>qe.id===J),Qe=(xe==null?void 0:xe.title)??"",Ee=ne("sess"),ht={id:Ee,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Qe||J,startedAt:new Date().toISOString()};r(qe=>[...qe,ht]),b(qe=>qe.map(Pt=>Pt.id===J?{...Pt,status:"working",latestSessionId:Ee,branch:`mock/${J.slice(0,8)}`}:Pt));const Ne=I();if(console.log(`[MockGrackle] Playing task scenario: ${Ne.label}`),Ne.pauseForInput){const qe=Ne.pauseAfterStep??Ne.steps.length-1,Pt=Ne.steps.slice(0,qe+1),en=Pt.length>0?Pt[Pt.length-1].delayMs:0;if(ie(Ee,Pt),H(()=>{G(Ee,"idle"),O({sessionId:Ee,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},en+my,Ee),Ne.resumeSteps){const Ut=[...Ne.resumeSteps];Q.current.set(Ee,Ut);const Ta=Ut.reduce((mn,ka)=>Math.max(mn,ka.delayMs),0);F.current.set(Ee,{taskId:J,delayAfterResume:Ta+200})}}else{const qe=Ne.steps.length>0?Ne.steps[Ne.steps.length-1].delayMs:0;ie(Ee,Ne.steps);const Pt=(lt=Ne.steps[Ne.steps.length-1])==null?void 0:lt.event.content;H(()=>{Pt==="completed"?b(en=>en.map(Ut=>Ut.id===J&&Ut.status==="working"?{...Ut,status:"paused"}:Ut)):Pt==="failed"&&b(en=>en.map(Ut=>Ut.id===J&&Ut.status==="working"?{...Ut,status:"failed"}:Ut))},qe+100,Ee)}},[ne,I,ie,H,G,O]),ft=x.useCallback((J,le)=>{console.log("[MockGrackle] sendInput",{sessionId:J,text:le}),O({sessionId:J,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),G(J,"running"),O({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const ce=Q.current.get(J);if(ce)Q.current.delete(J),ie(J,ce);else{const xe=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ie(J,xe)}const _e=F.current.get(J);_e&&(F.current.delete(J),H(()=>{b(xe=>xe.map(Qe=>Qe.id===_e.taskId&&Qe.status==="working"?{...Qe,status:"paused"}:Qe))},_e.delayAfterResume,J))},[O,G,ie,H]),Ls=x.useCallback(J=>{console.log("[MockGrackle] completeTask",J),b(le=>le.map(ce=>ce.id===J?{...ce,status:"complete"}:ce))},[]),Ln=x.useCallback(J=>{console.log("[MockGrackle] resumeTask",J)},[]),Us=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] updateTask",{taskId:J,title:le}),b(Qe=>Qe.map(Ee=>Ee.id===J?{...Ee,title:le.trim()||Ee.title,description:ce,dependsOn:_e,...xe!==void 0?{defaultPersonaId:xe}:{}}:Ee))},[]),zs=x.useCallback(J=>{console.log("[MockGrackle] deleteTask",J),b(le=>le.filter(ce=>ce.id!==J))},[]),Cl=x.useCallback(J=>{console.log("[MockGrackle] loadFindings",J),k(hy.filter(le=>le.workspaceId===J))},[]),Qi=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] postFinding",{workspaceId:J,title:le});const Qe={id:ne("find"),workspaceId:J,taskId:"",sessionId:"",category:_e||"general",title:le,content:ce,tags:xe||[],createdAt:new Date().toISOString()};k(Ee=>[...Ee,Qe])},[ne]),Vs=x.useCallback((J,le,ce)=>{console.log("[MockGrackle] addEnvironment",{displayName:J,adapterType:le,adapterConfig:ce})},[]),Hs=x.useCallback((J,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:J,...le}),i(ce=>ce.map(_e=>_e.id!==J?_e:{..._e,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),Ps=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),El=x.useCallback((J,le,ce,_e,xe)=>{console.log("[MockGrackle] setToken",{name:J,tokenType:ce}),N(Qe=>[...Qe.filter(ht=>ht.name!==J),{name:J,tokenType:ce,envVar:_e,filePath:xe,expiresAt:""}])},[]),Nl=x.useCallback(J=>{console.log("[MockGrackle] deleteToken",J),N(le=>le.filter(ce=>ce.name!==J))},[]),Lt=x.useCallback(J=>{console.log("[MockGrackle] updateCredentialProviders",J),w(J)},[]);x.useEffect(()=>()=>{X.current.forEach(clearTimeout),X.current.clear()},[]);const Oc=x.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:v,findings:S,tokens:C,credentialProviders:E,spawn:be,sendInput:ft,kill:re,refresh:Fe,loadSessionEvents:vt,clearEvents:fe,createWorkspace:At,archiveWorkspace:pn,updateWorkspace:(J,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:J,...le}),y(ce=>ce.map(_e=>_e.id!==J?_e:{..._e,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Dn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:In,startTask:Se,stopTask:J=>{console.log("[MockGrackle] stopTask",{taskId:J}),Ls(J)},completeTask:Ls,resumeTask:Ln,updateTask:Us,deleteTask:zs,loadFindings:Cl,postFinding:Qi,addEnvironment:Vs,updateEnvironment:Hs,loadTokens:Ps,setToken:El,deleteToken:Nl,updateCredentialProviders:Lt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:M,createPersona:(J,le,ce,_e,xe,Qe,Ee,ht)=>{console.log("[MockGrackle] createPersona",{name:J});const Ne={id:`mock-persona-${Date.now()}`,name:J,description:le,systemPrompt:ce,toolConfig:"{}",runtime:_e??"claude-code",model:xe||"",maxTurns:Qe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ee||"agent",script:ht||""};D(lt=>[...lt,Ne])},updatePersona:(J,le,ce,_e,xe,Qe,Ee,ht,Ne)=>{console.log("[MockGrackle] updatePersona",{personaId:J,name:le}),D(lt=>lt.map(qe=>qe.id!==J?qe:{...qe,...le!==void 0?{name:le}:{},...ce!==void 0?{description:ce}:{},..._e!==void 0?{systemPrompt:_e}:{},...xe!==void 0?{runtime:xe}:{},...Qe!==void 0?{model:Qe}:{},...Ee!==void 0?{maxTurns:Ee}:{},...ht!==void 0?{type:ht}:{},...Ne!==void 0?{script:Ne}:{},updatedAt:new Date().toISOString()}))},deletePersona:J=>{console.log("[MockGrackle] deletePersona",J),D(le=>le.filter(ce=>ce.id!==J))},taskSessions:j,loadTaskSessions:J=>{console.log("[MockGrackle] loadTaskSessions",J)},appDefaultPersonaId:q,setAppDefaultPersonaId:J=>{console.log("[MockGrackle] setAppDefaultPersonaId",J),P(J)},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:(J,le)=>{console.log(`[MockGrackle] loadUsage(${J}, ${le})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,v,S,C,E,M,j,q,be,ft,re,Fe,vt,fe,At,pn,Dn,In,Se,Ls,Ln,Us,zs,Cl,Qi,Vs,Hs,Ps,El,Nl,Lt]);return c.jsx(ch.Provider,{value:Oc,children:n})}const Sb=x.createContext(void 0),BC=4e3;function IC({children:n}){const[a,i]=x.useState([]),o=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=x.useCallback((d,p="info",m=BC)=>{const g=`toast-${++o.current}`;i(y=>[...y,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Sb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:n})}function qi(){const n=x.useContext(Sb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const Cc=[{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"]}],Tb=new Set(Cc.map(n=>n.id)),gy="grackle";function Ef(n){return Cc.find(a=>a.id===n)}const Nf="grackle-theme",kb="grackle-prefer-system",Cb="(prefers-color-scheme: dark)";let Xo=[],nc;function tf(){nc=void 0;for(const n of Xo)n()}function wf(){return typeof window>"u"?!1:window.matchMedia(Cb).matches}function al(){if(typeof localStorage>"u")return gy;try{const n=localStorage.getItem(Nf);if(n!==null&&Tb.has(n))return n}catch{}return gy}function rc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(kb)==="true"}catch{return!1}}function jf(n){return Cc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function Eb(n,a){const i=Ef(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=jf(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return n}function Ai(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Eb(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ai(al(),rc());function LC(){return nc===void 0&&(nc={themeId:al(),systemDark:wf(),preferSystem:rc()}),nc}function UC(n){return Xo=[...Xo,n],()=>{Xo=Xo.filter(a=>a!==n)}}function zC(){const n=x.useSyncExternalStore(UC,LC),{themeId:a,preferSystem:i}=n,o=Eb(a,i),r=x.useCallback(d=>{if(Tb.has(d)){try{localStorage.setItem(Nf,d)}catch{}Ai(d,rc(),!0),tf()}},[]),u=x.useCallback(d=>{try{localStorage.setItem(kb,d?"true":"false")}catch{}if(d){const p=al(),m=Ef(p);if(m!=null&&m.hidden){const g=jf(p);if(g)try{localStorage.setItem(Nf,g.id)}catch{}}}Ai(al(),d,!0),tf()},[]);return x.useEffect(()=>{Ai(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(Cb),p=()=>{const m=al(),g=rc();if(g){const y=Ef(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ai(m,g),y!=null&&y.hidden){const v=jf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ai(m,g)}}tf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Nb=x.createContext(void 0);function VC({children:n}){const a=zC();return c.jsx(Nb.Provider,{value:a,children:n})}function wb(){const n=x.useContext(Nb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const HC="_container_1mq5u_1",PC="_hamburger_1mq5u_33",GC="_brand_1mq5u_49",$C="_brandLogo_1mq5u_68",FC="_info_1mq5u_75",qC="_connectionLabel_1mq5u_90",KC="_connectionDot_1mq5u_103",YC="_connected_1mq5u_106",ZC="_disconnected_1mq5u_110",ma={container:HC,hamburger:PC,brand:GC,brandLogo:$C,info:FC,connectionLabel:qC,connectionDot:KC,connected:YC,disconnected:ZC};function XC({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=Xe(),u=Ht(),d=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ma.container,children:[n&&c.jsx("button",{type:"button",className:ma.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ma.brand,onClick:()=>u(kc),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ma.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ma.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ma.connectionDot} ${i?ma.connected:ma.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ma.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const QC="_nav_13gkc_1",WC="_tab_13gkc_35",JC="_tabIcon_13gkc_68",eE="_tabLabel_13gkc_79",tE="_tabActive_13gkc_84",qo={nav:QC,tab:WC,tabIcon:JC,tabLabel:eE,tabActive:tE},ks=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:kc,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:lC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:rC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Ui,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:_b,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:iC,testId:"sidebar-tab-settings"}];function nE(n){return n===kc||n==="/"?"dashboard":n.startsWith("/chat")||n.startsWith("/sessions")?"chat":n.startsWith("/workspaces")||n.startsWith("/environments")?"environments":n.startsWith(_b)?"knowledge":n.startsWith(nl)?"settings":"tasks"}function aE(){const n=Nt(),a=Ht(),i=x.useRef(null),o=nE(n.pathname),r=x.useCallback(d=>{a(d.route)},[a]),u=x.useCallback(d=>{var v,b;const p=(v=i.current)==null?void 0:v.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:ks.findIndex(S=>S.view===o);let y=g;if(d.key==="ArrowRight")d.preventDefault(),y=(g+1)%ks.length;else if(d.key==="ArrowLeft")d.preventDefault(),y=(g-1+ks.length)%ks.length;else if(d.key==="Home")d.preventDefault(),y=0;else if(d.key==="End")d.preventDefault(),y=ks.length-1;else return;a(ks[y].route),(b=p[y])==null||b.focus()},[o,a]);return c.jsx("nav",{className:qo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:ks.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${qo.tab} ${p?qo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:qo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:qo.tabLabel,children:d.label})]},d.view)})})}const jb=x.createContext(void 0),Ab=x.createContext(void 0);function sE({children:n}){const[a,i]=x.useState(void 0),o=x.useCallback(r=>{i(r)},[]);return c.jsx(Ab.Provider,{value:o,children:c.jsx(jb.Provider,{value:a,children:n})})}function Db(){return x.useContext(jb)}function iE(){const n=x.useContext(Ab);if(n===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return n}const oE="_container_pi6ii_1",lE="_content_pi6ii_66",vy={container:oE,content:lE},rE=320,Mb=220,Rb=600,Ob="grackle-sidebar-width";function cE(){try{const n=localStorage.getItem(Ob);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=Mb&&a<=Rb)return a}}catch{}return rE}function uE(n){try{localStorage.setItem(Ob,String(n))}catch{}}function dE(){const[n]=x.useState(cE),a=x.useRef(null),i=Db();if(x.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Mb&&m<=Rb&&uE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:vy.container,ref:a,"data-testid":"sidebar",style:{width:n},children:c.jsx("div",{className:vy.content,children:i})})}function Ec(n){const a=iE();x.useLayoutEffect(()=>(a(n),()=>{a(void 0)}),[n,a])}const uh=x.createContext({});function dh(n){const a=x.useRef(null);return a.current===null&&(a.current=n()),a.current}const Nc=x.createContext(null),fh=x.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class fE extends x.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function hE({children:n,isPresent:a}){const i=x.useId(),o=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(fh);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const y=document.createElement("style");return u&&(y.nonce=u),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
91
+ [data-motion-pop-id="${i}"] {
92
+ position: absolute !important;
93
+ width: ${d}px !important;
94
+ height: ${p}px !important;
95
+ top: ${m}px !important;
96
+ left: ${g}px !important;
97
+ }
98
+ `),()=>{document.head.removeChild(y)}},[a]),c.jsx(fE,{isPresent:a,childRef:o,sizeRef:r,children:x.cloneElement(n,{ref:o})})}const pE=({children:n,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=dh(mE),m=x.useId(),g=x.useCallback(v=>{p.set(v,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),y=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((v,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(n=c.jsx(hE,{isPresent:i,children:n})),c.jsx(Nc.Provider,{value:y,children:n})};function mE(){return new Map}function Bb(n=!0){const a=x.useContext(Nc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=x.useId();x.useEffect(()=>{n&&r(u)},[n]);const d=x.useCallback(()=>n&&o&&o(u),[u,o,n]);return!i&&o?[!1,d]:[!0]}const Fr=n=>n.key||"";function yy(n){const a=[];return x.Children.forEach(n,i=>{x.isValidElement(i)&&a.push(i)}),a}const hh=typeof window<"u",Ib=hh?x.useLayoutEffect:x.useEffect,Xn=({children:n,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Bb(d),g=x.useMemo(()=>yy(n),[n]),y=d&&!p?[]:g.map(Fr),v=x.useRef(!0),b=x.useRef(g),S=dh(()=>new Map),[k,C]=x.useState(g),[N,E]=x.useState(g);Ib(()=>{v.current=!1,b.current=g;for(let D=0;D<N.length;D++){const j=Fr(N[D]);y.includes(j)?S.delete(j):S.get(j)!==!0&&S.set(j,!1)}},[N,y.length,y.join("-")]);const w=[];if(g!==k){let D=[...g];for(let j=0;j<N.length;j++){const q=N[j],P=Fr(q);y.includes(P)||(D.splice(j,0,q),w.push(q))}u==="wait"&&w.length&&(D=w),E(yy(D)),C(g);return}const{forceRender:M}=x.useContext(uh);return c.jsx(c.Fragment,{children:N.map(D=>{const j=Fr(D),q=d&&!p?!1:g===N||y.includes(j),P=()=>{if(S.has(j))S.set(j,!0);else return;let B=!0;S.forEach(Y=>{Y||(B=!1)}),B&&(M==null||M(),E(b.current),d&&(m==null||m()),o&&o())};return c.jsx(pE,{isPresent:q,initial:!v.current||i?void 0:!1,custom:q?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:q?void 0:P,children:D},j)})})},dn=n=>n;let Lb=dn;const gE={useManualTiming:!1};function vE(n){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,v=!1)=>{const S=v&&o?a:i;return y&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const qr=["read","resolveKeyframes","update","preRender","render","postRender"],yE=40;function Ub(n,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=qr.reduce((E,w)=>(E[w]=vE(u),E),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:b}=d,S=()=>{const E=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(E-r.timestamp,yE),1),r.timestamp=E,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,n(S))},k=()=>{i=!0,o=!0,r.isProcessing||n(S)};return{schedule:qr.reduce((E,w)=>{const M=d[w];return E[w]=(D,j=!1,q=!1)=>(i||k(),M.schedule(D,j,q)),E},{}),cancel:E=>{for(let w=0;w<qr.length;w++)d[qr[w]].cancel(E)},state:r,steps:d}}const{schedule:st,cancel:es,state:It,steps:nf}=Ub(typeof requestAnimationFrame<"u"?requestAnimationFrame:dn,!0),zb=x.createContext({strict:!1}),by={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"]},zi={};for(const n in by)zi[n]={isEnabled:a=>by[n].some(i=>!!a[i])};function bE(n){for(const a in n)zi[a]={...zi[a],...n[a]}}const xE=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 cc(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||xE.has(n)}let Vb=n=>!cc(n);function _E(n){n&&(Vb=a=>a.startsWith("on")?!cc(a):n(a))}try{_E(require("@emotion/is-prop-valid").default)}catch{}function SE(n,a,i){const o={};for(const r in n)r==="values"&&typeof n.values=="object"||(Vb(r)||i===!0&&cc(r)||!a&&!cc(r)||n.draggable&&r.startsWith("onDrag"))&&(o[r]=n[r]);return o}function TE(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...o)=>n(...o);return new Proxy(i,{get:(o,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const wc=x.createContext({});function hl(n){return typeof n=="string"||Array.isArray(n)}function jc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const ph=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mh=["initial",...ph];function Ac(n){return jc(n.animate)||mh.some(a=>hl(n[a]))}function Hb(n){return!!(Ac(n)||n.variants)}function kE(n,a){if(Ac(n)){const{initial:i,animate:o}=n;return{initial:i===!1||hl(i)?i:void 0,animate:hl(o)?o:void 0}}return n.inherit!==!1?a:{}}function CE(n){const{initial:a,animate:i}=kE(n,x.useContext(wc));return x.useMemo(()=>({initial:a,animate:i}),[xy(a),xy(i)])}function xy(n){return Array.isArray(n)?n.join(" "):n}const EE=Symbol.for("motionComponentSymbol");function Di(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function NE(n,a,i){return x.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Di(i)&&(i.current=o))},[a])}const gh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),wE="framerAppearId",Pb="data-"+gh(wE),{schedule:vh}=Ub(queueMicrotask,!1),Gb=x.createContext({});function jE(n,a,i,o,r){var u,d;const{visualElement:p}=x.useContext(wc),m=x.useContext(zb),g=x.useContext(Nc),y=x.useContext(fh).reducedMotion,v=x.useRef(null);o=o||m.renderer,!v.current&&o&&(v.current=o(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const b=v.current,S=x.useContext(Gb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&AE(v.current,i,r,S);const k=x.useRef(!1);x.useInsertionEffect(()=>{b&&k.current&&b.update(i,g)});const C=i[Pb],N=x.useRef(!!C&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,C))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,C)));return Ib(()=>{b&&(k.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),vh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)===null||E===void 0||E.call(window,C)}),N.current=!1))}),b}function AE(n,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:$b(n.parent)),n.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Di(p),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function $b(n){if(n)return n.options.allowProjection!==!1?n.projection:$b(n.parent)}function DE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;n&&bE(n);function p(g,y){let v;const b={...x.useContext(fh),...g,layoutId:ME(g)},{isStatic:S}=b,k=CE(g),C=o(g,S);if(!S&&hh){RE();const N=OE(b);v=N.MeasureLayout,k.visualElement=jE(r,C,b,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:k,children:[v&&k.visualElement?c.jsx(v,{visualElement:k.visualElement,...b}):null,i(r,g,NE(C,k.visualElement,y),C,S,k.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[EE]=r,m}function ME({layoutId:n}){const a=x.useContext(uh).id;return a&&n!==void 0?a+"-"+n:n}function RE(n,a){x.useContext(zb).strict}function OE(n){const{drag:a,layout:i}=zi;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const BE=["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 yh(n){return typeof n!="string"||n.includes("-")?!1:!!(BE.indexOf(n)>-1||/[A-Z]/u.test(n))}function _y(n){const a=[{},{}];return n==null||n.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function bh(n,a,i,o){if(typeof a=="function"){const[r,u]=_y(o);a=a(i!==void 0?i:n.custom,r,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,u]=_y(o);a=a(i!==void 0?i:n.custom,r,u)}return a}const Af=n=>Array.isArray(n),IE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),LE=n=>Af(n)?n[n.length-1]||0:n,Vt=n=>!!(n&&n.getVelocity);function ac(n){const a=Vt(n)?n.get():n;return IE(a)?a.toValue():a}function UE({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:zE(o,r,u,n),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const Fb=n=>(a,i)=>{const o=x.useContext(wc),r=x.useContext(Nc),u=()=>UE(n,a,o,r);return i?u():dh(u)};function zE(n,a,i,o){const r={},u=o(n,{});for(const b in u)r[b]=ac(u[b]);let{initial:d,animate:p}=n;const m=Ac(n),g=Hb(n);a&&g&&!m&&n.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||d===!1;const v=y?p:d;if(v&&typeof v!="boolean"&&!jc(v)){const b=Array.isArray(v)?v:[v];for(let S=0;S<b.length;S++){const k=bh(n,b[S]);if(k){const{transitionEnd:C,transition:N,...E}=k;for(const w in E){let M=E[w];if(Array.isArray(M)){const D=y?M.length-1:0;M=M[D]}M!==null&&(r[w]=M)}for(const w in C)r[w]=C[w]}}}return r}const Ki=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Is=new Set(Ki),qb=n=>a=>typeof a=="string"&&a.startsWith(n),Kb=qb("--"),VE=qb("var(--"),xh=n=>VE(n)?HE.test(n.split("/*")[0].trim()):!1,HE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Yb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,_a=(n,a,i)=>i>a?a:i<n?n:i,Yi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},pl={...Yi,transform:n=>_a(0,1,n)},Kr={...Yi,default:1},_l=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Xa=_l("deg"),Yn=_l("%"),ve=_l("px"),PE=_l("vh"),GE=_l("vw"),Sy={...Yn,parse:n=>Yn.parse(n)/100,transform:n=>Yn.transform(n*100)},$E={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},FE={rotate:Xa,rotateX:Xa,rotateY:Xa,rotateZ:Xa,scale:Kr,scaleX:Kr,scaleY:Kr,scaleZ:Kr,skew:Xa,skewX:Xa,skewY:Xa,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:pl,originX:Sy,originY:Sy,originZ:ve},Ty={...Yi,transform:Math.round},_h={...$E,...FE,zIndex:Ty,size:ve,fillOpacity:pl,strokeOpacity:pl,numOctaves:Ty},qE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KE=Ki.length;function YE(n,a,i){let o="",r=!0;for(let u=0;u<KE;u++){const d=Ki[u],p=n[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Yb(p,_h[d]);if(!m){r=!1;const y=qE[d]||d;o+=`${y}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function Sh(n,a,i){const{style:o,vars:r,transformOrigin:u}=n;let d=!1,p=!1;for(const m in a){const g=a[m];if(Is.has(m)){d=!0;continue}else if(Kb(m)){r[m]=g;continue}else{const y=Yb(g,_h[m]);m.startsWith("origin")?(p=!0,u[m]=y):o[m]=y}}if(a.transform||(d||i?o.transform=YE(a,n.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=u;o.transformOrigin=`${m} ${g} ${y}`}}const ZE={offset:"stroke-dashoffset",array:"stroke-dasharray"},XE={offset:"strokeDashoffset",array:"strokeDasharray"};function QE(n,a,i=1,o=0,r=!0){n.pathLength=1;const u=r?ZE:XE;n[u.offset]=ve.transform(-o);const d=ve.transform(a),p=ve.transform(i);n[u.array]=`${d} ${p}`}function ky(n,a,i){return typeof n=="string"?n:ve.transform(a+i*n)}function WE(n,a,i){const o=ky(a,n.x,n.width),r=ky(i,n.y,n.height);return`${o} ${r}`}function Th(n,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(Sh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:b,style:S,dimensions:k}=n;b.transform&&(k&&(S.transform=b.transform),delete b.transform),k&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=WE(k,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),d!==void 0&&QE(b,d,p,m,!1)}const kh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Zb=()=>({...kh(),attrs:{}}),Ch=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Xb(n,{style:a,vars:i},o,r){Object.assign(n.style,a,r&&r.getProjectionStyles(o));for(const u in i)n.style.setProperty(u,i[u])}const Qb=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,o){Xb(n,a,void 0,o);for(const r in a.attrs)n.setAttribute(Qb.has(r)?r:gh(r),a.attrs[r])}const uc={};function JE(n){Object.assign(uc,n)}function Jb(n,{layout:a,layoutId:i}){return Is.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!uc[n]||n==="opacity")}function Eh(n,a,i){var o;const{style:r}=n,u={};for(const d in r)(Vt(r[d])||a.style&&Vt(a.style[d])||Jb(d,n)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ex(n,a,i){const o=Eh(n,a,i);for(const r in n)if(Vt(n[r])||Vt(a[r])){const u=Ki.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=n[r]}return o}function eN(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 Cy=["x","y","width","height","cx","cy","r"],tN={useVisualState:Fb({scrapeMotionValuesFromProps:ex,createRenderState:Zb,onUpdate:({props:n,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!n.drag;if(!u){for(const p in r)if(Is.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Cy.length;p++){const m=Cy[p];n[m]!==a[m]&&(d=!0)}d&&st.read(()=>{eN(i,o),st.render(()=>{Th(o,r,Ch(i.tagName),n.transformTemplate),Wb(i,o)})})}})},nN={useVisualState:Fb({scrapeMotionValuesFromProps:Eh,createRenderState:kh})};function tx(n,a,i){for(const o in a)!Vt(a[o])&&!Jb(o,i)&&(n[o]=a[o])}function aN({transformTemplate:n},a){return x.useMemo(()=>{const i=kh();return Sh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function sN(n,a){const i=n.style||{},o={};return tx(o,i,n),Object.assign(o,aN(n,a)),o}function iN(n,a){const i={},o=sN(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=o,i}function oN(n,a,i,o){const r=x.useMemo(()=>{const u=Zb();return Th(u,a,Ch(o),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};tx(u,n.style,n),r.style={...u,...r.style}}return r}function lN(n=!1){return(i,o,r,{latestValues:u},d)=>{const m=(yh(i)?oN:iN)(o,u,d,i),g=SE(o,typeof i=="string",n),y=i!==x.Fragment?{...g,...m,ref:r}:{},{children:v}=o,b=x.useMemo(()=>Vt(v)?v.get():v,[v]);return x.createElement(i,{...y,children:b})}}function rN(n,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...yh(o)?tN:nN,preloadedFeatures:n,useRender:lN(r),createVisualElement:a,Component:o};return DE(d)}}function nx(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let o=0;o<i;o++)if(a[o]!==n[o])return!1;return!0}function Dc(n,a,i){const o=n.getProps();return bh(o,a,i!==void 0?i:o.custom,n)}function Nh(n,a){return n?n[a]||n.default||n:void 0}const ax=new Set(["width","height","top","left","right","bottom",...Ki]);let sc;function cN(){sc=void 0}const Zn={now:()=>(sc===void 0&&Zn.set(It.isProcessing||gE.useManualTiming?It.timestamp:performance.now()),sc),set:n=>{sc=n,queueMicrotask(cN)}};function wh(n,a){n.indexOf(a)===-1&&n.push(a)}function jh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class Ah{constructor(){this.subscriptions=[]}add(a){return wh(this.subscriptions,a),()=>jh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function sx(n,a){return a?n*(1e3/a):0}const Ey=30,uN=n=>!isNaN(parseFloat(n));class dN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Zn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Zn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=uN(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 Ah);const o=this.events[a].add(i);return a==="change"?()=>{o(),st.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Zn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ey)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ey);return sx(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 ml(n,a){return new dN(n,a)}function fN(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,ml(i))}function hN(n,a){const i=Dc(n,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=LE(u[d]);fN(n,d,p)}}function pN(n){return!!(Vt(n)&&n.add)}function Df(n,a){const i=n.getValue("willChange");if(pN(i))return i.add(a)}function ix(n){return n.props[Pb]}function Dh(n){let a;return()=>(a===void 0&&(a=n()),a)}const mN=Dh(()=>window.ScrollTimeline!==void 0);class gN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(mN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].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 vN extends gN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const va=n=>n*1e3,ya=n=>n/1e3;function Mh(n){return typeof n=="function"}function Ny(n,a){n.timeline=a,n.onfinish=null}const Rh=n=>Array.isArray(n)&&typeof n[0]=="number",yN={linearEasing:void 0};function bN(n,a){const i=Dh(n);return()=>{var o;return(o=yN[a])!==null&&o!==void 0?o:i()}}const dc=bN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vi=(n,a,i)=>{const o=a-n;return o===0?1:(i-n)/o},ox=(n,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=n(Vi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function lx(n){return!!(typeof n=="function"&&dc()||!n||typeof n=="string"&&(n in Mf||dc())||Rh(n)||Array.isArray(n)&&n.every(lx))}const Qo=([n,a,i,o])=>`cubic-bezier(${n}, ${a}, ${i}, ${o})`,Mf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function rx(n,a){if(n)return typeof n=="function"&&dc()?ox(n,a):Rh(n)?Qo(n):Array.isArray(n)?n.map(i=>rx(i,a)||Mf.easeOut):Mf[n]}const cx=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,xN=1e-7,_N=12;function SN(n,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=cx(d,o,r)-n,u>0?i=d:a=d;while(Math.abs(u)>xN&&++p<_N);return d}function Sl(n,a,i,o){if(n===a&&i===o)return dn;const r=u=>SN(u,0,1,n,i);return u=>u===0||u===1?u:cx(r(u),a,o)}const ux=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,dx=n=>a=>1-n(1-a),fx=Sl(.33,1.53,.69,.99),Oh=dx(fx),hx=ux(Oh),px=n=>(n*=2)<1?.5*Oh(n):.5*(2-Math.pow(2,-10*(n-1))),Bh=n=>1-Math.sin(Math.acos(n)),mx=dx(Bh),gx=ux(Bh),vx=n=>/^0[^.\s]+$/u.test(n);function TN(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||vx(n):!0}const sl=n=>Math.round(n*1e5)/1e5,Ih=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kN(n){return n==null}const CN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Lh=(n,a)=>i=>!!(typeof i=="string"&&CN.test(i)&&i.startsWith(n)||a&&!kN(i)&&Object.prototype.hasOwnProperty.call(i,a)),yx=(n,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Ih);return{[n]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},EN=n=>_a(0,255,n),af={...Yi,transform:n=>Math.round(EN(n))},Ds={test:Lh("rgb","red"),parse:yx("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:o=1})=>"rgba("+af.transform(n)+", "+af.transform(a)+", "+af.transform(i)+", "+sl(pl.transform(o))+")"};function NN(n){let a="",i="",o="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),o=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),o=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Rf={test:Lh("#"),parse:NN,transform:Ds.transform},Mi={test:Lh("hsl","hue"),parse:yx("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(n)+", "+Yn.transform(sl(a))+", "+Yn.transform(sl(i))+", "+sl(pl.transform(o))+")"},zt={test:n=>Ds.test(n)||Rf.test(n)||Mi.test(n),parse:n=>Ds.test(n)?Ds.parse(n):Mi.test(n)?Mi.parse(n):Rf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Ds.transform(n):Mi.transform(n)},wN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jN(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Ih))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(wN))===null||i===void 0?void 0:i.length)||0)>0}const bx="number",xx="color",AN="var",DN="var(",wy="${}",MN=/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 gl(n){const a=n.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(MN,m=>(zt.test(m)?(o.color.push(u),r.push(xx),i.push(zt.parse(m))):m.startsWith(DN)?(o.var.push(u),r.push(AN),i.push(m)):(o.number.push(u),r.push(bx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function _x(n){return gl(n).values}function Sx(n){const{split:a,types:i}=gl(n),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===bx?u+=sl(r[d]):p===xx?u+=zt.transform(r[d]):u+=r[d]}return u}}const RN=n=>typeof n=="number"?0:n;function ON(n){const a=_x(n);return Sx(n)(a.map(RN))}const ts={test:jN,parse:_x,createTransformer:Sx,getAnimatableNone:ON},BN=new Set(["brightness","contrast","saturate","opacity"]);function IN(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=i.match(Ih)||[];if(!o)return n;const r=i.replace(o,"");let u=BN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const LN=/\b([a-z-]*)\(.*?\)/gu,Of={...ts,getAnimatableNone:n=>{const a=n.match(LN);return a?a.map(IN).join(" "):n}},UN={..._h,color:zt,backgroundColor:zt,outlineColor:zt,fill:zt,stroke:zt,borderColor:zt,borderTopColor:zt,borderRightColor:zt,borderBottomColor:zt,borderLeftColor:zt,filter:Of,WebkitFilter:Of},Uh=n=>UN[n];function Tx(n,a){let i=Uh(n);return i!==Of&&(i=ts),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const zN=new Set(["auto","none","0"]);function VN(n,a,i){let o=0,r;for(;o<n.length&&!r;){const u=n[o];typeof u=="string"&&!zN.has(u)&&gl(u).values.length&&(r=n[o]),o++}if(r&&i)for(const u of a)n[u]=Tx(i,r)}const jy=n=>n===Yi||n===ve,Ay=(n,a)=>parseFloat(n.split(", ")[a]),Dy=(n,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Ay(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Ay(u[1],n):0}},HN=new Set(["x","y","z"]),PN=Ki.filter(n=>!HN.has(n));function GN(n){const a=[];return PN.forEach(i=>{const o=n.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Hi={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:Dy(4,13),y:Dy(5,14)};Hi.translateX=Hi.x;Hi.translateY=Hi.y;const Ms=new Set;let Bf=!1,If=!1;function kx(){if(If){const n=Array.from(Ms).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=GN(o);r.length&&(i.set(o,r),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}If=!1,Bf=!1,Ms.forEach(n=>n.complete()),Ms.clear()}function Cx(){Ms.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(If=!0)})}function $N(){Cx(),kx()}class zh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ms.add(this),Bf||(Bf=!0,st.read(Cx),st.resolveKeyframes(kx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ms.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ms.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ex=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),FN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qN(n){const a=FN.exec(n);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Nx(n,a,i=1){const[o,r]=qN(n);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return Ex(d)?parseFloat(d):d}return xh(r)?Nx(r,a,i+1):r}const wx=n=>a=>a.test(n),KN={test:n=>n==="auto",parse:n=>n},jx=[Yi,ve,Yn,Xa,GE,PE,KN],My=n=>jx.find(wx(n));class Ax extends zh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),xh(g))){const y=Nx(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!ax.has(o)||a.length!==2)return;const[r,u]=a,d=My(r),p=My(u);if(d!==p)if(jy(d)&&jy(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)TN(a[r])&&o.push(r);o.length&&VN(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=Hi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Ry=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(ts.test(n)||n==="0")&&!n.startsWith("url("));function YN(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 ZN(n,a,i,o){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],d=Ry(r,a),p=Ry(u,a);return!d||!p?!1:YN(n)||(i==="spring"||Mh(i))&&o}const XN=n=>n!==null;function Mc(n,{repeat:a,repeatType:i="loop"},o){const r=n.filter(XN),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const QN=40;class Dx{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Zn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>QN?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&$N(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Zn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!ZN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Mc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Lf=2e4;function Mx(n){let a=0;const i=50;let o=n.next(a);for(;!o.done&&a<Lf;)a+=i,o=n.next(a);return a>=Lf?1/0:a}const rt=(n,a,i)=>n+(a-n)*i;function sf(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 WN({hue:n,saturation:a,lightness:i,alpha:o}){n/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=sf(m,p,n+1/3),u=sf(m,p,n),d=sf(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function fc(n,a){return i=>i>0?a:n}const of=(n,a,i)=>{const o=n*n,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},JN=[Rf,Ds,Mi],ew=n=>JN.find(a=>a.test(n));function Oy(n){const a=ew(n);if(!a)return!1;let i=a.parse(n);return a===Mi&&(i=WN(i)),i}const By=(n,a)=>{const i=Oy(n),o=Oy(a);if(!i||!o)return fc(n,a);const r={...i};return u=>(r.red=of(i.red,o.red,u),r.green=of(i.green,o.green,u),r.blue=of(i.blue,o.blue,u),r.alpha=rt(i.alpha,o.alpha,u),Ds.transform(r))},tw=(n,a)=>i=>a(n(i)),Tl=(...n)=>n.reduce(tw),Uf=new Set(["none","hidden"]);function nw(n,a){return Uf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function aw(n,a){return i=>rt(n,a,i)}function Vh(n){return typeof n=="number"?aw:typeof n=="string"?xh(n)?fc:zt.test(n)?By:ow:Array.isArray(n)?Rx:typeof n=="object"?zt.test(n)?By:sw:fc}function Rx(n,a){const i=[...n],o=i.length,r=n.map((u,d)=>Vh(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function sw(n,a){const i={...n,...a},o={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(o[r]=Vh(n[r])(n[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function iw(n,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=n.indexes[d][r[d]],m=(i=n.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const ow=(n,a)=>{const i=ts.createTransformer(a),o=gl(n),r=gl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?Uf.has(n)&&!r.values.length||Uf.has(a)&&!o.values.length?nw(n,a):Tl(Rx(iw(o,r),r.values),i):fc(n,a)};function Ox(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?rt(n,a,i):Vh(n)(n,a)}const lw=5;function Bx(n,a,i){const o=Math.max(a-lw,0);return sx(i-n(o),a-o)}const dt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},lf=.001;function rw({duration:n=dt.duration,bounce:a=dt.bounce,velocity:i=dt.velocity,mass:o=dt.mass}){let r,u,d=1-a;d=_a(dt.minDamping,dt.maxDamping,d),n=_a(dt.minDuration,dt.maxDuration,ya(n)),d<1?(r=g=>{const y=g*d,v=y*n,b=y-i,S=zf(g,d),k=Math.exp(-v);return lf-b/S*k},u=g=>{const v=g*d*n,b=v*i+i,S=Math.pow(d,2)*Math.pow(g,2)*n,k=Math.exp(-v),C=zf(Math.pow(g,2),d);return(-r(g)+lf>0?-1:1)*((b-S)*k)/C}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-lf+y*v},u=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=uw(r,u,p);if(n=va(n),isNaN(m))return{stiffness:dt.stiffness,damping:dt.damping,duration:n};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:n}}}const cw=12;function uw(n,a,i){let o=i;for(let r=1;r<cw;r++)o=o-n(o)/a(o);return o}function zf(n,a){return n*Math.sqrt(1-a*a)}const dw=["duration","bounce"],fw=["stiffness","damping","mass"];function Iy(n,a){return a.some(i=>n[i]!==void 0)}function hw(n){let a={velocity:dt.velocity,stiffness:dt.stiffness,damping:dt.damping,mass:dt.mass,isResolvedFromDuration:!1,...n};if(!Iy(n,fw)&&Iy(n,dw))if(n.visualDuration){const i=n.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*_a(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:dt.mass,stiffness:r,damping:u}}else{const i=rw(n);a={...a,...i,mass:dt.mass},a.isResolvedFromDuration=!0}return a}function Ix(n=dt.visualDuration,a=dt.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:y,duration:v,velocity:b,isResolvedFromDuration:S}=hw({...i,velocity:-ya(i.velocity||0)}),k=b||0,C=g/(2*Math.sqrt(m*y)),N=d-u,E=ya(Math.sqrt(m/y)),w=Math.abs(N)<5;o||(o=w?dt.restSpeed.granular:dt.restSpeed.default),r||(r=w?dt.restDelta.granular:dt.restDelta.default);let M;if(C<1){const j=zf(E,C);M=q=>{const P=Math.exp(-C*E*q);return d-P*((k+C*E*N)/j*Math.sin(j*q)+N*Math.cos(j*q))}}else if(C===1)M=j=>d-Math.exp(-E*j)*(N+(k+E*N)*j);else{const j=E*Math.sqrt(C*C-1);M=q=>{const P=Math.exp(-C*E*q),B=Math.min(j*q,300);return d-P*((k+C*E*N)*Math.sinh(B)+j*N*Math.cosh(B))/j}}const D={calculatedDuration:S&&v||null,next:j=>{const q=M(j);if(S)p.done=j>=v;else{let P=0;C<1&&(P=j===0?va(k):Bx(M,j,q));const B=Math.abs(P)<=o,Y=Math.abs(d-q)<=r;p.done=B&&Y}return p.value=p.done?d:q,p},toString:()=>{const j=Math.min(Mx(D),Lf),q=ox(P=>D.next(j*P).value,j,30);return j+"ms "+q}};return D}function Ly({keyframes:n,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],b={done:!1,value:v},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,k=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let C=i*a;const N=v+C,E=d===void 0?N:d(N);E!==N&&(C=E-v);const w=B=>-C*Math.exp(-B/o),M=B=>E+w(B),D=B=>{const Y=w(B),X=M(B);b.done=Math.abs(Y)<=g,b.value=b.done?E:X};let j,q;const P=B=>{S(b.value)&&(j=B,q=Ix({keyframes:[b.value,k(b.value)],velocity:Bx(M,B,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:y}))};return P(0),{calculatedDuration:null,next:B=>{let Y=!1;return!q&&j===void 0&&(Y=!0,D(B),P(B)),j!==void 0&&B>=j?q.next(B-j):(!Y&&D(B),b)}}}const pw=Sl(.42,0,1,1),mw=Sl(0,0,.58,1),Lx=Sl(.42,0,.58,1),gw=n=>Array.isArray(n)&&typeof n[0]!="number",vw={linear:dn,easeIn:pw,easeInOut:Lx,easeOut:mw,circIn:Bh,circInOut:gx,circOut:mx,backIn:Oh,backInOut:hx,backOut:fx,anticipate:px},Uy=n=>{if(Rh(n)){Lb(n.length===4);const[a,i,o,r]=n;return Sl(a,i,o,r)}else if(typeof n=="string")return vw[n];return n};function yw(n,a,i){const o=[],r=i||Ox,u=n.length-1;for(let d=0;d<u;d++){let p=r(n[d],n[d+1]);if(a){const m=Array.isArray(a)?a[d]||dn:a;p=Tl(m,p)}o.push(p)}return o}function bw(n,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=n.length;if(Lb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=yw(a,o,r),m=p.length,g=y=>{if(d&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const b=Vi(n[v],n[v+1],y);return p[v](b)};return i?y=>g(_a(n[0],n[u-1],y)):g}function xw(n,a){const i=n[n.length-1];for(let o=1;o<=a;o++){const r=Vi(0,a,o);n.push(rt(i,1,r))}}function _w(n){const a=[0];return xw(a,n.length-1),a}function Sw(n,a){return n.map(i=>i*a)}function Tw(n,a){return n.map(()=>a||Lx).splice(0,n.length-1)}function hc({duration:n=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=gw(o)?o.map(Uy):Uy(o),u={done:!1,value:a[0]},d=Sw(i&&i.length===a.length?i:_w(a),n),p=bw(d,a,{ease:Array.isArray(r)?r:Tw(a,r)});return{calculatedDuration:n,next:m=>(u.value=p(m),u.done=m>=n,u)}}const kw=n=>{const a=({timestamp:i})=>n(i);return{start:()=>st.update(a,!0),stop:()=>es(a),now:()=>It.isProcessing?It.timestamp:Zn.now()}},Cw={decay:Ly,inertia:Ly,tween:hc,keyframes:hc,spring:Ix},Ew=n=>n/100;class Hh extends Dx{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||zh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Mh(i)?i:Cw[i]||hc;let m,g;p!==hc&&typeof a[0]!="number"&&(m=Tl(Ew,Ox(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=Mx(y));const{calculatedDuration:v}=y,b=v+r,S=b*(o+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:b,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=o;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:k,repeatDelay:C,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const E=this.currentTime-b*(this.speed>=0?1:-1),w=this.speed>=0?E<0:E>y;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let M=this.currentTime,D=u;if(S){const B=Math.min(this.currentTime,y)/v;let Y=Math.floor(B),X=B%1;!X&&B>=1&&(X=1),X===1&&Y--,Y=Math.min(Y,S+1),!!(Y%2)&&(k==="reverse"?(X=1-X,C&&(X-=C/v)):k==="mirror"&&(D=d)),M=_a(0,1,X)*v}const j=w?{done:!1,value:m[0]}:D.next(M);p&&(j.value=p(j.value));let{done:q}=j;!w&&g!==null&&(q=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&q);return P&&r!==void 0&&(j.value=Mc(m,this.options,r)),N&&N(j.value),P&&this.finish(),j}get duration(){const{resolved:a}=this;return a?ya(a.calculatedDuration):0}get time(){return ya(this.currentTime)}set time(a){a=va(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=ya(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=kw,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const Nw=new Set(["opacity","clipPath","filter","transform"]);function ww(n,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=rx(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:o,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const jw=Dh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),pc=10,Aw=2e4;function Dw(n){return Mh(n.type)||n.type==="spring"||!lx(n.ease)}function Mw(n,a){const i=new Hh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const r=[];let u=0;for(;!o.done&&u<Aw;)o=i.sample(u),r.push(o.value),u+=pc;return{times:void 0,keyframes:r,duration:u-pc,ease:"linear"}}const Ux={anticipate:px,backInOut:hx,circInOut:gx};function Rw(n){return n in Ux}class zy extends Dx{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Ax(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&dc()&&Rw(u)&&(u=Ux[u]),Dw(this.options)){const{onComplete:v,onUpdate:b,motionValue:S,element:k,...C}=this.options,N=Mw(a,C);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const y=ww(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(Ny(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(Mc(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ya(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ya(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=va(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return dn;const{animation:o}=i;Ny(o,a)}return dn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:b,...S}=this.options,k=new Hh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),C=va(this.time);g.setWithVelocity(k.sample(C-pc).value,k.sample(C).value,pc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return jw()&&o&&Nw.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Ow={type:"spring",stiffness:500,damping:25,restSpeed:10},Bw=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Iw={type:"keyframes",duration:.8},Lw={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Uw=(n,{keyframes:a})=>a.length>2?Iw:Is.has(n)?n.startsWith("scale")?Bw(a[1]):Ow:Lw;function zw({when:n,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const Ph=(n,a,i,o={},r,u)=>d=>{const p=Nh(o,n)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-va(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:u?void 0:r};zw(p)||(y={...y,...Uw(n,y)}),y.duration&&(y.duration=va(y.duration)),y.repeatDelay&&(y.repeatDelay=va(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!u&&a.get()!==void 0){const b=Mc(y.keyframes,p);if(b!==void 0)return st.update(()=>{y.onUpdate(b),y.onComplete()}),new vN([])}return!u&&zy.supports(y)?new zy(y):new Hh(y)};function Vw({protectedKeys:n,needsAnimating:a},i){const o=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function zx(n,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=n.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const b=n.getValue(v,(u=n.latestValues[v])!==null&&u!==void 0?u:null),S=m[v];if(S===void 0||y&&Vw(y,v))continue;const k={delay:i,...Nh(d||{},v)};let C=!1;if(window.MotionHandoffAnimation){const E=ix(n);if(E){const w=window.MotionHandoffAnimation(E,v,st);w!==null&&(k.startTime=w,C=!0)}}Df(n,v),b.start(Ph(v,b,S,n.shouldReduceMotion&&ax.has(v)?{type:!1}:k,n,C));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{st.update(()=>{p&&hN(n,p)})}),g}function Vf(n,a,i={}){var o;const r=Dc(n,a,i.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(zx(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:b}=u;return Hw(n,a,y+g,v,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,y]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>y())}else return Promise.all([d(),p(i.delay)])}function Hw(n,a,i=0,o=0,r=1,u){const d=[],p=(n.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(n.variantChildren).sort(Pw).forEach((g,y)=>{g.notify("AnimationStart",a),d.push(Vf(g,a,{...u,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function Pw(n,a){return n.sortNodePosition(a)}function Gw(n,a,i={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Vf(n,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Vf(n,a,i);else{const r=typeof a=="function"?Dc(n,a,i.custom):a;o=Promise.all(zx(n,r,i))}return o.then(()=>{n.notify("AnimationComplete",a)})}const $w=mh.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<$w;i++){const o=mh[i],r=n.props[o];(hl(r)||r===!1)&&(a[o]=r)}return a}const Fw=[...ph].reverse(),qw=ph.length;function Kw(n){return a=>Promise.all(a.map(({animation:i,options:o})=>Gw(n,i,o)))}function Yw(n){let a=Kw(n),i=Vy(),o=!0;const r=m=>(g,y)=>{var v;const b=Dc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(b){const{transition:S,transitionEnd:k,...C}=b;g={...g,...C,...k}}return g};function u(m){a=m(n)}function d(m){const{props:g}=n,y=Vx(n.parent)||{},v=[],b=new Set;let S={},k=1/0;for(let N=0;N<qw;N++){const E=Fw[N],w=i[E],M=g[E]!==void 0?g[E]:y[E],D=hl(M),j=E===m?w.isActive:null;j===!1&&(k=N);let q=M===y[E]&&M!==g[E]&&D;if(q&&o&&n.manuallyAnimateOnMount&&(q=!1),w.protectedKeys={...S},!w.isActive&&j===null||!M&&!w.prevProp||jc(M)||typeof M=="boolean")continue;const P=Zw(w.prevProp,M);let B=P||E===m&&w.isActive&&!q&&D||N>k&&D,Y=!1;const X=Array.isArray(M)?M:[M];let ae=X.reduce(r(E),{});j===!1&&(ae={});const{prevResolvedValues:te={}}=w,Q={...te,...ae},F=H=>{B=!0,b.has(H)&&(Y=!0,b.delete(H)),w.needsAnimating[H]=!0;const oe=n.getValue(H);oe&&(oe.liveStyle=!1)};for(const H in Q){const oe=ae[H],G=te[H];if(S.hasOwnProperty(H))continue;let O=!1;Af(oe)&&Af(G)?O=!nx(oe,G):O=oe!==G,O?oe!=null?F(H):b.add(H):oe!==void 0&&b.has(H)?F(H):w.protectedKeys[H]=!0}w.prevProp=M,w.prevResolvedValues=ae,w.isActive&&(S={...S,...ae}),o&&n.blockInitialAnimation&&(B=!1),B&&(!(q&&P)||Y)&&v.push(...X.map(H=>({animation:H,options:{type:E}})))}if(b.size){const N={};b.forEach(E=>{const w=n.getBaseTarget(E),M=n.getValue(E);M&&(M.liveStyle=!0),N[E]=w??null}),v.push({animation:N})}let C=!!v.length;return o&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(C=!1),o=!1,C?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const v=d(m);for(const b in i)i[b].protectedKeys={};return v}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Vy(),o=!0}}}function Zw(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!nx(a,n):!1}function Cs(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vy(){return{animate:Cs(!0),whileInView:Cs(),whileHover:Cs(),whileTap:Cs(),whileDrag:Cs(),whileFocus:Cs(),exit:Cs()}}class ss{constructor(a){this.isMounted=!1,this.node=a}update(){}}class Xw extends ss{constructor(a){super(a),a.animationState||(a.animationState=Yw(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();jc(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 Qw=0;class Ww extends ss{constructor(){super(...arguments),this.id=Qw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const Jw={animation:{Feature:Xw},exit:{Feature:Ww}},Bn={x:!1,y:!1};function Hx(){return Bn.x||Bn.y}function ej(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 Gh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function vl(n,a,i,o={passive:!0}){return n.addEventListener(a,i,o),()=>n.removeEventListener(a,i)}function kl(n){return{point:{x:n.pageX,y:n.pageY}}}const tj=n=>a=>Gh(a)&&n(a,kl(a));function il(n,a,i,o){return vl(n,a,tj(i),o)}const Hy=(n,a)=>Math.abs(n-a);function nj(n,a){const i=Hy(n.x,a.x),o=Hy(n.y,a.y);return Math.sqrt(i**2+o**2)}class Px{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=cf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=nj(v.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:k}=v,{timestamp:C}=It;this.history.push({...k,timestamp:C});const{onStart:N,onMove:E}=this.handlers;b||(N&&N(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,v)},this.handlePointerMove=(v,b)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=rf(b,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(v,b)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=cf(v.type==="pointercancel"?this.lastMoveEventInfo:rf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(v,N),k&&k(v,N)},!Gh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=kl(a),p=rf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=It;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,cf(p,this.history)),this.removeListeners=Tl(il(this.contextWindow,"pointermove",this.handlePointerMove),il(this.contextWindow,"pointerup",this.handlePointerUp),il(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),es(this.updatePoint)}}function rf(n,a){return a?{point:a(n.point)}:n}function Py(n,a){return{x:n.x-a.x,y:n.y-a.y}}function cf({point:n},a){return{point:n,delta:Py(n,Gx(a)),offset:Py(n,aj(a)),velocity:sj(a,.1)}}function aj(n){return n[0]}function Gx(n){return n[n.length-1]}function sj(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,o=null;const r=Gx(n);for(;i>=0&&(o=n[i],!(r.timestamp-o.timestamp>va(a)));)i--;if(!o)return{x:0,y:0};const u=ya(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const $x=1e-4,ij=1-$x,oj=1+$x,Fx=.01,lj=0-Fx,rj=0+Fx;function fn(n){return n.max-n.min}function cj(n,a,i){return Math.abs(n-a)<=i}function Gy(n,a,i,o=.5){n.origin=o,n.originPoint=rt(a.min,a.max,n.origin),n.scale=fn(i)/fn(a),n.translate=rt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=ij&&n.scale<=oj||isNaN(n.scale))&&(n.scale=1),(n.translate>=lj&&n.translate<=rj||isNaN(n.translate))&&(n.translate=0)}function ol(n,a,i,o){Gy(n.x,a.x,i.x,o?o.originX:void 0),Gy(n.y,a.y,i.y,o?o.originY:void 0)}function $y(n,a,i){n.min=i.min+a.min,n.max=n.min+fn(a)}function uj(n,a,i){$y(n.x,a.x,i.x),$y(n.y,a.y,i.y)}function Fy(n,a,i){n.min=a.min-i.min,n.max=n.min+fn(a)}function ll(n,a,i){Fy(n.x,a.x,i.x),Fy(n.y,a.y,i.y)}function dj(n,{min:a,max:i},o){return a!==void 0&&n<a?n=o?rt(a,n,o.min):Math.max(n,a):i!==void 0&&n>i&&(n=o?rt(i,n,o.max):Math.min(n,i)),n}function qy(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 fj(n,{top:a,left:i,bottom:o,right:r}){return{x:qy(n.x,i,r),y:qy(n.y,a,o)}}function Ky(n,a){let i=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,o]=[o,i]),{min:i,max:o}}function hj(n,a){return{x:Ky(n.x,a.x),y:Ky(n.y,a.y)}}function pj(n,a){let i=.5;const o=fn(n),r=fn(a);return r>o?i=Vi(a.min,a.max-o,n.min):o>r&&(i=Vi(n.min,n.max-r,a.min)),_a(0,1,i)}function mj(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 Hf=.35;function gj(n=Hf){return n===!1?n=0:n===!0&&(n=Hf),{x:Yy(n,"left","right"),y:Yy(n,"top","bottom")}}function Yy(n,a,i){return{min:Zy(n,a),max:Zy(n,i)}}function Zy(n,a){return typeof n=="number"?n:n[a]||0}const Xy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ri=()=>({x:Xy(),y:Xy()}),Qy=()=>({min:0,max:0}),gt=()=>({x:Qy(),y:Qy()});function wn(n){return[n("x"),n("y")]}function qx({top:n,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:n,max:o}}}function vj({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function yj(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function uf(n){return n===void 0||n===1}function Pf({scale:n,scaleX:a,scaleY:i}){return!uf(n)||!uf(a)||!uf(i)}function ws(n){return Pf(n)||Kx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Kx(n){return Wy(n.x)||Wy(n.y)}function Wy(n){return n&&n!=="0%"}function mc(n,a,i){const o=n-i,r=a*o;return i+r}function Jy(n,a,i,o,r){return r!==void 0&&(n=mc(n,r,o)),mc(n,i,o)+a}function Gf(n,a=0,i=1,o,r){n.min=Jy(n.min,a,i,o,r),n.max=Jy(n.max,a,i,o,r)}function Yx(n,{x:a,y:i}){Gf(n.x,a.translate,a.scale,a.originPoint),Gf(n.y,i.translate,i.scale,i.originPoint)}const e0=.999999999999,t0=1.0000000000001;function bj(n,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Bi(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Yx(n,d)),o&&ws(u.latestValues)&&Bi(n,u.latestValues))}a.x<t0&&a.x>e0&&(a.x=1),a.y<t0&&a.y>e0&&(a.y=1)}function Oi(n,a){n.min=n.min+a,n.max=n.max+a}function n0(n,a,i,o,r=.5){const u=rt(n.min,n.max,r);Gf(n,a,i,u,o)}function Bi(n,a){n0(n.x,a.x,a.scaleX,a.scale,a.originX),n0(n.y,a.y,a.scaleY,a.scale,a.originY)}function Zx(n,a){return qx(yj(n.getBoundingClientRect(),a))}function xj(n,a,i){const o=Zx(n,i),{scroll:r}=a;return r&&(Oi(o.x,r.offset.x),Oi(o.y,r.offset.y)),o}const Xx=({current:n})=>n?n.ownerDocument.defaultView:null,_j=new WeakMap;class Sj{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:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(kl(y).point)},u=(y,v)=>{const{drag:b,dragPropagation:S,onDragStart:k}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ej(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wn(N=>{let E=this.getAxisMotionValue(N).get()||0;if(Yn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const M=w.layout.layoutBox[N];M&&(E=fn(M)*(parseFloat(E)/100))}}this.originPoint[N]=E}),k&&st.postRender(()=>k(y,v)),Df(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(y,v)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:k,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=v;if(S&&this.currentDirection===null){this.currentDirection=Tj(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",v.point,N),this.updateAxis("y",v.point,N),this.visualElement.render(),C&&C(y,v)},p=(y,v)=>this.stop(y,v),m=()=>wn(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Px(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Xx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&st.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Yr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=dj(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Di(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=fj(r.layoutBox,i):this.constraints=!1,this.elastic=gj(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=mj(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Di(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=xj(o,r.root,this.visualElement.getTransformPagePoint());let d=hj(r.layout.layoutBox,u);if(i){const p=i(vj(d));this.hasMutatedConstraints=!!p,p&&(d=qx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=wn(y=>{if(!Yr(y,i,this.currentDirection))return;let v=m&&m[y]||{};d&&(v={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,k={type:"inertia",velocity:o?a[y]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...v};return this.startAxisValueAnimation(y,k)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Df(this.visualElement,a),o.start(Ph(a,o,0,i,this.visualElement,!1))}stopAnimation(){wn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){wn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){wn(i=>{const{drag:o}=this.getProps();if(!Yr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-rt(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Di(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};wn(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=pj({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),wn(d=>{if(!Yr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(rt(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;_j.set(this.visualElement,this);const a=this.visualElement.current,i=il(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Di(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),st.read(o);const d=vl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(wn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Hf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Yr(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function Tj(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class kj extends ss{constructor(a){super(a),this.removeGroupControls=dn,this.removeListeners=dn,this.controls=new Sj(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||dn}unmount(){this.removeGroupControls(),this.removeListeners()}}const a0=n=>(a,i)=>{n&&st.postRender(()=>n(a,i))};class Cj extends ss{constructor(){super(...arguments),this.removePointerDownListener=dn}onPointerDown(a){this.session=new Px(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Xx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:a0(a),onStart:a0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&st.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=il(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 ic={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function s0(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Ko={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ve.test(n))n=parseFloat(n);else return n;const i=s0(n,a.target.x),o=s0(n,a.target.y);return`${i}% ${o}%`}},Ej={correct:(n,{treeScale:a,projectionDelta:i})=>{const o=n,r=ts.parse(n);if(r.length>5)return o;const u=ts.createTransformer(n),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=rt(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Nj extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;JE(wj),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),ic.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||st.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),vh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function Qx(n){const[a,i]=Bb(),o=x.useContext(uh);return c.jsx(Nj,{...n,layoutGroup:o,switchLayoutGroup:x.useContext(Gb),isPresent:a,safeToRemove:i})}const wj={borderRadius:{...Ko,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ko,borderTopRightRadius:Ko,borderBottomLeftRadius:Ko,borderBottomRightRadius:Ko,boxShadow:Ej};function jj(n,a,i){const o=Vt(n)?n:ml(n);return o.start(Ph("",o,a,i)),o.animation}function Aj(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Dj=(n,a)=>n.depth-a.depth;class Mj{constructor(){this.children=[],this.isDirty=!1}add(a){wh(this.children,a),this.isDirty=!0}remove(a){jh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Dj),this.isDirty=!1,this.children.forEach(a)}}function Rj(n,a){const i=Zn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(es(o),n(u-a))};return st.read(o,!0),()=>es(o)}const Wx=["TopLeft","TopRight","BottomLeft","BottomRight"],Oj=Wx.length,i0=n=>typeof n=="string"?parseFloat(n):n,o0=n=>typeof n=="number"||ve.test(n);function Bj(n,a,i,o,r,u){r?(n.opacity=rt(0,i.opacity!==void 0?i.opacity:1,Ij(o)),n.opacityExit=rt(a.opacity!==void 0?a.opacity:1,0,Lj(o))):u&&(n.opacity=rt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Oj;d++){const p=`border${Wx[d]}Radius`;let m=l0(a,p),g=l0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||o0(m)===o0(g)?(n[p]=Math.max(rt(i0(m),i0(g),o),0),(Yn.test(g)||Yn.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=rt(a.rotate||0,i.rotate||0,o))}function l0(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const Ij=Jx(0,.5,mx),Lj=Jx(.5,.95,dn);function Jx(n,a,i){return o=>o<n?0:o>a?1:i(Vi(n,a,o))}function r0(n,a){n.min=a.min,n.max=a.max}function En(n,a){r0(n.x,a.x),r0(n.y,a.y)}function c0(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function u0(n,a,i,o,r){return n-=a,n=mc(n,1/i,o),r!==void 0&&(n=mc(n,1/r,o)),n}function Uj(n,a=0,i=1,o=.5,r,u=n,d=n){if(Yn.test(a)&&(a=parseFloat(a),a=rt(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=rt(u.min,u.max,o);n===u&&(p-=a),n.min=u0(n.min,a,i,p,r),n.max=u0(n.max,a,i,p,r)}function d0(n,a,[i,o,r],u,d){Uj(n,a[i],a[o],a[r],a.scale,u,d)}const zj=["x","scaleX","originX"],Vj=["y","scaleY","originY"];function f0(n,a,i,o){d0(n.x,a,zj,i?i.x:void 0,o?o.x:void 0),d0(n.y,a,Vj,i?i.y:void 0,o?o.y:void 0)}function h0(n){return n.translate===0&&n.scale===1}function e_(n){return h0(n.x)&&h0(n.y)}function p0(n,a){return n.min===a.min&&n.max===a.max}function Hj(n,a){return p0(n.x,a.x)&&p0(n.y,a.y)}function m0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function t_(n,a){return m0(n.x,a.x)&&m0(n.y,a.y)}function g0(n){return fn(n.x)/fn(n.y)}function v0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class Pj{constructor(){this.members=[]}add(a){wh(this.members,a),a.scheduleRender()}remove(a){if(jh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Gj(n,a,i){let o="";const r=n.x.translate/a.x,u=n.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:b,skewX:S,skewY:k}=i;g&&(o=`perspective(${g}px) ${o}`),y&&(o+=`rotate(${y}deg) `),v&&(o+=`rotateX(${v}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),k&&(o+=`skewY(${k}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const js={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Wo=typeof window<"u"&&window.MotionDebug!==void 0,df=["","X","Y","Z"],$j={visibility:"hidden"},y0=1e3;let Fj=0;function ff(n,a,i,o){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),o&&(o[n]=0))}function n_(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=ix(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",st,!(r||u))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&n_(o)}function a_({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Fj++,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,Wo&&(js.totalNodes=js.resolvedTargetDeltas=js.recalculatedProjection=0),this.nodes.forEach(Yj),this.nodes.forEach(Jj),this.nodes.forEach(eA),this.nodes.forEach(Zj),Wo&&window.MotionDebug.record(js)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Mj)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Ah),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Aj(d),this.instance=d;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const b=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=Rj(b,250),ic.hasAnimatedSinceResize&&(ic.hasAnimatedSinceResize=!1,this.nodes.forEach(x0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||y.getDefaultTransition()||iA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:E}=y.getProps(),w=!this.targetLayout||!t_(this.targetLayout,k)||S,M=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||M||b&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,M);const D={...Nh(C,"layout"),onPlay:N,onComplete:E};(y.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else b||x0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,es(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(tA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&n_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(b0);return}this.isUpdating||this.nodes.forEach(Qj),this.isUpdating=!1,this.nodes.forEach(Wj),this.nodes.forEach(qj),this.nodes.forEach(Kj),this.clearAllSnapshots();const p=Zn.now();It.delta=_a(0,1e3/60,p-It.timestamp),It.timestamp=p,It.isProcessing=!0,nf.update.process(It),nf.preRender.process(It),nf.render.process(It),It.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xj),this.sharedNodes.forEach(nA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=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:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!e_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(p||ws(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),oA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return gt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(lA))){const{scroll:y}=this.root;y&&(Oi(m.x,y.offset.x),Oi(m.y,y.offset.y))}return m}removeElementScroll(d){var p;const m=gt();if(En(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:b}=y;y!==this.root&&v&&b.layoutScroll&&(v.wasRoot&&En(m,d),Oi(m.x,v.offset.x),Oi(m.y,v.offset.y))}return m}applyTransform(d,p=!1){const m=gt();En(m,d);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Bi(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),ws(y.latestValues)&&Bi(m,y.latestValues)}return ws(this.latestValues)&&Bi(m,this.latestValues),m}removeTransform(d){const p=gt();En(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!ws(g.latestValues))continue;Pf(g.latestValues)&&g.updateSnapshot();const y=gt(),v=g.measurePageBox();En(y,v),f0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return ws(this.latestValues)&&f0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.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!==It.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:b}=this.options;if(!(!this.layout||!(v||b))){if(this.resolvedRelativeTargetAt=It.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(),ll(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),En(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(),uj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):En(this.target,this.layout.layoutBox),Yx(this.target,this.targetDelta)):En(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(),ll(this.relativeTargetOrigin,this.target,S.target),En(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Wo&&js.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Pf(this.parent.latestValues)||Kx(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 d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===It.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;En(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;bj(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=gt());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(c0(this.prevProjectionDelta.x,this.projectionDelta.x),c0(this.prevProjectionDelta.y,this.projectionDelta.y)),ol(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!v0(this.projectionDelta.x,this.prevProjectionDelta.x)||!v0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Wo&&js.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ri(),this.projectionDelta=Ri(),this.projectionDeltaWithTransform=Ri()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=Ri();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=gt(),S=m?m.source:void 0,k=this.layout?this.layout.source:void 0,C=S!==k,N=this.getStack(),E=!N||N.members.length<=1,w=!!(C&&!E&&this.options.crossfade===!0&&!this.path.some(sA));this.animationProgress=0;let M;this.mixTargetDelta=D=>{const j=D/1e3;_0(v.x,d.x,j),_0(v.y,d.y,j),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ll(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),aA(this.relativeTarget,this.relativeTargetOrigin,b,j),M&&Hj(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=gt()),En(M,this.relativeTarget)),C&&(this.animationValues=y,Bj(y,g,this.latestValues,j,w,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(es(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{ic.hasAnimatedSinceResize=!0,this.currentAnimation=jj(0,y0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.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 d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(y0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&s_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||gt();const v=fn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const b=fn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}En(p,m),Bi(p,y),ol(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new Pj),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&ff("z",d,g,this.animationValues);for(let y=0;y<df.length;y++)ff(`rotate${df[y]}`,d,g,this.animationValues),ff(`skew${df[y]}`,d,g,this.animationValues);d.render();for(const y in g)d.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $j;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ac(d==null?void 0:d.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=ac(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!ws(this.latestValues)&&(C.transform=y?y({},""):"none",this.hasProjected=!1),C}const b=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=Gj(this.projectionDeltaWithTransform,this.treeScale,b),y&&(g.transform=y(b,g.transform));const{x:S,y:k}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${k.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=v===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const C in uc){if(b[C]===void 0)continue;const{correct:N,applyTo:E}=uc[C],w=g.transform==="none"?b[C]:N(b[C],v);if(E){const M=E.length;for(let D=0;D<M;D++)g[E[D]]=w}else g[C]=w}return this.options.layoutId&&(g.pointerEvents=v===this?ac(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(b0),this.root.sharedNodes.clear()}}}function qj(n){n.updateLayout()}function Kj(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=n.layout,{animationType:u}=n.options,d=i.source!==n.layout.source;u==="size"?wn(v=>{const b=d?i.measuredBox[v]:i.layoutBox[v],S=fn(b);b.min=o[v].min,b.max=b.min+S}):s_(u,i.layoutBox,o)&&wn(v=>{const b=d?i.measuredBox[v]:i.layoutBox[v],S=fn(o[v]);b.max=b.min+S,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+S)});const p=Ri();ol(p,o,i.layoutBox);const m=Ri();d?ol(m,n.applyTransform(r,!0),i.measuredBox):ol(m,o,i.layoutBox);const g=!e_(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:S}=v;if(b&&S){const k=gt();ll(k,i.layoutBox,b.layoutBox);const C=gt();ll(C,o,S.layoutBox),t_(k,C)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=k,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function Yj(n){Wo&&js.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 Zj(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Xj(n){n.clearSnapshot()}function b0(n){n.clearMeasurements()}function Qj(n){n.isLayoutDirty=!1}function Wj(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function x0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Jj(n){n.resolveTargetDelta()}function eA(n){n.calcProjection()}function tA(n){n.resetSkewAndRotation()}function nA(n){n.removeLeadSnapshot()}function _0(n,a,i){n.translate=rt(a.translate,0,i),n.scale=rt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function S0(n,a,i,o){n.min=rt(a.min,i.min,o),n.max=rt(a.max,i.max,o)}function aA(n,a,i,o){S0(n.x,a.x,i.x,o),S0(n.y,a.y,i.y,o)}function sA(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const iA={duration:.45,ease:[.4,0,.1,1]},T0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),k0=T0("applewebkit/")&&!T0("chrome/")?Math.round:dn;function C0(n){n.min=k0(n.min),n.max=k0(n.max)}function oA(n){C0(n.x),C0(n.y)}function s_(n,a,i){return n==="position"||n==="preserve-aspect"&&!cj(g0(a),g0(i),.2)}function lA(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const rA=a_({attachResizeListener:(n,a)=>vl(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hf={current:void 0},i_=a_({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!hf.current){const n=new rA({});n.mount(window),n.setOptions({layoutScroll:!0}),hf.current=n}return hf.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),cA={pan:{Feature:Cj},drag:{Feature:kj,ProjectionNode:i_,MeasureLayout:Qx}};function uA(n,a,i){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function o_(n,a){const i=uA(n),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function E0(n){return a=>{a.pointerType==="touch"||Hx()||n(a)}}function dA(n,a,i={}){const[o,r,u]=o_(n,i),d=E0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=E0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function N0(n,a,i){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&st.postRender(()=>u(a,kl(a)))}class fA extends ss{mount(){const{current:a}=this.node;a&&(this.unmount=dA(a,i=>(N0(this.node,i,"Start"),o=>N0(this.node,o,"End"))))}unmount(){}}class hA extends ss{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=Tl(vl(this.node.current,"focus",()=>this.onFocus()),vl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const l_=(n,a)=>a?n===a?!0:l_(n,a.parentElement):!1,pA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mA(n){return pA.has(n.tagName)||n.tabIndex!==-1}const Jo=new WeakSet;function w0(n){return a=>{a.key==="Enter"&&n(a)}}function pf(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const gA=(n,a)=>{const i=n.currentTarget;if(!i)return;const o=w0(()=>{if(Jo.has(i))return;pf(i,"down");const r=w0(()=>{pf(i,"up")}),u=()=>pf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function j0(n){return Gh(n)&&!Hx()}function vA(n,a,i={}){const[o,r,u]=o_(n,i),d=p=>{const m=p.currentTarget;if(!j0(p)||Jo.has(m))return;Jo.add(m);const g=a(p),y=(S,k)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),!(!j0(S)||!Jo.has(m))&&(Jo.delete(m),typeof g=="function"&&g(S,{success:k}))},v=S=>{y(S,i.useGlobalTarget||l_(m,S.target))},b=S=>{y(S,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!mA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>gA(g,r),r)}),u}function A0(n,a,i){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&st.postRender(()=>u(a,kl(a)))}class yA extends ss{mount(){const{current:a}=this.node;a&&(this.unmount=vA(a,i=>(A0(this.node,i,"Start"),(o,{success:r})=>A0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const $f=new WeakMap,mf=new WeakMap,bA=n=>{const a=$f.get(n.target);a&&a(n)},xA=n=>{n.forEach(bA)};function _A({root:n,...a}){const i=n||document;mf.has(i)||mf.set(i,{});const o=mf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(xA,{root:n,...a})),o[r]}function SA(n,a,i){const o=_A(a);return $f.set(n,i),o.observe(n),()=>{$f.delete(n),o.unobserve(n)}}const TA={some:0,all:1};class kA extends ss{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:TA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),b=g?y:v;b&&b(m)};return SA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(CA(a,i))&&this.startObserver()}unmount(){}}function CA({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const EA={inView:{Feature:kA},tap:{Feature:yA},focus:{Feature:hA},hover:{Feature:fA}},NA={layout:{ProjectionNode:i_,MeasureLayout:Qx}},gc={current:null},$h={current:!1};function r_(){if($h.current=!0,!!hh)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>gc.current=n.matches;n.addListener(a),a()}else gc.current=!1}const wA=[...jx,zt,ts],jA=n=>wA.find(wx(n)),D0=new WeakMap;function AA(n,a,i){for(const o in a){const r=a[o],u=i[o];if(Vt(r))n.addValue(o,r);else if(Vt(u))n.addValue(o,ml(r,{owner:n}));else if(u!==r)if(n.hasValue(o)){const d=n.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=n.getStaticValue(o);n.addValue(o,ml(d!==void 0?d:r,{owner:n}))}}for(const o in i)a[o]===void 0&&n.removeValue(o);return a}const M0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class DA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zh,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=Zn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,st.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=d;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Ac(i),this.isVariantNode=Hb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const k=b[S];m[S]!==void 0&&Vt(k)&&k.set(m[S],!1)}}mount(a){this.current=a,D0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),$h.current||r_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){D0.delete(this.current),this.projection&&this.projection.unmount(),es(this.notifyUpdate),es(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Is.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&st.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),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 zi){const i=zi[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):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 o=0;o<M0.length;o++){const r=M0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=AA(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=ml(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(Ex(r)||vx(r))?r=parseFloat(r):!jA(r)&&ts.test(i)&&(r=Tx(a,i)),this.setBaseTarget(a,Vt(r)?r.get():r)),Vt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=bh(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Vt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Ah),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class c_ extends DA{constructor(){super(...arguments),this.KeyframeResolver=Ax}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Vt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function MA(n){return window.getComputedStyle(n)}class RA extends c_{constructor(){super(...arguments),this.type="html",this.renderInstance=Xb}readValueFromInstance(a,i){if(Is.has(i)){const o=Uh(i);return o&&o.default||0}else{const o=MA(a),r=(Kb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Zx(a,i)}build(a,i,o){Sh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return Eh(a,i,o)}}class OA extends c_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Is.has(i)){const o=Uh(i);return o&&o.default||0}return i=Qb.has(i)?i:gh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ex(a,i,o)}build(a,i,o){Th(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){Wb(a,i,o,r)}mount(a){this.isSVGTag=Ch(a.tagName),super.mount(a)}}const BA=(n,a)=>yh(n)?new OA(a):new RA(a,{allowProjection:n!==x.Fragment}),IA=rN({...Jw,...EA,...cA,...NA},BA),kt=TE(IA);function LA(){!$h.current&&r_();const[n]=x.useState(gc.current);return n}var Je;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT",n[n.SIGNAL=10]="SIGNAL",n[n.USAGE=11]="USAGE"})(Je||(Je={}));var Tt;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(Tt||(Tt={}));var Qa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(Qa||(Qa={}));var Wa;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(Wa||(Wa={}));var $n;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})($n||($n={}));var Ja;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(Ja||(Ja={}));const UA=8,R0="system",Yo="system";Object.assign(Object.create(null),{"":Je.UNSPECIFIED,text:Je.TEXT,tool_use:Je.TOOL_USE,tool_result:Je.TOOL_RESULT,error:Je.ERROR,status:Je.STATUS,system:Je.SYSTEM,finding:Je.FINDING,subtask_create:Je.SUBTASK_CREATE,user_input:Je.USER_INPUT,signal:Je.SIGNAL,usage:Je.USAGE});Je.UNSPECIFIED+"",Je.TEXT+"",Je.TOOL_USE+"",Je.TOOL_RESULT+"",Je.ERROR+"",Je.STATUS+"",Je.SYSTEM+"",Je.FINDING+"",Je.SUBTASK_CREATE+"",Je.USER_INPUT+"",Je.SIGNAL+"",Je.USAGE+"";Object.assign(Object.create(null),{"":Tt.UNSPECIFIED,not_started:Tt.NOT_STARTED,working:Tt.WORKING,paused:Tt.PAUSED,complete:Tt.COMPLETE,failed:Tt.FAILED,pending:Tt.NOT_STARTED,assigned:Tt.NOT_STARTED,in_progress:Tt.WORKING,waiting_input:Tt.PAUSED,review:Tt.PAUSED,done:Tt.COMPLETE});Tt.UNSPECIFIED+"",Tt.NOT_STARTED+"",Tt.WORKING+"",Tt.PAUSED+"",Tt.COMPLETE+"",Tt.FAILED+"";Object.assign(Object.create(null),{"":Qa.UNSPECIFIED,active:Qa.ACTIVE,archived:Qa.ARCHIVED});Qa.UNSPECIFIED+"",Qa.ACTIVE+"",Qa.ARCHIVED+"";Object.assign(Object.create(null),{"":Wa.UNSPECIFIED,open:Wa.OPEN,closed:Wa.CLOSED});Wa.UNSPECIFIED+"",Wa.OPEN+"",Wa.CLOSED+"";Object.assign(Object.create(null),{"":$n.UNSPECIFIED,off:$n.OFF,subscription:$n.SUBSCRIPTION,api_key:$n.API_KEY});$n.UNSPECIFIED+"",$n.OFF+"",$n.SUBSCRIPTION+"",$n.API_KEY+"";Object.assign(Object.create(null),{"":Ja.UNSPECIFIED,off:Ja.OFF,on:Ja.ON});Ja.UNSPECIFIED+"",Ja.OFF+"",Ja.ON+"";function Sa(n){return Array.isArray?Array.isArray(n):f_(n)==="[object Array]"}function zA(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function VA(n){return n==null?"":zA(n)}function Fn(n){return typeof n=="string"}function u_(n){return typeof n=="number"}function HA(n){return n===!0||n===!1||PA(n)&&f_(n)=="[object Boolean]"}function d_(n){return typeof n=="object"}function PA(n){return d_(n)&&n!==null}function un(n){return n!=null}function gf(n){return!n.trim().length}function f_(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const GA="Incorrect 'index' type",$A=n=>`Invalid value for key ${n}`,FA=n=>`Pattern length exceeds max of ${n}.`,qA=n=>`Missing ${n} property in key`,KA=n=>`Property 'weight' in key '${n}' must be a positive integer`,O0=Object.prototype.hasOwnProperty;class YA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=h_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function h_(n){let a=null,i=null,o=null,r=1,u=null;if(Fn(n)||Sa(n))o=n,a=B0(n),i=Ff(n);else{if(!O0.call(n,"name"))throw new Error(qA("name"));const d=n.name;if(o=d,O0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(KA(d));a=B0(d),i=Ff(d),u=n.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function B0(n){return Sa(n)?n:n.split(".")}function Ff(n){return Sa(n)?n.join("."):n}function ZA(n,a){let i=[],o=!1;const r=(u,d,p)=>{if(un(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!un(g))return;if(p===d.length-1&&(Fn(g)||u_(g)||HA(g)))i.push(VA(g));else if(Sa(g)){o=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],d,p+1)}else d.length&&r(g,d,p+1)}};return r(n,Fn(a)?a.split("."):a,0),o?i:i[0]}const XA={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},QA={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},WA={location:0,threshold:.6,distance:100},JA={useExtendedSearch:!1,getFn:ZA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ye={...QA,...XA,...WA,...JA};const e2=/[^ ]+/g;function t2(n=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(e2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*n),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Fh{constructor({getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){this.norm=t2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Fn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();Fn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!un(a)||gf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(un(d)){if(Sa(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(un(y))if(Fn(y)&&!gf(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else Sa(y)&&y.forEach((v,b)=>{m.push({nestedArrIndex:b,value:v})})}o.$[u]=p}else if(Fn(d)&&!gf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function p_(n,a,{getFn:i=ye.getFn,fieldNormWeight:o=ye.fieldNormWeight}={}){const r=new Fh({getFn:i,fieldNormWeight:o});return r.setKeys(n.map(h_)),r.setSources(a),r.create(),r}function n2(n,{getFn:a=ye.getFn,fieldNormWeight:i=ye.fieldNormWeight}={}){const{keys:o,records:r}=n,u=new Fh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Zr(n,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=ye.distance,ignoreLocation:u=ye.ignoreLocation}={}){const d=a/n.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function a2(n=[],a=ye.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=n.length;u<d;u+=1){let p=n[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return n[u-1]&&u-o>=a&&i.push([o,u-1]),i}const As=32;function s2(n,a,i,{location:o=ye.location,distance:r=ye.distance,threshold:u=ye.threshold,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,includeMatches:m=ye.includeMatches,ignoreLocation:g=ye.ignoreLocation}={}){if(a.length>As)throw new Error(FA(As));const y=a.length,v=n.length,b=Math.max(0,Math.min(o,v));let S=u,k=b;const C=p>1||m,N=C?Array(v):[];let E;for(;(E=n.indexOf(a,k))>-1;){let P=Zr(a,{currentLocation:E,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(P,S),k=E+y,C){let B=0;for(;B<y;)N[E+B]=1,B+=1}}k=-1;let w=[],M=1,D=y+v;const j=1<<y-1;for(let P=0;P<y;P+=1){let B=0,Y=D;for(;B<Y;)Zr(a,{errors:P,currentLocation:b+Y,expectedLocation:b,distance:r,ignoreLocation:g})<=S?B=Y:D=Y,Y=Math.floor((D-B)/2+B);D=Y;let X=Math.max(1,b-Y+1),ae=d?v:Math.min(b+Y,v)+y,te=Array(ae+2);te[ae+1]=(1<<P)-1;for(let F=ae;F>=X;F-=1){let ne=F-1,I=i[n.charAt(ne)];if(C&&(N[ne]=+!!I),te[F]=(te[F+1]<<1|1)&I,P&&(te[F]|=(w[F+1]|w[F])<<1|1|w[F+1]),te[F]&j&&(M=Zr(a,{errors:P,currentLocation:ne,expectedLocation:b,distance:r,ignoreLocation:g}),M<=S)){if(S=M,k=ne,k<=b)break;X=Math.max(1,2*b-k)}}if(Zr(a,{errors:P+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;w=te}const q={isMatch:k>=0,score:Math.max(.001,M)};if(C){const P=a2(N,p);P.length?m&&(q.indices=P):q.isMatch=!1}return q}function i2(n){let a={};for(let i=0,o=n.length;i<o;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const vc=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class m_{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:u=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?vc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(S,k)=>{this.chunks.push({pattern:S,alphabet:i2(S),startIndex:k})},b=this.pattern.length;if(b>As){let S=0;const k=b%As,C=b-k;for(;S<C;)v(this.pattern.substr(S,As),S),S+=As;if(k){const N=b-As;v(this.pattern.substr(N),N)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?vc(a):a,this.pattern===a){let C={isMatch:!0,score:0};return r&&(C.indices=[[0,a.length-1]]),C}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],b=0,S=!1;this.chunks.forEach(({pattern:C,alphabet:N,startIndex:E})=>{const{isMatch:w,score:M,indices:D}=s2(a,C,N,{location:u+E,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});w&&(S=!0),b+=M,w&&D&&(v=[...v,...D])});let k={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(k.indices=v),k}}class is{constructor(a){this.pattern=a}static isMultiMatch(a){return I0(a,this.multiRegex)}static isSingleMatch(a){return I0(a,this.singleRegex)}search(){}}function I0(n,a){const i=n.match(a);return i?i[1]:null}class o2 extends is{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class l2 extends is{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class r2 extends is{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class c2 extends is{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class u2 extends is{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class d2 extends is{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class g_ extends is{constructor(a,{location:i=ye.location,threshold:o=ye.threshold,distance:r=ye.distance,includeMatches:u=ye.includeMatches,findAllMatches:d=ye.findAllMatches,minMatchCharLength:p=ye.minMatchCharLength,isCaseSensitive:m=ye.isCaseSensitive,ignoreDiacritics:g=ye.ignoreDiacritics,ignoreLocation:y=ye.ignoreLocation}={}){super(a),this._bitapSearch=new m_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class v_ extends is{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const qf=[o2,v_,r2,c2,d2,u2,l2,g_],L0=qf.length,f2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,h2="|";function p2(n,a={}){return n.split(h2).map(i=>{let o=i.trim().split(f2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<L0;){const y=qf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<L0;){const y=qf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const m2=new Set([g_.type,v_.type]);class g2{constructor(a,{isCaseSensitive:i=ye.isCaseSensitive,ignoreDiacritics:o=ye.ignoreDiacritics,includeMatches:r=ye.includeMatches,minMatchCharLength:u=ye.minMatchCharLength,ignoreLocation:d=ye.ignoreLocation,findAllMatches:p=ye.findAllMatches,location:m=ye.location,threshold:g=ye.threshold,distance:y=ye.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=o?vc(a):a,this.pattern=a,this.query=p2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?vc(a):a;let d=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,d=0;for(let b=0,S=v.length;b<S;b+=1){const k=v[b],{isMatch:C,indices:N,score:E}=k.search(a);if(C){if(d+=1,m+=E,o){const w=k.constructor.type;m2.has(w)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let b={isMatch:!0,score:m/d};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Kf=[];function v2(...n){Kf.push(...n)}function Yf(n,a){for(let i=0,o=Kf.length;i<o;i+=1){let r=Kf[i];if(r.condition(n,a))return new r(n,a)}return new m_(n,a)}const yc={AND:"$and",OR:"$or"},Zf={PATH:"$path",PATTERN:"$val"},Xf=n=>!!(n[yc.AND]||n[yc.OR]),y2=n=>!!n[Zf.PATH],b2=n=>!Sa(n)&&d_(n)&&!Xf(n),U0=n=>({[yc.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function y_(n,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=y2(r);if(!d&&u.length>1&&!Xf(r))return o(U0(r));if(b2(r)){const m=d?r[Zf.PATH]:u[0],g=d?r[Zf.PATTERN]:r[m];if(!Fn(g))throw new Error($A(m));const y={keyId:Ff(m),pattern:g};return i&&(y.searcher=Yf(g,a)),y}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Sa(g)&&g.forEach(y=>{p.children.push(o(y))})}),p};return Xf(n)||(n=U0(n)),o(n)}function x2(n,{ignoreFieldNorm:a=ye.ignoreFieldNorm}){n.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function _2(n,a){const i=n.matches;a.matches=[],un(i)&&i.forEach(o=>{if(!un(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function S2(n,a){a.score=n.score}function T2(n,a,{includeMatches:i=ye.includeMatches,includeScore:o=ye.includeScore}={}){const r=[];return i&&r.push(_2),o&&r.push(S2),n.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Zi{constructor(a,i={},o){this.options={...ye,...i},this.options.useExtendedSearch,this._keyStore=new YA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Fh))throw new Error(GA);this._myIndex=i||p_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){un(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=Fn(a)?Fn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return x2(m,{ignoreFieldNorm:p}),u&&m.sort(d),u_(i)&&i>-1&&(m=m.slice(0,i)),T2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Yf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!un(u))return;const{isMatch:m,score:g,indices:y}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:y}]})}),r}_searchLogical(a){const i=y_(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const y=[];for(let v=0,b=p.children.length;v<b;v+=1){const S=p.children[v],k=o(S,m,g);if(k.length)y.push(...k);else if(p.operator===yc.AND)return[]}return y},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(un(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:y})=>{u[m].matches.push(...y)}))}}),d}_searchObjectList(a){const i=Yf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!un(d))return;let m=[];o.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:d[y],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!un(i))return[];let r=[];if(Sa(i))i.forEach(({v:u,i:d,n:p})=>{if(!un(u))return;const{isMatch:m,score:g,indices:y}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:y})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Zi.version="7.1.0";Zi.createIndex=p_;Zi.parseIndex=n2;Zi.config=ye;Zi.parseQuery=y_;v2(g2);function k2(n,a,i,o){if(!a.trim())return[];const r=.3;return new Zi(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Qf={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 ns(n){return n==="blocked"?Qf.blocked:Qf[qh(n)]}const C2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function E2(n){return C2[qh(n)]??"statusPending"}const N2=["working","paused","failed","not_started","blocked","complete"],z0=["not_started","working","paused","complete","failed"],w2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function qh(n){return n in Qf&&n!=="blocked"?n:w2[n]??"not_started"}const j2={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 A2(n){if(n.length===0)return[];const a=[...n].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function b_({text:n,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:n});const o=A2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:n.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:n.slice(d,p+1)},`m${d}`)),u=p+1;return u<n.length&&r.push(c.jsx("span",{children:n.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function D2(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function M2(n,a){const i=new Map;for(const u of n){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of N2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ns(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ns(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const R2="_container_z4i38_1",O2="_header_z4i38_5",B2="_headerActions_z4i38_17",I2="_searchInput_z4i38_23",L2="_searchHighlight_z4i38_56",U2="_groupToggle_z4i38_62",z2="_groupToggleActive_z4i38_89",V2="_addButton_z4i38_93",H2="_taskRow_z4i38_120",P2="_selected_z4i38_140",G2="_expandArrow_z4i38_150",$2="_expanded_z4i38_157",F2="_leafSpacer_z4i38_161",q2="_taskStatusIcon_z4i38_166",K2="_taskTitle_z4i38_170",Y2="_workspaceBadge_z4i38_177",Z2="_childCountBadge_z4i38_195",X2="_dependencyBadge_z4i38_208",Q2="_blockedBadge_z4i38_220",W2="_addChildButton_z4i38_225",J2="_emptyState_z4i38_268",eD="_statusGroupHeader_z4i38_275",tD="_statusGroupIcon_z4i38_294",nD="_statusGroupLabel_z4i38_298",aD="_statusGroupCount_z4i38_303",Oe={container:R2,header:O2,headerActions:B2,searchInput:I2,searchHighlight:L2,groupToggle:U2,groupToggleActive:z2,addButton:V2,taskRow:H2,selected:P2,expandArrow:G2,expanded:$2,leafSpacer:F2,taskStatusIcon:q2,taskTitle:K2,workspaceBadge:Y2,childCountBadge:Z2,dependencyBadge:X2,blockedBadge:Q2,addChildButton:W2,emptyState:J2,statusGroupHeader:eD,statusGroupIcon:tD,statusGroupLabel:nD,statusGroupCount:aD},sD=[{name:"title",weight:2},{name:"description",weight:1}],x_=16,iD=16,__="grackle-task-group-by-status";function V0(){try{return localStorage.getItem(__)==="true"}catch{return!1}}function oD(n){try{localStorage.setItem(__,String(n))}catch{}}function lD({group:n,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[c.jsxs("div",{className:Oe.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Oe.expandArrow} ${a?Oe.expanded:""}`,children:"▸"}),c.jsx("span",{className:Oe.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),c.jsx("span",{className:Oe.statusGroupLabel,children:n.label}),c.jsx("span",{className:Oe.statusGroupCount,children:n.tasks.length})]}),c.jsx(Xn,{children:a&&c.jsx(kt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(p=>{const m=ns(p.status),g=o===p.id,y=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(xa(p.id)),className:`${Oe.taskRow} ${g?Oe.selected:""}`,style:{"--task-indent":`${x_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Oe.taskTitle,title:p.title,children:c.jsx(b_,{text:p.title,indices:u.get(p.id),highlightClass:Oe.searchHighlight})}),y&&c.jsx("span",{className:Oe.workspaceBadge,title:y,children:y})]},p.id)})})})]})}function S_({node:n,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=ns(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(E=>d.get(E)!=="complete"),v=i.has(n.id),b=n.children.length>0,S=r===n.id,k=x_+a*iD,N=a===0&&!n.parentTaskId&&n.workspaceId?m.get(n.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(xa(n.id)),className:`${Oe.taskRow} ${S?Oe.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":n.id,children:[b&&c.jsx("span",{className:`${Oe.expandArrow} ${v?Oe.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),o(n.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),o(n.id))},children:"▸"}),!b&&c.jsx("span",{className:Oe.leafSpacer}),c.jsx("span",{className:Oe.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Oe.taskTitle,title:n.title,children:c.jsx(b_,{text:n.title,indices:p.get(n.id),highlightClass:Oe.searchHighlight})}),N&&c.jsx("span",{className:Oe.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Oe.childCountBadge,children:[n.children.filter(E=>E.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&c.jsx("span",{className:`${Oe.dependencyBadge} ${y?Oe.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<UA&&c.jsx("button",{onClick:E=>{E.stopPropagation(),u(Fi(n.workspaceId,n.id))},title:"Add child task","aria-label":"Add child task",className:Oe.addChildButton,children:"+"})]}),c.jsx(Xn,{children:b&&v&&c.jsx(kt.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(E=>c.jsx(S_,{node:E,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},E.id))})})]})}function rD(){const{workspaces:n,tasks:a}=Xe(),i=Ht(),[o,r]=x.useState(new Set),[u,d]=x.useState(new Set),[p,m]=x.useState(V0),[g,y]=x.useState(V0),[v,b]=x.useState(new Map),S=St("/tasks/:taskId/*"),k=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=x.useMemo(()=>new Map(a.map(F=>[F.id,F.status])),[a]),N=x.useMemo(()=>new Map(n.map(F=>[F.id,F.name])),[n]),E=()=>{const F=!p;oD(F),m(F),F&&(y(!0),b(new Map))},w=F=>{b(ne=>{const I=new Map(ne),H=I.has(F)?I.get(F):g;return I.set(F,!H),I})},M=F=>v.has(F)?v.get(F):g,D=F=>{r(ne=>{const I=new Set(ne);return I.has(F)?(I.delete(F),d(H=>new Set(H).add(F))):(I.add(F),d(H=>{const oe=new Set(H);return oe.delete(F),oe})),I})};x.useEffect(()=>{const F=new Set(a.filter(ne=>ne.parentTaskId).map(ne=>ne.parentTaskId));F.size>0&&r(ne=>{const I=new Set(ne);for(const H of F)u.has(H)||I.add(H);return I})},[a,u]);const[j,q]=x.useState(""),{directMatchTaskIds:P,treeMatchTaskIds:B,titleHighlights:Y}=x.useMemo(()=>{if(!j.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const F=k2(a,j,sD),ne=new Set(F.map(G=>G.item.id)),I=new Map;for(const G of F){const O=G.matches.find(ie=>ie.key==="title");O&&I.set(G.item.id,O.indices)}const H=new Set(ne),oe=new Map(a.map(G=>[G.id,G]));for(const G of[...ne]){let O=oe.get(G);for(;O!=null&&O.parentTaskId;)H.add(O.parentTaskId),O=oe.get(O.parentTaskId)}return{directMatchTaskIds:ne,treeMatchTaskIds:H,titleHighlights:I}},[j,a]),X=P!==null,ae=X?p?P:B:null,te=ae?a.filter(F=>ae.has(F.id)):a,Q=p?[]:D2(te);return c.jsxs("div",{className:Oe.container,children:[c.jsxs("div",{className:Oe.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Oe.headerActions,children:[c.jsx("button",{className:`${Oe.groupToggle} ${p?Oe.groupToggleActive:""}`,onClick:E,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Oe.addButton,onClick:()=>i(Fi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:j,onChange:F=>q(F.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Oe.searchInput,"data-testid":"sidebar-search"}),p?M2(te,C).map(F=>c.jsx(lD,{group:F,isExpanded:M(F.status),onToggle:()=>w(F.status),selectedTaskId:k,navigate:i,titleHighlights:Y,workspaceNames:N},F.status)):Q.map(F=>c.jsx(S_,{node:F,depth:0,expandedTasks:o,toggleTask:D,selectedTaskId:k,navigate:i,taskStatusById:C,titleHighlights:Y,workspaceNames:N},F.id)),te.length===0&&!X&&c.jsx("div",{className:Oe.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&X&&c.jsx("div",{className:Oe.emptyState,children:"No matching tasks"})]})}const cD="_nav_14i94_1",uD="_tab_14i94_24",dD="_tabActive_14i94_62",fD="_tabLabel_14i94_75",hD="_statusDot_14i94_81",pD="_pulse_14i94_87",mD="_addButton_14i94_99",gD="_empty_14i94_132",Za={nav:cD,tab:uD,tabActive:dD,tabLabel:fD,statusDot:hD,pulse:pD,addButton:mD,empty:gD},vD={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function yD(){const{environments:n}=Xe(),a=Ht(),i=x.useRef(null),o=St("/environments/:environmentId"),r=St("/environments/:environmentId/edit"),u=St("/environments/:environmentId/workspaces/:workspaceId"),d=St("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(fl(b))},[a]),y=x.useCallback(b=>{var E;const S=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(w=>w===document.activeElement),C=k>=0?k:n.findIndex(w=>w.id===m);let N=C;if(b.key==="ArrowDown")b.preventDefault(),N=(C+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(C-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<n.length&&a(fl(n[N].id)),S[N].focus()},[m,n,a]),v=m??(n.length>0?n[0].id:void 0);return c.jsxs("div",{className:Za.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:y,children:n.map(b=>{const S=b.id===m,k=b.id===v,C=vD[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${Za.tab} ${S?Za.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Za.statusDot} ${N?Za.pulse:""}`,style:{color:C},children:"●"}),c.jsx("span",{className:Za.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Za.addButton,onClick:()=>a(aC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),n.length===0&&c.jsx("div",{className:Za.empty,children:"No environments yet."})]})}const bD="_nav_1bhou_1",xD="_tab_1bhou_24",_D="_tabIcon_1bhou_62",SD="_tabActive_1bhou_68",Xr={nav:bD,tab:xD,tabIcon:_D,tabActive:SD},ga=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function TD(){var d;const n=Nt(),a=Ht(),i=x.useRef(null),o=((d=ga.find(p=>n.pathname===`${nl}/${p.path}`))==null?void 0:d.path)??ga[0].path,r=x.useCallback(p=>{a(`${nl}/${p}`)},[a]),u=x.useCallback(p=>{var S,k;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(C=>C===document.activeElement),y=g>=0?g:ga.findIndex(C=>C.path===o);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%ga.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+ga.length)%ga.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=ga.length-1;else return;const b=ga[v].path;a(`${nl}/${b}`),(k=m[v])==null||k.focus()},[o,a]);return c.jsx("nav",{className:Xr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:ga.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Xr.tab} ${m?Xr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Xr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const kD="_nav_1snmp_1",CD="_searchForm_1snmp_8",ED="_searchInput_1snmp_15",ND="_searchButton_1snmp_33",wD="_clearButton_1snmp_68",jD="_workspaceSelect_1snmp_85",AD="_listHeader_1snmp_99",DD="_nodeList_1snmp_108",MD="_nodeItem_1snmp_116",RD="_indicator_1snmp_129",OD="_label_1snmp_136",BD="_badge_1snmp_145",Nn={nav:kD,searchForm:CD,searchInput:ED,searchButton:ND,clearButton:wD,workspaceSelect:jD,listHeader:AD,nodeList:DD,nodeItem:MD,indicator:RD,label:OD,badge:BD};function ID(){const{knowledge:n,workspaces:a}=Xe(),[i,o]=x.useState(""),r=x.useCallback(m=>{m.preventDefault(),i.trim()&&n.search(i.trim())},[i,n]),u=x.useCallback(()=>{o(""),n.clearSearch()},[n]),d=x.useCallback(m=>{n.selectNode(m)},[n]),p=x.useCallback(m=>{o(""),n.loadRecent(m||void 0)},[n]);return c.jsxs("div",{className:Nn.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:Nn.searchForm,onSubmit:r,children:[c.jsx("input",{className:Nn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:Nn.searchButton,disabled:n.loading,children:"Go"})]}),n.searchQuery&&c.jsx("button",{type:"button",className:Nn.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:Nn.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:Nn.listHeader,children:["Nodes (",n.graphData.nodes.length,")"]}),c.jsx("ul",{className:Nn.nodeList,children:n.graphData.nodes.map(m=>c.jsxs("li",{className:Nn.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:Nn.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:Nn.label,children:m.label}),c.jsx("span",{className:Nn.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function LD(){const n=x.useMemo(()=>c.jsx(rD,{}),[]);return Ec(n),c.jsx(Bs,{})}function UD(){const n=x.useMemo(()=>c.jsx(yD,{}),[]);return Ec(n),c.jsx(Bs,{})}function zD(){const n=x.useMemo(()=>c.jsx(TD,{}),[]);return Ec(n),c.jsx(Bs,{})}function VD(){const n=x.useMemo(()=>c.jsx(ID,{}),[]);return Ec(n),c.jsx(Bs,{})}const HD="_bar_tnfsh_1",PD="_btnPrimary_tnfsh_32",GD="_statusText_tnfsh_85",$D="_statusCompleted_tnfsh_90",FD="_statusFailed_tnfsh_94",qD="_statusBlocked_tnfsh_98",KD="_hintText_tnfsh_103",ot={bar:HD,btnPrimary:PD,statusText:GD,statusCompleted:$D,statusFailed:FD,statusBlocked:qD,hintText:KD};function YD(){const{sessions:n,tasks:a,environments:i}=Xe(),o=Ht(),r=Nt(),u=St("/sessions/:sessionId"),d=St("/tasks/:taskId"),p=St("/tasks/:taskId/stream"),m=St("/tasks/:taskId/findings"),g=St("/tasks/:taskId/edit"),y=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),v=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=St("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),k=St("/sessions/new"),C=St("/environments/:environmentId/workspaces/:workspaceId"),N=St("/tasks/new"),E=St("/chat"),w=St("/"),M=St("/settings/*"),D=u==null?void 0:u.params.sessionId,j=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(y==null?void 0:y.params.taskId)??(v==null?void 0:v.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),q=y??v??b??S,P=(q==null?void 0:q.params.environmentId)??(C==null?void 0:C.params.environmentId),B=r.pathname.startsWith("/environments")&&!C&&!q,Y=!!E,X=!!k,ae=!!C&&!y&&!v&&!b&&!S,te=!!N;if(!!w&&!X&&!ae&&!te||!!M||(!!g||!!S)||te||B||X)return c.jsx(c.Fragment,{});if(Y)return i.find(H=>H.adapterType==="local"&&H.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Add a local environment to start chatting"})});if(ae)return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Select a task or click + to create one"})});if(j){const I=a.find(G=>G.id===j);if(!I)return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Loading..."})});const H=new Map(a.map(G=>[G.id,G])),oe=I.dependsOn.some(G=>{const O=H.get(G);return O!==void 0&&O.status!=="complete"});if(I.status==="not_started"){const G=oe?I.dependsOn.map(O=>H.get(O)).filter(O=>O&&O.status!=="complete").map(O=>O.title):[];return c.jsx("div",{className:ot.bar,children:oe?c.jsxs("span",{className:ot.statusBlocked,children:["Blocked by: ",G.join(", ")]}):c.jsx("span",{className:ot.hintText,children:"Use the buttons above to start or manage this task"})})}if(I.status==="working"||I.status==="paused"){const G=I.latestSessionId||void 0,O=G?n.find(be=>be.id===G):void 0;return O&&!["completed","failed","interrupted","hibernating"].includes(O.status)?c.jsx(c.Fragment,{}):c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Waiting for agent..."})})}if(I.status==="complete")return c.jsxs("div",{className:ot.bar,children:[c.jsx("span",{className:`${ot.statusText} ${ot.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Fi(I.workspaceId,void 0,P)),className:ot.btnPrimary,children:"+ New Task"})]});if(I.status==="failed")return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:`${ot.statusText} ${ot.statusFailed}`,children:"Task failed"})})}if(D){const I=n.find(G=>G.id===D),H=I!==void 0&&["completed","failed","interrupted","hibernating"].includes(I.status);if(I!==void 0&&!H)return c.jsx(c.Fragment,{});if(H)return c.jsxs("div",{className:ot.bar,children:[c.jsxs("span",{className:`${ot.statusText} ${ot.hintText}`,children:["Session ",I.status]}),c.jsx("button",{onClick:()=>o(xb(I.environmentId)),className:ot.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ot.bar,children:c.jsx("span",{className:ot.hintText,children:"Loading..."})})}const ZD="_toast_da8ll_1",XD="_success_da8ll_18",QD="_icon_da8ll_22",WD="_error_da8ll_25",JD="_warning_da8ll_32",eM="_info_da8ll_38",tM="_message_da8ll_53",nM="_close_da8ll_60",Zo={toast:ZD,success:XD,icon:QD,error:WD,warning:JD,info:eM,message:tM,close:nM},aM={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function sM({toast:n,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),c.jsxs(kt.div,{className:`${Zo.toast} ${Zo[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Zo.icon,"aria-hidden":"true",children:aM[n.variant]}),c.jsx("span",{className:Zo.message,children:n.message}),c.jsx("button",{type:"button",className:Zo.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const iM="_container_qqse2_1",oM={container:iM};function lM(){const{toasts:n,dismissToast:a}=qi();return c.jsx("div",{className:oM.container,"data-testid":"toast-container",children:c.jsx(Xn,{children:n.map(i=>c.jsx(sM,{toast:i,onDismiss:a},i.id))})})}const rM="_breadcrumbs_17or2_1",cM="_list_17or2_11",uM="_item_17or2_21",dM="_separator_17or2_28",fM="_link_17or2_34",hM="_current_17or2_57",wi={breadcrumbs:rM,list:cM,item:uM,separator:dM,link:fM,current:hM},pM="›";function Xi({segments:n}){return c.jsx("nav",{className:wi.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:wi.list,children:n.map((a,i)=>{const o=i===n.length-1;return c.jsxs("li",{className:wi.item,children:[i>0&&c.jsx("span",{className:wi.separator,"aria-hidden":"true",children:pM}),a.url&&!o?c.jsx(rh,{className:wi.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:wi.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Wf(){Wf=function(r,u){return new i(r,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),bc(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&bc(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=n.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return n[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var y=d[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof u=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return n[Symbol.replace].call(this,r,u)},Wf.apply(this,arguments)}function bc(n,a){return bc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},bc(n,a)}function H0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=n[i];return o}function vf(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(r,u){if(r){if(typeof r=="string")return H0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?H0(r,u):void 0}})(n))||a){i&&(n=i);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var mM=(function(n){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){qS(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,y,v=(function(j){for(var q,P=vf(j.properties.className);!(q=P()).done;){var B=q.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(o);if(!v&&a.defaultLanguage&&o.properties.className.push("language-"+(v=a.defaultLanguage)),o.properties.className.push("code-highlight"),v)try{var b,S;S=(b=v)!=null&&b.includes("diff-")?v.split("-")[1]:v,g=n.highlight(Hr(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(j){if(!a.ignoreMissing||!/Unknown language/.test(j.message))throw j;g=o}else g=o;g.children=(y=1,function j(q){return q.reduce(function(P,B){if(B.type==="text"){var Y=B.value,X=(Y.match(/\n/g)||"").length;if(X===0)B.position={start:{line:y,column:1},end:{line:y,column:1}},P.push(B);else for(var ae,te=Y.split(`
100
+ `),Q=vf(te.entries());!(ae=Q()).done;){var F=ae.value,ne=F[0],I=F[1];P.push({type:"text",value:ne===te.length-1?I:I+`
101
+ `,position:{start:{line:y+ne,column:1},end:{line:y+ne,column:1}}})}return y+=X,P}if(Object.prototype.hasOwnProperty.call(B,"children")){var H=y;return B.children=j(B.children),P.push(B),B.position={start:{line:H,column:1},end:{line:y,column:1}},P}return P.push(B),P},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var k,C=(function(j){var q=/{([\d,-]+)}/,P=j.split(",").map(function(X){return X.trim()}).join();if(q.test(P)){var B=q.exec(P)[1],Y=YS(B);return function(X){return Y.includes(X+1)}}return function(){return!1}})(m),N=(function(j){var q=Wf(/showLineNumbers=(\d+)/i,{lines:1});if(q.test(j)){var P=q.exec(j);return Number(P.groups.lines)}return 1})(m),E=(function(j){for(var q=new Array(j),P=0;P<j;P++)q[P]={type:"element",tagName:"span",properties:{className:[]},children:[]};return q})(g.position.end.line),w=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],M=function(){var j,q,P=k.value,B=P[0],Y=P[1];Y.properties.className=["code-line"];var X=ZS(g,function(ae){return ae.position.start.line<=B+1&&ae.position.end.line>=B+1});Y.children=X.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!w.some(function(ae){return m.toLowerCase().includes(ae)})&&(Y.properties.line=[(B+N).toString()],Y.properties.className.push("line-number")),C(B)&&Y.properties.className.push("highlight-line"),(v==="diff"||(j=v)!=null&&j.includes("diff-"))&&Hr(Y).substring(0,1)==="-"?Y.properties.className.push("deleted"):(v==="diff"||(q=v)!=null&&q.includes("diff-"))&&Hr(Y).substring(0,1)==="+"&&Y.properties.className.push("inserted")},D=vf(E.entries());!(k=D()).done;)M();E.length>0&&Hr(E[E.length-1]).trim()===""&&E.pop(),o.children=E}}}})(KS);function T_(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 Pi(n){return n===0?"-":n<.01?`$${n.toFixed(4)}`:`$${n.toFixed(2)}`}const gM="_systemContextEvent_1qbiw_1",vM="_systemContextHeader_1qbiw_7",yM="_systemContextBadge_1qbiw_28",bM="_systemContextToggle_1qbiw_37",xM="_systemContextPre_1qbiw_43",_M="_systemContextEllipsis_1qbiw_54",SM="_systemEvent_1qbiw_58",TM="_systemTimestamp_1qbiw_65",kM="_textEvent_1qbiw_69",CM="_toolUseEvent_1qbiw_155",EM="_toolUseHeader_1qbiw_175",NM="_toolUsePrefix_1qbiw_182",wM="_toolUseName_1qbiw_187",jM="_toolUseArgs_1qbiw_192",AM="_toolResultEvent_1qbiw_203",DM="_toolResultHeader_1qbiw_208",MM="_toolResultIndicatorOk_1qbiw_232",RM="_toolResultIndicatorError_1qbiw_239",OM="_toolResultLabel_1qbiw_246",BM="_toolResultToggle_1qbiw_250",IM="_toolResultCommand_1qbiw_256",LM="_toolResultEllipsis_1qbiw_266",UM="_toolResultPre_1qbiw_270",zM="_errorEvent_1qbiw_291",VM="_statusEvent_1qbiw_299",HM="_userInputEvent_1qbiw_308",PM="_userInputContent_1qbiw_314",GM="_signalEvent_1qbiw_331",$M="_signalBadge_1qbiw_342",FM="_signalContent_1qbiw_351",qM="_usageEvent_1qbiw_356",KM="_usageBadge_1qbiw_363",YM="_defaultEvent_1qbiw_372",Be={systemContextEvent:gM,systemContextHeader:vM,systemContextBadge:yM,systemContextToggle:bM,systemContextPre:xM,systemContextEllipsis:_M,systemEvent:SM,systemTimestamp:TM,textEvent:kM,toolUseEvent:CM,toolUseHeader:EM,toolUsePrefix:NM,toolUseName:wM,toolUseArgs:jM,toolResultEvent:AM,toolResultHeader:DM,toolResultIndicatorOk:MM,toolResultIndicatorError:RM,toolResultLabel:OM,toolResultToggle:BM,toolResultCommand:IM,toolResultEllipsis:LM,toolResultPre:UM,errorEvent:zM,statusEvent:VM,userInputEvent:HM,userInputContent:PM,signalEvent:GM,signalBadge:$M,signalContent:FM,usageEvent:qM,usageBadge:KM,defaultEvent:YM},P0=3;function ZM({content:n}){const[a,i]=x.useState(!1),o=n.split(`
102
+ `),r=o.length>P0,u=a?n:o.slice(0,P0).join(`
103
+ `);return c.jsxs("div",{className:Be.systemContextEvent,"data-testid":"system-context-event",children:[c.jsxs("button",{type:"button",className:Be.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[c.jsx("span",{className:Be.systemContextBadge,children:"SYSTEM PROMPT"}),r&&c.jsx("span",{className:Be.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),c.jsxs("pre",{className:Be.systemContextPre,children:[u,!a&&r&&c.jsx("span",{className:Be.systemContextEllipsis,children:"…"})]})]})}function XM({time:n,content:a}){return c.jsxs("div",{className:Be.systemEvent,children:[c.jsxs("span",{className:Be.systemTimestamp,children:["[",n,"]"]})," ",a]})}function QM({content:n}){return c.jsx("div",{className:Be.textEvent,children:c.jsx(eh,{remarkPlugins:[th],rehypePlugins:[mM],children:n})})}function WM({content:n}){let a="",i=n;try{const o=JSON.parse(n);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return c.jsxs("div",{className:Be.toolUseEvent,children:[c.jsxs("div",{className:Be.toolUseHeader,children:[c.jsx("span",{className:Be.toolUsePrefix,children:">"}),a?c.jsx("span",{className:Be.toolUseName,children:a}):null]}),c.jsx("pre",{className:Be.toolUseArgs,children:i})]})}const G0=5;function JM(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function eR({content:n,raw:a,toolUseCtx:i}){const[o,r]=x.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=n.split(`
104
+ `),p=d.length>G0,m=o?n:d.slice(0,G0).join(`
105
+ `),y=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),v=i?JM(i.tool,i.args):"",b=c.jsxs(c.Fragment,{children:[c.jsx("span",{className:u?Be.toolResultIndicatorError:Be.toolResultIndicatorOk,"aria-label":u?"error":"success","data-testid":u?"tool-result-indicator-error":"tool-result-indicator-ok",children:u?"✗":"✓"}),c.jsx("span",{className:Be.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&c.jsx("span",{className:Be.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return c.jsxs("div",{className:Be.toolResultEvent,"data-testid":"tool-result",children:[p?c.jsx("button",{className:Be.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(S=>!S)},"aria-expanded":o,children:b}):c.jsx("div",{className:Be.toolResultHeader,"data-testid":"tool-result-header",children:b}),v&&c.jsx("div",{className:Be.toolResultCommand,children:v}),c.jsxs("pre",{className:Be.toolResultPre,"data-testid":"tool-result-content",children:[m,!o&&p&&c.jsx("span",{className:Be.toolResultEllipsis,children:"…"})]})]})}function tR({content:n}){return c.jsxs("div",{className:Be.errorEvent,children:["Error: ",n]})}function nR({content:n}){return c.jsxs("div",{className:Be.statusEvent,children:["--- ",n," ---"]})}function aR({content:n}){return c.jsx("div",{className:Be.userInputEvent,children:c.jsx("span",{className:Be.userInputContent,children:n})})}function sR({content:n}){return c.jsxs("div",{className:Be.signalEvent,"data-testid":"signal-event",children:[c.jsx("span",{className:Be.signalBadge,children:"SIGNAL"}),c.jsx("span",{className:Be.signalContent,children:n})]})}function iR({content:n}){let a=n;try{const i=JSON.parse(n),o=Number(i.input_tokens)||0,r=Number(i.output_tokens)||0,u=T_(o+r),d=Pi(Number(i.cost_usd)||0);a=`${u} tokens · ${d}`}catch{}return c.jsx("div",{className:Be.usageEvent,"data-testid":"usage-event",children:c.jsx("span",{className:Be.usageBadge,children:a})})}function oR({content:n}){return c.jsx("div",{className:Be.defaultEvent,children:n})}function lR({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return c.jsx(ZM,{content:n.content})}catch{}return c.jsx(XM,{time:i,content:n.content})}case"text":case"output":return c.jsx(QM,{content:n.content});case"tool_use":return c.jsx(WM,{content:n.content});case"tool_result":return c.jsx(eR,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return c.jsx(tR,{content:n.content});case"status":return c.jsx(nR,{content:n.content});case"user_input":return c.jsx(aR,{content:n.content});case"signal":return c.jsx(sR,{content:n.content});case"usage":return c.jsx(iR,{content:n.content});default:return c.jsx(oR,{content:n.content})}}const rR="_overlay_cmicx_1",cR="_dialog_cmicx_11",uR="_title_cmicx_30",dR="_description_cmicx_38",fR="_actions_cmicx_45",hR="_cancelButton_cmicx_52",pR="_confirmButton_cmicx_79",Es={overlay:rR,dialog:cR,title:uR,description:dR,actions:fR,cancelButton:hR,confirmButton:pR};function Rc({isOpen:n,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=x.useId(),p=x.useId();return c.jsx(Xn,{children:n&&c.jsx(kt.div,{className:Es.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:c.jsxs(kt.div,{className:Es.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[c.jsx("h3",{id:d,className:Es.title,children:a}),i&&c.jsx("p",{id:p,className:Es.description,children:i}),c.jsxs("div",{className:Es.actions,children:[c.jsx("button",{type:"button",className:Es.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),c.jsx("button",{type:"button",className:Es.confirmButton,onClick:r,children:o})]})]})})})}const mR="_spinner_1uyt1_1",gR="_spin_1uyt1_1",vR="_sm_1uyt1_14",yR="_md_1uyt1_20",bR="_lg_1uyt1_26",xR="_xl_1uyt1_32",$0={spinner:mR,spin:gR,sm:vR,md:yR,lg:bR,xl:xR};function Kh({size:n="md",className:a,label:i="Loading",liveRegion:o=!1}){return c.jsx("span",{className:`${$0.spinner} ${$0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const _R="_splash_1bn1g_1",SR="_logo_1bn1g_11",F0={splash:_R,logo:SR};function k_(){return c.jsxs("div",{className:F0.splash,"data-testid":"splash-screen",children:[c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:F0.logo}),c.jsx(Kh,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}function TR(n,a){const i=x.useRef(null);x.useEffect(()=>{const o=i.current;if(i.current=n,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of n){u.add(d.id);const p=r.get(d.id);if(p&&p.status!==d.status&&d.status!=="sleeping"){if(d.status==="connecting"){a("Provisioning environment…","info");continue}d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const d of o)u.has(d.id)||a("Environment removed","info")},[n,a])}function kR(n,a,i){const o=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=C_(a),u=a.filter(m=>Jf(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||Jf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:o,blockedTasks:u,attentionTasks:d,unhealthyEnvironments:p}}function C_(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function Jf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function CR(n,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const o=C_(n),r=[];for(const p of n){const m=p.workspaceId?((d=i.get(p.workspaceId))==null?void 0:d.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):Jf(p,o)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const u={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(u[p.reason]??3)-(u[m.reason]??3)),r}function ER(n,a){const i=new Map;for(const o of a)i.set(o.id,o);return n.filter(o=>o.status==="running"||o.status==="idle"||o.status==="waiting").map(o=>{var r;return{session:o,environmentName:((r=i.get(o.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function NR(n,a,i){const o=new Map;for(const r of a){if(!r.workspaceId)continue;let u=o.get(r.workspaceId);u||(u={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},o.set(r.workspaceId,u)),u.totalTasks+=1,r.status==="complete"?u.completedTasks+=1:r.status==="working"?u.workingTasks+=1:r.status==="failed"&&(u.failedTasks+=1)}return n.map(r=>{const u=o.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:u.totalTasks,completedTasks:u.completedTasks,workingTasks:u.workingTasks,failedTasks:u.failedTasks}})}const wR="_dashboard_16pzm_1",jR="_kpiStrip_16pzm_11",AR="_kpiCard_16pzm_23",DR="_kpiValue_16pzm_68",MR="_kpiLabel_16pzm_76",RR="_bodyGrid_16pzm_84",OR="_section_16pzm_96",BR="_sectionHeader_16pzm_109",IR="_sectionIcon_16pzm_118",LR="_sectionTitle_16pzm_123",UR="_sectionCount_16pzm_131",zR="_sectionBody_16pzm_138",VR="_emptyHint_16pzm_143",HR="_sessionRow_16pzm_150",PR="_sessionPrompt_16pzm_177",GR="_sessionEnv_16pzm_186",$R="_sessionRuntime_16pzm_192",FR="_sessionStatus_16pzm_198",qR="_statusDot_16pzm_207",KR="_attentionRow_16pzm_233",YR="_attentionTitle_16pzm_259",ZR="_attentionMeta_16pzm_267",XR="_reasonBadge_16pzm_274",QR="_bottomGrid_16pzm_301",WR="_envRow_16pzm_312",JR="_envName_16pzm_323",e3="_envStatusBadge_16pzm_333",t3="_workspaceRow_16pzm_369",n3="_workspaceTop_16pzm_395",a3="_workspaceName_16pzm_401",s3="_workspaceCounts_16pzm_407",i3="_progressBar_16pzm_415",o3="_progressFill_16pzm_422",me={dashboard:wR,kpiStrip:jR,kpiCard:AR,kpiValue:DR,kpiLabel:MR,bodyGrid:RR,section:OR,sectionHeader:BR,sectionIcon:IR,sectionTitle:LR,sectionCount:UR,sectionBody:zR,emptyHint:VR,sessionRow:HR,sessionPrompt:PR,sessionEnv:GR,sessionRuntime:$R,sessionStatus:FR,statusDot:qR,attentionRow:KR,attentionTitle:YR,attentionMeta:ZR,reasonBadge:XR,bottomGrid:QR,envRow:WR,envName:JR,envStatusBadge:e3,workspaceRow:t3,workspaceTop:n3,workspaceName:a3,workspaceCounts:s3,progressBar:i3,progressFill:o3},l3={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Qr={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function r3(n,a,i,o){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),o>0&&r.push(`${o} failed`),r.join(", ")}function Wr({value:n,label:a,accent:i,index:o,testId:r}){return c.jsxs(kt.div,{className:me.kpiCard,"data-accent":i,"data-testid":r,variants:l3,initial:"hidden",animate:"visible",custom:o,children:[c.jsx("span",{className:me.kpiValue,children:n}),c.jsx("span",{className:me.kpiLabel,children:a})]})}function c3(){const{workspaces:n,tasks:a,sessions:i,environments:o,loadTasks:r}=Xe(),u=Ht(),d=x.useRef(new Set);x.useEffect(()=>{for(const v of n)d.current.has(v.id)||(d.current.add(v.id),r(v.id))},[n,r]);const p=x.useMemo(()=>kR(i,a,o),[i,a,o]),m=x.useMemo(()=>ER(i,o),[i,o]),g=x.useMemo(()=>CR(a,n),[a,n]),y=x.useMemo(()=>NR(n,a),[n,a,o]);return c.jsxs("div",{className:me.dashboard,"data-testid":"dashboard",children:[c.jsxs("div",{className:me.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[c.jsx(Wr,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),c.jsx(Wr,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),c.jsx(Wr,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),c.jsx(Wr,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),c.jsxs("div",{className:me.bodyGrid,children:[c.jsxs(kt.div,{className:me.section,variants:Qr,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"●"}),c.jsx("span",{className:me.sectionTitle,children:"Active Sessions"}),c.jsx("span",{className:me.sectionCount,children:m.length})]}),c.jsx("div",{className:me.sectionBody,children:m.length===0?c.jsx("div",{className:me.emptyHint,children:"No active sessions"}):m.map(({session:v,environmentName:b})=>c.jsxs("button",{type:"button",className:me.sessionRow,onClick:()=>u(bb(v.id)),"data-testid":"session-row",children:[c.jsx("span",{className:me.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),c.jsx("span",{className:me.sessionEnv,children:b}),c.jsx("span",{className:me.sessionRuntime,children:v.runtime}),c.jsxs("span",{className:me.sessionStatus,children:[c.jsx("span",{className:me.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),c.jsxs(kt.div,{className:me.section,variants:Qr,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"⚑"}),c.jsx("span",{className:me.sectionTitle,children:"Needs Attention"}),c.jsx("span",{className:me.sectionCount,children:g.length})]}),c.jsx("div",{className:me.sectionBody,children:g.length===0?c.jsx("div",{className:me.emptyHint,children:"All clear"}):g.map(({task:v,reason:b,workspaceName:S})=>c.jsxs("button",{type:"button",className:me.attentionRow,onClick:()=>u(xa(v.id)),"data-testid":"attention-row",children:[c.jsxs("div",{className:me.attentionTitle,children:[c.jsx("span",{className:me.reasonBadge,"data-reason":b,children:b}),v.title]}),c.jsx("div",{className:me.attentionMeta,children:c.jsx("span",{children:S})})]},v.id))})]})]}),c.jsxs("div",{className:me.bottomGrid,children:[c.jsxs(kt.div,{className:me.section,variants:Qr,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"◈"}),c.jsx("span",{className:me.sectionTitle,children:"Environment Health"}),c.jsx("span",{className:me.sectionCount,children:o.length})]}),c.jsx("div",{className:me.sectionBody,children:o.length===0?c.jsx("div",{className:me.emptyHint,children:"No environments configured"}):o.map(v=>c.jsxs("div",{className:me.envRow,"data-testid":"dashboard-env-row",children:[c.jsx("span",{className:me.envName,children:v.displayName}),c.jsx("span",{className:me.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),c.jsxs(kt.div,{className:me.section,variants:Qr,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[c.jsxs("div",{className:me.sectionHeader,children:[c.jsx("span",{className:me.sectionIcon,"aria-hidden":"true",children:"▦"}),c.jsx("span",{className:me.sectionTitle,children:"Workspaces"}),c.jsx("span",{className:me.sectionCount,children:n.length})]}),c.jsx("div",{className:me.sectionBody,children:y.length===0?c.jsx("div",{className:me.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:b,completedTasks:S,workingTasks:k,failedTasks:C})=>{const N=b>0?Math.round(S/b*100):0;return c.jsxs("button",{type:"button",className:me.workspaceRow,onClick:()=>u(Li(v.id,v.environmentId)),"data-testid":"workspace-row",children:[c.jsxs("div",{className:me.workspaceTop,children:[c.jsx("span",{className:me.workspaceName,children:v.name}),c.jsxs("span",{className:me.workspaceCounts,"aria-label":r3(S,b,k,C),children:[S,"/",b,k>0&&c.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",k]}),C>0&&c.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",C]})]})]}),b>0&&c.jsx("div",{className:me.progressBar,children:c.jsx("div",{className:me.progressFill,style:{width:`${N}%`}})})]},v.id)})})]})]})]})}const u3="_panelContainer_aei9x_1",d3="_emptyState_aei9x_8",f3="_fadeIn_aei9x_1",h3="_workspaceSummary_aei9x_17",p3="_workspaceSummaryTitle_aei9x_28",m3="_workspaceSummarySubtitle_aei9x_32",g3="_header_aei9x_36",v3="_headerInfo_aei9x_69",y3="_killButton_aei9x_75",b3="_headerTitle_aei9x_104",x3="_headerActions_aei9x_119",_3="_taskStatusBadge_aei9x_126",S3="_taskBranch_aei9x_135",T3="_taskBlockedBadge_aei9x_141",k3="_btnPrimary_aei9x_149",C3="_btnDanger_aei9x_180",E3="_btnGhost_aei9x_219",N3="_rejectInput_aei9x_245",w3="_tabBar_aei9x_275",j3="_tab_aei9x_275",A3="_active_aei9x_301",D3="_eventScroll_aei9x_306",M3="_tabContent_aei9x_312",R3="_noContext_aei9x_317",O3="_overviewContent_aei9x_323",B3="_overviewDashboard_aei9x_332",I3="_overviewHero_aei9x_338",L3="_statusBadge_aei9x_345",U3="_statusPending_aei9x_357",z3="_statusAssigned_aei9x_362",V3="_statusInProgress_aei9x_367",H3="_statusReview_aei9x_372",P3="_statusDone_aei9x_377",G3="_statusFailed_aei9x_382",$3="_statusWaitingInput_aei9x_387",F3="_overviewBranchPill_aei9x_392",q3="_branchLink_aei9x_407",K3="_overviewSection_aei9x_418",Y3="_overviewLabel_aei9x_424",Z3="_overviewValue_aei9x_431",X3="_overviewMuted_aei9x_436",Q3="_overviewMarkdown_aei9x_442",W3="_envRow_aei9x_511",J3="_envDot_aei9x_517",eO="_envDotGreen_aei9x_524",tO="_envDotYellow_aei9x_528",nO="_envDotRed_aei9x_532",aO="_envDotGray_aei9x_536",sO="_depList_aei9x_540",iO="_depItem_aei9x_546",oO="_depBlocked_aei9x_553",lO="_depDone_aei9x_557",rO="_timeline_aei9x_561",cO="_timelineRow_aei9x_567",uO="_timelineKey_aei9x_574",dO="_timelineValue_aei9x_580",fO="_timelineDelta_aei9x_584",hO="_reviewNotes_aei9x_595",pO="_overviewDescription_aei9x_606",mO="_waitingMessage_aei9x_612",gO="_errorMessage_aei9x_616",vO="_eventOverflowWarning_aei9x_620",yO="_attemptSelector_aei9x_634",bO="_attemptLabel_aei9x_650",xO="_attemptButton_aei9x_654",_O="_attemptActive_aei9x_671",SO="_attemptStatus_aei9x_677",TO="_emptyCta_aei9x_683",kO="_ctaTitle_aei9x_695",CO="_ctaDescription_aei9x_701",EO="_ctaButton_aei9x_708",NO="_ctaCreateForm_aei9x_743",wO="_ctaCreateInput_aei9x_749",jO="_ctaCreateOk_aei9x_780",AO="_ctaLink_aei9x_815",DO="_workspaceHeader_aei9x_829",MO="_workspaceName_aei9x_854",RO="_workspaceMeta_aei9x_867",OO="_metaRow_aei9x_875",BO="_metaLabel_aei9x_888",IO="_metaValue_aei9x_903",LO="_archiveButton_aei9x_913",UO="_repoLink_aei9x_943",zO="_metaToggle_aei9x_953",VO="_metaToggleArrow_aei9x_974",HO="_metaToggleArrowOpen_aei9x_979",PO="_progressBarContainer_aei9x_983",GO="_progressBar_aei9x_983",$O="_progressFill_aei9x_999",FO="_progressLabel_aei9x_1006",qO="_metaTimestamps_aei9x_1013",KO="_metaTimestamp_aei9x_1013",L={panelContainer:u3,emptyState:d3,fadeIn:f3,workspaceSummary:h3,workspaceSummaryTitle:p3,workspaceSummarySubtitle:m3,header:g3,headerInfo:v3,killButton:y3,headerTitle:b3,headerActions:x3,taskStatusBadge:_3,taskBranch:S3,taskBlockedBadge:T3,btnPrimary:k3,btnDanger:C3,btnGhost:E3,rejectInput:N3,tabBar:w3,tab:j3,active:A3,eventScroll:D3,tabContent:M3,noContext:R3,overviewContent:O3,overviewDashboard:B3,overviewHero:I3,statusBadge:L3,statusPending:U3,statusAssigned:z3,statusInProgress:V3,statusReview:H3,statusDone:P3,statusFailed:G3,statusWaitingInput:$3,overviewBranchPill:F3,branchLink:q3,overviewSection:K3,overviewLabel:Y3,overviewValue:Z3,overviewMuted:X3,overviewMarkdown:Q3,envRow:W3,envDot:J3,envDotGreen:eO,envDotYellow:tO,envDotRed:nO,envDotGray:aO,depList:sO,depItem:iO,depBlocked:oO,depDone:lO,timeline:rO,timelineRow:cO,timelineKey:uO,timelineValue:dO,timelineDelta:fO,reviewNotes:hO,overviewDescription:pO,waitingMessage:mO,errorMessage:gO,eventOverflowWarning:vO,attemptSelector:yO,attemptLabel:bO,attemptButton:xO,attemptActive:_O,attemptStatus:SO,emptyCta:TO,ctaTitle:kO,ctaDescription:CO,ctaButton:EO,ctaCreateForm:NO,ctaCreateInput:wO,ctaCreateOk:jO,ctaLink:AO,workspaceHeader:DO,workspaceName:MO,workspaceMeta:RO,metaRow:OO,metaLabel:BO,metaValue:IO,archiveButton:LO,repoLink:UO,metaToggle:zO,metaToggleArrow:VO,metaToggleArrowOpen:HO,progressBarContainer:PO,progressBar:GO,progressFill:$O,progressLabel:FO,metaTimestamps:qO,metaTimestamp:KO};function YO(){return c.jsx("div",{className:L.emptyState,children:"Select a task or click + to create one"})}function ZO(){return c.jsx("div",{className:L.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function XO(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:o}=Xe(),[r,u]=x.useState(!1),[d,p]=x.useState(""),m=a.length>0,g=()=>{!d.trim()||o||!m||i(d.trim(),void 0,void 0,a[0].id)};return n.length>0?c.jsx(c3,{}):c.jsxs("div",{className:L.emptyCta,"data-testid":"welcome-cta",children:[c.jsx("div",{className:L.ctaTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:L.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?c.jsxs("div",{className:L.ctaCreateForm,children:[c.jsx("input",{type:"text",value:d,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(u(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:o,className:L.ctaCreateInput,"data-testid":"welcome-create-input"}),c.jsx("button",{onClick:g,className:L.ctaCreateOk,disabled:o,"aria-label":o?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:o?c.jsx(Kh,{size:"sm",label:"Creating workspace"}):"OK"})]}):c.jsx("button",{className:L.ctaButton,onClick:()=>u(!0),disabled:o||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&c.jsx("div",{className:L.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const E_=50;function QO(n,a,i,o,r=E_){return o?n<r:a-n-i<r}function WO(n,a){const i=a-n;return i>0?i:0}function JO({scrollRef:n,contentLength:a,isReversed:i}){const[o,r]=x.useState(!0),u=x.useRef(0),d=x.useRef(!1),p=x.useRef(0);x.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const b=QO(g.scrollTop,g.scrollHeight,g.clientHeight,i,E_);b!==y&&(y=b,r(b))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),x.useLayoutEffect(()=>{const g=n.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),x.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!o){const y=WO(u.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}o&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),u.current=g.scrollHeight}},[a,o,i,n]);const m=x.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:o,scrollToAnchor:m}}const eB="_wrapper_p24zt_1",tB="_scrollContainer_p24zt_9",nB="_toolbar_p24zt_15",aB="_directionToggle_p24zt_22",sB="_scrollToAnchor_p24zt_60",iB="_scrollToAnchorBottom_p24zt_84",oB="_scrollToAnchorTop_p24zt_88",Ns={wrapper:eB,scrollContainer:tB,toolbar:nB,directionToggle:aB,scrollToAnchor:sB,scrollToAnchorBottom:iB,scrollToAnchorTop:oB},N_="grackle-stream-direction";function lB(){try{return localStorage.getItem(N_)==="reversed"}catch{return!1}}function rB({eventsDropped:n}){return n<=0?c.jsx(c.Fragment,{}):c.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 Yh({events:n,eventsDropped:a,emptyState:i}){const o=x.useRef(null),[r,u]=x.useState(lB),d=LA(),p=x.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=JO({scrollRef:o,contentLength:n.length,isReversed:r}),y=()=>{const S=!r;u(S);try{localStorage.setItem(N_,S?"reversed":"default")}catch{}},v=d?0:.2,b=r?-8:8;return c.jsxs("div",{className:Ns.wrapper,children:[c.jsx("div",{className:Ns.toolbar,children:c.jsx("button",{className:Ns.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),c.jsxs("div",{ref:o,className:Ns.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,c.jsx(rB,{eventsDropped:a}),c.jsx(Xn,{initial:!1,children:p.map((S,k)=>{const C=r?n.length-1-k:k;return c.jsx(kt.div,{initial:{opacity:0,y:b},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:c.jsx(lR,{event:S,toolUseCtx:S.toolUseCtx})},`${S.sessionId}-${S.timestamp}-${C}`)})})]}),c.jsx(Xn,{children:!m&&c.jsxs(kt.button,{className:`${Ns.scrollToAnchor} ${r?Ns.scrollToAnchorTop:Ns.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}const cB="_bar_1xhb4_1",uB="_input_1xhb4_32",dB="_select_1xhb4_67",fB="_btnPrimary_1xhb4_103",hB="_btnDanger_1xhb4_134",pB="_btnGhost_1xhb4_173",mB="_badge_1xhb4_195",gB="_disconnectHint_1xhb4_205",Jt={bar:cB,input:uB,select:dB,btnPrimary:fB,btnDanger:hB,btnGhost:pB,badge:mB,disconnectHint:gB};function vB(n,a){if(!n)return!1;const i=a.find(o=>o.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function yB({environmentId:n,onReconnect:a}){return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:Jt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),c.jsx("button",{type:"button",onClick:()=>a(n),className:Jt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function yl({mode:n,sessionId:a,environmentId:i,taskId:o,showStop:r,showPersonaSelect:u,onSessionKill:d}){const{sendInput:p,spawn:m,startTask:g,personas:y,environments:v,provisionEnvironment:b}=Xe(),{showToast:S}=qi(),[k,C]=x.useState(""),[N,E]=x.useState(""),w=vB(i,v),M=D=>{if(D.preventDefault(),!!k.trim())if(n==="send"){if(!a||w)return;p(a,k),C("")}else if(n==="spawn"){if(!i)return;m(i,k,N),S("Session started","success"),C(""),E("")}else{if(!o)return;g(o,void 0,i,k),C("")}};return n==="spawn"?c.jsxs("form",{onSubmit:M,className:Jt.bar,children:[c.jsx("span",{className:Jt.badge,children:"new chat"}),c.jsx("input",{type:"text",value:k,onChange:D=>C(D.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Jt.input}),u&&c.jsxs("select",{value:N,onChange:D=>E(D.target.value),className:Jt.select,children:[c.jsx("option",{value:"",children:"(Default)"}),y.map(D=>c.jsx("option",{value:D.id,children:D.name},D.id))]}),c.jsx("button",{type:"submit",disabled:!k.trim()||!i,className:Jt.btnPrimary,children:"Go"})]}):n==="start"?c.jsxs("form",{onSubmit:M,className:Jt.bar,children:[c.jsx("input",{type:"text",value:k,onChange:D=>C(D.target.value),placeholder:"Type a message...",autoFocus:!0,className:Jt.input}),c.jsx("button",{type:"submit",disabled:!k.trim(),className:Jt.btnPrimary,children:"Send"})]}):c.jsxs("form",{onSubmit:M,className:Jt.bar,children:[w&&i&&c.jsx(yB,{environmentId:i,onReconnect:b}),c.jsx("input",{type:"text",value:k,onChange:D=>C(D.target.value),placeholder:"Type a message...",autoFocus:!w,disabled:w,className:Jt.input}),c.jsx("span",{title:w?"Environment is unavailable — reconnect first":void 0,children:c.jsx("button",{type:"submit",disabled:!k.trim()||w,className:Jt.btnPrimary,children:"Send"})}),r&&d&&c.jsx("button",{type:"button",onClick:d,className:Jt.btnDanger,title:"Stop session",children:"Stop"})]})}function Zh(n){const a=[];for(const i of n){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function Xh(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(u.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const p=i.get(d.tool_use_id);return p?(o.add(d.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}const bB="_panelContainer_pz4cr_1",xB="_emptyState_pz4cr_8",_B="_emptyTitle_pz4cr_20",SB="_emptyDescription_pz4cr_26",TB="_emptyHint_pz4cr_32",el={panelContainer:bB,emptyState:xB,emptyTitle:_B,emptyDescription:SB,emptyHint:TB};function kB({hasLocalEnvironment:n}){return c.jsxs("div",{className:el.emptyState,"data-testid":"chat-empty-state",children:[c.jsx("div",{className:el.emptyTitle,children:"Welcome to Grackle"}),c.jsx("div",{className:el.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&c.jsx("div",{className:el.emptyHint,children:"Go to Settings → Environments to add one."})]})}function CB(){const{tasks:n,sessions:a,events:i,eventsDropped:o,environments:r,loadTaskSessions:u,loadSessionEvents:d,kill:p,taskSessions:m}=Xe(),g=x.useRef(void 0),y=n.find(C=>C.id===Yo),v=y!=null&&y.latestSessionId?a.find(C=>C.id===y.latestSessionId)??(m[Yo]??[]).find(C=>C.id===y.latestSessionId):void 0;x.useEffect(()=>{u(Yo)},[u]),x.useEffect(()=>{y!=null&&y.latestSessionId&&u(Yo)},[y==null?void 0:y.latestSessionId,u]),x.useEffect(()=>{v&&v.id!==g.current&&(g.current=v.id,d(v.id))},[v==null?void 0:v.id,d]);const b=x.useMemo(()=>{if(!v)return[];const C=i.filter(N=>N.sessionId===v.id);return Xh(Zh(C))},[i,v==null?void 0:v.id]),S=r.find(C=>C.adapterType==="local"&&C.status==="connected"),k=v!==void 0&&!["completed","failed","interrupted","hibernating","suspended"].includes(v.status);return c.jsxs("div",{className:el.panelContainer,"data-testid":"chat-page",children:[c.jsx(Yh,{events:b,eventsDropped:o,emptyState:c.jsx(kB,{hasLocalEnvironment:!!S})}),S&&k&&c.jsx(yl,{mode:"send",sessionId:v.id,environmentId:v.environmentId,showStop:!0,onSessionKill:()=>p(v.id)}),S&&!k&&c.jsx(yl,{mode:"start",taskId:Yo,environmentId:S.id})]})}function EB(n,a){const i=[];let o=n;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const Rs={label:"Home",url:kc};function NB(n){return n?[Rs,{label:"Settings",url:nl},{label:n,url:void 0}]:[Rs,{label:"Settings",url:void 0}]}const w_={label:"Environments",url:Ui};function wB(){return[Rs,{label:"Environments",url:void 0}]}function jB(){return[Rs,{label:"New Chat",url:void 0}]}function AB(n){return[Rs,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function DB(n,a,i,o){const r=i.find(d=>d.id===n),u=o.find(d=>d.id===a);return[Rs,w_,{label:(u==null?void 0:u.displayName)??"Environment",url:fl(a)},{label:(r==null?void 0:r.name)??"Workspace",url:void 0}]}function MB(n,a,i,o,r){const u=EB(n,r),d=r.get(n),p=d==null?void 0:d.workspaceId,m=p?i.find(S=>S.id===p):void 0,g=a??(m==null?void 0:m.environmentId),y=g?o.find(S=>S.id===g):void 0,v=[Rs];y&&g&&(v.push(w_),v.push({label:y.displayName,url:fl(g)})),m&&g&&v.push({label:m.name,url:Li(m.id,g)});for(let S=0;S<u.length-1;S++)v.push({label:u[S].title,url:xa(u[S].id,void 0,p,g)});const b=u[u.length-1];return v.push({label:(b==null?void 0:b.title)??n,url:void 0}),v}function RB(){const n=jB(),[a]=yb(),i=a.get("env")??"";return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(Xi,{segments:n}),c.jsx("div",{className:L.emptyState,children:"Enter a prompt below to start a new session"}),c.jsx(yl,{mode:"spawn",environmentId:i,showPersonaSelect:!0})]})}function OB({sessionId:n,session:a,isActive:i,onKill:o}){return c.jsxs("div",{className:L.header,children:[c.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`,a!=null&&a.inputTokens||a!=null&&a.outputTokens||a!=null&&a.costUsd?` | ${T_((a.inputTokens??0)+(a.outputTokens??0))} tokens · ${Pi(a.costUsd??0)}`:""]}),c.jsxs("span",{className:L.headerInfo,children:[a&&c.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&c.jsx("button",{onClick:()=>o(n),title:"Stop session",className:L.killButton,children:"×"})]})]})}function BB({session:n}){const a=n&&["completed","failed","interrupted","suspended"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return c.jsx("div",{className:a?L.errorMessage:L.waitingMessage,children:i})}function IB(){const{sessionId:n}=as(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:u}=Xe(),d=x.useRef(void 0),p=AB(n),m=o.find(v=>v.id===n)??void 0,g=x.useMemo(()=>{const v=n?a.filter(b=>b.sessionId===n):[];return Xh(Zh(v))},[a,n]);if(x.useEffect(()=>{n&&n!==d.current&&(d.current=n,u(n))},[n,u]),!n)return c.jsx("div",{className:L.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(Xi,{segments:p}),c.jsx(OB,{sessionId:n,session:m,isActive:y,onKill:r}),c.jsx(Yh,{events:g,eventsDropped:i,emptyState:c.jsx(BB,{session:m})}),y&&c.jsx(yl,{mode:"send",sessionId:n,environmentId:m.environmentId,showStop:!0,onSessionKill:()=>r(n)})]})}const q0=220,K0=70,LB=40,UB=60,zB="hierarchy",VB="dependency";function HB(n){return x.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Yv.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:LB,ranksep:UB});const i=new Map(n.map(d=>[d.id,d])),o=new Map;for(const d of n)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=o.get(d.parentTaskId)||[];p.push(d),o.set(d.parentTaskId,p)}for(const d of n)a.setNode(d.id,{width:q0,height:K0});const r=[];for(const d of n){if(d.parentTaskId&&i.has(d.parentTaskId)){const p=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},p),r.push({id:p,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:zB},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of d.dependsOn)if(i.has(p)){const m=`dependency-${p}-${d.id}`;a.setEdge(p,d.id,{},m),r.push({id:m,source:p,target:d.id,type:"smoothstep",data:{edgeType:VB},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Yv.layout(a),{nodes:n.map(d=>{const p=a.node(d.id),m=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-q0/2,y:p.y-K0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[n])}const PB="_dagContainer_js4w6_1",GB="_taskNode_js4w6_26",$B="_taskNodeBorder_js4w6_54",FB="_taskNodeContent_js4w6_60",qB="_taskNodeHeader_js4w6_70",KB="_taskNodeIcon_js4w6_77",YB="_taskNodeTitle_js4w6_82",ZB="_taskNodeBadges_js4w6_90",XB="_childBadge_js4w6_95",QB="_depBadge_js4w6_107",WB="_handle_js4w6_119",JB="_emptyCta_js4w6_126",e6="_ctaDescription_js4w6_137",t6="_ctaButton_js4w6_144",$t={dagContainer:PB,taskNode:GB,taskNodeBorder:$B,taskNodeContent:FB,taskNodeHeader:qB,taskNodeIcon:KB,taskNodeTitle:YB,taskNodeBadges:ZB,childBadge:XB,depBadge:QB,handle:WB,emptyCta:JB,ctaDescription:e6,ctaButton:t6};function n6({data:n}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=n,u=ns(a.status);return c.jsxs("div",{className:$t.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[c.jsx(Zv,{type:"target",position:Xv.Top,className:$t.handle}),c.jsx("div",{className:$t.taskNodeBorder,style:{backgroundColor:u.color}}),c.jsxs("div",{className:$t.taskNodeContent,children:[c.jsxs("div",{className:$t.taskNodeHeader,children:[c.jsx("span",{className:$t.taskNodeIcon,style:{color:u.color},children:u.icon}),c.jsx("span",{className:$t.taskNodeTitle,children:a.title})]}),c.jsxs("div",{className:$t.taskNodeBadges,children:[i>0&&c.jsxs("span",{className:$t.childBadge,children:[o,"/",i]}),r&&c.jsx("span",{className:$t.depBadge,children:"dep"})]})]}),c.jsx(Zv,{type:"source",position:Xv.Bottom,className:$t.handle})]})}const a6=j2,s6={task:n6};function i6({workspaceId:n,environmentId:a}){const{tasks:i}=Xe(),o=Ht(),{resolvedThemeId:r}=wb(),u=x.useMemo(()=>i.filter(v=>v.workspaceId===n),[i,n]),{nodes:d,edges:p}=HB(u),m=x.useMemo(()=>{const v=getComputedStyle(document.documentElement),b={};for(const[S,k]of Object.entries(a6))b[S]=v.getPropertyValue(k).trim()||"#6b7a8d";return b},[r]),g=x.useCallback((v,b)=>{o(xa(b.id,void 0,n,a))},[o,n,a]),y=x.useCallback(v=>{const b=v.data;return m[b.task.status]||m.pending},[m]);return u.length===0?c.jsxs("div",{className:$t.emptyCta,children:[c.jsx("button",{className:$t.ctaButton,onClick:()=>o(Fi(n,void 0,a)),children:"Create Task"}),c.jsx("div",{className:$t.ctaDescription,children:"Create tasks to see the dependency graph"})]}):c.jsx("div",{className:$t.dagContainer,children:c.jsxs(QS,{nodes:d,edges:p,nodeTypes:s6,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[c.jsx(WS,{variant:JS.Dots,gap:24,size:1,color:"var(--text-disabled)"}),c.jsx(eT,{showInteractive:!1}),c.jsx(tT,{nodeColor:y,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function o6({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of n)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(z0.map(u=>[u,[]]));for(const u of n){const d=qh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(k=>a.get(k)!=="complete"),m=o.get(u.id)??[],g=m.length,y=m.filter(k=>k.status==="complete").length;let v;if(d==="paused"&&i){const k=i.get(u.id);k==="idle"?v="Needs input":k==="completed"&&(v="Ready to complete")}const b={task:u,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},S=r.get(d);S?S.push(b):r.get("not_started").push(b)}for(const u of r.values())u.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return z0.map(u=>{const d=ns(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const l6="_boardContainer_1c4y1_1",r6="_column_1c4y1_17",c6="_columnHeader_1c4y1_34",u6="_columnIcon_1c4y1_47",d6="_columnLabel_1c4y1_52",f6="_columnCount_1c4y1_57",h6="_cardList_1c4y1_67",p6="_emptyPlaceholder_1c4y1_76",m6="_card_1c4y1_67",g6="_cardHeader_1c4y1_107",v6="_cardStatusIcon_1c4y1_113",y6="_cardTitle_1c4y1_119",b6="_cardBadges_1c4y1_127",x6="_badge_1c4y1_134",_6="_blockedBadge_1c4y1_146",S6="_childBadge_1c4y1_151",T6="_depBadge_1c4y1_155",k6="_parentBadge_1c4y1_159",C6="_pausedSubBadge_1c4y1_166",E6="_personaBadge_1c4y1_170",N6="_envBadge_1c4y1_174",w6="_emptyCta_1c4y1_178",j6="_ctaButton_1c4y1_188",A6="_ctaDescription_1c4y1_204",Pe={boardContainer:l6,column:r6,columnHeader:c6,columnIcon:u6,columnLabel:d6,columnCount:f6,cardList:h6,emptyPlaceholder:p6,card:m6,cardHeader:g6,cardStatusIcon:v6,cardTitle:y6,cardBadges:b6,badge:x6,blockedBadge:_6,childBadge:S6,depBadge:T6,parentBadge:k6,pausedSubBadge:C6,personaBadge:E6,envBadge:N6,emptyCta:w6,ctaButton:j6,ctaDescription:A6};function D6({workspaceId:n,environmentId:a}){const{tasks:i,sessions:o,personas:r,environments:u}=Xe(),d=Ht(),p=x.useMemo(()=>i.filter(b=>b.workspaceId===n),[i,n]),m=x.useMemo(()=>new Map(i.map(b=>[b.id,b.status])),[i]),g=x.useMemo(()=>new Map(p.map(b=>[b.id,b])),[p]),y=x.useMemo(()=>{const b=new Map(o.map(w=>[w.id,w])),S=new Map(r.map(w=>[w.id,w])),k=new Map(u.map(w=>[w.id,w])),C=new Map,N=new Map,E=new Map;for(const w of p)if(w.latestSessionId){const M=b.get(w.latestSessionId);if(M){if(C.set(w.id,M.status),M.personaId){const D=S.get(M.personaId);D&&N.set(w.id,D.name)}if(M.environmentId){const D=k.get(M.environmentId);D&&E.set(w.id,D.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:N,environmentNameByTaskId:E}},[p,o,r,u]),v=x.useMemo(()=>o6({tasks:p,taskStatusById:m,sessionStatusByTaskId:y.sessionStatusByTaskId}),[p,m,y]);return p.length===0?c.jsxs("div",{className:Pe.emptyCta,"data-testid":"board-empty-cta",children:[c.jsx("button",{className:Pe.ctaButton,onClick:()=>d(Fi(n,void 0,a)),children:"Create Task"}),c.jsx("div",{className:Pe.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):c.jsx("div",{className:Pe.boardContainer,"data-testid":"board-container",children:v.map(b=>c.jsxs("section",{className:Pe.column,"data-testid":`board-column-${b.status}`,"aria-label":`${b.label}, ${b.tasks.length} ${b.tasks.length===1?"task":"tasks"}`,children:[c.jsxs("div",{className:Pe.columnHeader,children:[c.jsx("span",{className:Pe.columnIcon,style:{color:b.style.color},children:b.style.icon}),c.jsx("span",{className:Pe.columnLabel,children:b.label}),c.jsx("span",{className:Pe.columnCount,"data-testid":`board-count-${b.status}`,children:b.tasks.length})]}),c.jsx("div",{className:Pe.cardList,children:b.tasks.length===0?c.jsx("div",{className:Pe.emptyPlaceholder,children:"No tasks"}):c.jsx(Xn,{mode:"popLayout",children:b.tasks.map(S=>c.jsx(kt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:c.jsx(M6,{boardTask:S,tasksById:g,personaName:y.personaNameByTaskId.get(S.task.id),envName:y.environmentNameByTaskId.get(S.task.id),onClick:()=>d(xa(S.task.id,void 0,n,a))})},S.task.id))})})]},b.status))})}function M6({boardTask:n,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=ns(u.status),v=u.parentTaskId?a.get(u.parentTaskId):void 0;return c.jsxs("div",{className:Pe.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),r())},children:[c.jsxs("div",{className:Pe.cardHeader,children:[c.jsx("span",{className:Pe.cardStatusIcon,style:{color:y.color},children:y.icon}),c.jsx("span",{className:Pe.cardTitle,children:u.title})]}),c.jsxs("div",{className:Pe.cardBadges,children:[v&&c.jsx("span",{className:`${Pe.badge} ${Pe.parentBadge}`,title:v.title,children:v.title}),p>0&&c.jsxs("span",{className:`${Pe.badge} ${Pe.childBadge}`,children:[m,"/",p]}),d&&c.jsx("span",{className:`${Pe.badge} ${Pe.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&c.jsx("span",{className:`${Pe.badge} ${Pe.depBadge}`,children:"dep"}),g&&c.jsx("span",{className:`${Pe.badge} ${Pe.pausedSubBadge}`,children:g}),i&&c.jsx("span",{className:`${Pe.badge} ${Pe.personaBadge}`,children:i}),o&&c.jsx("span",{className:`${Pe.badge} ${Pe.envBadge}`,children:o})]})]})}function Qh(n){const{value:a,onSave:i,validate:o,fieldId:r,activeFieldId:u,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=x.useState(""),[v,b]=x.useState(""),S=x.useRef(!1),k=u===r,C=x.useCallback(P=>{y(P),b("")},[]),N=x.useCallback(()=>{b("")},[]),E=x.useCallback(()=>{S.current=!1,d==null||d(null),y(""),b("")},[d]),w=x.useCallback(()=>{const P=m?g.trim():g;if(o){const Y=o(g);if(Y){b(Y);return}}const B=m?a.trim():a;if(P===B){E();return}i(P),E()},[g,a,m,o,i,E]),M=x.useCallback(()=>{S.current=!0,d==null||d(r),y(a),b("")},[r,a,d]),D=x.useCallback(P=>{if(S.current){S.current=!1;return}P.relatedTarget instanceof HTMLElement&&P.relatedTarget.dataset.editAction===r||w()},[r,w]),j=x.useCallback(P=>{P.key==="Escape"?E():P.key==="Enter"&&p&&w()},[E,p,w]),q=(()=>{if(!k)return!1;const P=m?a.trim():a;return(m?g.trim():g)!==P})();return x.useEffect(()=>{!k&&(g!==""||v!=="")&&(y(""),b(""))},[k,g,v]),{isEditing:k,draft:g,error:v,isDirty:q,startEdit:M,cancelEdit:E,save:w,setDraft:C,clearError:N,handleBlur:D,handleKeyDown:j,ignoreInitialBlurRef:S}}const R6="_editFieldWrapper_yuzty_1",O6="_editInput_yuzty_10",B6="_editTextarea_yuzty_42",I6="_editSelect_yuzty_78",L6="_editError_yuzty_111",U6="_editInputInvalid_yuzty_118",z6="_editHint_yuzty_123",V6="_unsavedDot_yuzty_132",H6="_metaValueClickable_yuzty_140",P6="_editButton_yuzty_159",G6="_metaPlaceholder_yuzty_175",$6="_worktreeToggle_yuzty_180",ze={editFieldWrapper:R6,editInput:O6,editTextarea:B6,editSelect:I6,editError:L6,editInputInvalid:U6,editHint:z6,unsavedDot:V6,metaValueClickable:H6,editButton:P6,metaPlaceholder:G6,worktreeToggle:$6};function cn(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:b,"data-testid":S}=n,k=x.useRef(null),C=Qh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(x.useEffect(()=>{if(C.isEditing){const E=window.setTimeout(()=>{var w;(w=k.current)==null||w.focus()},0);return()=>window.clearTimeout(E)}},[C.isEditing]),r==="create"){const E=M=>{m==null||m(M.target.value)},w=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{className:`${ze.editInput} ${w?ze.editInputInvalid:""}`,value:a,onChange:E,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),w&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:w})]})}if(C.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("input",{ref:k,className:`${ze.editInput} ${C.error?ze.editInputInvalid:""}`,value:C.draft,onChange:E=>C.setDraft(E.target.value),onBlur:C.handleBlur,onKeyDown:C.handleKeyDown,maxLength:v,placeholder:y,"aria-label":b,"data-testid":S?`${S}-input`:void 0}),C.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),C.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:C.error}),c.jsx("span",{className:ze.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>C.startEdit(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),C.startEdit())},title:"Click to edit","aria-label":b,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function F6(n){const{value:a,onSave:i,validate:o,mode:r="edit",fieldId:u="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=x.useRef(null),k=Qh({value:a,onSave:i,validate:o,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(x.useEffect(()=>{if(k.isEditing){const N=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(N)}},[k.isEditing]),r==="create"){const N=w=>{m==null||m(w.target.value)},E=o==null?void 0:o(a);return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{className:`${ze.editTextarea} ${E?ze.editInputInvalid:""}`,value:a,onChange:N,placeholder:y,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),E&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:E})]})}if(k.isEditing)return c.jsxs("div",{className:ze.editFieldWrapper,children:[c.jsx("textarea",{ref:S,className:`${ze.editTextarea} ${k.error?ze.editInputInvalid:""}`,value:k.draft,onChange:N=>k.setDraft(N.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,title:v,"aria-label":v,"data-testid":b?`${b}-input`:void 0}),k.isDirty&&c.jsx("span",{className:ze.unsavedDot,title:"Unsaved changes"}),k.error&&c.jsx("span",{className:ze.editError,"data-testid":"edit-error",children:k.error}),c.jsx("span",{className:ze.editHint,children:"Tab to save · Esc to cancel"})]});const C=g==null?void 0:g(a);return c.jsxs("span",{role:"button",tabIndex:0,className:ze.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[C!==void 0?C:a?c.jsx("span",{children:a}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function j_(n){var M;const{value:a,onSave:i,mode:o="edit",options:r,fieldId:u="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":b}=n,S=x.useRef(null),k=Qh({value:a,onSave:i,fieldId:u,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});x.useEffect(()=>{if(k.isEditing){const D=window.setTimeout(()=>{var j;(j=S.current)==null||j.focus()},0);return()=>window.clearTimeout(D)}},[k.isEditing]);const C=x.useCallback(D=>{const j=D.target.value;k.ignoreInitialBlurRef.current=!1,j!==a&&i(j),k.cancelEdit()},[a,i,k]),N=x.useCallback(D=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}D.relatedTarget instanceof HTMLElement&&D.relatedTarget.dataset.editAction===u||k.cancelEdit()},[u,k]);if(o==="create")return c.jsx("select",{className:ze.editSelect,value:a,onChange:D=>m==null?void 0:m(D.target.value),"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(D=>c.jsx("option",{value:D.value,children:D.label},D.value))});if(k.isEditing)return c.jsx("select",{ref:S,className:ze.editSelect,value:k.draft,onChange:C,onBlur:N,title:v,"aria-label":v,"data-testid":b?`${b}-select`:void 0,children:r.map(D=>c.jsx("option",{value:D.value,children:D.label},D.value))});const E=g==null?void 0:g(a),w=(M=r.find(D=>D.value===a))==null?void 0:M.label;return c.jsxs("button",{type:"button",className:ze.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","aria-label":v,"data-testid":b?`${b}-button`:void 0,children:[E!==void 0?E:w?c.jsx("span",{children:w}):c.jsx("span",{className:ze.metaPlaceholder,children:y||"None"}),c.jsx("span",{className:ze.editButton,"aria-hidden":"true",children:"✏️"})]})}function q6(n){const{checked:a,onChange:i,label:o,ariaLabel:r,"data-testid":u}=n;return c.jsxs("label",{className:ze.worktreeToggle,"data-testid":u,children:[c.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),c.jsx("span",{children:o})]})}const K6="_envRow_1e1r5_1",Y6="_envDot_1e1r5_7",Z6="_envDotGreen_1e1r5_14",X6="_envDotYellow_1e1r5_18",Q6="_envDotRed_1e1r5_22",W6="_envDotGray_1e1r5_26",Ii={envRow:K6,envDot:Y6,envDotGreen:Z6,envDotYellow:X6,envDotRed:Q6,envDotGray:W6};function J6(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Ii.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Ii.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Ii.envDotRed:Ii.envDotGray}function e4(n){const{value:a,onSave:i,environments:o,allowNone:r=!1,fieldId:u="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=o.find(k=>k.id===a),b=[...r?[{value:"",label:"None"}]:[],...o.map(k=>({value:k.id,label:k.displayName}))],S=()=>{if(v)return c.jsxs("span",{className:Ii.envRow,children:[c.jsx("span",{className:`${Ii.envDot} ${J6(v.status)}`}),v.displayName]})};return c.jsx(j_,{value:a,onSave:i,options:b,fieldId:u,activeFieldId:d,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":y})}function Y0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const yf=100;function t4(){const{workspaceId:n,environmentId:a}=as(),i=Ht(),{tasks:o,environments:r,workspaces:u,personas:d,sessions:p,archiveWorkspace:m,updateWorkspace:g,usageCache:y,loadUsage:v}=Xe(),[b,S]=x.useState("tasks"),[k,C]=x.useState(!1),[N,E]=x.useState(null),[w,M]=x.useState(!1),D=x.useRef(void 0),j=u.find(F=>F.id===n),q=a??(j==null?void 0:j.environmentId)??"",P=DB(n,q,u,r);x.useEffect(()=>{const F=D.current;D.current=n,!(F===void 0||F===n)&&N!==null&&E(null)},[n,N]);const B=p.reduce((F,ne)=>F+(ne.costUsd??0),0);x.useEffect(()=>{n&&v("workspace",n)},[n,v,B]);const Y=n?y[`workspace:${n}`]:void 0,X=o.filter(F=>F.workspaceId===n),ae=X.filter(F=>F.status==="complete").length,te=X.length,Q=te>0?Math.round(ae/te*100):0;return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(Xi,{segments:P}),c.jsxs("div",{className:L.workspaceHeader,children:[c.jsx("span",{className:L.workspaceName,"data-testid":"workspace-name",children:c.jsx(cn,{value:(j==null?void 0:j.name)||"",onSave:F=>{j&&g(j.id,{name:F})},validate:F=>{const ne=F.trim();if(!ne)return"Name is required";if(ne.length>yf)return`Max ${yf} characters`},maxLength:yf,fieldId:"name",activeFieldId:N,onActivate:E,ariaLabel:"Workspace name",renderDisplay:F=>F||n||void 0,"data-testid":"edit-name"})}),c.jsx("button",{className:L.archiveButton,onClick:()=>C(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),c.jsxs("button",{className:L.metaToggle,onClick:()=>M(!w),"aria-expanded":!w,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[c.jsx("span",{className:`${L.metaToggleArrow} ${w?"":L.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!w&&c.jsxs("div",{className:L.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Description"}),c.jsx("div",{className:L.metaValue,children:c.jsx(F6,{value:(j==null?void 0:j.description)||"",onSave:F=>{j&&g(j.id,{description:F})},fieldId:"description",activeFieldId:N,onActivate:E,renderDisplay:F=>F?c.jsx("span",{className:L.overviewMarkdown,children:c.jsx(eh,{remarkPlugins:[th],children:F})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Repository"}),c.jsx("div",{className:L.metaValue,children:c.jsx(cn,{value:(j==null?void 0:j.repoUrl)||"",onSave:F=>{j&&g(j.id,{repoUrl:F})},validate:F=>{const ne=F.trim();if(ne&&!/^https?:\/\/.+/.test(ne))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:N,onActivate:E,renderDisplay:F=>F&&/^https?:\/\//i.test(F)?c.jsx("a",{className:L.repoLink,href:F,target:"_blank",rel:"noopener noreferrer",onClick:ne=>ne.stopPropagation(),children:F}):F?c.jsx("span",{children:F}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Environment"}),c.jsx("div",{className:L.metaValue,children:c.jsx(e4,{value:(j==null?void 0:j.environmentId)||"",onSave:F=>{j&&F&&g(j.id,{environmentId:F})},environments:r,fieldId:"environmentId",activeFieldId:N,onActivate:E,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Persona"}),c.jsx("div",{className:L.metaValue,children:c.jsx(j_,{value:(j==null?void 0:j.defaultPersonaId)||"",onSave:F=>{j&&g(j.id,{defaultPersonaId:F})},options:[{value:"",label:"(Inherit)"},...d.map(F=>({value:F.id,label:F.name}))],fieldId:"defaultPersonaId",activeFieldId:N,onActivate:E,renderDisplay:F=>{const ne=d.find(I=>I.id===F);if(ne)return c.jsx("span",{children:ne.name})},placeholder:(j==null?void 0:j.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Worktrees"}),c.jsx("div",{className:L.metaValue,children:c.jsx(q6,{checked:(j==null?void 0:j.useWorktrees)??!0,onChange:F=>{j&&g(j.id,{useWorktrees:F})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),c.jsxs("div",{className:L.metaRow,children:[c.jsx("span",{className:L.metaLabel,children:"Working Dir"}),c.jsx("div",{className:L.metaValue,children:c.jsx(cn,{value:(j==null?void 0:j.worktreeBasePath)||"",onSave:F=>{j&&g(j.id,{worktreeBasePath:F})},fieldId:"worktreeBasePath",activeFieldId:N,onActivate:E,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),j&&c.jsxs("div",{className:L.metaTimestamps,children:[c.jsxs("span",{className:L.metaTimestamp,children:["Created ",Y0(j.createdAt)]}),j.updatedAt&&j.updatedAt!==j.createdAt&&c.jsxs("span",{className:L.metaTimestamp,children:["· Updated ",Y0(j.updatedAt)]})]})]}),te>0&&c.jsxs("div",{className:L.progressBarContainer,"data-testid":"progress-bar",children:[c.jsx("div",{className:L.progressBar,children:c.jsx("div",{className:L.progressFill,style:{width:`${Q}%`}})}),c.jsxs("span",{className:L.progressLabel,children:[ae,"/",te]})]}),Y&&Y.costUsd>0&&c.jsx("div",{className:L.progressBarContainer,children:c.jsxs("span",{className:L.progressLabel,children:["Usage: ",Pi(Y.costUsd)," (",Y.sessionCount," session",Y.sessionCount!==1?"s":"",")"]})}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Workspace view",children:[c.jsx("button",{role:"tab","aria-selected":b==="graph",className:`${L.tab} ${b==="graph"?L.active:""}`,onClick:()=>S("graph"),children:"Graph"}),c.jsx("button",{role:"tab","aria-selected":b==="board",className:`${L.tab} ${b==="board"?L.active:""}`,onClick:()=>S("board"),"data-testid":"board-tab",children:"Board"}),c.jsx("button",{role:"tab","aria-selected":b==="tasks",className:`${L.tab} ${b==="tasks"?L.active:""}`,onClick:()=>S("tasks"),children:"Tasks"})]}),b==="tasks"&&te>0&&c.jsxs("div",{className:L.workspaceSummary,children:[c.jsx("span",{className:L.workspaceSummaryTitle,children:`${ae}/${te} tasks complete`}),c.jsx("span",{className:L.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),b==="tasks"&&te===0&&c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>i(Fi(n,void 0,q)),children:"Create Task"}),c.jsx("div",{className:L.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),b==="board"&&c.jsx(D6,{workspaceId:n,environmentId:q}),b==="graph"&&c.jsx(i6,{workspaceId:n,environmentId:q}),c.jsx(Rc,{isOpen:k,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{j&&(m(j.id),i("/",{replace:!0})),C(!1)},onCancel:()=>C(!1)})]})}const n4="_container_cddyd_1",a4="_header_cddyd_8",s4="_headerTitle_cddyd_35",i4="_badge_cddyd_44",o4="_headerActions_cddyd_54",l4="_body_cddyd_61",r4="_formContent_cddyd_73",c4="_section_cddyd_85",u4="_label_cddyd_91",d4="_titleInput_cddyd_98",f4="_descriptionTextarea_cddyd_131",h4="_parentContext_cddyd_167",p4="_parentLabel_cddyd_175",m4="_parentName_cddyd_182",g4="_personaSelect_cddyd_186",v4="_depList_cddyd_220",y4="_depItem_cddyd_226",b4="_depItemSelected_cddyd_248",x4="_noDeps_cddyd_252",_4="_btnPrimary_cddyd_258",S4="_btnGhost_cddyd_289",Ue={container:n4,header:a4,headerTitle:s4,badge:i4,headerActions:o4,body:l4,formContent:r4,section:c4,label:u4,titleInput:d4,descriptionTextarea:f4,parentContext:h4,parentLabel:p4,parentName:m4,personaSelect:g4,depList:v4,depItem:y4,depItemSelected:b4,noDeps:x4,btnPrimary:_4,btnGhost:S4};function A_({mode:n,taskId:a,workspaceId:i,parentTaskId:o,environmentId:r}){const{tasks:u,workspaces:d,personas:p,createTask:m,updateTask:g}=Xe(),{showToast:y}=qi(),v=Ht(),b=n==="edit",S=b&&a?u.find(fe=>fe.id===a):void 0,k=b?(S==null?void 0:S.workspaceId)??"":i??"",[C,N]=x.useState(k),E=k||C,w=d.find(fe=>fe.id===E),M=r??(w==null?void 0:w.environmentId),D=!b&&!i,j=b?(S==null?void 0:S.parentTaskId)??"":o??"",q=j?u.find(fe=>fe.id===j):void 0,[P,B]=x.useState((S==null?void 0:S.title)??""),[Y,X]=x.useState((S==null?void 0:S.description)??""),[ae,te]=x.useState((S==null?void 0:S.dependsOn)??[]),[Q,F]=x.useState((S==null?void 0:S.defaultPersonaId)??""),[ne,I]=x.useState((S==null?void 0:S.canDecompose)??!1),[H,oe]=x.useState(!1),G=x.useRef(!1);x.useEffect(()=>{b&&S&&!G.current&&(G.current=!0,B(S.title),X(S.description),te(S.dependsOn),F(S.defaultPersonaId),I(S.canDecompose))},[b,S]);const O=u.filter(fe=>fe.workspaceId===E&&(!b||fe.id!==a)&&fe.id!==j),ie=P.trim().length>0&&(!b||S!==void 0)&&E.length>0,be=fe=>{te(At=>At.includes(fe)?At.filter(pn=>pn!==fe):[...At,fe])},re=()=>{!ie||H||b&&S===void 0||(b&&a?(g(a,P.trim(),Y,ae,Q),y("Task updated","success"),v(xa(a,void 0,E,M),{replace:!0})):(oe(!0),m(E,P.trim(),Y,ae.length>0?ae:void 0,j||void 0,Q,ne,()=>{y("Task created","success"),v(i?Li(i,M):"/tasks",{replace:!0})},fe=>{y(fe,"error"),oe(!1)})))},Fe=()=>{v(b&&a?xa(a,void 0,E,M):i?Li(i,M):"/tasks")},vt=b?"edit task":j?"child task":"new task";return c.jsxs("div",{className:Ue.container,children:[c.jsxs("div",{className:Ue.header,children:[c.jsxs("div",{className:Ue.headerTitle,children:[c.jsx("span",{className:Ue.badge,children:vt}),q&&c.jsxs("span",{className:Ue.parentContext,children:[c.jsx("span",{className:Ue.parentLabel,children:"Child of"}),c.jsx("span",{className:Ue.parentName,children:q.title})]})]}),c.jsxs("div",{className:Ue.headerActions,children:[c.jsx("button",{onClick:re,disabled:!ie||H,className:Ue.btnPrimary,"data-testid":"task-edit-save",children:H?"Creating…":b?"Save Changes":"Create"}),c.jsx("button",{onClick:Fe,className:Ue.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:Ue.body,children:c.jsxs("div",{className:Ue.formContent,children:[D&&c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-workspace",children:"Workspace"}),c.jsxs("select",{id:"task-edit-workspace",value:C,onChange:fe=>N(fe.target.value),className:Ue.personaSelect,"data-testid":"task-edit-workspace",children:[c.jsx("option",{value:"",children:"Select a workspace..."}),d.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-title",children:"Title"}),c.jsx("input",{id:"task-edit-title",type:"text",value:P,onChange:fe=>B(fe.target.value),placeholder:"Task title...",autoFocus:!0,className:Ue.titleInput,"data-testid":"task-edit-title",onKeyDown:fe=>{fe.key==="Enter"&&ie&&re()}})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-description",children:"Description"}),c.jsx("textarea",{id:"task-edit-description",value:Y,onChange:fe=>X(fe.target.value),placeholder:"Describe the task... (markdown supported)",className:Ue.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),c.jsxs("div",{className:Ue.section,children:[c.jsx("label",{className:Ue.label,htmlFor:"task-edit-persona",children:"Default Persona"}),c.jsxs("select",{id:"task-edit-persona",value:Q,onChange:fe=>F(fe.target.value),className:Ue.personaSelect,"data-testid":"task-edit-persona",children:[c.jsx("option",{value:"",children:"(Inherit)"}),p.map(fe=>c.jsx("option",{value:fe.id,children:fe.name},fe.id))]})]}),!b&&c.jsx("div",{className:Ue.section,children:c.jsxs("label",{className:Ue.depItem,"data-testid":"task-edit-can-decompose",children:[c.jsx("input",{type:"checkbox",checked:ne,onChange:fe=>I(fe.target.checked)}),"Can spawn subtasks"]})}),c.jsxs("div",{className:Ue.section,children:[c.jsx("div",{className:Ue.label,children:"Dependencies"}),O.length===0?c.jsx("div",{className:Ue.noDeps,children:"No other tasks in this workspace"}):c.jsx("div",{className:Ue.depList,children:O.map(fe=>{const At=ae.includes(fe.id);return c.jsxs("label",{className:`${Ue.depItem} ${At?Ue.depItemSelected:""}`,"data-testid":`dep-option-${fe.id}`,children:[c.jsx("input",{type:"checkbox",checked:At,onChange:()=>be(fe.id)}),fe.title,c.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",fe.status,")"]})]},fe.id)})})]})]})})]})}function Z0(){const{workspaceId:n,environmentId:a}=as(),[i]=yb(),o=n??i.get("workspace")??"",r=i.get("parent")??void 0;return c.jsx(A_,{mode:"new",workspaceId:o,parentTaskId:r,environmentId:a})}function X0(){const{taskId:n,workspaceId:a,environmentId:i}=as();return c.jsx(A_,{mode:"edit",taskId:n,workspaceId:a,environmentId:i})}const T4="_container_1pqxm_1",k4="_emptyState_1pqxm_8",C4="_card_1pqxm_14",E4="_cardHeader_1pqxm_34",N4="_categoryBadge_1pqxm_46",w4="_findingTitle_1pqxm_54",j4="_findingDate_1pqxm_60",A4="_findingContent_1pqxm_72",D4="_tags_1pqxm_78",M4="_tag_1pqxm_78",Pn={container:T4,emptyState:k4,card:C4,cardHeader:E4,categoryBadge:N4,findingTitle:w4,findingDate:j4,findingContent:A4,tags:D4,tag:M4};function R4(n){const a=new Date(n),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),p=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const Q0={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 O4({workspaceId:n}){const{findings:a}=Xe(),i=a.filter(o=>o.workspaceId===n);return i.length===0?c.jsx("div",{className:Pn.emptyState,children:"No findings yet. Agents will post discoveries here."}):c.jsx("div",{className:Pn.container,children:i.map((o,r)=>{const u=Q0[o.category]||Q0.general;return c.jsxs(kt.div,{className:Pn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[c.jsxs("div",{className:Pn.cardHeader,children:[c.jsx("span",{className:Pn.categoryBadge,style:{background:u.bg,color:u.text},children:o.category}),c.jsx("span",{className:Pn.findingTitle,children:o.title}),c.jsx("span",{className:Pn.findingDate,title:o.createdAt,children:R4(o.createdAt)})]}),c.jsx("div",{className:Pn.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&c.jsx("div",{className:Pn.tags,children:o.tags.map(d=>c.jsx("span",{className:Pn.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:d},d))})]},o.id)})})}function Jr(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 bf(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function W0(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 B4({status:n}){const a=ns(n),i=E2(n);return c.jsx("span",{className:`${L.statusBadge} ${L[i]??L.statusPending}`,children:a.label})}function I4({task:n,tasksById:a,environments:i,workspaces:o,taskSessions:r,selectedEnvId:u}){const{loadUsage:d,usageCache:p}=Xe(),m=r.reduce((M,D)=>M+(D.costUsd??0),0);x.useEffect(()=>{d("task",n.id),n.childTaskIds.length>0&&d("task_tree",n.id)},[n.id,n.childTaskIds.length,d,m]);const g=`task:${n.id}`,y=g in p?p[g]:void 0,v=`task_tree:${n.id}`,b=n.childTaskIds.length>0&&v in p?p[v]:void 0,S=r.length>0?r[r.length-1]:void 0,k=(S==null?void 0:S.environmentId)??"",C=k?i.find(M=>M.id===k):void 0,N=o.find(M=>M.id===n.workspaceId),E=i.find(M=>M.id===u),w=n.branch&&(N!=null&&N.repoUrl)?`${N.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return c.jsxs("div",{className:L.overviewDashboard,children:[c.jsxs("div",{className:L.overviewHero,children:[c.jsx(B4,{status:n.status}),n.branch&&c.jsx("span",{className:L.overviewBranchPill,children:w?c.jsxs("a",{href:w,target:"_blank",rel:"noreferrer noopener",className:L.branchLink,children:["🔗"," ",n.branch]}):c.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Description"}),c.jsx("div",{className:L.overviewMarkdown,children:c.jsx(eh,{remarkPlugins:[th],children:n.description})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Environment"}),k&&C?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${W0(C.status)}`,title:C.status,"aria-label":`Status: ${C.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:C.displayName})]}):E?c.jsxs("div",{className:L.envRow,"data-testid":"task-overview-environment",children:[c.jsx("span",{className:`${L.envDot} ${W0(E.status)}`,title:E.status,"aria-label":`Status: ${E.status}`,role:"img"}),c.jsx("span",{className:L.overviewValue,children:E.displayName}),c.jsx("span",{className:L.overviewMuted,children:"(workspace default)"})]}):c.jsx("div",{className:L.overviewMuted,children:"Set in workspace settings"})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?c.jsx("div",{className:L.overviewMuted,children:"None"}):c.jsx("div",{className:L.depList,children:n.dependsOn.map(M=>{const D=a.get(M),j=(D==null?void 0:D.status)==="complete";return c.jsxs("div",{className:`${L.depItem} ${j?L.depDone:L.depBlocked}`,children:[c.jsx("span",{children:j?"✓":"○"}),c.jsx("span",{children:(D==null?void 0:D.title)??M})]},M)})})]}),c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Timeline"}),c.jsxs("div",{className:L.timeline,children:[n.createdAt&&c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Created"}),c.jsx("span",{className:L.timelineValue,children:Jr(n.createdAt)})]}),n.assignedAt&&(()=>{const M=bf(n.createdAt,n.assignedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Assigned"}),c.jsx("span",{className:L.timelineValue,children:Jr(n.assignedAt)}),M!==void 0&&c.jsx("span",{className:L.timelineDelta,children:M})]})})(),n.startedAt&&(()=>{const M=bf(n.assignedAt??n.createdAt,n.startedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Started"}),c.jsx("span",{className:L.timelineValue,children:Jr(n.startedAt)}),M!==void 0&&c.jsx("span",{className:L.timelineDelta,children:M})]})})(),n.completedAt&&(()=>{const M=bf(n.startedAt,n.completedAt);return c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Completed"}),c.jsx("span",{className:L.timelineValue,children:Jr(n.completedAt)}),M!==void 0&&c.jsx("span",{className:L.timelineDelta,children:M})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&c.jsx("div",{className:L.overviewMuted,children:"No timing data"})]})]}),y&&y.costUsd>0&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Usage"}),c.jsxs("div",{className:L.timeline,children:[c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Cost"}),c.jsx("span",{className:L.timelineValue,children:Pi(y.costUsd)}),c.jsxs("span",{className:L.timelineDelta,children:[y.sessionCount," session",y.sessionCount!==1?"s":""]})]}),b&&b.costUsd>y.costUsd&&c.jsxs("div",{className:L.timelineRow,children:[c.jsx("span",{className:L.timelineKey,children:"Total (incl. subtasks)"}),c.jsx("span",{className:L.timelineValue,children:Pi(b.costUsd)}),c.jsxs("span",{className:L.timelineDelta,children:[b.sessionCount," session",b.sessionCount!==1?"s":""]})]})]})]}),n.reviewNotes&&c.jsxs("div",{className:L.overviewSection,children:[c.jsx("div",{className:L.overviewLabel,children:"Review Notes"}),c.jsx("div",{className:L.reviewNotes,children:n.reviewNotes})]})]})}function L4({task:n,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:u,onPause:d,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]}):c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:o,className:L.btnPrimary,children:"Start"}),c.jsx("button",{onClick:m,className:L.btnGhost,children:"Edit"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(n.status==="working")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:u,className:L.btnDanger,children:"Stop"}),c.jsx("button",{onClick:d,disabled:!a,className:L.btnGhost,children:"Pause"})]});if(n.status==="paused")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:u,className:L.btnPrimary,children:"Stop"}),c.jsx("button",{onClick:r,className:L.btnGhost,children:"Resume"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]});if(n.status==="complete")return c.jsx("div",{className:L.headerActions,children:c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})});if(n.status==="failed")return c.jsxs("div",{className:L.headerActions,children:[c.jsx("button",{onClick:o,className:L.btnPrimary,children:"Retry"}),c.jsx("button",{onClick:p,className:L.btnDanger,children:"Delete"})]})}function U4({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return c.jsxs("div",{className:L.attemptSelector,"data-testid":"attempt-selector",children:[c.jsx("span",{className:L.attemptLabel,children:"Attempts:"}),n.map((o,r)=>{const u=o.id===a,d=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return c.jsxs("button",{className:`${L.attemptButton} ${u?L.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&c.jsx("span",{className:L.attemptStatus,children:d})]},o.id)})]})}function ji(){const{taskId:n,workspaceId:a,environmentId:i}=as(),o=Nt(),r=Ht(),{events:u,eventsDropped:d,tasks:p,sessions:m,environments:g,loadSessionEvents:y,loadFindings:v,kill:b,startTask:S,stopTask:k,resumeTask:C,deleteTask:N,workspaces:E,taskSessions:w,loadTaskSessions:M}=Xe(),D=x.useRef(void 0),j=x.useRef(void 0),q=x.useRef(void 0),P=x.useRef(void 0),B=x.useRef(void 0),Y=o.pathname.endsWith("/stream")?"stream":o.pathname.endsWith("/findings")?"findings":"overview",[X,ae]=x.useState(Y),[te,Q]=x.useState(!1),[F,ne]=x.useState(void 0),[I,H]=x.useState(""),oe=x.useRef(Y);Y!==oe.current&&(oe.current=Y,Y!==X&&ae(Y));const G=p.find(Se=>Se.id===n),O=(G==null?void 0:G.workspaceId)||void 0,ie=E.find(Se=>Se.id===O);x.useEffect(()=>{if(I===""){if(ie!=null&&ie.environmentId)H(ie.environmentId);else if(g.length>0){const Se=g.find(ft=>ft.status==="connected");H((Se==null?void 0:Se.id)??g[0].id)}}},[I,ie==null?void 0:ie.environmentId,g]);const be=G?w[G.id]??[]:[];let re;F&&be.some(Se=>Se.id===F)?re=F:re=(G==null?void 0:G.latestSessionId)||void 0;const Fe=()=>{Q(!0)},vt=()=>{if(!G)return;N(G.id),Q(!1);const Se=i??(ie==null?void 0:ie.environmentId);r(G.workspaceId&&Se?Li(G.workspaceId,Se):"/",{replace:!0})};if((G==null?void 0:G.id)!==j.current&&(j.current=G==null?void 0:G.id,F!==void 0&&ne(void 0),I!==""&&H("")),x.useEffect(()=>{if(!(G!=null&&G.id))return;const Se=G.id!==P.current,ft=G.latestSessionId!==B.current;(Se||ft)&&(P.current=G.id,B.current=G.latestSessionId,M(G.id))},[G==null?void 0:G.id,G==null?void 0:G.latestSessionId,M]),(G==null?void 0:G.status)!==q.current){const Se=q.current===void 0;q.current=G==null?void 0:G.status;const ft=(G==null?void 0:G.status)==="not_started"?"overview":(G==null?void 0:G.status)==="working"||(G==null?void 0:G.status)==="paused"?"stream":(G==null?void 0:G.status)==="complete"?"findings":void 0;ft&&ft!==X&&!(Se&&Y!=="overview")&&ae(ft)}const fe=x.useMemo(()=>new Map(p.map(Se=>[Se.id,Se])),[p]),At=x.useMemo(()=>{const Se=re?u.filter(ft=>ft.sessionId===re):[];return Xh(Zh(Se))},[u,re]),pn=G?G.dependsOn.some(Se=>{const ft=fe.get(Se);return ft!==void 0&&ft.status!=="complete"}):!1,Dn=x.useMemo(()=>MB(n,i,E,g,fe),[n,i,E,g,fe]);x.useEffect(()=>{re&&re!==D.current&&(D.current=re,y(re))},[re,y]),x.useEffect(()=>{X==="findings"&&O&&v(O)},[X,O,v]);const In=Se=>{ae(Se),r(xa(n,Se==="overview"?void 0:Se,a,i))};return c.jsxs("div",{className:L.panelContainer,children:[c.jsx(Xi,{segments:Dn}),c.jsxs("div",{className:L.header,children:[c.jsxs("span",{className:L.headerTitle,children:[c.jsx("span",{"data-testid":"task-title",children:(G==null?void 0:G.title)||n}),G&&c.jsx("span",{className:L.taskStatusBadge,"data-testid":"task-status",children:G.status}),(G==null?void 0:G.branch)&&c.jsx("span",{className:L.taskBranch,children:G.branch}),pn&&c.jsx("span",{className:L.taskBlockedBadge,children:"blocked"})]}),G&&c.jsx(L4,{task:G,sessionId:re,isBlocked:pn,onStart:()=>S(G.id,void 0,I),onResume:()=>C(G.id),onStop:()=>k(G.id),onPause:()=>re&&b(re),onDelete:Fe,onEdit:()=>r(nC(G.id,a,i))})]}),c.jsxs("div",{className:L.tabBar,role:"tablist","aria-label":"Task view",children:[c.jsx("button",{role:"tab","aria-selected":X==="overview",className:`${L.tab} ${X==="overview"?L.active:""}`,onClick:()=>In("overview"),children:"Overview"}),c.jsx("button",{role:"tab","aria-selected":X==="stream",className:`${L.tab} ${X==="stream"?L.active:""}`,onClick:()=>In("stream"),children:"Stream"}),c.jsx("button",{role:"tab","aria-selected":X==="findings",className:`${L.tab} ${X==="findings"?L.active:""}`,onClick:()=>In("findings"),children:"Findings"})]}),c.jsxs(Xn,{mode:"wait",children:[X==="overview"&&c.jsx(kt.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:G?c.jsx(I4,{task:G,tasksById:fe,environments:g,workspaces:E,taskSessions:be,selectedEnvId:I}):c.jsx("div",{className:L.waitingMessage,children:"No additional details"})},"overview"),X==="stream"&&c.jsxs(kt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[c.jsx(U4,{taskSessions:be,selectedSessionId:re,onSelect:Se=>ne(Se)}),c.jsx(Yh,{events:At,eventsDropped:d,emptyState:!re&&G?c.jsxs("div",{className:L.emptyCta,children:[c.jsx("button",{className:L.ctaButton,onClick:()=>S(G.id,void 0,I),children:"Start Task"}),c.jsx("div",{className:L.ctaDescription,children:"Click to begin agent execution"})]}):re&&At.length===0?c.jsx("div",{className:L.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),X==="findings"&&c.jsx(kt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:L.tabContent,children:O?c.jsx(O4,{workspaceId:O}):c.jsx("div",{className:L.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!G||G.status!=="working"&&G.status!=="paused")return;const Se=re?m.find(ft=>ft.id===re):void 0;if(!(!Se||["completed","failed","interrupted","hibernating"].includes(Se.status)))return c.jsx(yl,{mode:"send",sessionId:Se.id,environmentId:Se.environmentId})})(),G&&c.jsx(Rc,{isOpen:te,title:"Delete Task?",description:`"${G.title}" will be permanently removed.`,onConfirm:vt,onCancel:()=>Q(!1)})]})}const z4="_container_legrg_1",V4="_header_legrg_8",H4="_headerTitle_legrg_35",P4="_badge_legrg_44",G4="_headerActions_legrg_54",$4="_body_legrg_61",F4="_formContent_legrg_73",q4="_section_legrg_85",K4="_label_legrg_91",Y4="_nameInput_legrg_98",Z4="_fieldInput_legrg_131",X4="_adapterSelect_legrg_164",Q4="_readOnlyValue_legrg_198",W4="_codespaceSection_legrg_204",J4="_codespaceActions_legrg_210",eI="_creatingHint_legrg_216",tI="_errorHint_legrg_222",nI="_btnPrimary_legrg_235",aI="_btnGhost_legrg_266",se={container:z4,header:V4,headerTitle:H4,badge:P4,headerActions:G4,body:$4,formContent:F4,section:q4,label:K4,nameInput:Y4,fieldInput:Z4,adapterSelect:X4,readOnlyValue:Q4,codespaceSection:W4,codespaceActions:J4,creatingHint:eI,errorHint:tI,btnPrimary:nI,btnGhost:aI},oc=1,lc=65535;function xf(n){if(!n.trim())return!0;const a=Number(n);return Number.isInteger(a)&&a>=oc&&a<=lc}function _f(n){try{const a=JSON.parse(n);if(typeof a=="object"&&a!==null&&!Array.isArray(a))return a}catch{}return{}}function sI({codespaceName:n,onCodespaceNameChange:a,envName:i,onEnvNameChange:o}){const{codespaces:r,codespaceError:u,codespaceListError:d,codespaceCreating:p,createCodespace:m}=Xe(),[g,y]=x.useState("pick"),[v,b]=x.useState(""),[S,k]=x.useState("");return g==="create"?c.jsxs("div",{className:se.codespaceSection,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repository"}),c.jsx("input",{type:"text",value:v,onChange:C=>b(C.target.value),placeholder:"owner/repo",className:se.fieldInput,"data-testid":"env-codespace-repo"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Machine Type"}),c.jsx("input",{type:"text",value:S,onChange:C=>k(C.target.value),placeholder:"Machine type (optional)...",className:se.fieldInput,"data-testid":"env-codespace-machine"})]}),c.jsxs("div",{className:se.codespaceActions,children:[c.jsx("button",{onClick:()=>{v.trim()&&(m(v.trim(),S.trim()||void 0),y("pick"),b(""),k(""))},disabled:!v.trim(),className:se.btnPrimary,children:"Create"}),c.jsx("button",{onClick:()=>{y("pick"),b(""),k("")},className:se.btnGhost,children:"Cancel"})]})]}):c.jsx("div",{className:se.codespaceSection,children:c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace"}),!d&&c.jsxs("select",{value:n,onChange:C=>{C.target.value==="__create__"?(y("create"),a("")):(a(C.target.value),C.target.value&&!i.trim()&&o(C.target.value))},disabled:p,className:se.adapterSelect,"data-testid":"env-codespace-select",children:[c.jsx("option",{value:"",children:"Select a codespace..."}),r.map(C=>c.jsxs("option",{value:C.name,children:[C.name," (",C.repository,") — ",C.state]},C.name)),c.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&c.jsx("span",{className:se.creatingHint,children:"Creating codespace..."}),d&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:se.errorHint,children:d}),c.jsx("input",{type:"text",value:n,onChange:C=>a(C.target.value),placeholder:"Or enter codespace name manually...",className:se.fieldInput,"data-testid":"env-codespace-manual"})]}),u&&!d&&c.jsx("span",{className:se.errorHint,children:u})]})})}function D_({mode:n,environmentId:a}){const{environments:i,addEnvironment:o,updateEnvironment:r,listCodespaces:u}=Xe(),{showToast:d}=qi(),p=Ht(),m=n==="edit",g=m&&a?i.find(O=>O.id===a):void 0,[y,v]=x.useState(""),[b,S]=x.useState("local"),[k,C]=x.useState(""),[N,E]=x.useState(""),[w,M]=x.useState(""),[D,j]=x.useState(""),[q,P]=x.useState(""),[B,Y]=x.useState(""),[X,ae]=x.useState(""),[te,Q]=x.useState(null),F=x.useCallback(()=>{const O={};if(b==="local"){if(k.trim()&&(O.host=k.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.port=ie)}}else if(b==="ssh"){if(O.host=k.trim(),w.trim()&&(O.user=w.trim()),N.trim()){const ie=Number(N);Number.isInteger(ie)&&(O.sshPort=ie)}D.trim()&&(O.identityFile=D.trim())}else b==="docker"?(q.trim()&&(O.image=q.trim()),B.trim()&&(O.repo=B.trim())):b==="codespace"&&(O.codespaceName=X.trim());return O},[b,k,N,w,D,q,B,X]),ne=()=>!(!y.trim()||b==="ssh"&&!k.trim()||b==="codespace"&&!X.trim()||(b==="local"||b==="ssh")&&!xf(N)),I=()=>{ne()&&(o(y.trim(),b,F()),d("Environment added successfully","success"),p(Ui,{replace:!0}))},H=()=>{p(a?fl(a):Ui)},oe=x.useCallback((O,ie)=>{if(!g||!a)return;const be=_f(g.adapterConfig),re=ie.trim();re?be[O]=re:delete be[O],r(a,{adapterConfig:be})},[g,a,r]),G=x.useCallback((O,ie)=>{if(!g||!a)return;const be=_f(g.adapterConfig);if(ie.trim()){const re=Number(ie);Number.isInteger(re)&&re>=oc&&re<=lc&&(be[O]=re)}else delete be[O];r(a,{adapterConfig:be})},[g,a,r]);if(m){if(!g)return c.jsxs("div",{className:se.container,children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:H,className:se.btnGhost,children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsx("div",{className:se.formContent,children:c.jsx("span",{className:se.readOnlyValue,children:"Environment not found"})})})]});const O=_f(g.adapterConfig);return c.jsxs("div",{className:se.container,"data-testid":"env-edit-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"edit environment"})}),c.jsx("div",{className:se.headerActions,children:c.jsx("button",{onClick:H,className:se.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Name"}),c.jsx(cn,{value:g.displayName,onSave:ie=>{a&&r(a,{displayName:ie})},validate:ie=>ie.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:te,onActivate:Q,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Adapter Type"}),c.jsx("span",{className:se.readOnlyValue,"data-testid":"env-edit-adapter-type",children:g.adapterType})]}),g.adapterType==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(cn,{value:String(O.host??""),onSave:ie=>oe("host",ie),mode:"edit",fieldId:"host",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Port"}),c.jsx(cn,{value:String(O.port??""),onSave:ie=>G("port",ie),validate:ie=>xf(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),g.adapterType==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Host"}),c.jsx(cn,{value:String(O.host??""),onSave:ie=>oe("host",ie),validate:ie=>ie.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:te,onActivate:Q,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"User"}),c.jsx(cn,{value:String(O.user??""),onSave:ie=>oe("user",ie),mode:"edit",fieldId:"user",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"SSH Port"}),c.jsx(cn,{value:String(O.sshPort??""),onSave:ie=>G("sshPort",ie),validate:ie=>xf(ie)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:te,onActivate:Q,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Identity File"}),c.jsx(cn,{value:String(O.identityFile??""),onSave:ie=>oe("identityFile",ie),mode:"edit",fieldId:"identityFile",activeFieldId:te,onActivate:Q,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),g.adapterType==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Image"}),c.jsx(cn,{value:String(O.image??""),onSave:ie=>oe("image",ie),mode:"edit",fieldId:"image",activeFieldId:te,onActivate:Q,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Repo"}),c.jsx(cn,{value:String(O.repo??""),onSave:ie=>oe("repo",ie),mode:"edit",fieldId:"repo",activeFieldId:te,onActivate:Q,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),g.adapterType==="codespace"&&c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,children:"Codespace Name"}),c.jsx(cn,{value:String(O.codespaceName??""),onSave:ie=>oe("codespaceName",ie),validate:ie=>ie.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:te,onActivate:Q,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return c.jsxs("div",{className:se.container,"data-testid":"env-create-panel",children:[c.jsxs("div",{className:se.header,children:[c.jsx("div",{className:se.headerTitle,children:c.jsx("span",{className:se.badge,children:"new environment"})}),c.jsxs("div",{className:se.headerActions,children:[c.jsx("button",{onClick:I,disabled:!ne(),className:se.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),c.jsx("button",{onClick:H,className:se.btnGhost,children:"Cancel"})]})]}),c.jsx("div",{className:se.body,children:c.jsxs("div",{className:se.formContent,children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-name",children:"Name"}),c.jsx("input",{id:"env-create-name",type:"text",value:y,onChange:O=>v(O.target.value),placeholder:"Environment name...",autoFocus:!0,className:se.nameInput,"data-testid":"env-create-name",onKeyDown:O=>{O.key==="Enter"&&ne()&&I()}})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),c.jsxs("select",{id:"env-create-adapter",value:b,onChange:O=>{S(O.target.value),O.target.value==="codespace"&&u()},className:se.adapterSelect,"data-testid":"env-create-adapter",children:[c.jsx("option",{value:"local",children:"local"}),c.jsx("option",{value:"ssh",children:"ssh"}),c.jsx("option",{value:"docker",children:"docker"}),c.jsx("option",{value:"codespace",children:"codespace"})]})]}),b==="local"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Host (optional)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:oc,max:lc,value:N,onChange:O=>E(O.target.value),placeholder:"Port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]})]}),b==="ssh"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-host",children:"Host"}),c.jsx("input",{id:"env-create-host",type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Host (required)...",className:se.fieldInput,"data-testid":"env-create-host"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-user",children:"User"}),c.jsx("input",{id:"env-create-user",type:"text",value:w,onChange:O=>M(O.target.value),placeholder:"User (optional)...",className:se.fieldInput,"data-testid":"env-create-user"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-port",children:"SSH Port"}),c.jsx("input",{id:"env-create-port",type:"number",min:oc,max:lc,value:N,onChange:O=>E(O.target.value),placeholder:"SSH port (optional)...",className:se.fieldInput,"data-testid":"env-create-port"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-identity",children:"Identity File"}),c.jsx("input",{id:"env-create-identity",type:"text",value:D,onChange:O=>j(O.target.value),placeholder:"Identity file (optional)...",className:se.fieldInput,"data-testid":"env-create-identity"})]})]}),b==="docker"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-image",children:"Image"}),c.jsx("input",{id:"env-create-image",type:"text",value:q,onChange:O=>P(O.target.value),placeholder:"Image (optional)...",className:se.fieldInput,"data-testid":"env-create-image"})]}),c.jsxs("div",{className:se.section,children:[c.jsx("label",{className:se.label,htmlFor:"env-create-repo",children:"Repo"}),c.jsx("input",{id:"env-create-repo",type:"text",value:B,onChange:O=>Y(O.target.value),placeholder:"Repo (optional)...",className:se.fieldInput,"data-testid":"env-create-repo"})]})]}),b==="codespace"&&c.jsx(sI,{codespaceName:X,onCodespaceNameChange:ae,envName:y,onEnvNameChange:v})]})})]})}function iI(){return c.jsx(D_,{mode:"new"})}function oI(){const{environmentId:n}=as();return c.jsx(D_,{mode:"edit",environmentId:n})}const lI="_layout_11u79_1",rI="_content_11u79_8",cI="_tabPanel_11u79_14",rl={layout:lI,content:rI,tabPanel:cI};function uI(){const n=wB();return c.jsxs("div",{className:rl.layout,children:[c.jsx(Xi,{segments:n}),c.jsx("div",{className:rl.content,children:c.jsx(Bs,{})})]})}const dI="_container_13sb6_1",fI="_envHeader_13sb6_6",hI="_envTitleRow_13sb6_10",pI="_statusDot_13sb6_16",mI="_envName_13sb6_21",gI="_statusBadge_13sb6_27",vI="_envMeta_13sb6_33",yI="_metaTag_13sb6_39",bI="_actions_13sb6_51",xI="_provisionMessage_13sb6_59",_I="_errorMessage_13sb6_64",SI="_section_13sb6_69",TI="_sectionHeader_13sb6_73",kI="_createForm_13sb6_85",CI="_createInput_13sb6_92",EI="_cardList_13sb6_121",NI="_card_13sb6_121",wI="_cardHeader_13sb6_138",jI="_cardName_13sb6_144",AI="_cardActions_13sb6_149",DI="_cardDescription_13sb6_154",MI="_cardMeta_13sb6_160",RI="_repoLink_13sb6_166",OI="_empty_13sb6_174",BI="_btnPrimary_13sb6_180",II="_btnOutline_13sb6_214",LI="_btnSmall_13sb6_241",UI="_btnDanger_13sb6_267",we={container:dI,envHeader:fI,envTitleRow:hI,statusDot:pI,envName:mI,statusBadge:gI,envMeta:vI,metaTag:yI,actions:bI,provisionMessage:xI,errorMessage:_I,section:SI,sectionHeader:TI,createForm:kI,createInput:CI,cardList:EI,card:NI,cardHeader:wI,cardName:jI,cardActions:AI,cardDescription:DI,cardMeta:MI,repoLink:RI,empty:OI,btnPrimary:BI,btnOutline:II,btnSmall:LI,btnDanger:UI},zI={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function VI(){const{environmentId:n}=as(),a=Ht(),{environments:i,workspaces:o,sessions:r,provisionStatus:u,provisionEnvironment:d,stopEnvironment:p,removeEnvironment:m,createWorkspace:g,archiveWorkspace:y,workspaceCreating:v}=Xe(),[b,S]=x.useState(!1),[k,C]=x.useState(void 0),[N,E]=x.useState(!1),[w,M]=x.useState(""),D=i.find(H=>H.id===n);if(!n||!D)return c.jsx(Gn,{to:Ui,replace:!0});const j=o.filter(H=>H.environmentId===D.id),q=r.filter(H=>H.environmentId===D.id),P=q.reduce((H,oe)=>H+(oe.costUsd??0),0),B=zI[D.status]||"var(--text-tertiary)",Y=D.status==="connected",X=D.status==="connecting",ae=D.status==="disconnected"||D.status==="error",te=D.id in u?u[D.id]:void 0,Q=()=>{m(D.id),S(!1),a(Ui,{replace:!0})},F=()=>{!w.trim()||v||(g(w.trim(),void 0,void 0,D.id),M(""),E(!1))},ne=H=>{H.key==="Enter"?F():H.key==="Escape"&&(E(!1),M(""))},I=H=>{y(H),C(void 0)};return c.jsxs("div",{className:we.container,children:[c.jsx(Rc,{isOpen:b,title:"Delete Environment?",description:`"${D.displayName||D.id}" will be permanently removed along with all its data.`,onConfirm:Q,onCancel:()=>S(!1)}),c.jsxs("div",{className:we.envHeader,children:[c.jsxs("div",{className:we.envTitleRow,children:[c.jsx("span",{className:we.statusDot,style:{color:B},children:"●"}),c.jsx("h2",{className:we.envName,children:D.displayName||D.id}),c.jsx("span",{className:we.statusBadge,style:{color:B},children:D.status})]}),c.jsxs("div",{className:we.envMeta,children:[c.jsxs("span",{className:we.metaTag,children:["Adapter: ",D.adapterType]}),q.length>0&&c.jsxs("span",{className:we.metaTag,children:[q.length," session",q.length!==1?"s":""]}),P>0&&c.jsxs("span",{className:we.metaTag,children:["Cost: ",Pi(P)]})]})]}),c.jsxs("div",{className:we.actions,children:[Y&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:we.btnPrimary,onClick:()=>a(xb(D.id)),children:"New Chat"}),c.jsx("button",{className:we.btnOutline,onClick:()=>p(D.id),children:"Stop"})]}),ae&&c.jsx("button",{className:we.btnPrimary,onClick:()=>d(D.id),children:D.status==="error"?"Retry":"Connect"}),X&&te!==void 0&&c.jsx("span",{className:we.provisionMessage,children:te.message}),D.status==="error"&&(te==null?void 0:te.stage)==="error"&&c.jsx("span",{className:we.errorMessage,children:te.message}),c.jsx("button",{className:we.btnOutline,onClick:()=>a(sC(D.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),c.jsx("button",{className:we.btnDanger,onClick:()=>S(!0),children:"Delete"})]}),c.jsxs("div",{className:we.section,children:[c.jsxs("div",{className:we.sectionHeader,children:[c.jsx("h3",{children:"Workspaces"}),c.jsx("button",{className:we.btnPrimary,onClick:()=>E(!0),disabled:v,children:"+ New Workspace"})]}),N&&c.jsxs("div",{className:we.createForm,children:[c.jsx("input",{type:"text",value:w,onChange:H=>M(H.target.value),onKeyDown:ne,placeholder:"Workspace name...",autoFocus:!0,disabled:v,className:we.createInput,"data-testid":"workspace-create-input"}),c.jsx("button",{onClick:F,className:we.btnPrimary,disabled:v||!w.trim(),"data-testid":"workspace-create-submit",children:v?c.jsx(Kh,{size:"sm",label:"Creating"}):"Create"}),c.jsx("button",{onClick:()=>{E(!1),M("")},className:we.btnOutline,children:"Cancel"})]}),j.length===0&&!N&&c.jsx("p",{className:we.empty,children:"No workspaces yet. Create one to get started."}),c.jsx("div",{className:we.cardList,children:j.map(H=>c.jsx(HI,{workspace:H,confirmArchiveId:k,onOpen:()=>a(Li(H.id,D.id)),onArchive:()=>C(H.id),onConfirmArchive:()=>I(H.id),onCancelArchive:()=>C(void 0)},H.id))})]})]})}function HI({workspace:n,confirmArchiveId:a,onOpen:i,onArchive:o,onConfirmArchive:r,onCancelArchive:u}){const d=a===n.id,p=n.repoUrl&&/^https?:\/\//.test(n.repoUrl);return c.jsxs("div",{className:we.card,"data-testid":"workspace-card",children:[c.jsxs("div",{className:we.cardHeader,children:[c.jsx("strong",{className:we.cardName,children:n.name}),c.jsxs("div",{className:we.cardActions,children:[c.jsx("button",{className:we.btnSmall,onClick:i,children:"Open"}),d?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:we.btnDanger,onClick:r,children:"Confirm"}),c.jsx("button",{className:we.btnSmall,onClick:u,children:"Cancel"})]}):c.jsx("button",{className:we.btnSmall,onClick:o,children:"Archive"})]})]}),n.description&&c.jsx("p",{className:we.cardDescription,children:n.description}),n.repoUrl&&c.jsx("div",{className:we.cardMeta,children:p?c.jsx("a",{href:n.repoUrl,target:"_blank",rel:"noopener noreferrer",className:we.repoLink,children:n.repoUrl}):c.jsx("span",{children:n.repoUrl})})]})}const PI={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function GI(){const a=Nt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=PI[a],o=NB(i);return c.jsxs("div",{className:rl.layout,children:[c.jsx(Xi,{segments:o}),c.jsx("div",{className:rl.content,children:c.jsx("div",{className:rl.tabPanel,children:c.jsx(Bs,{})},a)})]})}const $I="_section_1ingb_14",FI="_sectionTitle_1ingb_26",qI="_sectionDescription_1ingb_35",KI="_tokenList_1ingb_48",YI="_tokenRow_1ingb_55",ZI="_tokenBadge_1ingb_68",XI="_tokenName_1ingb_83",QI="_tokenTarget_1ingb_90",WI="_deleteButton_1ingb_99",JI="_addForm_1ingb_113",e5="_formRow_1ingb_119",t5="_input_1ingb_125",n5="_select_1ingb_155",a5="_addButton_1ingb_187",s5="_emptyStateInfo_1ingb_221",i5="_themeOptions_1ingb_229",o5="_themeOption_1ingb_229",l5="_themeOptionSelected_1ingb_254",r5="_themeOptionHeader_1ingb_259",c5="_themeOptionLabel_1ingb_266",u5="_themeOptionDesc_1ingb_273",d5="_variantToggle_1ingb_279",f5="_variantButton_1ingb_286",h5="_variantActive_1ingb_305",p5="_themeSwatches_1ingb_311",m5="_themeSwatch_1ingb_311",g5="_systemToggle_1ingb_325",v5="_systemToggleHint_1ingb_341",y5="_themeActive_1ingb_348",b5="_aboutGrid_1ingb_354",x5="_aboutItem_1ingb_360",_5="_aboutLabel_1ingb_373",S5="_aboutValue_1ingb_379",T5="_aboutDot_1ingb_387",k5="_aboutDotConnected_1ingb_394",C5="_aboutDotDisconnected_1ingb_398",de={section:$I,sectionTitle:FI,sectionDescription:qI,tokenList:KI,tokenRow:YI,tokenBadge:ZI,tokenName:XI,tokenTarget:QI,deleteButton:WI,addForm:JI,formRow:e5,input:t5,select:n5,addButton:a5,emptyStateInfo:s5,themeOptions:i5,themeOption:o5,themeOptionSelected:l5,themeOptionHeader:r5,themeOptionLabel:c5,themeOptionDesc:u5,variantToggle:d5,variantButton:f5,variantActive:h5,themeSwatches:p5,themeSwatch:m5,systemToggle:g5,systemToggleHint:v5,themeActive:y5,aboutGrid:b5,aboutItem:x5,aboutLabel:_5,aboutValue:S5,aboutDot:T5,aboutDotConnected:k5,aboutDotDisconnected:C5},E5=[{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 N5(){const{credentialProviders:n,updateCredentialProviders:a}=Xe(),i=(o,r)=>{const u={...n};o==="claude"?u.claude=r:u[o]=r,a(u)};return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Credential Providers"}),c.jsx("p",{className:de.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),c.jsx("div",{className:de.tokenList,children:E5.map(o=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenName,children:o.label}),c.jsx("span",{className:de.tokenTarget,children:o.description}),c.jsx("select",{className:de.select,value:n[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>c.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const w5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function j5(){const{tokens:n,setToken:a,deleteToken:i}=Xe(),{showToast:o}=qi(),[r,u]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState("env_var"),[y,v]=x.useState(""),[b,S]=x.useState(null),k=E=>{if(E.preventDefault(),!r||!d)return;const w=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,d,m,w,m==="file"?y:""),o("Token saved successfully","success"),u(""),p(""),v("")},C=E=>{S(E)},N=()=>{b&&(i(b),o("Token deleted","info")),S(null)};return c.jsxs(c.Fragment,{children:[c.jsx(Rc,{isOpen:b!==null,title:"Delete Token?",description:b?`"${b}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Tokens"}),c.jsx("p",{className:de.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?c.jsx("div",{className:de.emptyStateInfo,children:"Add your first API token to enable service integrations."}):c.jsx("div",{className:de.tokenList,children:n.map(E=>c.jsxs("div",{className:de.tokenRow,children:[c.jsx("span",{className:de.tokenBadge,children:E.tokenType}),c.jsx("span",{className:de.tokenName,children:E.name}),c.jsx("span",{className:de.tokenTarget,children:E.tokenType==="env_var"?E.envVar:E.filePath}),c.jsx("button",{className:de.deleteButton,onClick:()=>C(E.name),title:`Delete ${E.name}`,children:"×"})]},E.name))}),c.jsxs("form",{className:de.addForm,onSubmit:k,children:[c.jsxs("div",{className:de.formRow,children:[c.jsx("input",{className:de.input,type:"text",placeholder:"Token name",value:r,onChange:E=>u(E.target.value)}),c.jsx("input",{className:de.input,type:"password",placeholder:"Value",value:d,onChange:E=>p(E.target.value)})]}),c.jsxs("div",{className:de.formRow,children:[c.jsx("select",{className:de.select,value:m,onChange:E=>g(E.target.value),children:w5.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx("input",{className:de.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:E=>v(E.target.value)}),c.jsx("button",{className:de.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function A5(){return c.jsxs(c.Fragment,{children:[c.jsx(N5,{}),c.jsx(j5,{})]})}const D5="_container_xb7ms_1",M5="_header_xb7ms_7",R5="_form_xb7ms_19",O5="_formActions_xb7ms_87",B5="_list_xb7ms_93",I5="_card_xb7ms_99",L5="_active_xb7ms_109",U5="_cardHeader_xb7ms_113",z5="_cardTitle_xb7ms_123",V5="_defaultBadge_xb7ms_129",H5="_cardActions_xb7ms_143",P5="_description_xb7ms_148",G5="_meta_xb7ms_154",$5="_promptDetails_xb7ms_171",F5="_promptText_xb7ms_183",q5="_empty_xb7ms_200",K5="_btnPrimary_xb7ms_206",Y5="_btnSecondary_xb7ms_240",Z5="_btnSmall_xb7ms_267",X5="_btnDanger_xb7ms_293",Q5="_typeToggle_xb7ms_336",W5="_typeBadge_xb7ms_350",J5="_scriptEditor_xb7ms_364",eL="_optional_xb7ms_371",He={container:D5,header:M5,form:R5,formActions:O5,list:B5,card:I5,active:L5,cardHeader:U5,cardTitle:z5,defaultBadge:V5,cardActions:H5,description:P5,meta:G5,promptDetails:$5,promptText:F5,empty:q5,btnPrimary:K5,btnSecondary:Y5,btnSmall:Z5,btnDanger:X5,typeToggle:Q5,typeBadge:W5,scriptEditor:J5,optional:eL};function tL(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:o,appDefaultPersonaId:r,setAppDefaultPersonaId:u}=Xe(),[d,p]=x.useState(null),[m,g]=x.useState(!1),[y,v]=x.useState(null),[b,S]=x.useState(""),[k,C]=x.useState(""),[N,E]=x.useState(""),[w,M]=x.useState("claude-code"),[D,j]=x.useState("sonnet"),[q,P]=x.useState(0),[B,Y]=x.useState("agent"),[X,ae]=x.useState(""),te=()=>{S(""),C(""),E(""),M("claude-code"),j("sonnet"),P(0),Y("agent"),ae("")},Q=()=>{te(),p(null),g(!0)},F=O=>{S(O.name),C(O.description),E(O.systemPrompt);const ie=O.type==="script"?"script":"agent";M(ie==="script"?O.runtime||"genaiscript":O.runtime),j(O.model),P(O.maxTurns),Y(ie),ae(O.script||""),p(O),g(!1)},ne=O=>{Y(O),O==="script"?M("genaiscript"):w==="genaiscript"&&M("claude-code")},I=O=>{if(O.preventDefault(),!!b.trim()){if(B==="script"){if(!X.trim())return}else if(!N.trim()||!w||!D)return;d?(i(d.id,b,k,N,w,D,q,B,X),p(null)):(a(b,k,N,w,D,q,B,X),g(!1)),te()}},H=O=>{o(O),v(null),(d==null?void 0:d.id)===O&&(p(null),te())},oe=()=>{p(null),g(!1),te()},G=()=>c.jsxs("form",{onSubmit:I,className:He.form,children:[c.jsx("h3",{children:d?"Edit Persona":"Create Persona"}),c.jsxs("div",{className:He.typeToggle,"data-testid":"persona-type-toggle",children:[c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:B==="agent",onChange:()=>ne("agent")}),"Agent"]}),c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:"personaType",value:"script",checked:B==="script",onChange:()=>ne("script")}),"Script"]})]}),c.jsxs("label",{children:["Name",c.jsx("input",{type:"text",value:b,onChange:O=>S(O.target.value),placeholder:B==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),c.jsxs("label",{children:["Description",c.jsx("input",{type:"text",value:k,onChange:O=>C(O.target.value),placeholder:"Brief description..."})]}),c.jsxs("label",{children:["Runtime",c.jsx("select",{value:w,onChange:O=>M(O.target.value),"data-testid":"persona-runtime-select",children:B==="script"?c.jsx("option",{value:"genaiscript",children:"genaiscript"}):c.jsxs(c.Fragment,{children:[c.jsx("option",{value:"claude-code",children:"claude-code"}),c.jsx("option",{value:"codex",children:"codex"}),c.jsx("option",{value:"copilot",children:"copilot"}),c.jsx("option",{value:"goose",children:"goose"}),c.jsx("option",{value:"stub",children:"stub"}),c.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),c.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),c.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),B==="agent"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model",c.jsx("input",{type:"text",value:D,onChange:O=>j(O.target.value),placeholder:"e.g. sonnet"})]}),c.jsxs("label",{children:["Max Turns",c.jsx("input",{type:"number",value:q,onChange:O=>P(parseInt(O.target.value,10)||0),min:0})]}),c.jsxs("label",{children:["System Prompt",c.jsx("textarea",{value:N,onChange:O=>E(O.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),B==="script"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Model ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("input",{type:"text",value:D,onChange:O=>j(O.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),c.jsxs("label",{children:["System Prompt ",c.jsx("span",{className:He.optional,children:"(optional)"}),c.jsx("textarea",{value:N,onChange:O=>E(O.target.value),placeholder:"Optional context for the script...",rows:4})]}),c.jsxs("label",{children:["Script",c.jsx("textarea",{value:X,onChange:O=>ae(O.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:He.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:He.formActions,children:[c.jsx("button",{type:"submit",className:He.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:oe,className:He.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:He.container,children:[c.jsxs("div",{className:He.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:Q,className:He.btnPrimary,children:"+ New Persona"})]}),(m||d)&&G(),n.length===0&&!m?c.jsx("p",{className:He.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:He.list,children:n.map(O=>{const ie=r===O.id,be=O.type==="script";return c.jsxs("div",{className:`${He.card} ${(d==null?void 0:d.id)===O.id?He.active:""}`,"data-testid":`persona-card-${O.id}`,children:[c.jsxs("div",{className:He.cardHeader,children:[c.jsxs("span",{className:He.cardTitle,children:[c.jsx("strong",{children:O.name}),c.jsx("span",{className:He.typeBadge,"data-testid":`persona-type-badge-${O.id}`,children:be?"Script":"Agent"}),ie&&c.jsx("span",{className:He.defaultBadge,"data-testid":`persona-default-badge-${O.id}`,children:"App Default"})]}),c.jsxs("div",{className:He.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>u(O.id),className:He.btnSmall,"data-testid":`persona-set-default-${O.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>F(O),className:He.btnSmall,children:"Edit"}),y===O.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>H(O.id),className:He.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>v(null),className:He.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>v(O.id),className:He.btnSmall,children:"Delete"})]})]}),O.description&&c.jsx("p",{className:He.description,children:O.description}),c.jsxs("div",{className:He.meta,children:[O.runtime&&c.jsxs("span",{children:["Runtime: ",O.runtime]}),O.model&&c.jsxs("span",{children:["Model: ",O.model]}),O.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",O.maxTurns]})]}),be?c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:He.promptText,children:O.script})]}):c.jsxs("details",{className:He.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:He.promptText,children:O.systemPrompt})]})]},O.id)})})]})}function nL(){return c.jsx(tL,{})}function aL(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=wb();return c.jsxs("section",{className:de.section,children:[c.jsx("h3",{className:de.sectionTitle,children:"Appearance"}),c.jsx("p",{className:de.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:de.themeOptions,children:Cc.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${de.themeOption} ${p?de.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:de.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:de.themeOptionLabel,children:u.label}),c.jsx("span",{className:de.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:de.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${de.variantButton} ${p&&!m?de.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:de.themeSwatches,children:u.swatches.map((g,y)=>c.jsx("span",{className:de.themeSwatch,style:{background:g}},y))})]},u.id)})}),c.jsxs("label",{className:de.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:de.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:de.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function sL(){return c.jsx(aL,{})}function iL(){const{connected:n,environments:a,sessions:i}=Xe(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:de.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:de.sectionTitle,children:"About"}),c.jsx("p",{className:de.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:de.aboutGrid,children:[c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Connection"}),c.jsxs("span",{className:de.aboutValue,children:[c.jsx("span",{className:`${de.aboutDot} ${n?de.aboutDotConnected:de.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Environments"}),c.jsxs("span",{className:de.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:de.aboutValue,children:u})]}),c.jsxs("div",{className:de.aboutItem,children:[c.jsx("span",{className:de.aboutLabel,children:"Version"}),c.jsx("span",{className:de.aboutValue,children:"0.71.0"})]})]})]})}function oL(){return c.jsx(iL,{})}const lL="_wizard_1260s_1",rL="_container_1260s_10",cL="_stepContent_1260s_19",uL="_logoArea_1260s_28",dL="_logoImage_1260s_32",fL="_heading_1260s_41",hL="_tagline_1260s_49",pL="_subtitle_1260s_56",mL="_featureList_1260s_64",gL="_runtimeGrid_1260s_89",vL="_runtimeCard_1260s_101",yL="_runtimeName_1260s_133",bL="_runtimeDescription_1260s_139",xL="_buttonRow_1260s_144",_L="_primaryButton_1260s_151",SL="_ghostButton_1260s_185",TL="_dots_1260s_213",kL="_dot_1260s_213",et={wizard:lL,container:rL,stepContent:cL,logoArea:uL,logoImage:dL,heading:fL,tagline:hL,subtitle:pL,featureList:mL,runtimeGrid:gL,runtimeCard:vL,runtimeName:yL,runtimeDescription:bL,buttonRow:xL,primaryButton:_L,ghostButton:SL,dots:TL,dot:kL};function CL({onNext:n}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:et.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:et.logoImage})}),c.jsx("h1",{className:et.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:et.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function EL({onNext:n,onBack:a}){return c.jsxs("div",{className:et.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:et.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:et.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const NL=[{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 wL({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=x.useState(n||"claude-code");return x.useEffect(()=>{n&&u(n)},[n]),c.jsxs("div",{className:et.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:et.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:et.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:et.runtimeGrid,children:NL.map(d=>c.jsxs("button",{type:"button",className:et.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:et.runtimeName,children:d.name}),c.jsx("span",{className:et.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:et.buttonRow,children:[c.jsx("button",{type:"button",className:et.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:et.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const jL=3,J0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function AL(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=Xe(),r=Ht(),[u,d]=x.useState(0),p=n.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const v=J0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===R0);if(y&&g!==y.runtime){const v=J0[g]??"sonnet";a(R0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return o===!0?c.jsx(Gn,{to:"/",replace:!0}):c.jsx("div",{className:et.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:et.container,children:[c.jsx(Xn,{mode:"wait",children:c.jsxs(kt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(CL,{onNext:()=>d(1)}),u===1&&c.jsx(EL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(wL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:et.dots,children:Array.from({length:jL},(g,y)=>c.jsx("span",{className:et.dot,"data-active":y===u},y))})]})})}const DL="_root_zndgp_1",ML="_body_zndgp_7",RL="_main_zndgp_19",OL="_sidebarWrapper_zndgp_26",BL="_overlay_zndgp_51",tl={root:DL,body:ML,main:RL,sidebarWrapper:OL,overlay:BL},IL=x.lazy(()=>cT(()=>import("./KnowledgePage-B96DoL0R.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.KnowledgePage}))),LL=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function UL(){const n=Nt(),i=Db()!==void 0,[o,r]=x.useState(!1),u=x.useCallback(()=>r(d=>!d),[]);return x.useEffect(()=>{r(!1)},[n.pathname]),x.useEffect(()=>{if(!o)return;const d=p=>{p.key==="Escape"&&r(!1)};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[o]),c.jsxs(c.Fragment,{children:[c.jsx(XC,{onToggleSidebar:i?u:void 0,sidebarOpen:o}),c.jsx(aE,{}),c.jsxs("div",{className:tl.body,children:[i&&c.jsx("div",{className:tl.sidebarWrapper,"data-sidebar-open":o,children:c.jsx(dE,{})}),i&&o&&c.jsx("div",{className:tl.overlay,"data-testid":"drawer-overlay",onClick:()=>r(!1)}),c.jsxs("div",{className:tl.main,children:[c.jsx(Bs,{}),c.jsx(YD,{})]})]}),c.jsx(lM,{})]})}function zL(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:o}=Xe(),{showToast:r}=qi();TR(a,r);const u=Ht(),d=Nt();return x.useEffect(()=>{n&&!d.pathname.includes("/tasks/")&&u(bb(n),{replace:!0})},[n,u,d.pathname]),i&&o===!1?c.jsx(Gn,{to:"/setup",replace:!0}):c.jsx(sE,{children:c.jsx("div",{className:tl.root,children:c.jsx(UL,{})})})}function Sf(){const{workspaceId:n}=as(),{workspaces:a}=Xe(),i=Nt(),o=a.find(m=>m.id===n);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx(Gn,{to:"/environments",replace:!0});const r=encodeURIComponent(n),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx(Gn,{to:p,replace:!0})}function VL(){return c.jsxs(_k,{children:[c.jsx(ke,{path:"setup",element:c.jsx(AL,{})}),c.jsxs(ke,{element:c.jsx(zL,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(XO,{})}),c.jsx(ke,{path:"chat",element:c.jsx(CB,{})}),c.jsx(ke,{path:"sessions/new",element:c.jsx(RB,{})}),c.jsx(ke,{path:"sessions/:sessionId",element:c.jsx(IB,{})}),c.jsx(ke,{element:c.jsx(VD,{}),children:c.jsx(ke,{path:"knowledge",element:c.jsx(x.Suspense,{fallback:c.jsx(k_,{}),children:c.jsx(IL,{})})})}),c.jsxs(ke,{element:c.jsx(LD,{}),children:[c.jsx(ke,{path:"tasks",element:c.jsx(YO,{})}),c.jsx(ke,{path:"tasks/new",element:c.jsx(Z0,{})}),c.jsx(ke,{path:"tasks/:taskId",element:c.jsx(ji,{})}),c.jsx(ke,{path:"tasks/:taskId/stream",element:c.jsx(ji,{})}),c.jsx(ke,{path:"tasks/:taskId/findings",element:c.jsx(ji,{})}),c.jsx(ke,{path:"tasks/:taskId/edit",element:c.jsx(X0,{})})]}),c.jsxs(ke,{element:c.jsx(UD,{}),children:[c.jsx(ke,{path:"workspaces",element:c.jsx(Gn,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"workspaces/:workspaceId",element:c.jsx(Sf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Sf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Sf,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(t4,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(Z0,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(ji,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(ji,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(ji,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(X0,{})}),c.jsxs(ke,{path:"environments",element:c.jsx(uI,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(ZO,{})}),c.jsx(ke,{path:"new",element:c.jsx(iI,{})}),c.jsx(ke,{path:":environmentId",element:c.jsx(VI,{})}),c.jsx(ke,{path:":environmentId/edit",element:c.jsx(oI,{})})]})]}),c.jsx(ke,{element:c.jsx(zD,{}),children:c.jsxs(ke,{path:"settings",element:c.jsx(GI,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(Gn,{to:"credentials",replace:!0})}),c.jsx(ke,{path:"environments",element:c.jsx(Gn,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"credentials",element:c.jsx(A5,{})}),c.jsx(ke,{path:"tokens",element:c.jsx(Gn,{to:"../credentials",replace:!0})}),c.jsx(ke,{path:"personas",element:c.jsx(nL,{})}),c.jsx(ke,{path:"appearance",element:c.jsx(sL,{})}),c.jsx(ke,{path:"about",element:c.jsx(oL,{})})]})}),c.jsx(ke,{path:"*",element:c.jsx(Gn,{to:"/",replace:!0})})]})]})}const HL=1e4;function PL(){const{onboardingCompleted:n}=Xe(),[a,i]=x.useState(!1);x.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),HL);return()=>clearTimeout(r)},[n]);const o=n===void 0&&!a;return c.jsx(Xn,{mode:"wait",children:o?c.jsx(kt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(k_,{})},"splash"):c.jsx(kt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(qk,{children:c.jsx(VL,{})})},"app")})}function GL(){const n=LL?OC:CC;return c.jsx(VC,{children:c.jsx(IC,{children:c.jsx(n,{children:c.jsx(PL,{})})})})}oT.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(GL,{})}));export{Xi as B,_b as K,Xe as a,bb as s,xa as t,Ht as u};