autoforge-ai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/check-code.md +32 -0
- package/.claude/commands/checkpoint.md +40 -0
- package/.claude/commands/create-spec.md +613 -0
- package/.claude/commands/expand-project.md +234 -0
- package/.claude/commands/gsd-to-autoforge-spec.md +10 -0
- package/.claude/commands/review-pr.md +75 -0
- package/.claude/templates/app_spec.template.txt +331 -0
- package/.claude/templates/coding_prompt.template.md +265 -0
- package/.claude/templates/initializer_prompt.template.md +354 -0
- package/.claude/templates/testing_prompt.template.md +146 -0
- package/.env.example +64 -0
- package/LICENSE.md +676 -0
- package/README.md +423 -0
- package/agent.py +444 -0
- package/api/__init__.py +10 -0
- package/api/database.py +536 -0
- package/api/dependency_resolver.py +449 -0
- package/api/migration.py +156 -0
- package/auth.py +83 -0
- package/autoforge_paths.py +315 -0
- package/autonomous_agent_demo.py +293 -0
- package/bin/autoforge.js +3 -0
- package/client.py +607 -0
- package/env_constants.py +27 -0
- package/examples/OPTIMIZE_CONFIG.md +230 -0
- package/examples/README.md +531 -0
- package/examples/org_config.yaml +172 -0
- package/examples/project_allowed_commands.yaml +139 -0
- package/lib/cli.js +791 -0
- package/mcp_server/__init__.py +1 -0
- package/mcp_server/feature_mcp.py +988 -0
- package/package.json +53 -0
- package/parallel_orchestrator.py +1800 -0
- package/progress.py +247 -0
- package/prompts.py +427 -0
- package/pyproject.toml +17 -0
- package/rate_limit_utils.py +132 -0
- package/registry.py +614 -0
- package/requirements-prod.txt +14 -0
- package/security.py +959 -0
- package/server/__init__.py +17 -0
- package/server/main.py +261 -0
- package/server/routers/__init__.py +32 -0
- package/server/routers/agent.py +177 -0
- package/server/routers/assistant_chat.py +327 -0
- package/server/routers/devserver.py +309 -0
- package/server/routers/expand_project.py +239 -0
- package/server/routers/features.py +746 -0
- package/server/routers/filesystem.py +514 -0
- package/server/routers/projects.py +524 -0
- package/server/routers/schedules.py +356 -0
- package/server/routers/settings.py +127 -0
- package/server/routers/spec_creation.py +357 -0
- package/server/routers/terminal.py +453 -0
- package/server/schemas.py +593 -0
- package/server/services/__init__.py +36 -0
- package/server/services/assistant_chat_session.py +496 -0
- package/server/services/assistant_database.py +304 -0
- package/server/services/chat_constants.py +57 -0
- package/server/services/dev_server_manager.py +557 -0
- package/server/services/expand_chat_session.py +399 -0
- package/server/services/process_manager.py +657 -0
- package/server/services/project_config.py +475 -0
- package/server/services/scheduler_service.py +683 -0
- package/server/services/spec_chat_session.py +502 -0
- package/server/services/terminal_manager.py +756 -0
- package/server/utils/__init__.py +1 -0
- package/server/utils/process_utils.py +134 -0
- package/server/utils/project_helpers.py +32 -0
- package/server/utils/validation.py +54 -0
- package/server/websocket.py +903 -0
- package/start.py +456 -0
- package/ui/dist/assets/index-8W_wmZzz.js +168 -0
- package/ui/dist/assets/index-B47Ubhox.css +1 -0
- package/ui/dist/assets/vendor-flow-CVNK-_lx.js +7 -0
- package/ui/dist/assets/vendor-query-BUABzP5o.js +1 -0
- package/ui/dist/assets/vendor-radix-DTNNCg2d.js +45 -0
- package/ui/dist/assets/vendor-react-qkC6yhPU.js +1 -0
- package/ui/dist/assets/vendor-utils-COeKbHgx.js +2 -0
- package/ui/dist/assets/vendor-xterm-DP_gxef0.js +16 -0
- package/ui/dist/index.html +23 -0
- package/ui/dist/ollama.png +0 -0
- package/ui/dist/vite.svg +6 -0
- package/ui/package.json +57 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import{r as m,u as Rt,b as at,c as ct,j as a,Q as Wg,d as Ig}from"./vendor-query-BUABzP5o.js";import{r as Pg,a as ep,g as tp}from"./vendor-react-qkC6yhPU.js";import{c as Ei,t as ap,a as np,I as sp,B as qi,U as lp,b as ho,C as ea,d as ta,F as ih,E as xo,X as We,e as za,R as ds,P as Ri,S as go,L as Me,Z as ip,A as rh,W as fs,f as ms,g as _i,h as po,i as oo,H as rp,j as Ui,k as zm,l as uo,T as Aa,m as ol,n as tn,o as Pa,G as hs,M as yo,p as us,q as Sn,r as cp,s as Nn,u as op,v as ch,w as up,x as Am,y as dp,z as fp,D as mp,J as hp,K as xp,N as fo,O as gp,Q as pp,V as Li,Y as yp,_ as bp,$ as oh,a0 as uh,a1 as dh,a2 as jp,a3 as fh,a4 as vp,a5 as mh,a6 as Np,a7 as bo,a8 as jo,a9 as Sp,aa as hh,ab as wp,ac as Cp,ad as xh,ae as gh,af as zp,ag as Ap,ah as Tp,ai as Ep,aj as Dp,ak as kp,al as Mp}from"./vendor-utils-COeKbHgx.js";import{r as ph,a as _p,M as Op,u as Rp,b as Up,i as Lp,C as Bp,B as Hp,c as qp,d as Gp,P as os,H as Tm}from"./vendor-flow-CVNK-_lx.js";import{S as yh,R as Qp,C as Yp,a as bh,T as Vp,D as Fp,P as Xp,O as Kp,b as Zp,c as Jp,d as $p,e as Wp,f as Ip,I as Pp,g as ey,h as ty,i as ay,j as ny,k as sy,l as ly}from"./vendor-radix-DTNNCg2d.js";import{D as iy,o as ry}from"./vendor-xterm-DP_gxef0.js";(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))u(h);new MutationObserver(h=>{for(const x of h)if(x.type==="childList")for(const y of x.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&u(y)}).observe(document,{childList:!0,subtree:!0});function d(h){const x={};return h.integrity&&(x.integrity=h.integrity),h.referrerPolicy&&(x.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?x.credentials="include":h.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function u(h){if(h.ep)return;h.ep=!0;const x=d(h);fetch(h.href,x)}})();var so={exports:{}},cl={},lo={exports:{}},io={};var Em;function cy(){return Em||(Em=1,(function(i){function c(j,M){var I=j.length;j.push(M);e:for(;0<I;){var P=I-1>>>1,fe=j[P];if(0<h(fe,M))j[P]=M,j[I]=fe,I=P;else break e}}function d(j){return j.length===0?null:j[0]}function u(j){if(j.length===0)return null;var M=j[0],I=j.pop();if(I!==M){j[0]=I;e:for(var P=0,fe=j.length,ue=fe>>>1;P<ue;){var Ce=2*(P+1)-1,ne=j[Ce],Re=Ce+1,ot=j[Re];if(0>h(ne,I))Re<fe&&0>h(ot,ne)?(j[P]=ot,j[Re]=I,P=Re):(j[P]=ne,j[Ce]=I,P=Ce);else if(Re<fe&&0>h(ot,I))j[P]=ot,j[Re]=I,P=Re;else break e}}return M}function h(j,M){var I=j.sortIndex-M.sortIndex;return I!==0?I:j.id-M.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;i.unstable_now=function(){return x.now()}}else{var y=Date,g=y.now();i.unstable_now=function(){return y.now()-g}}var T=[],C=[],A=1,D=null,H=3,v=!1,E=!1,O=!1,L=!1,z=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function X(j){for(var M=d(C);M!==null;){if(M.callback===null)u(C);else if(M.startTime<=j)u(C),M.sortIndex=M.expirationTime,c(T,M);else break;M=d(C)}}function J(j){if(O=!1,X(j),!E)if(d(T)!==null)E=!0,$||($=!0,U());else{var M=d(C);M!==null&&le(J,M.startTime-j)}}var $=!1,F=-1,ee=5,Y=-1;function se(){return L?!0:!(i.unstable_now()-Y<ee)}function K(){if(L=!1,$){var j=i.unstable_now();Y=j;var M=!0;try{e:{E=!1,O&&(O=!1,b(F),F=-1),v=!0;var I=H;try{t:{for(X(j),D=d(T);D!==null&&!(D.expirationTime>j&&se());){var P=D.callback;if(typeof P=="function"){D.callback=null,H=D.priorityLevel;var fe=P(D.expirationTime<=j);if(j=i.unstable_now(),typeof fe=="function"){D.callback=fe,X(j),M=!0;break t}D===d(T)&&u(T),X(j)}else u(T);D=d(T)}if(D!==null)M=!0;else{var ue=d(C);ue!==null&&le(J,ue.startTime-j),M=!1}}break e}finally{D=null,H=I,v=!1}M=void 0}}finally{M?U():$=!1}}}var U;if(typeof S=="function")U=function(){S(K)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,W=q.port2;q.port1.onmessage=K,U=function(){W.postMessage(null)}}else U=function(){z(K,0)};function le(j,M){F=z(function(){j(i.unstable_now())},M)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(j){j.callback=null},i.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<j?Math.floor(1e3/j):5},i.unstable_getCurrentPriorityLevel=function(){return H},i.unstable_next=function(j){switch(H){case 1:case 2:case 3:var M=3;break;default:M=H}var I=H;H=M;try{return j()}finally{H=I}},i.unstable_requestPaint=function(){L=!0},i.unstable_runWithPriority=function(j,M){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var I=H;H=j;try{return M()}finally{H=I}},i.unstable_scheduleCallback=function(j,M,I){var P=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?P+I:P):I=P,j){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=I+fe,j={id:A++,callback:M,priorityLevel:j,startTime:I,expirationTime:fe,sortIndex:-1},I>P?(j.sortIndex=I,c(C,j),d(T)===null&&j===d(C)&&(O?(b(F),F=-1):O=!0,le(J,I-P))):(j.sortIndex=fe,c(T,j),E||v||(E=!0,$||($=!0,U()))),j},i.unstable_shouldYield=se,i.unstable_wrapCallback=function(j){var M=H;return function(){var I=H;H=M;try{return j.apply(this,arguments)}finally{H=I}}}})(io)),io}var Dm;function oy(){return Dm||(Dm=1,lo.exports=cy()),lo.exports}var km;function uy(){if(km)return cl;km=1;var i=oy(),c=Pg(),d=ep();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function y(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 g(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 T(e){if(x(e)!==e)throw Error(u(188))}function C(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,s=t;;){var l=n.return;if(l===null)break;var r=l.alternate;if(r===null){if(s=l.return,s!==null){n=s;continue}break}if(l.child===r.child){for(r=l.child;r;){if(r===n)return T(l),e;if(r===s)return T(l),t;r=r.sibling}throw Error(u(188))}if(n.return!==s.return)n=l,s=r;else{for(var o=!1,f=l.child;f;){if(f===n){o=!0,n=l,s=r;break}if(f===s){o=!0,s=l,n=r;break}f=f.sibling}if(!o){for(f=r.child;f;){if(f===n){o=!0,n=r,s=l;break}if(f===s){o=!0,s=r,n=l;break}f=f.sibling}if(!o)throw Error(u(189))}}if(n.alternate!==s)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var D=Object.assign,H=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),S=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var q=Symbol.for("react.client.reference");function W(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 O:return"Fragment";case z:return"Profiler";case L:return"StrictMode";case J:return"Suspense";case $:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case S:return e.displayName||"Context";case b:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var le=Array.isArray,j=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},P=[],fe=-1;function ue(e){return{current:e}}function Ce(e){0>fe||(e.current=P[fe],P[fe]=null,fe--)}function ne(e,t){fe++,P[fe]=e.current,e.current=t}var Re=ue(null),ot=ue(null),ft=ue(null),ia=ue(null);function ra(e,t){switch(ne(ft,t),ne(ot,e),ne(Re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jf(t),e=$f(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ce(Re),ne(Re,e)}function te(){Ce(Re),Ce(ot),Ce(ft)}function de(e){e.memoizedState!==null&&ne(ia,e);var t=Re.current,n=$f(t,e.type);t!==n&&(ne(ot,e),ne(Re,n))}function Ue(e){ot.current===e&&(Ce(Re),Ce(ot)),ia.current===e&&(Ce(ia),sl._currentValue=I)}var St,Xt;function ut(e){if(St===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);St=t&&t[1]||"",Xt=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+St+e+Xt}var Xe=!1;function je(e,t){if(!e||Xe)return"";Xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(B){var R=B}Reflect.construct(e,[],V)}else{try{V.call()}catch(B){R=B}e.call(V.prototype)}}else{try{throw Error()}catch(B){R=B}(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(B){if(B&&R&&typeof B.stack=="string")return[B.stack,R.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=s.DetermineComponentFrameRoot(),o=r[0],f=r[1];if(o&&f){var p=o.split(`
|
|
4
|
+
`),_=f.split(`
|
|
5
|
+
`);for(l=s=0;s<p.length&&!p[s].includes("DetermineComponentFrameRoot");)s++;for(;l<_.length&&!_[l].includes("DetermineComponentFrameRoot");)l++;if(s===p.length||l===_.length)for(s=p.length-1,l=_.length-1;1<=s&&0<=l&&p[s]!==_[l];)l--;for(;1<=s&&0<=l;s--,l--)if(p[s]!==_[l]){if(s!==1||l!==1)do if(s--,l--,0>l||p[s]!==_[l]){var G=`
|
|
6
|
+
`+p[s].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=s&&0<=l);break}}}finally{Xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ut(n):""}function wt(e,t){switch(e.tag){case 26:case 27:case 5:return ut(e.type);case 16:return ut("Lazy");case 13:return e.child!==t&&t!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return ut("Activity");default:return""}}function dl(e){try{var t="",n=null;do t+=wt(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var Yi=Object.prototype.hasOwnProperty,Vi=i.unstable_scheduleCallback,Fi=i.unstable_cancelCallback,Eh=i.unstable_shouldYield,Dh=i.unstable_requestPaint,Ct=i.unstable_now,kh=i.unstable_getCurrentPriorityLevel,zo=i.unstable_ImmediatePriority,Ao=i.unstable_UserBlockingPriority,fl=i.unstable_NormalPriority,Mh=i.unstable_LowPriority,To=i.unstable_IdlePriority,_h=i.log,Oh=i.unstable_setDisableYieldValue,gs=null,zt=null;function Ta(e){if(typeof _h=="function"&&Oh(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(gs,e)}catch{}}var At=Math.clz32?Math.clz32:Lh,Rh=Math.log,Uh=Math.LN2;function Lh(e){return e>>>=0,e===0?32:31-(Rh(e)/Uh|0)|0}var ml=256,hl=262144,xl=4194304;function an(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gl(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var l=0,r=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var f=s&134217727;return f!==0?(s=f&~r,s!==0?l=an(s):(o&=f,o!==0?l=an(o):n||(n=f&~e,n!==0&&(l=an(n))))):(f=s&~r,f!==0?l=an(f):o!==0?l=an(o):n||(n=s&~e,n!==0&&(l=an(n)))),l===0?0:t!==0&&t!==l&&(t&r)===0&&(r=l&-l,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:l}function ps(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Bh(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 Eo(){var e=xl;return xl<<=1,(xl&62914560)===0&&(xl=4194304),e}function Xi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ys(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hh(e,t,n,s,l,r){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var f=e.entanglements,p=e.expirationTimes,_=e.hiddenUpdates;for(n=o&~n;0<n;){var G=31-At(n),V=1<<G;f[G]=0,p[G]=-1;var R=_[G];if(R!==null)for(_[G]=null,G=0;G<R.length;G++){var B=R[G];B!==null&&(B.lane&=-536870913)}n&=~V}s!==0&&Do(e,s,0),r!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=r&~(o&~t))}function Do(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-At(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function ko(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-At(n),l=1<<s;l&t|e[s]&t&&(e[s]|=t),n&=~l}}function Mo(e,t){var n=t&-t;return n=(n&42)!==0?1:Ki(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ki(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 Zi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _o(){var e=M.p;return e!==0?e:(e=window.event,e===void 0?32:bm(e.type))}function Oo(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var Ea=Math.random().toString(36).slice(2),nt="__reactFiber$"+Ea,ht="__reactProps$"+Ea,wn="__reactContainer$"+Ea,Ji="__reactEvents$"+Ea,qh="__reactListeners$"+Ea,Gh="__reactHandles$"+Ea,Ro="__reactResources$"+Ea,bs="__reactMarker$"+Ea;function $i(e){delete e[nt],delete e[ht],delete e[Ji],delete e[qh],delete e[Gh]}function Cn(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wn]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=nm(e);e!==null;){if(n=e[nt])return n;e=nm(e)}return t}e=n,n=e.parentNode}return null}function zn(e){if(e=e[nt]||e[wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function js(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function An(e){var t=e[Ro];return t||(t=e[Ro]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[bs]=!0}var Uo=new Set,Lo={};function nn(e,t){Tn(e,t),Tn(e+"Capture",t)}function Tn(e,t){for(Lo[e]=t,e=0;e<t.length;e++)Uo.add(t[e])}var Qh=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]*$"),Bo={},Ho={};function Yh(e){return Yi.call(Ho,e)?!0:Yi.call(Bo,e)?!1:Qh.test(e)?Ho[e]=!0:(Bo[e]=!0,!1)}function pl(e,t,n){if(Yh(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function yl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ca(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vh(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var l=s.get,r=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){n=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wi(e){if(!e._valueTracker){var t=qo(e)?"checked":"value";e._valueTracker=Vh(e,t,""+e[t])}}function Go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=qo(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function bl(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 Fh=/[\n"\\]/g;function Lt(e){return e.replace(Fh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ii(e,t,n,s,l,r,o,f){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Pi(e,o,Ut(t)):n!=null?Pi(e,o,Ut(n)):s!=null&&e.removeAttribute("value"),l==null&&r!=null&&(e.defaultChecked=!!r),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+Ut(f):e.removeAttribute("name")}function Qo(e,t,n,s,l,r,o,f){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Wi(e);return}n=n!=null?""+Ut(n):"",t=t!=null?""+Ut(t):n,f||t===e.value||(e.value=t),e.defaultValue=t}s=s??l,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=f?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),Wi(e)}function Pi(e,t,n){t==="number"&&bl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function En(e,t,n,s){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Ut(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,s&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Yo(e,t,n){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ut(n):""}function Vo(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(u(92));if(le(s)){if(1<s.length)throw Error(u(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=Ut(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),Wi(e)}function Dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xh=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 Fo(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||Xh.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Xo(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var l in t)s=t[l],t.hasOwnProperty(l)&&n[l]!==s&&Fo(e,l,s)}else for(var r in t)t.hasOwnProperty(r)&&Fo(e,r,t[r])}function er(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 Kh=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"]]),Zh=/^[\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 jl(e){return Zh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function oa(){}var tr=null;function ar(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kn=null,Mn=null;function Ko(e){var t=zn(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ii(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Lt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var l=s[ht]||null;if(!l)throw Error(u(90));Ii(s,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&Go(s)}break e;case"textarea":Yo(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&En(e,!!n.multiple,t,!1)}}}var nr=!1;function Zo(e,t,n){if(nr)return e(t,n);nr=!0;try{var s=e(t);return s}finally{if(nr=!1,(kn!==null||Mn!==null)&&(ri(),kn&&(t=kn,e=Mn,Mn=kn=null,Ko(t),e)))for(t=0;t<e.length;t++)Ko(e[t])}}function vs(e,t){var n=e.stateNode;if(n===null)return null;var s=n[ht]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sr=!1;if(ua)try{var Ns={};Object.defineProperty(Ns,"passive",{get:function(){sr=!0}}),window.addEventListener("test",Ns,Ns),window.removeEventListener("test",Ns,Ns)}catch{sr=!1}var Da=null,lr=null,vl=null;function Jo(){if(vl)return vl;var e,t=lr,n=t.length,s,l="value"in Da?Da.value:Da.textContent,r=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===l[r-s];s++);return vl=l.slice(e,1<s?1-s:void 0)}function Nl(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 Sl(){return!0}function $o(){return!1}function xt(e){function t(n,s,l,r,o){this._reactName=n,this._targetInst=l,this.type=s,this.nativeEvent=r,this.target=o,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(n=e[f],this[f]=n?n(r):r[f]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Sl:$o,this.isPropagationStopped=$o,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Sl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Sl)},persist:function(){},isPersistent:Sl}),t}var sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=xt(sn),Ss=D({},sn,{view:0,detail:0}),Jh=xt(Ss),ir,rr,ws,Cl=D({},Ss,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,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!==ws&&(ws&&e.type==="mousemove"?(ir=e.screenX-ws.screenX,rr=e.screenY-ws.screenY):rr=ir=0,ws=e),ir)},movementY:function(e){return"movementY"in e?e.movementY:rr}}),Wo=xt(Cl),$h=D({},Cl,{dataTransfer:0}),Wh=xt($h),Ih=D({},Ss,{relatedTarget:0}),cr=xt(Ih),Ph=D({},sn,{animationName:0,elapsedTime:0,pseudoElement:0}),ex=xt(Ph),tx=D({},sn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ax=xt(tx),nx=D({},sn,{data:0}),Io=xt(nx),sx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lx={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"},ix={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ix[e])?!!t[e]:!1}function or(){return rx}var cx=D({},Ss,{key:function(e){if(e.key){var t=sx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?lx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ox=xt(cx),ux=D({},Cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Po=xt(ux),dx=D({},Ss,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or}),fx=xt(dx),mx=D({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0}),hx=xt(mx),xx=D({},Cl,{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}),gx=xt(xx),px=D({},sn,{newState:0,oldState:0}),yx=xt(px),bx=[9,13,27,32],ur=ua&&"CompositionEvent"in window,Cs=null;ua&&"documentMode"in document&&(Cs=document.documentMode);var jx=ua&&"TextEvent"in window&&!Cs,eu=ua&&(!ur||Cs&&8<Cs&&11>=Cs),tu=" ",au=!1;function nu(e,t){switch(e){case"keyup":return bx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _n=!1;function vx(e,t){switch(e){case"compositionend":return su(t);case"keypress":return t.which!==32?null:(au=!0,tu);case"textInput":return e=t.data,e===tu&&au?null:e;default:return null}}function Nx(e,t){if(_n)return e==="compositionend"||!ur&&nu(e,t)?(e=Jo(),vl=lr=Da=null,_n=!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 eu&&t.locale!=="ko"?null:t.data;default:return null}}var Sx={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 lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sx[e.type]:t==="textarea"}function iu(e,t,n,s){kn?Mn?Mn.push(s):Mn=[s]:kn=s,t=hi(t,"onChange"),0<t.length&&(n=new wl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var zs=null,As=null;function wx(e){Yf(e,0)}function zl(e){var t=js(e);if(Go(t))return e}function ru(e,t){if(e==="change")return t}var cu=!1;if(ua){var dr;if(ua){var fr="oninput"in document;if(!fr){var ou=document.createElement("div");ou.setAttribute("oninput","return;"),fr=typeof ou.oninput=="function"}dr=fr}else dr=!1;cu=dr&&(!document.documentMode||9<document.documentMode)}function uu(){zs&&(zs.detachEvent("onpropertychange",du),As=zs=null)}function du(e){if(e.propertyName==="value"&&zl(As)){var t=[];iu(t,As,e,ar(e)),Zo(wx,t)}}function Cx(e,t,n){e==="focusin"?(uu(),zs=t,As=n,zs.attachEvent("onpropertychange",du)):e==="focusout"&&uu()}function zx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zl(As)}function Ax(e,t){if(e==="click")return zl(t)}function Tx(e,t){if(e==="input"||e==="change")return zl(t)}function Ex(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:Ex;function Ts(e,t){if(Tt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var l=n[s];if(!Yi.call(t,l)||!Tt(e[l],t[l]))return!1}return!0}function fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mu(e,t){var n=fu(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fu(n)}}function hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bl(e.document)}return t}function mr(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 Dx=ua&&"documentMode"in document&&11>=document.documentMode,On=null,hr=null,Es=null,xr=!1;function gu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xr||On==null||On!==bl(s)||(s=On,"selectionStart"in s&&mr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Es&&Ts(Es,s)||(Es=s,s=hi(hr,"onSelect"),0<s.length&&(t=new wl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=On)))}function ln(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rn={animationend:ln("Animation","AnimationEnd"),animationiteration:ln("Animation","AnimationIteration"),animationstart:ln("Animation","AnimationStart"),transitionrun:ln("Transition","TransitionRun"),transitionstart:ln("Transition","TransitionStart"),transitioncancel:ln("Transition","TransitionCancel"),transitionend:ln("Transition","TransitionEnd")},gr={},pu={};ua&&(pu=document.createElement("div").style,"AnimationEvent"in window||(delete Rn.animationend.animation,delete Rn.animationiteration.animation,delete Rn.animationstart.animation),"TransitionEvent"in window||delete Rn.transitionend.transition);function rn(e){if(gr[e])return gr[e];if(!Rn[e])return e;var t=Rn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pu)return gr[e]=t[n];return e}var yu=rn("animationend"),bu=rn("animationiteration"),ju=rn("animationstart"),kx=rn("transitionrun"),Mx=rn("transitionstart"),_x=rn("transitioncancel"),vu=rn("transitionend"),Nu=new Map,pr="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(" ");pr.push("scrollEnd");function Kt(e,t){Nu.set(e,t),nn(t,[e])}var Al=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)},Bt=[],Un=0,yr=0;function Tl(){for(var e=Un,t=yr=Un=0;t<e;){var n=Bt[t];Bt[t++]=null;var s=Bt[t];Bt[t++]=null;var l=Bt[t];Bt[t++]=null;var r=Bt[t];if(Bt[t++]=null,s!==null&&l!==null){var o=s.pending;o===null?l.next=l:(l.next=o.next,o.next=l),s.pending=l}r!==0&&Su(n,l,r)}}function El(e,t,n,s){Bt[Un++]=e,Bt[Un++]=t,Bt[Un++]=n,Bt[Un++]=s,yr|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function br(e,t,n,s){return El(e,t,n,s),Dl(e)}function cn(e,t){return El(e,null,null,t),Dl(e)}function Su(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var l=!1,r=e.return;r!==null;)r.childLanes|=n,s=r.alternate,s!==null&&(s.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(l=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,l&&t!==null&&(l=31-At(n),e=r.hiddenUpdates,s=e[l],s===null?e[l]=[t]:s.push(t),t.lane=n|536870912),r):null}function Dl(e){if(50<Ws)throw Ws=0,Tc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ln={};function Ox(e,t,n,s){this.tag=e,this.key=n,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,s){return new Ox(e,t,n,s)}function jr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function da(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function wu(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function kl(e,t,n,s,l,r){var o=0;if(s=e,typeof e=="function")jr(e)&&(o=1);else if(typeof e=="string")o=Hg(e,n,Re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=Et(31,n,t,l),e.elementType=Y,e.lanes=r,e;case O:return on(n.children,l,r,t);case L:o=8,l|=24;break;case z:return e=Et(12,n,t,l|2),e.elementType=z,e.lanes=r,e;case J:return e=Et(13,n,t,l),e.elementType=J,e.lanes=r,e;case $:return e=Et(19,n,t,l),e.elementType=$,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:o=10;break e;case b:o=9;break e;case X:o=11;break e;case F:o=14;break e;case ee:o=16,s=null;break e}o=29,n=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=Et(o,n,t,l),t.elementType=e,t.type=s,t.lanes=r,t}function on(e,t,n,s){return e=Et(7,e,s,t),e.lanes=n,e}function vr(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Cu(e){var t=Et(18,null,null,0);return t.stateNode=e,t}function Nr(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var zu=new WeakMap;function Ht(e,t){if(typeof e=="object"&&e!==null){var n=zu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:dl(t)},zu.set(e,t),t)}return{value:e,source:t,stack:dl(t)}}var Bn=[],Hn=0,Ml=null,Ds=0,qt=[],Gt=0,ka=null,$t=1,Wt="";function fa(e,t){Bn[Hn++]=Ds,Bn[Hn++]=Ml,Ml=e,Ds=t}function Au(e,t,n){qt[Gt++]=$t,qt[Gt++]=Wt,qt[Gt++]=ka,ka=e;var s=$t;e=Wt;var l=32-At(s)-1;s&=~(1<<l),n+=1;var r=32-At(t)+l;if(30<r){var o=l-l%5;r=(s&(1<<o)-1).toString(32),s>>=o,l-=o,$t=1<<32-At(t)+l|n<<l|s,Wt=r+e}else $t=1<<r|n<<l|s,Wt=e}function Sr(e){e.return!==null&&(fa(e,1),Au(e,1,0))}function wr(e){for(;e===Ml;)Ml=Bn[--Hn],Bn[Hn]=null,Ds=Bn[--Hn],Bn[Hn]=null;for(;e===ka;)ka=qt[--Gt],qt[Gt]=null,Wt=qt[--Gt],qt[Gt]=null,$t=qt[--Gt],qt[Gt]=null}function Tu(e,t){qt[Gt++]=$t,qt[Gt++]=Wt,qt[Gt++]=ka,$t=t.id,Wt=t.overflow,ka=e}var st=null,Le=null,ve=!1,Ma=null,Qt=!1,Cr=Error(u(519));function _a(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ks(Ht(t,e)),Cr}function Eu(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[nt]=e,t[ht]=s,n){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(n=0;n<Ps.length;n++)ge(Ps[n],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),Qo(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),Vo(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||Kf(t.textContent,n)?(s.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),s.onScroll!=null&&ge("scroll",t),s.onScrollEnd!=null&&ge("scrollend",t),s.onClick!=null&&(t.onclick=oa),t=!0):t=!1,t||_a(e,!0)}function Du(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Qt=!1;return;case 27:case 3:Qt=!0;return;default:st=st.return}}function qn(e){if(e!==st)return!1;if(!ve)return Du(e),ve=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Yc(e.type,e.memoizedProps)),n=!n),n&&Le&&_a(e),Du(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Le=am(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Le=am(e)}else t===27?(t=Le,Ka(e.type)?(e=Zc,Zc=null,Le=e):Le=t):Le=st?Vt(e.stateNode.nextSibling):null;return!0}function un(){Le=st=null,ve=!1}function zr(){var e=Ma;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),Ma=null),e}function ks(e){Ma===null?Ma=[e]:Ma.push(e)}var Ar=ue(null),dn=null,ma=null;function Oa(e,t,n){ne(Ar,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=Ar.current,Ce(Ar)}function Tr(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Er(e,t,n,s){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var r=l.dependencies;if(r!==null){var o=l.child;r=r.firstContext;e:for(;r!==null;){var f=r;r=l;for(var p=0;p<t.length;p++)if(f.context===t[p]){r.lanes|=n,f=r.alternate,f!==null&&(f.lanes|=n),Tr(r.return,n,e),s||(o=null);break e}r=f.next}}else if(l.tag===18){if(o=l.return,o===null)throw Error(u(341));o.lanes|=n,r=o.alternate,r!==null&&(r.lanes|=n),Tr(o,n,e),o=null}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===e){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}}function Gn(e,t,n,s){e=null;for(var l=t,r=!1;l!==null;){if(!r){if((l.flags&524288)!==0)r=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var o=l.alternate;if(o===null)throw Error(u(387));if(o=o.memoizedProps,o!==null){var f=l.type;Tt(l.pendingProps.value,o.value)||(e!==null?e.push(f):e=[f])}}else if(l===ia.current){if(o=l.alternate,o===null)throw Error(u(387));o.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}l=l.return}e!==null&&Er(t,e,n,s),t.flags|=262144}function _l(e){for(e=e.firstContext;e!==null;){if(!Tt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fn(e){dn=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return ku(dn,e)}function Ol(e,t){return dn===null&&fn(e),ku(e,t)}function ku(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(u(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Rx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ux=i.unstable_scheduleCallback,Lx=i.unstable_NormalPriority,Ke={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dr(){return{controller:new Rx,data:new Map,refCount:0}}function Ms(e){e.refCount--,e.refCount===0&&Ux(Lx,function(){e.controller.abort()})}var _s=null,kr=0,Qn=0,Yn=null;function Bx(e,t){if(_s===null){var n=_s=[];kr=0,Qn=Oc(),Yn={status:"pending",value:void 0,then:function(s){n.push(s)}}}return kr++,t.then(Mu,Mu),t}function Mu(){if(--kr===0&&_s!==null){Yn!==null&&(Yn.status="fulfilled");var e=_s;_s=null,Qn=0,Yn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Hx(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(s.status="rejected",s.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),s}var _u=j.S;j.S=function(e,t){pf=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Bx(e,t),_u!==null&&_u(e,t)};var mn=ue(null);function Mr(){var e=mn.current;return e!==null?e:ke.pooledCache}function Rl(e,t){t===null?ne(mn,mn.current):ne(mn,t.pool)}function Ou(){var e=Mr();return e===null?null:{parent:Ke._currentValue,pool:e}}var Vn=Error(u(460)),_r=Error(u(474)),Ul=Error(u(542)),Ll={then:function(){}};function Ru(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Uu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(oa,oa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bu(e),e;default:if(typeof t.status=="string")t.then(oa,oa);else{if(e=ke,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=s}},function(s){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bu(e),e}throw xn=t,Vn}}function hn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(xn=n,Vn):n}}var xn=null;function Lu(){if(xn===null)throw Error(u(459));var e=xn;return xn=null,e}function Bu(e){if(e===Vn||e===Ul)throw Error(u(483))}var Fn=null,Os=0;function Bl(e){var t=Os;return Os+=1,Fn===null&&(Fn=[]),Uu(Fn,e,t)}function Rs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hl(e,t){throw t.$$typeof===H?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hu(e){function t(w,N){if(e){var k=w.deletions;k===null?(w.deletions=[N],w.flags|=16):k.push(N)}}function n(w,N){if(!e)return null;for(;N!==null;)t(w,N),N=N.sibling;return null}function s(w){for(var N=new Map;w!==null;)w.key!==null?N.set(w.key,w):N.set(w.index,w),w=w.sibling;return N}function l(w,N){return w=da(w,N),w.index=0,w.sibling=null,w}function r(w,N,k){return w.index=k,e?(k=w.alternate,k!==null?(k=k.index,k<N?(w.flags|=67108866,N):k):(w.flags|=67108866,N)):(w.flags|=1048576,N)}function o(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function f(w,N,k,Q){return N===null||N.tag!==6?(N=vr(k,w.mode,Q),N.return=w,N):(N=l(N,k),N.return=w,N)}function p(w,N,k,Q){var ce=k.type;return ce===O?G(w,N,k.props.children,Q,k.key):N!==null&&(N.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ee&&hn(ce)===N.type)?(N=l(N,k.props),Rs(N,k),N.return=w,N):(N=kl(k.type,k.key,k.props,null,w.mode,Q),Rs(N,k),N.return=w,N)}function _(w,N,k,Q){return N===null||N.tag!==4||N.stateNode.containerInfo!==k.containerInfo||N.stateNode.implementation!==k.implementation?(N=Nr(k,w.mode,Q),N.return=w,N):(N=l(N,k.children||[]),N.return=w,N)}function G(w,N,k,Q,ce){return N===null||N.tag!==7?(N=on(k,w.mode,Q,ce),N.return=w,N):(N=l(N,k),N.return=w,N)}function V(w,N,k){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=vr(""+N,w.mode,k),N.return=w,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case v:return k=kl(N.type,N.key,N.props,null,w.mode,k),Rs(k,N),k.return=w,k;case E:return N=Nr(N,w.mode,k),N.return=w,N;case ee:return N=hn(N),V(w,N,k)}if(le(N)||U(N))return N=on(N,w.mode,k,null),N.return=w,N;if(typeof N.then=="function")return V(w,Bl(N),k);if(N.$$typeof===S)return V(w,Ol(w,N),k);Hl(w,N)}return null}function R(w,N,k,Q){var ce=N!==null?N.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ce!==null?null:f(w,N,""+k,Q);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case v:return k.key===ce?p(w,N,k,Q):null;case E:return k.key===ce?_(w,N,k,Q):null;case ee:return k=hn(k),R(w,N,k,Q)}if(le(k)||U(k))return ce!==null?null:G(w,N,k,Q,null);if(typeof k.then=="function")return R(w,N,Bl(k),Q);if(k.$$typeof===S)return R(w,N,Ol(w,k),Q);Hl(w,k)}return null}function B(w,N,k,Q,ce){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return w=w.get(k)||null,f(N,w,""+Q,ce);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return w=w.get(Q.key===null?k:Q.key)||null,p(N,w,Q,ce);case E:return w=w.get(Q.key===null?k:Q.key)||null,_(N,w,Q,ce);case ee:return Q=hn(Q),B(w,N,k,Q,ce)}if(le(Q)||U(Q))return w=w.get(k)||null,G(N,w,Q,ce,null);if(typeof Q.then=="function")return B(w,N,k,Bl(Q),ce);if(Q.$$typeof===S)return B(w,N,k,Ol(N,Q),ce);Hl(N,Q)}return null}function ae(w,N,k,Q){for(var ce=null,Ne=null,re=N,he=N=0,ye=null;re!==null&&he<k.length;he++){re.index>he?(ye=re,re=null):ye=re.sibling;var Se=R(w,re,k[he],Q);if(Se===null){re===null&&(re=ye);break}e&&re&&Se.alternate===null&&t(w,re),N=r(Se,N,he),Ne===null?ce=Se:Ne.sibling=Se,Ne=Se,re=ye}if(he===k.length)return n(w,re),ve&&fa(w,he),ce;if(re===null){for(;he<k.length;he++)re=V(w,k[he],Q),re!==null&&(N=r(re,N,he),Ne===null?ce=re:Ne.sibling=re,Ne=re);return ve&&fa(w,he),ce}for(re=s(re);he<k.length;he++)ye=B(re,w,he,k[he],Q),ye!==null&&(e&&ye.alternate!==null&&re.delete(ye.key===null?he:ye.key),N=r(ye,N,he),Ne===null?ce=ye:Ne.sibling=ye,Ne=ye);return e&&re.forEach(function(Ia){return t(w,Ia)}),ve&&fa(w,he),ce}function oe(w,N,k,Q){if(k==null)throw Error(u(151));for(var ce=null,Ne=null,re=N,he=N=0,ye=null,Se=k.next();re!==null&&!Se.done;he++,Se=k.next()){re.index>he?(ye=re,re=null):ye=re.sibling;var Ia=R(w,re,Se.value,Q);if(Ia===null){re===null&&(re=ye);break}e&&re&&Ia.alternate===null&&t(w,re),N=r(Ia,N,he),Ne===null?ce=Ia:Ne.sibling=Ia,Ne=Ia,re=ye}if(Se.done)return n(w,re),ve&&fa(w,he),ce;if(re===null){for(;!Se.done;he++,Se=k.next())Se=V(w,Se.value,Q),Se!==null&&(N=r(Se,N,he),Ne===null?ce=Se:Ne.sibling=Se,Ne=Se);return ve&&fa(w,he),ce}for(re=s(re);!Se.done;he++,Se=k.next())Se=B(re,w,he,Se.value,Q),Se!==null&&(e&&Se.alternate!==null&&re.delete(Se.key===null?he:Se.key),N=r(Se,N,he),Ne===null?ce=Se:Ne.sibling=Se,Ne=Se);return e&&re.forEach(function($g){return t(w,$g)}),ve&&fa(w,he),ce}function De(w,N,k,Q){if(typeof k=="object"&&k!==null&&k.type===O&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case v:e:{for(var ce=k.key;N!==null;){if(N.key===ce){if(ce=k.type,ce===O){if(N.tag===7){n(w,N.sibling),Q=l(N,k.props.children),Q.return=w,w=Q;break e}}else if(N.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ee&&hn(ce)===N.type){n(w,N.sibling),Q=l(N,k.props),Rs(Q,k),Q.return=w,w=Q;break e}n(w,N);break}else t(w,N);N=N.sibling}k.type===O?(Q=on(k.props.children,w.mode,Q,k.key),Q.return=w,w=Q):(Q=kl(k.type,k.key,k.props,null,w.mode,Q),Rs(Q,k),Q.return=w,w=Q)}return o(w);case E:e:{for(ce=k.key;N!==null;){if(N.key===ce)if(N.tag===4&&N.stateNode.containerInfo===k.containerInfo&&N.stateNode.implementation===k.implementation){n(w,N.sibling),Q=l(N,k.children||[]),Q.return=w,w=Q;break e}else{n(w,N);break}else t(w,N);N=N.sibling}Q=Nr(k,w.mode,Q),Q.return=w,w=Q}return o(w);case ee:return k=hn(k),De(w,N,k,Q)}if(le(k))return ae(w,N,k,Q);if(U(k)){if(ce=U(k),typeof ce!="function")throw Error(u(150));return k=ce.call(k),oe(w,N,k,Q)}if(typeof k.then=="function")return De(w,N,Bl(k),Q);if(k.$$typeof===S)return De(w,N,Ol(w,k),Q);Hl(w,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,N!==null&&N.tag===6?(n(w,N.sibling),Q=l(N,k),Q.return=w,w=Q):(n(w,N),Q=vr(k,w.mode,Q),Q.return=w,w=Q),o(w)):n(w,N)}return function(w,N,k,Q){try{Os=0;var ce=De(w,N,k,Q);return Fn=null,ce}catch(re){if(re===Vn||re===Ul)throw re;var Ne=Et(29,re,null,w.mode);return Ne.lanes=Q,Ne.return=w,Ne}}}var gn=Hu(!0),qu=Hu(!1),Ra=!1;function Or(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rr(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(we&2)!==0){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,t=Dl(e),Su(e,null,n),t}return El(e,s,t,n),Dl(e)}function Us(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ko(e,n)}}function Ur(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var l=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?l=r=o:r=r.next=o,n=n.next}while(n!==null);r===null?l=r=t:r=r.next=t}else l=r=t;n={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:r,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Lr=!1;function Ls(){if(Lr){var e=Yn;if(e!==null)throw e}}function Bs(e,t,n,s){Lr=!1;var l=e.updateQueue;Ra=!1;var r=l.firstBaseUpdate,o=l.lastBaseUpdate,f=l.shared.pending;if(f!==null){l.shared.pending=null;var p=f,_=p.next;p.next=null,o===null?r=_:o.next=_,o=p;var G=e.alternate;G!==null&&(G=G.updateQueue,f=G.lastBaseUpdate,f!==o&&(f===null?G.firstBaseUpdate=_:f.next=_,G.lastBaseUpdate=p))}if(r!==null){var V=l.baseState;o=0,G=_=p=null,f=r;do{var R=f.lane&-536870913,B=R!==f.lane;if(B?(pe&R)===R:(s&R)===R){R!==0&&R===Qn&&(Lr=!0),G!==null&&(G=G.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var ae=e,oe=f;R=t;var De=n;switch(oe.tag){case 1:if(ae=oe.payload,typeof ae=="function"){V=ae.call(De,V,R);break e}V=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=oe.payload,R=typeof ae=="function"?ae.call(De,V,R):ae,R==null)break e;V=D({},V,R);break e;case 2:Ra=!0}}R=f.callback,R!==null&&(e.flags|=64,B&&(e.flags|=8192),B=l.callbacks,B===null?l.callbacks=[R]:B.push(R))}else B={lane:R,tag:f.tag,payload:f.payload,callback:f.callback,next:null},G===null?(_=G=B,p=V):G=G.next=B,o|=R;if(f=f.next,f===null){if(f=l.shared.pending,f===null)break;B=f,f=B.next,B.next=null,l.lastBaseUpdate=B,l.shared.pending=null}}while(!0);G===null&&(p=V),l.baseState=p,l.firstBaseUpdate=_,l.lastBaseUpdate=G,r===null&&(l.shared.lanes=0),Qa|=o,e.lanes=o,e.memoizedState=V}}function Gu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Qu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Gu(n[e],t)}var Xn=ue(null),ql=ue(0);function Yu(e,t){e=Sa,ne(ql,e),ne(Xn,t),Sa=e|t.baseLanes}function Br(){ne(ql,Sa),ne(Xn,Xn.current)}function Hr(){Sa=ql.current,Ce(Xn),Ce(ql)}var Dt=ue(null),Yt=null;function Ba(e){var t=e.alternate;ne(Ve,Ve.current&1),ne(Dt,e),Yt===null&&(t===null||Xn.current!==null||t.memoizedState!==null)&&(Yt=e)}function qr(e){ne(Ve,Ve.current),ne(Dt,e),Yt===null&&(Yt=e)}function Vu(e){e.tag===22?(ne(Ve,Ve.current),ne(Dt,e),Yt===null&&(Yt=e)):Ha()}function Ha(){ne(Ve,Ve.current),ne(Dt,Dt.current)}function kt(e){Ce(Dt),Yt===e&&(Yt=null),Ce(Ve)}var Ve=ue(0);function Gl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xc(n)||Kc(n)))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 xa=0,me=null,Te=null,Ze=null,Ql=!1,Kn=!1,pn=!1,Yl=0,Hs=0,Zn=null,qx=0;function Qe(){throw Error(u(321))}function Gr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tt(e[n],t[n]))return!1;return!0}function Qr(e,t,n,s,l,r){return xa=r,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Ad:nc,pn=!1,r=n(s,l),pn=!1,Kn&&(r=Xu(t,n,s,l)),Fu(e),r}function Fu(e){j.H=Qs;var t=Te!==null&&Te.next!==null;if(xa=0,Ze=Te=me=null,Ql=!1,Hs=0,Zn=null,t)throw Error(u(300));e===null||Je||(e=e.dependencies,e!==null&&_l(e)&&(Je=!0))}function Xu(e,t,n,s){me=e;var l=0;do{if(Kn&&(Zn=null),Hs=0,Kn=!1,25<=l)throw Error(u(301));if(l+=1,Ze=Te=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}j.H=Td,r=t(n,s)}while(Kn);return r}function Gx(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?qs(t):t,e=e.useState()[0],(Te!==null?Te.memoizedState:null)!==e&&(me.flags|=1024),t}function Yr(){var e=Yl!==0;return Yl=0,e}function Vr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fr(e){if(Ql){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ql=!1}xa=0,Ze=Te=me=null,Kn=!1,Hs=Yl=0,Zn=null}function mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Fe(){if(Te===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Ze===null?me.memoizedState:Ze.next;if(t!==null)Ze=t,Te=e;else{if(e===null)throw me.alternate===null?Error(u(467)):Error(u(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qs(e){var t=Hs;return Hs+=1,Zn===null&&(Zn=[]),e=Uu(Zn,e,t),t=me,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Ad:nc),e}function Fl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return qs(e);if(e.$$typeof===S)return lt(e)}throw Error(u(438,String(e)))}function Xr(e){var t=null,n=me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=me.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Vl(),me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=se;return t.index++,n}function ga(e,t){return typeof t=="function"?t(e):t}function Xl(e){var t=Fe();return Kr(t,Te,e)}function Kr(e,t,n){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=n;var l=e.baseQueue,r=s.pending;if(r!==null){if(l!==null){var o=l.next;l.next=r.next,r.next=o}t.baseQueue=l=r,s.pending=null}if(r=e.baseState,l===null)e.memoizedState=r;else{t=l.next;var f=o=null,p=null,_=t,G=!1;do{var V=_.lane&-536870913;if(V!==_.lane?(pe&V)===V:(xa&V)===V){var R=_.revertLane;if(R===0)p!==null&&(p=p.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),V===Qn&&(G=!0);else if((xa&R)===R){_=_.next,R===Qn&&(G=!0);continue}else V={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},p===null?(f=p=V,o=r):p=p.next=V,me.lanes|=R,Qa|=R;V=_.action,pn&&n(r,V),r=_.hasEagerState?_.eagerState:n(r,V)}else R={lane:V,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},p===null?(f=p=R,o=r):p=p.next=R,me.lanes|=V,Qa|=V;_=_.next}while(_!==null&&_!==t);if(p===null?o=r:p.next=f,!Tt(r,e.memoizedState)&&(Je=!0,G&&(n=Yn,n!==null)))throw n;e.memoizedState=r,e.baseState=o,e.baseQueue=p,s.lastRenderedState=r}return l===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Zr(e){var t=Fe(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var s=n.dispatch,l=n.pending,r=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do r=e(r,o.action),o=o.next;while(o!==l);Tt(r,t.memoizedState)||(Je=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,s]}function Ku(e,t,n){var s=me,l=Fe(),r=ve;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var o=!Tt((Te||l).memoizedState,n);if(o&&(l.memoizedState=n,Je=!0),l=l.queue,Wr($u.bind(null,s,l,e),[e]),l.getSnapshot!==t||o||Ze!==null&&Ze.memoizedState.tag&1){if(s.flags|=2048,Jn(9,{destroy:void 0},Ju.bind(null,s,l,n,t),null),ke===null)throw Error(u(349));r||(xa&127)!==0||Zu(s,t,n)}return n}function Zu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t=Vl(),me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ju(e,t,n,s){t.value=n,t.getSnapshot=s,Wu(t)&&Iu(e)}function $u(e,t,n){return n(function(){Wu(t)&&Iu(e)})}function Wu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tt(e,n)}catch{return!0}}function Iu(e){var t=cn(e,2);t!==null&&jt(t,e,2)}function Jr(e){var t=mt();if(typeof e=="function"){var n=e;if(e=n(),pn){Ta(!0);try{n()}finally{Ta(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},t}function Pu(e,t,n,s){return e.baseState=n,Kr(e,Te,typeof s=="function"?s:ga)}function Qx(e,t,n,s,l){if(Jl(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){r.listeners.push(o)}};j.T!==null?n(!0):r.isTransition=!1,s(r),n=t.pending,n===null?(r.next=t.pending=r,ed(t,r)):(r.next=n.next,t.pending=n.next=r)}}function ed(e,t){var n=t.action,s=t.payload,l=e.state;if(t.isTransition){var r=j.T,o={};j.T=o;try{var f=n(l,s),p=j.S;p!==null&&p(o,f),td(e,t,f)}catch(_){$r(e,t,_)}finally{r!==null&&o.types!==null&&(r.types=o.types),j.T=r}}else try{r=n(l,s),td(e,t,r)}catch(_){$r(e,t,_)}}function td(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){ad(e,t,s)},function(s){return $r(e,t,s)}):ad(e,t,n)}function ad(e,t,n){t.status="fulfilled",t.value=n,nd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ed(e,n)))}function $r(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,nd(t),t=t.next;while(t!==s)}e.action=null}function nd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sd(e,t){return t}function ld(e,t){if(ve){var n=ke.formState;if(n!==null){e:{var s=me;if(ve){if(Le){t:{for(var l=Le,r=Qt;l.nodeType!==8;){if(!r){l=null;break t}if(l=Vt(l.nextSibling),l===null){l=null;break t}}r=l.data,l=r==="F!"||r==="F"?l:null}if(l){Le=Vt(l.nextSibling),s=l.data==="F!";break e}}_a(s)}s=!1}s&&(t=n[0])}}return n=mt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sd,lastRenderedState:t},n.queue=s,n=wd.bind(null,me,s),s.dispatch=n,s=Jr(!1),r=ac.bind(null,me,!1,s.queue),s=mt(),l={state:t,dispatch:null,action:e,pending:null},s.queue=l,n=Qx.bind(null,me,l,r,n),l.dispatch=n,s.memoizedState=e,[t,n,!1]}function id(e){var t=Fe();return rd(t,Te,e)}function rd(e,t,n){if(t=Kr(e,t,sd)[0],e=Xl(ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=qs(t)}catch(o){throw o===Vn?Ul:o}else s=t;t=Fe();var l=t.queue,r=l.dispatch;return n!==t.memoizedState&&(me.flags|=2048,Jn(9,{destroy:void 0},Yx.bind(null,l,n),null)),[s,r,e]}function Yx(e,t){e.action=t}function cd(e){var t=Fe(),n=Te;if(n!==null)return rd(t,n,e);Fe(),t=t.memoizedState,n=Fe();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Jn(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=me.updateQueue,t===null&&(t=Vl(),me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function od(){return Fe().memoizedState}function Kl(e,t,n,s){var l=mt();me.flags|=e,l.memoizedState=Jn(1|t,{destroy:void 0},n,s===void 0?null:s)}function Zl(e,t,n,s){var l=Fe();s=s===void 0?null:s;var r=l.memoizedState.inst;Te!==null&&s!==null&&Gr(s,Te.memoizedState.deps)?l.memoizedState=Jn(t,r,n,s):(me.flags|=e,l.memoizedState=Jn(1|t,r,n,s))}function ud(e,t){Kl(8390656,8,e,t)}function Wr(e,t){Zl(2048,8,e,t)}function Vx(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Vl(),me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function dd(e){var t=Fe().memoizedState;return Vx({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return Zl(4,2,e,t)}function md(e,t){return Zl(4,4,e,t)}function hd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xd(e,t,n){n=n!=null?n.concat([e]):null,Zl(4,4,hd.bind(null,t,e),n)}function Ir(){}function gd(e,t){var n=Fe();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Gr(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function pd(e,t){var n=Fe();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Gr(t,s[1]))return s[0];if(s=e(),pn){Ta(!0);try{e()}finally{Ta(!1)}}return n.memoizedState=[s,t],s}function Pr(e,t,n){return n===void 0||(xa&1073741824)!==0&&(pe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=bf(),me.lanes|=e,Qa|=e,n)}function yd(e,t,n,s){return Tt(n,t)?n:Xn.current!==null?(e=Pr(e,n,s),Tt(e,t)||(Je=!0),e):(xa&42)===0||(xa&1073741824)!==0&&(pe&261930)===0?(Je=!0,e.memoizedState=n):(e=bf(),me.lanes|=e,Qa|=e,t)}function bd(e,t,n,s,l){var r=M.p;M.p=r!==0&&8>r?r:8;var o=j.T,f={};j.T=f,ac(e,!1,t,n);try{var p=l(),_=j.S;if(_!==null&&_(f,p),p!==null&&typeof p=="object"&&typeof p.then=="function"){var G=Hx(p,s);Gs(e,t,G,Ot(e))}else Gs(e,t,s,Ot(e))}catch(V){Gs(e,t,{then:function(){},status:"rejected",reason:V},Ot())}finally{M.p=r,o!==null&&f.types!==null&&(o.types=f.types),j.T=o}}function Fx(){}function ec(e,t,n,s){if(e.tag!==5)throw Error(u(476));var l=jd(e).queue;bd(e,l,t,I,n===null?Fx:function(){return vd(e),n(s)})}function jd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vd(e){var t=jd(e);t.next===null&&(t=e.alternate.memoizedState),Gs(e,t.next.queue,{},Ot())}function tc(){return lt(sl)}function Nd(){return Fe().memoizedState}function Sd(){return Fe().memoizedState}function Xx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ot();e=Ua(n);var s=La(t,e,n);s!==null&&(jt(s,t,n),Us(s,t,n)),t={cache:Dr()},e.payload=t;return}t=t.return}}function Kx(e,t,n){var s=Ot();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Jl(e)?Cd(t,n):(n=br(e,t,n,s),n!==null&&(jt(n,e,s),zd(n,t,s)))}function wd(e,t,n){var s=Ot();Gs(e,t,n,s)}function Gs(e,t,n,s){var l={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jl(e))Cd(t,l);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,f=r(o,n);if(l.hasEagerState=!0,l.eagerState=f,Tt(f,o))return El(e,t,l,0),ke===null&&Tl(),!1}catch{}if(n=br(e,t,l,s),n!==null)return jt(n,e,s),zd(n,t,s),!0}return!1}function ac(e,t,n,s){if(s={lane:2,revertLane:Oc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Jl(e)){if(t)throw Error(u(479))}else t=br(e,n,s,2),t!==null&&jt(t,e,2)}function Jl(e){var t=e.alternate;return e===me||t!==null&&t===me}function Cd(e,t){Kn=Ql=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zd(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ko(e,n)}}var Qs={readContext:lt,use:Fl,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Qs.useEffectEvent=Qe;var Ad={readContext:lt,use:Fl,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:ud,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Kl(4194308,4,hd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kl(4194308,4,e,t)},useInsertionEffect:function(e,t){Kl(4,2,e,t)},useMemo:function(e,t){var n=mt();t=t===void 0?null:t;var s=e();if(pn){Ta(!0);try{e()}finally{Ta(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=mt();if(n!==void 0){var l=n(t);if(pn){Ta(!0);try{n(t)}finally{Ta(!1)}}}else l=t;return s.memoizedState=s.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},s.queue=e,e=e.dispatch=Kx.bind(null,me,e),[s.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:function(e){e=Jr(e);var t=e.queue,n=wd.bind(null,me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ir,useDeferredValue:function(e,t){var n=mt();return Pr(n,e,t)},useTransition:function(){var e=Jr(!1);return e=bd.bind(null,me,e.queue,!0,!1),mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=me,l=mt();if(ve){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),ke===null)throw Error(u(349));(pe&127)!==0||Zu(s,t,n)}l.memoizedState=n;var r={value:n,getSnapshot:t};return l.queue=r,ud($u.bind(null,s,r,e),[e]),s.flags|=2048,Jn(9,{destroy:void 0},Ju.bind(null,s,r,n,t),null),n},useId:function(){var e=mt(),t=ke.identifierPrefix;if(ve){var n=Wt,s=$t;n=(s&~(1<<32-At(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Yl++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=qx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:ld,useActionState:ld,useOptimistic:function(e){var t=mt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ac.bind(null,me,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xr,useCacheRefresh:function(){return mt().memoizedState=Xx.bind(null,me)},useEffectEvent:function(e){var t=mt(),n={impl:e};return t.memoizedState=n,function(){if((we&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},nc={readContext:lt,use:Fl,useCallback:gd,useContext:lt,useEffect:Wr,useImperativeHandle:xd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:pd,useReducer:Xl,useRef:od,useState:function(){return Xl(ga)},useDebugValue:Ir,useDeferredValue:function(e,t){var n=Fe();return yd(n,Te.memoizedState,e,t)},useTransition:function(){var e=Xl(ga)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:qs(e),t]},useSyncExternalStore:Ku,useId:Nd,useHostTransitionStatus:tc,useFormState:id,useActionState:id,useOptimistic:function(e,t){var n=Fe();return Pu(n,Te,e,t)},useMemoCache:Xr,useCacheRefresh:Sd};nc.useEffectEvent=dd;var Td={readContext:lt,use:Fl,useCallback:gd,useContext:lt,useEffect:Wr,useImperativeHandle:xd,useInsertionEffect:fd,useLayoutEffect:md,useMemo:pd,useReducer:Zr,useRef:od,useState:function(){return Zr(ga)},useDebugValue:Ir,useDeferredValue:function(e,t){var n=Fe();return Te===null?Pr(n,e,t):yd(n,Te.memoizedState,e,t)},useTransition:function(){var e=Zr(ga)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:qs(e),t]},useSyncExternalStore:Ku,useId:Nd,useHostTransitionStatus:tc,useFormState:cd,useActionState:cd,useOptimistic:function(e,t){var n=Fe();return Te!==null?Pu(n,Te,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xr,useCacheRefresh:Sd};Td.useEffectEvent=dd;function sc(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var lc={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ot(),l=Ua(s);l.payload=t,n!=null&&(l.callback=n),t=La(e,l,s),t!==null&&(jt(t,e,s),Us(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ot(),l=Ua(s);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=La(e,l,s),t!==null&&(jt(t,e,s),Us(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ot(),s=Ua(n);s.tag=2,t!=null&&(s.callback=t),t=La(e,s,n),t!==null&&(jt(t,e,n),Us(t,e,n))}};function Ed(e,t,n,s,l,r,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,r,o):t.prototype&&t.prototype.isPureReactComponent?!Ts(n,s)||!Ts(l,r):!0}function Dd(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&lc.enqueueReplaceState(t,t.state,null)}function yn(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=D({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}function kd(e){Al(e)}function Md(e){console.error(e)}function _d(e){Al(e)}function $l(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Od(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function ic(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){$l(e,t)},n}function Rd(e){return e=Ua(e),e.tag=3,e}function Ud(e,t,n,s){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var r=s.value;e.payload=function(){return l(r)},e.callback=function(){Od(t,n,s)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Od(t,n,s),typeof l!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var f=s.stack;this.componentDidCatch(s.value,{componentStack:f!==null?f:""})})}function Zx(e,t,n,s,l){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Gn(t,n,l,!0),n=Dt.current,n!==null){switch(n.tag){case 31:case 13:return Yt===null?ci():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=l,s===Ll?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),kc(e,s,l)),!1;case 22:return n.flags|=65536,s===Ll?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),kc(e,s,l)),!1}throw Error(u(435,n.tag))}return kc(e,s,l),ci(),!1}if(ve)return t=Dt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,s!==Cr&&(e=Error(u(422),{cause:s}),ks(Ht(e,n)))):(s!==Cr&&(t=Error(u(423),{cause:s}),ks(Ht(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,s=Ht(s,n),l=ic(e.stateNode,s,l),Ur(e,l),Ye!==4&&(Ye=2)),!1;var r=Error(u(520),{cause:s});if(r=Ht(r,n),$s===null?$s=[r]:$s.push(r),Ye!==4&&(Ye=2),t===null)return!0;s=Ht(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=ic(n.stateNode,s,e),Ur(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Ya===null||!Ya.has(r))))return n.flags|=65536,l&=-l,n.lanes|=l,l=Rd(l),Ud(l,e,n,s),Ur(n,l),!1}n=n.return}while(n!==null);return!1}var rc=Error(u(461)),Je=!1;function it(e,t,n,s){t.child=e===null?qu(t,null,n,s):gn(t,e.child,n,s)}function Ld(e,t,n,s,l){n=n.render;var r=t.ref;if("ref"in s){var o={};for(var f in s)f!=="ref"&&(o[f]=s[f])}else o=s;return fn(t),s=Qr(e,t,n,o,r,l),f=Yr(),e!==null&&!Je?(Vr(e,t,l),pa(e,t,l)):(ve&&f&&Sr(t),t.flags|=1,it(e,t,s,l),t.child)}function Bd(e,t,n,s,l){if(e===null){var r=n.type;return typeof r=="function"&&!jr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Hd(e,t,r,s,l)):(e=kl(n.type,null,s,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!xc(e,l)){var o=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ts,n(o,s)&&e.ref===t.ref)return pa(e,t,l)}return t.flags|=1,e=da(r,s),e.ref=t.ref,e.return=t,t.child=e}function Hd(e,t,n,s,l){if(e!==null){var r=e.memoizedProps;if(Ts(r,s)&&e.ref===t.ref)if(Je=!1,t.pendingProps=s=r,xc(e,l))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,pa(e,t,l)}return cc(e,t,n,s,l)}function qd(e,t,n,s){var l=s.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(s=t.child=e.child,l=0;s!==null;)l=l|s.lanes|s.childLanes,s=s.sibling;s=l&~r}else s=0,t.child=null;return Gd(e,t,r,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Rl(t,r!==null?r.cachePool:null),r!==null?Yu(t,r):Br(),Vu(t);else return s=t.lanes=536870912,Gd(e,t,r!==null?r.baseLanes|n:n,n,s)}else r!==null?(Rl(t,r.cachePool),Yu(t,r),Ha(),t.memoizedState=null):(e!==null&&Rl(t,null),Br(),Ha());return it(e,t,l,n),t.child}function Ys(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gd(e,t,n,s,l){var r=Mr();return r=r===null?null:{parent:Ke._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Rl(t,null),Br(),Vu(t),e!==null&&Gn(e,t,s,!0),t.childLanes=l,null}function Wl(e,t){return t=Pl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qd(e,t,n){return gn(t,e.child,null,n),e=Wl(t,t.pendingProps),e.flags|=2,kt(t),t.memoizedState=null,e}function Jx(e,t,n){var s=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ve){if(s.mode==="hidden")return e=Wl(t,s),t.lanes=536870912,Ys(null,e);if(qr(t),(e=Le)?(e=tm(e,Qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:$t,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},n=Cu(e),n.return=t,t.child=n,st=t,Le=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return Wl(t,s)}var r=e.memoizedState;if(r!==null){var o=r.dehydrated;if(qr(t),l)if(t.flags&256)t.flags&=-257,t=Qd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Je||Gn(e,t,n,!1),l=(n&e.childLanes)!==0,Je||l){if(s=ke,s!==null&&(o=Mo(s,n),o!==0&&o!==r.retryLane))throw r.retryLane=o,cn(e,o),jt(s,e,o),rc;ci(),t=Qd(e,t,n)}else e=r.treeContext,Le=Vt(o.nextSibling),st=t,ve=!0,Ma=null,Qt=!1,e!==null&&Tu(t,e),t=Wl(t,s),t.flags|=4096;return t}return e=da(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Il(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,s,l){return fn(t),n=Qr(e,t,n,s,void 0,l),s=Yr(),e!==null&&!Je?(Vr(e,t,l),pa(e,t,l)):(ve&&s&&Sr(t),t.flags|=1,it(e,t,n,l),t.child)}function Yd(e,t,n,s,l,r){return fn(t),t.updateQueue=null,n=Xu(t,s,n,l),Fu(e),s=Yr(),e!==null&&!Je?(Vr(e,t,r),pa(e,t,r)):(ve&&s&&Sr(t),t.flags|=1,it(e,t,n,r),t.child)}function Vd(e,t,n,s,l){if(fn(t),t.stateNode===null){var r=Ln,o=n.contextType;typeof o=="object"&&o!==null&&(r=lt(o)),r=new n(s,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=lc,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=s,r.state=t.memoizedState,r.refs={},Or(t),o=n.contextType,r.context=typeof o=="object"&&o!==null?lt(o):Ln,r.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(sc(t,n,o,s),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(o=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),o!==r.state&&lc.enqueueReplaceState(r,r.state,null),Bs(t,s,r,l),Ls(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){r=t.stateNode;var f=t.memoizedProps,p=yn(n,f);r.props=p;var _=r.context,G=n.contextType;o=Ln,typeof G=="object"&&G!==null&&(o=lt(G));var V=n.getDerivedStateFromProps;G=typeof V=="function"||typeof r.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,G||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f||_!==o)&&Dd(t,r,s,o),Ra=!1;var R=t.memoizedState;r.state=R,Bs(t,s,r,l),Ls(),_=t.memoizedState,f||R!==_||Ra?(typeof V=="function"&&(sc(t,n,V,s),_=t.memoizedState),(p=Ra||Ed(t,n,p,s,R,_,o))?(G||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=_),r.props=s,r.state=_,r.context=o,s=p):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{r=t.stateNode,Rr(e,t),o=t.memoizedProps,G=yn(n,o),r.props=G,V=t.pendingProps,R=r.context,_=n.contextType,p=Ln,typeof _=="object"&&_!==null&&(p=lt(_)),f=n.getDerivedStateFromProps,(_=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o!==V||R!==p)&&Dd(t,r,s,p),Ra=!1,R=t.memoizedState,r.state=R,Bs(t,s,r,l),Ls();var B=t.memoizedState;o!==V||R!==B||Ra||e!==null&&e.dependencies!==null&&_l(e.dependencies)?(typeof f=="function"&&(sc(t,n,f,s),B=t.memoizedState),(G=Ra||Ed(t,n,G,s,R,B,p)||e!==null&&e.dependencies!==null&&_l(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(s,B,p),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(s,B,p)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=B),r.props=s,r.state=B,r.context=p,s=G):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),s=!1)}return r=s,Il(e,t),s=(t.flags&128)!==0,r||s?(r=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&s?(t.child=gn(t,e.child,null,l),t.child=gn(t,null,n,l)):it(e,t,n,l),t.memoizedState=r.state,e=t.child):e=pa(e,t,l),e}function Fd(e,t,n,s){return un(),t.flags|=256,it(e,t,n,s),t.child}var oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uc(e){return{baseLanes:e,cachePool:Ou()}}function dc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=_t),e}function Xd(e,t,n){var s=t.pendingProps,l=!1,r=(t.flags&128)!==0,o;if((o=r)||(o=e!==null&&e.memoizedState===null?!1:(Ve.current&2)!==0),o&&(l=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ve){if(l?Ba(t):Ha(),(e=Le)?(e=tm(e,Qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:$t,overflow:Wt}:null,retryLane:536870912,hydrationErrors:null},n=Cu(e),n.return=t,t.child=n,st=t,Le=null)):e=null,e===null)throw _a(t);return Kc(e)?t.lanes=32:t.lanes=536870912,null}var f=s.children;return s=s.fallback,l?(Ha(),l=t.mode,f=Pl({mode:"hidden",children:f},l),s=on(s,l,n,null),f.return=t,s.return=t,f.sibling=s,t.child=f,s=t.child,s.memoizedState=uc(n),s.childLanes=dc(e,o,n),t.memoizedState=oc,Ys(null,s)):(Ba(t),fc(t,f))}var p=e.memoizedState;if(p!==null&&(f=p.dehydrated,f!==null)){if(r)t.flags&256?(Ba(t),t.flags&=-257,t=mc(e,t,n)):t.memoizedState!==null?(Ha(),t.child=e.child,t.flags|=128,t=null):(Ha(),f=s.fallback,l=t.mode,s=Pl({mode:"visible",children:s.children},l),f=on(f,l,n,null),f.flags|=2,s.return=t,f.return=t,s.sibling=f,t.child=s,gn(t,e.child,null,n),s=t.child,s.memoizedState=uc(n),s.childLanes=dc(e,o,n),t.memoizedState=oc,t=Ys(null,s));else if(Ba(t),Kc(f)){if(o=f.nextSibling&&f.nextSibling.dataset,o)var _=o.dgst;o=_,s=Error(u(419)),s.stack="",s.digest=o,ks({value:s,source:null,stack:null}),t=mc(e,t,n)}else if(Je||Gn(e,t,n,!1),o=(n&e.childLanes)!==0,Je||o){if(o=ke,o!==null&&(s=Mo(o,n),s!==0&&s!==p.retryLane))throw p.retryLane=s,cn(e,s),jt(o,e,s),rc;Xc(f)||ci(),t=mc(e,t,n)}else Xc(f)?(t.flags|=192,t.child=e.child,t=null):(e=p.treeContext,Le=Vt(f.nextSibling),st=t,ve=!0,Ma=null,Qt=!1,e!==null&&Tu(t,e),t=fc(t,s.children),t.flags|=4096);return t}return l?(Ha(),f=s.fallback,l=t.mode,p=e.child,_=p.sibling,s=da(p,{mode:"hidden",children:s.children}),s.subtreeFlags=p.subtreeFlags&65011712,_!==null?f=da(_,f):(f=on(f,l,n,null),f.flags|=2),f.return=t,s.return=t,s.sibling=f,t.child=s,Ys(null,s),s=t.child,f=e.child.memoizedState,f===null?f=uc(n):(l=f.cachePool,l!==null?(p=Ke._currentValue,l=l.parent!==p?{parent:p,pool:p}:l):l=Ou(),f={baseLanes:f.baseLanes|n,cachePool:l}),s.memoizedState=f,s.childLanes=dc(e,o,n),t.memoizedState=oc,Ys(e.child,s)):(Ba(t),n=e.child,e=n.sibling,n=da(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function fc(e,t){return t=Pl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Pl(e,t){return e=Et(22,e,null,t),e.lanes=0,e}function mc(e,t,n){return gn(t,e.child,null,n),e=fc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kd(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Tr(e.return,t,n)}function hc(e,t,n,s,l,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:l,treeForkCount:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=n,o.tailMode=l,o.treeForkCount=r)}function Zd(e,t,n){var s=t.pendingProps,l=s.revealOrder,r=s.tail;s=s.children;var o=Ve.current,f=(o&2)!==0;if(f?(o=o&1|2,t.flags|=128):o&=1,ne(Ve,o),it(e,t,s,n),s=ve?Ds:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kd(e,n,t);else if(e.tag===19)Kd(e,n,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(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Gl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),hc(t,!1,l,n,r,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Gl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}hc(t,!0,n,null,r,s);break;case"together":hc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qa|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Gn(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=da(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=da(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_l(e)))}function $x(e,t,n){switch(t.tag){case 3:ra(t,t.stateNode.containerInfo),Oa(t,Ke,e.memoizedState.cache),un();break;case 27:case 5:de(t);break;case 4:ra(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qr(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ba(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Xd(e,t,n):(Ba(t),e=pa(e,t,n),e!==null?e.sibling:null);Ba(t);break;case 19:var l=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Gn(e,t,n,!1),s=(n&t.childLanes)!==0),l){if(s)return Zd(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ne(Ve,Ve.current),s)break;return null;case 22:return t.lanes=0,qd(e,t,n,t.pendingProps);case 24:Oa(t,Ke,e.memoizedState.cache)}return pa(e,t,n)}function Jd(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!xc(e,n)&&(t.flags&128)===0)return Je=!1,$x(e,t,n);Je=(e.flags&131072)!==0}else Je=!1,ve&&(t.flags&1048576)!==0&&Au(t,Ds,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=hn(t.elementType),t.type=e,typeof e=="function")jr(e)?(s=yn(e,s),t.tag=1,t=Vd(null,t,e,s,n)):(t.tag=0,t=cc(null,t,e,s,n));else{if(e!=null){var l=e.$$typeof;if(l===X){t.tag=11,t=Ld(null,t,e,s,n);break e}else if(l===F){t.tag=14,t=Bd(null,t,e,s,n);break e}}throw t=W(e)||e,Error(u(306,t,""))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,l=yn(s,t.pendingProps),Vd(e,t,s,l,n);case 3:e:{if(ra(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var r=t.memoizedState;l=r.element,Rr(e,t),Bs(t,s,null,n);var o=t.memoizedState;if(s=o.cache,Oa(t,Ke,s),s!==r.cache&&Er(t,[Ke],n,!0),Ls(),s=o.element,r.isDehydrated)if(r={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Fd(e,t,s,n);break e}else if(s!==l){l=Ht(Error(u(424)),t),ks(l),t=Fd(e,t,s,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Le=Vt(e.firstChild),st=t,ve=!0,Ma=null,Qt=!0,n=qu(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(un(),s===l){t=pa(e,t,n);break e}it(e,t,s,n)}t=t.child}return t;case 26:return Il(e,t),e===null?(n=rm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ve||(n=t.type,e=t.pendingProps,s=xi(ft.current).createElement(n),s[nt]=t,s[ht]=e,rt(s,n,e),et(s),t.stateNode=s):t.memoizedState=rm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&ve&&(s=t.stateNode=sm(t.type,t.pendingProps,ft.current),st=t,Qt=!0,l=Le,Ka(t.type)?(Zc=l,Le=Vt(s.firstChild)):Le=l),it(e,t,t.pendingProps.children,n),Il(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ve&&((l=s=Le)&&(s=zg(s,t.type,t.pendingProps,Qt),s!==null?(t.stateNode=s,st=t,Le=Vt(s.firstChild),Qt=!1,l=!0):l=!1),l||_a(t)),de(t),l=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,s=r.children,Yc(l,r)?s=null:o!==null&&Yc(l,o)&&(t.flags|=32),t.memoizedState!==null&&(l=Qr(e,t,Gx,null,null,n),sl._currentValue=l),Il(e,t),it(e,t,s,n),t.child;case 6:return e===null&&ve&&((e=n=Le)&&(n=Ag(n,t.pendingProps,Qt),n!==null?(t.stateNode=n,st=t,Le=null,e=!0):e=!1),e||_a(t)),null;case 13:return Xd(e,t,n);case 4:return ra(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gn(t,null,s,n):it(e,t,s,n),t.child;case 11:return Ld(e,t,t.type,t.pendingProps,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Oa(t,t.type,s.value),it(e,t,s.children,n),t.child;case 9:return l=t.type._context,s=t.pendingProps.children,fn(t),l=lt(l),s=s(l),t.flags|=1,it(e,t,s,n),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,n);case 15:return Hd(e,t,t.type,t.pendingProps,n);case 19:return Zd(e,t,n);case 31:return Jx(e,t,n);case 22:return qd(e,t,n,t.pendingProps);case 24:return fn(t),s=lt(Ke),e===null?(l=Mr(),l===null&&(l=ke,r=Dr(),l.pooledCache=r,r.refCount++,r!==null&&(l.pooledCacheLanes|=n),l=r),t.memoizedState={parent:s,cache:l},Or(t),Oa(t,Ke,l)):((e.lanes&n)!==0&&(Rr(e,t),Bs(t,null,null,n),Ls()),l=e.memoizedState,r=t.memoizedState,l.parent!==s?(l={parent:s,cache:s},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Oa(t,Ke,s)):(s=r.cache,Oa(t,Ke,s),s!==l.cache&&Er(t,[Ke],n,!0))),it(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ya(e){e.flags|=4}function gc(e,t,n,s,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Sf())e.flags|=8192;else throw xn=Ll,_r}else e.flags&=-16777217}function $d(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fm(t))if(Sf())e.flags|=8192;else throw xn=Ll,_r}function ei(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Eo():536870912,e.lanes|=t,Pn|=t)}function Vs(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,s|=l.subtreeFlags&65011712,s|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Wx(e,t,n){var s=t.pendingProps;switch(wr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ha(Ke),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(qn(t)?ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zr())),Be(t),null;case 26:var l=t.type,r=t.memoizedState;return e===null?(ya(t),r!==null?(Be(t),$d(t,r)):(Be(t),gc(t,l,null,s,n))):r?r!==e.memoizedState?(ya(t),Be(t),$d(t,r)):(Be(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ya(t),Be(t),gc(t,l,e,s,n)),null;case 27:if(Ue(t),n=ft.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return Be(t),null}e=Re.current,qn(t)?Eu(t):(e=sm(l,s,n),t.stateNode=e,ya(t))}return Be(t),null;case 5:if(Ue(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return Be(t),null}if(r=Re.current,qn(t))Eu(t);else{var o=xi(ft.current);switch(r){case 1:r=o.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:r=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":r=o.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":r=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":r=o.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?o.createElement("select",{is:s.is}):o.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?o.createElement(l,{is:s.is}):o.createElement(l)}}r[nt]=t,r[ht]=s;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)r.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=r;e:switch(rt(r,l,s),l){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ya(t)}}return Be(t),gc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ya(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=ft.current,qn(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,l=st,l!==null)switch(l.tag){case 27:case 5:s=l.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||Kf(e.nodeValue,n)),e||_a(t,!0)}else e=xi(e).createTextNode(s),e[nt]=t,t.stateNode=e}return Be(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=qn(t),n!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[nt]=t}else un(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),e=!1}else n=zr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(kt(t),t):(kt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Be(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=qn(t),s!==null&&s.dehydrated!==null){if(e===null){if(!l)throw Error(u(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));l[nt]=t}else un(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),l=!1}else l=zr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(kt(t),t):(kt(t),null)}return kt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,l=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(l=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==l&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ei(t,t.updateQueue),Be(t),null);case 4:return te(),e===null&&Bc(t.stateNode.containerInfo),Be(t),null;case 10:return ha(t.type),Be(t),null;case 19:if(Ce(Ve),s=t.memoizedState,s===null)return Be(t),null;if(l=(t.flags&128)!==0,r=s.rendering,r===null)if(l)Vs(s,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Gl(e),r!==null){for(t.flags|=128,Vs(s,!1),e=r.updateQueue,t.updateQueue=e,ei(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)wu(n,e),n=n.sibling;return ne(Ve,Ve.current&1|2),ve&&fa(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ct()>li&&(t.flags|=128,l=!0,Vs(s,!1),t.lanes=4194304)}else{if(!l)if(e=Gl(r),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,ei(t,e),Vs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!r.alternate&&!ve)return Be(t),null}else 2*Ct()-s.renderingStartTime>li&&n!==536870912&&(t.flags|=128,l=!0,Vs(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ct(),e.sibling=null,n=Ve.current,ne(Ve,l?n&1|2:n&1),ve&&fa(t,s.treeForkCount),e):(Be(t),null);case 22:case 23:return kt(t),Hr(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),n=t.updateQueue,n!==null&&ei(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Ce(mn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Ke),Be(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Ix(e,t){switch(wr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Ke),te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ue(t),null;case 31:if(t.memoizedState!==null){if(kt(t),t.alternate===null)throw Error(u(340));un()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));un()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Ve),null;case 4:return te(),null;case 10:return ha(t.type),null;case 22:case 23:return kt(t),Hr(),e!==null&&Ce(mn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Ke),null;case 25:return null;default:return null}}function Wd(e,t){switch(wr(t),t.tag){case 3:ha(Ke),te();break;case 26:case 27:case 5:Ue(t);break;case 4:te();break;case 31:t.memoizedState!==null&&kt(t);break;case 13:kt(t);break;case 19:Ce(Ve);break;case 10:ha(t.type);break;case 22:case 23:kt(t),Hr(),e!==null&&Ce(mn);break;case 24:ha(Ke)}}function Fs(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var l=s.next;n=l;do{if((n.tag&e)===e){s=void 0;var r=n.create,o=n.inst;s=r(),o.destroy=s}n=n.next}while(n!==l)}}catch(f){Ae(t,t.return,f)}}function qa(e,t,n){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var r=l.next;s=r;do{if((s.tag&e)===e){var o=s.inst,f=o.destroy;if(f!==void 0){o.destroy=void 0,l=t;var p=n,_=f;try{_()}catch(G){Ae(l,p,G)}}}s=s.next}while(s!==r)}}catch(G){Ae(t,t.return,G)}}function Id(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qu(t,n)}catch(s){Ae(e,e.return,s)}}}function Pd(e,t,n){n.props=yn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Ae(e,t,s)}}function Xs(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(l){Ae(e,t,l)}}function It(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(l){Ae(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){Ae(e,t,l)}else n.current=null}function ef(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(l){Ae(e,e.return,l)}}function pc(e,t,n){try{var s=e.stateNode;jg(s,e.type,n,t),s[ht]=t}catch(l){Ae(e,e.return,l)}}function tf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ka(e.type)||e.tag===4}function yc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tf(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&&Ka(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 bc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=oa));else if(s!==4&&(s===27&&Ka(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(bc(e,t,n),e=e.sibling;e!==null;)bc(e,t,n),e=e.sibling}function ti(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Ka(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ti(e,t,n),e=e.sibling;e!==null;)ti(e,t,n),e=e.sibling}function af(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);rt(t,s,n),t[nt]=e,t[ht]=n}catch(r){Ae(e,e.return,r)}}var ba=!1,$e=!1,jc=!1,nf=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Px(e,t){if(e=e.containerInfo,Gc=Ni,e=xu(e),mr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var l=s.anchorOffset,r=s.focusNode;s=s.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var o=0,f=-1,p=-1,_=0,G=0,V=e,R=null;t:for(;;){for(var B;V!==n||l!==0&&V.nodeType!==3||(f=o+l),V!==r||s!==0&&V.nodeType!==3||(p=o+s),V.nodeType===3&&(o+=V.nodeValue.length),(B=V.firstChild)!==null;)R=V,V=B;for(;;){if(V===e)break t;if(R===n&&++_===l&&(f=o),R===r&&++G===s&&(p=o),(B=V.nextSibling)!==null)break;V=R,R=V.parentNode}V=B}n=f===-1||p===-1?null:{start:f,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qc={focusedElem:e,selectionRange:n},Ni=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){switch(t=tt,r=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(n=0;n<e.length;n++)l=e[n],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,l=r.memoizedProps,r=r.memoizedState,s=n.stateNode;try{var ae=yn(n.type,l);e=s.getSnapshotBeforeUpdate(ae,r),s.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Ae(n,n.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Fc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fc(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}}function sf(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:va(e,n),s&4&&Fs(5,n);break;case 1:if(va(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){Ae(n,n.return,o)}else{var l=yn(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Ae(n,n.return,o)}}s&64&&Id(n),s&512&&Xs(n,n.return);break;case 3:if(va(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qu(e,t)}catch(o){Ae(n,n.return,o)}}break;case 27:t===null&&s&4&&af(n);case 26:case 5:va(e,n),t===null&&s&4&&ef(n),s&512&&Xs(n,n.return);break;case 12:va(e,n);break;case 31:va(e,n),s&4&&cf(e,n);break;case 13:va(e,n),s&4&&of(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=cg.bind(null,n),Tg(e,n))));break;case 22:if(s=n.memoizedState!==null||ba,!s){t=t!==null&&t.memoizedState!==null||$e,l=ba;var r=$e;ba=s,($e=t)&&!r?Na(e,n,(n.subtreeFlags&8772)!==0):va(e,n),ba=l,$e=r}break;case 30:break;default:va(e,n)}}function lf(e){var t=e.alternate;t!==null&&(e.alternate=null,lf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$i(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 He=null,gt=!1;function ja(e,t,n){for(n=n.child;n!==null;)rf(e,t,n),n=n.sibling}function rf(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(gs,n)}catch{}switch(n.tag){case 26:$e||It(n,t),ja(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$e||It(n,t);var s=He,l=gt;Ka(n.type)&&(He=n.stateNode,gt=!1),ja(e,t,n),tl(n.stateNode),He=s,gt=l;break;case 5:$e||It(n,t);case 6:if(s=He,l=gt,He=null,ja(e,t,n),He=s,gt=l,He!==null)if(gt)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(n.stateNode)}catch(r){Ae(n,t,r)}else try{He.removeChild(n.stateNode)}catch(r){Ae(n,t,r)}break;case 18:He!==null&&(gt?(e=He,Pf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),rs(e)):Pf(He,n.stateNode));break;case 4:s=He,l=gt,He=n.stateNode.containerInfo,gt=!0,ja(e,t,n),He=s,gt=l;break;case 0:case 11:case 14:case 15:qa(2,n,t),$e||qa(4,n,t),ja(e,t,n);break;case 1:$e||(It(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&Pd(n,t,s)),ja(e,t,n);break;case 21:ja(e,t,n);break;case 22:$e=(s=$e)||n.memoizedState!==null,ja(e,t,n),$e=s;break;default:ja(e,t,n)}}function cf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rs(e)}catch(n){Ae(t,t.return,n)}}}function of(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rs(e)}catch(n){Ae(t,t.return,n)}}function eg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nf),t;default:throw Error(u(435,e.tag))}}function ai(e,t){var n=eg(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var l=og.bind(null,e,s);s.then(l,l)}})}function pt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var l=n[s],r=e,o=t,f=o;e:for(;f!==null;){switch(f.tag){case 27:if(Ka(f.type)){He=f.stateNode,gt=!1;break e}break;case 5:He=f.stateNode,gt=!1;break e;case 3:case 4:He=f.stateNode.containerInfo,gt=!0;break e}f=f.return}if(He===null)throw Error(u(160));rf(r,o,l),He=null,gt=!1,r=l.alternate,r!==null&&(r.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)uf(t,e),t=t.sibling}var Zt=null;function uf(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),yt(e),s&4&&(qa(3,e,e.return),Fs(3,e),qa(5,e,e.return));break;case 1:pt(t,e),yt(e),s&512&&($e||n===null||It(n,n.return)),s&64&&ba&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var l=Zt;if(pt(t,e),yt(e),s&512&&($e||n===null||It(n,n.return)),s&4){var r=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(s){case"title":r=l.getElementsByTagName("title")[0],(!r||r[bs]||r[nt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=l.createElement(s),l.head.insertBefore(r,l.querySelector("head > title"))),rt(r,s,n),r[nt]=e,et(r),s=r;break e;case"link":var o=um("link","href",l).get(s+(n.href||""));if(o){for(var f=0;f<o.length;f++)if(r=o[f],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(f,1);break t}}r=l.createElement(s),rt(r,s,n),l.head.appendChild(r);break;case"meta":if(o=um("meta","content",l).get(s+(n.content||""))){for(f=0;f<o.length;f++)if(r=o[f],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(f,1);break t}}r=l.createElement(s),rt(r,s,n),l.head.appendChild(r);break;default:throw Error(u(468,s))}r[nt]=e,et(r),s=r}e.stateNode=s}else dm(l,e.type,e.stateNode);else e.stateNode=om(l,s,e.memoizedProps);else r!==s?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,s===null?dm(l,e.type,e.stateNode):om(l,s,e.memoizedProps)):s===null&&e.stateNode!==null&&pc(e,e.memoizedProps,n.memoizedProps)}break;case 27:pt(t,e),yt(e),s&512&&($e||n===null||It(n,n.return)),n!==null&&s&4&&pc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pt(t,e),yt(e),s&512&&($e||n===null||It(n,n.return)),e.flags&32){l=e.stateNode;try{Dn(l,"")}catch(ae){Ae(e,e.return,ae)}}s&4&&e.stateNode!=null&&(l=e.memoizedProps,pc(e,l,n!==null?n.memoizedProps:l)),s&1024&&(jc=!0);break;case 6:if(pt(t,e),yt(e),s&4){if(e.stateNode===null)throw Error(u(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ae){Ae(e,e.return,ae)}}break;case 3:if(yi=null,l=Zt,Zt=gi(t.containerInfo),pt(t,e),Zt=l,yt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(ae){Ae(e,e.return,ae)}jc&&(jc=!1,df(e));break;case 4:s=Zt,Zt=gi(e.stateNode.containerInfo),pt(t,e),yt(e),Zt=s;break;case 12:pt(t,e),yt(e);break;case 31:pt(t,e),yt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ai(e,s)));break;case 13:pt(t,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(si=Ct()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ai(e,s)));break;case 22:l=e.memoizedState!==null;var p=n!==null&&n.memoizedState!==null,_=ba,G=$e;if(ba=_||l,$e=G||p,pt(t,e),$e=G,ba=_,yt(e),s&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||p||ba||$e||bn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){p=n=t;try{if(r=p.stateNode,l)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{f=p.stateNode;var V=p.memoizedProps.style,R=V!=null&&V.hasOwnProperty("display")?V.display:null;f.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(ae){Ae(p,p.return,ae)}}}else if(t.tag===6){if(n===null){p=t;try{p.stateNode.nodeValue=l?"":p.memoizedProps}catch(ae){Ae(p,p.return,ae)}}}else if(t.tag===18){if(n===null){p=t;try{var B=p.stateNode;l?em(B,!0):em(p.stateNode,!1)}catch(ae){Ae(p,p.return,ae)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,ai(e,n))));break;case 19:pt(t,e),yt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,ai(e,s)));break;case 30:break;case 21:break;default:pt(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(tf(s)){n=s;break}s=s.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var l=n.stateNode,r=yc(e);ti(e,r,l);break;case 5:var o=n.stateNode;n.flags&32&&(Dn(o,""),n.flags&=-33);var f=yc(e);ti(e,f,o);break;case 3:case 4:var p=n.stateNode.containerInfo,_=yc(e);bc(e,_,p);break;default:throw Error(u(161))}}catch(G){Ae(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function df(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;df(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function va(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sf(e,t.alternate,t),t=t.sibling}function bn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qa(4,t,t.return),bn(t);break;case 1:It(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Pd(t,t.return,n),bn(t);break;case 27:tl(t.stateNode);case 26:case 5:It(t,t.return),bn(t);break;case 22:t.memoizedState===null&&bn(t);break;case 30:bn(t);break;default:bn(t)}e=e.sibling}}function Na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,l=e,r=t,o=r.flags;switch(r.tag){case 0:case 11:case 15:Na(l,r,n),Fs(4,r);break;case 1:if(Na(l,r,n),s=r,l=s.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(_){Ae(s,s.return,_)}if(s=r,l=s.updateQueue,l!==null){var f=s.stateNode;try{var p=l.shared.hiddenCallbacks;if(p!==null)for(l.shared.hiddenCallbacks=null,l=0;l<p.length;l++)Gu(p[l],f)}catch(_){Ae(s,s.return,_)}}n&&o&64&&Id(r),Xs(r,r.return);break;case 27:af(r);case 26:case 5:Na(l,r,n),n&&s===null&&o&4&&ef(r),Xs(r,r.return);break;case 12:Na(l,r,n);break;case 31:Na(l,r,n),n&&o&4&&cf(l,r);break;case 13:Na(l,r,n),n&&o&4&&of(l,r);break;case 22:r.memoizedState===null&&Na(l,r,n),Xs(r,r.return);break;case 30:break;default:Na(l,r,n)}t=t.sibling}}function vc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ms(n))}function Nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(e))}function Jt(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ff(e,t,n,s),t=t.sibling}function ff(e,t,n,s){var l=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,n,s),l&2048&&Fs(9,t);break;case 1:Jt(e,t,n,s);break;case 3:Jt(e,t,n,s),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(e)));break;case 12:if(l&2048){Jt(e,t,n,s),e=t.stateNode;try{var r=t.memoizedProps,o=r.id,f=r.onPostCommit;typeof f=="function"&&f(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(p){Ae(t,t.return,p)}}else Jt(e,t,n,s);break;case 31:Jt(e,t,n,s);break;case 13:Jt(e,t,n,s);break;case 23:break;case 22:r=t.stateNode,o=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,n,s):Ks(e,t):r._visibility&2?Jt(e,t,n,s):(r._visibility|=2,$n(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),l&2048&&vc(o,t);break;case 24:Jt(e,t,n,s),l&2048&&Nc(t.alternate,t);break;default:Jt(e,t,n,s)}}function $n(e,t,n,s,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,o=t,f=n,p=s,_=o.flags;switch(o.tag){case 0:case 11:case 15:$n(r,o,f,p,l),Fs(8,o);break;case 23:break;case 22:var G=o.stateNode;o.memoizedState!==null?G._visibility&2?$n(r,o,f,p,l):Ks(r,o):(G._visibility|=2,$n(r,o,f,p,l)),l&&_&2048&&vc(o.alternate,o);break;case 24:$n(r,o,f,p,l),l&&_&2048&&Nc(o.alternate,o);break;default:$n(r,o,f,p,l)}t=t.sibling}}function Ks(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,l=s.flags;switch(s.tag){case 22:Ks(n,s),l&2048&&vc(s.alternate,s);break;case 24:Ks(n,s),l&2048&&Nc(s.alternate,s);break;default:Ks(n,s)}t=t.sibling}}var Zs=8192;function Wn(e,t,n){if(e.subtreeFlags&Zs)for(e=e.child;e!==null;)mf(e,t,n),e=e.sibling}function mf(e,t,n){switch(e.tag){case 26:Wn(e,t,n),e.flags&Zs&&e.memoizedState!==null&&qg(n,Zt,e.memoizedState,e.memoizedProps);break;case 5:Wn(e,t,n);break;case 3:case 4:var s=Zt;Zt=gi(e.stateNode.containerInfo),Wn(e,t,n),Zt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Zs,Zs=16777216,Wn(e,t,n),Zs=s):Wn(e,t,n));break;default:Wn(e,t,n)}}function hf(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 Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];tt=s,gf(s,e)}hf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xf(e),e=e.sibling}function xf(e){switch(e.tag){case 0:case 11:case 15:Js(e),e.flags&2048&&qa(9,e,e.return);break;case 3:Js(e);break;case 12:Js(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ni(e)):Js(e);break;default:Js(e)}}function ni(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];tt=s,gf(s,e)}hf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qa(8,t,t.return),ni(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ni(t));break;default:ni(t)}e=e.sibling}}function gf(e,t){for(;tt!==null;){var n=tt;switch(n.tag){case 0:case 11:case 15:qa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ms(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,tt=s;else e:for(n=e;tt!==null;){s=tt;var l=s.sibling,r=s.return;if(lf(s),s===n){tt=null;break e}if(l!==null){l.return=r,tt=l;break e}tt=r}}}var tg={getCacheForType:function(e){var t=lt(Ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return lt(Ke).controller.signal}},ag=typeof WeakMap=="function"?WeakMap:Map,we=0,ke=null,xe=null,pe=0,ze=0,Mt=null,Ga=!1,In=!1,Sc=!1,Sa=0,Ye=0,Qa=0,jn=0,wc=0,_t=0,Pn=0,$s=null,bt=null,Cc=!1,si=0,pf=0,li=1/0,ii=null,Ya=null,Ie=0,Va=null,es=null,wa=0,zc=0,Ac=null,yf=null,Ws=0,Tc=null;function Ot(){return(we&2)!==0&&pe!==0?pe&-pe:j.T!==null?Oc():_o()}function bf(){if(_t===0)if((pe&536870912)===0||ve){var e=hl;hl<<=1,(hl&3932160)===0&&(hl=262144),_t=e}else _t=536870912;return e=Dt.current,e!==null&&(e.flags|=32),_t}function jt(e,t,n){(e===ke&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(ts(e,0),Fa(e,pe,_t,!1)),ys(e,n),((we&2)===0||e!==ke)&&(e===ke&&((we&2)===0&&(jn|=n),Ye===4&&Fa(e,pe,_t,!1)),Pt(e))}function jf(e,t,n){if((we&6)!==0)throw Error(u(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ps(e,t),l=s?lg(e,t):Dc(e,t,!0),r=s;do{if(l===0){In&&!s&&Fa(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!ng(n)){l=Dc(e,t,!1),r=!1;continue}if(l===2){if(r=t,e.errorRecoveryDisabledLanes&r)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var f=e;l=$s;var p=f.current.memoizedState.isDehydrated;if(p&&(ts(f,o).flags|=256),o=Dc(f,o,!1),o!==2){if(Sc&&!p){f.errorRecoveryDisabledLanes|=r,jn|=r,l=4;break e}r=bt,bt=l,r!==null&&(bt===null?bt=r:bt.push.apply(bt,r))}l=o}if(r=!1,l!==2)continue}}if(l===1){ts(e,0),Fa(e,t,0,!0);break}e:{switch(s=e,r=l,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Fa(s,t,_t,!Ga);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(l=si+300-Ct(),10<l)){if(Fa(s,t,_t,!Ga),gl(s,0,!0)!==0)break e;wa=t,s.timeoutHandle=Wf(vf.bind(null,s,n,bt,ii,Cc,t,_t,jn,Pn,Ga,r,"Throttled",-0,0),l);break e}vf(s,n,bt,ii,Cc,t,_t,jn,Pn,Ga,r,null,-0,0)}}break}while(!0);Pt(e)}function vf(e,t,n,s,l,r,o,f,p,_,G,V,R,B){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oa},mf(t,r,V);var ae=(r&62914560)===r?si-Ct():(r&4194048)===r?pf-Ct():0;if(ae=Gg(V,ae),ae!==null){wa=r,e.cancelPendingCommit=ae(Ef.bind(null,e,t,r,n,s,l,o,f,p,G,V,null,R,B)),Fa(e,r,o,!_);return}}Ef(e,t,r,n,s,l,o,f,p)}function ng(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var l=n[s],r=l.getSnapshot;l=l.value;try{if(!Tt(r(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Fa(e,t,n,s){t&=~wc,t&=~jn,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var l=t;0<l;){var r=31-At(l),o=1<<r;s[r]=-1,l&=~o}n!==0&&Do(e,n,t)}function ri(){return(we&6)===0?(Is(0),!1):!0}function Ec(){if(xe!==null){if(ze===0)var e=xe.return;else e=xe,ma=dn=null,Fr(e),Fn=null,Os=0,e=xe;for(;e!==null;)Wd(e.alternate,e),e=e.return;xe=null}}function ts(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Sg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wa=0,Ec(),ke=e,xe=n=da(e.current,null),pe=t,ze=0,Mt=null,Ga=!1,In=ps(e,t),Sc=!1,Pn=_t=wc=jn=Qa=Ye=0,bt=$s=null,Cc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var l=31-At(s),r=1<<l;t|=e[l],s&=~r}return Sa=t,Tl(),n}function Nf(e,t){me=null,j.H=Qs,t===Vn||t===Ul?(t=Lu(),ze=3):t===_r?(t=Lu(),ze=4):ze=t===rc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mt=t,xe===null&&(Ye=1,$l(e,Ht(t,e.current)))}function Sf(){var e=Dt.current;return e===null?!0:(pe&4194048)===pe?Yt===null:(pe&62914560)===pe||(pe&536870912)!==0?e===Yt:!1}function wf(){var e=j.H;return j.H=Qs,e===null?Qs:e}function Cf(){var e=j.A;return j.A=tg,e}function ci(){Ye=4,Ga||(pe&4194048)!==pe&&Dt.current!==null||(In=!0),(Qa&134217727)===0&&(jn&134217727)===0||ke===null||Fa(ke,pe,_t,!1)}function Dc(e,t,n){var s=we;we|=2;var l=wf(),r=Cf();(ke!==e||pe!==t)&&(ii=null,ts(e,t)),t=!1;var o=Ye;e:do try{if(ze!==0&&xe!==null){var f=xe,p=Mt;switch(ze){case 8:Ec(),o=6;break e;case 3:case 2:case 9:case 6:Dt.current===null&&(t=!0);var _=ze;if(ze=0,Mt=null,as(e,f,p,_),n&&In){o=0;break e}break;default:_=ze,ze=0,Mt=null,as(e,f,p,_)}}sg(),o=Ye;break}catch(G){Nf(e,G)}while(!0);return t&&e.shellSuspendCounter++,ma=dn=null,we=s,j.H=l,j.A=r,xe===null&&(ke=null,pe=0,Tl()),o}function sg(){for(;xe!==null;)zf(xe)}function lg(e,t){var n=we;we|=2;var s=wf(),l=Cf();ke!==e||pe!==t?(ii=null,li=Ct()+500,ts(e,t)):In=ps(e,t);e:do try{if(ze!==0&&xe!==null){t=xe;var r=Mt;t:switch(ze){case 1:ze=0,Mt=null,as(e,t,r,1);break;case 2:case 9:if(Ru(r)){ze=0,Mt=null,Af(t);break}t=function(){ze!==2&&ze!==9||ke!==e||(ze=7),Pt(e)},r.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Ru(r)?(ze=0,Mt=null,Af(t)):(ze=0,Mt=null,as(e,t,r,7));break;case 5:var o=null;switch(xe.tag){case 26:o=xe.memoizedState;case 5:case 27:var f=xe;if(o?fm(o):f.stateNode.complete){ze=0,Mt=null;var p=f.sibling;if(p!==null)xe=p;else{var _=f.return;_!==null?(xe=_,oi(_)):xe=null}break t}}ze=0,Mt=null,as(e,t,r,5);break;case 6:ze=0,Mt=null,as(e,t,r,6);break;case 8:Ec(),Ye=6;break e;default:throw Error(u(462))}}ig();break}catch(G){Nf(e,G)}while(!0);return ma=dn=null,j.H=s,j.A=l,we=n,xe!==null?0:(ke=null,pe=0,Tl(),Ye)}function ig(){for(;xe!==null&&!Eh();)zf(xe)}function zf(e){var t=Jd(e.alternate,e,Sa);e.memoizedProps=e.pendingProps,t===null?oi(e):xe=t}function Af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Yd(n,t,t.pendingProps,t.type,void 0,pe);break;case 11:t=Yd(n,t,t.pendingProps,t.type.render,t.ref,pe);break;case 5:Fr(t);default:Wd(n,t),t=xe=wu(t,Sa),t=Jd(n,t,Sa)}e.memoizedProps=e.pendingProps,t===null?oi(e):xe=t}function as(e,t,n,s){ma=dn=null,Fr(t),Fn=null,Os=0;var l=t.return;try{if(Zx(e,l,t,n,pe)){Ye=1,$l(e,Ht(n,e.current)),xe=null;return}}catch(r){if(l!==null)throw xe=l,r;Ye=1,$l(e,Ht(n,e.current)),xe=null;return}t.flags&32768?(ve||s===1?e=!0:In||(pe&536870912)!==0?e=!1:(Ga=e=!0,(s===2||s===9||s===3||s===6)&&(s=Dt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Tf(t,e)):oi(t)}function oi(e){var t=e;do{if((t.flags&32768)!==0){Tf(t,Ga);return}e=t.return;var n=Wx(t.alternate,t,Sa);if(n!==null){xe=n;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);Ye===0&&(Ye=5)}function Tf(e,t){do{var n=Ix(e.alternate,e);if(n!==null){n.flags&=32767,xe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=n}while(e!==null);Ye=6,xe=null}function Ef(e,t,n,s,l,r,o,f,p){e.cancelPendingCommit=null;do ui();while(Ie!==0);if((we&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=yr,Hh(e,n,r,o,f,p),e===ke&&(xe=ke=null,pe=0),es=t,Va=e,wa=n,zc=r,Ac=l,yf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ug(fl,function(){return Of(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=j.T,j.T=null,l=M.p,M.p=2,o=we,we|=4;try{Px(e,t,n)}finally{we=o,M.p=l,j.T=s}}Ie=1,Df(),kf(),Mf()}}function Df(){if(Ie===1){Ie=0;var e=Va,t=es,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=j.T,j.T=null;var s=M.p;M.p=2;var l=we;we|=4;try{uf(t,e);var r=Qc,o=xu(e.containerInfo),f=r.focusedElem,p=r.selectionRange;if(o!==f&&f&&f.ownerDocument&&hu(f.ownerDocument.documentElement,f)){if(p!==null&&mr(f)){var _=p.start,G=p.end;if(G===void 0&&(G=_),"selectionStart"in f)f.selectionStart=_,f.selectionEnd=Math.min(G,f.value.length);else{var V=f.ownerDocument||document,R=V&&V.defaultView||window;if(R.getSelection){var B=R.getSelection(),ae=f.textContent.length,oe=Math.min(p.start,ae),De=p.end===void 0?oe:Math.min(p.end,ae);!B.extend&&oe>De&&(o=De,De=oe,oe=o);var w=mu(f,oe),N=mu(f,De);if(w&&N&&(B.rangeCount!==1||B.anchorNode!==w.node||B.anchorOffset!==w.offset||B.focusNode!==N.node||B.focusOffset!==N.offset)){var k=V.createRange();k.setStart(w.node,w.offset),B.removeAllRanges(),oe>De?(B.addRange(k),B.extend(N.node,N.offset)):(k.setEnd(N.node,N.offset),B.addRange(k))}}}}for(V=[],B=f;B=B.parentNode;)B.nodeType===1&&V.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<V.length;f++){var Q=V[f];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Ni=!!Gc,Qc=Gc=null}finally{we=l,M.p=s,j.T=n}}e.current=t,Ie=2}}function kf(){if(Ie===2){Ie=0;var e=Va,t=es,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=j.T,j.T=null;var s=M.p;M.p=2;var l=we;we|=4;try{sf(e,t.alternate,t)}finally{we=l,M.p=s,j.T=n}}Ie=3}}function Mf(){if(Ie===4||Ie===3){Ie=0,Dh();var e=Va,t=es,n=wa,s=yf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,es=Va=null,_f(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Ya=null),Zi(n),t=t.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(gs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=j.T,l=M.p,M.p=2,j.T=null;try{for(var r=e.onRecoverableError,o=0;o<s.length;o++){var f=s[o];r(f.value,{componentStack:f.stack})}}finally{j.T=t,M.p=l}}(wa&3)!==0&&ui(),Pt(e),l=e.pendingLanes,(n&261930)!==0&&(l&42)!==0?e===Tc?Ws++:(Ws=0,Tc=e):Ws=0,Is(0)}}function _f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ms(t)))}function ui(){return Df(),kf(),Mf(),Of()}function Of(){if(Ie!==5)return!1;var e=Va,t=zc;zc=0;var n=Zi(wa),s=j.T,l=M.p;try{M.p=32>n?32:n,j.T=null,n=Ac,Ac=null;var r=Va,o=wa;if(Ie=0,es=Va=null,wa=0,(we&6)!==0)throw Error(u(331));var f=we;if(we|=4,xf(r.current),ff(r,r.current,o,n),we=f,Is(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(gs,r)}catch{}return!0}finally{M.p=l,j.T=s,_f(e,t)}}function Rf(e,t,n){t=Ht(n,t),t=ic(e.stateNode,t,2),e=La(e,t,2),e!==null&&(ys(e,2),Pt(e))}function Ae(e,t,n){if(e.tag===3)Rf(e,e,n);else for(;t!==null;){if(t.tag===3){Rf(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ya===null||!Ya.has(s))){e=Ht(n,e),n=Rd(2),s=La(t,n,2),s!==null&&(Ud(n,s,t,e),ys(s,2),Pt(s));break}}t=t.return}}function kc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new ag;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(n)||(Sc=!0,l.add(n),e=rg.bind(null,e,t,n),t.then(e,e))}function rg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ke===e&&(pe&n)===n&&(Ye===4||Ye===3&&(pe&62914560)===pe&&300>Ct()-si?(we&2)===0&&ts(e,0):wc|=n,Pn===pe&&(Pn=0)),Pt(e)}function Uf(e,t){t===0&&(t=Eo()),e=cn(e,t),e!==null&&(ys(e,t),Pt(e))}function cg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uf(e,n)}function og(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),Uf(e,n)}function ug(e,t){return Vi(e,t)}var di=null,ns=null,Mc=!1,fi=!1,_c=!1,Xa=0;function Pt(e){e!==ns&&e.next===null&&(ns===null?di=ns=e:ns=ns.next=e),fi=!0,Mc||(Mc=!0,fg())}function Is(e,t){if(!_c&&fi){_c=!0;do for(var n=!1,s=di;s!==null;){if(e!==0){var l=s.pendingLanes;if(l===0)var r=0;else{var o=s.suspendedLanes,f=s.pingedLanes;r=(1<<31-At(42|e)+1)-1,r&=l&~(o&~f),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,qf(s,r))}else r=pe,r=gl(s,s===ke?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(r&3)===0||ps(s,r)||(n=!0,qf(s,r));s=s.next}while(n);_c=!1}}function dg(){Lf()}function Lf(){fi=Mc=!1;var e=0;Xa!==0&&Ng()&&(e=Xa);for(var t=Ct(),n=null,s=di;s!==null;){var l=s.next,r=Bf(s,t);r===0?(s.next=null,n===null?di=l:n.next=l,l===null&&(ns=n)):(n=s,(e!==0||(r&3)!==0)&&(fi=!0)),s=l}Ie!==0&&Ie!==5||Is(e),Xa!==0&&(Xa=0)}function Bf(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,l=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var o=31-At(r),f=1<<o,p=l[o];p===-1?((f&n)===0||(f&s)!==0)&&(l[o]=Bh(f,t)):p<=t&&(e.expiredLanes|=f),r&=~f}if(t=ke,n=pe,n=gl(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Fi(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ps(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Fi(s),Zi(n)){case 2:case 8:n=Ao;break;case 32:n=fl;break;case 268435456:n=To;break;default:n=fl}return s=Hf.bind(null,e),n=Vi(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Fi(s),e.callbackPriority=2,e.callbackNode=null,2}function Hf(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ui()&&e.callbackNode!==n)return null;var s=pe;return s=gl(e,e===ke?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(jf(e,s,t),Bf(e,Ct()),e.callbackNode!=null&&e.callbackNode===n?Hf.bind(null,e):null)}function qf(e,t){if(ui())return null;jf(e,t,!0)}function fg(){wg(function(){(we&6)!==0?Vi(zo,dg):Lf()})}function Oc(){if(Xa===0){var e=Qn;e===0&&(e=ml,ml<<=1,(ml&261888)===0&&(ml=256)),Xa=e}return Xa}function Gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jl(""+e)}function Qf(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function mg(e,t,n,s,l){if(t==="submit"&&n&&n.stateNode===l){var r=Gf((l[ht]||null).action),o=s.submitter;o&&(t=(t=o[ht]||null)?Gf(t.formAction):o.getAttribute("formAction"),t!==null&&(r=t,o=null));var f=new wl("action","action",null,s,l);e.push({event:f,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Xa!==0){var p=o?Qf(l,o):new FormData(l);ec(n,{pending:!0,data:p,method:l.method,action:r},null,p)}}else typeof r=="function"&&(f.preventDefault(),p=o?Qf(l,o):new FormData(l),ec(n,{pending:!0,data:p,method:l.method,action:r},r,p))},currentTarget:l}]})}}for(var Rc=0;Rc<pr.length;Rc++){var Uc=pr[Rc],hg=Uc.toLowerCase(),xg=Uc[0].toUpperCase()+Uc.slice(1);Kt(hg,"on"+xg)}Kt(yu,"onAnimationEnd"),Kt(bu,"onAnimationIteration"),Kt(ju,"onAnimationStart"),Kt("dblclick","onDoubleClick"),Kt("focusin","onFocus"),Kt("focusout","onBlur"),Kt(kx,"onTransitionRun"),Kt(Mx,"onTransitionStart"),Kt(_x,"onTransitionCancel"),Kt(vu,"onTransitionEnd"),Tn("onMouseEnter",["mouseout","mouseover"]),Tn("onMouseLeave",["mouseout","mouseover"]),Tn("onPointerEnter",["pointerout","pointerover"]),Tn("onPointerLeave",["pointerout","pointerover"]),nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nn("onBeforeInput",["compositionend","keypress","textInput","paste"]),nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ps="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(" "),gg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ps));function Yf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],l=s.event;s=s.listeners;e:{var r=void 0;if(t)for(var o=s.length-1;0<=o;o--){var f=s[o],p=f.instance,_=f.currentTarget;if(f=f.listener,p!==r&&l.isPropagationStopped())break e;r=f,l.currentTarget=_;try{r(l)}catch(G){Al(G)}l.currentTarget=null,r=p}else for(o=0;o<s.length;o++){if(f=s[o],p=f.instance,_=f.currentTarget,f=f.listener,p!==r&&l.isPropagationStopped())break e;r=f,l.currentTarget=_;try{r(l)}catch(G){Al(G)}l.currentTarget=null,r=p}}}}function ge(e,t){var n=t[Ji];n===void 0&&(n=t[Ji]=new Set);var s=e+"__bubble";n.has(s)||(Vf(t,e,2,!1),n.add(s))}function Lc(e,t,n){var s=0;t&&(s|=4),Vf(n,e,s,t)}var mi="_reactListening"+Math.random().toString(36).slice(2);function Bc(e){if(!e[mi]){e[mi]=!0,Uo.forEach(function(n){n!=="selectionchange"&&(gg.has(n)||Lc(n,!1,e),Lc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mi]||(t[mi]=!0,Lc("selectionchange",!1,t))}}function Vf(e,t,n,s){switch(bm(t)){case 2:var l=Vg;break;case 8:l=Fg;break;default:l=Pc}n=l.bind(null,t,n,e),l=void 0,!sr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Hc(e,t,n,s,l){var r=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var f=s.stateNode.containerInfo;if(f===l)break;if(o===4)for(o=s.return;o!==null;){var p=o.tag;if((p===3||p===4)&&o.stateNode.containerInfo===l)return;o=o.return}for(;f!==null;){if(o=Cn(f),o===null)return;if(p=o.tag,p===5||p===6||p===26||p===27){s=r=o;continue e}f=f.parentNode}}s=s.return}Zo(function(){var _=r,G=ar(n),V=[];e:{var R=Nu.get(e);if(R!==void 0){var B=wl,ae=e;switch(e){case"keypress":if(Nl(n)===0)break e;case"keydown":case"keyup":B=ox;break;case"focusin":ae="focus",B=cr;break;case"focusout":ae="blur",B=cr;break;case"beforeblur":case"afterblur":B=cr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=Wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=fx;break;case yu:case bu:case ju:B=ex;break;case vu:B=hx;break;case"scroll":case"scrollend":B=Jh;break;case"wheel":B=gx;break;case"copy":case"cut":case"paste":B=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=Po;break;case"toggle":case"beforetoggle":B=yx}var oe=(t&4)!==0,De=!oe&&(e==="scroll"||e==="scrollend"),w=oe?R!==null?R+"Capture":null:R;oe=[];for(var N=_,k;N!==null;){var Q=N;if(k=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||k===null||w===null||(Q=vs(N,w),Q!=null&&oe.push(el(N,Q,k))),De)break;N=N.return}0<oe.length&&(R=new B(R,ae,null,n,G),V.push({event:R,listeners:oe}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",R&&n!==tr&&(ae=n.relatedTarget||n.fromElement)&&(Cn(ae)||ae[wn]))break e;if((B||R)&&(R=G.window===G?G:(R=G.ownerDocument)?R.defaultView||R.parentWindow:window,B?(ae=n.relatedTarget||n.toElement,B=_,ae=ae?Cn(ae):null,ae!==null&&(De=x(ae),oe=ae.tag,ae!==De||oe!==5&&oe!==27&&oe!==6)&&(ae=null)):(B=null,ae=_),B!==ae)){if(oe=Wo,Q="onMouseLeave",w="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(oe=Po,Q="onPointerLeave",w="onPointerEnter",N="pointer"),De=B==null?R:js(B),k=ae==null?R:js(ae),R=new oe(Q,N+"leave",B,n,G),R.target=De,R.relatedTarget=k,Q=null,Cn(G)===_&&(oe=new oe(w,N+"enter",ae,n,G),oe.target=k,oe.relatedTarget=De,Q=oe),De=Q,B&&ae)t:{for(oe=pg,w=B,N=ae,k=0,Q=w;Q;Q=oe(Q))k++;Q=0;for(var ce=N;ce;ce=oe(ce))Q++;for(;0<k-Q;)w=oe(w),k--;for(;0<Q-k;)N=oe(N),Q--;for(;k--;){if(w===N||N!==null&&w===N.alternate){oe=w;break t}w=oe(w),N=oe(N)}oe=null}else oe=null;B!==null&&Ff(V,R,B,oe,!1),ae!==null&&De!==null&&Ff(V,De,ae,oe,!0)}}e:{if(R=_?js(_):window,B=R.nodeName&&R.nodeName.toLowerCase(),B==="select"||B==="input"&&R.type==="file")var Ne=ru;else if(lu(R))if(cu)Ne=Tx;else{Ne=zx;var re=Cx}else B=R.nodeName,!B||B.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?_&&er(_.elementType)&&(Ne=ru):Ne=Ax;if(Ne&&(Ne=Ne(e,_))){iu(V,Ne,n,G);break e}re&&re(e,R,_),e==="focusout"&&_&&R.type==="number"&&_.memoizedProps.value!=null&&Pi(R,"number",R.value)}switch(re=_?js(_):window,e){case"focusin":(lu(re)||re.contentEditable==="true")&&(On=re,hr=_,Es=null);break;case"focusout":Es=hr=On=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,gu(V,n,G);break;case"selectionchange":if(Dx)break;case"keydown":case"keyup":gu(V,n,G)}var he;if(ur)e:{switch(e){case"compositionstart":var ye="onCompositionStart";break e;case"compositionend":ye="onCompositionEnd";break e;case"compositionupdate":ye="onCompositionUpdate";break e}ye=void 0}else _n?nu(e,n)&&(ye="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ye="onCompositionStart");ye&&(eu&&n.locale!=="ko"&&(_n||ye!=="onCompositionStart"?ye==="onCompositionEnd"&&_n&&(he=Jo()):(Da=G,lr="value"in Da?Da.value:Da.textContent,_n=!0)),re=hi(_,ye),0<re.length&&(ye=new Io(ye,e,null,n,G),V.push({event:ye,listeners:re}),he?ye.data=he:(he=su(n),he!==null&&(ye.data=he)))),(he=jx?vx(e,n):Nx(e,n))&&(ye=hi(_,"onBeforeInput"),0<ye.length&&(re=new Io("onBeforeInput","beforeinput",null,n,G),V.push({event:re,listeners:ye}),re.data=he)),mg(V,e,_,n,G)}Yf(V,t)})}function el(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hi(e,t){for(var n=t+"Capture",s=[];e!==null;){var l=e,r=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||r===null||(l=vs(e,n),l!=null&&s.unshift(el(e,l,r)),l=vs(e,t),l!=null&&s.push(el(e,l,r))),e.tag===3)return s;e=e.return}return[]}function pg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ff(e,t,n,s,l){for(var r=t._reactName,o=[];n!==null&&n!==s;){var f=n,p=f.alternate,_=f.stateNode;if(f=f.tag,p!==null&&p===s)break;f!==5&&f!==26&&f!==27||_===null||(p=_,l?(_=vs(n,r),_!=null&&o.unshift(el(n,_,p))):l||(_=vs(n,r),_!=null&&o.push(el(n,_,p)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var yg=/\r\n?/g,bg=/\u0000|\uFFFD/g;function Xf(e){return(typeof e=="string"?e:""+e).replace(yg,`
|
|
9
|
+
`).replace(bg,"")}function Kf(e,t){return t=Xf(t),Xf(e)===t}function Ee(e,t,n,s,l,r){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Dn(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Dn(e,""+s);break;case"className":yl(e,"class",s);break;case"tabIndex":yl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":yl(e,n,s);break;case"style":Xo(e,s,r);break;case"data":if(t!=="object"){yl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=jl(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"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 r=="function"&&(n==="formAction"?(t!=="input"&&Ee(e,t,"name",l.name,l,null),Ee(e,t,"formEncType",l.formEncType,l,null),Ee(e,t,"formMethod",l.formMethod,l,null),Ee(e,t,"formTarget",l.formTarget,l,null)):(Ee(e,t,"encType",l.encType,l,null),Ee(e,t,"method",l.method,l,null),Ee(e,t,"target",l.target,l,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=jl(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=oa);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(l.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=jl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":ge("beforetoggle",e),ge("toggle",e),pl(e,"popover",s);break;case"xlinkActuate":ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ca(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ca(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ca(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ca(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":pl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Kh.get(n)||n,pl(e,n,s))}}function qc(e,t,n,s,l,r){switch(n){case"style":Xo(e,s,r);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(l.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Dn(e,s):(typeof s=="number"||typeof s=="bigint")&&Dn(e,""+s);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"onClick":s!=null&&(e.onclick=oa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),r=e[ht]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,l),typeof s=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,l);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):pl(e,n,s)}}}function rt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var s=!1,l=!1,r;for(r in n)if(n.hasOwnProperty(r)){var o=n[r];if(o!=null)switch(r){case"src":s=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ee(e,t,r,o,n,null)}}l&&Ee(e,t,"srcSet",n.srcSet,n,null),s&&Ee(e,t,"src",n.src,n,null);return;case"input":ge("invalid",e);var f=r=o=l=null,p=null,_=null;for(s in n)if(n.hasOwnProperty(s)){var G=n[s];if(G!=null)switch(s){case"name":l=G;break;case"type":o=G;break;case"checked":p=G;break;case"defaultChecked":_=G;break;case"value":r=G;break;case"defaultValue":f=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(u(137,t));break;default:Ee(e,t,s,G,n,null)}}Qo(e,r,f,p,_,o,l,!1);return;case"select":ge("invalid",e),s=o=r=null;for(l in n)if(n.hasOwnProperty(l)&&(f=n[l],f!=null))switch(l){case"value":r=f;break;case"defaultValue":o=f;break;case"multiple":s=f;default:Ee(e,t,l,f,n,null)}t=r,n=o,e.multiple=!!s,t!=null?En(e,!!s,t,!1):n!=null&&En(e,!!s,n,!0);return;case"textarea":ge("invalid",e),r=l=s=null;for(o in n)if(n.hasOwnProperty(o)&&(f=n[o],f!=null))switch(o){case"value":s=f;break;case"defaultValue":l=f;break;case"children":r=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(u(91));break;default:Ee(e,t,o,f,n,null)}Vo(e,s,l,r);return;case"option":for(p in n)n.hasOwnProperty(p)&&(s=n[p],s!=null)&&(p==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ee(e,t,p,s,n,null));return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(s=0;s<Ps.length;s++)ge(Ps[s],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("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(_ in n)if(n.hasOwnProperty(_)&&(s=n[_],s!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ee(e,t,_,s,n,null)}return;default:if(er(t)){for(G in n)n.hasOwnProperty(G)&&(s=n[G],s!==void 0&&qc(e,t,G,s,n,void 0));return}}for(f in n)n.hasOwnProperty(f)&&(s=n[f],s!=null&&Ee(e,t,f,s,n,null))}function jg(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,r=null,o=null,f=null,p=null,_=null,G=null;for(B in n){var V=n[B];if(n.hasOwnProperty(B)&&V!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":p=V;default:s.hasOwnProperty(B)||Ee(e,t,B,null,s,V)}}for(var R in s){var B=s[R];if(V=n[R],s.hasOwnProperty(R)&&(B!=null||V!=null))switch(R){case"type":r=B;break;case"name":l=B;break;case"checked":_=B;break;case"defaultChecked":G=B;break;case"value":o=B;break;case"defaultValue":f=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:B!==V&&Ee(e,t,R,B,s,V)}}Ii(e,o,f,p,_,G,r,l);return;case"select":B=o=f=R=null;for(r in n)if(p=n[r],n.hasOwnProperty(r)&&p!=null)switch(r){case"value":break;case"multiple":B=p;default:s.hasOwnProperty(r)||Ee(e,t,r,null,s,p)}for(l in s)if(r=s[l],p=n[l],s.hasOwnProperty(l)&&(r!=null||p!=null))switch(l){case"value":R=r;break;case"defaultValue":f=r;break;case"multiple":o=r;default:r!==p&&Ee(e,t,l,r,s,p)}t=f,n=o,s=B,R!=null?En(e,!!n,R,!1):!!s!=!!n&&(t!=null?En(e,!!n,t,!0):En(e,!!n,n?[]:"",!1));return;case"textarea":B=R=null;for(f in n)if(l=n[f],n.hasOwnProperty(f)&&l!=null&&!s.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Ee(e,t,f,null,s,l)}for(o in s)if(l=s[o],r=n[o],s.hasOwnProperty(o)&&(l!=null||r!=null))switch(o){case"value":R=l;break;case"defaultValue":B=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(u(91));break;default:l!==r&&Ee(e,t,o,l,s,r)}Yo(e,R,B);return;case"option":for(var ae in n)R=n[ae],n.hasOwnProperty(ae)&&R!=null&&!s.hasOwnProperty(ae)&&(ae==="selected"?e.selected=!1:Ee(e,t,ae,null,s,R));for(p in s)R=s[p],B=n[p],s.hasOwnProperty(p)&&R!==B&&(R!=null||B!=null)&&(p==="selected"?e.selected=R&&typeof R!="function"&&typeof R!="symbol":Ee(e,t,p,R,s,B));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 oe in n)R=n[oe],n.hasOwnProperty(oe)&&R!=null&&!s.hasOwnProperty(oe)&&Ee(e,t,oe,null,s,R);for(_ in s)if(R=s[_],B=n[_],s.hasOwnProperty(_)&&R!==B&&(R!=null||B!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Ee(e,t,_,R,s,B)}return;default:if(er(t)){for(var De in n)R=n[De],n.hasOwnProperty(De)&&R!==void 0&&!s.hasOwnProperty(De)&&qc(e,t,De,void 0,s,R);for(G in s)R=s[G],B=n[G],!s.hasOwnProperty(G)||R===B||R===void 0&&B===void 0||qc(e,t,G,R,s,B);return}}for(var w in n)R=n[w],n.hasOwnProperty(w)&&R!=null&&!s.hasOwnProperty(w)&&Ee(e,t,w,null,s,R);for(V in s)R=s[V],B=n[V],!s.hasOwnProperty(V)||R===B||R==null&&B==null||Ee(e,t,V,R,s,B)}function Zf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var l=n[s],r=l.transferSize,o=l.initiatorType,f=l.duration;if(r&&f&&Zf(o)){for(o=0,f=l.responseEnd,s+=1;s<n.length;s++){var p=n[s],_=p.startTime;if(_>f)break;var G=p.transferSize,V=p.initiatorType;G&&Zf(V)&&(p=p.responseEnd,o+=G*(p<f?1:(f-_)/(p-_)))}if(--s,t+=8*(r+o)/(l.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 Gc=null,Qc=null;function xi(e){return e.nodeType===9?e:e.ownerDocument}function Jf(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 $f(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 Yc(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 Vc=null;function Ng(){var e=window.event;return e&&e.type==="popstate"?e===Vc?!1:(Vc=e,!0):(Vc=null,!1)}var Wf=typeof setTimeout=="function"?setTimeout:void 0,Sg=typeof clearTimeout=="function"?clearTimeout:void 0,If=typeof Promise=="function"?Promise:void 0,wg=typeof queueMicrotask=="function"?queueMicrotask:typeof If<"u"?function(e){return If.resolve(null).then(e).catch(Cg)}:Wf;function Cg(e){setTimeout(function(){throw e})}function Ka(e){return e==="head"}function Pf(e,t){var n=t,s=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(l),rs(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")tl(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,tl(n);for(var r=n.firstChild;r;){var o=r.nextSibling,f=r.nodeName;r[bs]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=o}}else n==="body"&&tl(e.ownerDocument.body);n=l}while(n);rs(t)}function em(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fc(n),$i(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function zg(e,t,n,s){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Vt(e.nextSibling),e===null)break}return null}function Ag(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Vt(e.nextSibling),e===null))return null;return e}function tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Vt(e.nextSibling),e===null))return null;return e}function Xc(e){return e.data==="$?"||e.data==="$~"}function Kc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Tg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Vt(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 Zc=null;function am(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Vt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function nm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function sm(e,t,n){switch(t=xi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function tl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$i(e)}var Ft=new Map,lm=new Set;function gi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ca=M.d;M.d={f:Eg,r:Dg,D:kg,C:Mg,L:_g,m:Og,X:Ug,S:Rg,M:Lg};function Eg(){var e=Ca.f(),t=ri();return e||t}function Dg(e){var t=zn(e);t!==null&&t.tag===5&&t.type==="form"?vd(t):Ca.r(e)}var ss=typeof document>"u"?null:document;function im(e,t,n){var s=ss;if(s&&typeof t=="string"&&t){var l=Lt(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),lm.has(l)||(lm.add(l),e={rel:e,crossOrigin:n,href:t},s.querySelector(l)===null&&(t=s.createElement("link"),rt(t,"link",e),et(t),s.head.appendChild(t)))}}function kg(e){Ca.D(e),im("dns-prefetch",e,null)}function Mg(e,t){Ca.C(e,t),im("preconnect",e,t)}function _g(e,t,n){Ca.L(e,t,n);var s=ss;if(s&&e&&t){var l='link[rel="preload"][as="'+Lt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+Lt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+Lt(n.imageSizes)+'"]')):l+='[href="'+Lt(e)+'"]';var r=l;switch(t){case"style":r=ls(e);break;case"script":r=is(e)}Ft.has(r)||(e=D({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ft.set(r,e),s.querySelector(l)!==null||t==="style"&&s.querySelector(al(r))||t==="script"&&s.querySelector(nl(r))||(t=s.createElement("link"),rt(t,"link",e),et(t),s.head.appendChild(t)))}}function Og(e,t){Ca.m(e,t);var n=ss;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Lt(s)+'"][href="'+Lt(e)+'"]',r=l;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=is(e)}if(!Ft.has(r)&&(e=D({rel:"modulepreload",href:e},t),Ft.set(r,e),n.querySelector(l)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(nl(r)))return}s=n.createElement("link"),rt(s,"link",e),et(s),n.head.appendChild(s)}}}function Rg(e,t,n){Ca.S(e,t,n);var s=ss;if(s&&e){var l=An(s).hoistableStyles,r=ls(e);t=t||"default";var o=l.get(r);if(!o){var f={loading:0,preload:null};if(o=s.querySelector(al(r)))f.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ft.get(r))&&Jc(e,n);var p=o=s.createElement("link");et(p),rt(p,"link",e),p._p=new Promise(function(_,G){p.onload=_,p.onerror=G}),p.addEventListener("load",function(){f.loading|=1}),p.addEventListener("error",function(){f.loading|=2}),f.loading|=4,pi(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:f},l.set(r,o)}}}function Ug(e,t){Ca.X(e,t);var n=ss;if(n&&e){var s=An(n).hoistableScripts,l=is(e),r=s.get(l);r||(r=n.querySelector(nl(l)),r||(e=D({src:e,async:!0},t),(t=Ft.get(l))&&$c(e,t),r=n.createElement("script"),et(r),rt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(l,r))}}function Lg(e,t){Ca.M(e,t);var n=ss;if(n&&e){var s=An(n).hoistableScripts,l=is(e),r=s.get(l);r||(r=n.querySelector(nl(l)),r||(e=D({src:e,async:!0,type:"module"},t),(t=Ft.get(l))&&$c(e,t),r=n.createElement("script"),et(r),rt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(l,r))}}function rm(e,t,n,s){var l=(l=ft.current)?gi(l):null;if(!l)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ls(n.href),n=An(l).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ls(n.href);var r=An(l).hoistableStyles,o=r.get(e);if(o||(l=l.ownerDocument||l,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,o),(r=l.querySelector(al(e)))&&!r._p&&(o.instance=r,o.state.loading=5),Ft.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ft.set(e,n),r||Bg(l,e,n,o.state))),t&&s===null)throw Error(u(528,""));return o}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=is(n),n=An(l).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function ls(e){return'href="'+Lt(e)+'"'}function al(e){return'link[rel="stylesheet"]['+e+"]"}function cm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Bg(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),rt(t,"link",n),et(t),e.head.appendChild(t))}function is(e){return'[src="'+Lt(e)+'"]'}function nl(e){return"script[async]"+e}function om(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Lt(n.href)+'"]');if(s)return t.instance=s,et(s),s;var l=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),et(s),rt(s,"style",l),pi(s,n.precedence,e),t.instance=s;case"stylesheet":l=ls(n.href);var r=e.querySelector(al(l));if(r)return t.state.loading|=4,t.instance=r,et(r),r;s=cm(n),(l=Ft.get(l))&&Jc(s,l),r=(e.ownerDocument||e).createElement("link"),et(r);var o=r;return o._p=new Promise(function(f,p){o.onload=f,o.onerror=p}),rt(r,"link",s),t.state.loading|=4,pi(r,n.precedence,e),t.instance=r;case"script":return r=is(n.src),(l=e.querySelector(nl(r)))?(t.instance=l,et(l),l):(s=n,(l=Ft.get(r))&&(s=D({},n),$c(s,l)),e=e.ownerDocument||e,l=e.createElement("script"),et(l),rt(l,"link",s),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,pi(s,n.precedence,e));return t.instance}function pi(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=s.length?s[s.length-1]:null,r=l,o=0;o<s.length;o++){var f=s[o];if(f.dataset.precedence===t)r=f;else if(r!==l)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var yi=null;function um(e,t,n){if(yi===null){var s=new Map,l=yi=new Map;l.set(n,s)}else l=yi,s=l.get(n),s||(s=new Map,l.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var r=n[l];if(!(r[bs]||r[nt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var o=r.getAttribute(t)||"";o=e+o;var f=s.get(o);f?f.push(r):s.set(o,[r])}}return s}function dm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Hg(e,t,n){if(n===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 fm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function qg(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var l=ls(s.href),r=t.querySelector(al(l));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,et(r);return}r=t.ownerDocument||t,s=cm(s),(l=Ft.get(l))&&Jc(s,l),r=r.createElement("link"),et(r);var o=r;o._p=new Promise(function(f,p){o.onload=f,o.onerror=p}),rt(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=bi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wc=0;function Gg(e,t){return e.stylesheets&&e.count===0&&vi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&vi(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Wc===0&&(Wc=62500*vg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vi(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Wc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(l)}}:null}function bi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ji=null;function vi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ji=new Map,t.forEach(Qg,e),ji=null,bi.call(e))}function Qg(e,t){if(!(t.state.loading&4)){var n=ji.get(e);if(n)var s=n.get(null);else{n=new Map,ji.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<l.length;r++){var o=l[r];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),s=o)}s&&n.set(null,s)}l=t.instance,o=l.getAttribute("data-precedence"),r=n.get(o)||s,r===s&&n.set(null,l),n.set(o,l),this.count++,s=bi.bind(this),l.addEventListener("load",s),l.addEventListener("error",s),r?r.parentNode.insertBefore(l,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var sl={$$typeof:S,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function Yg(e,t,n,s,l,r,o,f,p){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=Xi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xi(0),this.hiddenUpdates=Xi(null),this.identifierPrefix=s,this.onUncaughtError=l,this.onCaughtError=r,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=p,this.incompleteTransitions=new Map}function mm(e,t,n,s,l,r,o,f,p,_,G,V){return e=new Yg(e,t,n,o,p,_,G,V,f),t=1,r===!0&&(t|=24),r=Et(3,null,null,t),e.current=r,r.stateNode=e,t=Dr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:s,isDehydrated:n,cache:t},Or(r),e}function hm(e){return e?(e=Ln,e):Ln}function xm(e,t,n,s,l,r){l=hm(l),s.context===null?s.context=l:s.pendingContext=l,s=Ua(t),s.payload={element:n},r=r===void 0?null:r,r!==null&&(s.callback=r),n=La(e,s,t),n!==null&&(jt(n,e,t),Us(n,e,t))}function gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ic(e,t){gm(e,t),(e=e.alternate)&&gm(e,t)}function pm(e){if(e.tag===13||e.tag===31){var t=cn(e,67108864);t!==null&&jt(t,e,67108864),Ic(e,67108864)}}function ym(e){if(e.tag===13||e.tag===31){var t=Ot();t=Ki(t);var n=cn(e,t);n!==null&&jt(n,e,t),Ic(e,t)}}var Ni=!0;function Vg(e,t,n,s){var l=j.T;j.T=null;var r=M.p;try{M.p=2,Pc(e,t,n,s)}finally{M.p=r,j.T=l}}function Fg(e,t,n,s){var l=j.T;j.T=null;var r=M.p;try{M.p=8,Pc(e,t,n,s)}finally{M.p=r,j.T=l}}function Pc(e,t,n,s){if(Ni){var l=eo(s);if(l===null)Hc(e,t,s,Si,n),jm(e,s);else if(Kg(l,e,t,n,s))s.stopPropagation();else if(jm(e,s),t&4&&-1<Xg.indexOf(e)){for(;l!==null;){var r=zn(l);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var o=an(r.pendingLanes);if(o!==0){var f=r;for(f.pendingLanes|=2,f.entangledLanes|=2;o;){var p=1<<31-At(o);f.entanglements[1]|=p,o&=~p}Pt(r),(we&6)===0&&(li=Ct()+500,Is(0))}}break;case 31:case 13:f=cn(r,2),f!==null&&jt(f,r,2),ri(),Ic(r,2)}if(r=eo(s),r===null&&Hc(e,t,s,Si,n),r===l)break;l=r}l!==null&&s.stopPropagation()}else Hc(e,t,s,null,n)}}function eo(e){return e=ar(e),to(e)}var Si=null;function to(e){if(Si=null,e=Cn(e),e!==null){var t=x(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=y(t),e!==null)return e;e=null}else if(n===31){if(e=g(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Si=e,null}function bm(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(kh()){case zo:return 2;case Ao:return 8;case fl:case Mh:return 32;case To:return 268435456;default:return 32}default:return 32}}var ao=!1,Za=null,Ja=null,$a=null,ll=new Map,il=new Map,Wa=[],Xg="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 jm(e,t){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":il.delete(t.pointerId)}}function rl(e,t,n,s,l,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:r,targetContainers:[l]},t!==null&&(t=zn(t),t!==null&&pm(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Kg(e,t,n,s,l){switch(t){case"focusin":return Za=rl(Za,e,t,n,s,l),!0;case"dragenter":return Ja=rl(Ja,e,t,n,s,l),!0;case"mouseover":return $a=rl($a,e,t,n,s,l),!0;case"pointerover":var r=l.pointerId;return ll.set(r,rl(ll.get(r)||null,e,t,n,s,l)),!0;case"gotpointercapture":return r=l.pointerId,il.set(r,rl(il.get(r)||null,e,t,n,s,l)),!0}return!1}function vm(e){var t=Cn(e.target);if(t!==null){var n=x(t);if(n!==null){if(t=n.tag,t===13){if(t=y(n),t!==null){e.blockedOn=t,Oo(e.priority,function(){ym(n)});return}}else if(t===31){if(t=g(n),t!==null){e.blockedOn=t,Oo(e.priority,function(){ym(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=eo(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);tr=s,n.target.dispatchEvent(s),tr=null}else return t=zn(n),t!==null&&pm(t),e.blockedOn=n,!1;t.shift()}return!0}function Nm(e,t,n){wi(e)&&n.delete(t)}function Zg(){ao=!1,Za!==null&&wi(Za)&&(Za=null),Ja!==null&&wi(Ja)&&(Ja=null),$a!==null&&wi($a)&&($a=null),ll.forEach(Nm),il.forEach(Nm)}function Ci(e,t){e.blockedOn===t&&(e.blockedOn=null,ao||(ao=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Zg)))}var zi=null;function Sm(e){zi!==e&&(zi=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){zi===e&&(zi=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],l=e[t+2];if(typeof s!="function"){if(to(s||n)===null)continue;break}var r=zn(n);r!==null&&(e.splice(t,3),t-=3,ec(r,{pending:!0,data:l,method:n.method,action:s},s,l))}}))}function rs(e){function t(p){return Ci(p,e)}Za!==null&&Ci(Za,e),Ja!==null&&Ci(Ja,e),$a!==null&&Ci($a,e),ll.forEach(t),il.forEach(t);for(var n=0;n<Wa.length;n++){var s=Wa[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Wa.length&&(n=Wa[0],n.blockedOn===null);)vm(n),n.blockedOn===null&&Wa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var l=n[s],r=n[s+1],o=l[ht]||null;if(typeof r=="function")o||Sm(n);else if(o){var f=null;if(r&&r.hasAttribute("formAction")){if(l=r,o=r[ht]||null)f=o.formAction;else if(to(l)!==null)continue}else f=o.action;typeof f=="function"?n[s+1]=f:(n.splice(s,3),s-=3),Sm(n)}}}function wm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(o){return l=o})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function no(e){this._internalRoot=e}Ai.prototype.render=no.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,s=Ot();xm(n,s,e,t,null,null)},Ai.prototype.unmount=no.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xm(e.current,2,null,e,null,null),ri(),t[wn]=null}};function Ai(e){this._internalRoot=e}Ai.prototype.unstable_scheduleHydration=function(e){if(e){var t=_o();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wa.length&&t!==0&&t<Wa[n].priority;n++);Wa.splice(n,0,e),n===0&&vm(e)}};var Cm=c.version;if(Cm!=="19.2.3")throw Error(u(527,Cm,"19.2.3"));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=C(t),e=e!==null?A(e):null,e=e===null?null:e.stateNode,e};var Jg={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ti.isDisabled&&Ti.supportsFiber)try{gs=Ti.inject(Jg),zt=Ti}catch{}}return cl.createRoot=function(e,t){if(!h(e))throw Error(u(299));var n=!1,s="",l=kd,r=Md,o=_d;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mm(e,1,!1,null,null,n,s,null,l,r,o,wm),e[wn]=t.current,Bc(e),new no(t)},cl.hydrateRoot=function(e,t,n){if(!h(e))throw Error(u(299));var s=!1,l="",r=kd,o=Md,f=_d,p=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(f=n.onRecoverableError),n.formState!==void 0&&(p=n.formState)),t=mm(e,1,!0,t,n??null,s,l,p,r,o,f,wm),t.context=hm(null),n=t.current,s=Ot(),s=Ki(s),l=Ua(s),l.callback=null,La(n,l,s),n=s,t.current.lanes=n,ys(t,n),Pt(t),e[wn]=t.current,Bc(e),new Ai(t)},cl.version="19.2.3",cl}var Mm;function dy(){if(Mm)return so.exports;Mm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),so.exports=uy(),so.exports}var fy=dy();function _m(i){const c=i.replace(/^#\/?/,"");return c==="docs"||c.startsWith("docs/")?{route:"docs",section:c.slice(5)||null}:{route:"app",section:null}}function jh(){const[i,c]=m.useState(()=>_m(window.location.hash));m.useEffect(()=>{const u=()=>{c(_m(window.location.hash))};return window.addEventListener("hashchange",u),()=>window.removeEventListener("hashchange",u)},[]);const d=m.useCallback(u=>{window.location.hash=u},[]);return{...i,navigate:d}}const my="/api";async function be(i,c){const d=await fetch(`${my}${i}`,{...c,headers:{"Content-Type":"application/json",...c?.headers}});if(!d.ok){const u=await d.json().catch(()=>({detail:"Unknown error"}));throw new Error(u.detail||`HTTP ${d.status}`)}if(d.status!==204)return d.json()}async function hy(){return be("/projects")}async function xy(i,c,d="manual"){return be("/projects",{method:"POST",body:JSON.stringify({name:i,path:c,spec_method:d})})}async function gy(i){await be(`/projects/${encodeURIComponent(i)}`,{method:"DELETE"})}async function py(i,c){return be(`/projects/${encodeURIComponent(i)}/settings`,{method:"PATCH",body:JSON.stringify(c)})}async function yy(i,c=!1){const d=c?"?full_reset=true":"";return be(`/projects/${encodeURIComponent(i)}/reset${d}`,{method:"POST"})}async function by(i){return be(`/projects/${encodeURIComponent(i)}/features`)}async function jy(i,c){return be(`/projects/${encodeURIComponent(i)}/features`,{method:"POST",body:JSON.stringify(c)})}async function vy(i,c){await be(`/projects/${encodeURIComponent(i)}/features/${c}`,{method:"DELETE"})}async function Ny(i,c){await be(`/projects/${encodeURIComponent(i)}/features/${c}/skip`,{method:"PATCH"})}async function Sy(i,c,d){return be(`/projects/${encodeURIComponent(i)}/features/${c}`,{method:"PATCH",body:JSON.stringify(d)})}async function wy(i){return be(`/projects/${encodeURIComponent(i)}/features/graph`)}async function Cy(i){return be(`/projects/${encodeURIComponent(i)}/agent/status`)}async function vo(i,c={}){return be(`/projects/${encodeURIComponent(i)}/agent/start`,{method:"POST",body:JSON.stringify({yolo_mode:c.yoloMode??!1,parallel_mode:c.parallelMode??!1,max_concurrency:c.maxConcurrency,testing_agent_ratio:c.testingAgentRatio})})}async function zy(i){return be(`/projects/${encodeURIComponent(i)}/agent/stop`,{method:"POST"})}async function Ay(i){return be(`/spec/status/${encodeURIComponent(i)}`)}async function Ty(){return be("/setup/status")}async function Ey(){return be("/health")}async function Dy(i){const c=i?`?path=${encodeURIComponent(i)}`:"";return be(`/filesystem/list${c}`)}async function ky(i){const c=i.endsWith("/")?i.slice(0,-1):i,d=c.lastIndexOf("/");let u,h;if(d===2&&/^[A-Za-z]:/.test(c))u=c.substring(0,3),h=c.substring(3);else if(d>0)u=c.substring(0,d),h=c.substring(d+1);else if(d===0)u="/",h=c.substring(1);else throw new Error("Invalid path: must be an absolute path");if(!h)throw new Error("Invalid path: directory name is empty");return be("/filesystem/create-directory",{method:"POST",body:JSON.stringify({parent_path:u,name:h})})}async function My(i){return be(`/assistant/conversations/${encodeURIComponent(i)}`)}async function _y(i,c){return be(`/assistant/conversations/${encodeURIComponent(i)}/${c}`)}async function Oy(i,c){await be(`/assistant/conversations/${encodeURIComponent(i)}/${c}`,{method:"DELETE"})}async function Ry(){return be("/settings/models")}async function Uy(){return be("/settings")}async function Ly(i){return be("/settings",{method:"PATCH",body:JSON.stringify(i)})}async function By(i,c){return be(`/projects/${encodeURIComponent(i)}/devserver/start`,{method:"POST",body:JSON.stringify({command:c})})}async function Hy(i){return be(`/projects/${encodeURIComponent(i)}/devserver/stop`,{method:"POST"})}async function qy(i){return be(`/terminal/${encodeURIComponent(i)}`)}async function Gy(i,c){return be(`/terminal/${encodeURIComponent(i)}`,{method:"POST",body:JSON.stringify({name:null})})}async function Qy(i,c,d){return be(`/terminal/${encodeURIComponent(i)}/${c}`,{method:"PATCH",body:JSON.stringify({name:d})})}async function Yy(i,c){await be(`/terminal/${encodeURIComponent(i)}/${c}`,{method:"DELETE"})}async function Vy(i){return be(`/projects/${encodeURIComponent(i)}/schedules`)}async function Fy(i,c){return be(`/projects/${encodeURIComponent(i)}/schedules`,{method:"POST",body:JSON.stringify(c)})}async function Xy(i,c,d){return be(`/projects/${encodeURIComponent(i)}/schedules/${c}`,{method:"PATCH",body:JSON.stringify(d)})}async function Ky(i,c){await be(`/projects/${encodeURIComponent(i)}/schedules/${c}`,{method:"DELETE"})}async function Zy(i){return be(`/projects/${encodeURIComponent(i)}/schedules/next`)}function Jy(){return Rt({queryKey:["projects"],queryFn:hy})}function $y(){const i=at();return ct({mutationFn:({name:c,path:d,specMethod:u})=>xy(c,d,u),onSuccess:()=>{i.invalidateQueries({queryKey:["projects"]})}})}function Wy(){const i=at();return ct({mutationFn:c=>gy(c),onSuccess:()=>{i.invalidateQueries({queryKey:["projects"]})}})}function Iy(i){const c=at();return ct({mutationFn:d=>yy(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["projects"]}),c.invalidateQueries({queryKey:["project",i]}),c.invalidateQueries({queryKey:["features",i]}),c.invalidateQueries({queryKey:["agent-status",i]})}})}function Py(i){const c=at();return ct({mutationFn:d=>py(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["projects"]}),c.invalidateQueries({queryKey:["project",i]})}})}function vh(i){return Rt({queryKey:["features",i],queryFn:()=>by(i),enabled:!!i,refetchInterval:5e3})}function eb(i){const c=at();return ct({mutationFn:d=>jy(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["features",i]})}})}function tb(i){const c=at();return ct({mutationFn:d=>vy(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["features",i]})}})}function ab(i){const c=at();return ct({mutationFn:d=>Ny(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["features",i]})}})}function nb(i){const c=at();return ct({mutationFn:({featureId:d,update:u})=>Sy(i,d,u),onSuccess:()=>{c.invalidateQueries({queryKey:["features",i]})}})}function sb(i){return Rt({queryKey:["agent-status",i],queryFn:()=>Cy(i),enabled:!!i,refetchInterval:3e3})}function lb(i){const c=at();return ct({mutationFn:(d={})=>vo(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["agent-status",i]})}})}function ib(i){const c=at();return ct({mutationFn:()=>zy(i),onSuccess:()=>{c.invalidateQueries({queryKey:["agent-status",i]}),c.invalidateQueries({queryKey:["nextRun",i]})}})}function rb(){return Rt({queryKey:["setup-status"],queryFn:Ty,staleTime:6e4})}function cb(){return Rt({queryKey:["health"],queryFn:Ey,retry:!1})}const ob={models:[{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5"},{id:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5"}],default:"claude-opus-4-5-20251101"},Nh={yolo_mode:!1,model:"claude-opus-4-5-20251101",glm_mode:!1,ollama_mode:!1,testing_agent_ratio:1,playwright_headless:!0,batch_size:3};function ub(){return Rt({queryKey:["available-models"],queryFn:Ry,staleTime:3e5,retry:1,placeholderData:ob})}function No(){return Rt({queryKey:["settings"],queryFn:Uy,staleTime:6e4,retry:1,placeholderData:Nh})}function db(){const i=at();return ct({mutationFn:c=>Ly(c),onMutate:async c=>{await i.cancelQueries({queryKey:["settings"]});const d=i.getQueryData(["settings"]);return i.setQueryData(["settings"],u=>({...Nh,...u,...c})),{previous:d}},onError:(c,d,u)=>{u?.previous&&i.setQueryData(["settings"],u.previous)},onSettled:()=>{i.invalidateQueries({queryKey:["settings"]})}})}const Om=100,fb=20,Rm=500;function mb(i){const[c,d]=m.useState({progress:{passing:0,in_progress:0,total:0,percentage:0},agentStatus:"loading",logs:[],isConnected:!1,devServerStatus:"stopped",devServerUrl:null,devLogs:[],activeAgents:[],recentActivity:[],agentLogs:new Map,celebrationQueue:[],celebration:null,orchestratorStatus:null}),u=m.useRef(null),h=m.useRef(null),x=m.useRef(0),y=m.useCallback(()=>{if(!i)return;const v=window.location.protocol==="https:"?"wss:":"ws:",E=window.location.host,O=`${v}//${E}/ws/projects/${encodeURIComponent(i)}`;try{const L=new WebSocket(O);u.current=L,L.onopen=()=>{d(z=>({...z,isConnected:!0})),x.current=0},L.onmessage=z=>{try{const b=JSON.parse(z.data);switch(b.type){case"progress":d(S=>({...S,progress:{passing:b.passing,in_progress:b.in_progress,total:b.total,percentage:b.percentage}}));break;case"agent_status":d(S=>({...S,agentStatus:b.status,...(b.status==="stopped"||b.status==="crashed")&&{activeAgents:[],recentActivity:[],orchestratorStatus:null}}));break;case"log":d(S=>{const X=[...S.logs.slice(-Om+1),{line:b.line,timestamp:b.timestamp,featureId:b.featureId,agentIndex:b.agentIndex}];let J=S.agentLogs;if(b.agentIndex!==void 0){J=new Map(S.agentLogs);const $=J.get(b.agentIndex)||[],F={line:b.line,timestamp:b.timestamp,type:"output"};J.set(b.agentIndex,[...$.slice(-Rm+1),F])}return{...S,logs:X,agentLogs:J}});break;case"feature_update":break;case"agent_update":d(S=>{const X=new Map(S.agentLogs),J=X.get(b.agentIndex)||[],$={line:`[STATE] ${b.state}${b.thought?`: ${b.thought}`:""}`,timestamp:b.timestamp,type:b.state==="error"?"error":"state_change"};X.set(b.agentIndex,[...J.slice(-Rm+1),$]);const F=X.get(b.agentIndex)||[],ee=S.activeAgents.findIndex(q=>q.agentIndex===b.agentIndex);let Y;b.state==="success"||b.state==="error"?b.agentIndex===-1?Y=S.activeAgents.filter(q=>q.featureId!==b.featureId):Y=S.activeAgents.filter(q=>q.agentIndex!==b.agentIndex):ee>=0?(Y=[...S.activeAgents],Y[ee]={agentIndex:b.agentIndex,agentName:b.agentName,agentType:b.agentType||"coding",featureId:b.featureId,featureIds:b.featureIds||[b.featureId],featureName:b.featureName,state:b.state,thought:b.thought,timestamp:b.timestamp,logs:F}):Y=[...S.activeAgents,{agentIndex:b.agentIndex,agentName:b.agentName,agentType:b.agentType||"coding",featureId:b.featureId,featureIds:b.featureIds||[b.featureId],featureName:b.featureName,state:b.state,thought:b.thought,timestamp:b.timestamp,logs:F}];let se=S.recentActivity;b.thought&&(se=[{agentName:b.agentName,thought:b.thought,timestamp:b.timestamp,featureId:b.featureId},...S.recentActivity.slice(0,fb-1)]);let K=S.celebrationQueue,U=S.celebration;if(b.state==="success"){const q={agentName:b.agentName,featureName:b.featureName,featureId:b.featureId};S.celebration?K=[...S.celebrationQueue,q]:U=q}return{...S,activeAgents:Y,agentLogs:X,recentActivity:se,celebrationQueue:K,celebration:U}});break;case"orchestrator_update":d(S=>{const X={eventType:b.eventType,message:b.message,timestamp:b.timestamp,featureId:b.featureId,featureName:b.featureName};return{...S,orchestratorStatus:{state:b.state,message:b.message,codingAgents:b.codingAgents??S.orchestratorStatus?.codingAgents??0,testingAgents:b.testingAgents??S.orchestratorStatus?.testingAgents??0,maxConcurrency:b.maxConcurrency??S.orchestratorStatus?.maxConcurrency??3,readyCount:b.readyCount??S.orchestratorStatus?.readyCount??0,blockedCount:b.blockedCount??S.orchestratorStatus?.blockedCount??0,timestamp:b.timestamp,recentEvents:[X,...(S.orchestratorStatus?.recentEvents??[]).slice(0,4)]}}});break;case"dev_log":d(S=>({...S,devLogs:[...S.devLogs.slice(-Om+1),{line:b.line,timestamp:b.timestamp}]}));break;case"dev_server_status":d(S=>({...S,devServerStatus:b.status,devServerUrl:b.url}));break;case"pong":break}}catch{console.error("Failed to parse WebSocket message")}},L.onclose=()=>{d(b=>({...b,isConnected:!1})),u.current=null;const z=Math.min(1e3*Math.pow(2,x.current),3e4);x.current++,h.current=window.setTimeout(()=>{y()},z)},L.onerror=()=>{L.close()}}catch{}},[i]),g=m.useCallback(()=>{u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"ping"}))},[]),T=m.useCallback(()=>{d(v=>{const[E,...O]=v.celebrationQueue;return{...v,celebration:E||null,celebrationQueue:O}})},[]);m.useEffect(()=>{if(d({progress:{passing:0,in_progress:0,total:0,percentage:0},agentStatus:"loading",logs:[],isConnected:!1,devServerStatus:"stopped",devServerUrl:null,devLogs:[],activeAgents:[],recentActivity:[],agentLogs:new Map,celebrationQueue:[],celebration:null,orchestratorStatus:null}),!i){u.current&&(u.current.close(),u.current=null);return}y();const v=setInterval(g,3e4);return()=>{clearInterval(v),h.current&&clearTimeout(h.current),u.current&&(u.current.close(),u.current=null)}},[i,y,g]),m.useEffect(()=>{const E=setInterval(()=>{d(O=>{const L=Date.now(),z=O.activeAgents.filter(b=>L-new Date(b.timestamp).getTime()<18e5);return z.length!==O.activeAgents.length?{...O,activeAgents:z}:O})},6e4);return()=>clearInterval(E)},[]);const C=m.useCallback(()=>{d(v=>({...v,logs:[]}))},[]),A=m.useCallback(()=>{d(v=>({...v,devLogs:[]}))},[]),D=m.useCallback(v=>c.agentLogs.get(v)||[],[c.agentLogs]),H=m.useCallback(v=>{d(E=>{const O=new Map(E.agentLogs);return O.delete(v),{...E,agentLogs:O}})},[]);return{...c,clearLogs:C,clearDevLogs:A,clearCelebration:T,getAgentLogs:D,clearAgentLogs:H}}const hb={started:[523.25,659.25],completed:[523.25,659.25,783.99]};function Um(i){try{const c=new(window.AudioContext||window.webkitAudioContext),d=hb[i],u=i==="completed"?.15:.12,h=d.length*u;d.forEach((x,y)=>{const g=c.createOscillator(),T=c.createGain();g.connect(T),T.connect(c.destination),g.type="sine",g.frequency.setValueAtTime(x,c.currentTime);const C=c.currentTime+y*u;T.gain.setValueAtTime(0,C),T.gain.linearRampToValueAtTime(.3,C+.02),T.gain.exponentialRampToValueAtTime(.01,C+u),g.start(C),g.stop(C+u)}),setTimeout(()=>{c.close()},h*1e3+100)}catch{}}function xb(i){return{pendingIds:new Set(i?.pending.map(c=>c.id)??[]),inProgressIds:new Set(i?.in_progress.map(c=>c.id)??[]),doneIds:new Set(i?.done.map(c=>c.id)??[])}}function gb(i){const c=m.useRef(null),d=m.useRef(!1);m.useEffect(()=>{if(!i)return;const u=xb(i);if(!d.current){c.current=u,d.current=!0;return}const h=c.current;if(!h){c.current=u;return}for(const x of u.inProgressIds)if(h.pendingIds.has(x)&&!h.inProgressIds.has(x)){Um("started");break}for(const x of u.doneIds)if(!h.doneIds.has(x)&&(h.inProgressIds.has(x)||h.pendingIds.has(x))){Um("completed");break}c.current=u},[i])}function pb(){try{const i=new(window.AudioContext||window.webkitAudioContext),c=[{freq:523.25,start:0},{freq:659.25,start:.15},{freq:783.99,start:.3},{freq:1046.5,start:.45}],d=.25;c.forEach(({freq:y,start:g})=>{const T=i.createOscillator(),C=i.createGain();T.connect(C),C.connect(i.destination),T.type="sine",T.frequency.setValueAtTime(y,i.currentTime+g);const A=i.currentTime+g;C.gain.setValueAtTime(0,A),C.gain.linearRampToValueAtTime(.4,A+.03),C.gain.setValueAtTime(.4,A+d*.6),C.gain.exponentialRampToValueAtTime(.01,A+d),T.start(A),T.stop(A+d)});const u=[523.25,659.25,783.99,1046.5],h=.65,x=.5;u.forEach(y=>{const g=i.createOscillator(),T=i.createGain();g.connect(T),T.connect(i.destination),g.type="sine",g.frequency.setValueAtTime(y,i.currentTime+h);const C=i.currentTime+h;T.gain.setValueAtTime(0,C),T.gain.linearRampToValueAtTime(.2,C+.05),T.gain.setValueAtTime(.2,C+x*.5),T.gain.exponentialRampToValueAtTime(.01,C+x),g.start(C),g.stop(C+x)}),setTimeout(()=>{i.close()},1500)}catch{}}function yb(){const c=Date.now()+2e3;Ei({particleCount:100,spread:70,origin:{x:0,y:.6},angle:60,colors:["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dfe6e9"]}),Ei({particleCount:100,spread:70,origin:{x:1,y:.6},angle:120,colors:["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dfe6e9"]});const d=setInterval(()=>{if(Date.now()>c){clearInterval(d);return}Ei({particleCount:30,spread:60,origin:{x:0,y:.6},angle:60,colors:["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dfe6e9"]}),Ei({particleCount:30,spread:60,origin:{x:1,y:.6},angle:120,colors:["#ff6b6b","#4ecdc4","#45b7d1","#96ceb4","#ffeaa7","#dfe6e9"]})},250)}function bb(i){return i?i.pending.length===0&&i.in_progress.length===0&&i.done.length>0:!1}function jb(i,c){const d=m.useRef(new Set),u=m.useRef(null);m.useEffect(()=>{if(!i||!c)return;const h=bb(i);if(u.current!==c){u.current=c,h&&d.current.add(c);return}h&&!d.current.has(c)&&(d.current.add(c),yb(),pb())},[i,c])}const Oi=[{id:"twitter",name:"Twitter",description:"Clean and modern blue design",previewColors:{primary:"#4a9eff",background:"#ffffff",accent:"#e8f4ff"}},{id:"claude",name:"Claude",description:"Warm beige tones with orange accents",previewColors:{primary:"#c75b2a",background:"#faf6f0",accent:"#f5ede4"}},{id:"neo-brutalism",name:"Neo Brutalism",description:"Bold colors with hard shadows",previewColors:{primary:"#ff4d00",background:"#ffffff",accent:"#ffeb00"}},{id:"retro-arcade",name:"Retro Arcade",description:"Vibrant pink and teal pixel vibes",previewColors:{primary:"#e8457c",background:"#f0e6d3",accent:"#4eb8a5"}},{id:"aurora",name:"Aurora",description:"Deep violet and teal, like northern lights",previewColors:{primary:"#8b5cf6",background:"#faf8ff",accent:"#2dd4bf"}},{id:"business",name:"Business",description:"Deep navy (#000e4e) and gray monochrome",previewColors:{primary:"#000e4e",background:"#eaecef",accent:"#6b7280"}}],Lm="autoforge-theme",Bm="autoforge-dark-mode";function vb(i){switch(i){case"twitter":return"";case"claude":return"theme-claude";case"neo-brutalism":return"theme-neo-brutalism";case"retro-arcade":return"theme-retro-arcade";case"aurora":return"theme-aurora";case"business":return"theme-business";default:return""}}function So(){const[i,c]=m.useState(()=>{try{const g=localStorage.getItem(Lm);if(g==="twitter"||g==="claude"||g==="neo-brutalism"||g==="retro-arcade"||g==="aurora"||g==="business")return g}catch{}return"twitter"}),[d,u]=m.useState(()=>{try{return localStorage.getItem(Bm)==="true"}catch{return!1}});m.useEffect(()=>{const g=document.documentElement;g.classList.remove("theme-claude","theme-neo-brutalism","theme-retro-arcade","theme-aurora","theme-business");const T=vb(i);T&&g.classList.add(T),d?g.classList.add("dark"):g.classList.remove("dark");try{localStorage.setItem(Lm,i),localStorage.setItem(Bm,String(d))}catch{}},[i,d]);const h=m.useCallback(g=>{c(g)},[]),x=m.useCallback(g=>{u(g)},[]),y=m.useCallback(()=>{u(g=>!g)},[]);return{theme:i,setTheme:h,darkMode:d,setDarkMode:x,toggleDarkMode:y,themes:Oi,currentTheme:Oi.find(g=>g.id===i)??Oi[0]}}function vn(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function Nb({projectName:i,onError:c}){const[d,u]=m.useState([]),[h,x]=m.useState(!1),[y,g]=m.useState(!1),[T,C]=m.useState("disconnected"),[A,D]=m.useState(null),[H,v]=m.useState(null),E=m.useRef(null),O=m.useRef(null),L=m.useRef(0),z=3,b=m.useRef(null),S=m.useRef(null),X=m.useRef(!1);m.useEffect(()=>{X.current=y},[y]),m.useEffect(()=>()=>{b.current&&clearInterval(b.current),S.current&&clearTimeout(S.current),E.current&&E.current.close()},[]),m.useEffect(()=>{if(y)return;const se=setTimeout(()=>{const K=setInterval(async()=>{if(X.current){clearInterval(K);return}try{const U=await Ay(i);U.exists&&U.status==="complete"&&(g(!0),x(!1),u(q=>{const W=q[q.length-1];return W?.role==="assistant"&&W.isStreaming?[...q.slice(0,-1),{...W,isStreaming:!1}]:q}),u(q=>[...q,{id:vn(),role:"system",content:`Spec creation complete! Files written: ${U.files_written.join(", ")}${U.feature_count?` (${U.feature_count} features)`:""}`,timestamp:new Date}]),clearInterval(K))}catch{}},3e3);return()=>clearInterval(K)},3e3);return()=>clearTimeout(se)},[i,y]);const J=m.useCallback(()=>{if(E.current?.readyState===WebSocket.OPEN)return;C("connecting");const se=window.location.protocol==="https:"?"wss:":"ws:",K=window.location.host,U=`${se}//${K}/api/spec/ws/${encodeURIComponent(i)}`,q=new WebSocket(U);E.current=q,q.onopen=()=>{C("connected"),L.current=0,b.current=window.setInterval(()=>{q.readyState===WebSocket.OPEN&&q.send(JSON.stringify({type:"ping"}))},3e4)},q.onclose=()=>{if(C("disconnected"),b.current&&(clearInterval(b.current),b.current=null),L.current<z&&!X.current){L.current++;const W=Math.min(1e3*Math.pow(2,L.current),1e4);S.current=window.setTimeout(J,W)}},q.onerror=()=>{C("error"),c?.("WebSocket connection error")},q.onmessage=W=>{try{const le=JSON.parse(W.data);switch(le.type){case"text":{u(j=>{const M=j[j.length-1];return M?.role==="assistant"&&M.isStreaming?[...j.slice(0,-1),{...M,content:M.content+le.content}]:(O.current=vn(),[...j,{id:O.current,role:"assistant",content:le.content,timestamp:new Date,isStreaming:!0}])});break}case"question":{D(le.questions),v(le.tool_id||null),x(!1),u(j=>{const M=j[j.length-1];return M?.role==="assistant"&&M.isStreaming?[...j.slice(0,-1),{...M,isStreaming:!1,questions:le.questions}]:j});break}case"spec_complete":{g(!0),x(!1),u(j=>{const M=j[j.length-1];return M?.role==="assistant"&&M.isStreaming?[...j.slice(0,-1),{...M,isStreaming:!1}]:j}),u(j=>[...j,{id:vn(),role:"system",content:`Specification file created: ${le.path}`,timestamp:new Date}]);break}case"file_written":{u(j=>[...j,{id:vn(),role:"system",content:`File created: ${le.path}`,timestamp:new Date}]);break}case"complete":{g(!0),x(!1),u(j=>{const M=j[j.length-1];return M?.role==="assistant"&&M.isStreaming?[...j.slice(0,-1),{...M,isStreaming:!1}]:j});break}case"error":{x(!1),c?.(le.content),u(j=>[...j,{id:vn(),role:"system",content:`Error: ${le.content}`,timestamp:new Date}]);break}case"pong":break;case"response_done":{x(!1),u(j=>{const M=j[j.length-1];return M?.role==="assistant"&&M.isStreaming?[...j.slice(0,-1),{...M,isStreaming:!1}]:j});break}}}catch(le){console.error("Failed to parse WebSocket message:",le)}}},[i,c]),$=m.useCallback(()=>{J();const se=()=>{E.current?.readyState===WebSocket.OPEN?(x(!0),E.current.send(JSON.stringify({type:"start"}))):E.current?.readyState===WebSocket.CONNECTING&&setTimeout(se,100)};setTimeout(se,100)},[J]),F=m.useCallback((se,K)=>{if(!E.current||E.current.readyState!==WebSocket.OPEN){c?.("Not connected");return}u(q=>[...q,{id:vn(),role:"user",content:se,attachments:K,timestamp:new Date}]),D(null),v(null),x(!0);const U={type:"message",content:se};K&&K.length>0&&(U.attachments=K.map(q=>({filename:q.filename,mimeType:q.mimeType,base64Data:q.base64Data}))),E.current.send(JSON.stringify(U))},[c]),ee=m.useCallback(se=>{if(!E.current||E.current.readyState!==WebSocket.OPEN){c?.("Not connected");return}const K=Object.values(se).map(U=>Array.isArray(U)?U.join(", "):U).join("; ");u(U=>[...U,{id:vn(),role:"user",content:K,timestamp:new Date}]),D(null),v(null),x(!0),E.current.send(JSON.stringify({type:"answer",answers:se,tool_id:H}))},[H,c]),Y=m.useCallback(()=>{L.current=z,b.current&&(clearInterval(b.current),b.current=null),E.current&&(E.current.close(),E.current=null),C("disconnected")},[]);return{messages:d,isLoading:h,isComplete:y,connectionStatus:T,currentQuestions:A,currentToolId:H,start:$,sendMessage:F,sendAnswer:ee,disconnect:Y}}function Oe(...i){return ap(np(i))}function _e({className:i,...c}){return a.jsx("div",{"data-slot":"card",className:Oe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",i),...c})}function Gi({className:i,...c}){return a.jsx("div",{"data-slot":"card-header",className:Oe("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",i),...c})}function wo({className:i,...c}){return a.jsx("div",{"data-slot":"card-title",className:Oe("leading-none font-semibold",i),...c})}function Sb({className:i,...c}){return a.jsx("div",{"data-slot":"card-description",className:Oe("text-muted-foreground text-sm",i),...c})}function Ge({className:i,...c}){return a.jsx("div",{"data-slot":"card-content",className:Oe("px-6",i),...c})}const Hm=/\*\*(.*?)\*\*/g,Co=m.memo(function({message:c}){const{role:d,content:u,attachments:h,timestamp:x,isStreaming:y}=c,g=x.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),C={user:{icon:lp,bgColor:"bg-primary",textColor:"text-primary-foreground",align:"justify-end",bubbleAlign:"items-end",iconBg:"bg-primary",iconColor:"text-primary-foreground"},assistant:{icon:qi,bgColor:"bg-muted",textColor:"text-foreground",align:"justify-start",bubbleAlign:"items-start",iconBg:"bg-secondary",iconColor:"text-secondary-foreground"},system:{icon:sp,bgColor:"bg-green-100 dark:bg-green-900/30",textColor:"text-green-900 dark:text-green-100",align:"justify-center",bubbleAlign:"items-center",iconBg:"bg-green-500",iconColor:"text-white"}}[d],A=C.icon;return d==="system"?a.jsx("div",{className:`flex ${C.align} px-4 py-2`,children:a.jsx("div",{className:`${C.bgColor} border border-border rounded-lg px-4 py-2 text-sm font-mono ${C.textColor}`,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(A,{size:14}),u]})})}):a.jsx("div",{className:`flex ${C.align} px-4 py-2`,children:a.jsxs("div",{className:`flex flex-col ${C.bubbleAlign} max-w-[80%] gap-1`,children:[a.jsxs("div",{className:"flex items-start gap-2",children:[d==="assistant"&&a.jsx("div",{className:`${C.iconBg} p-1.5 rounded flex-shrink-0`,children:a.jsx(A,{size:16,className:C.iconColor})}),a.jsxs(_e,{className:`${C.bgColor} px-4 py-3 border ${y?"animate-pulse":""}`,children:[u&&a.jsx("div",{className:`whitespace-pre-wrap text-sm leading-relaxed ${C.textColor}`,children:u.split(`
|
|
10
|
+
`).map((D,H)=>{Hm.lastIndex=0;const v=[];let E=0,O;for(;(O=Hm.exec(D))!==null;)O.index>E&&v.push(D.slice(E,O.index)),v.push(a.jsx("strong",{className:"font-bold",children:O[1]},`bold-${H}-${O.index}`)),E=O.index+O[0].length;return E<D.length&&v.push(D.slice(E)),a.jsxs("span",{children:[v.length>0?v:D,H<u.split(`
|
|
11
|
+
`).length-1&&`
|
|
12
|
+
`]},H)})}),h&&h.length>0&&a.jsx("div",{className:`flex flex-wrap gap-2 ${u?"mt-3":""}`,children:h.map(D=>a.jsxs("div",{className:"border border-border rounded p-1 bg-card",children:[a.jsx("img",{src:D.previewUrl,alt:D.filename,className:"max-w-48 max-h-48 object-contain cursor-pointer hover:opacity-90 transition-opacity rounded",onClick:()=>window.open(D.previewUrl,"_blank"),title:`${D.filename} (click to enlarge)`}),a.jsx("span",{className:"text-xs text-muted-foreground block mt-1 text-center",children:D.filename})]},D.id))}),y&&a.jsx("span",{className:"inline-block w-2 h-4 bg-primary ml-1 animate-pulse rounded"})]}),d==="user"&&a.jsx("div",{className:`${C.iconBg} p-1.5 rounded flex-shrink-0`,children:a.jsx(A,{size:16,className:C.iconColor})})]}),a.jsx("span",{className:"text-xs text-muted-foreground font-mono px-2",children:g})]})})}),wb=ho("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Z({className:i,variant:c="default",size:d="default",asChild:u=!1,...h}){const x=u?yh:"button";return a.jsx(x,{"data-slot":"button","data-variant":c,"data-size":d,className:Oe(wb({variant:c,size:d,className:i})),...h})}function dt({className:i,type:c,...d}){return a.jsx("input",{type:c,"data-slot":"input",className:Oe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),...d})}const Cb=ho("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ie({className:i,variant:c="default",asChild:d=!1,...u}){const h=d?yh:"span";return a.jsx(h,{"data-slot":"badge","data-variant":c,className:Oe(Cb({variant:c}),i),...u})}function zb({questions:i,onSubmit:c,disabled:d=!1}){const[u,h]=m.useState({}),[x,y]=m.useState({}),[g,T]=m.useState({}),C=(O,L,z)=>{const b=String(O);if(L==="Other"){T(S=>({...S,[b]:!0}));return}T(S=>({...S,[b]:!1})),h(S=>{if(z){const X=S[b]||[];return X.includes(L)?{...S,[b]:X.filter(J=>J!==L)}:{...S,[b]:[...X,L]}}else return{...S,[b]:L}})},A=(O,L)=>{const z=String(O);y(b=>({...b,[z]:L})),h(b=>({...b,[z]:L}))},D=()=>{const O={};i.forEach((L,z)=>{const b=String(z);g[b]&&x[b]?O[b]=x[b]:u[b]&&(O[b]=u[b])}),c(O)},H=(O,L,z)=>{const b=String(O),S=u[b];return z?Array.isArray(S)&&S.includes(L):S===L},v=O=>{const L=String(O);return!!(u[L]||g[L]&&x[L])},E=i.every((O,L)=>v(L));return a.jsxs("div",{className:"space-y-6 p-4",children:[i.map((O,L)=>a.jsx(_e,{children:a.jsxs(Ge,{className:"p-4",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx(ie,{children:O.header}),a.jsx("span",{className:"font-bold text-foreground",children:O.question}),O.multiSelect&&a.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:"(select multiple)"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[O.options.map((z,b)=>{const S=H(L,z.label,O.multiSelect);return a.jsx("button",{onClick:()=>C(L,z.label,O.multiSelect),disabled:d,className:`
|
|
13
|
+
text-left p-4 rounded-lg border-2 transition-all duration-150
|
|
14
|
+
${S?"bg-primary/10 border-primary":"bg-card border-border hover:border-primary/50 hover:bg-muted"}
|
|
15
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
16
|
+
`,children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("div",{className:`
|
|
17
|
+
w-5 h-5 flex-shrink-0 mt-0.5 border-2 flex items-center justify-center
|
|
18
|
+
${O.multiSelect?"rounded":"rounded-full"}
|
|
19
|
+
${S?"bg-primary border-primary text-primary-foreground":"border-border bg-background"}
|
|
20
|
+
`,children:S&&a.jsx(ea,{size:12,strokeWidth:3})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"font-bold text-foreground",children:z.label}),a.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:z.description})]})]})},b)}),a.jsx("button",{onClick:()=>C(L,"Other",O.multiSelect),disabled:d,className:`
|
|
21
|
+
text-left p-4 rounded-lg border-2 transition-all duration-150
|
|
22
|
+
${g[String(L)]?"bg-primary/10 border-primary":"bg-card border-border hover:border-primary/50 hover:bg-muted"}
|
|
23
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
24
|
+
`,children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("div",{className:`
|
|
25
|
+
w-5 h-5 flex-shrink-0 mt-0.5 border-2 flex items-center justify-center
|
|
26
|
+
${O.multiSelect?"rounded":"rounded-full"}
|
|
27
|
+
${g[String(L)]?"bg-primary border-primary text-primary-foreground":"border-border bg-background"}
|
|
28
|
+
`,children:g[String(L)]&&a.jsx(ea,{size:12,strokeWidth:3})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"font-bold text-foreground",children:"Other"}),a.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Provide a custom answer"})]})]})})]}),g[String(L)]&&a.jsx("div",{className:"mt-4",children:a.jsx(dt,{type:"text",value:x[String(L)]||"",onChange:z=>A(L,z.target.value),placeholder:"Type your answer...",autoFocus:!0,disabled:d})})]})},L)),a.jsx("div",{className:"flex justify-end",children:a.jsx(Z,{onClick:D,disabled:d||!E,children:"Continue"})})]})}function Sh(){return a.jsxs("div",{className:"flex items-center gap-2 p-4",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),a.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:"Claude is thinking..."})]})}function ul(i,c=!0){return!(i.key!=="Enter"||c&&i.shiftKey||i.nativeEvent.isComposing)}function Qi({className:i,...c}){return a.jsx("textarea",{"data-slot":"textarea",className:Oe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",i),...c})}const Ab=ho("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function vt({className:i,variant:c,...d}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:Oe(Ab({variant:c}),i),...d})}function Tb({className:i,...c}){return a.jsx("div",{"data-slot":"alert-title",className:Oe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",i),...c})}function Nt({className:i,...c}){return a.jsx("div",{"data-slot":"alert-description",className:Oe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",i),...c})}const Eb=5*1024*1024,Db=["image/jpeg","image/png"],kb=`Let's call it Simple Todo. This is a really simple web app that I can use to track my to-do items using a Kanban board. I should be able to add to-dos and then drag and drop them through the Kanban board. The different columns in the Kanban board are:
|
|
29
|
+
|
|
30
|
+
- To Do
|
|
31
|
+
- In Progress
|
|
32
|
+
- Done
|
|
33
|
+
|
|
34
|
+
The app should use a neobrutalism design.
|
|
35
|
+
|
|
36
|
+
There is no need for user authentication either. All the to-dos will be stored in local storage, so each user has access to all of their to-dos when they open their browser. So do not worry about implementing a backend with user authentication or a database. Simply store everything in local storage. As for the design, please try to avoid AI slop, so use your front-end design skills to design something beautiful and practical. As for the content of the to-dos, we should store:
|
|
37
|
+
|
|
38
|
+
- The name or the title at the very least
|
|
39
|
+
- Optionally, we can also set tags, due dates, and priorities which should be represented as beautiful little badges on the to-do card
|
|
40
|
+
|
|
41
|
+
Users should have the ability to easily clear out all the completed To-Dos. They should also be able to filter and search for To-Dos as well.
|
|
42
|
+
|
|
43
|
+
You choose the rest. Keep it simple. Should be 25 features.`;function wh({projectName:i,onComplete:c,onCancel:d,onExitToProject:u,initializerStatus:h="idle",initializerError:x=null,onRetryInitializer:y}){const[g,T]=m.useState(""),[C,A]=m.useState(null),[D,H]=m.useState(!1),[v,E]=m.useState([]),O=m.useRef(null),L=m.useRef(null),z=m.useRef(null),{messages:b,isLoading:S,isComplete:X,connectionStatus:J,currentQuestions:$,start:F,sendMessage:ee,sendAnswer:Y,disconnect:se}=Nb({projectName:i,onComplete:c,onError:P=>A(P)});m.useEffect(()=>(F(),()=>{se()}),[]),m.useEffect(()=>{O.current?.scrollIntoView({behavior:"smooth"})},[b,$,S]),m.useEffect(()=>{!S&&!$&&L.current&&L.current.focus()},[S,$]);const K=()=>{const P=g.trim();if(!(!P&&v.length===0||S)){if(/^\s*\/exit\s*$/i.test(P)){T(""),u();return}ee(P,v.length>0?v:void 0),T(""),E([]),L.current&&(L.current.style.height="auto")}},U=P=>{ul(P)&&(P.preventDefault(),K())},q=P=>{Y(P)},W=m.useCallback(P=>{P&&Array.from(P).forEach(fe=>{if(!Db.includes(fe.type)){A(`Invalid file type: ${fe.name}. Only JPEG and PNG are supported.`);return}if(fe.size>Eb){A(`File too large: ${fe.name}. Maximum size is 5 MB.`);return}const ue=new FileReader;ue.onload=Ce=>{const ne=Ce.target?.result,Re=ne.split(",")[1],ot={id:`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,filename:fe.name,mimeType:fe.type,base64Data:Re,previewUrl:ne,size:fe.size};E(ft=>[...ft,ot])},ue.readAsDataURL(fe)})},[]),le=m.useCallback(P=>{E(fe=>fe.filter(ue=>ue.id!==P))},[]),j=m.useCallback(P=>{P.preventDefault(),W(P.dataTransfer.files)},[W]),M=m.useCallback(P=>{P.preventDefault()},[]),I=()=>{switch(J){case"connected":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[a.jsx(ms,{size:12}),"Connected"]});case"connecting":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[a.jsx(ms,{size:12,className:"animate-pulse"}),"Connecting..."]});case"error":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-destructive",children:[a.jsx(fs,{size:12}),"Error"]});default:return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(fs,{size:12}),"Disconnected"]})}};return a.jsxs("div",{className:"flex flex-col h-screen bg-background",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b-2 border-border bg-card",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("h2",{className:"font-display font-bold text-lg text-foreground",children:["Create Spec: ",i]}),a.jsx(I,{})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[X&&a.jsxs("span",{className:"flex items-center gap-1 text-sm text-green-500 font-bold",children:[a.jsx(ta,{size:16}),"Complete"]}),a.jsxs(Z,{onClick:()=>{T(kb),L.current&&(L.current.style.height="auto",L.current.style.height=`${Math.min(L.current.scrollHeight,200)}px`)},variant:"ghost",size:"sm",title:"Load sample prompt (Simple Todo app)",children:[a.jsx(ih,{size:16}),"Load Sample"]}),a.jsxs(Z,{onClick:u,variant:"ghost",size:"sm",title:"Exit chat and go to project (you can start the agent manually)",children:[a.jsx(xo,{size:16}),"Exit to Project"]}),a.jsx(Z,{onClick:d,variant:"ghost",size:"icon",title:"Cancel",children:a.jsx(We,{size:20})})]})]}),C&&a.jsxs(vt,{variant:"destructive",className:"rounded-none border-x-0 border-t-0",children:[a.jsx(za,{size:16}),a.jsx(Nt,{className:"flex-1",children:C}),a.jsx(Z,{onClick:()=>A(null),variant:"ghost",size:"icon",className:"h-6 w-6",children:a.jsx(We,{size:14})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto py-4 min-h-0",children:[b.length===0&&!S&&a.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:a.jsx(_e,{className:"p-6 max-w-md",children:a.jsxs(Ge,{className:"p-0",children:[a.jsx("h3",{className:"font-display font-bold text-lg mb-2",children:"Starting Spec Creation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting to Claude to help you create your app specification..."}),J==="error"&&a.jsxs(Z,{onClick:F,className:"mt-4",size:"sm",children:[a.jsx(ds,{size:14}),"Retry Connection"]})]})})}),b.map(P=>a.jsx(Co,{message:P},P.id)),$&&$.length>0&&a.jsx(zb,{questions:$,onSubmit:q,disabled:S}),S&&!$&&a.jsx(Sh,{}),a.jsx("div",{ref:O})]}),!X&&a.jsxs("div",{className:"p-4 border-t-2 border-border bg-card",onDrop:j,onDragOver:M,children:[v.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:v.map(P=>a.jsxs("div",{className:"relative group border-2 border-border p-1 bg-card rounded shadow-sm",children:[a.jsx("img",{src:P.previewUrl,alt:P.filename,className:"w-16 h-16 object-cover rounded"}),a.jsx("button",{onClick:()=>le(P.id),className:"absolute -top-2 -right-2 bg-destructive text-destructive-foreground rounded-full p-0.5 border-2 border-border hover:scale-110 transition-transform",title:"Remove attachment",children:a.jsx(We,{size:12})}),a.jsx("span",{className:"text-xs truncate block max-w-16 mt-1 text-center text-muted-foreground",children:P.filename.length>10?`${P.filename.substring(0,7)}...`:P.filename})]},P.id))}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("input",{ref:z,type:"file",accept:"image/jpeg,image/png",multiple:!0,onChange:P=>W(P.target.files),className:"hidden"}),a.jsx(Z,{onClick:()=>z.current?.click(),disabled:J!=="connected",variant:"ghost",size:"icon",title:"Attach image (JPEG, PNG - max 5MB)",children:a.jsx(Ri,{size:18})}),a.jsx(Qi,{ref:L,value:g,onChange:P=>{T(P.target.value),P.target.style.height="auto",P.target.style.height=`${Math.min(P.target.scrollHeight,200)}px`},onKeyDown:U,placeholder:$?"Or type a custom response...":v.length>0?"Add a message with your image(s)...":"Type your response... (or /exit to go to project)",className:"flex-1 resize-none min-h-[46px] max-h-[200px] overflow-y-auto",disabled:S&&!$||J!=="connected",rows:1}),a.jsx(Z,{onClick:K,disabled:!g.trim()&&v.length===0||S&&!$||J!=="connected",className:"px-6",children:a.jsx(go,{size:18})})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Press Enter to send, Shift+Enter for new line. Drag & drop or click ",a.jsx(Ri,{size:12,className:"inline"})," to attach images (JPEG/PNG, max 5MB)."]})]}),X&&a.jsx("div",{className:`p-4 border-t-2 border-border ${h==="error"?"bg-destructive":"bg-green-500"}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"flex items-center gap-2",children:h==="starting"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{size:20,className:"animate-spin text-white"}),a.jsxs("span",{className:"font-bold text-white",children:["Starting agent",D?" (YOLO mode)":"","..."]})]}):h==="error"?a.jsxs(a.Fragment,{children:[a.jsx(za,{size:20,className:"text-white"}),a.jsx("span",{className:"font-bold text-white",children:x||"Failed to start agent"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ta,{size:20,className:"text-white"}),a.jsx("span",{className:"font-bold text-white",children:"Specification created successfully!"})]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[h==="error"&&y&&a.jsxs(Z,{onClick:y,variant:"secondary",children:[a.jsx(ds,{size:14}),"Retry"]}),h==="idle"&&a.jsxs(a.Fragment,{children:[a.jsxs(Z,{onClick:()=>H(!D),variant:D?"default":"secondary",size:"sm",className:D?"bg-yellow-500 hover:bg-yellow-600 text-yellow-900":"",title:"YOLO Mode: Skip testing for rapid prototyping",children:[a.jsx(ip,{size:16}),a.jsx("span",{className:D?"font-bold":"",children:"YOLO"})]}),a.jsxs(Z,{onClick:()=>c("",D),children:["Continue to Project",a.jsx(rh,{size:16})]})]})]})]})})]})}function Mb({onSelect:i,onCancel:c,initialPath:d}){const[u,h]=m.useState(d),[x,y]=m.useState(null),[g,T]=m.useState(!1),[C,A]=m.useState(""),[D,H]=m.useState(null),{data:v,isLoading:E,error:O,refetch:L}=Rt({queryKey:["filesystem","list",u],queryFn:()=>Dy(u)});m.useEffect(()=>{v?.current_path&&y(v.current_path)},[v?.current_path]);const z=Y=>{h(Y),y(Y),T(!1),A(""),H(null)},b=()=>{v?.parent_path&&z(v.parent_path)},S=Y=>{z(`${Y.letter}:/`)},X=Y=>{Y.is_directory&&z(Y.path)},J=async()=>{if(!C.trim()){H("Folder name is required");return}if(!/^[a-zA-Z0-9_\-. ]+$/.test(C)){H("Invalid folder name");return}const Y=`${v?.current_path}/${C.trim()}`;try{await ky(Y),await L(),z(Y)}catch(se){H(se instanceof Error?se.message:"Failed to create folder")}},$=()=>{x&&i(x)},F=Y=>{if(!Y)return[];const se=[];if(/^[A-Za-z]:/.test(Y)){const q=Y.slice(0,2);se.push({name:q,path:`${q}/`}),Y=Y.slice(3)}else Y.startsWith("/")&&(se.push({name:"/",path:"/"}),Y=Y.slice(1));const K=Y.split("/").filter(Boolean);let U=se.length>0?se[0].path:"";for(const q of K)U=U.endsWith("/")?U+q:U+"/"+q,se.push({name:q,path:U});return se},ee=v?.current_path?F(v.current_path):[];return a.jsxs("div",{className:"flex flex-col h-full max-h-[70vh]",children:[a.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(_i,{size:20,className:"text-primary"}),a.jsx("span",{className:"font-semibold",children:"Select Project Folder"})]}),a.jsxs("div",{className:"flex items-center gap-1 flex-wrap text-sm",children:[v?.parent_path&&a.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:b,title:"Go up",children:a.jsx(po,{size:16})}),ee.map((Y,se)=>a.jsxs("div",{className:"flex items-center",children:[se>0&&a.jsx(oo,{size:14,className:"text-muted-foreground mx-1"}),a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>z(Y.path),className:se===ee.length-1?"font-semibold":"",children:Y.name})]},Y.path))]})]}),v?.drives&&v.drives.length>0&&a.jsx("div",{className:"flex-shrink-0 p-3 border-b bg-muted/50",children:a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Drives:"}),v.drives.map(Y=>a.jsxs(Z,{variant:u?.startsWith(Y.letter)?"default":"outline",size:"sm",onClick:()=>S(Y),children:[a.jsx(rp,{size:14}),Y.letter,": ",Y.label&&`(${Y.label})`]},Y.letter))]})}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto bg-card",children:a.jsxs("div",{className:"p-2",children:[E?a.jsx("div",{className:"flex items-center justify-center p-8",children:a.jsx(Me,{size:24,className:"animate-spin text-primary"})}):O?a.jsxs("div",{className:"p-4 text-center",children:[a.jsx(za,{size:32,className:"mx-auto mb-2 text-destructive"}),a.jsx("p",{className:"text-destructive",children:O instanceof Error?O.message:"Failed to load directory"}),a.jsx(Z,{variant:"outline",size:"sm",onClick:()=>L(),className:"mt-2",children:"Retry"})]}):a.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[v?.entries.filter(Y=>Y.is_directory).map(Y=>a.jsxs("button",{onClick:()=>X(Y),onDoubleClick:()=>z(Y.path),className:`
|
|
44
|
+
w-full text-left p-2 rounded-md
|
|
45
|
+
flex items-center gap-2
|
|
46
|
+
hover:bg-muted
|
|
47
|
+
border-2 border-transparent transition-colors
|
|
48
|
+
${x===Y.path?"bg-primary/10 border-primary":""}
|
|
49
|
+
`,children:[x===Y.path?a.jsx(Ui,{size:18,className:"text-primary flex-shrink-0"}):a.jsx(_i,{size:18,className:"text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"truncate flex-1",children:Y.name}),Y.has_children&&a.jsx(oo,{size:14,className:"ml-auto text-muted-foreground flex-shrink-0"})]},Y.path)),v?.entries.filter(Y=>Y.is_directory).length===0&&a.jsxs("div",{className:"p-4 text-center text-muted-foreground",children:[a.jsx(_i,{size:32,className:"mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No subfolders"}),a.jsx("p",{className:"text-sm",children:"You can create a new folder or select this directory."})]})]}),g&&a.jsx(_e,{className:"mt-2",children:a.jsxs(Ge,{className:"p-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(zm,{size:18,className:"text-primary"}),a.jsx(dt,{type:"text",value:C,onChange:Y=>A(Y.target.value),placeholder:"New folder name",className:"flex-1",autoFocus:!0,onKeyDown:Y=>{ul(Y,!1)&&J(),Y.key==="Escape"&&(T(!1),A(""),H(null))}}),a.jsx(Z,{onClick:J,size:"sm",children:"Create"}),a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>{T(!1),A(""),H(null)},children:"Cancel"})]}),D&&a.jsx("p",{className:"text-sm text-destructive mt-1",children:D})]})})]})}),a.jsxs("div",{className:"flex-shrink-0 p-4 border-t bg-card",children:[a.jsx(_e,{className:"mb-3",children:a.jsxs(Ge,{className:"p-2",children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Selected path:"}),a.jsx("div",{className:"font-mono text-sm truncate",children:x||"No folder selected"}),x&&a.jsx("div",{className:"text-xs text-muted-foreground mt-2 italic",children:"This folder will contain all project files"})]})}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Z,{variant:"outline",onClick:()=>T(!0),disabled:g,children:[a.jsx(zm,{size:16}),"New Folder"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Z,{variant:"outline",onClick:c,children:"Cancel"}),a.jsx(Z,{onClick:$,disabled:!x,children:"Select This Folder"})]})]})]})]})}function aa({...i}){return a.jsx(Qp,{"data-slot":"dialog",...i})}function _b({...i}){return a.jsx(Xp,{"data-slot":"dialog-portal",...i})}function Ob({className:i,...c}){return a.jsx(Kp,{"data-slot":"dialog-overlay",className:Oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",i),...c})}function na({className:i,children:c,showCloseButton:d=!0,...u}){return a.jsxs(_b,{"data-slot":"dialog-portal",children:[a.jsx(Ob,{}),a.jsxs(Yp,{"data-slot":"dialog-content",className:Oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] max-h-[calc(100vh-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none overflow-y-auto sm:max-w-lg",i),...u,children:[c,d&&a.jsxs(bh,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a.jsx(We,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function sa({className:i,...c}){return a.jsx("div",{"data-slot":"dialog-header",className:Oe("flex flex-col gap-2 text-center sm:text-left",i),...c})}function en({className:i,showCloseButton:c=!1,children:d,...u}){return a.jsxs("div",{"data-slot":"dialog-footer",className:Oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",i),...u,children:[d,c&&a.jsx(bh,{asChild:!0,children:a.jsx(Z,{variant:"outline",children:"Close"})})]})}function la({className:i,...c}){return a.jsx(Vp,{"data-slot":"dialog-title",className:Oe("text-lg leading-none font-semibold",i),...c})}function Bi({className:i,...c}){return a.jsx(Fp,{"data-slot":"dialog-description",className:Oe("text-muted-foreground text-sm",i),...c})}function qe({className:i,...c}){return a.jsx(Zp,{"data-slot":"label",className:Oe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",i),...c})}function Rb({isOpen:i,onClose:c,onProjectCreated:d,onStepChange:u}){const[h,x]=m.useState("name"),[y,g]=m.useState(""),[T,C]=m.useState(null),[A,D]=m.useState(null),[H,v]=m.useState(null),[E,O]=m.useState("idle"),[L,z]=m.useState(null),[b,S]=m.useState(!1),X=$y(),J=j=>{x(j),u?.(j)};if(!i)return null;const $=j=>{j.preventDefault();const M=y.trim();if(!M){v("Please enter a project name");return}if(!/^[a-zA-Z0-9_-]+$/.test(M)){v("Project name can only contain letters, numbers, hyphens, and underscores");return}v(null),J("folder")},F=j=>{C(j),J("method")},ee=()=>{J("name")},Y=async j=>{if(D(j),!T){v("Please select a project folder first"),J("folder");return}if(j==="manual")try{const M=await X.mutateAsync({name:y.trim(),path:T,specMethod:"manual"});J("complete"),setTimeout(()=>{d(M.name),W()},1500)}catch(M){v(M instanceof Error?M.message:"Failed to create project")}else try{await X.mutateAsync({name:y.trim(),path:T,specMethod:"claude"}),J("chat")}catch(M){v(M instanceof Error?M.message:"Failed to create project")}},se=async(j,M=!1)=>{S(M),O("starting");try{await vo(y.trim(),{yoloMode:M,maxConcurrency:3}),J("complete"),setTimeout(()=>{d(y.trim()),W()},1500)}catch(I){O("error"),z(I instanceof Error?I.message:"Failed to start agent")}},K=()=>{z(null),O("idle"),se("",b)},U=()=>{J("method"),D(null)},q=()=>{d(y.trim()),W()},W=()=>{J("name"),g(""),C(null),D(null),v(null),O("idle"),z(null),S(!1),c()},le=()=>{h==="method"?(J("folder"),D(null)):h==="folder"&&(J("name"),C(null))};return h==="chat"?ph.createPortal(a.jsx("div",{className:"fixed inset-0 z-50 bg-background flex flex-col",children:a.jsx(wh,{projectName:y.trim(),onComplete:se,onCancel:U,onExitToProject:q,initializerStatus:E,initializerError:L,onRetryInitializer:K})}),document.body):h==="folder"?a.jsx(aa,{open:!0,onOpenChange:j=>!j&&W(),children:a.jsxs(na,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col p-0",children:[a.jsx(sa,{className:"p-6 pb-4 border-b",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(_i,{size:24,className:"text-primary"}),a.jsxs("div",{children:[a.jsx(la,{children:"Select Project Location"}),a.jsxs(Bi,{children:["Select the folder to use for project ",a.jsx("span",{className:"font-semibold font-mono",children:y}),". Create a new folder or choose an existing one."]})]})]})}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Mb,{onSelect:F,onCancel:ee})})]})}):a.jsx(aa,{open:!0,onOpenChange:j=>!j&&W(),children:a.jsxs(na,{className:"sm:max-w-lg",children:[a.jsx(sa,{children:a.jsxs(la,{children:[h==="name"&&"Create New Project",h==="method"&&"Choose Setup Method",h==="complete"&&"Project Created!"]})}),h==="name"&&a.jsxs("form",{onSubmit:$,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{htmlFor:"project-name",children:"Project Name"}),a.jsx(dt,{id:"project-name",type:"text",value:y,onChange:j=>g(j.target.value),placeholder:"my-awesome-app",pattern:"^[a-zA-Z0-9_-]+$",autoFocus:!0}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Use letters, numbers, hyphens, and underscores only."})]}),H&&a.jsx(vt,{variant:"destructive",children:a.jsx(Nt,{children:H})}),a.jsx(en,{children:a.jsxs(Z,{type:"submit",disabled:!y.trim(),children:["Next",a.jsx(rh,{size:16})]})})]}),h==="method"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(Bi,{children:"How would you like to define your project?"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(_e,{className:"cursor-pointer hover:border-primary transition-colors",onClick:()=>!X.isPending&&Y("claude"),children:a.jsx(Ge,{className:"p-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:a.jsx(qi,{size:24,className:"text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Create with Claude"}),a.jsx(ie,{children:"Recommended"})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Interactive conversation to define features and generate your app specification automatically."})]})]})})}),a.jsx(_e,{className:"cursor-pointer hover:border-primary transition-colors",onClick:()=>!X.isPending&&Y("manual"),children:a.jsx(Ge,{className:"p-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-2 bg-secondary rounded-lg",children:a.jsx(uo,{size:24,className:"text-secondary-foreground"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("span",{className:"font-semibold",children:"Edit Templates Manually"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Edit the template files directly. Best for developers who want full control."})]})]})})})]}),H&&a.jsx(vt,{variant:"destructive",children:a.jsx(Nt,{children:H})}),X.isPending&&a.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[a.jsx(Me,{size:16,className:"animate-spin"}),a.jsx("span",{children:"Creating project..."})]}),a.jsx(en,{className:"sm:justify-start",children:a.jsxs(Z,{variant:"ghost",onClick:le,disabled:X.isPending,children:[a.jsx(po,{size:16}),"Back"]})})]}),h==="complete"&&a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-full mb-4",children:a.jsx(ta,{size:32,className:"text-primary"})}),a.jsx("h3",{className:"font-semibold text-xl mb-2",children:y}),a.jsx("p",{className:"text-muted-foreground",children:"Your project has been created successfully!"}),a.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[a.jsx(Me,{size:16,className:"animate-spin"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Redirecting..."})]})]})]})})}function Ch({isOpen:i,title:c,message:d,confirmLabel:u="Confirm",cancelLabel:h="Cancel",variant:x="danger",isLoading:y=!1,onConfirm:g,onCancel:T}){return a.jsx(aa,{open:i,onOpenChange:C=>!C&&T(),children:a.jsxs(na,{className:"sm:max-w-md",children:[a.jsx(sa,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 rounded-lg ${x==="danger"?"bg-destructive/10 text-destructive":"bg-primary/10 text-primary"}`,children:a.jsx(Aa,{size:20})}),a.jsx(la,{children:c})]})}),a.jsx(Bi,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground",children:d})}),a.jsxs(en,{className:"gap-2 sm:gap-0",children:[a.jsx(Z,{variant:"outline",onClick:T,disabled:y,children:h}),a.jsx(Z,{variant:x==="danger"?"destructive":"default",onClick:g,disabled:y,children:y?"Deleting...":u})]})]})})}function Ub({...i}){return a.jsx(Jp,{"data-slot":"dropdown-menu",...i})}function Lb({...i}){return a.jsx($p,{"data-slot":"dropdown-menu-trigger",...i})}function Bb({className:i,sideOffset:c=4,...d}){return a.jsx(Wp,{children:a.jsx(Ip,{"data-slot":"dropdown-menu-content",sideOffset:c,className:Oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",i),...d})})}function qm({className:i,inset:c,variant:d="default",...u}){return a.jsx(Pp,{"data-slot":"dropdown-menu-item","data-inset":c,"data-variant":d,className:Oe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),...u})}function Hb({className:i,...c}){return a.jsx(ey,{"data-slot":"dropdown-menu-separator",className:Oe("bg-border -mx-1 my-1 h-px",i),...c})}function qb({projects:i,selectedProject:c,onSelectProject:d,isLoading:u,onSpecCreatingChange:h}){const[x,y]=m.useState(!1),[g,T]=m.useState(!1),[C,A]=m.useState(null),D=Wy(),H=z=>{d(z),y(!1)},v=(z,b)=>{z.stopPropagation(),z.preventDefault(),A(b)},E=async()=>{if(C)try{await D.mutateAsync(C),c===C&&d(null),A(null)}catch(z){console.error("Failed to delete project:",z),A(null)}},O=()=>{A(null)},L=i.find(z=>z.name===c);return a.jsxs("div",{className:"relative",children:[a.jsxs(Ub,{open:x,onOpenChange:y,children:[a.jsx(Lb,{asChild:!0,children:a.jsxs(Z,{variant:"outline",className:"min-w-[200px] justify-between",disabled:u,children:[u?a.jsx(Me,{size:18,className:"animate-spin"}):c?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Ui,{size:18}),c]}),L&&L.stats.total>0&&a.jsxs(ie,{className:"ml-2",children:[L.stats.percentage,"%"]})]}):a.jsx("span",{className:"text-muted-foreground",children:"Select Project"}),a.jsx(ol,{size:18,className:`transition-transform ${x?"rotate-180":""}`})]})}),a.jsxs(Bb,{align:"start",className:"w-[280px] p-0 flex flex-col",children:[i.length>0?a.jsx("div",{className:"max-h-[300px] overflow-y-auto p-1",children:i.map(z=>a.jsxs(qm,{className:`flex items-center justify-between cursor-pointer ${z.name===c?"bg-primary/10":""}`,onSelect:()=>{d(z.name)},children:[a.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[a.jsx(Ui,{size:16}),z.name,z.stats.total>0&&a.jsxs("span",{className:"text-sm font-mono text-muted-foreground ml-auto",children:[z.stats.passing,"/",z.stats.total]})]}),a.jsx(Z,{variant:"ghost",size:"icon-xs",onClick:b=>v(b,z.name),className:"text-muted-foreground hover:text-destructive",children:a.jsx(tn,{size:14})})]},z.name))}):a.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No projects yet"}),a.jsx(Hb,{className:"my-0"}),a.jsx("div",{className:"p-1",children:a.jsxs(qm,{onSelect:()=>{T(!0)},className:"cursor-pointer font-semibold",children:[a.jsx(Pa,{size:16}),"New Project"]})})]})]}),a.jsx(Rb,{isOpen:g,onClose:()=>T(!1),onProjectCreated:H,onStepChange:z=>h?.(z==="chat")}),a.jsx(Ch,{isOpen:C!==null,title:"Delete Project",message:`Are you sure you want to remove "${C}" from the registry? This will unregister the project but preserve its files on disk.`,confirmLabel:"Delete",cancelLabel:"Cancel",variant:"danger",isLoading:D.isPending,onConfirm:E,onCancel:O})]})}function Gb({feature:i,allFeatures:c=[],compact:d=!1}){const u=i.dependencies||[];if(u.length===0)return null;const h=i.blocked??(i.blocking_dependencies&&i.blocking_dependencies.length>0)??!1,x=i.blocking_dependencies?.length??0;let y=u.length-x;if(c.length>0&&!i.blocking_dependencies){const g=new Set(c.filter(T=>T.passes).map(T=>T.id));y=u.filter(T=>g.has(T)).length}return d?a.jsx(ie,{variant:"outline",className:`gap-1 font-mono text-xs ${h?"bg-destructive/10 text-destructive border-destructive/30":"bg-muted text-muted-foreground"}`,title:h?`Blocked by ${x} ${x===1?"dependency":"dependencies"}`:`${y}/${u.length} dependencies satisfied`,children:h?a.jsxs(a.Fragment,{children:[a.jsx(Aa,{size:12}),a.jsx("span",{children:x})]}):a.jsxs(a.Fragment,{children:[a.jsx(hs,{size:12}),a.jsxs("span",{children:[y,"/",u.length]})]})}):a.jsx("div",{className:"flex items-center gap-2",children:h?a.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[a.jsx(Aa,{size:14}),a.jsxs("span",{className:"font-medium",children:["Blocked by ",x," ",x===1?"dependency":"dependencies"]})]}):a.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[a.jsx(ea,{size:14,className:"text-primary"}),a.jsxs("span",{children:["All ",u.length," ",u.length===1?"dependency":"dependencies"," satisfied"]})]})})}const Qb={primary:"#6B7280",secondary:"#9CA3AF",accent:"#F3F4F6"},Yb={Spark:{primary:"#3B82F6",secondary:"#60A5FA",accent:"#DBEAFE"},Fizz:{primary:"#F97316",secondary:"#FB923C",accent:"#FFEDD5"},Octo:{primary:"#8B5CF6",secondary:"#A78BFA",accent:"#EDE9FE"},Hoot:{primary:"#22C55E",secondary:"#4ADE80",accent:"#DCFCE7"},Buzz:{primary:"#EAB308",secondary:"#FACC15",accent:"#FEF9C3"},Pixel:{primary:"#EC4899",secondary:"#F472B6",accent:"#FCE7F3"},Byte:{primary:"#06B6D4",secondary:"#22D3EE",accent:"#CFFAFE"},Nova:{primary:"#F43F5E",secondary:"#FB7185",accent:"#FFE4E6"},Chip:{primary:"#84CC16",secondary:"#A3E635",accent:"#ECFCCB"},Bolt:{primary:"#FBBF24",secondary:"#FCD34D",accent:"#FEF3C7"},Dash:{primary:"#14B8A6",secondary:"#2DD4BF",accent:"#CCFBF1"},Zap:{primary:"#A855F7",secondary:"#C084FC",accent:"#F3E8FF"},Gizmo:{primary:"#64748B",secondary:"#94A3B8",accent:"#F1F5F9"},Turbo:{primary:"#EF4444",secondary:"#F87171",accent:"#FEE2E2"},Blip:{primary:"#10B981",secondary:"#34D399",accent:"#D1FAE5"},Neon:{primary:"#D946EF",secondary:"#E879F9",accent:"#FAE8FF"},Widget:{primary:"#6366F1",secondary:"#818CF8",accent:"#E0E7FF"},Zippy:{primary:"#F59E0B",secondary:"#FBBF24",accent:"#FEF3C7"},Quirk:{primary:"#0EA5E9",secondary:"#38BDF8",accent:"#E0F2FE"},Flux:{primary:"#7C3AED",secondary:"#8B5CF6",accent:"#EDE9FE"}};function Vb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"16",y:"20",width:"32",height:"28",rx:"4",fill:i.primary}),a.jsx("rect",{x:"12",y:"8",width:"40",height:"24",rx:"4",fill:i.secondary}),a.jsx("circle",{cx:"32",cy:"4",r:"4",fill:i.primary,className:"animate-pulse"}),a.jsx("rect",{x:"30",y:"4",width:"4",height:"8",fill:i.primary}),a.jsx("circle",{cx:"24",cy:"18",r:"4",fill:"white"}),a.jsx("circle",{cx:"40",cy:"18",r:"4",fill:"white"}),a.jsx("circle",{cx:"25",cy:"18",r:"2",fill:i.primary}),a.jsx("circle",{cx:"41",cy:"18",r:"2",fill:i.primary}),a.jsx("rect",{x:"26",y:"24",width:"12",height:"2",rx:"1",fill:"white"}),a.jsx("rect",{x:"6",y:"24",width:"8",height:"4",rx:"2",fill:i.primary}),a.jsx("rect",{x:"50",y:"24",width:"8",height:"4",rx:"2",fill:i.primary})]})}function Fb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("polygon",{points:"12,12 20,28 4,28",fill:i.primary}),a.jsx("polygon",{points:"52,12 60,28 44,28",fill:i.primary}),a.jsx("polygon",{points:"14,14 18,26 8,26",fill:i.accent}),a.jsx("polygon",{points:"50,14 56,26 44,26",fill:i.accent}),a.jsx("ellipse",{cx:"32",cy:"36",rx:"24",ry:"22",fill:i.primary}),a.jsx("ellipse",{cx:"32",cy:"40",rx:"18",ry:"14",fill:i.accent}),a.jsx("ellipse",{cx:"24",cy:"32",rx:"4",ry:"5",fill:"white"}),a.jsx("ellipse",{cx:"40",cy:"32",rx:"4",ry:"5",fill:"white"}),a.jsx("circle",{cx:"25",cy:"33",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"41",cy:"33",r:"2",fill:"#1a1a1a"}),a.jsx("ellipse",{cx:"32",cy:"42",rx:"4",ry:"3",fill:i.primary}),a.jsx("line",{x1:"8",y1:"38",x2:"18",y2:"40",stroke:i.primary,strokeWidth:"2"}),a.jsx("line",{x1:"8",y1:"44",x2:"18",y2:"44",stroke:i.primary,strokeWidth:"2"}),a.jsx("line",{x1:"46",y1:"40",x2:"56",y2:"38",stroke:i.primary,strokeWidth:"2"}),a.jsx("line",{x1:"46",y1:"44",x2:"56",y2:"44",stroke:i.primary,strokeWidth:"2"})]})}function Xb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("path",{d:"M12,48 Q8,56 12,60 Q16,64 20,58",fill:i.secondary}),a.jsx("path",{d:"M22,50 Q20,58 24,62",fill:i.secondary}),a.jsx("path",{d:"M32,52 Q32,60 36,62",fill:i.secondary}),a.jsx("path",{d:"M42,50 Q44,58 40,62",fill:i.secondary}),a.jsx("path",{d:"M52,48 Q56,56 52,60 Q48,64 44,58",fill:i.secondary}),a.jsx("ellipse",{cx:"32",cy:"32",rx:"22",ry:"24",fill:i.primary}),a.jsx("ellipse",{cx:"24",cy:"28",rx:"6",ry:"8",fill:"white"}),a.jsx("ellipse",{cx:"40",cy:"28",rx:"6",ry:"8",fill:"white"}),a.jsx("ellipse",{cx:"25",cy:"30",rx:"3",ry:"4",fill:i.primary}),a.jsx("ellipse",{cx:"41",cy:"30",rx:"3",ry:"4",fill:i.primary}),a.jsx("path",{d:"M24,42 Q32,48 40,42",stroke:i.accent,strokeWidth:"2",fill:"none",strokeLinecap:"round"})]})}function Kb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("polygon",{points:"14,8 22,24 6,20",fill:i.primary}),a.jsx("polygon",{points:"50,8 58,20 42,24",fill:i.primary}),a.jsx("ellipse",{cx:"32",cy:"40",rx:"20",ry:"18",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"28",r:"20",fill:i.secondary}),a.jsx("circle",{cx:"24",cy:"26",r:"10",fill:i.accent}),a.jsx("circle",{cx:"40",cy:"26",r:"10",fill:i.accent}),a.jsx("circle",{cx:"24",cy:"26",r:"6",fill:"white"}),a.jsx("circle",{cx:"40",cy:"26",r:"6",fill:"white"}),a.jsx("circle",{cx:"25",cy:"27",r:"3",fill:"#1a1a1a"}),a.jsx("circle",{cx:"41",cy:"27",r:"3",fill:"#1a1a1a"}),a.jsx("polygon",{points:"32,32 28,40 36,40",fill:"#F97316"}),a.jsx("ellipse",{cx:"32",cy:"46",rx:"10",ry:"8",fill:i.accent})]})}function Zb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("ellipse",{cx:"14",cy:"32",rx:"10",ry:"14",fill:i.accent,opacity:"0.8",className:"animate-pulse"}),a.jsx("ellipse",{cx:"50",cy:"32",rx:"10",ry:"14",fill:i.accent,opacity:"0.8",className:"animate-pulse"}),a.jsx("ellipse",{cx:"32",cy:"36",rx:"14",ry:"20",fill:i.primary}),a.jsx("ellipse",{cx:"32",cy:"30",rx:"12",ry:"6",fill:"#1a1a1a"}),a.jsx("ellipse",{cx:"32",cy:"44",rx:"12",ry:"6",fill:"#1a1a1a"}),a.jsx("circle",{cx:"32",cy:"16",r:"12",fill:i.primary}),a.jsx("line",{x1:"26",y1:"8",x2:"22",y2:"2",stroke:"#1a1a1a",strokeWidth:"2"}),a.jsx("line",{x1:"38",y1:"8",x2:"42",y2:"2",stroke:"#1a1a1a",strokeWidth:"2"}),a.jsx("circle",{cx:"22",cy:"2",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"42",cy:"2",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"28",cy:"14",r:"4",fill:"white"}),a.jsx("circle",{cx:"36",cy:"14",r:"4",fill:"white"}),a.jsx("circle",{cx:"29",cy:"15",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"37",cy:"15",r:"2",fill:"#1a1a1a"}),a.jsx("path",{d:"M28,20 Q32,24 36,20",stroke:"#1a1a1a",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})]})}function Jb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"20",y:"28",width:"24",height:"28",fill:i.primary}),a.jsx("rect",{x:"16",y:"32",width:"8",height:"20",fill:i.secondary}),a.jsx("rect",{x:"40",y:"32",width:"8",height:"20",fill:i.secondary}),a.jsx("rect",{x:"16",y:"8",width:"32",height:"24",fill:i.primary}),a.jsx("rect",{x:"20",y:"14",width:"8",height:"8",fill:"white"}),a.jsx("rect",{x:"36",y:"14",width:"8",height:"8",fill:"white"}),a.jsx("rect",{x:"24",y:"16",width:"4",height:"4",fill:"#1a1a1a"}),a.jsx("rect",{x:"38",y:"16",width:"4",height:"4",fill:"#1a1a1a"}),a.jsx("rect",{x:"26",y:"26",width:"12",height:"4",fill:i.accent})]})}function $b({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("polygon",{points:"32,8 56,20 56,44 32,56 8,44 8,20",fill:i.primary}),a.jsx("polygon",{points:"32,8 56,20 32,32 8,20",fill:i.secondary}),a.jsx("polygon",{points:"32,32 56,20 56,44 32,56",fill:i.accent,opacity:"0.6"}),a.jsx("circle",{cx:"24",cy:"28",r:"4",fill:"white"}),a.jsx("circle",{cx:"40",cy:"28",r:"4",fill:"white"}),a.jsx("circle",{cx:"25",cy:"29",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"41",cy:"29",r:"2",fill:"#1a1a1a"}),a.jsx("path",{d:"M26,38 Q32,42 38,38",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round"})]})}function Wb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("polygon",{points:"32,2 38,22 58,22 42,36 48,56 32,44 16,56 22,36 6,22 26,22",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"14",fill:i.secondary}),a.jsx("circle",{cx:"27",cy:"30",r:"3",fill:"white"}),a.jsx("circle",{cx:"37",cy:"30",r:"3",fill:"white"}),a.jsx("circle",{cx:"28",cy:"31",r:"1.5",fill:"#1a1a1a"}),a.jsx("circle",{cx:"38",cy:"31",r:"1.5",fill:"#1a1a1a"}),a.jsx("path",{d:"M28,37 Q32,40 36,37",stroke:"#1a1a1a",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})]})}function Ib({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"16",y:"16",width:"32",height:"32",rx:"4",fill:i.primary}),a.jsx("rect",{x:"20",y:"10",width:"4",height:"8",fill:i.secondary}),a.jsx("rect",{x:"30",y:"10",width:"4",height:"8",fill:i.secondary}),a.jsx("rect",{x:"40",y:"10",width:"4",height:"8",fill:i.secondary}),a.jsx("rect",{x:"20",y:"46",width:"4",height:"8",fill:i.secondary}),a.jsx("rect",{x:"30",y:"46",width:"4",height:"8",fill:i.secondary}),a.jsx("rect",{x:"40",y:"46",width:"4",height:"8",fill:i.secondary}),a.jsx("circle",{cx:"26",cy:"28",r:"4",fill:i.accent}),a.jsx("circle",{cx:"38",cy:"28",r:"4",fill:i.accent}),a.jsx("circle",{cx:"26",cy:"28",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"38",cy:"28",r:"2",fill:"#1a1a1a"}),a.jsx("rect",{x:"26",y:"38",width:"12",height:"3",rx:"1",fill:i.accent})]})}function Pb({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("polygon",{points:"36,4 20,28 30,28 24,60 48,32 36,32 44,4",fill:i.primary}),a.jsx("polygon",{points:"34,8 24,26 32,26 28,52 42,34 34,34 40,8",fill:i.secondary}),a.jsx("circle",{cx:"30",cy:"30",r:"3",fill:"white"}),a.jsx("circle",{cx:"38",cy:"26",r:"3",fill:"white"}),a.jsx("circle",{cx:"31",cy:"31",r:"1.5",fill:"#1a1a1a"}),a.jsx("circle",{cx:"39",cy:"27",r:"1.5",fill:"#1a1a1a"})]})}function ej({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"4",y:"28",width:"12",height:"3",rx:"1",fill:i.accent,opacity:"0.6"}),a.jsx("rect",{x:"8",y:"34",width:"10",height:"3",rx:"1",fill:i.accent,opacity:"0.4"}),a.jsx("ellipse",{cx:"36",cy:"32",rx:"20",ry:"16",fill:i.primary}),a.jsx("ellipse",{cx:"40",cy:"32",rx:"14",ry:"12",fill:i.secondary}),a.jsx("circle",{cx:"38",cy:"28",r:"4",fill:"white"}),a.jsx("circle",{cx:"48",cy:"28",r:"4",fill:"white"}),a.jsx("circle",{cx:"39",cy:"29",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"49",cy:"29",r:"2",fill:"#1a1a1a"}),a.jsx("path",{d:"M40,36 Q44,39 48,36",stroke:"#1a1a1a",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})]})}function tj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("path",{d:"M12,32 L20,28 L16,32 L22,30",stroke:i.secondary,strokeWidth:"2",className:"animate-pulse"}),a.jsx("path",{d:"M52,32 L44,28 L48,32 L42,30",stroke:i.secondary,strokeWidth:"2",className:"animate-pulse"}),a.jsx("circle",{cx:"32",cy:"32",r:"18",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"14",fill:i.secondary}),a.jsx("circle",{cx:"26",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"38",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"27",cy:"31",r:"2",fill:i.primary}),a.jsx("circle",{cx:"39",cy:"31",r:"2",fill:i.primary}),a.jsx("path",{d:"M28,40 Q32,44 36,40",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round"})]})}function aj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"28",y:"4",width:"8",height:"8",fill:i.primary}),a.jsx("rect",{x:"28",y:"52",width:"8",height:"8",fill:i.primary}),a.jsx("rect",{x:"4",y:"28",width:"8",height:"8",fill:i.primary}),a.jsx("rect",{x:"52",y:"28",width:"8",height:"8",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"20",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"14",fill:i.secondary}),a.jsx("circle",{cx:"26",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"38",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"27",cy:"31",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"39",cy:"31",r:"2",fill:"#1a1a1a"}),a.jsx("path",{d:"M28,40 Q32,43 36,40",stroke:"#1a1a1a",strokeWidth:"2",fill:"none",strokeLinecap:"round"})]})}function nj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("ellipse",{cx:"32",cy:"58",rx:"8",ry:"6",fill:"#FBBF24",className:"animate-pulse"}),a.jsx("ellipse",{cx:"32",cy:"56",rx:"5",ry:"4",fill:"#FCD34D"}),a.jsx("ellipse",{cx:"32",cy:"32",rx:"14",ry:"24",fill:i.primary}),a.jsx("ellipse",{cx:"32",cy:"12",rx:"8",ry:"10",fill:i.secondary}),a.jsx("polygon",{points:"18,44 10,56 18,52",fill:i.secondary}),a.jsx("polygon",{points:"46,44 54,56 46,52",fill:i.secondary}),a.jsx("circle",{cx:"32",cy:"28",r:"8",fill:i.accent}),a.jsx("circle",{cx:"29",cy:"27",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"35",cy:"27",r:"2",fill:"#1a1a1a"}),a.jsx("path",{d:"M29,32 Q32,34 35,32",stroke:"#1a1a1a",strokeWidth:"1",fill:"none"})]})}function sj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("circle",{cx:"32",cy:"32",r:"28",stroke:i.accent,strokeWidth:"2",fill:"none",opacity:"0.3"}),a.jsx("circle",{cx:"32",cy:"32",r:"22",stroke:i.accent,strokeWidth:"2",fill:"none",opacity:"0.5"}),a.jsx("circle",{cx:"32",cy:"32",r:"14",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"10",fill:i.secondary}),a.jsx("circle",{cx:"28",cy:"30",r:"3",fill:"white"}),a.jsx("circle",{cx:"36",cy:"30",r:"3",fill:"white"}),a.jsx("circle",{cx:"29",cy:"31",r:"1.5",fill:"#1a1a1a"}),a.jsx("circle",{cx:"37",cy:"31",r:"1.5",fill:"#1a1a1a"}),a.jsx("path",{d:"M29,37 Q32,40 35,37",stroke:"white",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"})]})}function lj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("circle",{cx:"32",cy:"32",r:"26",fill:i.accent,opacity:"0.3"}),a.jsx("circle",{cx:"32",cy:"32",r:"22",fill:i.accent,opacity:"0.5"}),a.jsx("circle",{cx:"32",cy:"32",r:"18",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"12",fill:i.secondary}),a.jsx("circle",{cx:"27",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"37",cy:"30",r:"4",fill:"white"}),a.jsx("circle",{cx:"28",cy:"31",r:"2",fill:i.primary}),a.jsx("circle",{cx:"38",cy:"31",r:"2",fill:i.primary}),a.jsx("path",{d:"M28,38 Q32,42 36,38",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round"})]})}function ij({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"8",y:"12",width:"48",height:"40",rx:"4",fill:i.primary}),a.jsx("rect",{x:"8",y:"12",width:"48",height:"10",rx:"4",fill:i.secondary}),a.jsx("circle",{cx:"16",cy:"17",r:"2",fill:"#EF4444"}),a.jsx("circle",{cx:"24",cy:"17",r:"2",fill:"#FBBF24"}),a.jsx("circle",{cx:"32",cy:"17",r:"2",fill:"#22C55E"}),a.jsx("rect",{x:"12",y:"26",width:"40",height:"22",rx:"2",fill:i.accent}),a.jsx("circle",{cx:"24",cy:"34",r:"4",fill:"white"}),a.jsx("circle",{cx:"40",cy:"34",r:"4",fill:"white"}),a.jsx("circle",{cx:"25",cy:"35",r:"2",fill:i.primary}),a.jsx("circle",{cx:"41",cy:"35",r:"2",fill:i.primary}),a.jsx("rect",{x:"28",y:"42",width:"8",height:"3",rx:"1",fill:i.primary})]})}function rj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("ellipse",{cx:"22",cy:"14",rx:"6",ry:"14",fill:i.primary}),a.jsx("ellipse",{cx:"42",cy:"14",rx:"6",ry:"14",fill:i.primary}),a.jsx("ellipse",{cx:"22",cy:"14",rx:"3",ry:"10",fill:i.accent}),a.jsx("ellipse",{cx:"42",cy:"14",rx:"3",ry:"10",fill:i.accent}),a.jsx("circle",{cx:"32",cy:"38",r:"20",fill:i.primary}),a.jsx("circle",{cx:"24",cy:"34",r:"5",fill:"white"}),a.jsx("circle",{cx:"40",cy:"34",r:"5",fill:"white"}),a.jsx("circle",{cx:"25",cy:"35",r:"2.5",fill:"#1a1a1a"}),a.jsx("circle",{cx:"41",cy:"35",r:"2.5",fill:"#1a1a1a"}),a.jsx("ellipse",{cx:"32",cy:"44",rx:"3",ry:"2",fill:i.secondary}),a.jsx("path",{d:"M32,46 L32,50 M28,52 Q32,56 36,52",stroke:"#1a1a1a",strokeWidth:"1.5",fill:"none"})]})}function cj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("path",{d:"M24,20 Q24,8 32,8 Q44,8 44,20 Q44,28 32,32 L32,40",stroke:i.primary,strokeWidth:"8",fill:"none",strokeLinecap:"round"}),a.jsx("circle",{cx:"32",cy:"52",r:"6",fill:i.primary}),a.jsx("circle",{cx:"29",cy:"51",r:"1.5",fill:"white"}),a.jsx("circle",{cx:"35",cy:"51",r:"1.5",fill:"white"}),a.jsx("circle",{cx:"29",cy:"51",r:"0.75",fill:"#1a1a1a"}),a.jsx("circle",{cx:"35",cy:"51",r:"0.75",fill:"#1a1a1a"}),a.jsx("circle",{cx:"32",cy:"20",r:"4",fill:i.secondary})]})}function oj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("path",{d:"M8,32 Q16,16 32,32 Q48,48 56,32",stroke:i.primary,strokeWidth:"16",fill:"none",strokeLinecap:"round"}),a.jsx("path",{d:"M8,32 Q16,16 32,32 Q48,48 56,32",stroke:i.secondary,strokeWidth:"10",fill:"none",strokeLinecap:"round"}),a.jsx("circle",{cx:"28",cy:"28",r:"4",fill:"white"}),a.jsx("circle",{cx:"40",cy:"36",r:"4",fill:"white"}),a.jsx("circle",{cx:"29",cy:"29",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"41",cy:"37",r:"2",fill:"#1a1a1a"}),a.jsx("circle",{cx:"16",cy:"24",r:"2",fill:i.accent,className:"animate-pulse"}),a.jsx("circle",{cx:"48",cy:"40",r:"2",fill:i.accent,className:"animate-pulse"})]})}function uj({colors:i,size:c}){return a.jsxs("svg",{width:c,height:c,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("circle",{cx:"32",cy:"32",r:"28",fill:i.primary}),a.jsx("circle",{cx:"32",cy:"32",r:"24",fill:i.secondary}),a.jsx("text",{x:"32",y:"44",textAnchor:"middle",fontSize:"32",fontWeight:"bold",fill:"white",children:"?"})]})}const dj={Spark:Vb,Fizz:Fb,Octo:Xb,Hoot:Kb,Buzz:Zb,Pixel:Jb,Byte:$b,Nova:Wb,Chip:Ib,Bolt:Pb,Dash:ej,Zap:tj,Gizmo:aj,Turbo:nj,Blip:sj,Neon:lj,Widget:ij,Zippy:rj,Quirk:cj,Flux:oj},fj=uj,mj={sm:{svg:32,font:"text-xs"},md:{svg:48,font:"text-sm"},lg:{svg:64,font:"text-base"}};function hj(i){switch(i){case"idle":return"animate-bounce-gentle";case"thinking":return"animate-thinking";case"working":return"animate-working";case"testing":return"animate-testing";case"success":return"animate-celebrate";case"error":case"struggling":return"animate-shake-gentle";default:return""}}function xj(i){switch(i){case"working":return"shadow-[0_0_12px_rgba(0,180,216,0.5)]";case"thinking":return"shadow-[0_0_8px_rgba(255,214,10,0.4)]";case"success":return"shadow-[0_0_16px_rgba(112,224,0,0.6)]";case"error":case"struggling":return"shadow-[0_0_12px_rgba(255,84,0,0.5)]";default:return""}}function gj(i){switch(i){case"idle":return"waiting";case"thinking":return"analyzing";case"working":return"coding";case"testing":return"running tests";case"success":return"completed successfully";case"error":return"encountered an error";case"struggling":return"having difficulty";default:return i}}function xs({name:i,state:c,size:d="md",showName:u=!1}){const h=i==="Unknown",x=h?Qb:Yb[i],{svg:y,font:g}=mj[d],T=h?fj:dj[i],C=gj(c),A=`Agent ${i} is ${C}`;return a.jsxs("div",{className:"flex flex-col items-center gap-1",role:"status","aria-label":A,"aria-live":"polite",children:[a.jsx("div",{className:`
|
|
50
|
+
rounded-full p-1 transition-all duration-300
|
|
51
|
+
${hj(c)}
|
|
52
|
+
${xj(c)}
|
|
53
|
+
`,style:{backgroundColor:x.accent},title:A,role:"img","aria-hidden":"true",children:a.jsx(T,{colors:x,size:y})}),u&&a.jsx("span",{className:`${g} font-bold text-foreground`,style:{color:x.primary},children:i})]})}function pj(i){const c=["bg-pink-500","bg-cyan-500","bg-green-500","bg-yellow-500","bg-orange-500","bg-purple-500","bg-blue-500"];let d=0;for(let u=0;u<i.length;u++)d=i.charCodeAt(u)+((d<<5)-d);return c[Math.abs(d)%c.length]}function yj({feature:i,onClick:c,isInProgress:d,allFeatures:u=[],activeAgent:h}){const x=pj(i.category),y=i.blocked||i.blocking_dependencies&&i.blocking_dependencies.length>0,g=!!h;return a.jsx(_e,{onClick:c,className:`
|
|
54
|
+
cursor-pointer transition-all hover:border-primary py-3
|
|
55
|
+
${d?"animate-pulse":""}
|
|
56
|
+
${i.passes?"border-primary/50":""}
|
|
57
|
+
${y&&!i.passes?"border-destructive/50 opacity-80":""}
|
|
58
|
+
${g?"ring-2 ring-primary ring-offset-2":""}
|
|
59
|
+
`,children:a.jsxs(Ge,{className:"p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ie,{className:`${x} text-white`,children:i.category}),a.jsx(Gb,{feature:i,allFeatures:u,compact:!0})]}),a.jsxs("span",{className:"font-mono text-sm text-muted-foreground",children:["#",i.priority]})]}),a.jsx("h3",{className:"font-semibold line-clamp-2",children:i.name}),a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:i.description}),h&&a.jsxs("div",{className:"flex items-center gap-2 py-2 px-2 rounded-md bg-primary/10 border border-primary/30",children:[a.jsx(xs,{name:h.agentName,state:h.state,size:"sm"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"text-xs font-semibold text-primary",children:[h.agentName," is working on this!"]}),h.thought&&a.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[a.jsx(yo,{size:10,className:"text-muted-foreground shrink-0"}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate italic",children:h.thought})]})]})]}),a.jsx("div",{className:"flex items-center gap-2 text-sm",children:d?a.jsxs(a.Fragment,{children:[a.jsx(Me,{size:16,className:"animate-spin text-primary"}),a.jsx("span",{className:"text-primary font-medium",children:"Processing..."})]}):i.passes?a.jsxs(a.Fragment,{children:[a.jsx(ta,{size:16,className:"text-primary"}),a.jsx("span",{className:"text-primary font-medium",children:"Complete"})]}):y?a.jsxs(a.Fragment,{children:[a.jsx(us,{size:16,className:"text-destructive"}),a.jsx("span",{className:"text-destructive",children:"Blocked"})]}):a.jsxs(a.Fragment,{children:[a.jsx(us,{size:16,className:"text-muted-foreground"}),a.jsx("span",{className:"text-muted-foreground",children:"Pending"})]})})]})})}const bj={pending:"border-t-4 border-t-muted",progress:"border-t-4 border-t-primary",done:"border-t-4 border-t-primary"};function ro({title:i,count:c,features:d,allFeatures:u=[],activeAgents:h=[],color:x,onFeatureClick:y,onAddFeature:g,onExpandProject:T,showExpandButton:C,onCreateSpec:A,showCreateSpec:D}){const H=new Map;for(const v of h){const E=v.featureIds||[v.featureId];for(const O of E)H.set(O,v)}return a.jsxs(_e,{className:`overflow-hidden ${bj[x]} py-0`,children:[a.jsxs(Gi,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[a.jsxs(wo,{className:"text-lg font-semibold flex items-center gap-2",children:[i,a.jsx(ie,{variant:"secondary",children:c})]}),(g||T)&&a.jsxs("div",{className:"flex items-center gap-2",children:[g&&a.jsx(Z,{onClick:g,size:"icon-sm",title:"Add new feature (N)",children:a.jsx(Pa,{size:16})}),T&&C&&a.jsx(Z,{onClick:T,size:"icon-sm",variant:"secondary",title:"Expand project with AI (E)",children:a.jsx(Sn,{size:16})})]})]}),a.jsx(Ge,{className:"p-0",children:a.jsx("div",{className:"h-[600px] overflow-y-auto",children:a.jsx("div",{className:"p-4 space-y-3",children:d.length===0?a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:D&&A?a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{children:"No spec created yet"}),a.jsxs(Z,{onClick:A,children:[a.jsx(cp,{size:18}),"Create Spec with AI"]})]}):"No features"}):d.map((v,E)=>a.jsx("div",{className:"animate-slide-in",style:{animationDelay:`${E*50}ms`},children:a.jsx(yj,{feature:v,onClick:()=>y(v),isInProgress:x==="progress",allFeatures:u,activeAgent:H.get(v.id)})},v.id))})})})]})}function jj({features:i,onFeatureClick:c,onAddFeature:d,onExpandProject:u,activeAgents:h=[],onCreateSpec:x,hasSpec:y=!0}){const g=i&&i.pending.length+i.in_progress.length+i.done.length>0,T=i?[...i.pending,...i.in_progress,...i.done]:[];return i?a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(ro,{title:"Pending",count:i.pending.length,features:i.pending,allFeatures:T,activeAgents:h,color:"pending",onFeatureClick:c,onAddFeature:d,onExpandProject:u,showExpandButton:g,onCreateSpec:x,showCreateSpec:!y&&!g}),a.jsx(ro,{title:"In Progress",count:i.in_progress.length,features:i.in_progress,allFeatures:T,activeAgents:h,color:"progress",onFeatureClick:c}),a.jsx(ro,{title:"Done",count:i.done.length,features:i.done,allFeatures:T,activeAgents:h,color:"done",onFeatureClick:c})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:["Pending","In Progress","Done"].map(C=>a.jsx(_e,{className:"py-4",children:a.jsxs(Ge,{className:"p-4",children:[a.jsx("div",{className:"h-8 bg-muted animate-pulse rounded mb-4"}),a.jsx("div",{className:"space-y-3",children:[1,2,3].map(A=>a.jsx("div",{className:"h-24 bg-muted animate-pulse rounded"},A))})]})},C))})}function vj(i){return Rt({queryKey:["schedules",i],queryFn:()=>Vy(i),enabled:!!i})}function Nj(i){const c=at();return ct({mutationFn:d=>Fy(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["schedules",i]}),c.invalidateQueries({queryKey:["nextRun",i]})}})}function Sj(i){const c=at();return ct({mutationFn:d=>Ky(i,d),onSuccess:()=>{c.invalidateQueries({queryKey:["schedules",i]}),c.invalidateQueries({queryKey:["nextRun",i]})}})}function wj(i){const c=at();return ct({mutationFn:({scheduleId:d,enabled:u})=>Xy(i,d,{enabled:u}),onSuccess:()=>{c.invalidateQueries({queryKey:["schedules",i]}),c.invalidateQueries({queryKey:["nextRun",i]})}})}function Cj(i){return Rt({queryKey:["nextRun",i],queryFn:()=>Zy(i),enabled:!!i,refetchInterval:3e4})}function zj(i){const[c,d]=i.split(":").map(Number),u=new Date(Date.UTC(2e3,0,15,c,d,0,0)),h=u.getDate();let x=0;h===14&&(x=-1),h===16&&(x=1);const y=u.getHours(),g=u.getMinutes();return{time:`${String(y).padStart(2,"0")}:${String(g).padStart(2,"0")}`,dayShift:x}}function Aj(i){const[c,d]=i.split(":").map(Number),u=new Date(2e3,0,15,c,d,0,0),h=u.getUTCDate();let x=0;h===14&&(x=-1),h===16&&(x=1);const y=u.getUTCHours(),g=u.getUTCMinutes();return{time:`${String(y).padStart(2,"0")}:${String(g).padStart(2,"0")}`,dayShift:x}}function Tj(i){let c=0;return i&1&&(c|=2),i&2&&(c|=4),i&4&&(c|=8),i&8&&(c|=16),i&16&&(c|=32),i&32&&(c|=64),i&64&&(c|=1),c}function Ej(i){let c=0;return i&1&&(c|=64),i&2&&(c|=1),i&4&&(c|=2),i&8&&(c|=4),i&16&&(c|=8),i&32&&(c|=16),i&64&&(c|=32),c}function Gm(i,c){return c===1?Tj(i):c===-1?Ej(i):i}function Qm(i){const c=Math.floor(i/60),d=i%60;return c===0?`${d}m`:d===0?`${c}h`:`${c}h ${d}m`}function Dj(i){const c=new Date(i),d=new Date,u=c.getTime()-d.getTime();return Math.floor(u/(1e3*60*60))<24?c.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):c.toLocaleString([],{weekday:"short",hour:"numeric",minute:"2-digit"})}function kj(i){return new Date(i).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}const Ym=[{label:"Mon",bit:1},{label:"Tue",bit:2},{label:"Wed",bit:4},{label:"Thu",bit:8},{label:"Fri",bit:16},{label:"Sat",bit:32},{label:"Sun",bit:64}];function Vm(i,c){return(i&c)!==0}function Mj(i,c){return i^c}function _j({className:i,...c}){return a.jsx(ty,{"data-slot":"checkbox",className:Oe("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",i),...c,children:a.jsx(ay,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:a.jsx(ea,{className:"size-3.5"})})})}function mo({className:i,orientation:c="horizontal",decorative:d=!0,...u}){return a.jsx(ny,{"data-slot":"separator",decorative:d,orientation:c,className:Oe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",i),...u})}function Oj({projectName:i,isOpen:c,onClose:d}){const u=m.useRef(null),h=m.useRef(null),{data:x,isLoading:y}=vj(i),g=Nj(i),T=Sj(i),C=wj(i),[A,D]=m.useState({start_time:"22:00",duration_minutes:240,days_of_week:31,enabled:!0,yolo_mode:!1,model:null,max_concurrency:3}),[H,v]=m.useState(null);m.useEffect(()=>{c&&h.current&&h.current.focus()},[c]);const E=x?.schedules||[],O=async()=>{try{if(v(null),A.days_of_week===0){v("Please select at least one day");return}if(A.duration_minutes<1||A.duration_minutes>1440){v("Duration must be between 1 and 1440 minutes");return}const{time:S,dayShift:X}=Aj(A.start_time),J=Gm(A.days_of_week,X),$={...A,start_time:S,days_of_week:J};await g.mutateAsync($),D({start_time:"22:00",duration_minutes:240,days_of_week:31,enabled:!0,yolo_mode:!1,model:null,max_concurrency:3})}catch(S){v(S instanceof Error?S.message:"Failed to create schedule")}},L=async(S,X)=>{try{v(null),await C.mutateAsync({scheduleId:S,enabled:!X})}catch(J){v(J instanceof Error?J.message:"Failed to toggle schedule")}},z=async S=>{if(confirm("Are you sure you want to delete this schedule?"))try{v(null),await T.mutateAsync(S)}catch(X){v(X instanceof Error?X.message:"Failed to delete schedule")}},b=S=>{D(X=>({...X,days_of_week:Mj(X.days_of_week,S)}))};return a.jsx(aa,{open:c,onOpenChange:S=>!S&&d(),children:a.jsxs(na,{ref:u,className:"sm:max-w-[650px] max-h-[80vh] flex flex-col p-0",children:[a.jsx(sa,{className:"p-6 pb-4",children:a.jsxs(la,{className:"flex items-center gap-2",children:[a.jsx(Nn,{size:24,className:"text-primary"}),"Agent Schedules"]})}),a.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6",children:[H&&a.jsx(vt,{variant:"destructive",className:"mb-4",children:a.jsx(Nt,{children:H})}),y&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading schedules..."}),!y&&E.length>0&&a.jsx("div",{className:"space-y-3 mb-6",children:E.map(S=>{const{time:X,dayShift:J}=zj(S.start_time),$=Qm(S.duration_minutes),F=Gm(S.days_of_week,J);return a.jsx(_e,{children:a.jsx(Ge,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[a.jsx("span",{className:"text-lg font-semibold",children:X}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:["for ",$]})]}),a.jsx("div",{className:"flex gap-1 mb-2",children:Ym.map(ee=>{const Y=Vm(F,ee.bit);return a.jsx("span",{className:`text-xs px-2 py-1 rounded border ${Y?"border-primary bg-primary text-primary-foreground font-medium":"border-border text-muted-foreground"}`,children:ee.label},ee.label)})}),a.jsxs("div",{className:"flex gap-3 text-xs text-muted-foreground",children:[S.yolo_mode&&a.jsx("span",{className:"font-semibold text-yellow-600",children:"YOLO mode"}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(hs,{size:12}),S.max_concurrency,"x"]}),S.model&&a.jsxs("span",{children:["Model: ",S.model]}),S.crash_count>0&&a.jsxs("span",{className:"text-destructive",children:["Crashes: ",S.crash_count]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>L(S.id,S.enabled),disabled:C.isPending,className:S.enabled?"text-primary":"text-muted-foreground",children:S.enabled?"Enabled":"Disabled"}),a.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:()=>z(S.id),disabled:T.isPending,className:"text-destructive hover:text-destructive",children:a.jsx(tn,{size:16})})]})]})})},S.id)})}),!y&&E.length===0&&a.jsxs("div",{className:"text-center py-6 text-muted-foreground mb-6",children:[a.jsx(Nn,{size:48,className:"mx-auto mb-2 opacity-50"}),a.jsx("p",{children:"No schedules configured yet"})]}),a.jsx(mo,{className:"my-6"}),a.jsxs("div",{className:"pb-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Add New Schedule"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{children:"Start Time (Local)"}),a.jsx(dt,{type:"time",value:A.start_time,onChange:S=>D(X=>({...X,start_time:S.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{children:"Duration (minutes)"}),a.jsx(dt,{type:"number",min:"1",max:"1440",value:A.duration_minutes,onChange:S=>{const X=parseInt(S.target.value,10),J=isNaN(X)?1:Math.max(1,Math.min(1440,X));D($=>({...$,duration_minutes:J}))}}),a.jsx("p",{className:"text-xs text-muted-foreground",children:Qm(A.duration_minutes)})]})]}),a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx(qe,{children:"Days"}),a.jsx("div",{className:"flex gap-2",children:Ym.map(S=>{const X=Vm(A.days_of_week,S.bit);return a.jsx(Z,{variant:X?"default":"outline",size:"sm",onClick:()=>b(S.bit),children:S.label},S.label)})})]}),a.jsxs("div",{className:"mb-4 flex items-center space-x-2",children:[a.jsx(_j,{id:"yolo-mode",checked:A.yolo_mode,onCheckedChange:S=>D(X=>({...X,yolo_mode:S===!0}))}),a.jsx(qe,{htmlFor:"yolo-mode",className:"font-normal",children:"YOLO Mode (skip testing)"})]}),a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx(qe,{children:"Concurrent Agents (1-5)"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(hs,{size:16,className:A.max_concurrency>1?"text-primary":"text-muted-foreground"}),a.jsx("input",{type:"range",min:1,max:5,value:A.max_concurrency,onChange:S=>D(X=>({...X,max_concurrency:Number(S.target.value)})),className:"flex-1 h-2 accent-primary cursor-pointer"}),a.jsxs("span",{className:"text-sm font-medium min-w-[2rem] text-center",children:[A.max_concurrency,"x"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Run ",A.max_concurrency," agent",A.max_concurrency>1?"s":""," in parallel for faster feature completion"]})]}),a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx(qe,{children:"Model (optional, defaults to global setting)"}),a.jsx(dt,{placeholder:"e.g., claude-3-5-sonnet-20241022",value:A.model||"",onChange:S=>D(X=>({...X,model:S.target.value||null}))})]})]})]}),a.jsxs(en,{className:"p-6 pt-4 border-t",children:[a.jsx(Z,{variant:"outline",onClick:d,children:"Close"}),a.jsx(Z,{onClick:O,disabled:g.isPending||A.days_of_week===0,children:g.isPending?"Creating...":"Create Schedule"})]})]})})}function Rj({projectName:i,status:c,defaultConcurrency:d=3}){const{data:u}=No(),h=u?.yolo_mode??!1,[x,y]=m.useState(d);m.useEffect(()=>{y(d)},[d]);const g=Py(i),T=m.useRef(null),C=m.useCallback($=>{y($),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{g.mutate({default_concurrency:$})},500)},[g]);m.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const A=lb(i),D=ib(i),{data:H}=Cj(i),[v,E]=m.useState(!1),O=A.isPending||D.isPending,L=c==="running"||c==="paused",z=c==="loading",b=x>1,S=()=>A.mutate({yoloMode:h,parallelMode:b,maxConcurrency:x,testingAgentRatio:u?.testing_agent_ratio}),X=()=>D.mutate(),J=c==="stopped"||c==="crashed";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-4",children:[J&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(hs,{size:16,className:b?"text-primary":"text-muted-foreground"}),a.jsx("input",{type:"range",min:1,max:5,value:x,onChange:$=>C(Number($.target.value)),disabled:O,className:"w-16 h-2 accent-primary cursor-pointer",title:`${x} concurrent agent${x>1?"s":""}`,"aria-label":"Set number of concurrent agents"}),a.jsxs("span",{className:"text-xs font-semibold min-w-[1.5rem] text-center",children:[x,"x"]})]}),L&&b&&a.jsxs(ie,{variant:"secondary",className:"gap-1",children:[a.jsx(hs,{size:14}),x,"x"]}),H?.is_currently_running&&H.next_end&&a.jsxs(ie,{variant:"default",className:"gap-1",children:[a.jsx(Nn,{size:14}),"Running until ",kj(H.next_end)]}),!H?.is_currently_running&&H?.next_start&&a.jsxs(ie,{variant:"secondary",className:"gap-1",children:[a.jsx(Nn,{size:14}),"Next: ",Dj(H.next_start)]}),z?a.jsx(Z,{disabled:!0,variant:"outline",size:"sm",children:a.jsx(Me,{size:18,className:"animate-spin"})}):J?a.jsx(Z,{onClick:S,disabled:O,variant:h?"secondary":"default",size:"sm",title:h?"Start Agent (YOLO Mode)":"Start Agent",children:O?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsx(op,{size:18})}):a.jsx(Z,{onClick:X,disabled:O,variant:"destructive",size:"sm",title:h?"Stop Agent (YOLO Mode)":"Stop Agent",children:O?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsx(ch,{size:18})}),a.jsx(Z,{variant:"outline",size:"sm",onClick:()=>E(!0),title:"Manage schedules",children:a.jsx(Nn,{size:18})})]}),a.jsx(Oj,{projectName:i,isOpen:v,onClose:()=>E(!1)})]})}const Uj=3e4;function Lj(i){const c=i.trim();return!(/^\[Tool:/.test(c)||/^\s*Input:\s*\{/.test(c)||/^\[(Done|Error)\]/.test(c)||/^Output:/.test(c)||/^[[{]/.test(c)||c.length<10||/^[A-Za-z]:\\/.test(c)||/^\/[a-z]/.test(c))}function Bj(i){for(let c=i.length-1;c>=0;c--)if(Lj(i[c].line))return i[c].line.trim();return null}function Hj({passing:i,total:c,percentage:d,isConnected:u,logs:h=[],agentStatus:x}){const y=m.useMemo(()=>Bj(h),[h]),[g,T]=m.useState(null),[C,A]=m.useState(!0),D=h.length>0?new Date(h[h.length-1].timestamp).getTime():0,H=m.useMemo(()=>y?x==="running"?!0:x==="paused"?Date.now()-D<Uj:!1:!1,[y,x,D]);m.useEffect(()=>{if(y!==g&&y){A(!1);const E=setTimeout(()=>{T(y),A(!0)},150);return()=>clearTimeout(E)}},[y,g]);const v=x==="running";return a.jsxs(_e,{children:[a.jsxs(Gi,{className:"flex-row items-center justify-between space-y-0 pb-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(wo,{className:"text-xl uppercase tracking-wide",children:"Progress"}),a.jsx(ie,{variant:u?"default":"destructive",className:"gap-1",children:u?a.jsxs(a.Fragment,{children:[a.jsx(ms,{size:14}),"Live"]}):a.jsxs(a.Fragment,{children:[a.jsx(fs,{size:14}),"Offline"]})})]}),a.jsxs("div",{className:"flex items-baseline gap-1",children:[a.jsx("span",{className:"font-mono text-lg font-bold text-primary",children:i}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"/"}),a.jsx("span",{className:"font-mono text-lg font-bold",children:c})]})]}),a.jsxs(Ge,{className:"pt-3 pb-3",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"h-2.5 bg-muted rounded-full overflow-hidden flex-1",children:a.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-500 ease-out",style:{width:`${d}%`}})}),a.jsxs("span",{className:"text-sm font-bold tabular-nums text-muted-foreground w-12 text-right",children:[d.toFixed(1),"%"]})]}),a.jsx("div",{className:`
|
|
60
|
+
transition-all duration-300 ease-out overflow-hidden
|
|
61
|
+
${H&&g?"opacity-100 max-h-10 mt-3":"opacity-0 max-h-0 mt-0"}
|
|
62
|
+
`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx(up,{size:16,className:"text-primary",strokeWidth:2.5}),v&&a.jsx(Sn,{size:8,className:"absolute -top-1 -right-1 text-yellow-500 animate-pulse"})]}),a.jsx("p",{className:"font-mono text-sm truncate text-muted-foreground transition-all duration-150 ease-out",style:{opacity:C?1:0,transform:C?"translateY(0)":"translateY(-4px)"},children:g?.replace(/:$/,"")})]})})]})]})}function qj({onComplete:i}){const{data:c,isLoading:d,error:u}=rb(),{data:h,error:x}=cb(),y=h?.status==="healthy"&&!x,g=y&&c?.claude_cli&&c?.credentials,T=m.useCallback(()=>{g&&i()},[g,i]);return m.useEffect(()=>{T()},[T]),a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:a.jsx(_e,{className:"w-full max-w-lg",children:a.jsxs(Ge,{className:"p-8",children:[a.jsx("h1",{className:"font-display text-3xl font-bold text-center mb-2",children:"Setup Wizard"}),a.jsx("p",{className:"text-center text-muted-foreground mb-8",children:"Let's make sure everything is ready to go"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Di,{label:"Backend Server",description:"FastAPI server is running",status:x?"error":y?"success":"loading"}),a.jsx(Di,{label:"Claude CLI",description:"Claude Code CLI is installed",status:d?"loading":u?"error":c?.claude_cli?"success":"error",helpLink:"https://docs.anthropic.com/claude/claude-code",helpText:"Install Claude Code"}),a.jsx(Di,{label:"Anthropic Credentials",description:"API credentials are configured",status:d?"loading":u?"error":c?.credentials?"success":"error",helpLink:"https://console.anthropic.com/account/keys",helpText:"Get API Key"}),a.jsx(Di,{label:"Node.js",description:"Node.js is installed (for UI dev)",status:d?"loading":u?"error":c?.node?"success":"warning",helpLink:"https://nodejs.org",helpText:"Install Node.js",optional:!0})]}),g&&a.jsx(Z,{onClick:i,className:"w-full mt-8 bg-green-500 hover:bg-green-600 text-white",children:"Continue to Dashboard"}),(x||u)&&a.jsxs(vt,{variant:"destructive",className:"mt-6",children:[a.jsx(Tb,{children:"Setup Error"}),a.jsx(Nt,{children:x?"Cannot connect to the backend server. Make sure to run start_ui.py first.":"Failed to check setup status."})]})]})})})}function Di({label:i,description:c,status:d,helpLink:u,helpText:h,optional:x}){return a.jsxs("div",{className:"flex items-start gap-4 p-4 bg-background border-2 border-border rounded-lg",children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:d==="success"?a.jsx(ta,{size:24,className:"text-green-500"}):d==="error"?a.jsx(Am,{size:24,className:"text-destructive"}):d==="warning"?a.jsx(Am,{size:24,className:"text-yellow-500"}):a.jsx(Me,{size:24,className:"animate-spin text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-display font-bold text-foreground",children:i}),x&&a.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:c}),(d==="error"||d==="warning")&&u&&a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-2 text-sm text-primary hover:underline",children:[h," ",a.jsx(xo,{size:12})]})]})]})}function Gj({projectName:i,onClose:c}){const d=m.useId(),[u,h]=m.useState(""),[x,y]=m.useState(""),[g,T]=m.useState(""),[C,A]=m.useState(""),[D,H]=m.useState([{id:`${d}-step-0`,value:""}]),[v,E]=m.useState(null),[O,L]=m.useState(1),z=eb(i),b=()=>{H([...D,{id:`${d}-step-${O}`,value:""}]),L(O+1)},S=F=>{H(D.filter(ee=>ee.id!==F))},X=(F,ee)=>{H(D.map(Y=>Y.id===F?{...Y,value:ee}:Y))},J=async F=>{F.preventDefault(),E(null);const ee=D.map(Y=>Y.value.trim()).filter(Y=>Y.length>0);try{await z.mutateAsync({category:u.trim(),name:x.trim(),description:g.trim(),steps:ee,priority:C?parseInt(C,10):void 0}),c()}catch(Y){E(Y instanceof Error?Y.message:"Failed to create feature")}},$=u.trim()&&x.trim()&&g.trim();return a.jsx(aa,{open:!0,onOpenChange:F=>!F&&c(),children:a.jsxs(na,{className:"sm:max-w-2xl",children:[a.jsx(sa,{children:a.jsx(la,{children:"Add Feature"})}),a.jsxs("form",{onSubmit:J,className:"space-y-4",children:[v&&a.jsxs(vt,{variant:"destructive",children:[a.jsx(za,{className:"h-4 w-4"}),a.jsxs(Nt,{className:"flex items-center justify-between",children:[a.jsx("span",{children:v}),a.jsx(Z,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>E(null),children:a.jsx(We,{size:14})})]})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(qe,{htmlFor:"category",children:"Category"}),a.jsx(dt,{id:"category",type:"text",value:u,onChange:F=>h(F.target.value),placeholder:"e.g., Authentication, UI, API",required:!0})]}),a.jsxs("div",{className:"w-32 space-y-2",children:[a.jsx(qe,{htmlFor:"priority",children:"Priority"}),a.jsx(dt,{id:"priority",type:"number",value:C,onChange:F=>A(F.target.value),placeholder:"Auto",min:"1"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{htmlFor:"name",children:"Feature Name"}),a.jsx(dt,{id:"name",type:"text",value:x,onChange:F=>y(F.target.value),placeholder:"e.g., User login form",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{htmlFor:"description",children:"Description"}),a.jsx(Qi,{id:"description",value:g,onChange:F=>T(F.target.value),placeholder:"Describe what this feature should do...",className:"min-h-[100px] resize-y",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{children:"Test Steps (Optional)"}),a.jsx("div",{className:"space-y-2",children:D.map((F,ee)=>a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx("span",{className:"w-10 h-10 flex-shrink-0 flex items-center justify-center font-mono font-semibold text-sm border rounded-md bg-muted text-muted-foreground",children:ee+1}),a.jsx(dt,{type:"text",value:F.value,onChange:Y=>X(F.id,Y.target.value),placeholder:"Describe this step...",className:"flex-1"}),D.length>1&&a.jsx(Z,{type:"button",variant:"ghost",size:"icon",onClick:()=>S(F.id),children:a.jsx(tn,{size:18})})]},F.id))}),a.jsxs(Z,{type:"button",variant:"ghost",size:"sm",onClick:b,children:[a.jsx(Pa,{size:16}),"Add Step"]})]}),a.jsxs(en,{className:"pt-4 border-t",children:[a.jsx(Z,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),a.jsx(Z,{type:"submit",disabled:!$||z.isPending,children:z.isPending?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(Pa,{size:18}),"Create Feature"]})})]})]})]})})}function Qj({feature:i,projectName:c,onClose:d,onSaved:u}){const h=m.useId(),[x,y]=m.useState(i.category),[g,T]=m.useState(i.name),[C,A]=m.useState(i.description),[D,H]=m.useState(String(i.priority)),[v,E]=m.useState(()=>i.steps.length>0?i.steps.map((K,U)=>({id:`${h}-step-${U}`,value:K})):[{id:`${h}-step-0`,value:""}]),[O,L]=m.useState(null),[z,b]=m.useState(i.steps.length||1),S=nb(c),X=()=>{E([...v,{id:`${h}-step-${z}`,value:""}]),b(z+1)},J=K=>{E(v.filter(U=>U.id!==K))},$=(K,U)=>{E(v.map(q=>q.id===K?{...q,value:U}:q))},F=async K=>{K.preventDefault(),L(null);const U=v.map(q=>q.value.trim()).filter(q=>q.length>0);try{await S.mutateAsync({featureId:i.id,update:{category:x.trim(),name:g.trim(),description:C.trim(),steps:U,priority:parseInt(D,10)}}),u()}catch(q){L(q instanceof Error?q.message:"Failed to update feature")}},ee=x.trim()&&g.trim()&&C.trim(),Y=v.map(K=>K.value.trim()).filter(K=>K),se=x.trim()!==i.category||g.trim()!==i.name||C.trim()!==i.description||parseInt(D,10)!==i.priority||JSON.stringify(Y)!==JSON.stringify(i.steps);return a.jsx(aa,{open:!0,onOpenChange:K=>!K&&d(),children:a.jsxs(na,{className:"sm:max-w-2xl",children:[a.jsx(sa,{children:a.jsx(la,{children:"Edit Feature"})}),a.jsxs("form",{onSubmit:F,className:"space-y-4",children:[O&&a.jsxs(vt,{variant:"destructive",children:[a.jsx(za,{className:"h-4 w-4"}),a.jsxs(Nt,{className:"flex items-center justify-between",children:[a.jsx("span",{children:O}),a.jsx(Z,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>L(null),children:a.jsx(We,{size:14})})]})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(qe,{htmlFor:"category",children:"Category"}),a.jsx(dt,{id:"category",type:"text",value:x,onChange:K=>y(K.target.value),placeholder:"e.g., Authentication, UI, API",required:!0})]}),a.jsxs("div",{className:"w-32 space-y-2",children:[a.jsx(qe,{htmlFor:"priority",children:"Priority"}),a.jsx(dt,{id:"priority",type:"number",value:D,onChange:K=>H(K.target.value),min:"1",required:!0})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{htmlFor:"name",children:"Feature Name"}),a.jsx(dt,{id:"name",type:"text",value:g,onChange:K=>T(K.target.value),placeholder:"e.g., User login form",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{htmlFor:"description",children:"Description"}),a.jsx(Qi,{id:"description",value:C,onChange:K=>A(K.target.value),placeholder:"Describe what this feature should do...",className:"min-h-[100px] resize-y",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{children:"Test Steps"}),a.jsx("div",{className:"space-y-2",children:v.map((K,U)=>a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx("span",{className:"w-10 h-10 flex-shrink-0 flex items-center justify-center font-mono font-semibold text-sm border rounded-md bg-muted text-muted-foreground",children:U+1}),a.jsx(dt,{type:"text",value:K.value,onChange:q=>$(K.id,q.target.value),placeholder:"Describe this step...",className:"flex-1"}),v.length>1&&a.jsx(Z,{type:"button",variant:"ghost",size:"icon",onClick:()=>J(K.id),children:a.jsx(tn,{size:18})})]},K.id))}),a.jsxs(Z,{type:"button",variant:"ghost",size:"sm",onClick:X,children:[a.jsx(Pa,{size:16}),"Add Step"]})]}),a.jsxs(en,{className:"pt-4 border-t",children:[a.jsx(Z,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),a.jsx(Z,{type:"submit",disabled:!ee||!se||S.isPending,children:S.isPending?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(dp,{size:18}),"Save Changes"]})})]})]})]})})}function Yj(i){const c=["bg-pink-500","bg-cyan-500","bg-green-500","bg-yellow-500","bg-orange-500","bg-purple-500","bg-blue-500"];let d=0;for(let u=0;u<i.length;u++)d=i.charCodeAt(u)+((d<<5)-d);return c[Math.abs(d)%c.length]}function Vj({feature:i,projectName:c,onClose:d}){const[u,h]=m.useState(null),[x,y]=m.useState(!1),[g,T]=m.useState(!1),C=ab(c),A=tb(c),{data:D}=vh(c),H=new Map;D&&[...D.pending,...D.in_progress,...D.done].forEach(z=>{H.set(z.id,z)});const v=(i.dependencies||[]).map(z=>H.get(z)).filter(z=>z!==void 0),E=(i.blocking_dependencies||[]).map(z=>H.get(z)).filter(z=>z!==void 0),O=async()=>{h(null);try{await C.mutateAsync(i.id),d()}catch(z){h(z instanceof Error?z.message:"Failed to skip feature")}},L=async()=>{h(null);try{await A.mutateAsync(i.id),d()}catch(z){h(z instanceof Error?z.message:"Failed to delete feature")}};return g?a.jsx(Qj,{feature:i,projectName:c,onClose:()=>T(!1),onSaved:d}):a.jsx(aa,{open:!0,onOpenChange:z=>!z&&d(),children:a.jsxs(na,{className:"sm:max-w-2xl p-0 gap-0",children:[a.jsxs(sa,{className:"p-6 pb-4",children:[a.jsx("div",{className:"flex items-start gap-3",children:a.jsx(ie,{className:`${Yj(i.category)} text-white`,children:i.category})}),a.jsx(la,{className:"text-xl mt-2",children:i.name})]}),a.jsx(mo,{}),a.jsxs("div",{className:"p-6 space-y-6 max-h-[60vh] overflow-y-auto",children:[u&&a.jsxs(vt,{variant:"destructive",children:[a.jsx(za,{className:"h-4 w-4"}),a.jsxs(Nt,{className:"flex items-center justify-between",children:[a.jsx("span",{children:u}),a.jsx(Z,{variant:"ghost",size:"icon-xs",onClick:()=>h(null),children:a.jsx(We,{size:14})})]})]}),a.jsxs("div",{className:"flex items-center gap-3 p-4 bg-muted rounded-lg",children:[i.passes?a.jsxs(a.Fragment,{children:[a.jsx(ta,{size:24,className:"text-primary"}),a.jsx("span",{className:"font-semibold text-primary",children:"COMPLETE"})]}):a.jsxs(a.Fragment,{children:[a.jsx(us,{size:24,className:"text-muted-foreground"}),a.jsx("span",{className:"font-semibold text-muted-foreground",children:"PENDING"})]}),a.jsxs("span",{className:"ml-auto font-mono text-sm text-muted-foreground",children:["Priority: #",i.priority]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2 text-sm uppercase tracking-wide text-muted-foreground",children:"Description"}),a.jsx("p",{className:"text-foreground",children:i.description})]}),E.length>0&&a.jsxs(vt,{variant:"destructive",className:"border-orange-500 bg-orange-50 dark:bg-orange-950/20",children:[a.jsx(Aa,{className:"h-4 w-4 text-orange-600"}),a.jsxs(Nt,{children:[a.jsx("h4",{className:"font-semibold mb-1 text-orange-700 dark:text-orange-400",children:"Blocked By"}),a.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300 mb-2",children:"This feature cannot start until the following dependencies are complete:"}),a.jsx("ul",{className:"space-y-1",children:E.map(z=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-orange-600 dark:text-orange-300",children:[a.jsx(us,{size:14}),a.jsxs("span",{className:"font-mono text-xs",children:["#",z.id]}),a.jsx("span",{children:z.name})]},z.id))})]})]}),v.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-2 text-sm uppercase tracking-wide text-muted-foreground flex items-center gap-2",children:[a.jsx(fp,{size:16}),"Depends On"]}),a.jsx("ul",{className:"space-y-1",children:v.map(z=>a.jsxs("li",{className:"flex items-center gap-2 p-2 bg-muted rounded-md text-sm",children:[z.passes?a.jsx(ta,{size:16,className:"text-primary"}):a.jsx(us,{size:16,className:"text-muted-foreground"}),a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["#",z.id]}),a.jsx("span",{className:z.passes?"text-primary":"",children:z.name})]},z.id))})]}),i.steps.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2 text-sm uppercase tracking-wide text-muted-foreground",children:"Test Steps"}),a.jsx("ol",{className:"list-decimal list-inside space-y-2",children:i.steps.map((z,b)=>a.jsx("li",{className:"p-3 bg-muted rounded-md text-sm",children:z},b))})]})]}),!i.passes&&a.jsxs(a.Fragment,{children:[a.jsx(mo,{}),a.jsx(en,{className:"p-4 bg-muted/50",children:x?a.jsxs("div",{className:"w-full space-y-4",children:[a.jsx("p",{className:"font-medium text-center",children:"Are you sure you want to delete this feature?"}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Z,{variant:"destructive",onClick:L,disabled:A.isPending,className:"flex-1",children:A.isPending?a.jsx(Me,{size:18,className:"animate-spin"}):"Yes, Delete"}),a.jsx(Z,{variant:"outline",onClick:()=>y(!1),disabled:A.isPending,className:"flex-1",children:"Cancel"})]})]}):a.jsxs("div",{className:"flex gap-3 w-full",children:[a.jsxs(Z,{onClick:()=>T(!0),disabled:C.isPending,className:"flex-1",children:[a.jsx(mp,{size:18}),"Edit"]}),a.jsx(Z,{variant:"secondary",onClick:O,disabled:C.isPending,className:"flex-1",children:C.isPending?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(hp,{size:18}),"Skip"]})}),a.jsx(Z,{variant:"destructive",size:"icon",onClick:()=>y(!0),disabled:C.isPending,children:a.jsx(tn,{size:18})})]})})]})]})})}const Fj={background:"#09090b",foreground:"#fafafa",cursor:"#3b82f6",cursorAccent:"#09090b",selectionBackground:"rgba(59, 130, 246, 0.3)",selectionForeground:"#ffffff",black:"#09090b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#fafafa",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#ffffff"},Fm=1e3,Xm=3e4;function Xj({projectName:i,terminalId:c,isActive:d}){const u=m.useRef(null),h=m.useRef(null),x=m.useRef(null),y=m.useRef(null),g=m.useRef(null),T=m.useRef(0),C=m.useRef(!1),A=m.useRef(!1),D=m.useRef(!1),H=m.useRef(!1),v=m.useRef(null),E=m.useRef(null),O=m.useRef(null),L=m.useRef(d),[z,b]=m.useState(!1),[S,X]=m.useState(!1),[J,$]=m.useState(null);m.useEffect(()=>{D.current=S},[S]),m.useEffect(()=>{L.current=d},[d]);const F=m.useCallback(W=>{const j=new TextEncoder().encode(W);let M="";for(let I=0;I<j.length;I++)M+=String.fromCharCode(j[I]);return btoa(M)},[]),ee=m.useCallback(W=>{try{const le=atob(W),j=new Uint8Array(le.length);for(let I=0;I<le.length;I++)j[I]=le.charCodeAt(I);return new TextDecoder().decode(j)}catch{return console.error("Failed to decode base64 data"),""}},[]),Y=m.useCallback(W=>{y.current?.readyState===WebSocket.OPEN&&y.current.send(JSON.stringify(W))},[]),se=m.useCallback((W,le)=>{Y({type:"resize",cols:W,rows:le})},[Y]),K=m.useCallback(()=>{if(x.current&&h.current)try{const W=x.current.proposeDimensions();W&&W.cols&&W.rows&&!isNaN(W.cols)&&!isNaN(W.rows)&&W.cols>=1&&W.rows>=1&&x.current.fit();const{cols:j,rows:M}=h.current;j>0&&M>0&&se(j,M)}catch{}},[se]),U=m.useCallback(()=>{if(!i||!c||!L.current||A.current||y.current?.readyState===WebSocket.CONNECTING||y.current?.readyState===WebSocket.OPEN)return;A.current=!0,g.current&&(clearTimeout(g.current),g.current=null);const W=window.location.protocol==="https:"?"wss:":"ws:",le=window.location.host,j=`${W}//${le}/api/terminal/ws/${encodeURIComponent(i)}/${encodeURIComponent(c)}`;try{const M=new WebSocket(j);y.current=M,M.onopen=()=>{if(A.current=!1,b(!0),X(!1),$(null),T.current=0,h.current){const{cols:I,rows:P}=h.current;se(I,P)}},M.onmessage=I=>{try{const P=JSON.parse(I.data);switch(P.type){case"output":{const fe=ee(P.data);fe&&h.current&&h.current.write(fe);break}case"exit":{X(!0),$(P.code),h.current&&(h.current.writeln(""),h.current.writeln(`\x1B[33m[Shell exited with code ${P.code}]\x1B[0m`),h.current.writeln("\x1B[90mPress any key to reconnect...\x1B[0m"));break}}}catch{console.error("Failed to parse terminal WebSocket message")}},M.onclose=()=>{A.current=!1,b(!1),y.current=null;const I=L.current&&!D.current&&!H.current;if(H.current=!1,I){const P=Math.min(Fm*Math.pow(2,T.current),Xm);T.current++,g.current=window.setTimeout(()=>{U()},P)}},M.onerror=()=>{M.close()}}catch{A.current=!1;const M=Math.min(Fm*Math.pow(2,T.current),Xm);T.current++,g.current=window.setTimeout(()=>{U()},M)}},[i,c,se,ee]);m.useEffect(()=>{v.current=U},[U]);const q=m.useCallback(()=>{if(!u.current||C.current)return;const W=new iy({theme:Fj,fontFamily:"JetBrains Mono, Consolas, Monaco, monospace",fontSize:14,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),le=new ry;W.loadAddon(le),W.open(u.current),h.current=W,x.current=le,C.current=!0,W.onData(j=>{if(D.current){X(!1),$(null),v.current?.();return}const M={type:"input",data:F(j)};Y(M)}),W.onResize(({cols:j,rows:M})=>{se(j,M)})},[F,Y,se]);return m.useEffect(()=>{if(!d)return;const W=()=>{K()};return window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}},[d,K]),m.useEffect(()=>{if(!d){g.current&&(clearTimeout(g.current),g.current=null);return}C.current||q();let W,le;const j=()=>{W=requestAnimationFrame(()=>{le=requestAnimationFrame(()=>{(!y.current||y.current.readyState!==WebSocket.OPEN)&&v.current?.()})})},M=window.setTimeout(j,50);return()=>{clearTimeout(M),cancelAnimationFrame(W),cancelAnimationFrame(le)}},[d,q]),m.useEffect(()=>{if(d&&h.current){let W,le;const j=()=>{W=requestAnimationFrame(()=>{le=requestAnimationFrame(()=>{h.current&&x.current&&(K(),h.current.refresh(0,h.current.rows-1),h.current.focus())})})},M=window.setTimeout(j,16);return()=>{clearTimeout(M),cancelAnimationFrame(W),cancelAnimationFrame(le)}}},[d,K]),m.useEffect(()=>()=>{g.current&&clearTimeout(g.current),y.current&&y.current.close(),h.current&&h.current.dispose(),C.current=!1},[]),m.useEffect(()=>{if(d&&C.current){if(E.current===null&&O.current===null){E.current=i,O.current=c;return}if(E.current===i&&O.current===c)return;E.current=i,O.current=c,h.current&&(h.current.clear(),h.current.write("\x1B[H")),H.current=!0,y.current&&(y.current.close(),y.current=null),A.current=!1,X(!1),$(null),T.current=0,v.current?.()}},[i,c,d]),a.jsxs("div",{className:"relative h-full w-full bg-zinc-950",children:[a.jsxs("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-2",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${z?"bg-green-500":"bg-destructive"}`,title:z?"Connected":"Disconnected"}),!z&&!S&&a.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:"Connecting..."}),S&&J!==null&&a.jsxs("span",{className:"text-xs font-mono text-yellow-500",children:["Exit: ",J]})]}),a.jsx("div",{ref:u,className:"h-full w-full p-2",style:{minHeight:"100px"},onClick:()=>{h.current?.focus()}})]})}function Kj({terminals:i,activeTerminalId:c,onSelect:d,onCreate:u,onRename:h,onClose:x}){const[y,g]=m.useState(null),[T,C]=m.useState(""),[A,D]=m.useState({visible:!1,x:0,y:0,terminalId:null}),H=m.useRef(null),v=m.useRef(null);m.useEffect(()=>{y&&H.current&&(H.current.focus(),H.current.select())},[y]),m.useEffect(()=>{const F=ee=>{v.current&&!v.current.contains(ee.target)&&D(Y=>({...Y,visible:!1}))};if(A.visible)return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[A.visible]);const E=m.useCallback(F=>{g(F.id),C(F.name),D(ee=>({...ee,visible:!1}))},[]),O=m.useCallback(()=>{y&&T.trim()&&h(y,T.trim()),g(null),C("")},[y,T,h]),L=m.useCallback(()=>{g(null),C("")},[]),z=m.useCallback(F=>{ul(F,!1)?(F.preventDefault(),O()):F.key==="Escape"&&(F.preventDefault(),L())},[O,L]),b=m.useCallback(F=>{E(F)},[E]),S=m.useCallback((F,ee)=>{F.preventDefault(),D({visible:!0,x:F.clientX,y:F.clientY,terminalId:ee})},[]),X=m.useCallback(()=>{if(A.terminalId){const F=i.find(ee=>ee.id===A.terminalId);F&&E(F)}},[A.terminalId,i,E]),J=m.useCallback(()=>{A.terminalId&&x(A.terminalId),D(F=>({...F,visible:!1}))},[A.terminalId,x]),$=m.useCallback((F,ee)=>{F.stopPropagation(),x(ee)},[x]);return a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-zinc-900 border-b border-border overflow-x-auto",children:[i.map(F=>a.jsxs("div",{className:`
|
|
63
|
+
group flex items-center gap-1 px-3 py-1 rounded cursor-pointer
|
|
64
|
+
transition-colors duration-100 select-none min-w-0
|
|
65
|
+
${c===F.id?"bg-primary text-primary-foreground":"bg-zinc-800 text-zinc-300 hover:bg-zinc-700"}
|
|
66
|
+
`,onClick:()=>d(F.id),onDoubleClick:()=>b(F),onContextMenu:ee=>S(ee,F.id),children:[y===F.id?a.jsx(dt,{ref:H,type:"text",value:T,onChange:ee=>C(ee.target.value),onBlur:O,onKeyDown:z,className:"h-6 px-1 py-0 text-sm font-mono w-24",onClick:ee=>ee.stopPropagation()}):a.jsx("span",{className:"text-sm font-mono truncate max-w-[120px]",children:F.name}),i.length>1&&a.jsx("button",{onClick:ee=>$(ee,F.id),className:`
|
|
67
|
+
p-0.5 rounded opacity-0 group-hover:opacity-100 transition-opacity
|
|
68
|
+
${c===F.id?"hover:bg-black/20":"hover:bg-white/20"}
|
|
69
|
+
`,title:"Close terminal",children:a.jsx(We,{className:"w-3 h-3"})})]},F.id)),a.jsx(Z,{variant:"ghost",size:"icon",onClick:u,className:"h-8 w-8 bg-zinc-800 text-zinc-300 hover:bg-zinc-700",title:"New terminal",children:a.jsx(Pa,{className:"w-4 h-4"})}),A.visible&&a.jsxs("div",{ref:v,className:"fixed z-50 bg-popover border border-border rounded-md py-1 min-w-[120px] shadow-md",style:{left:A.x,top:A.y},children:[a.jsx("button",{onClick:X,className:"w-full px-3 py-1.5 text-left text-sm font-mono hover:bg-accent transition-colors",children:"Rename"}),i.length>1&&a.jsx("button",{onClick:J,className:"w-full px-3 py-1.5 text-left text-sm font-mono text-destructive hover:bg-destructive hover:text-destructive-foreground transition-colors",children:"Close"})]})]})}const Km=150,Zm=600,Zj=288,Jm="debug-panel-height",$m="debug-panel-tab";function Jj({logs:i,devLogs:c,isOpen:d,onToggle:u,onClear:h,onClearDevLogs:x,onHeightChange:y,projectName:g,activeTab:T,onTabChange:C}){const A=m.useRef(null),D=m.useRef(null),[H,v]=m.useState(!0),[E,O]=m.useState(!0),[L,z]=m.useState(!1),[b,S]=m.useState(()=>{const te=localStorage.getItem(Jm);return te?Math.min(Math.max(parseInt(te,10),Km),Zm):Zj}),[X,J]=m.useState(()=>localStorage.getItem($m)||"agent"),[$,F]=m.useState([]),[ee,Y]=m.useState(null),[se,K]=m.useState(!1),U=T??X,q=te=>{J(te),localStorage.setItem($m,te),C?.(te)},W=m.useCallback(async()=>{if(g){K(!0);try{const te=await qy(g);F(te),te.length>0&&(!ee||!te.find(de=>de.id===ee))&&Y(te[0].id)}catch(te){console.error("Failed to fetch terminals:",te)}finally{K(!1)}}},[g,ee]),le=m.useCallback(async()=>{if(g)try{const te=await Gy(g);F(de=>[...de,te]),Y(te.id)}catch(te){console.error("Failed to create terminal:",te)}},[g]),j=m.useCallback(async(te,de)=>{if(g)try{const Ue=await Qy(g,te,de);F(St=>St.map(Xt=>Xt.id===te?Ue:Xt))}catch(Ue){console.error("Failed to rename terminal:",Ue)}},[g]),M=m.useCallback(async te=>{if(!(!g||$.length<=1))try{if(await Yy(g,te),F(de=>de.filter(Ue=>Ue.id!==te)),ee===te){const de=$.filter(Ue=>Ue.id!==te);de.length>0&&Y(de[0].id)}}catch(de){console.error("Failed to close terminal:",de)}},[g,$,ee]);m.useEffect(()=>{g?W():(F([]),Y(null))},[g]),m.useEffect(()=>{H&&A.current&&d&&U==="agent"&&(A.current.scrollTop=A.current.scrollHeight)},[i,H,d,U]),m.useEffect(()=>{E&&D.current&&d&&U==="devserver"&&(D.current.scrollTop=D.current.scrollHeight)},[c,E,d,U]),m.useEffect(()=>{y&&d&&y(b)},[b,d,y]);const I=m.useCallback(te=>{const de=window.innerHeight-te.clientY,Ue=Math.min(Math.max(de,Km),Zm);S(Ue)},[]),P=m.useCallback(()=>{z(!1),localStorage.setItem(Jm,b.toString())},[b]);m.useEffect(()=>(L&&(document.addEventListener("mousemove",I),document.addEventListener("mouseup",P),document.body.style.cursor="ns-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",P),document.body.style.cursor="",document.body.style.userSelect=""}),[L,I,P]);const fe=te=>{te.preventDefault(),te.stopPropagation(),z(!0)},ue=te=>{const de=te.currentTarget,Ue=de.scrollHeight-de.scrollTop<=de.clientHeight+50;v(Ue)},Ce=te=>{const de=te.currentTarget,Ue=de.scrollHeight-de.scrollTop<=de.clientHeight+50;O(Ue)},ne=()=>{U==="agent"?h():U==="devserver"&&x()},Re=()=>U==="agent"?i.length:U==="devserver"?c.length:0,ot=()=>U==="agent"?!H:U==="devserver"?!E:!1,ft=te=>{const de=te.toLowerCase();return de.includes("error")||de.includes("exception")||de.includes("traceback")?"error":de.includes("warn")||de.includes("warning")?"warn":de.includes("debug")?"debug":"info"},ia=te=>{switch(te){case"error":return"text-red-500";case"warn":return"text-yellow-500";case"debug":return"text-blue-400";default:return"text-foreground"}},ra=te=>{try{return new Date(te).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}};return a.jsxs("div",{className:`fixed bottom-0 left-0 right-0 z-40 ${L?"":"transition-all duration-200"}`,style:{height:d?b:40},children:[d&&a.jsx("div",{className:"absolute top-0 left-0 right-0 h-2 cursor-ns-resize group flex items-center justify-center -translate-y-1/2 z-50",onMouseDown:fe,children:a.jsx("div",{className:"w-16 h-1.5 bg-border rounded-full group-hover:bg-muted-foreground transition-colors flex items-center justify-center",children:a.jsx(xp,{size:12,className:"text-muted-foreground group-hover:text-foreground"})})}),a.jsxs("div",{className:"flex items-center justify-between h-10 px-4 bg-muted border-t border-border",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:u,className:"flex items-center gap-2 hover:bg-accent px-2 py-1 rounded transition-colors cursor-pointer",children:[a.jsx(fo,{size:16,className:"text-green-500"}),a.jsx("span",{className:"font-mono text-sm text-foreground font-bold",children:"Debug"}),a.jsx(ie,{variant:"secondary",className:"text-xs font-mono",title:"Toggle debug panel",children:"D"})]}),d&&a.jsxs("div",{className:"flex items-center gap-1 ml-4",children:[a.jsxs(Z,{variant:U==="agent"?"secondary":"ghost",size:"sm",onClick:te=>{te.stopPropagation(),q("agent")},className:"h-7 text-xs font-mono gap-1.5",children:[a.jsx(gp,{size:12}),"Agent",i.length>0&&a.jsx(ie,{variant:"default",className:"h-4 px-1.5 text-[10px]",children:i.length})]}),a.jsxs(Z,{variant:U==="devserver"?"secondary":"ghost",size:"sm",onClick:te=>{te.stopPropagation(),q("devserver")},className:"h-7 text-xs font-mono gap-1.5",children:[a.jsx(pp,{size:12}),"Dev Server",c.length>0&&a.jsx(ie,{variant:"default",className:"h-4 px-1.5 text-[10px]",children:c.length})]}),a.jsxs(Z,{variant:U==="terminal"?"secondary":"ghost",size:"sm",onClick:te=>{te.stopPropagation(),q("terminal")},className:"h-7 text-xs font-mono gap-1.5",children:[a.jsx(fo,{size:12}),"Terminal",a.jsx(ie,{variant:"outline",className:"h-4 px-1.5 text-[10px]",title:"Toggle terminal",children:"T"})]})]}),d&&U!=="terminal"&&a.jsxs(a.Fragment,{children:[Re()>0&&a.jsx(ie,{variant:"secondary",className:"ml-2 font-mono",children:Re()}),ot()&&a.jsx(ie,{variant:"default",className:"bg-yellow-500 text-yellow-950",children:"Paused"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[d&&U!=="terminal"&&a.jsx(Z,{variant:"ghost",size:"icon",onClick:te=>{te.stopPropagation(),ne()},className:"h-7 w-7",title:"Clear logs",children:a.jsx(tn,{size:14,className:"text-muted-foreground"})}),a.jsx("div",{className:"p-1",children:d?a.jsx(ol,{size:16,className:"text-muted-foreground"}):a.jsx(Li,{size:16,className:"text-muted-foreground"})})]})]}),d&&a.jsxs("div",{className:"h-[calc(100%-2.5rem)] bg-card",children:[U==="agent"&&a.jsx("div",{ref:A,onScroll:ue,className:"h-full overflow-y-auto p-2 font-mono text-sm",children:i.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No logs yet. Start the agent to see output."}):a.jsx("div",{className:"space-y-0.5",children:i.map((te,de)=>{const Ue=ft(te.line),St=ia(Ue),Xt=ra(te.timestamp);return a.jsxs("div",{className:"flex gap-2 hover:bg-muted px-1 py-0.5 rounded",children:[a.jsx("span",{className:"text-muted-foreground select-none shrink-0",children:Xt}),a.jsx("span",{className:`${St} whitespace-pre-wrap break-all`,children:te.line})]},`${te.timestamp}-${de}`)})})}),U==="devserver"&&a.jsx("div",{ref:D,onScroll:Ce,className:"h-full overflow-y-auto p-2 font-mono text-sm",children:c.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No dev server logs yet."}):a.jsx("div",{className:"space-y-0.5",children:c.map((te,de)=>{const Ue=ft(te.line),St=ia(Ue),Xt=ra(te.timestamp);return a.jsxs("div",{className:"flex gap-2 hover:bg-muted px-1 py-0.5 rounded",children:[a.jsx("span",{className:"text-muted-foreground select-none shrink-0",children:Xt}),a.jsx("span",{className:`${St} whitespace-pre-wrap break-all`,children:te.line})]},`${te.timestamp}-${de}`)})})}),U==="terminal"&&a.jsxs("div",{className:"h-full flex flex-col",children:[$.length>0&&a.jsx(Kj,{terminals:$,activeTerminalId:ee,onSelect:Y,onCreate:le,onRename:j,onClose:M}),a.jsx("div",{className:"flex-1 min-h-0 relative",children:se?a.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground font-mono text-sm",children:"Loading terminals..."}):$.length===0?a.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground font-mono text-sm",children:"No terminal available"}):$.map(te=>{const de=te.id===ee;return a.jsx("div",{className:"absolute inset-0",style:{zIndex:de?10:1,transform:de?"none":"translateX(-200%)",pointerEvents:de?"auto":"none"},children:a.jsx(Xj,{projectName:g,terminalId:te.id,isActive:U==="terminal"&&de})},te.id)})})]})]})]})}function $j(i){switch(i){case"idle":return"Standing by...";case"thinking":return"Pondering...";case"working":return"Coding away...";case"testing":return"Checking work...";case"success":return"Nailed it!";case"error":return"Trying plan B...";case"struggling":return"Being persistent...";default:return"Busy..."}}function Wj(i){switch(i){case"success":return"text-primary";case"error":return"text-yellow-600";case"struggling":return"text-orange-500";case"working":case"testing":return"text-primary";case"thinking":return"text-yellow-600";default:return"text-muted-foreground"}}function zh(i){return i==="testing"?{label:"TEST",className:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300",icon:oh}:{label:"CODE",className:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300",icon:uh}}function Ij({agent:i,onShowLogs:c}){const d=["thinking","working","testing"].includes(i.state),u=i.logs&&i.logs.length>0,h=zh(i.agentType||"coding"),x=h.icon;return a.jsx(_e,{className:`min-w-[180px] max-w-[220px] py-3 ${d?"animate-pulse":""}`,children:a.jsxs(Ge,{className:"p-3 space-y-2",children:[a.jsx("div",{className:"flex justify-end",children:a.jsxs(ie,{variant:"outline",className:`text-[10px] ${h.className}`,children:[a.jsx(x,{size:10}),h.label]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xs,{name:i.agentName,state:i.state,size:"sm"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-semibold text-sm truncate",children:i.agentName}),a.jsx("div",{className:`text-xs ${Wj(i.state)}`,children:$j(i.state)})]}),u&&c&&a.jsx(Z,{variant:"ghost",size:"icon-xs",onClick:()=>c(i.agentIndex),title:`View logs (${i.logs?.length||0} entries)`,children:a.jsx(yp,{size:14,className:"text-muted-foreground"})})]}),a.jsx("div",{children:i.featureIds&&i.featureIds.length>1?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-xs text-muted-foreground mb-0.5",children:["Batch: ",i.featureIds.map(y=>`#${y}`).join(", ")]}),a.jsxs("div",{className:"text-sm font-bold truncate",children:["Active: Feature #",i.featureId]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-xs text-muted-foreground mb-0.5",children:["Feature #",i.featureId]}),a.jsx("div",{className:"text-sm font-medium truncate",title:i.featureName,children:i.featureName})]})}),i.thought&&a.jsx("div",{className:"pt-2 border-t border-border/50",children:a.jsxs("div",{className:"flex items-start gap-1.5",children:[a.jsx(yo,{size:14,className:"text-primary shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 italic",title:i.thought,children:i.thought})]})})]})})}function Pj({agent:i,logs:c,onClose:d}){const[u,h]=m.useState(!1),x=zh(i.agentType||"coding"),y=x.icon,g=async()=>{const C=c.map(A=>`[${A.timestamp}] ${A.line}`).join(`
|
|
70
|
+
`);await navigator.clipboard.writeText(C),h(!0),setTimeout(()=>h(!1),2e3)},T=C=>{switch(C){case"error":return"text-destructive";case"state_change":return"text-primary";default:return"text-foreground"}};return ph.createPortal(a.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4 bg-black/50",style:{zIndex:9999},onClick:C=>{C.target===C.currentTarget&&d()},children:a.jsxs(_e,{className:"w-full max-w-4xl max-h-[80vh] flex flex-col py-0",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(xs,{name:i.agentName,state:i.state,size:"sm"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("h2",{className:"font-semibold text-lg",children:[i.agentName," Logs"]}),a.jsxs(ie,{variant:"outline",className:`text-[10px] ${x.className}`,children:[a.jsx(y,{size:10}),x.label]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:i.featureIds&&i.featureIds.length>1?`Batch: ${i.featureIds.map(C=>`#${C}`).join(", ")}`:`Feature #${i.featureId}: ${i.featureName}`})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(Z,{variant:"outline",size:"sm",onClick:g,children:[u?a.jsx(ea,{size:14}):a.jsx(bp,{size:14}),u?"Copied!":"Copy"]}),a.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:d,children:a.jsx(We,{size:20})})]})]}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 bg-muted/50",children:a.jsx("div",{className:"font-mono text-xs space-y-1",children:c.length===0?a.jsx("p",{className:"text-muted-foreground italic",children:"No logs available"}):c.map((C,A)=>a.jsxs("div",{className:`${T(C.type)} whitespace-pre-wrap break-all`,children:[a.jsxs("span",{className:"text-muted-foreground",children:["[",new Date(C.timestamp).toLocaleTimeString(),"]"]})," ",C.line]},A))})}),a.jsxs("div",{className:"p-3 border-t text-xs text-muted-foreground",children:[c.length," log entries"]})]})}),document.body)}function e0(i){const c=new Date(i),u=new Date().getTime()-c.getTime(),h=Math.floor(u/1e3);return h<5?"just now":h<60?`${h}s ago`:h<3600?`${Math.floor(h/60)}m ago`:c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function t0({activities:i,maxItems:c=5,showHeader:d=!0}){const u=i.slice(0,c);return u.length===0?null:a.jsxs("div",{children:[d&&a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(dh,{size:14,className:"text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Recent Activity"})]}),a.jsx("div",{className:"space-y-2",children:u.map(h=>a.jsx(_e,{className:"py-1.5",children:a.jsxs(Ge,{className:"p-2 flex items-start gap-2",children:[a.jsx(xs,{name:h.agentName,state:"working",size:"sm"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-semibold",style:{color:a0(h.agentName)},children:h.agentName}),a.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["#",h.featureId]}),a.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:e0(h.timestamp)})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",title:h.thought,children:h.thought})]})]})},`${h.featureId}-${h.timestamp}-${h.thought.slice(0,20)}`))})]})}function a0(i){return{Spark:"#3B82F6",Fizz:"#F97316",Octo:"#8B5CF6",Hoot:"#22C55E",Buzz:"#EAB308",Pixel:"#EC4899",Byte:"#06B6D4",Nova:"#F43F5E",Chip:"#84CC16",Bolt:"#FBBF24",Dash:"#14B8A6",Zap:"#A855F7",Gizmo:"#64748B",Turbo:"#EF4444",Blip:"#10B981",Neon:"#D946EF",Widget:"#6366F1",Zippy:"#F59E0B",Quirk:"#0EA5E9",Flux:"#7C3AED"}[i]||"#6B7280"}const n0={sm:{svg:32,font:"text-xs"},md:{svg:48,font:"text-sm"},lg:{svg:64,font:"text-base"}},Pe={primary:"#7C3AED",secondary:"#A78BFA",accent:"#EDE9FE",baton:"#FBBF24",gold:"#F59E0B"};function s0({size:i,state:c}){const d=c==="spawning"?"animate-conducting":c==="scheduling"?"animate-baton-tap":"";return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 64 64",fill:"none",children:[a.jsx("rect",{x:"22",y:"54",width:"20",height:"6",rx:"2",fill:Pe.primary,opacity:"0.3"}),a.jsx("rect",{x:"18",y:"28",width:"28",height:"26",rx:"4",fill:Pe.primary}),a.jsx("rect",{x:"26",y:"32",width:"12",height:"18",fill:Pe.accent}),a.jsx("rect",{x:"30",y:"32",width:"4",height:"18",fill:Pe.secondary}),a.jsx("path",{d:"M27,30 L32,33 L37,30 L32,32 Z",fill:Pe.gold}),a.jsx("rect",{x:"16",y:"6",width:"32",height:"24",rx:"4",fill:Pe.secondary}),a.jsx("rect",{x:"14",y:"2",width:"36",height:"8",rx:"2",fill:Pe.primary}),a.jsx("rect",{x:"20",y:"0",width:"24",height:"4",rx:"2",fill:Pe.primary}),a.jsx("circle",{cx:"32",cy:"2",r:"3",fill:Pe.gold}),a.jsx("circle",{cx:"24",cy:"16",r:"4",fill:"white"}),a.jsx("circle",{cx:"40",cy:"16",r:"4",fill:"white"}),a.jsx("circle",{cx:"25",cy:"16",r:"2",fill:Pe.primary}),a.jsx("circle",{cx:"41",cy:"16",r:"2",fill:Pe.primary}),a.jsx("path",{d:"M26,24 Q32,28 38,24",stroke:"white",strokeWidth:"2",fill:"none",strokeLinecap:"round"}),a.jsx("rect",{x:"8",y:"32",width:"10",height:"4",rx:"2",fill:Pe.primary}),a.jsx("rect",{x:"46",y:"28",width:"10",height:"4",rx:"2",fill:Pe.primary,className:d,style:{transformOrigin:"46px 30px"}}),a.jsx("circle",{cx:"56",cy:"30",r:"4",fill:Pe.secondary,className:d,style:{transformOrigin:"46px 30px"}}),a.jsxs("g",{className:d,style:{transformOrigin:"56px 30px"},children:[a.jsx("line",{x1:"56",y1:"26",x2:"62",y2:"10",stroke:Pe.baton,strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"62",cy:"10",r:"2",fill:Pe.gold})]}),(c==="spawning"||c==="monitoring")&&a.jsxs(a.Fragment,{children:[a.jsx("text",{x:"4",y:"20",fontSize:"8",fill:Pe.secondary,className:"animate-pulse",children:"♪"}),a.jsx("text",{x:"58",y:"48",fontSize:"8",fill:Pe.secondary,className:"animate-pulse",style:{animationDelay:"0.3s"},children:"♫"})]})]})}function l0(i){switch(i){case"idle":return"animate-bounce-gentle";case"initializing":return"animate-thinking";case"scheduling":return"animate-thinking";case"spawning":return"animate-working";case"monitoring":return"animate-bounce-gentle";case"complete":return"animate-celebrate";default:return""}}function i0(i){switch(i){case"initializing":return"shadow-[0_0_12px_rgba(124,58,237,0.4)]";case"scheduling":return"shadow-[0_0_10px_rgba(167,139,250,0.5)]";case"spawning":return"shadow-[0_0_16px_rgba(124,58,237,0.6)]";case"monitoring":return"shadow-[0_0_8px_rgba(167,139,250,0.4)]";case"complete":return"shadow-[0_0_20px_rgba(112,224,0,0.6)]";default:return""}}function r0(i){switch(i){case"idle":return"waiting";case"initializing":return"initializing features";case"scheduling":return"selecting next features";case"spawning":return"spawning agents";case"monitoring":return"monitoring progress";case"complete":return"all features complete";default:return i}}function c0({state:i,size:c="md"}){const{svg:d}=n0[c],h=`Orchestrator Maestro is ${r0(i)}`;return a.jsx("div",{className:"flex flex-col items-center gap-1",role:"status","aria-label":h,"aria-live":"polite",children:a.jsx("div",{className:`
|
|
71
|
+
rounded-full p-1 transition-all duration-300
|
|
72
|
+
${l0(i)}
|
|
73
|
+
${i0(i)}
|
|
74
|
+
`,style:{backgroundColor:Pe.accent},title:h,role:"img","aria-hidden":"true",children:a.jsx(s0,{size:d,state:i})})})}function o0(i){switch(i){case"idle":return"Standing by...";case"initializing":return"Setting up features...";case"scheduling":return"Planning next moves...";case"spawning":return"Deploying agents...";case"monitoring":return"Watching progress...";case"complete":return"Mission accomplished!";default:return"Orchestrating..."}}function u0(i){switch(i){case"complete":return"text-primary";case"spawning":return"text-primary";case"scheduling":case"monitoring":return"text-primary";case"initializing":return"text-yellow-600 dark:text-yellow-400";default:return"text-muted-foreground"}}function d0(i){const c=new Date,d=new Date(i),u=c.getTime()-d.getTime(),h=Math.floor(u/1e3);if(h<5)return"just now";if(h<60)return`${h}s ago`;const x=Math.floor(h/60);return x<60?`${x}m ago`:`${Math.floor(x/60)}h ago`}function f0({status:i}){const[c,d]=m.useState(!1);return a.jsx(_e,{className:"mb-4 bg-primary/10 border-primary/30 py-4",children:a.jsxs(Ge,{className:"p-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx(c0,{state:i.state,size:"md"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-semibold text-lg text-primary",children:"Maestro"}),a.jsx("span",{className:`text-sm font-medium ${u0(i.state)}`,children:o0(i.state)})]}),a.jsx("p",{className:"text-sm text-foreground mb-3 line-clamp-2",children:i.message}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(ie,{variant:"outline",className:"bg-blue-100 text-blue-700 border-blue-300 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700",children:[a.jsx(uh,{size:12}),"Coding: ",i.codingAgents]}),a.jsxs(ie,{variant:"outline",className:"bg-purple-100 text-purple-700 border-purple-300 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700",children:[a.jsx(oh,{size:12}),"Testing: ",i.testingAgents]}),a.jsxs(ie,{variant:"outline",className:"bg-green-100 text-green-700 border-green-300 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",children:[a.jsx(Nn,{size:12}),"Ready: ",i.readyCount]}),i.blockedCount>0&&a.jsxs(ie,{variant:"outline",className:"bg-amber-100 text-amber-700 border-amber-300 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-700",children:[a.jsx(jp,{size:12}),"Blocked: ",i.blockedCount]})]})]}),i.recentEvents.length>0&&a.jsxs(Z,{variant:"ghost",size:"sm",onClick:()=>d(!c),className:"text-primary hover:bg-primary/10",children:[a.jsx(Sn,{size:12}),"Activity",c?a.jsx(Li,{size:14}):a.jsx(ol,{size:14})]})]}),c&&i.recentEvents.length>0&&a.jsx("div",{className:"mt-3 pt-3 border-t border-primary/20",children:a.jsx("div",{className:"space-y-1.5",children:i.recentEvents.map((u,h)=>a.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[a.jsx("span",{className:"text-primary shrink-0 font-mono",children:d0(u.timestamp)}),a.jsx("span",{className:"text-foreground",children:u.message})]},`${u.timestamp}-${h}`))})})]})})}const Wm="autoforge-activity-collapsed";function m0({agents:i,orchestratorStatus:c,recentActivity:d,isExpanded:u=!0,getAgentLogs:h}){const[x,y]=m.useState(u),[g,T]=m.useState(()=>{try{return localStorage.getItem(Wm)==="true"}catch{return!1}}),[C,A]=m.useState(null),D=()=>{const H=!g;T(H);try{localStorage.setItem(Wm,String(H))}catch{}};return!c&&i.length===0?null:a.jsxs(_e,{className:"mb-6 overflow-hidden py-0",children:[a.jsxs("button",{onClick:()=>y(!x),className:"w-full flex items-center justify-between px-4 py-3 bg-primary hover:bg-primary/90 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fh,{size:20,className:"text-primary-foreground"}),a.jsx("span",{className:"font-semibold text-primary-foreground uppercase tracking-wide",children:"Mission Control"}),a.jsx(ie,{variant:"secondary",className:"ml-2",children:i.length>0?`${i.length} ${i.length===1?"agent":"agents"} active`:c?.state==="initializing"?"Initializing":c?.state==="complete"?"Complete":"Orchestrating"})]}),x?a.jsx(Li,{size:20,className:"text-primary-foreground"}):a.jsx(ol,{size:20,className:"text-primary-foreground"})]}),a.jsx("div",{className:`
|
|
75
|
+
transition-all duration-300 ease-out
|
|
76
|
+
${x?"max-h-[600px] opacity-100 overflow-y-auto":"max-h-0 opacity-0 overflow-hidden"}
|
|
77
|
+
`,children:a.jsxs(Ge,{className:"p-4",children:[c&&a.jsx(f0,{status:c}),i.length>0&&a.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4",children:i.map(H=>a.jsx(Ij,{agent:H,onShowLogs:v=>{const E=i.find(O=>O.agentIndex===v);E&&A(E)}},`agent-${H.agentIndex}`))}),d.length>0&&a.jsxs("div",{className:"mt-4 pt-4 border-t",children:[a.jsxs(Z,{variant:"ghost",size:"sm",onClick:D,className:"gap-2 mb-2 h-auto p-1",children:[a.jsx(dh,{size:14,className:"text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Recent Activity"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",d.length,")"]}),g?a.jsx(ol,{size:14,className:"text-muted-foreground"}):a.jsx(Li,{size:14,className:"text-muted-foreground"})]}),a.jsx("div",{className:`
|
|
78
|
+
transition-all duration-200 ease-out overflow-hidden
|
|
79
|
+
${g?"max-h-0 opacity-0":"max-h-[300px] opacity-100"}
|
|
80
|
+
`,children:a.jsx(t0,{activities:d,maxItems:5,showHeader:!1})})]})]})}),C&&h&&a.jsx(Pj,{agent:C,logs:h(C.agentIndex),onClose:()=>A(null)})]})}function h0(i){return Array.from({length:i},(c,d)=>({id:d,x:Math.random()*100,delay:Math.random()*.5,duration:1+Math.random()*1,color:["#ff006e","#ffd60a","#70e000","#00b4d8","#8338ec"][Math.floor(Math.random()*5)],rotation:Math.random()*360}))}function x0({agentName:i,featureName:c,onComplete:d}){const[u,h]=m.useState(!0),[x]=m.useState(()=>h0(30)),y=m.useCallback(()=>{h(!1),setTimeout(()=>d?.(),300)},[d]);return m.useEffect(()=>{const g=setTimeout(y,3e3),T=C=>{C.key==="Escape"&&y()};return window.addEventListener("keydown",T),()=>{clearTimeout(g),window.removeEventListener("keydown",T)}},[y]),u?a.jsxs("div",{className:`
|
|
81
|
+
fixed inset-0 z-50 flex items-center justify-center
|
|
82
|
+
pointer-events-none
|
|
83
|
+
transition-opacity duration-300
|
|
84
|
+
${u?"opacity-100":"opacity-0"}
|
|
85
|
+
`,children:[a.jsx("div",{className:"absolute inset-0 overflow-hidden",children:x.map(g=>a.jsx("div",{className:"absolute w-3 h-3 animate-confetti",style:{left:`${g.x}%`,top:"-20px",backgroundColor:g.color,animationDelay:`${g.delay}s`,animationDuration:`${g.duration}s`,transform:`rotate(${g.rotation}deg)`}},g.id))}),a.jsx(_e,{onClick:y,className:"p-6 bg-green-500 border-green-600 animate-bounce-in pointer-events-auto cursor-pointer hover:scale-105 transition-transform focus:outline-none focus:ring-2 focus:ring-primary",role:"button",tabIndex:0,children:a.jsxs(Ge,{className:"p-0 flex flex-col items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Sn,{size:24,className:"text-yellow-300 animate-pulse"}),a.jsx(vp,{size:28,className:"text-white"}),a.jsx(Sn,{size:24,className:"text-yellow-300 animate-pulse"})]}),a.jsx(xs,{name:i,state:"success",size:"lg"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h3",{className:"font-display text-lg font-bold text-white mb-1",children:"Feature Complete!"}),a.jsx("p",{className:"text-sm text-white/80 max-w-[200px] truncate",children:c}),a.jsxs("p",{className:"text-xs text-white/60 mt-2",children:["Great job, ",i,"!"]})]}),a.jsx("p",{className:"text-xs text-white/40 mt-1",children:"Click or press Esc to dismiss"})]})})]}):null}function g0({onClick:i,isOpen:c}){return a.jsx(Z,{onClick:i,size:"icon",className:"fixed bottom-6 right-6 z-50 w-14 h-14 rounded-full shadow-lg hover:shadow-xl transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0.5",title:c?"Close Assistant (Press A)":"Open Assistant (Press A)","aria-label":c?"Close Assistant":"Open Assistant",children:c?a.jsx(We,{size:24}):a.jsx(yo,{size:24})})}function ki(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function p0({projectName:i,onError:c}){const[d,u]=m.useState([]),[h,x]=m.useState(!1),[y,g]=m.useState("disconnected"),[T,C]=m.useState(null),A=m.useRef(null),D=m.useRef(null),H=m.useRef(0),v=3,E=m.useRef(null),O=m.useRef(null),L=m.useRef(null);m.useEffect(()=>()=>{E.current&&clearInterval(E.current),O.current&&clearTimeout(O.current),L.current&&clearTimeout(L.current),A.current&&A.current.close(),D.current=null},[]);const z=m.useCallback(()=>{if(A.current?.readyState===WebSocket.OPEN||A.current?.readyState===WebSocket.CONNECTING)return;g("connecting");const $=window.location.protocol==="https:"?"wss:":"ws:",F=window.location.host,ee=`${$}//${F}/api/assistant/ws/${encodeURIComponent(i)}`,Y=new WebSocket(ee);A.current=Y,Y.onopen=()=>{g("connected"),H.current=0,E.current=window.setInterval(()=>{Y.readyState===WebSocket.OPEN&&Y.send(JSON.stringify({type:"ping"}))},3e4)},Y.onclose=()=>{if(g("disconnected"),E.current&&(clearInterval(E.current),E.current=null),H.current<v){H.current++;const se=Math.min(1e3*Math.pow(2,H.current),1e4);O.current=window.setTimeout(z,se)}},Y.onerror=()=>{g("error"),c?.("WebSocket connection error")},Y.onmessage=se=>{try{const K=JSON.parse(se.data);switch(K.type){case"text":{u(U=>{const q=U[U.length-1];return q?.role==="assistant"&&q.isStreaming?[...U.slice(0,-1),{...q,content:q.content+K.content}]:(D.current=ki(),[...U,{id:D.current,role:"assistant",content:K.content,timestamp:new Date,isStreaming:!0}])});break}case"tool_call":{let U=`Using tool: ${K.tool}`;if(K.tool==="mcp__features__feature_create"){const q=K.input;U=`Creating feature: "${q.name||"New Feature"}" in ${q.category||"General"}`}else if(K.tool==="mcp__features__feature_create_bulk"){const W=K.input.features?.length||0;U=`Creating ${W} feature${W!==1?"s":""}`}else if(K.tool==="mcp__features__feature_skip")U="Skipping feature (moving to end of queue)";else if(K.tool==="mcp__features__feature_get_stats")U="Checking project progress";else if(K.tool==="mcp__features__feature_get_next")U="Getting next pending feature";else if(K.tool==="Read"){const W=K.input.file_path||"";U=`Reading file: ${W.split("/").pop()||W}`}else K.tool==="Glob"?U=`Searching for files: ${K.input.pattern||"..."}`:K.tool==="Grep"&&(U=`Searching for: ${K.input.pattern||"..."}`);u(q=>[...q,{id:ki(),role:"system",content:U,timestamp:new Date}]);break}case"conversation_created":{C(K.conversation_id);break}case"response_done":{x(!1),D.current=null,u(U=>{const q=U[U.length-1];return q?.role==="assistant"&&q.isStreaming?[...U.slice(0,-1),{...q,isStreaming:!1}]:U});break}case"error":{x(!1),c?.(K.content),u(U=>[...U,{id:ki(),role:"system",content:`Error: ${K.content}`,timestamp:new Date}]);break}case"pong":break}}catch(K){console.error("Failed to parse WebSocket message:",K)}}},[i,c]),b=m.useCallback($=>{L.current&&(clearTimeout(L.current),L.current=null),z();const F=()=>{if(A.current?.readyState===WebSocket.OPEN){L.current=null,x(!0);const ee={type:"start"};$&&(ee.conversation_id=$,C($)),A.current.send(JSON.stringify(ee))}else A.current?.readyState===WebSocket.CONNECTING?L.current=window.setTimeout(F,100):L.current=null};L.current=window.setTimeout(F,100)},[z]),S=m.useCallback($=>{if(!A.current||A.current.readyState!==WebSocket.OPEN){c?.("Not connected");return}u(F=>[...F,{id:ki(),role:"user",content:$,timestamp:new Date}]),x(!0),A.current.send(JSON.stringify({type:"message",content:$}))},[c]),X=m.useCallback(()=>{H.current=v,E.current&&(clearInterval(E.current),E.current=null),A.current&&(A.current.close(),A.current=null),g("disconnected")},[]),J=m.useCallback(()=>{u([])},[]);return{messages:d,isLoading:h,connectionStatus:y,conversationId:T,start:b,sendMessage:S,disconnect:X,clearMessages:J}}function y0(i){return Rt({queryKey:["conversations",i],queryFn:()=>My(i),enabled:!!i,staleTime:3e4})}function b0(i,c){return Rt({queryKey:["conversation",i,c],queryFn:()=>_y(i,c),enabled:!!i&&!!c,staleTime:3e4,retry:(d,u)=>u instanceof Error&&(u.message.toLowerCase().includes("not found")||u.message==="HTTP 404")?!1:d<3})}function j0(i){const c=at();return ct({mutationFn:d=>Oy(i,d),onSuccess:(d,u)=>{c.invalidateQueries({queryKey:["conversations",i]}),c.removeQueries({queryKey:["conversation",i,u]})}})}function v0(i){if(!i)return"";const c=new Date(i),u=new Date().getTime()-c.getTime(),h=Math.floor(u/1e3),x=Math.floor(h/60),y=Math.floor(x/60),g=Math.floor(y/24);return h<60?"just now":x<60?`${x}m ago`:y<24?`${y}h ago`:g===1?"yesterday":g<7?`${g}d ago`:c.toLocaleDateString()}function N0({projectName:i,currentConversationId:c,isOpen:d,onClose:u,onSelectConversation:h}){const[x,y]=m.useState(null),[g,T]=m.useState(null),{data:C,isLoading:A}=y0(i),D=j0(i);m.useEffect(()=>{d||T(null)},[d]);const H=(L,z)=>{L.stopPropagation(),y(z)},v=async()=>{if(x)try{T(null),await D.mutateAsync(x.id),y(null)}catch{T("Failed to delete conversation. Please try again.")}},E=()=>{y(null),T(null)},O=L=>{h(L),u()};return m.useEffect(()=>{if(!d)return;const L=z=>{z.key==="Escape"&&(z.preventDefault(),u())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[d,u]),d?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-40",onClick:u}),a.jsxs(_e,{className:"absolute top-full left-0 mt-2 z-50 w-[320px] max-w-[calc(100vw-2rem)] shadow-lg",children:[a.jsx(Gi,{className:"p-3 border-b border-border",children:a.jsx("h3",{className:"font-bold text-sm",children:"Conversation History"})}),a.jsx(Ge,{className:"p-0",children:A?a.jsx("div",{className:"p-4 flex items-center justify-center",children:a.jsx(Me,{size:20,className:"animate-spin text-muted-foreground"})}):!C||C.length===0?a.jsx("div",{className:"p-4 text-center text-muted-foreground text-sm",children:"No conversations yet"}):a.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:C.map(L=>{const z=L.id===c;return a.jsxs("div",{className:`flex items-center group ${z?"bg-primary/10":"hover:bg-muted"}`,children:[a.jsx("button",{onClick:()=>O(L.id),className:"flex-1 px-3 py-2 text-left",disabled:z,children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(mh,{size:16,className:"mt-0.5 flex-shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium truncate text-foreground",children:L.title||"Untitled conversation"}),a.jsxs("div",{className:"text-xs flex items-center gap-2 text-muted-foreground",children:[a.jsxs("span",{children:[L.message_count," messages"]}),a.jsx("span",{children:"|"}),a.jsx("span",{children:v0(L.updated_at)})]})]})]})}),a.jsx(Z,{variant:"ghost",size:"icon",onClick:b=>H(b,L),className:`h-8 w-8 mr-2 ${z?"opacity-60 hover:opacity-100":"opacity-0 group-hover:opacity-100"} hover:text-destructive hover:bg-destructive/10`,title:"Delete conversation",children:a.jsx(tn,{size:14})})]},L.id)})})})]}),a.jsx(Ch,{isOpen:x!==null,title:"Delete Conversation",message:g?a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{children:`Are you sure you want to delete "${x?.title||"this conversation"}"? This action cannot be undone.`}),a.jsxs("div",{className:"flex items-center gap-2 p-2 bg-destructive/10 border border-destructive rounded text-sm text-destructive",children:[a.jsx(za,{size:16,className:"flex-shrink-0"}),a.jsx("span",{children:g})]})]}):`Are you sure you want to delete "${x?.title||"this conversation"}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",variant:"danger",isLoading:D.isPending,onConfirm:v,onCancel:E})]}):null}function S0({projectName:i,conversationId:c,initialMessages:d,isLoadingConversation:u,onNewChat:h,onSelectConversation:x,onConversationCreated:y}){const[g,T]=m.useState(""),[C,A]=m.useState(!1),D=m.useRef(null),H=m.useRef(null),v=m.useRef(!1),E=m.useRef(void 0),O=m.useCallback(q=>{console.error("Assistant error:",q)},[]),{messages:L,isLoading:z,connectionStatus:b,conversationId:S,start:X,sendMessage:J,clearMessages:$}=p0({projectName:i,onError:O}),F=m.useRef(S);m.useEffect(()=>{F.current===null&&S!==null&&y&&y(S),F.current=S},[S,y]),m.useEffect(()=>{D.current?.scrollIntoView({behavior:"smooth"})},[L]),m.useEffect(()=>{if(u||E.current===c&&v.current)return;const q=E.current!==void 0&&E.current!==c;E.current=c,v.current=!0,q&&$(),X(c)},[c,u,X,$]);const ee=m.useCallback(()=>{$(),h?.()},[$,h]),Y=m.useCallback(q=>{A(!1),x?.(q)},[x]);m.useEffect(()=>{z||H.current?.focus()},[z]);const se=()=>{const q=g.trim();!q||z||u||(J(q),T(""))},K=q=>{ul(q)&&(q.preventDefault(),se())},U=m.useMemo(()=>{if(!(E.current===c&&!u))return d??[];if(!d||d.length===0)return L;const W=new Map;for(const le of d)W.set(le.id,le);for(const le of L)W.set(le.id,le);return Array.from(W.values())},[d,L,c,u]);return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-background",children:[a.jsxs("div",{className:"flex items-center gap-1 relative",children:[a.jsx(Z,{variant:"ghost",size:"icon",onClick:ee,className:"h-8 w-8",title:"New conversation",disabled:z,children:a.jsx(Pa,{size:16})}),a.jsx(Z,{variant:C?"secondary":"ghost",size:"icon",onClick:()=>A(!C),className:"h-8 w-8",title:"Conversation history",children:a.jsx(Np,{size:16})}),a.jsx(N0,{projectName:i,currentConversationId:c??S,isOpen:C,onClose:()=>A(!1),onSelectConversation:Y})]}),a.jsx("div",{className:"flex items-center gap-2",children:b==="connected"?a.jsxs(a.Fragment,{children:[a.jsx(ms,{size:14,className:"text-green-500"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}):b==="connecting"?a.jsxs(a.Fragment,{children:[a.jsx(Me,{size:14,className:"text-primary animate-spin"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Connecting..."})]}):a.jsxs(a.Fragment,{children:[a.jsx(fs,{size:14,className:"text-destructive"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Disconnected"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:u?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Me,{size:16,className:"animate-spin"}),a.jsx("span",{children:"Loading conversation..."})]})}):U.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:z?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Me,{size:16,className:"animate-spin"}),a.jsx("span",{children:"Connecting to assistant..."})]}):a.jsx("span",{children:"Ask me anything about the codebase"})}):a.jsxs("div",{className:"py-4",children:[U.map(q=>a.jsx(Co,{message:q},q.id)),a.jsx("div",{ref:D})]})}),z&&U.length>0&&a.jsx("div",{className:"px-4 py-2 border-t border-border bg-background",children:a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("span",{className:"w-2 h-2 bg-primary rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),a.jsx("span",{children:"Thinking..."})]})}),a.jsxs("div",{className:"border-t border-border p-4 bg-card",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Qi,{ref:H,value:g,onChange:q=>T(q.target.value),onKeyDown:K,placeholder:"Ask about the codebase...",disabled:z||u||b!=="connected",className:"flex-1 resize-none min-h-[44px] max-h-[120px]",rows:1}),a.jsx(Z,{onClick:se,disabled:!g.trim()||z||u||b!=="connected",title:"Send message",children:z?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsx(go,{size:18})})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Press Enter to send, Shift+Enter for new line"})]})]})}const Ah="assistant-conversation-";function Im(i){try{const c=localStorage.getItem(`${Ah}${i}`);if(c)return JSON.parse(c).conversationId||null}catch{}return null}function w0(i,c){const d=`${Ah}${i}`;c?localStorage.setItem(d,JSON.stringify({conversationId:c})):localStorage.removeItem(d)}function C0({projectName:i,isOpen:c,onClose:d}){const[u,h]=m.useState(()=>Im(i)),{data:x,isLoading:y,error:g}=b0(i,u);m.useEffect(()=>{if(g&&u){const H=g.message.toLowerCase();(H.includes("not found")||H.includes("404"))&&(console.warn(`Conversation ${u} not found, clearing stored ID`),h(null))}},[g,u]);const T=x?.messages.map(H=>({id:`db-${H.id}`,role:H.role,content:H.content,timestamp:H.timestamp?new Date(H.timestamp):new Date}));m.useEffect(()=>{w0(i,u)},[i,u]),m.useEffect(()=>{h(Im(i))},[i]);const C=m.useCallback(()=>{h(null)},[]),A=m.useCallback(H=>{h(H)},[]),D=m.useCallback(H=>{h(H)},[]);return a.jsxs(a.Fragment,{children:[c&&a.jsx("div",{className:"fixed inset-0 bg-black/20 z-40 transition-opacity duration-300",onClick:d,"aria-hidden":"true"}),a.jsxs("div",{className:`
|
|
86
|
+
fixed right-0 top-0 bottom-0 z-50
|
|
87
|
+
w-[400px] max-w-[90vw]
|
|
88
|
+
bg-card
|
|
89
|
+
border-l border-border
|
|
90
|
+
transform transition-transform duration-300 ease-out
|
|
91
|
+
flex flex-col shadow-xl
|
|
92
|
+
${c?"translate-x-0":"translate-x-full"}
|
|
93
|
+
`,role:"dialog","aria-label":"Project Assistant","aria-hidden":!c,children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-primary text-primary-foreground",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"bg-card text-foreground border border-border p-1.5 rounded",children:a.jsx(qi,{size:18})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold",children:"Project Assistant"}),a.jsx("p",{className:"text-xs opacity-80 font-mono",children:i})]})]}),a.jsx(Z,{variant:"ghost",size:"icon",onClick:d,className:"text-primary-foreground hover:bg-primary-foreground/20",title:"Close Assistant (Press A)","aria-label":"Close Assistant",children:a.jsx(We,{size:18})})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:c&&a.jsx(S0,{projectName:i,conversationId:u,initialMessages:T,isLoadingConversation:y,onNewChat:C,onSelectConversation:A,onConversationCreated:D})})]})]})}function Mi(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function z0({projectName:i,onComplete:c,onError:d}){const[u,h]=m.useState([]),[x,y]=m.useState(!1),[g,T]=m.useState(!1),[C,A]=m.useState("disconnected"),[D,H]=m.useState(0),[v,E]=m.useState([]),O=m.useRef(null),L=m.useRef(null),z=m.useRef(0),b=3,S=m.useRef(null),X=m.useRef(null),J=m.useRef(!1),$=m.useRef(!1);m.useEffect(()=>{J.current=g},[g]),m.useEffect(()=>()=>{S.current&&clearInterval(S.current),X.current&&clearTimeout(X.current),O.current&&O.current.close()},[]);const F=m.useCallback(()=>{if($.current||O.current?.readyState===WebSocket.OPEN)return;A("connecting");const K=window.location.protocol==="https:"?"wss:":"ws:",U=window.location.host,q=`${K}//${U}/api/expand/ws/${encodeURIComponent(i)}`,W=new WebSocket(q);O.current=W,W.onopen=()=>{A("connected"),z.current=0,$.current=!1,S.current=window.setInterval(()=>{W.readyState===WebSocket.OPEN&&W.send(JSON.stringify({type:"ping"}))},3e4)},W.onclose=()=>{if(A("disconnected"),S.current&&(clearInterval(S.current),S.current=null),!$.current&&z.current<b&&!J.current){z.current++;const le=Math.min(1e3*Math.pow(2,z.current),1e4);X.current=window.setTimeout(F,le)}},W.onerror=()=>{A("error"),d?.("WebSocket connection error")},W.onmessage=le=>{try{const j=JSON.parse(le.data);switch(j.type){case"text":{h(M=>{const I=M[M.length-1];return I?.role==="assistant"&&I.isStreaming?[...M.slice(0,-1),{...I,content:I.content+j.content}]:(L.current=Mi(),[...M,{id:L.current,role:"assistant",content:j.content,timestamp:new Date,isStreaming:!0}])});break}case"features_created":{H(M=>M+j.count),E(j.features),h(M=>[...M,{id:Mi(),role:"system",content:`Created ${j.count} new feature${j.count!==1?"s":""}!`,timestamp:new Date}]);break}case"expansion_complete":{T(!0),y(!1),h(M=>{const I=M[M.length-1];return I?.role==="assistant"&&I.isStreaming?[...M.slice(0,-1),{...I,isStreaming:!1}]:M}),c?.(j.total_added);break}case"error":{y(!1),d?.(j.content),h(M=>[...M,{id:Mi(),role:"system",content:`Error: ${j.content}`,timestamp:new Date}]);break}case"pong":break;case"response_done":{y(!1),h(M=>{const I=M[M.length-1];return I?.role==="assistant"&&I.isStreaming?[...M.slice(0,-1),{...I,isStreaming:!1}]:M});break}}}catch(j){console.error("Failed to parse WebSocket message:",j)}}},[i,c,d]),ee=m.useCallback(()=>{F();let K=0;const U=50,q=()=>{O.current?.readyState===WebSocket.OPEN?(y(!0),O.current.send(JSON.stringify({type:"start"}))):O.current?.readyState===WebSocket.CONNECTING&&(K++<U?setTimeout(q,100):(d?.("Connection timeout"),y(!1)))};setTimeout(q,100)},[F,d]),Y=m.useCallback((K,U)=>{if(!O.current||O.current.readyState!==WebSocket.OPEN){d?.("Not connected");return}h(W=>[...W,{id:Mi(),role:"user",content:K,attachments:U,timestamp:new Date}]),y(!0);const q={type:"message",content:K};U&&U.length>0&&(q.attachments=U.map(W=>({filename:W.filename,mimeType:W.mimeType,base64Data:W.base64Data}))),O.current.send(JSON.stringify(q))},[d]),se=m.useCallback(()=>{$.current=!0,z.current=b,S.current&&(clearInterval(S.current),S.current=null),X.current&&(clearTimeout(X.current),X.current=null),O.current&&(O.current.close(),O.current=null),A("disconnected")},[]);return{messages:u,isLoading:x,isComplete:g,connectionStatus:C,featuresCreated:D,recentFeatures:v,start:ee,sendMessage:Y,disconnect:se}}const A0=5*1024*1024,T0=["image/jpeg","image/png"];function E0({projectName:i,onComplete:c,onCancel:d}){const[u,h]=m.useState(""),[x,y]=m.useState(null),[g,T]=m.useState([]),C=m.useRef(null),A=m.useRef(null),D=m.useRef(null),H=m.useCallback(U=>y(U),[]),{messages:v,isLoading:E,isComplete:O,connectionStatus:L,featuresCreated:z,start:b,sendMessage:S,disconnect:X}=z0({projectName:i,onComplete:c,onError:H});m.useEffect(()=>(b(),()=>{X()}),[]),m.useEffect(()=>{C.current?.scrollIntoView({behavior:"smooth"})},[v,E]),m.useEffect(()=>{!E&&A.current&&A.current.focus()},[E]);const J=()=>{const U=u.trim();!U&&g.length===0||E||(S(U,g.length>0?g:void 0),h(""),T([]))},$=U=>{ul(U)&&(U.preventDefault(),J())},F=m.useCallback(U=>{U&&Array.from(U).forEach(q=>{if(!T0.includes(q.type)){y(`Invalid file type: ${q.name}. Only JPEG and PNG are supported.`);return}if(q.size>A0){y(`File too large: ${q.name}. Maximum size is 5 MB.`);return}const W=new FileReader;W.onload=le=>{const j=le.target?.result,M=j.split(",")[1],I={id:`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,filename:q.name,mimeType:q.type,base64Data:M,previewUrl:j,size:q.size};T(P=>[...P,I])},W.onerror=()=>{y(`Failed to read file: ${q.name}`)},W.readAsDataURL(q)})},[]),ee=m.useCallback(U=>{T(q=>q.filter(W=>W.id!==U))},[]),Y=m.useCallback(U=>{U.preventDefault(),F(U.dataTransfer.files)},[F]),se=m.useCallback(U=>{U.preventDefault()},[]),K=()=>{switch(L){case"connected":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-500",children:[a.jsx(ms,{size:12}),"Connected"]});case"connecting":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-yellow-500",children:[a.jsx(ms,{size:12,className:"animate-pulse"}),"Connecting..."]});case"error":return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-destructive",children:[a.jsx(fs,{size:12}),"Error"]});default:return a.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(fs,{size:12}),"Disconnected"]})}};return a.jsxs("div",{className:"flex flex-col h-full bg-background",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b-2 border-border bg-card",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("h2",{className:"font-display font-bold text-lg text-foreground",children:["Expand Project: ",i]}),a.jsx(K,{}),z>0&&a.jsxs("span",{className:"flex items-center gap-1 text-sm text-green-500 font-bold",children:[a.jsx(Pa,{size:14}),z," added"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[O&&a.jsxs("span",{className:"flex items-center gap-1 text-sm text-green-500 font-bold",children:[a.jsx(ta,{size:16}),"Complete"]}),a.jsx(Z,{onClick:d,variant:"ghost",size:"icon",title:"Close",children:a.jsx(We,{size:20})})]})]}),x&&a.jsxs(vt,{variant:"destructive",className:"rounded-none border-x-0 border-t-0",children:[a.jsx(za,{size:16}),a.jsx(Nt,{className:"flex-1",children:x}),a.jsx(Z,{onClick:()=>y(null),variant:"ghost",size:"icon",className:"h-6 w-6",children:a.jsx(We,{size:14})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto py-4",children:[v.length===0&&!E&&a.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:a.jsx(_e,{className:"p-6 max-w-md",children:a.jsxs(Ge,{className:"p-0",children:[a.jsx("h3",{className:"font-display font-bold text-lg mb-2",children:"Starting Project Expansion"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting to Claude to help you add new features to your project..."}),L==="error"&&a.jsxs(Z,{onClick:b,className:"mt-4",size:"sm",children:[a.jsx(ds,{size:14}),"Retry Connection"]})]})})}),v.map(U=>a.jsx(Co,{message:U},U.id)),E&&a.jsx(Sh,{}),a.jsx("div",{ref:C})]}),!O&&a.jsxs("div",{className:"p-4 border-t-2 border-border bg-card",onDrop:Y,onDragOver:se,children:[g.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:g.map(U=>a.jsxs("div",{className:"relative group border-2 border-border p-1 bg-card rounded shadow-sm",children:[a.jsx("img",{src:U.previewUrl,alt:U.filename,className:"w-16 h-16 object-cover rounded"}),a.jsx("button",{onClick:()=>ee(U.id),className:"absolute -top-2 -right-2 bg-destructive text-destructive-foreground rounded-full p-0.5 border-2 border-border hover:scale-110 transition-transform",title:"Remove attachment",children:a.jsx(We,{size:12})}),a.jsx("span",{className:"text-xs truncate block max-w-16 mt-1 text-center text-muted-foreground",children:U.filename.length>10?`${U.filename.substring(0,7)}...`:U.filename})]},U.id))}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("input",{ref:D,type:"file",accept:"image/jpeg,image/png",multiple:!0,onChange:U=>F(U.target.files),className:"hidden"}),a.jsx(Z,{onClick:()=>D.current?.click(),disabled:L!=="connected",variant:"ghost",size:"icon",title:"Attach image (JPEG, PNG - max 5MB)",children:a.jsx(Ri,{size:18})}),a.jsx(dt,{ref:A,type:"text",value:u,onChange:U=>h(U.target.value),onKeyDown:$,placeholder:g.length>0?"Add a message with your image(s)...":"Describe the features you want to add...",className:"flex-1",disabled:E||L!=="connected"}),a.jsx(Z,{onClick:J,disabled:!u.trim()&&g.length===0||E||L!=="connected",className:"px-6",children:a.jsx(go,{size:18})})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Press Enter to send. Drag & drop or click ",a.jsx(Ri,{size:12,className:"inline"})," to attach images."]})]}),O&&a.jsx("div",{className:"p-4 border-t-2 border-border bg-green-500 text-white",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ta,{size:20}),a.jsxs("span",{className:"font-bold",children:["Added ",z," new feature",z!==1?"s":"","!"]})]}),a.jsx(Z,{onClick:()=>c(z),variant:"secondary",children:"Close"})]})})]})}function D0({isOpen:i,projectName:c,onClose:d,onFeaturesAdded:u}){if(!i)return null;const h=x=>{x>0&&u(),d()};return a.jsx("div",{className:"fixed inset-0 z-50 bg-background",children:a.jsx(E0,{projectName:c,onComplete:h,onCancel:d})})}function Pm({className:i,size:c="default",...d}){return a.jsx(sy,{"data-slot":"switch","data-size":c,className:Oe("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",i),...d,children:a.jsx(ly,{"data-slot":"switch-thumb",className:Oe("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function k0({isOpen:i,onClose:c}){const{data:d,isLoading:u,isError:h,refetch:x}=No(),{data:y}=ub(),g=db(),{theme:T,setTheme:C,darkMode:A,toggleDarkMode:D}=So(),H=()=>{d&&!g.isPending&&g.mutate({yolo_mode:!d.yolo_mode})},v=b=>{g.isPending||g.mutate({model:b})},E=b=>{g.isPending||g.mutate({testing_agent_ratio:b})},O=b=>{g.isPending||g.mutate({batch_size:b})},L=y?.models??[],z=g.isPending;return a.jsx(aa,{open:i,onOpenChange:b=>!b&&c(),children:a.jsxs(na,{className:"sm:max-w-sm",children:[a.jsx(sa,{children:a.jsxs(la,{className:"flex items-center gap-2",children:["Settings",z&&a.jsx(Me,{className:"animate-spin",size:16})]})}),u&&a.jsxs("div",{className:"flex items-center justify-center py-8",children:[a.jsx(Me,{className:"animate-spin",size:24}),a.jsx("span",{className:"ml-2",children:"Loading settings..."})]}),h&&a.jsxs(vt,{variant:"destructive",children:[a.jsx(za,{className:"h-4 w-4"}),a.jsxs(Nt,{children:["Failed to load settings",a.jsx(Z,{variant:"link",onClick:()=>x(),className:"ml-2 p-0 h-auto",children:"Retry"})]})]}),d&&!u&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(qe,{className:"font-medium",children:"Theme"}),a.jsx("div",{className:"grid gap-2",children:Oi.map(b=>a.jsxs("button",{onClick:()=>C(b.id),className:`flex items-center gap-3 p-3 rounded-lg border-2 transition-colors text-left ${T===b.id?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/50"}`,children:[a.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[a.jsx("div",{className:"w-5 h-5 rounded-sm border border-border/50",style:{backgroundColor:b.previewColors.background}}),a.jsx("div",{className:"w-5 h-5 rounded-sm border border-border/50",style:{backgroundColor:b.previewColors.primary}}),a.jsx("div",{className:"w-5 h-5 rounded-sm border border-border/50",style:{backgroundColor:b.previewColors.accent}})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm",children:b.name}),a.jsx("div",{className:"text-xs text-muted-foreground",children:b.description})]}),T===b.id&&a.jsx(ea,{size:18,className:"text-primary shrink-0"})]},b.id))})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(qe,{htmlFor:"dark-mode",className:"font-medium",children:"Dark Mode"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Switch between light and dark appearance"})]}),a.jsxs(Z,{id:"dark-mode",variant:"outline",size:"sm",onClick:D,className:"gap-2",children:[A?a.jsx(bo,{size:16}):a.jsx(jo,{size:16}),A?"Light":"Dark"]})]}),a.jsx("hr",{className:"border-border"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(qe,{htmlFor:"yolo-mode",className:"font-medium",children:"YOLO Mode"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Skip testing for rapid prototyping"})]}),a.jsx(Pm,{id:"yolo-mode",checked:d.yolo_mode,onCheckedChange:H,disabled:z})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(qe,{htmlFor:"playwright-headless",className:"font-medium",children:"Headless Browser"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Run browser without visible window (saves CPU)"})]}),a.jsx(Pm,{id:"playwright-headless",checked:d.playwright_headless,onCheckedChange:()=>g.mutate({playwright_headless:!d.playwright_headless}),disabled:z})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{className:"font-medium",children:"Model"}),a.jsx("div",{className:"flex rounded-lg border overflow-hidden",children:L.map(b=>a.jsx("button",{onClick:()=>v(b.id),disabled:z,className:`flex-1 py-2 px-3 text-sm font-medium transition-colors ${d.model===b.id?"bg-primary text-primary-foreground":"bg-background text-foreground hover:bg-muted"} ${z?"opacity-50 cursor-not-allowed":""}`,children:b.name},b.id))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{className:"font-medium",children:"Regression Agents"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Number of regression testing agents (0 = disabled)"}),a.jsx("div",{className:"flex rounded-lg border overflow-hidden",children:[0,1,2,3].map(b=>a.jsx("button",{onClick:()=>E(b),disabled:z,className:`flex-1 py-2 px-3 text-sm font-medium transition-colors ${d.testing_agent_ratio===b?"bg-primary text-primary-foreground":"bg-background text-foreground hover:bg-muted"} ${z?"opacity-50 cursor-not-allowed":""}`,children:b},b))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(qe,{className:"font-medium",children:"Features per Agent"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Number of features assigned to each coding agent"}),a.jsx("div",{className:"flex rounded-lg border overflow-hidden",children:[1,2,3].map(b=>a.jsx("button",{onClick:()=>O(b),disabled:z,className:`flex-1 py-2 px-3 text-sm font-medium transition-colors ${(d.batch_size??1)===b?"bg-primary text-primary-foreground":"bg-background text-foreground hover:bg-muted"} ${z?"opacity-50 cursor-not-allowed":""}`,children:b},b))})]}),g.isError&&a.jsx(vt,{variant:"destructive",children:a.jsx(Nt,{children:"Failed to save settings. Please try again."})})]})]})})}function M0(i){const c=at();return ct({mutationFn:()=>By(i),onSuccess:()=>{c.invalidateQueries({queryKey:["dev-server-status",i]})}})}function _0(i){const c=at();return ct({mutationFn:()=>Hy(i),onSuccess:()=>{c.invalidateQueries({queryKey:["dev-server-status",i]})}})}function O0({projectName:i,status:c,url:d}){const u=M0(i),h=_0(i),x=u.isPending||h.isPending,y=()=>{h.reset(),u.mutate()},g=()=>{u.reset(),h.mutate()},T=c==="stopped"||c==="crashed",C=c==="running",A=c==="crashed";return a.jsxs("div",{className:"flex items-center gap-2",children:[T?a.jsx(Z,{onClick:y,disabled:x,variant:A?"destructive":"outline",size:"sm",title:A?"Dev Server Crashed - Click to Restart":"Start Dev Server","aria-label":A?"Restart Dev Server (crashed)":"Start Dev Server",children:x?a.jsx(Me,{size:18,className:"animate-spin"}):A?a.jsx(Aa,{size:18}):a.jsx(Sp,{size:18})}):a.jsx(Z,{onClick:g,disabled:x,size:"sm",className:"bg-primary text-primary-foreground hover:bg-primary/90",title:"Stop Dev Server","aria-label":"Stop Dev Server",children:x?a.jsx(Me,{size:18,className:"animate-spin"}):a.jsx(ch,{size:18})}),C&&d&&a.jsx(Z,{asChild:!0,size:"sm",className:"bg-primary text-primary-foreground hover:bg-primary/90 gap-1",children:a.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",title:`Open ${d} in new tab`,children:[a.jsx("span",{className:"font-mono text-xs",children:d}),a.jsx(xo,{size:14})]})}),(u.error||h.error)&&a.jsx("span",{className:"text-xs font-mono text-destructive ml-2",children:String((u.error||h.error)?.message||"Operation failed")})]})}function R0({viewMode:i,onViewModeChange:c}){return a.jsxs("div",{className:"inline-flex rounded-lg border p-1 bg-background",children:[a.jsxs(Z,{variant:i==="kanban"?"default":"ghost",size:"sm",onClick:()=>c("kanban"),title:"Kanban View",children:[a.jsx(hh,{size:16}),"Kanban"]}),a.jsxs(Z,{variant:i==="graph"?"default":"ghost",size:"sm",onClick:()=>c("graph"),title:"Dependency Graph View",children:[a.jsx(hs,{size:16}),"Graph"]})]})}var U0=_p();const eh=tp(U0),Hi=220,th=80;class L0 extends m.Component{constructor(c){super(c),this.state={hasError:!1,error:null}}static getDerivedStateFromError(c){return{hasError:!0,error:c}}componentDidCatch(c,d){console.error("DependencyGraph error:",c,d)}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset?.()};render(){return this.state.hasError?a.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted",children:a.jsxs("div",{className:"text-center p-6",children:[a.jsx(Aa,{size:48,className:"mx-auto mb-4 text-yellow-500"}),a.jsx("div",{className:"text-foreground font-bold mb-2",children:"Graph rendering error"}),a.jsx("div",{className:"text-sm text-muted-foreground mb-4",children:"The dependency graph encountered an issue."}),a.jsxs(Z,{onClick:this.handleReset,className:"gap-2",children:[a.jsx(wp,{size:16}),"Reload Graph"]})]})}):this.props.children}}function B0({data:i}){const c={pending:"bg-yellow-100 border-yellow-300 dark:bg-yellow-900/30 dark:border-yellow-700",in_progress:"bg-cyan-100 border-cyan-300 dark:bg-cyan-900/30 dark:border-cyan-700",done:"bg-green-100 border-green-300 dark:bg-green-900/30 dark:border-green-700",blocked:"bg-red-50 border-red-300 dark:bg-red-900/20 dark:border-red-700"},d={pending:"text-yellow-900 dark:text-yellow-100",in_progress:"text-cyan-900 dark:text-cyan-100",done:"text-green-900 dark:text-green-100",blocked:"text-red-900 dark:text-red-100"},u=()=>{switch(i.status){case"done":return a.jsx(ta,{size:16,className:d[i.status]});case"in_progress":return a.jsx(Me,{size:16,className:`${d[i.status]} animate-spin`});case"blocked":return a.jsx(Aa,{size:16,className:"text-destructive"});default:return a.jsx(us,{size:16,className:d[i.status]})}};return a.jsxs(a.Fragment,{children:[a.jsx(Tm,{type:"target",position:os.Left,className:"!bg-border !w-2 !h-2"}),a.jsxs("div",{className:`
|
|
94
|
+
px-4 py-3 rounded-lg border-2 cursor-pointer
|
|
95
|
+
transition-all hover:shadow-md relative
|
|
96
|
+
${c[i.status]}
|
|
97
|
+
`,onClick:i.onClick,style:{minWidth:Hi-20,maxWidth:Hi},children:[i.agent&&a.jsx("div",{className:"absolute -top-3 -right-3 z-10",children:a.jsx("div",{className:"rounded-full border-2 border-border bg-background shadow-sm",children:a.jsx(xs,{name:i.agent.name,state:i.agent.state,size:"sm"})})}),a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(u,{}),a.jsxs("span",{className:`text-xs font-mono ${d[i.status]} opacity-70`,children:["#",i.priority]}),i.agent&&a.jsx("span",{className:`text-xs font-bold ${d[i.status]} ml-auto`,children:i.agent.name})]}),a.jsx("div",{className:`font-bold text-sm ${d[i.status]} truncate`,title:i.name,children:i.name}),a.jsx("div",{className:`text-xs ${d[i.status]} opacity-70 truncate`,title:i.category,children:i.category})]}),a.jsx(Tm,{type:"source",position:os.Right,className:"!bg-border !w-2 !h-2"})]})}const H0={feature:B0};function ah(i,c,d="LR"){const u=new eh.graphlib.Graph;u.setDefaultEdgeLabel(()=>({}));const h=d==="LR";return u.setGraph({rankdir:d,nodesep:50,ranksep:100,marginx:50,marginy:50}),i.forEach(y=>{u.setNode(y.id,{width:Hi,height:th})}),c.forEach(y=>{u.setEdge(y.source,y.target)}),eh.layout(u),{nodes:i.map(y=>{const g=u.node(y.id);return{...y,position:{x:g.x-Hi/2,y:g.y-th/2},sourcePosition:h?os.Right:os.Bottom,targetPosition:h?os.Left:os.Top}}),edges:c}}function q0({graphData:i,onNodeClick:c,activeAgents:d=[]}){const[u,h]=m.useState("LR"),x=m.useRef(c);m.useEffect(()=>{x.current=c},[c]);const y=m.useCallback(S=>{x.current?.(S)},[]),g=m.useMemo(()=>{const S=new Map;for(const X of d){const J=X.featureIds||[X.featureId];for(const $ of J)S.set($,{name:X.agentName,state:X.state})}return S},[d]),T=m.useMemo(()=>{const S=i.nodes.map(J=>({id:String(J.id),type:"feature",position:{x:0,y:0},data:{...J,onClick:()=>y(J.id),agent:g.get(J.id)}})),X=i.edges.map((J,$)=>({id:`e${J.source}-${J.target}-${$}`,source:String(J.source),target:String(J.target),type:"smoothstep",animated:!1,style:{stroke:"#a1a1aa",strokeWidth:2},markerEnd:{type:Op.ArrowClosed,color:"#a1a1aa"}}));return ah(S,X,u)},[i,u,y,g]),[C,A,D]=Rp(T.nodes),[H,v,E]=Up(T.edges),O=m.useRef(""),L=m.useRef(u);m.useEffect(()=>{const S=Array.from(g.entries()).map(([J,$])=>({featureId:J,agentName:$.name,agentState:$.state})),X=JSON.stringify({nodes:i.nodes.map(J=>({id:J.id,status:J.status})),edges:i.edges,agents:S});if(X!==O.current||u!==L.current){O.current=X,L.current=u;const{nodes:J,edges:$}=ah(T.nodes,T.edges,u);A(J),v($)}},[i,u,A,v,T,g]);const z=m.useCallback(S=>{h(S)},[]),b=m.useCallback(S=>{switch(S.data.status){case"done":return"#22c55e";case"in_progress":return"#06b6d4";case"blocked":return"#ef4444";default:return"#eab308"}},[]);return i.nodes.length===0?a.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-muted-foreground mb-2",children:"No features to display"}),a.jsx("div",{className:"text-sm text-muted-foreground/70",children:"Create features to see the dependency graph"})]})}):a.jsxs("div",{className:"h-full w-full relative bg-background",children:[a.jsxs("div",{className:"absolute top-4 left-4 z-10 flex gap-2",children:[a.jsx(Z,{variant:u==="LR"?"default":"outline",size:"sm",onClick:()=>z("LR"),children:"Horizontal"}),a.jsx(Z,{variant:u==="TB"?"default":"outline",size:"sm",onClick:()=>z("TB"),children:"Vertical"})]}),a.jsx(_e,{className:"absolute top-4 right-4 z-10",children:a.jsxs(Ge,{className:"p-3",children:[a.jsx("div",{className:"text-xs font-bold mb-2",children:"Status"}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-3 h-3 rounded bg-yellow-400 border border-yellow-500"}),a.jsx("span",{children:"Pending"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-3 h-3 rounded bg-cyan-400 border border-cyan-500"}),a.jsx("span",{children:"In Progress"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-3 h-3 rounded bg-green-400 border border-green-500"}),a.jsx("span",{children:"Done"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-3 h-3 rounded bg-red-100 border border-red-400"}),a.jsx("span",{children:"Blocked"})]})]})]})}),a.jsxs(Lp,{nodes:C,edges:H,onNodesChange:D,onEdgesChange:E,nodeTypes:H0,connectionMode:Bp.Loose,fitView:!0,fitViewOptions:{padding:.2},attributionPosition:"bottom-left",minZoom:.1,maxZoom:2,children:[a.jsx(Hp,{color:"#d4d4d8",gap:20,size:1}),a.jsx(qp,{className:"!bg-card !border !border-border !rounded-lg !shadow-sm",showInteractive:!1}),a.jsx(Gp,{nodeColor:b,className:"!bg-card !border !border-border !rounded-lg !shadow-sm",maskColor:"rgba(0, 0, 0, 0.1)"})]})]})}function G0({graphData:i,onNodeClick:c,activeAgents:d}){const[u,h]=m.useState(0),x=m.useCallback(()=>{h(y=>y+1)},[]);return a.jsx(L0,{onReset:x,children:a.jsx(q0,{graphData:i,onNodeClick:c,activeAgents:d})},u)}const Q0=[{key:"?",description:"Show keyboard shortcuts"},{key:"D",description:"Toggle debug panel"},{key:"T",description:"Toggle terminal tab"},{key:"N",description:"Add new feature",context:"with project"},{key:"E",description:"Expand project with AI",context:"with features"},{key:"A",description:"Toggle AI assistant",context:"with project"},{key:"G",description:"Toggle Kanban/Graph view",context:"with project"},{key:",",description:"Open settings"},{key:"Esc",description:"Close modal/panel"}];function Y0({isOpen:i,onClose:c}){const d=m.useCallback(u=>{(u.key==="Escape"||u.key==="?")&&(u.preventDefault(),c())},[c]);return m.useEffect(()=>{if(i)return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i,d]),a.jsx(aa,{open:i,onOpenChange:u=>!u&&c(),children:a.jsxs(na,{className:"sm:max-w-md",children:[a.jsx(sa,{children:a.jsxs(la,{className:"flex items-center gap-2",children:[a.jsx(Cp,{size:20,className:"text-primary"}),"Keyboard Shortcuts"]})}),a.jsx("ul",{className:"space-y-1",children:Q0.map(u=>a.jsxs("li",{className:"flex items-center justify-between py-2 border-b border-border/50 last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-muted rounded border border-border min-w-[2rem] text-center",children:u.key}),a.jsx("span",{className:"text-sm",children:u.description})]}),u.context&&a.jsx(ie,{variant:"secondary",className:"text-xs",children:u.context})]},u.key))}),a.jsx("p",{className:"text-xs text-muted-foreground text-center pt-2",children:"Press ? or Esc to close"})]})})}function Th({themes:i,currentTheme:c,onThemeChange:d}){const[u,h]=m.useState(!1),[x,y]=m.useState(null),g=m.useRef(null),T=m.useRef(null);m.useEffect(()=>{const v=E=>{g.current&&!g.current.contains(E.target)&&(h(!1),y(null))};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[]),m.useEffect(()=>{if(x){const v=document.documentElement;v.classList.remove("theme-claude","theme-neo-brutalism","theme-retro-arcade","theme-aurora","theme-business"),x==="claude"?v.classList.add("theme-claude"):x==="neo-brutalism"?v.classList.add("theme-neo-brutalism"):x==="retro-arcade"?v.classList.add("theme-retro-arcade"):x==="aurora"?v.classList.add("theme-aurora"):x==="business"&&v.classList.add("theme-business")}return()=>{if(x){const v=document.documentElement;v.classList.remove("theme-claude","theme-neo-brutalism","theme-retro-arcade","theme-aurora","theme-business"),c==="claude"?v.classList.add("theme-claude"):c==="neo-brutalism"?v.classList.add("theme-neo-brutalism"):c==="retro-arcade"?v.classList.add("theme-retro-arcade"):c==="aurora"?v.classList.add("theme-aurora"):c==="business"&&v.classList.add("theme-business")}}},[x,c]);const C=()=>{T.current&&clearTimeout(T.current),h(!0)},A=()=>{T.current=setTimeout(()=>{h(!1),y(null)},150)},D=v=>{y(v)},H=v=>{d(v),y(null),h(!1)};return a.jsxs("div",{ref:g,className:"relative",onMouseEnter:C,onMouseLeave:A,children:[a.jsx(Z,{variant:"outline",size:"sm",title:"Theme","aria-label":"Select theme","aria-expanded":u,"aria-haspopup":"true",children:a.jsx(xh,{size:18})}),u&&a.jsx("div",{className:"absolute right-0 top-full mt-2 w-56 bg-popover border-2 border-border rounded-lg shadow-lg z-50 animate-slide-in-down overflow-hidden",role:"menu","aria-orientation":"vertical",children:a.jsx("div",{className:"p-2 space-y-1",children:i.map(v=>a.jsxs("button",{onClick:()=>H(v.id),onMouseEnter:()=>D(v.id),onMouseLeave:()=>y(null),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${c===v.id?"bg-primary/10 text-foreground":"hover:bg-muted text-foreground"}`,role:"menuitem",children:[a.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[a.jsx("div",{className:"w-4 h-4 rounded-sm border border-border/50",style:{backgroundColor:v.previewColors.background}}),a.jsx("div",{className:"w-4 h-4 rounded-sm border border-border/50",style:{backgroundColor:v.previewColors.primary}}),a.jsx("div",{className:"w-4 h-4 rounded-sm border border-border/50",style:{backgroundColor:v.previewColors.accent}})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-sm",children:v.name}),a.jsx("div",{className:"text-xs text-muted-foreground truncate",children:v.description})]}),c===v.id&&a.jsx(ea,{size:16,className:"text-primary shrink-0"})]},v.id))})})]})}function V0({isOpen:i,projectName:c,onClose:d,onResetComplete:u}){const[h,x]=m.useState("quick"),y=Iy(c),g=async()=>{const C=h==="full";try{await y.mutateAsync(C),u?.(C),d()}catch{}},T=()=>{y.isPending||(y.reset(),x("quick"),d())};return a.jsx(aa,{open:i,onOpenChange:C=>!C&&T(),children:a.jsxs(na,{className:"sm:max-w-md",children:[a.jsxs(sa,{children:[a.jsxs(la,{className:"flex items-center gap-2",children:[a.jsx(ds,{size:20}),"Reset Project"]}),a.jsxs(Bi,{children:["Reset ",a.jsx("span",{className:"font-semibold",children:c})," to start fresh"]})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"flex rounded-lg border-2 border-border overflow-hidden",children:[a.jsxs("button",{onClick:()=>x("quick"),disabled:y.isPending,className:`flex-1 py-3 px-4 text-sm font-medium transition-colors flex items-center justify-center gap-2 ${h==="quick"?"bg-primary text-primary-foreground":"bg-background text-foreground hover:bg-muted"} ${y.isPending?"opacity-50 cursor-not-allowed":""}`,children:[a.jsx(ds,{size:16}),"Quick Reset"]}),a.jsxs("button",{onClick:()=>x("full"),disabled:y.isPending,className:`flex-1 py-3 px-4 text-sm font-medium transition-colors flex items-center justify-center gap-2 ${h==="full"?"bg-destructive text-destructive-foreground":"bg-background text-foreground hover:bg-muted"} ${y.isPending?"opacity-50 cursor-not-allowed":""}`,children:[a.jsx(tn,{size:16}),"Full Reset"]})]}),a.jsxs(vt,{variant:h==="full"?"destructive":"default",className:"border-2",children:[a.jsx(Aa,{className:"h-4 w-4"}),a.jsxs(Nt,{children:[a.jsx("div",{className:"font-semibold mb-2",children:"What will be deleted:"}),a.jsxs("ul",{className:"list-none space-y-1 text-sm",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(We,{size:14,className:"text-destructive"}),"All features and progress"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(We,{size:14,className:"text-destructive"}),"Assistant chat history"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(We,{size:14,className:"text-destructive"}),"Agent settings"]}),h==="full"&&a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(We,{size:14,className:"text-destructive"}),"App spec and prompts"]})]})]})]}),a.jsxs("div",{className:"bg-muted/50 rounded-lg border-2 border-border p-3",children:[a.jsx("div",{className:"font-semibold mb-2 text-sm",children:"What will be preserved:"}),a.jsx("ul",{className:"list-none space-y-1 text-sm text-muted-foreground",children:h==="quick"?a.jsxs(a.Fragment,{children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ea,{size:14,className:"text-green-600"}),"App spec and prompts"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ea,{size:14,className:"text-green-600"}),"Project code and files"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ea,{size:14,className:"text-green-600"}),"Project code and files"]}),a.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground/70",children:[a.jsx(Aa,{size:14}),"Setup wizard will appear"]})]})})]}),y.isError&&a.jsx(vt,{variant:"destructive",children:a.jsx(Nt,{children:y.error instanceof Error?y.error.message:"Failed to reset project. Please try again."})})]}),a.jsxs(en,{className:"gap-2",children:[a.jsx(Z,{variant:"outline",onClick:T,disabled:y.isPending,children:"Cancel"}),a.jsx(Z,{variant:h==="full"?"destructive":"default",onClick:g,disabled:y.isPending,children:y.isPending?a.jsxs(a.Fragment,{children:[a.jsx(Me,{className:"animate-spin mr-2",size:16}),"Resetting..."]}):a.jsx(a.Fragment,{children:h==="quick"?"Quick Reset":"Full Reset"})})]})]})})}function F0({projectName:i,projectPath:c,onCreateWithClaude:d,onEditManually:u}){return a.jsx("div",{className:"max-w-2xl mx-auto mt-8",children:a.jsxs(_e,{className:"border-2",children:[a.jsxs(Gi,{className:"text-center",children:[a.jsx(wo,{className:"text-2xl font-display",children:"Project Setup Required"}),a.jsxs(Sb,{className:"text-base",children:[a.jsx("span",{className:"font-semibold",children:i})," needs an app spec to get started"]}),c&&a.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground mt-2",children:[a.jsx(Ui,{size:14}),a.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-xs",children:c})]})]}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsx("p",{className:"text-center text-muted-foreground",children:"Choose how you want to create your app specification:"}),a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsx(_e,{className:"cursor-pointer border-2 transition-all hover:border-primary hover:shadow-md",onClick:d,children:a.jsxs(Ge,{className:"pt-6 text-center space-y-3",children:[a.jsx("div",{className:"w-12 h-12 mx-auto bg-primary/10 rounded-full flex items-center justify-center",children:a.jsx(Sn,{className:"text-primary",size:24})}),a.jsx("h3",{className:"font-semibold text-lg",children:"Create with Claude"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Describe your app idea and Claude will help create a detailed specification"}),a.jsxs(Z,{className:"w-full",children:[a.jsx(Sn,{size:16,className:"mr-2"}),"Start Chat"]})]})}),a.jsx(_e,{className:"cursor-pointer border-2 transition-all hover:border-primary hover:shadow-md",onClick:u,children:a.jsxs(Ge,{className:"pt-6 text-center space-y-3",children:[a.jsx("div",{className:"w-12 h-12 mx-auto bg-muted rounded-full flex items-center justify-center",children:a.jsx(uo,{className:"text-muted-foreground",size:24})}),a.jsx("h3",{className:"font-semibold text-lg",children:"Edit Templates Manually"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Create the prompts directory and edit template files yourself"}),a.jsxs(Z,{variant:"outline",className:"w-full",children:[a.jsx(uo,{size:16,className:"mr-2"}),"View Templates"]})]})})]}),a.jsx("p",{className:"text-center text-xs text-muted-foreground pt-4",children:"The app spec tells the agent what to build. It includes the application name, description, tech stack, and feature requirements."})]})]})})}const co="autoforge-selected-project",nh="autoforge-view-mode",X0=48;function K0(){const[i,c]=m.useState(()=>{try{return localStorage.getItem(co)}catch{return null}}),[d,u]=m.useState(!1),[h,x]=m.useState(!1),[y,g]=m.useState(null),[T,C]=m.useState(!0),[A,D]=m.useState(!1),[H,v]=m.useState(288),[E,O]=m.useState("agent"),[L,z]=m.useState(!1),[b,S]=m.useState(!1),[X,J]=m.useState(!1),[$,F]=m.useState(!1),[ee,Y]=m.useState(!1),[se,K]=m.useState(!1),[U,q]=m.useState("idle"),[W,le]=m.useState(null),[j,M]=m.useState(()=>{try{return localStorage.getItem(nh)==="graph"?"graph":"kanban"}catch{return"kanban"}}),I=at(),{data:P,isLoading:fe}=Jy(),{data:ue}=vh(i),{data:Ce}=No();sb(i);const ne=mb(i),{theme:Re,setTheme:ot,darkMode:ft,toggleDarkMode:ia,themes:ra}=So(),te=P?.find(Xe=>Xe.name===i),de=te?.has_spec??!0,{data:Ue}=Rt({queryKey:["dependencyGraph",i],queryFn:()=>wy(i),enabled:!!i&&j==="graph",refetchInterval:5e3});m.useEffect(()=>{try{localStorage.setItem(nh,j)}catch{}},[j]),gb(ue),jb(ue,i);const St=m.useCallback(Xe=>{c(Xe);try{Xe?localStorage.setItem(co,Xe):localStorage.removeItem(co)}catch{}},[]),Xt=m.useCallback(Xe=>{const wt=[...ue?.pending??[],...ue?.in_progress??[],...ue?.done??[]].find(dl=>dl.id===Xe);wt&&g(wt)},[ue]);m.useEffect(()=>{i&&P&&!P.some(Xe=>Xe.name===i)&&St(null)},[i,P,St]),m.useEffect(()=>{const Xe=je=>{je.target instanceof HTMLInputElement||je.target instanceof HTMLTextAreaElement||((je.key==="d"||je.key==="D")&&(je.preventDefault(),D(wt=>!wt)),(je.key==="t"||je.key==="T")&&(je.preventDefault(),A?E==="terminal"?D(!1):O("terminal"):(D(!0),O("terminal"))),(je.key==="n"||je.key==="N")&&i&&(je.preventDefault(),u(!0)),(je.key==="e"||je.key==="E")&&i&&ue&&ue.pending.length+ue.in_progress.length+ue.done.length>0&&(je.preventDefault(),x(!0)),(je.key==="a"||je.key==="A")&&i&&!$&&(je.preventDefault(),z(wt=>!wt)),je.key===","&&(je.preventDefault(),S(!0)),(je.key==="g"||je.key==="G")&&i&&(je.preventDefault(),M(wt=>wt==="kanban"?"graph":"kanban")),je.key==="?"&&(je.preventDefault(),J(!0)),(je.key==="r"||je.key==="R")&&i&&ne.agentStatus!=="running"&&(je.preventDefault(),Y(!0)),je.key==="Escape"&&(X?J(!1):ee?Y(!1):h?x(!1):b?S(!1):L?z(!1):d?u(!1):y?g(null):A&&D(!1)))};return window.addEventListener("keydown",Xe),()=>window.removeEventListener("keydown",Xe)},[i,d,h,y,A,E,L,ue,b,X,$,j,ee,ne.agentStatus]);const ut=ne.progress.total>0?ne.progress:{passing:ue?.done.length??0,total:(ue?.pending.length??0)+(ue?.in_progress.length??0)+(ue?.done.length??0),percentage:0};return ut.total>0&&ut.percentage===0&&(ut.percentage=Math.round(ut.passing/ut.total*100*10)/10),T?a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"sticky top-0 z-50 bg-card/80 backdrop-blur-md text-foreground border-b-2 border-border",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"font-display text-2xl font-bold tracking-tight uppercase",children:"AutoForge"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(qb,{projects:P??[],selectedProject:i,onSelectProject:St,isLoading:fe,onSpecCreatingChange:F}),i&&a.jsxs(a.Fragment,{children:[a.jsx(Rj,{projectName:i,status:ne.agentStatus,defaultConcurrency:te?.default_concurrency}),a.jsx(O0,{projectName:i,status:ne.devServerStatus,url:ne.devServerUrl}),a.jsx(Z,{onClick:()=>S(!0),variant:"outline",size:"sm",title:"Settings (,)","aria-label":"Open Settings",children:a.jsx(gh,{size:18})}),a.jsx(Z,{onClick:()=>Y(!0),variant:"outline",size:"sm",title:"Reset Project (R)","aria-label":"Reset Project",disabled:ne.agentStatus==="running",children:a.jsx(ds,{size:18})}),Ce?.ollama_mode&&a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-card rounded border-2 border-border shadow-sm",title:"Using Ollama local models (configured via .env)",children:[a.jsx("img",{src:"/ollama.png",alt:"Ollama",className:"w-5 h-5"}),a.jsx("span",{className:"text-xs font-bold text-foreground",children:"Ollama"})]}),Ce?.glm_mode&&a.jsx(ie,{className:"bg-purple-500 text-white hover:bg-purple-600",title:"Using GLM API (configured via .env)",children:"GLM"})]}),a.jsx(Z,{onClick:()=>{window.location.hash="#/docs"},variant:"outline",size:"sm",title:"Documentation","aria-label":"Open Documentation",children:a.jsx(zp,{size:18})}),a.jsx(Th,{themes:ra,currentTheme:Re,onThemeChange:ot}),a.jsx(Z,{onClick:ia,variant:"outline",size:"sm",title:"Toggle dark mode","aria-label":"Toggle dark mode",children:ft?a.jsx(bo,{size:18}):a.jsx(jo,{size:18})})]})]})})}),a.jsx("main",{className:"max-w-7xl mx-auto px-4 py-8",style:{paddingBottom:A?H+32:X0},children:i?de?a.jsxs("div",{className:"space-y-8",children:[a.jsx(Hj,{passing:ut.passing,total:ut.total,percentage:ut.percentage,isConnected:ne.isConnected,logs:ne.activeAgents.length===0?ne.logs:void 0,agentStatus:ne.activeAgents.length===0?ne.agentStatus:void 0}),a.jsx(m0,{agents:ne.activeAgents,orchestratorStatus:ne.orchestratorStatus,recentActivity:ne.recentActivity,getAgentLogs:ne.getAgentLogs}),ue&&ue.pending.length===0&&ue.in_progress.length===0&&ue.done.length===0&&ne.agentStatus==="running"&&a.jsx(_e,{className:"p-8 text-center",children:a.jsxs(Ge,{className:"p-0",children:[a.jsx(Me,{size:32,className:"animate-spin mx-auto mb-4 text-primary"}),a.jsx("h3",{className:"font-display font-bold text-xl mb-2",children:"Initializing Features..."}),a.jsx("p",{className:"text-muted-foreground",children:"The agent is reading your spec and creating features. This may take a moment."})]})}),ue&&ue.pending.length+ue.in_progress.length+ue.done.length>0&&a.jsx("div",{className:"flex justify-center",children:a.jsx(R0,{viewMode:j,onViewModeChange:M})}),j==="kanban"?a.jsx(jj,{features:ue,onFeatureClick:g,onAddFeature:()=>u(!0),onExpandProject:()=>x(!0),activeAgents:ne.activeAgents,onCreateSpec:()=>K(!0),hasSpec:de}):a.jsx(_e,{className:"overflow-hidden",style:{height:"600px"},children:Ue?a.jsx(G0,{graphData:Ue,onNodeClick:Xt,activeAgents:ne.activeAgents}):a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx(Me,{size:32,className:"animate-spin text-primary"})})})]}):a.jsx(F0,{projectName:i,projectPath:te?.path,onCreateWithClaude:()=>K(!0),onEditManually:()=>{D(!0)}}):a.jsxs("div",{className:"text-center mt-12",children:[a.jsx("h2",{className:"font-display text-2xl font-bold mb-2",children:"Welcome to AutoForge"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Select a project from the dropdown above or create a new one to get started."})]})}),d&&i&&a.jsx(Gj,{projectName:i,onClose:()=>u(!1)}),y&&i&&a.jsx(Vj,{feature:y,projectName:i,onClose:()=>g(null)}),h&&i&&a.jsx(D0,{isOpen:h,projectName:i,onClose:()=>x(!1),onFeaturesAdded:()=>{I.invalidateQueries({queryKey:["features",i]})}}),se&&i&&a.jsx("div",{className:"fixed inset-0 z-50 bg-background",children:a.jsx(wh,{projectName:i,onComplete:async(Xe,je)=>{q("starting");try{await vo(i,{yoloMode:je??!1,maxConcurrency:3}),K(!1),q("idle"),I.invalidateQueries({queryKey:["projects"]}),I.invalidateQueries({queryKey:["features",i]})}catch(wt){q("error"),le(wt instanceof Error?wt.message:"Failed to start agent")}},onCancel:()=>{K(!1),q("idle")},onExitToProject:()=>{K(!1),q("idle")},initializerStatus:U,initializerError:W,onRetryInitializer:()=>{le(null),q("idle")}})}),i&&a.jsx(Jj,{logs:ne.logs,devLogs:ne.devLogs,isOpen:A,onToggle:()=>D(!A),onClear:ne.clearLogs,onClearDevLogs:ne.clearDevLogs,onHeightChange:v,projectName:i,activeTab:E,onTabChange:O}),i&&!h&&!$&&!se&&a.jsxs(a.Fragment,{children:[a.jsx(g0,{onClick:()=>z(!L),isOpen:L}),a.jsx(C0,{projectName:i,isOpen:L,onClose:()=>z(!1)})]}),a.jsx(k0,{isOpen:b,onClose:()=>S(!1)}),a.jsx(Y0,{isOpen:X,onClose:()=>J(!1)}),ee&&i&&a.jsx(V0,{isOpen:ee,projectName:i,onClose:()=>Y(!1),onResetComplete:Xe=>{Xe&&K(!0)}}),ne.celebration&&a.jsx(x0,{agentName:ne.celebration.agentName,featureName:ne.celebration.featureName,onComplete:ne.clearCelebration})]}):a.jsx(qj,{onComplete:()=>C(!0)})}const cs=[{id:"getting-started",title:"Getting Started",icon:fh,subsections:[{id:"what-is-autoforge",title:"What is AutoForge?"},{id:"installation",title:"Installation"},{id:"quick-start",title:"Quick Start"},{id:"cli-commands",title:"CLI Commands"},{id:"creating-a-project",title:"Creating a New Project"},{id:"existing-project",title:"Adding to an Existing Project"},{id:"system-requirements",title:"System Requirements"}],keywords:["install","setup","start","begin","new","requirements","prerequisites","npm","config","port","repair"]},{id:"app-spec-setup",title:"App Spec & Project Setup",icon:ih,subsections:[{id:"what-is-app-spec",title:"What is an App Spec?"},{id:"creating-spec-with-claude",title:"Creating a Spec with Claude"},{id:"writing-spec-manually",title:"Writing a Spec Manually"},{id:"initializer-agent",title:"The Initializer Agent"},{id:"starting-after-spec",title:"Starting After Spec Creation"}],keywords:["spec","specification","xml","app_spec","initializer","prompt","template"]},{id:"project-structure",title:"Target Project Structure",icon:Ap,subsections:[{id:"autoforge-directory",title:".autoforge/ Directory Layout"},{id:"features-db",title:"Features Database"},{id:"prompts-directory",title:"Prompts Directory"},{id:"allowed-commands-yaml",title:"Allowed Commands Config"},{id:"claude-md",title:"CLAUDE.md Convention"},{id:"legacy-migration",title:"Legacy Layout Migration"},{id:"claude-inheritance",title:"Claude Inheritance"}],keywords:["folder","directory","structure","layout","files","database","sqlite","migration"]},{id:"features-kanban",title:"Features & Kanban Board",icon:hh,subsections:[{id:"kanban-overview",title:"Kanban Board Overview"},{id:"feature-cards",title:"Feature Cards"},{id:"dependency-graph",title:"Dependency Graph View"},{id:"adding-features",title:"Adding Features"},{id:"editing-features",title:"Editing & Deleting Features"},{id:"feature-dependencies",title:"Feature Dependencies"},{id:"expanding-with-ai",title:"Expanding Project with AI"},{id:"feature-priority",title:"Priority & Ordering"}],keywords:["kanban","board","feature","card","dependency","graph","priority","pending","progress","done"]},{id:"agent-system",title:"Agent System",icon:qi,subsections:[{id:"maestro-orchestrator",title:"Maestro: The Orchestrator"},{id:"coding-agents",title:"Coding Agents"},{id:"testing-agents",title:"Testing Agents"},{id:"agent-lifecycle",title:"Agent Lifecycle"},{id:"concurrency",title:"Concurrency Control"},{id:"mission-control",title:"Agent Mission Control"},{id:"agent-mascots",title:"Agent Mascots & States"},{id:"agent-logs",title:"Viewing Agent Logs"},{id:"process-limits",title:"Process Limits"}],keywords:["agent","maestro","orchestrator","coding","testing","parallel","concurrency","mascot","spark","fizz","octo","batch"]},{id:"settings-config",title:"Settings & Configuration",icon:gh,subsections:[{id:"opening-settings",title:"Opening Settings"},{id:"yolo-mode",title:"YOLO Mode"},{id:"headless-browser",title:"Headless Browser"},{id:"model-selection",title:"Model Selection"},{id:"regression-agents",title:"Regression Agents"},{id:"features-per-agent",title:"Features per Agent (Batch Size)"},{id:"concurrency-setting",title:"Concurrency"},{id:"settings-persistence",title:"How Settings are Persisted"}],keywords:["settings","config","yolo","headless","model","opus","sonnet","haiku","batch","regression"]},{id:"developer-tools",title:"Developer Tools",icon:fo,subsections:[{id:"debug-panel",title:"Debug Panel"},{id:"agent-logs-tab",title:"Agent Logs Tab"},{id:"dev-server-logs",title:"Dev Server Logs Tab"},{id:"terminal",title:"Terminal"},{id:"dev-server-control",title:"Dev Server Control"},{id:"per-agent-logs",title:"Per-Agent Logs"}],keywords:["debug","terminal","logs","dev server","console","xterm","shell"]},{id:"ai-assistant",title:"AI Assistant",icon:mh,subsections:[{id:"what-is-assistant",title:"What is the Assistant?"},{id:"opening-assistant",title:"Opening the Assistant"},{id:"assistant-capabilities",title:"What It Can Do"},{id:"assistant-limitations",title:"What It Cannot Do"},{id:"conversation-history",title:"Conversation History"}],keywords:["assistant","ai","chat","help","question","conversation"]},{id:"scheduling",title:"Scheduling",icon:Nn,subsections:[{id:"what-scheduling-does",title:"What Scheduling Does"},{id:"creating-schedule",title:"Creating a Schedule"},{id:"schedule-settings",title:"Schedule Settings"},{id:"schedule-overrides",title:"Schedule Overrides"},{id:"crash-recovery",title:"Crash Recovery"}],keywords:["schedule","timer","automated","cron","run","recurring","utc"]},{id:"appearance-themes",title:"Appearance & Themes",icon:xh,subsections:[{id:"themes-overview",title:"Themes Overview"},{id:"dark-light-mode",title:"Dark & Light Mode"},{id:"theme-selector",title:"Theme Selector"},{id:"keyboard-shortcuts",title:"Keyboard Shortcuts"}],keywords:["theme","dark","light","color","appearance","twitter","claude","neo","brutalism","retro","aurora","business","keyboard","shortcut"]},{id:"security",title:"Security",icon:Tp,subsections:[{id:"command-validation",title:"Command Validation Overview"},{id:"command-hierarchy",title:"Command Hierarchy"},{id:"hardcoded-blocklist",title:"Hardcoded Blocklist"},{id:"global-allowlist",title:"Global Allowlist"},{id:"project-allowlist",title:"Per-Project Allowed Commands"},{id:"org-config",title:"Organization Configuration"},{id:"extra-read-paths",title:"Extra Read Paths"},{id:"filesystem-sandboxing",title:"Filesystem Sandboxing"}],keywords:["security","sandbox","allowlist","blocklist","command","bash","permission","filesystem"]},{id:"advanced-config",title:"Advanced Configuration",icon:Ep,subsections:[{id:"vertex-ai",title:"Vertex AI Setup"},{id:"ollama",title:"Ollama Local Models"},{id:"env-variables",title:"Environment Variables"},{id:"cli-arguments",title:"CLI Arguments"},{id:"webhooks",title:"Webhook Support"},{id:"project-registry",title:"Project Registry"}],keywords:["vertex","gcloud","ollama","local","env","environment","cli","webhook","n8n","registry","api"]},{id:"faq",title:"FAQ & Troubleshooting",icon:Dp,subsections:[{id:"faq-new-project",title:"Starting a New Project"},{id:"faq-existing-project",title:"Adding to Existing Project"},{id:"faq-agent-crash",title:"Agent Crashes"},{id:"faq-custom-commands",title:"Custom Bash Commands"},{id:"faq-blocked-features",title:"Blocked Features"},{id:"faq-parallel",title:"Running in Parallel"},{id:"faq-local-model",title:"Using Local Models"},{id:"faq-reset",title:"Resetting a Project"},{id:"faq-agent-types",title:"Coding vs Testing Agents"},{id:"faq-real-time",title:"Monitoring in Real Time"}],keywords:["faq","troubleshoot","help","problem","issue","fix","error","stuck","reset","crash"]}];function sh({activeSectionId:i,onSectionClick:c,searchQuery:d,onMobileClose:u}){const[h,x]=m.useState(()=>{const v=new Set;return cs.length>0&&v.add(cs[0].id),v}),y=d.trim().toLowerCase(),g=m.useMemo(()=>y?cs.filter(v=>!!(v.title.toLowerCase().includes(y)||v.keywords.some(E=>E.toLowerCase().includes(y))||v.subsections.some(E=>E.title.toLowerCase().includes(y)))):cs,[y]),T=v=>{if(y||h.has(v))return!0;if(i){const E=cs.find(O=>O.id===v);if(E&&(E.id===i||E.subsections.some(O=>O.id===i)))return!0}return!1},C=v=>{x(E=>{const O=new Set(E);return O.has(v)?O.delete(v):O.add(v),O})},A=v=>i===v,D=v=>i?v.subsections.some(E=>E.id===i):!1,H=v=>{c(v),u?.()};return a.jsxs("nav",{"aria-label":"Documentation navigation",className:"space-y-1",children:[g.map(v=>{const E=v.icon,O=T(v.id),L=A(v.id),z=D(v);return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>{C(v.id),H(v.id)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md
|
|
98
|
+
transition-colors cursor-pointer group
|
|
99
|
+
${L?"bg-primary/10 border-l-2 border-primary text-foreground font-semibold":z?"text-foreground font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,"aria-expanded":O,children:[a.jsx(E,{size:16,className:`shrink-0 ${L?"text-primary":"text-muted-foreground group-hover:text-foreground"}`}),a.jsx("span",{className:"flex-1 text-left truncate",children:v.title}),a.jsx(oo,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-200
|
|
100
|
+
${O?"rotate-90":""}`})]}),O&&a.jsx("div",{className:"ml-4 mt-0.5 space-y-0.5 border-l border-border animate-slide-in-down",children:v.subsections.map(b=>{const S=A(b.id);return a.jsx("button",{onClick:()=>H(b.id),className:`w-full text-left px-3 py-1.5 text-sm rounded-r-md
|
|
101
|
+
transition-colors cursor-pointer
|
|
102
|
+
${S?"bg-primary/10 border-l-2 border-primary text-foreground font-medium -ml-px":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:b.title},b.id)})})]},v.id)}),y&&g.length===0&&a.jsxs("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:["No sections match “",d,"”"]})]})}function lh({value:i,onChange:c}){const d=m.useRef(null);return m.useEffect(()=>{const u=h=>{(h.ctrlKey||h.metaKey)&&h.key==="k"&&(h.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]),a.jsxs("div",{className:"relative",children:[a.jsx(kp,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),a.jsx("input",{ref:d,type:"text",value:i,onChange:u=>c(u.target.value),placeholder:"Search docs...",className:`w-full pl-9 pr-16 py-2 text-sm bg-muted border border-border rounded-lg\r
|
|
103
|
+
text-foreground placeholder:text-muted-foreground\r
|
|
104
|
+
focus:outline-none focus:ring-2 focus:ring-ring/50 focus:border-ring\r
|
|
105
|
+
transition-colors`}),i?a.jsx("button",{onClick:()=>{c(""),d.current?.focus()},className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground\r
|
|
106
|
+
hover:text-foreground transition-colors`,"aria-label":"Clear search",children:a.jsx(We,{size:16})}):a.jsx("kbd",{className:`absolute right-3 top-1/2 -translate-y-1/2\r
|
|
107
|
+
text-[10px] text-muted-foreground bg-background\r
|
|
108
|
+
border border-border rounded px-1.5 py-0.5\r
|
|
109
|
+
pointer-events-none select-none`,children:"Ctrl+K"})]})}const Z0=[{command:"autoforge",description:"Start the server (default)"},{command:"autoforge config",description:"Open ~/.autoforge/.env in your editor"},{command:"autoforge config --path",description:"Print config file path"},{command:"autoforge config --show",description:"Show active configuration values"},{command:"autoforge --port PORT",description:"Custom port (default: auto from 8888)"},{command:"autoforge --host HOST",description:"Custom host (default: 127.0.0.1)"},{command:"autoforge --no-browser",description:"Don't auto-open browser"},{command:"autoforge --repair",description:"Delete and recreate virtual environment"},{command:"autoforge --version",description:"Print version"},{command:"autoforge --help",description:"Show help"}];function J0(){return a.jsxs("div",{children:[a.jsx("h3",{id:"what-is-autoforge",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What is AutoForge?"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"AutoForge is an autonomous coding agent system that builds complete applications over multiple sessions using a two-agent pattern:"}),a.jsxs("ol",{className:"list-decimal space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Initializer Agent"})," — reads your app spec and creates features in a SQLite database"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Coding Agent"})," — implements features one by one, marking each as passing when complete"]})]}),a.jsx("p",{className:"text-muted-foreground mt-4",children:"It comes with a React-based UI for monitoring progress, managing features, and controlling agents in real time."}),a.jsx("h3",{id:"installation",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Installation"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Install AutoForge globally via npm:"}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:"npm install -g autoforge-ai"})})}),a.jsxs("p",{className:"text-muted-foreground mt-3",children:["This requires"," ",a.jsx("strong",{className:"text-foreground",children:"Node.js 20+"})," and"," ",a.jsx("strong",{className:"text-foreground",children:"Python 3.11+"}),". Python is auto-detected on first run."]}),a.jsx("h3",{id:"quick-start",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Quick Start"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"After installing, start AutoForge with a single command:"}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:"autoforge"})})}),a.jsx("p",{className:"text-muted-foreground mt-3 mb-2",children:"On first run, AutoForge automatically:"}),a.jsxs("ol",{className:"list-decimal space-y-1 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Checks for Python 3.11+"}),a.jsxs("li",{children:["Creates a virtual environment at"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/venv/"})]}),a.jsx("li",{children:"Installs Python dependencies"}),a.jsxs("li",{children:["Copies a default config file to"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/.env"})]}),a.jsx("li",{children:"Starts the server and opens your browser"})]}),a.jsx("p",{className:"text-muted-foreground mt-3",children:"On subsequent runs, AutoForge starts instantly — the environment is already set up."}),a.jsx("h4",{className:"text-base font-semibold text-foreground mt-6 mb-3",children:"Running from Source"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"If you prefer to clone the repository (for development or contributing):"}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:`# Windows
|
|
110
|
+
start_ui.bat # Web UI
|
|
111
|
+
|
|
112
|
+
# macOS/Linux
|
|
113
|
+
./start_ui.sh # Web UI`})})}),a.jsx("h3",{id:"cli-commands",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"CLI Commands"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["The"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"autoforge"})," ","command supports these options:"]}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Command"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Description"})]})}),a.jsx("tbody",{className:"text-muted-foreground",children:Z0.map(i=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:i.command})}),a.jsx("td",{className:"border border-border px-3 py-2",children:i.description})]},i.command))})]}),a.jsx("h4",{className:"text-base font-semibold text-foreground mt-6 mb-3",children:"Configuration"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["AutoForge reads configuration from a"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".env"})," ","file. The location depends on your install method:"]}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Install method"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Config location"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"npm (global)"}),a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/.env"})})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"From source"}),a.jsxs("td",{className:"border border-border px-3 py-2",children:[a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".env"})," ","in the project root"]})]})]})]}),a.jsxs("p",{className:"text-muted-foreground mt-3",children:["Run"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"autoforge config"})," ","to open the config file in your editor, or"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"autoforge config --show"})," ","to print the active values. See"," ",a.jsx("a",{href:"#/docs/advanced-config",className:"text-primary underline",children:"Advanced Configuration"})," ","for API provider setup (Ollama, Vertex AI, z.ai)."]}),a.jsx("h3",{id:"creating-a-project",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Creating a New Project"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["From the UI, click the project dropdown and select"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"Create New Project"})]}),a.jsx("li",{children:"Enter a name and select or browse to a folder for the project"}),a.jsx("li",{children:"Create an app spec interactively with Claude, or write one manually in XML format"}),a.jsx("li",{children:"The initializer agent reads your spec and creates features automatically"})]}),a.jsx("h3",{id:"existing-project",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Adding to an Existing Project"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Register the project folder via the UI project selector"}),a.jsxs("li",{children:["AutoForge creates a"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/"})," ","directory inside your project"]}),a.jsx("li",{children:"Existing code is preserved — AutoForge adds its configuration alongside it"}),a.jsx("li",{children:"Write or generate an app spec describing what to build"})]}),a.jsx("h3",{id:"system-requirements",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"System Requirements"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Requirement"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Details"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Node.js"}),a.jsxs("td",{className:"border border-border px-3 py-2",children:[a.jsx(ie,{variant:"secondary",children:"20+"})," ",a.jsx("span",{className:"text-xs",children:"(required for CLI and UI)"})]})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Python"}),a.jsxs("td",{className:"border border-border px-3 py-2",children:[a.jsx(ie,{variant:"secondary",children:"3.11+"})," ",a.jsx("span",{className:"text-xs",children:"(auto-detected on first run)"})]})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Claude Code CLI"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Required for running agents"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Operating System"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Windows, macOS, or Linux"})]})]})]})]})}function $0(){return a.jsxs("div",{children:[a.jsx("h3",{id:"what-is-app-spec",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What is an App Spec?"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["The app spec is an XML document that describes the application to be built. It lives at"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/prompts/app_spec.txt"})," ","and tells the initializer agent what features to create. The spec defines your app's name, description, tech stack, and the features that should be implemented."]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:`<app>
|
|
114
|
+
<name>My App</name>
|
|
115
|
+
<description>A task management app</description>
|
|
116
|
+
<features>
|
|
117
|
+
<feature>User authentication with login/signup</feature>
|
|
118
|
+
<feature>Task CRUD with categories</feature>
|
|
119
|
+
</features>
|
|
120
|
+
</app>`})})}),a.jsx("h3",{id:"creating-spec-with-claude",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Creating a Spec with Claude"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["In the UI, select your project and click"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"Create Spec"})]}),a.jsx("li",{children:"An interactive chat with Claude helps you define your app — it asks about your app's purpose, features, and tech stack"}),a.jsx("li",{children:"The spec is generated and saved automatically"}),a.jsx("li",{children:"After creation, the initializer agent can be started immediately"})]}),a.jsx("h3",{id:"writing-spec-manually",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Writing a Spec Manually"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Create"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/prompts/app_spec.txt"})," ","in your project directory"]}),a.jsx("li",{children:"Use XML format with app name, description, tech stack, and a feature list"}),a.jsx("li",{children:"Be specific about each feature — the initializer creates test cases from these descriptions"}),a.jsxs("li",{children:["Include technical constraints where needed (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:'"use PostgreSQL"'}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:'"React with TypeScript"'}),")"]})]}),a.jsx("h3",{id:"initializer-agent",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"The Initializer Agent"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"The initializer agent is the first agent to run on a new project. It bridges the gap between your spec and the coding agents that implement features."}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Runs automatically on first agent start when no features exist in the database"}),a.jsx("li",{children:"Reads the app spec and creates features with descriptions, steps, and priorities"}),a.jsx("li",{children:'Sets up feature dependencies (e.g., "auth must be done before user profile")'}),a.jsxs("li",{children:["Creates the feature database at"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/features.db"})]})]}),a.jsx("h3",{id:"starting-after-spec",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Starting After Spec Creation"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Once your spec is ready, you can kick off the agents:"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["From the UI, click the ",a.jsx("strong",{className:"text-foreground",children:"Play"})," button to start the agent"]}),a.jsx("li",{children:"Or run from the CLI:"})]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm mt-3",children:a.jsx("pre",{children:a.jsx("code",{children:"python autonomous_agent_demo.py --project-dir your-project"})})}),a.jsx("p",{className:"text-muted-foreground mt-3",children:"The initializer runs first to create features, then coding agents take over to implement them. Progress is shown in real time on the Kanban board."})]})}function W0(){return a.jsxs("div",{children:[a.jsx("h3",{id:"autoforge-directory",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:".autoforge/ Directory Layout"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Every AutoForge project stores its configuration and runtime files in a"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/"})," ","directory at the project root."]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:`your-project/
|
|
121
|
+
├── .autoforge/
|
|
122
|
+
│ ├── features.db # SQLite feature database
|
|
123
|
+
│ ├── .agent.lock # Lock file (prevents multiple instances)
|
|
124
|
+
│ ├── .gitignore # Ignores runtime files
|
|
125
|
+
│ ├── allowed_commands.yaml # Per-project bash command allowlist
|
|
126
|
+
│ └── prompts/
|
|
127
|
+
│ ├── app_spec.txt # Application specification (XML)
|
|
128
|
+
│ ├── initializer_prompt.md # First session prompt
|
|
129
|
+
│ └── coding_prompt.md # Continuation session prompt
|
|
130
|
+
├── CLAUDE.md # Claude Code convention file
|
|
131
|
+
└── app_spec.txt # Root copy for template compatibility`})})}),a.jsx("h3",{id:"features-db",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Features Database"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["SQLite database managed by SQLAlchemy, stored at"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/features.db"})]}),a.jsxs("li",{children:["Each feature record includes: id, priority, category, name, description, steps, status (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"pending"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"in_progress"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"passing"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"failing"}),"), and dependencies"]}),a.jsx("li",{children:"Agents interact with features through MCP server tools, not direct database access"}),a.jsx("li",{children:"Viewable in the UI via the Kanban board or the Dependency Graph view"})]}),a.jsx("h3",{id:"prompts-directory",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Prompts Directory"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Prompts control how agents behave during each session:"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"app_spec.txt"})," ","— your application specification in XML format"]}),a.jsxs("li",{children:[a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"initializer_prompt.md"})," ","— prompt for the initializer agent (creates features from the spec)"]}),a.jsxs("li",{children:[a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"coding_prompt.md"})," ","— prompt for coding agents (implements features)"]})]}),a.jsxs("p",{className:"text-muted-foreground mt-3",children:["These can be customized per project. If not present, defaults from"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".claude/templates/"})," ","are used as a fallback."]}),a.jsx("h3",{id:"allowed-commands-yaml",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Allowed Commands Config"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["The optional"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/allowed_commands.yaml"})," ","file lets you grant project-specific bash commands to the agent. This is useful when your project requires tools beyond the default allowlist (e.g., language-specific compilers or custom build scripts)."]}),a.jsxs("p",{className:"text-muted-foreground",children:["See the ",a.jsx("strong",{className:"text-foreground",children:"Security"})," section for full details on the command hierarchy and how project-level commands interact with global and organization policies."]}),a.jsx("h3",{id:"claude-md",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"CLAUDE.md Convention"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"CLAUDE.md"})," ","lives at the project root, as required by the Claude Code SDK"]}),a.jsx("li",{children:"Contains project-specific instructions that the agent follows during every coding session"}),a.jsx("li",{children:"Automatically inherited by all agents working on the project — no additional configuration needed"})]}),a.jsx("h3",{id:"legacy-migration",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Legacy Layout Migration"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Older projects stored configuration files directly at the project root (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"features.db"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"prompts/"}),")."]}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["On the next agent start, these files are automatically migrated into"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/"})]}),a.jsx("li",{children:"Dual-path resolution ensures both old and new layouts work transparently"}),a.jsx("li",{children:"No manual migration is needed — it happens seamlessly"})]}),a.jsx("h3",{id:"claude-inheritance",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Claude Inheritance"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Agents inherit all MCP servers, tools, skills, custom commands, and"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"CLAUDE.md"})," ","from the target project folder."]}),a.jsx("div",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground",children:"If your project has its own MCP servers or Claude commands, the coding agent can use them. The agent essentially runs as if Claude Code was opened in your project directory."})]})}function I0(){return a.jsxs("div",{children:[a.jsx("h3",{id:"kanban-overview",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Kanban Board Overview"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"The main view organizes features into three columns representing their current status:"}),a.jsxs("table",{className:"w-full text-sm mt-3 mb-4",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Column"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Color"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Meaning"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Pending"}),a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:"Yellow"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Waiting to be picked up"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"In Progress"}),a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"outline",className:"border-cyan-500 text-cyan-600",children:"Cyan"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"An agent is actively working on it"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Done"}),a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"outline",className:"border-green-500 text-green-600",children:"Green"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Implemented and passing"})]})]})]}),a.jsx("p",{className:"text-muted-foreground",children:"Each feature appears as a card showing its name, priority, and category. The board updates in real time as agents work."}),a.jsx("h3",{id:"feature-cards",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Feature Cards"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Each card displays a priority badge (",a.jsx(ie,{variant:"secondary",children:"P1"})," through"," ",a.jsx(ie,{variant:"secondary",children:"P5"}),"), a category tag, and the feature name"]}),a.jsx("li",{children:"Status icons indicate the current state of the feature"}),a.jsx("li",{children:"Click a card to open the detail modal with the full description and test steps"}),a.jsx("li",{children:'Cards in the "In Progress" column show which agent is currently working on them'})]}),a.jsx("h3",{id:"dependency-graph",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Dependency Graph View"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"An alternative to the Kanban board that visualizes feature relationships as a directed graph."}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"G"})," to toggle between Kanban and Graph view"]}),a.jsx("li",{children:"Uses the dagre layout engine for automatic node positioning"}),a.jsx("li",{children:"Nodes are colored by status — pending, in-progress, and done each have distinct colors"}),a.jsx("li",{children:"Arrows show dependency relationships between features"}),a.jsx("li",{children:"Click any node to open the feature detail modal"}),a.jsx("li",{children:"Supports both horizontal and vertical layout orientations"})]}),a.jsx("h3",{id:"adding-features",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Adding Features"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"N"})," to open the Add Feature form"]}),a.jsx("li",{children:"Fill in: name, description, category, and priority"}),a.jsx("li",{children:"Optionally define steps (test criteria the agent must pass to complete the feature)"}),a.jsx("li",{children:"New features are added to the Pending column immediately"})]}),a.jsx("h3",{id:"editing-features",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Editing & Deleting Features"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Click a feature card to open the detail modal"}),a.jsxs("li",{children:["Click ",a.jsx("strong",{className:"text-foreground",children:"Edit"})," to modify the name, description, category, priority, or steps"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Delete"})," removes the feature permanently"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Skip"})," moves a feature to the end of the queue without deleting it"]})]}),a.jsx("h3",{id:"feature-dependencies",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Feature Dependencies"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Features can declare dependencies on other features, ensuring they are implemented in the correct order."}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Set dependencies in the feature edit modal"}),a.jsx("li",{children:"Cycle detection prevents circular dependencies (uses Kahn's algorithm combined with DFS)"}),a.jsx("li",{children:"Blocked features display a lock icon and cannot be claimed by agents until their dependencies are met"}),a.jsx("li",{children:"The Dependency Graph view makes these relationships easy to visualize"})]}),a.jsx("h3",{id:"expanding-with-ai",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Expanding Project with AI"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"E"})," to open the Expand Project modal"]}),a.jsx("li",{children:"Chat with Claude to describe the new features you want to add"}),a.jsx("li",{children:"Supports image attachments for UI mockups or design references"}),a.jsx("li",{children:"Claude creates properly structured features with appropriate dependencies"}),a.jsx("li",{children:"New features appear on the board immediately after creation"})]}),a.jsx("h3",{id:"feature-priority",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Priority & Ordering"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Features are ordered by priority: ",a.jsx(ie,{variant:"secondary",children:"P1"})," is the highest and ",a.jsx(ie,{variant:"secondary",children:"P5"})," is the lowest"]}),a.jsx("li",{children:"Within the same priority level, features are ordered by creation time"}),a.jsx("li",{children:"Agents always pick up the highest-priority ready feature first"})]})]})}function P0(){return a.jsxs("div",{children:[a.jsx("h3",{id:"maestro-orchestrator",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Maestro: The Orchestrator"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Maestro is the central orchestrator that coordinates all agents. It acts as the conductor, ensuring features are implemented efficiently and in the correct order."}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Manages the full lifecycle of coding and testing agents"}),a.jsx("li",{children:"Schedules which features to work on based on dependencies and priority"}),a.jsx("li",{children:"Monitors agent health and restarts crashed agents automatically"}),a.jsx("li",{children:"Reports status to the UI in real time via WebSocket"})]}),a.jsx("h3",{id:"coding-agents",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Coding Agents"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Implement features one at a time, or in batches of 1–3"}),a.jsxs("li",{children:["Claim features atomically via the"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"feature_claim_and_get"})," ","MCP tool — no two agents work on the same feature"]}),a.jsx("li",{children:"Run in isolated environments with their own browser context"}),a.jsxs("li",{children:["Use the Claude Code SDK with project-specific tools and"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"CLAUDE.md"})]})]}),a.jsx("h3",{id:"testing-agents",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Testing Agents"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Run regression tests after features are implemented"}),a.jsx("li",{children:"Verify that new code does not break existing features"}),a.jsx("li",{children:"Configurable ratio: 0–3 testing agents per coding agent"}),a.jsx("li",{children:"Can batch-test multiple features per session (1–5)"})]}),a.jsx("h3",{id:"agent-lifecycle",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Agent Lifecycle"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Agents are controlled through the UI or CLI. The lifecycle states are:"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Action"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Behavior"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Start"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Click the Play button or run the CLI command"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Stop"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Gracefully terminates all running agents"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Pause"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Temporarily halts work (agents finish their current task first)"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2 font-medium",children:"Resume"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Continues from where the agents were paused"})]})]})]}),a.jsx("p",{className:"text-muted-foreground mt-3",children:"Agents auto-continue between sessions with a 3-second delay, so they keep working until all features are complete or they are explicitly stopped."}),a.jsx("h3",{id:"concurrency",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Concurrency Control"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"A slider in the agent control bar sets the number of concurrent coding agents (1–5)"}),a.jsx("li",{children:"More agents means faster progress, but also higher API usage"}),a.jsx("li",{children:"Each agent runs as an independent subprocess"}),a.jsx("li",{children:"Feature claiming is atomic — no two agents will ever work on the same feature simultaneously"})]}),a.jsx("h3",{id:"mission-control",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Agent Mission Control"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"The Mission Control dashboard provides a real-time overview of all active agents:"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Active agent cards with mascot icons and current status"}),a.jsx("li",{children:"The feature each agent is currently working on"}),a.jsx("li",{children:"Agent state indicators (thinking, working, testing, etc.)"}),a.jsx("li",{children:"Orchestrator status and a recent activity feed"})]}),a.jsx("h3",{id:"agent-mascots",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Agent Mascots & States"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Each agent is assigned a unique mascot for easy identification:"," ",a.jsx("strong",{className:"text-foreground",children:"Spark"}),","," ",a.jsx("strong",{className:"text-foreground",children:"Fizz"}),","," ",a.jsx("strong",{className:"text-foreground",children:"Octo"}),","," ",a.jsx("strong",{className:"text-foreground",children:"Hoot"}),","," ",a.jsx("strong",{className:"text-foreground",children:"Buzz"}),", and more. Agent states include:"]}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"State"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Animation"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Description"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"secondary",children:"Thinking"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Bouncing"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Agent is planning its approach"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"secondary",children:"Working"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Shake"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Actively writing code"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"secondary",children:"Testing"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Rotating"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Running tests"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"default",children:"Success"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Celebration"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Feature completed"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"destructive",children:"Error"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Red shake"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Encountered an issue"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"outline",children:"Struggling"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Concerned expression"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Multiple consecutive failures"})]})]})]}),a.jsx("h3",{id:"agent-logs",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Viewing Agent Logs"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Click any agent card in Mission Control to see its log output"}),a.jsx("li",{children:"Logs are color-coded by level (info, warning, error)"}),a.jsx("li",{children:"Output streams in real time via WebSocket"}),a.jsx("li",{children:"Each agent's logs are isolated and filterable"})]}),a.jsx("h3",{id:"process-limits",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Process Limits"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"The orchestrator enforces strict bounds on concurrent processes to prevent resource exhaustion:"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Limit"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Value"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"MAX_PARALLEL_AGENTS"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"5 (maximum concurrent coding agents)"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"MAX_TOTAL_AGENTS"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"10 (hard limit on coding + testing combined)"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Testing agents"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Capped at the same count as coding agents"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Total Python processes"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Never exceeds 11 (1 orchestrator + 5 coding + 5 testing)"})]})]})]})]})}function ev(){return a.jsxs("div",{children:[a.jsx("h3",{id:"opening-settings",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Opening Settings"}),a.jsxs("p",{className:"text-muted-foreground mb-4",children:["Press the ",a.jsx(ie,{variant:"secondary",children:","})," (comma) key or click the gear icon in the header bar to open the Settings modal. Settings are global and apply to all projects."]}),a.jsx("h3",{id:"yolo-mode",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"YOLO Mode"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"YOLO mode is for rapid prototyping — it skips testing for faster iteration:"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"What’s skipped:"})," Regression testing, Playwright MCP server (browser automation disabled)"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"What still runs:"})," Lint and type-check (to verify code compiles), Feature MCP server for tracking"]}),a.jsxs("li",{children:["Toggle via the lightning bolt button in the UI or the"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"--yolo"})," CLI flag"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"When to use:"})," Early prototyping when you want to scaffold features quickly without verification overhead"]}),a.jsx("li",{children:"Switch back to standard mode for production-quality development"})]}),a.jsx("h3",{id:"headless-browser",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Headless Browser"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"When enabled, Playwright runs without a visible browser window"}),a.jsx("li",{children:"Saves CPU/GPU resources on machines running multiple agents"}),a.jsx("li",{children:"Tests still run fully — just no visible browser UI"}),a.jsx("li",{children:"Toggle in settings or via the UI button"})]}),a.jsx("h3",{id:"model-selection",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Model Selection"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Choose which Claude model tier to use for your agents:"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Tier"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Characteristics"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"default",children:"Opus"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Most capable, highest quality"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"secondary",children:"Sonnet"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Balanced speed and quality"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"outline",children:"Haiku"})}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Fastest, most economical"})]})]})]}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground mt-4",children:[a.jsx("li",{children:"Model can be set globally in settings"}),a.jsx("li",{children:"Per-schedule model override is also available"}),a.jsxs("li",{children:["When using Vertex AI, model names use"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"@"})," instead of"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"-"})," (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"claude-opus-4-5@20251101"}),")"]})]}),a.jsx("h3",{id:"regression-agents",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Regression Agents"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Controls how many testing agents run alongside coding agents (0–3):"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"0:"})," No regression testing (like YOLO but coding agents still test their own feature)"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"1:"})," One testing agent runs in background verifying completed features"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"2–3:"})," Multiple testing agents for thorough verification"]}),a.jsx("li",{children:"Testing agents batch-test 1–5 features per session"})]}),a.jsx("h3",{id:"features-per-agent",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Features per Agent (Batch Size)"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Controls how many features each coding agent implements per session (1–3):"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"1:"})," One feature per session (most focused, lower risk of conflicts)"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"2–3:"})," Multiple features per session (more efficient, fewer session startups)"]}),a.jsxs("li",{children:["Set via settings UI or the"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"--batch-size"})," CLI flag"]}),a.jsxs("li",{children:["Can also target specific features:"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"--batch-features 1,2,3"})]})]}),a.jsx("h3",{id:"concurrency-setting",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Concurrency"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Per-project default concurrency saved in project settings"}),a.jsx("li",{children:"Override at runtime with the concurrency slider in agent controls"}),a.jsxs("li",{children:["Range: ",a.jsx(ie,{variant:"secondary",children:"1–5"})," concurrent coding agents"]}),a.jsx("li",{children:"Higher concurrency = faster progress but more API cost"})]}),a.jsx("h3",{id:"settings-persistence",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"How Settings are Persisted"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Global settings stored in SQLite registry at"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/registry.db"})]}),a.jsx("li",{children:"Per-project settings (like default concurrency) stored in the project registry entry"}),a.jsx("li",{children:"UI settings (theme, dark mode) stored in browser localStorage"}),a.jsx("li",{children:"Settings survive app restarts and are shared across UI sessions"})]})]})}function tv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"debug-panel",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Debug Panel"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"D"})," to toggle the debug panel at the bottom of the screen"]}),a.jsx("li",{children:"Resizable by dragging the top edge"}),a.jsxs("li",{children:["Three tabs: ",a.jsx("strong",{className:"text-foreground",children:"Agent Logs"}),","," ",a.jsx("strong",{className:"text-foreground",children:"Dev Server Logs"}),", and"," ",a.jsx("strong",{className:"text-foreground",children:"Terminal"})]}),a.jsx("li",{children:"Shows real-time output from agents and dev server"})]}),a.jsx("h3",{id:"agent-logs-tab",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Agent Logs Tab"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Color-coded log levels:"," ",a.jsx("span",{className:"text-[var(--color-log-error)] font-medium",children:"Error"}),","," ",a.jsx("span",{className:"text-[var(--color-log-warning)] font-medium",children:"Warning"}),","," ",a.jsx("span",{className:"text-[var(--color-log-info)] font-medium",children:"Info"}),","," ",a.jsx("span",{className:"text-[var(--color-log-debug)] font-medium",children:"Debug"}),","," ",a.jsx("span",{className:"text-[var(--color-log-success)] font-medium",children:"Success"})]}),a.jsx("li",{children:"Timestamps on each log entry"}),a.jsx("li",{children:"Auto-scrolls to latest entry"}),a.jsx("li",{children:"Clear button to reset log view"})]}),a.jsx("h3",{id:"dev-server-logs",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Dev Server Logs Tab"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Shows stdout/stderr from the project’s dev server (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"npm run dev"}),")"]}),a.jsx("li",{children:"Useful for seeing compilation errors, hot reload status"}),a.jsx("li",{children:"Clear button available"})]}),a.jsx("h3",{id:"terminal",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Terminal"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"T"})," to open terminal (opens debug panel on the terminal tab)"]}),a.jsx("li",{children:"Full xterm.js terminal emulator with WebSocket backend"}),a.jsx("li",{children:"Multi-tab support: create multiple terminal sessions"}),a.jsx("li",{children:"Rename tabs by double-clicking the tab title"}),a.jsx("li",{children:"Each tab runs an independent PTY (pseudo-terminal) session"}),a.jsx("li",{children:"Supports standard terminal features: colors, cursor movement, history"})]}),a.jsx("h3",{id:"dev-server-control",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Dev Server Control"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Start/stop button in the header bar"}),a.jsx("li",{children:"Auto-detects project type (Next.js, Vite, CRA, etc.) and runs the appropriate dev command"}),a.jsx("li",{children:"Shows the dev server URL when running"}),a.jsx("li",{children:"Automatic crash detection and restart option"}),a.jsx("li",{children:"Dev server output piped to the Dev Server Logs tab"})]}),a.jsx("h3",{id:"per-agent-logs",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Per-Agent Logs"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"In Agent Mission Control, click any agent card to see its individual logs"}),a.jsx("li",{children:"Logs include: what feature the agent is working on, code changes, test results"}),a.jsx("li",{children:"Separate logs for coding agents and testing agents"}),a.jsx("li",{children:"Real-time streaming — see agent output as it happens"})]})]})}function av(){return a.jsxs("div",{children:[a.jsx("h3",{id:"what-is-assistant",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What is the Assistant?"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"The AI Assistant is a read-only project helper that can answer questions about your project, search code, view progress, and help you understand what’s happening — without making any changes."}),a.jsx("h3",{id:"opening-assistant",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Opening the Assistant"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Press ",a.jsx(ie,{variant:"secondary",children:"A"})," to toggle the assistant panel"]}),a.jsx("li",{children:"Or click the floating action button (chat bubble) in the bottom-right corner"}),a.jsx("li",{children:"The panel slides in from the right side"})]}),a.jsx("h3",{id:"assistant-capabilities",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What It Can Do"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Read and search your project’s source code"}),a.jsx("li",{children:"Answer questions about code architecture and implementation"}),a.jsx("li",{children:"View feature progress and status"}),a.jsx("li",{children:"Create new features based on your description"}),a.jsx("li",{children:"Explain what agents have done or are currently doing"}),a.jsx("li",{children:"Help debug issues by analyzing code and logs"})]}),a.jsx("h3",{id:"assistant-limitations",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What It Cannot Do"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Modify files (read-only access)"}),a.jsx("li",{children:"Run bash commands"}),a.jsx("li",{children:"Mark features as passing/failing"}),a.jsx("li",{children:"Start or stop agents"}),a.jsx("li",{children:"Access external APIs or the internet"})]}),a.jsx("div",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground mt-4",children:"This is a deliberate security design — the assistant is a safe way to interact with your project without risk of unintended changes."}),a.jsx("h3",{id:"conversation-history",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Conversation History"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Conversations are stored per-project in SQLite database"}),a.jsx("li",{children:"Multiple conversations supported — start new ones as needed"}),a.jsx("li",{children:"Switch between conversations using the conversation selector"}),a.jsx("li",{children:"History persists across browser sessions"})]})]})}function nv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"what-scheduling-does",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"What Scheduling Does"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Scheduling automates agent runs at specific times. Set up a schedule and AutoForge will automatically start agents on your project — useful for overnight builds, periodic maintenance, or continuous development."}),a.jsx("h3",{id:"creating-schedule",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Creating a Schedule"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Click the clock icon in the header to open the Schedule modal"}),a.jsx("li",{children:"Set: start time, duration (how long agents run), days of the week"}),a.jsx("li",{children:"Optionally configure: YOLO mode, concurrency, model selection"}),a.jsx("li",{children:"Schedule is saved and starts at the next matching time"})]}),a.jsx("h3",{id:"schedule-settings",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Schedule Settings"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Each schedule can override global settings:"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Setting"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Details"})]})}),a.jsxs("tbody",{className:"text-muted-foreground",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"YOLO mode"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"On/off per schedule"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Concurrency"}),a.jsxs("td",{className:"border border-border px-3 py-2",children:[a.jsx(ie,{variant:"secondary",children:"1–5"})," agents"]})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Model tier"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"Opus / Sonnet / Haiku"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:"Duration"}),a.jsx("td",{className:"border border-border px-3 py-2",children:"How long the session runs before auto-stopping"})]})]})]}),a.jsx("div",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground mt-4",children:"All schedule times are in UTC timezone."}),a.jsx("h3",{id:"schedule-overrides",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Schedule Overrides"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Manually skip a scheduled run (one-time override)"}),a.jsx("li",{children:"Pause a schedule temporarily (resumes on next period)"}),a.jsxs("li",{children:["View upcoming runs with"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"Running until"})," /"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"Next run"})," indicators"]}),a.jsx("li",{children:"Override without deleting the schedule"})]}),a.jsx("h3",{id:"crash-recovery",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Crash Recovery"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"If a scheduled agent crashes, it uses exponential backoff for retries"}),a.jsxs("li",{children:["Maximum ",a.jsx(ie,{variant:"secondary",children:"3"})," retry attempts per scheduled run"]}),a.jsx("li",{children:"Backoff prevents rapid restart loops"}),a.jsx("li",{children:"Failed runs are logged for troubleshooting"})]})]})}const sv=[{name:"Twitter",description:"Clean, modern blue design. Primary: blue, Background: white/dark gray.",colors:[{label:"Background",hex:"#ffffff"},{label:"Primary",hex:"#4a9eff"},{label:"Accent",hex:"#e8f4ff"}]},{name:"Claude",description:"Warm beige/cream tones with orange accents. Inspired by Anthropic's Claude brand.",colors:[{label:"Background",hex:"#faf6f0"},{label:"Primary",hex:"#c75b2a"},{label:"Accent",hex:"#f5ede4"}]},{name:"Neo Brutalism",description:"Bold colors, hard shadows, no border radius. High contrast, expressive design.",colors:[{label:"Background",hex:"#ffffff"},{label:"Primary",hex:"#ff4d00"},{label:"Accent",hex:"#ffeb00"}]},{name:"Retro Arcade",description:"Vibrant pink and teal with pixel-art inspired styling.",colors:[{label:"Background",hex:"#f0e6d3"},{label:"Primary",hex:"#e8457c"},{label:"Accent",hex:"#4eb8a5"}]},{name:"Aurora",description:"Deep violet and luminous teal, inspired by the northern lights.",colors:[{label:"Background",hex:"#faf8ff"},{label:"Primary",hex:"#8b5cf6"},{label:"Accent",hex:"#2dd4bf"}]},{name:"Business",description:"Professional deep navy and gray monochrome palette for corporate use.",colors:[{label:"Background",hex:"#eaecef"},{label:"Primary",hex:"#000e4e"},{label:"Accent",hex:"#6b7280"}]}],lv=[{key:"?",action:"Show keyboard shortcuts help"},{key:"D",action:"Toggle debug panel"},{key:"T",action:"Toggle terminal"},{key:"G",action:"Toggle Kanban/Graph view"},{key:"N",action:"Add new feature"},{key:"E",action:"Expand project with AI"},{key:"A",action:"Toggle AI assistant"},{key:",",action:"Open settings"},{key:"R",action:"Reset project"},{key:"Escape",action:"Close current modal"}];function iv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"themes-overview",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Themes Overview"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"AutoForge comes with 6 built-in themes. Each theme provides a complete visual identity including colors, accents, and dark mode variants."}),a.jsx("div",{className:"space-y-4",children:sv.map(i=>a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex gap-1.5 shrink-0 mt-1",children:i.colors.map(c=>a.jsx("div",{title:`${c.label}: ${c.hex}`,className:"w-6 h-6 rounded border border-border",style:{backgroundColor:c.hex}},c.label))}),a.jsxs("div",{children:[a.jsx("strong",{className:"text-foreground",children:i.name}),i.name==="Twitter"&&a.jsxs(a.Fragment,{children:[" ",a.jsx(ie,{variant:"secondary",children:"Default"})]}),a.jsxs("span",{className:"text-muted-foreground",children:[" — ",i.description]})]})]},i.name))}),a.jsx("h3",{id:"dark-light-mode",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Dark & Light Mode"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Toggle with the sun/moon icon in the header"}),a.jsx("li",{children:"All 6 themes have dedicated dark mode variants"}),a.jsxs("li",{children:["Preference is saved in browser"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"localStorage"})]}),a.jsx("li",{children:"Dark mode affects all UI elements including the docs page"})]}),a.jsx("h3",{id:"theme-selector",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Theme Selector"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Hover over the palette icon in the header to open the theme dropdown"}),a.jsx("li",{children:"Preview themes by hovering over each option (live preview)"}),a.jsx("li",{children:"Click to select — the change is applied instantly"}),a.jsx("li",{children:"Theme preference persists across sessions"})]}),a.jsx("h3",{id:"keyboard-shortcuts",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Keyboard Shortcuts"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Press ",a.jsx(ie,{variant:"secondary",children:"?"})," anywhere in the UI to see the shortcuts help overlay."]}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Key"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Action"})]})}),a.jsx("tbody",{className:"text-muted-foreground",children:lv.map(i=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx(ie,{variant:"secondary",children:i.key})}),a.jsx("td",{className:"border border-border px-3 py-2",children:i.action})]},i.key))})]})]})}function rv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"command-validation",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Command Validation Overview"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"AutoForge uses a defense-in-depth approach for security. All three layers must pass before any command is executed:"}),a.jsxs("ol",{className:"list-decimal space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"OS-level sandbox"})," — bash commands run inside a restricted sandbox environment"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Filesystem restriction"})," — agents can only access the project directory (plus configured extra read paths)"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Hierarchical allowlist"})," — every bash command is validated against a multi-level allowlist system"]})]}),a.jsx("h3",{id:"command-hierarchy",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Command Hierarchy"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Commands are evaluated against a 5-level hierarchy, from highest to lowest priority:"}),a.jsxs("ol",{className:"list-decimal space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Hardcoded Blocklist"})," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"security.py"})," ","— NEVER allowed, cannot be overridden"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Org Blocklist"})," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/config.yaml"})," ","— org-wide blocks, cannot be project-overridden"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Org Allowlist"})," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/config.yaml"})," ","— available to all projects"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Global Allowlist"})," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"security.py"})," ","— default commands (npm, git, curl, etc.)"]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-foreground",children:"Project Allowlist"})," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/allowed_commands.yaml"})," ","— project-specific additions"]})]}),a.jsx("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground mt-4",children:"Higher priority levels always win. A command blocked at level 1 or 2 can never be allowed by lower levels."}),a.jsx("h3",{id:"hardcoded-blocklist",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Hardcoded Blocklist"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["The following commands can ",a.jsx("strong",{className:"text-foreground",children:"never"})," be allowed, regardless of any configuration. They are hardcoded in"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"security.py"})," and cannot be overridden:"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:["dd","sudo","su","shutdown","reboot","poweroff","mkfs","fdisk","mount","umount","systemctl"].map(i=>a.jsx(ie,{variant:"destructive",children:i},i))}),a.jsx("h3",{id:"global-allowlist",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Global Allowlist"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Default commands available to all projects out of the box. These are the standard development commands needed for most projects:"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:["npm","npx","node","git","curl","python","pip","cat","ls","mkdir","cp","mv","rm","grep","find"].map(i=>a.jsx(ie,{variant:"secondary",children:i},i))}),a.jsx("h3",{id:"project-allowlist",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Per-Project Allowed Commands"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Each project can define additional allowed commands in"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/allowed_commands.yaml"}),":"]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:`# .autoforge/allowed_commands.yaml
|
|
132
|
+
version: 1
|
|
133
|
+
commands:
|
|
134
|
+
# Exact command name
|
|
135
|
+
- name: swift
|
|
136
|
+
description: Swift compiler
|
|
137
|
+
|
|
138
|
+
# Wildcard - matches swiftc, swiftlint, swiftformat
|
|
139
|
+
- name: swift*
|
|
140
|
+
description: All Swift tools (wildcard)
|
|
141
|
+
|
|
142
|
+
# Local project scripts
|
|
143
|
+
- name: ./scripts/build.sh
|
|
144
|
+
description: Project build script`})})}),a.jsxs("p",{className:"text-muted-foreground mt-3",children:[a.jsx("strong",{className:"text-foreground",children:"Pattern matching:"})," exact match (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"swift"}),"), wildcard (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"swift*"})," matches swiftc, swiftlint, etc.), and scripts (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"./scripts/build.sh"}),"). Limit: 100 commands per project."]}),a.jsx("h3",{id:"org-config",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Organization Configuration"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["System administrators can set org-wide policies in"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/config.yaml"}),":"]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:`# ~/.autoforge/config.yaml
|
|
145
|
+
version: 1
|
|
146
|
+
|
|
147
|
+
# Commands available to ALL projects
|
|
148
|
+
allowed_commands:
|
|
149
|
+
- name: jq
|
|
150
|
+
description: JSON processor
|
|
151
|
+
|
|
152
|
+
# Commands blocked across ALL projects (cannot be overridden)
|
|
153
|
+
blocked_commands:
|
|
154
|
+
- aws # Prevent accidental cloud operations
|
|
155
|
+
- kubectl # Block production deployments`})})}),a.jsx("p",{className:"text-muted-foreground mt-3",children:"Org-level blocked commands cannot be overridden by any project configuration."}),a.jsx("h3",{id:"extra-read-paths",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Extra Read Paths"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Allow agents to read files from directories outside the project folder via the"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"EXTRA_READ_PATHS"})," ","environment variable:"]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm",children:a.jsx("pre",{children:a.jsx("code",{children:"EXTRA_READ_PATHS=/path/to/docs,/path/to/shared-libs"})})}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground mt-3",children:[a.jsx("li",{children:"Must be absolute paths and must exist as directories"}),a.jsx("li",{children:"Only read operations allowed (Read, Glob, Grep — no Write/Edit)"}),a.jsxs("li",{children:["Sensitive directories are always blocked:"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".ssh"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".aws"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".gnupg"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".docker"}),","," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".kube"}),", etc."]})]}),a.jsx("h3",{id:"filesystem-sandboxing",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Filesystem Sandboxing"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"Agents can only write to the project directory"}),a.jsx("li",{children:"Read access is limited to the project directory plus configured extra read paths"}),a.jsxs("li",{children:["Path traversal attacks are prevented via canonicalization (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"Path.resolve()"}),")"]}),a.jsx("li",{children:"File operations are validated before execution"})]})]})}const cv=[{name:"CLAUDE_CODE_USE_VERTEX",description:"Enable Vertex AI (1)"},{name:"CLOUD_ML_REGION",description:"GCP region"},{name:"ANTHROPIC_VERTEX_PROJECT_ID",description:"GCP project ID"},{name:"ANTHROPIC_BASE_URL",description:"Custom API base URL (for Ollama)"},{name:"ANTHROPIC_AUTH_TOKEN",description:"API auth token"},{name:"API_TIMEOUT_MS",description:"API timeout in milliseconds"},{name:"EXTRA_READ_PATHS",description:"Comma-separated extra read directories"},{name:"ANTHROPIC_DEFAULT_OPUS_MODEL",description:"Override Opus model name"},{name:"ANTHROPIC_DEFAULT_SONNET_MODEL",description:"Override Sonnet model name"},{name:"ANTHROPIC_DEFAULT_HAIKU_MODEL",description:"Override Haiku model name"}],ov=[{name:"--project-dir",description:"Project directory path or registered name"},{name:"--yolo",description:"Enable YOLO mode"},{name:"--parallel",description:"Enable parallel mode"},{name:"--max-concurrency N",description:"Max concurrent agents (1-5)"},{name:"--batch-size N",description:"Features per coding agent (1-3)"},{name:"--batch-features 1,2,3",description:"Specific feature IDs to implement"},{name:"--testing-batch-size N",description:"Features per testing batch (1-5)"},{name:"--testing-batch-features 1,2,3",description:"Specific testing feature IDs"}];function uv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"vertex-ai",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Vertex AI Setup"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Run coding agents via Google Cloud Vertex AI:"}),a.jsxs("ol",{className:"list-decimal space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Install and authenticate the gcloud CLI:"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"gcloud auth application-default login"})]}),a.jsxs("li",{children:["Configure your"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".env"})," file:"]})]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm mt-3",children:a.jsx("pre",{children:a.jsx("code",{children:`CLAUDE_CODE_USE_VERTEX=1
|
|
156
|
+
CLOUD_ML_REGION=us-east5
|
|
157
|
+
ANTHROPIC_VERTEX_PROJECT_ID=your-gcp-project-id
|
|
158
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-5@20251101
|
|
159
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5@20250929
|
|
160
|
+
ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-3-5-haiku@20241022`})})}),a.jsxs("blockquote",{className:"border-l-4 border-primary pl-4 italic text-muted-foreground mt-4",children:["Use ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono not-italic",children:"@"})," ","instead of ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono not-italic",children:"-"})," ","in model names for Vertex AI."]}),a.jsx("h3",{id:"ollama",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Ollama Local Models"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Run coding agents using local models via Ollama v0.14.0+:"}),a.jsxs("ol",{className:"list-decimal space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["Install Ollama from"," ",a.jsx("a",{href:"https://ollama.com",target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"ollama.com"})]}),a.jsxs("li",{children:["Start Ollama:"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"ollama serve"})]}),a.jsxs("li",{children:["Pull a coding model:"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"ollama pull qwen3-coder"})]}),a.jsxs("li",{children:["Configure your"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".env"}),":"]})]}),a.jsx("div",{className:"bg-muted rounded-lg p-4 font-mono text-sm mt-3",children:a.jsx("pre",{children:a.jsx("code",{children:`ANTHROPIC_BASE_URL=http://localhost:11434
|
|
161
|
+
ANTHROPIC_AUTH_TOKEN=ollama
|
|
162
|
+
API_TIMEOUT_MS=3000000
|
|
163
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3-coder`})})}),a.jsxs("p",{className:"text-muted-foreground mt-3",children:[a.jsx("strong",{className:"text-foreground",children:"Recommended models:"})," ",a.jsx(ie,{variant:"secondary",children:"qwen3-coder"})," ",a.jsx(ie,{variant:"secondary",children:"deepseek-coder-v2"})," ",a.jsx(ie,{variant:"secondary",children:"codellama"})]}),a.jsxs("p",{className:"text-muted-foreground mt-2",children:[a.jsx("strong",{className:"text-foreground",children:"Limitations:"})," Smaller context windows than Claude (model-dependent), extended context beta disabled (not supported by Ollama), and performance depends on local hardware (GPU recommended)."]}),a.jsx("h3",{id:"env-variables",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Environment Variables"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Key environment variables for configuring AutoForge:"}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Variable"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Description"})]})}),a.jsx("tbody",{className:"text-muted-foreground",children:cv.map(i=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:i.name})}),a.jsx("td",{className:"border border-border px-3 py-2",children:i.description})]},i.name))})]}),a.jsx("h3",{id:"cli-arguments",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"CLI Arguments"}),a.jsxs("p",{className:"text-muted-foreground mb-3",children:["Command-line arguments for"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"autonomous_agent_demo.py"}),":"]}),a.jsxs("table",{className:"w-full text-sm mt-3",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-muted/50",children:[a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Argument"}),a.jsx("th",{className:"border border-border px-3 py-2 text-left font-medium text-foreground",children:"Description"})]})}),a.jsx("tbody",{className:"text-muted-foreground",children:ov.map(i=>a.jsxs("tr",{children:[a.jsx("td",{className:"border border-border px-3 py-2",children:a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:i.name})}),a.jsx("td",{className:"border border-border px-3 py-2",children:i.description})]},i.name))})]}),a.jsx("h3",{id:"webhooks",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Webhook Support"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsx("li",{children:"AutoForge can send webhook notifications on feature completion"}),a.jsx("li",{children:"Compatible with N8N and similar automation tools"}),a.jsx("li",{children:"Configure the webhook URL in project settings"}),a.jsx("li",{children:"Payload includes: feature name, status, and project info"})]}),a.jsx("h3",{id:"project-registry",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Project Registry"}),a.jsxs("ul",{className:"list-disc space-y-2 ml-4 text-muted-foreground",children:[a.jsxs("li",{children:["All projects are registered in"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"~/.autoforge/registry.db"})," ","(SQLite)"]}),a.jsx("li",{children:"Maps project names to filesystem paths"}),a.jsx("li",{children:"Uses POSIX path format (forward slashes) for cross-platform compatibility"}),a.jsx("li",{children:"SQLAlchemy ORM with SQLite's built-in transaction handling"})]})]})}function dv(){return a.jsxs("div",{children:[a.jsx("h3",{id:"faq-new-project",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Starting a New Project"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I use AutoForge on a new project?"}),a.jsx("p",{className:"text-muted-foreground",children:'From the UI, select "Create New Project" in the project dropdown. Choose a folder and name. Then create an app spec using the interactive chat or write one manually. Click Start to run the initializer agent, which creates features from your spec. Coding agents then implement features automatically.'}),a.jsx("h3",{id:"faq-existing-project",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Adding to Existing Project"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I add AutoForge to an existing project?"}),a.jsxs("p",{className:"text-muted-foreground",children:['Register the project folder through the UI project selector using "Add Existing". AutoForge creates a'," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/"})," directory alongside your existing code. Write an app spec describing what to build (new features), and the agent works within your existing codebase."]}),a.jsx("h3",{id:"faq-agent-crash",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Agent Crashes"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"What happens if an agent crashes?"}),a.jsx("p",{className:"text-muted-foreground",children:"The orchestrator (Maestro) automatically detects crashed agents and can restart them. Features claimed by a crashed agent are released back to the pending queue. Scheduled runs use exponential backoff with up to 3 retries. Check the agent logs in the debug panel for crash details."}),a.jsx("h3",{id:"faq-custom-commands",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Custom Bash Commands"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I customize which bash commands the agent can use?"}),a.jsxs("p",{className:"text-muted-foreground",children:["Create"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".autoforge/allowed_commands.yaml"})," ","in your project with a list of allowed commands. Supports exact names, wildcards (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"swift*"}),"), and local scripts. See the Security section for full details on the command hierarchy."]}),a.jsx("h3",{id:"faq-blocked-features",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Blocked Features"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:'Why are my features stuck in "blocked" status?'}),a.jsxs("p",{className:"text-muted-foreground",children:["Features with unmet dependencies show as blocked. Check the Dependency Graph view (press"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"G"}),') to see which features are waiting on others. A feature can only start when all its dependencies are marked as "passing". Remove or reorder dependencies if needed.']}),a.jsx("h3",{id:"faq-parallel",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Running in Parallel"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I run multiple agents in parallel?"}),a.jsxs("p",{className:"text-muted-foreground",children:["Use the concurrency slider in the agent control bar (1–5 agents) or pass"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"--parallel --max-concurrency N"})," ","on the CLI. Each agent claims features atomically, so there is no conflict. More agents means faster progress but higher API cost."]}),a.jsx("h3",{id:"faq-local-model",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Using Local Models"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"Can I use a local model instead of the Claude API?"}),a.jsxs("p",{className:"text-muted-foreground",children:["Yes, via Ollama v0.14.0+. Install Ollama, pull a coding model (e.g.,"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"qwen3-coder"}),"), and configure your"," ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:".env"})," to point to localhost. See the Advanced Configuration section for full setup instructions."]}),a.jsx("h3",{id:"faq-reset",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Resetting a Project"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I reset a project and start over?"}),a.jsxs("p",{className:"text-muted-foreground",children:["Press ",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"R"}),' (when agents are stopped) to open the Reset modal. Choose between: "Reset Features" (clears the feature database, keeps the spec) or "Full Reset" (removes the spec too, starts fresh). After a full reset, you will be prompted to create a new spec.']}),a.jsx("h3",{id:"faq-agent-types",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Coding vs Testing Agents"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"What's the difference between coding and testing agents?"}),a.jsx("p",{className:"text-muted-foreground",children:"Coding agents implement features — they write code, create files, and run feature-specific tests. Testing agents run regression tests across completed features to ensure new code does not break existing functionality. Configure the testing agent ratio (0–3) in settings."}),a.jsx("h3",{id:"faq-real-time",className:"text-lg font-semibold text-foreground mt-8 mb-3",children:"Monitoring in Real Time"}),a.jsx("p",{className:"text-muted-foreground italic mb-2",children:"How do I view what an agent is doing in real time?"}),a.jsxs("p",{className:"text-muted-foreground",children:["Multiple ways: (1) Watch the Kanban board for feature status changes. (2) Open the debug panel (",a.jsx("span",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono",children:"D"})," key) for live agent logs. (3) Click agent cards in Mission Control for per-agent logs. (4) The progress bar updates in real time via WebSocket."]})]})}const fv={"getting-started":J0,"app-spec-setup":$0,"project-structure":W0,"features-kanban":I0,"agent-system":P0,"settings-config":ev,"developer-tools":tv,"ai-assistant":av,scheduling:nv,"appearance-themes":iv,security:rv,"advanced-config":uv,faq:dv};function mv({onSectionVisible:i}){const c=m.useRef(null),d=m.useRef(new Map),u=m.useCallback((h,x)=>{x?d.current.set(h,x):d.current.delete(h)},[]);return m.useEffect(()=>{const h=d.current;if(h.size===0)return;const x=new IntersectionObserver(y=>{const g=y.filter(T=>T.isIntersecting).sort((T,C)=>T.boundingClientRect.top-C.boundingClientRect.top);if(g.length>0){const C=g[0].target.getAttribute("data-section-id");C&&i(C)}},{rootMargin:"0px 0px -60% 0px",threshold:0});return h.forEach(y=>x.observe(y)),()=>x.disconnect()},[i]),a.jsx("div",{ref:c,className:"docs-prose",children:cs.map(h=>{const x=fv[h.id];if(!x)return null;const y=h.icon;return a.jsxs("div",{id:h.id,className:"scroll-mt-24 mb-16",children:[a.jsxs("h2",{ref:g=>u(h.id,g),"data-section-id":h.id,className:`font-display text-2xl font-bold tracking-tight mb-6 flex items-center gap-3\r
|
|
164
|
+
text-foreground border-b-2 border-border pb-3`,children:[a.jsx(y,{size:24,className:"text-primary shrink-0"}),h.title]}),a.jsx(x,{})]},h.id)})})}function hv(){const[i,c]=m.useState(null),[d,u]=m.useState(""),[h,x]=m.useState(!1),{section:y}=jh(),{theme:g,setTheme:T,darkMode:C,toggleDarkMode:A,themes:D}=So();m.useEffect(()=>{y&&(c(y),requestAnimationFrame(()=>{const E=document.getElementById(y);E&&E.scrollIntoView({behavior:"smooth",block:"start"})}))},[]);const H=m.useCallback(E=>{c(E),history.replaceState(null,"",`#/docs/${E}`);const O=document.getElementById(E);O&&O.scrollIntoView({behavior:"smooth",block:"start"})},[]),v=m.useCallback(E=>{c(E)},[]);return m.useEffect(()=>{const E=O=>{O.key==="Escape"&&h&&x(!1)};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[h]),m.useEffect(()=>(h?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[h]),a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"sticky top-0 z-50 bg-card/80 backdrop-blur-md text-foreground border-b-2 border-border",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Z,{variant:"ghost",size:"icon-sm",className:"lg:hidden",onClick:()=>x(!h),"aria-label":h?"Close sidebar":"Open sidebar",children:h?a.jsx(We,{size:20}):a.jsx(Mp,{size:20})}),a.jsx("a",{href:"#/",className:`font-display text-xl font-bold tracking-tight uppercase text-foreground\r
|
|
165
|
+
hover:text-primary transition-colors`,children:"AutoForge"}),a.jsx(ie,{variant:"secondary",className:"text-xs font-medium",children:"Documentation"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Th,{themes:D,currentTheme:g,onThemeChange:T}),a.jsx(Z,{onClick:A,variant:"outline",size:"sm",title:"Toggle dark mode","aria-label":"Toggle dark mode",children:C?a.jsx(bo,{size:18}):a.jsx(jo,{size:18})}),a.jsx(Z,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:"#/",className:"inline-flex items-center gap-1.5",children:[a.jsx(po,{size:16}),a.jsx("span",{className:"hidden sm:inline",children:"Back to App"})]})})]})]})})}),a.jsxs("div",{className:"max-w-7xl mx-auto flex",children:[a.jsxs("aside",{className:`hidden lg:block w-[280px] shrink-0 sticky top-[57px] h-[calc(100vh-57px)]\r
|
|
166
|
+
overflow-y-auto border-r border-border p-4 space-y-4`,children:[a.jsx(lh,{value:d,onChange:u}),a.jsx(sh,{activeSectionId:i,onSectionClick:H,searchQuery:d})]}),h&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-40 bg-background/60 backdrop-blur-sm lg:hidden",onClick:()=>x(!1),"aria-hidden":"true"}),a.jsxs("aside",{className:`fixed top-[57px] left-0 z-50 w-[280px] h-[calc(100vh-57px)]\r
|
|
167
|
+
overflow-y-auto bg-card border-r-2 border-border p-4 space-y-4\r
|
|
168
|
+
animate-slide-in lg:hidden`,children:[a.jsx(lh,{value:d,onChange:u}),a.jsx(sh,{activeSectionId:i,onSectionClick:H,searchQuery:d,onMobileClose:()=>x(!1)})]})]}),a.jsx("main",{className:"flex-1 min-w-0 px-6 py-8 lg:px-10",children:a.jsx("div",{className:"max-w-[65ch] mx-auto",children:a.jsx(mv,{activeSectionId:i,onSectionVisible:v})})})]})]})}const xv=new Wg({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1}}});function gv(){const{route:i}=jh();return i==="docs"?a.jsx(hv,{}):a.jsx(K0,{})}fy.createRoot(document.getElementById("root")).render(a.jsx(m.StrictMode,{children:a.jsx(Ig,{client:xv,children:a.jsx(gv,{})})}));
|