tlc-claude-code 2.0.1 → 2.2.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.
Files changed (109) hide show
  1. package/.claude/agents/builder.md +144 -0
  2. package/.claude/agents/planner.md +143 -0
  3. package/.claude/agents/reviewer.md +160 -0
  4. package/.claude/commands/tlc/build.md +4 -0
  5. package/.claude/commands/tlc/deploy.md +194 -2
  6. package/.claude/commands/tlc/e2e-verify.md +214 -0
  7. package/.claude/commands/tlc/guard.md +191 -0
  8. package/.claude/commands/tlc/help.md +32 -0
  9. package/.claude/commands/tlc/init.md +73 -37
  10. package/.claude/commands/tlc/llm.md +19 -4
  11. package/.claude/commands/tlc/preflight.md +134 -0
  12. package/.claude/commands/tlc/review-plan.md +363 -0
  13. package/.claude/commands/tlc/review.md +172 -57
  14. package/.claude/commands/tlc/watchci.md +159 -0
  15. package/.claude/hooks/tlc-block-tools.sh +41 -0
  16. package/.claude/hooks/tlc-capture-exchange.sh +50 -0
  17. package/.claude/hooks/tlc-post-build.sh +38 -0
  18. package/.claude/hooks/tlc-post-push.sh +22 -0
  19. package/.claude/hooks/tlc-prompt-guard.sh +69 -0
  20. package/.claude/hooks/tlc-session-init.sh +123 -0
  21. package/CLAUDE.md +13 -0
  22. package/bin/install.js +268 -2
  23. package/bin/postinstall.js +102 -24
  24. package/bin/setup-autoupdate.js +206 -0
  25. package/bin/setup-autoupdate.test.js +124 -0
  26. package/bin/tlc.js +0 -0
  27. package/dashboard-web/dist/assets/index-CdS5CHqu.css +1 -0
  28. package/dashboard-web/dist/assets/index-CwNPPVpg.js +483 -0
  29. package/dashboard-web/dist/assets/index-CwNPPVpg.js.map +1 -0
  30. package/dashboard-web/dist/index.html +2 -2
  31. package/docker-compose.dev.yml +18 -12
  32. package/package.json +4 -2
  33. package/scripts/project-docs.js +1 -1
  34. package/server/index.js +228 -2
  35. package/server/lib/capture-bridge.js +242 -0
  36. package/server/lib/capture-bridge.test.js +363 -0
  37. package/server/lib/capture-guard.js +140 -0
  38. package/server/lib/capture-guard.test.js +182 -0
  39. package/server/lib/command-runner.js +159 -0
  40. package/server/lib/command-runner.test.js +92 -0
  41. package/server/lib/cost-tracker.test.js +49 -12
  42. package/server/lib/deploy/runners/dependency-runner.js +106 -0
  43. package/server/lib/deploy/runners/dependency-runner.test.js +148 -0
  44. package/server/lib/deploy/runners/secrets-runner.js +174 -0
  45. package/server/lib/deploy/runners/secrets-runner.test.js +127 -0
  46. package/server/lib/deploy/security-gates.js +11 -24
  47. package/server/lib/deploy/security-gates.test.js +9 -2
  48. package/server/lib/deploy-engine.js +182 -0
  49. package/server/lib/deploy-engine.test.js +147 -0
  50. package/server/lib/docker-api.js +137 -0
  51. package/server/lib/docker-api.test.js +202 -0
  52. package/server/lib/docker-client.js +297 -0
  53. package/server/lib/docker-client.test.js +308 -0
  54. package/server/lib/input-sanitizer.js +86 -0
  55. package/server/lib/input-sanitizer.test.js +117 -0
  56. package/server/lib/launchd-agent.js +225 -0
  57. package/server/lib/launchd-agent.test.js +185 -0
  58. package/server/lib/memory-api.js +3 -1
  59. package/server/lib/memory-api.test.js +3 -5
  60. package/server/lib/memory-bridge-e2e.test.js +160 -0
  61. package/server/lib/memory-committer.js +18 -4
  62. package/server/lib/memory-committer.test.js +21 -0
  63. package/server/lib/memory-hooks-capture.test.js +69 -4
  64. package/server/lib/memory-hooks-integration.test.js +98 -0
  65. package/server/lib/memory-hooks.js +42 -4
  66. package/server/lib/memory-store-adapter.js +105 -0
  67. package/server/lib/memory-store-adapter.test.js +141 -0
  68. package/server/lib/memory-wiring-e2e.test.js +93 -0
  69. package/server/lib/nginx-config.js +114 -0
  70. package/server/lib/nginx-config.test.js +82 -0
  71. package/server/lib/ollama-health.js +91 -0
  72. package/server/lib/ollama-health.test.js +74 -0
  73. package/server/lib/orchestration/agent-dispatcher.js +114 -0
  74. package/server/lib/orchestration/agent-dispatcher.test.js +110 -0
  75. package/server/lib/orchestration/orchestrator.js +130 -0
  76. package/server/lib/orchestration/orchestrator.test.js +192 -0
  77. package/server/lib/orchestration/tmux-manager.js +101 -0
  78. package/server/lib/orchestration/tmux-manager.test.js +109 -0
  79. package/server/lib/orchestration/worktree-manager.js +132 -0
  80. package/server/lib/orchestration/worktree-manager.test.js +129 -0
  81. package/server/lib/port-guard.js +44 -0
  82. package/server/lib/port-guard.test.js +65 -0
  83. package/server/lib/project-scanner.js +37 -2
  84. package/server/lib/project-scanner.test.js +152 -0
  85. package/server/lib/remember-command.js +2 -0
  86. package/server/lib/remember-command.test.js +23 -0
  87. package/server/lib/review/plan-reviewer.js +260 -0
  88. package/server/lib/review/plan-reviewer.test.js +269 -0
  89. package/server/lib/review/review-schemas.js +173 -0
  90. package/server/lib/review/review-schemas.test.js +152 -0
  91. package/server/lib/security/crypto-utils.test.js +2 -2
  92. package/server/lib/semantic-recall.js +1 -1
  93. package/server/lib/semantic-recall.test.js +17 -0
  94. package/server/lib/ssh-client.js +184 -0
  95. package/server/lib/ssh-client.test.js +127 -0
  96. package/server/lib/vps-api.js +184 -0
  97. package/server/lib/vps-api.test.js +208 -0
  98. package/server/lib/vps-bootstrap.js +124 -0
  99. package/server/lib/vps-bootstrap.test.js +79 -0
  100. package/server/lib/vps-monitor.js +126 -0
  101. package/server/lib/vps-monitor.test.js +98 -0
  102. package/server/lib/workspace-api.js +182 -1
  103. package/server/lib/workspace-api.test.js +474 -0
  104. package/server/package-lock.json +737 -0
  105. package/server/package.json +3 -0
  106. package/server/setup.sh +271 -271
  107. package/dashboard-web/dist/assets/index-Uhc49PE-.css +0 -1
  108. package/dashboard-web/dist/assets/index-W36XHPC5.js +0 -431
  109. package/dashboard-web/dist/assets/index-W36XHPC5.js.map +0 -1
@@ -0,0 +1,483 @@
1
+ var bp=Object.defineProperty;var Cp=(s,a,i)=>a in s?bp(s,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[a]=i;var gl=(s,a,i)=>Cp(s,typeof a!="symbol"?a+"":a,i);(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))d(f);new MutationObserver(f=>{for(const u of f)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&d(m)}).observe(document,{childList:!0,subtree:!0});function i(f){const u={};return f.integrity&&(u.integrity=f.integrity),f.referrerPolicy&&(u.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?u.credentials="include":f.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function d(f){if(f.ep)return;f.ep=!0;const u=i(f);fetch(f.href,u)}})();function Wd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var _o={exports:{}},qr={},Do={exports:{}},de={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ad;function Ep(){if(ad)return de;ad=1;var s=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),m=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),j=Symbol.iterator;function k(R){return R===null||typeof R!="object"?null:(R=j&&R[j]||R["@@iterator"],typeof R=="function"?R:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,S={};function C(R,A,ue){this.props=R,this.context=A,this.refs=S,this.updater=ue||g}C.prototype.isReactComponent={},C.prototype.setState=function(R,A){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,A,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function P(){}P.prototype=C.prototype;function M(R,A,ue){this.props=R,this.context=A,this.refs=S,this.updater=ue||g}var T=M.prototype=new P;T.constructor=M,$(T,C.prototype),T.isPureReactComponent=!0;var I=Array.isArray,z=Object.prototype.hasOwnProperty,W={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function G(R,A,ue){var fe,he={},xe=null,Ce=null;if(A!=null)for(fe in A.ref!==void 0&&(Ce=A.ref),A.key!==void 0&&(xe=""+A.key),A)z.call(A,fe)&&!ee.hasOwnProperty(fe)&&(he[fe]=A[fe]);var we=arguments.length-2;if(we===1)he.children=ue;else if(1<we){for(var Le=Array(we),it=0;it<we;it++)Le[it]=arguments[it+2];he.children=Le}if(R&&R.defaultProps)for(fe in we=R.defaultProps,we)he[fe]===void 0&&(he[fe]=we[fe]);return{$$typeof:s,type:R,key:xe,ref:Ce,props:he,_owner:W.current}}function V(R,A){return{$$typeof:s,type:R.type,key:A,ref:R.ref,props:R.props,_owner:R._owner}}function ye(R){return typeof R=="object"&&R!==null&&R.$$typeof===s}function Se(R){var A={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ue){return A[ue]})}var ze=/\/+/g;function re(R,A){return typeof R=="object"&&R!==null&&R.key!=null?Se(""+R.key):A.toString(36)}function ve(R,A,ue,fe,he){var xe=typeof R;(xe==="undefined"||xe==="boolean")&&(R=null);var Ce=!1;if(R===null)Ce=!0;else switch(xe){case"string":case"number":Ce=!0;break;case"object":switch(R.$$typeof){case s:case a:Ce=!0}}if(Ce)return Ce=R,he=he(Ce),R=fe===""?"."+re(Ce,0):fe,I(he)?(ue="",R!=null&&(ue=R.replace(ze,"$&/")+"/"),ve(he,A,ue,"",function(it){return it})):he!=null&&(ye(he)&&(he=V(he,ue+(!he.key||Ce&&Ce.key===he.key?"":(""+he.key).replace(ze,"$&/")+"/")+R)),A.push(he)),1;if(Ce=0,fe=fe===""?".":fe+":",I(R))for(var we=0;we<R.length;we++){xe=R[we];var Le=fe+re(xe,we);Ce+=ve(xe,A,ue,Le,he)}else if(Le=k(R),typeof Le=="function")for(R=Le.call(R),we=0;!(xe=R.next()).done;)xe=xe.value,Le=fe+re(xe,we++),Ce+=ve(xe,A,ue,Le,he);else if(xe==="object")throw A=String(R),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.");return Ce}function Z(R,A,ue){if(R==null)return R;var fe=[],he=0;return ve(R,fe,"","",function(xe){return A.call(ue,xe,he++)}),fe}function be(R){if(R._status===-1){var A=R._result;A=A(),A.then(function(ue){(R._status===0||R._status===-1)&&(R._status=1,R._result=ue)},function(ue){(R._status===0||R._status===-1)&&(R._status=2,R._result=ue)}),R._status===-1&&(R._status=0,R._result=A)}if(R._status===1)return R._result.default;throw R._result}var me={current:null},H={transition:null},ne={ReactCurrentDispatcher:me,ReactCurrentBatchConfig:H,ReactCurrentOwner:W};function q(){throw Error("act(...) is not supported in production builds of React.")}return de.Children={map:Z,forEach:function(R,A,ue){Z(R,function(){A.apply(this,arguments)},ue)},count:function(R){var A=0;return Z(R,function(){A++}),A},toArray:function(R){return Z(R,function(A){return A})||[]},only:function(R){if(!ye(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},de.Component=C,de.Fragment=i,de.Profiler=f,de.PureComponent=M,de.StrictMode=d,de.Suspense=y,de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,de.act=q,de.cloneElement=function(R,A,ue){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var fe=$({},R.props),he=R.key,xe=R.ref,Ce=R._owner;if(A!=null){if(A.ref!==void 0&&(xe=A.ref,Ce=W.current),A.key!==void 0&&(he=""+A.key),R.type&&R.type.defaultProps)var we=R.type.defaultProps;for(Le in A)z.call(A,Le)&&!ee.hasOwnProperty(Le)&&(fe[Le]=A[Le]===void 0&&we!==void 0?we[Le]:A[Le])}var Le=arguments.length-2;if(Le===1)fe.children=ue;else if(1<Le){we=Array(Le);for(var it=0;it<Le;it++)we[it]=arguments[it+2];fe.children=we}return{$$typeof:s,type:R.type,key:he,ref:xe,props:fe,_owner:Ce}},de.createContext=function(R){return R={$$typeof:m,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:u,_context:R},R.Consumer=R},de.createElement=G,de.createFactory=function(R){var A=G.bind(null,R);return A.type=R,A},de.createRef=function(){return{current:null}},de.forwardRef=function(R){return{$$typeof:x,render:R}},de.isValidElement=ye,de.lazy=function(R){return{$$typeof:v,_payload:{_status:-1,_result:R},_init:be}},de.memo=function(R,A){return{$$typeof:w,type:R,compare:A===void 0?null:A}},de.startTransition=function(R){var A=H.transition;H.transition={};try{R()}finally{H.transition=A}},de.unstable_act=q,de.useCallback=function(R,A){return me.current.useCallback(R,A)},de.useContext=function(R){return me.current.useContext(R)},de.useDebugValue=function(){},de.useDeferredValue=function(R){return me.current.useDeferredValue(R)},de.useEffect=function(R,A){return me.current.useEffect(R,A)},de.useId=function(){return me.current.useId()},de.useImperativeHandle=function(R,A,ue){return me.current.useImperativeHandle(R,A,ue)},de.useInsertionEffect=function(R,A){return me.current.useInsertionEffect(R,A)},de.useLayoutEffect=function(R,A){return me.current.useLayoutEffect(R,A)},de.useMemo=function(R,A){return me.current.useMemo(R,A)},de.useReducer=function(R,A,ue){return me.current.useReducer(R,A,ue)},de.useRef=function(R){return me.current.useRef(R)},de.useState=function(R){return me.current.useState(R)},de.useSyncExternalStore=function(R,A,ue){return me.current.useSyncExternalStore(R,A,ue)},de.useTransition=function(){return me.current.useTransition()},de.version="18.3.1",de}var od;function Zo(){return od||(od=1,Do.exports=Ep()),Do.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var id;function Pp(){if(id)return qr;id=1;var s=Zo(),a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,f=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function m(x,y,w){var v,j={},k=null,g=null;w!==void 0&&(k=""+w),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(g=y.ref);for(v in y)d.call(y,v)&&!u.hasOwnProperty(v)&&(j[v]=y[v]);if(x&&x.defaultProps)for(v in y=x.defaultProps,y)j[v]===void 0&&(j[v]=y[v]);return{$$typeof:a,type:x,key:k,ref:g,props:j,_owner:f.current}}return qr.Fragment=i,qr.jsx=m,qr.jsxs=m,qr}var cd;function Tp(){return cd||(cd=1,_o.exports=Pp()),_o.exports}var r=Tp(),h=Zo();const Zr=Wd(h);var yl={},$o={exports:{}},ot={},zo={exports:{}},Io={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var ud;function Rp(){return ud||(ud=1,(function(s){function a(H,ne){var q=H.length;H.push(ne);e:for(;0<q;){var R=q-1>>>1,A=H[R];if(0<f(A,ne))H[R]=ne,H[q]=A,q=R;else break e}}function i(H){return H.length===0?null:H[0]}function d(H){if(H.length===0)return null;var ne=H[0],q=H.pop();if(q!==ne){H[0]=q;e:for(var R=0,A=H.length,ue=A>>>1;R<ue;){var fe=2*(R+1)-1,he=H[fe],xe=fe+1,Ce=H[xe];if(0>f(he,q))xe<A&&0>f(Ce,he)?(H[R]=Ce,H[xe]=q,R=xe):(H[R]=he,H[fe]=q,R=fe);else if(xe<A&&0>f(Ce,q))H[R]=Ce,H[xe]=q,R=xe;else break e}}return ne}function f(H,ne){var q=H.sortIndex-ne.sortIndex;return q!==0?q:H.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;s.unstable_now=function(){return u.now()}}else{var m=Date,x=m.now();s.unstable_now=function(){return m.now()-x}}var y=[],w=[],v=1,j=null,k=3,g=!1,$=!1,S=!1,C=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(H){for(var ne=i(w);ne!==null;){if(ne.callback===null)d(w);else if(ne.startTime<=H)d(w),ne.sortIndex=ne.expirationTime,a(y,ne);else break;ne=i(w)}}function I(H){if(S=!1,T(H),!$)if(i(y)!==null)$=!0,be(z);else{var ne=i(w);ne!==null&&me(I,ne.startTime-H)}}function z(H,ne){$=!1,S&&(S=!1,P(G),G=-1),g=!0;var q=k;try{for(T(ne),j=i(y);j!==null&&(!(j.expirationTime>ne)||H&&!Se());){var R=j.callback;if(typeof R=="function"){j.callback=null,k=j.priorityLevel;var A=R(j.expirationTime<=ne);ne=s.unstable_now(),typeof A=="function"?j.callback=A:j===i(y)&&d(y),T(ne)}else d(y);j=i(y)}if(j!==null)var ue=!0;else{var fe=i(w);fe!==null&&me(I,fe.startTime-ne),ue=!1}return ue}finally{j=null,k=q,g=!1}}var W=!1,ee=null,G=-1,V=5,ye=-1;function Se(){return!(s.unstable_now()-ye<V)}function ze(){if(ee!==null){var H=s.unstable_now();ye=H;var ne=!0;try{ne=ee(!0,H)}finally{ne?re():(W=!1,ee=null)}}else W=!1}var re;if(typeof M=="function")re=function(){M(ze)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Z=ve.port2;ve.port1.onmessage=ze,re=function(){Z.postMessage(null)}}else re=function(){C(ze,0)};function be(H){ee=H,W||(W=!0,re())}function me(H,ne){G=C(function(){H(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(H){H.callback=null},s.unstable_continueExecution=function(){$||g||($=!0,be(z))},s.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<H?Math.floor(1e3/H):5},s.unstable_getCurrentPriorityLevel=function(){return k},s.unstable_getFirstCallbackNode=function(){return i(y)},s.unstable_next=function(H){switch(k){case 1:case 2:case 3:var ne=3;break;default:ne=k}var q=k;k=ne;try{return H()}finally{k=q}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(H,ne){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=k;k=H;try{return ne()}finally{k=q}},s.unstable_scheduleCallback=function(H,ne,q){var R=s.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?R+q:R):q=R,H){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=q+A,H={id:v++,callback:ne,priorityLevel:H,startTime:q,expirationTime:A,sortIndex:-1},q>R?(H.sortIndex=q,a(w,H),i(y)===null&&H===i(w)&&(S?(P(G),G=-1):S=!0,me(I,q-R))):(H.sortIndex=A,a(y,H),$||g||($=!0,be(z))),H},s.unstable_shouldYield=Se,s.unstable_wrapCallback=function(H){var ne=k;return function(){var q=k;k=ne;try{return H.apply(this,arguments)}finally{k=q}}}})(Io)),Io}var dd;function Lp(){return dd||(dd=1,zo.exports=Rp()),zo.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var fd;function Mp(){if(fd)return ot;fd=1;var s=Zo(),a=Lp();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var d=new Set,f={};function u(e,t){m(e,t),m(e+"Capture",t)}function m(e,t){for(f[e]=t,e=0;e<t.length;e++)d.add(t[e])}var x=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,w=/^[: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]*$/,v={},j={};function k(e){return y.call(j,e)?!0:y.call(v,e)?!1:w.test(e)?j[e]=!0:(v[e]=!0,!1)}function g(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $(e,t,n,l){if(t===null||typeof t>"u"||g(e,t,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,n,l,o,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];C[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){C[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(P,M);C[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(P,M);C[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(P,M);C[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function T(e,t,n,l){var o=C.hasOwnProperty(t)?C[t]:null;(o!==null?o.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($(t,n,o,l)&&(n=null),l||o===null?k(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,l=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,l?e.setAttributeNS(l,t,n):e.setAttribute(t,n))))}var I=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),W=Symbol.for("react.portal"),ee=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),ye=Symbol.for("react.provider"),Se=Symbol.for("react.context"),ze=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),ve=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),be=Symbol.for("react.lazy"),me=Symbol.for("react.offscreen"),H=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var q=Object.assign,R;function A(e){if(R===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);R=t&&t[1]||""}return`
34
+ `+R+e}var ue=!1;function fe(e,t){if(!e||ue)return"";ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(D){var l=D}Reflect.construct(e,[],t)}else{try{t.call()}catch(D){l=D}e.call(t.prototype)}else{try{throw Error()}catch(D){l=D}e()}}catch(D){if(D&&l&&typeof D.stack=="string"){for(var o=D.stack.split(`
35
+ `),c=l.stack.split(`
36
+ `),p=o.length-1,N=c.length-1;1<=p&&0<=N&&o[p]!==c[N];)N--;for(;1<=p&&0<=N;p--,N--)if(o[p]!==c[N]){if(p!==1||N!==1)do if(p--,N--,0>N||o[p]!==c[N]){var b=`
37
+ `+o[p].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),b}while(1<=p&&0<=N);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?A(e):""}function he(e){switch(e.tag){case 5:return A(e.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("SuspenseList");case 0:case 2:case 15:return e=fe(e.type,!1),e;case 11:return e=fe(e.type.render,!1),e;case 1:return e=fe(e.type,!0),e;default:return""}}function xe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ee:return"Fragment";case W:return"Portal";case V:return"Profiler";case G:return"StrictMode";case re:return"Suspense";case ve:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Se:return(e.displayName||"Context")+".Consumer";case ye:return(e._context.displayName||"Context")+".Provider";case ze:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case be:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}function Ce(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(t);case 8:return t===G?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function it(e){var t=Le(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(p){l=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(p){l=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function os(e){e._valueTracker||(e._valueTracker=it(e))}function fi(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Le(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function is(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}}function Al(e,t){var n=t.checked;return q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mi(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=we(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pi(e,t){t=t.checked,t!=null&&T(e,"checked",t,!1)}function Ol(e,t){pi(e,t);var n=we(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bl(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Bl(e,t,n){(t!=="number"||is(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ur=Array.isArray;function Tn(e,t,n,l){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&l&&(e[n].defaultSelected=!0)}else{for(n=""+we(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ul(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return q({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xi(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(i(92));if(ur(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:we(n)}}function gi(e,t){var n=we(t.value),l=we(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function yi(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vi(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Vl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vi(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,ji=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tf=["Webkit","ms","Moz","O"];Object.keys(fr).forEach(function(e){Tf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fr[t]=fr[e]})});function wi(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||fr.hasOwnProperty(e)&&fr[e]?(""+t).trim():t+"px"}function Ni(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,o=wi(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,o):e[n]=o}}var Rf=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hl(e,t){if(t){if(Rf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Wl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ql=null;function Gl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kl=null,Rn=null,Ln=null;function ki(e){if(e=Dr(e)){if(typeof Kl!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ms(t),Kl(e.stateNode,e.type,t))}}function Si(e){Rn?Ln?Ln.push(e):Ln=[e]:Rn=e}function bi(){if(Rn){var e=Rn,t=Ln;if(Ln=Rn=null,ki(e),t)for(e=0;e<t.length;e++)ki(t[e])}}function Ci(e,t){return e(t)}function Ei(){}var ql=!1;function Pi(e,t,n){if(ql)return e(t,n);ql=!0;try{return Ci(e,t,n)}finally{ql=!1,(Rn!==null||Ln!==null)&&(Ei(),bi())}}function mr(e,t){var n=e.stateNode;if(n===null)return null;var l=Ms(n);if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Yl=!1;if(x)try{var pr={};Object.defineProperty(pr,"passive",{get:function(){Yl=!0}}),window.addEventListener("test",pr,pr),window.removeEventListener("test",pr,pr)}catch{Yl=!1}function Lf(e,t,n,l,o,c,p,N,b){var D=Array.prototype.slice.call(arguments,3);try{t.apply(n,D)}catch(O){this.onError(O)}}var hr=!1,us=null,ds=!1,Xl=null,Mf={onError:function(e){hr=!0,us=e}};function _f(e,t,n,l,o,c,p,N,b){hr=!1,us=null,Lf.apply(Mf,arguments)}function Df(e,t,n,l,o,c,p,N,b){if(_f.apply(this,arguments),hr){if(hr){var D=us;hr=!1,us=null}else throw Error(i(198));ds||(ds=!0,Xl=D)}}function pn(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 Ti(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 Ri(e){if(pn(e)!==e)throw Error(i(188))}function $f(e){var t=e.alternate;if(!t){if(t=pn(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return Ri(o),e;if(c===l)return Ri(o),t;c=c.sibling}throw Error(i(188))}if(n.return!==l.return)n=o,l=c;else{for(var p=!1,N=o.child;N;){if(N===n){p=!0,n=o,l=c;break}if(N===l){p=!0,l=o,n=c;break}N=N.sibling}if(!p){for(N=c.child;N;){if(N===n){p=!0,n=c,l=o;break}if(N===l){p=!0,l=c,n=o;break}N=N.sibling}if(!p)throw Error(i(189))}}if(n.alternate!==l)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function Li(e){return e=$f(e),e!==null?Mi(e):null}function Mi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Mi(e);if(t!==null)return t;e=e.sibling}return null}var _i=a.unstable_scheduleCallback,Di=a.unstable_cancelCallback,zf=a.unstable_shouldYield,If=a.unstable_requestPaint,Ae=a.unstable_now,Ff=a.unstable_getCurrentPriorityLevel,Jl=a.unstable_ImmediatePriority,$i=a.unstable_UserBlockingPriority,fs=a.unstable_NormalPriority,Af=a.unstable_LowPriority,zi=a.unstable_IdlePriority,ms=null,Tt=null;function Of(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(ms,e,void 0,(e.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:Vf,Bf=Math.log,Uf=Math.LN2;function Vf(e){return e>>>=0,e===0?32:31-(Bf(e)/Uf|0)|0}var ps=64,hs=4194304;function xr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function xs(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,o=e.suspendedLanes,c=e.pingedLanes,p=n&268435455;if(p!==0){var N=p&~o;N!==0?l=xr(N):(c&=p,c!==0&&(l=xr(c)))}else p=n&~o,p!==0?l=xr(p):c!==0&&(l=xr(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&o)===0&&(o=l&-l,c=t&-t,o>=c||o===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-jt(t),o=1<<n,l|=e[n],t&=~o;return l}function Hf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes;0<c;){var p=31-jt(c),N=1<<p,b=o[p];b===-1?((N&n)===0||(N&l)!==0)&&(o[p]=Hf(N,t)):b<=t&&(e.expiredLanes|=N),c&=~N}}function Zl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ii(){var e=ps;return ps<<=1,(ps&4194240)===0&&(ps=64),e}function ea(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Qf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-jt(n),c=1<<o;t[o]=0,l[o]=-1,e[o]=-1,n&=~c}}function ta(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-jt(n),o=1<<l;o&t|e[l]&t&&(e[l]|=t),n&=~o}}var Ne=0;function Fi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ai,na,Oi,Bi,Ui,ra=!1,gs=[],Qt=null,Gt=null,Kt=null,yr=new Map,vr=new Map,qt=[],Gf="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 submit".split(" ");function Vi(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":yr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vr.delete(t.pointerId)}}function jr(e,t,n,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Dr(t),t!==null&&na(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Kf(e,t,n,l,o){switch(t){case"focusin":return Qt=jr(Qt,e,t,n,l,o),!0;case"dragenter":return Gt=jr(Gt,e,t,n,l,o),!0;case"mouseover":return Kt=jr(Kt,e,t,n,l,o),!0;case"pointerover":var c=o.pointerId;return yr.set(c,jr(yr.get(c)||null,e,t,n,l,o)),!0;case"gotpointercapture":return c=o.pointerId,vr.set(c,jr(vr.get(c)||null,e,t,n,l,o)),!0}return!1}function Hi(e){var t=hn(e.target);if(t!==null){var n=pn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ti(n),t!==null){e.blockedOn=t,Ui(e.priority,function(){Oi(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 ys(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=la(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Ql=l,n.target.dispatchEvent(l),Ql=null}else return t=Dr(n),t!==null&&na(t),e.blockedOn=n,!1;t.shift()}return!0}function Wi(e,t,n){ys(e)&&n.delete(t)}function qf(){ra=!1,Qt!==null&&ys(Qt)&&(Qt=null),Gt!==null&&ys(Gt)&&(Gt=null),Kt!==null&&ys(Kt)&&(Kt=null),yr.forEach(Wi),vr.forEach(Wi)}function wr(e,t){e.blockedOn===t&&(e.blockedOn=null,ra||(ra=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,qf)))}function Nr(e){function t(o){return wr(o,e)}if(0<gs.length){wr(gs[0],e);for(var n=1;n<gs.length;n++){var l=gs[n];l.blockedOn===e&&(l.blockedOn=null)}}for(Qt!==null&&wr(Qt,e),Gt!==null&&wr(Gt,e),Kt!==null&&wr(Kt,e),yr.forEach(t),vr.forEach(t),n=0;n<qt.length;n++)l=qt[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<qt.length&&(n=qt[0],n.blockedOn===null);)Hi(n),n.blockedOn===null&&qt.shift()}var Mn=I.ReactCurrentBatchConfig,vs=!0;function Yf(e,t,n,l){var o=Ne,c=Mn.transition;Mn.transition=null;try{Ne=1,sa(e,t,n,l)}finally{Ne=o,Mn.transition=c}}function Xf(e,t,n,l){var o=Ne,c=Mn.transition;Mn.transition=null;try{Ne=4,sa(e,t,n,l)}finally{Ne=o,Mn.transition=c}}function sa(e,t,n,l){if(vs){var o=la(e,t,n,l);if(o===null)Na(e,t,l,js,n),Vi(e,l);else if(Kf(o,e,t,n,l))l.stopPropagation();else if(Vi(e,l),t&4&&-1<Gf.indexOf(e)){for(;o!==null;){var c=Dr(o);if(c!==null&&Ai(c),c=la(e,t,n,l),c===null&&Na(e,t,l,js,n),c===o)break;o=c}o!==null&&l.stopPropagation()}else Na(e,t,l,null,n)}}var js=null;function la(e,t,n,l){if(js=null,e=Gl(l),e=hn(e),e!==null)if(t=pn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ti(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 js=e,null}function Qi(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ff()){case Jl:return 1;case $i:return 4;case fs:case Af:return 16;case zi:return 536870912;default:return 16}default:return 16}}var Yt=null,aa=null,ws=null;function Gi(){if(ws)return ws;var e,t=aa,n=t.length,l,o="value"in Yt?Yt.value:Yt.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var p=n-e;for(l=1;l<=p&&t[n-l]===o[c-l];l++);return ws=o.slice(e,1<l?1-l:void 0)}function Ns(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 ks(){return!0}function Ki(){return!1}function ct(e){function t(n,l,o,c,p){this._reactName=n,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(n=e[N],this[N]=n?n(c):c[N]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ks:Ki,this.isPropagationStopped=Ki,this}return q(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=ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=ct(_n),kr=q({},_n,{view:0,detail:0}),Jf=ct(kr),ia,ca,Sr,Ss=q({},kr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:da,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!==Sr&&(Sr&&e.type==="mousemove"?(ia=e.screenX-Sr.screenX,ca=e.screenY-Sr.screenY):ca=ia=0,Sr=e),ia)},movementY:function(e){return"movementY"in e?e.movementY:ca}}),qi=ct(Ss),Zf=q({},Ss,{dataTransfer:0}),em=ct(Zf),tm=q({},kr,{relatedTarget:0}),ua=ct(tm),nm=q({},_n,{animationName:0,elapsedTime:0,pseudoElement:0}),rm=ct(nm),sm=q({},_n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lm=ct(sm),am=q({},_n,{data:0}),Yi=ct(am),om={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},im={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"},cm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function um(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cm[e])?!!t[e]:!1}function da(){return um}var dm=q({},kr,{key:function(e){if(e.key){var t=om[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?im[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:da,charCode:function(e){return e.type==="keypress"?Ns(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ns(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fm=ct(dm),mm=q({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xi=ct(mm),pm=q({},kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:da}),hm=ct(pm),xm=q({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0}),gm=ct(xm),ym=q({},Ss,{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}),vm=ct(ym),jm=[9,13,27,32],fa=x&&"CompositionEvent"in window,br=null;x&&"documentMode"in document&&(br=document.documentMode);var wm=x&&"TextEvent"in window&&!br,Ji=x&&(!fa||br&&8<br&&11>=br),Zi=" ",ec=!1;function tc(e,t){switch(e){case"keyup":return jm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dn=!1;function Nm(e,t){switch(e){case"compositionend":return nc(t);case"keypress":return t.which!==32?null:(ec=!0,Zi);case"textInput":return e=t.data,e===Zi&&ec?null:e;default:return null}}function km(e,t){if(Dn)return e==="compositionend"||!fa&&tc(e,t)?(e=Gi(),ws=aa=Yt=null,Dn=!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 Ji&&t.locale!=="ko"?null:t.data;default:return null}}var Sm={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 rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sm[e.type]:t==="textarea"}function sc(e,t,n,l){Si(l),t=Ts(t,"onChange"),0<t.length&&(n=new oa("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Cr=null,Er=null;function bm(e){Nc(e,0)}function bs(e){var t=An(e);if(fi(t))return e}function Cm(e,t){if(e==="change")return t}var lc=!1;if(x){var ma;if(x){var pa="oninput"in document;if(!pa){var ac=document.createElement("div");ac.setAttribute("oninput","return;"),pa=typeof ac.oninput=="function"}ma=pa}else ma=!1;lc=ma&&(!document.documentMode||9<document.documentMode)}function oc(){Cr&&(Cr.detachEvent("onpropertychange",ic),Er=Cr=null)}function ic(e){if(e.propertyName==="value"&&bs(Er)){var t=[];sc(t,Er,e,Gl(e)),Pi(bm,t)}}function Em(e,t,n){e==="focusin"?(oc(),Cr=t,Er=n,Cr.attachEvent("onpropertychange",ic)):e==="focusout"&&oc()}function Pm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bs(Er)}function Tm(e,t){if(e==="click")return bs(t)}function Rm(e,t){if(e==="input"||e==="change")return bs(t)}function Lm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:Lm;function Pr(e,t){if(wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var o=n[l];if(!y.call(t,o)||!wt(e[o],t[o]))return!1}return!0}function cc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uc(e,t){var n=cc(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cc(n)}}function dc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fc(){for(var e=window,t=is();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=is(e.document)}return t}function ha(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")}function Mm(e){var t=fc(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dc(n.ownerDocument.documentElement,n)){if(l!==null&&ha(n)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,c=Math.min(l.start,o);l=l.end===void 0?c:Math.min(l.end,o),!e.extend&&c>l&&(o=l,l=c,c=o),o=uc(n,c);var p=uc(n,l);o&&p&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var _m=x&&"documentMode"in document&&11>=document.documentMode,$n=null,xa=null,Tr=null,ga=!1;function mc(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ga||$n==null||$n!==is(l)||(l=$n,"selectionStart"in l&&ha(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Tr&&Pr(Tr,l)||(Tr=l,l=Ts(xa,"onSelect"),0<l.length&&(t=new oa("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=$n)))}function Cs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zn={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionend:Cs("Transition","TransitionEnd")},ya={},pc={};x&&(pc=document.createElement("div").style,"AnimationEvent"in window||(delete zn.animationend.animation,delete zn.animationiteration.animation,delete zn.animationstart.animation),"TransitionEvent"in window||delete zn.transitionend.transition);function Es(e){if(ya[e])return ya[e];if(!zn[e])return e;var t=zn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pc)return ya[e]=t[n];return e}var hc=Es("animationend"),xc=Es("animationiteration"),gc=Es("animationstart"),yc=Es("transitionend"),vc=new Map,jc="abort auxClick 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(" ");function Xt(e,t){vc.set(e,t),u(t,[e])}for(var va=0;va<jc.length;va++){var ja=jc[va],Dm=ja.toLowerCase(),$m=ja[0].toUpperCase()+ja.slice(1);Xt(Dm,"on"+$m)}Xt(hc,"onAnimationEnd"),Xt(xc,"onAnimationIteration"),Xt(gc,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(yc,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rr="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(" "),zm=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rr));function wc(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,Df(l,t,void 0,e),e.currentTarget=null}function Nc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],o=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var p=l.length-1;0<=p;p--){var N=l[p],b=N.instance,D=N.currentTarget;if(N=N.listener,b!==c&&o.isPropagationStopped())break e;wc(o,N,D),c=b}else for(p=0;p<l.length;p++){if(N=l[p],b=N.instance,D=N.currentTarget,N=N.listener,b!==c&&o.isPropagationStopped())break e;wc(o,N,D),c=b}}}if(ds)throw e=Xl,ds=!1,Xl=null,e}function Te(e,t){var n=t[Pa];n===void 0&&(n=t[Pa]=new Set);var l=e+"__bubble";n.has(l)||(kc(t,e,2,!1),n.add(l))}function wa(e,t,n){var l=0;t&&(l|=4),kc(n,e,l,t)}var Ps="_reactListening"+Math.random().toString(36).slice(2);function Lr(e){if(!e[Ps]){e[Ps]=!0,d.forEach(function(n){n!=="selectionchange"&&(zm.has(n)||wa(n,!1,e),wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ps]||(t[Ps]=!0,wa("selectionchange",!1,t))}}function kc(e,t,n,l){switch(Qi(t)){case 1:var o=Yf;break;case 4:o=Xf;break;default:o=sa}n=o.bind(null,t,n,e),o=void 0,!Yl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Na(e,t,n,l,o){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var p=l.tag;if(p===3||p===4){var N=l.stateNode.containerInfo;if(N===o||N.nodeType===8&&N.parentNode===o)break;if(p===4)for(p=l.return;p!==null;){var b=p.tag;if((b===3||b===4)&&(b=p.stateNode.containerInfo,b===o||b.nodeType===8&&b.parentNode===o))return;p=p.return}for(;N!==null;){if(p=hn(N),p===null)return;if(b=p.tag,b===5||b===6){l=c=p;continue e}N=N.parentNode}}l=l.return}Pi(function(){var D=c,O=Gl(n),B=[];e:{var F=vc.get(e);if(F!==void 0){var Q=oa,Y=e;switch(e){case"keypress":if(Ns(n)===0)break e;case"keydown":case"keyup":Q=fm;break;case"focusin":Y="focus",Q=ua;break;case"focusout":Y="blur",Q=ua;break;case"beforeblur":case"afterblur":Q=ua;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":Q=qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=em;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=hm;break;case hc:case xc:case gc:Q=rm;break;case yc:Q=gm;break;case"scroll":Q=Jf;break;case"wheel":Q=vm;break;case"copy":case"cut":case"paste":Q=lm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Xi}var X=(t&4)!==0,Oe=!X&&e==="scroll",L=X?F!==null?F+"Capture":null:F;X=[];for(var E=D,_;E!==null;){_=E;var U=_.stateNode;if(_.tag===5&&U!==null&&(_=U,L!==null&&(U=mr(E,L),U!=null&&X.push(Mr(E,U,_)))),Oe)break;E=E.return}0<X.length&&(F=new Q(F,Y,null,n,O),B.push({event:F,listeners:X}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",F&&n!==Ql&&(Y=n.relatedTarget||n.fromElement)&&(hn(Y)||Y[zt]))break e;if((Q||F)&&(F=O.window===O?O:(F=O.ownerDocument)?F.defaultView||F.parentWindow:window,Q?(Y=n.relatedTarget||n.toElement,Q=D,Y=Y?hn(Y):null,Y!==null&&(Oe=pn(Y),Y!==Oe||Y.tag!==5&&Y.tag!==6)&&(Y=null)):(Q=null,Y=D),Q!==Y)){if(X=qi,U="onMouseLeave",L="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(X=Xi,U="onPointerLeave",L="onPointerEnter",E="pointer"),Oe=Q==null?F:An(Q),_=Y==null?F:An(Y),F=new X(U,E+"leave",Q,n,O),F.target=Oe,F.relatedTarget=_,U=null,hn(O)===D&&(X=new X(L,E+"enter",Y,n,O),X.target=_,X.relatedTarget=Oe,U=X),Oe=U,Q&&Y)t:{for(X=Q,L=Y,E=0,_=X;_;_=In(_))E++;for(_=0,U=L;U;U=In(U))_++;for(;0<E-_;)X=In(X),E--;for(;0<_-E;)L=In(L),_--;for(;E--;){if(X===L||L!==null&&X===L.alternate)break t;X=In(X),L=In(L)}X=null}else X=null;Q!==null&&Sc(B,F,Q,X,!1),Y!==null&&Oe!==null&&Sc(B,Oe,Y,X,!0)}}e:{if(F=D?An(D):window,Q=F.nodeName&&F.nodeName.toLowerCase(),Q==="select"||Q==="input"&&F.type==="file")var J=Cm;else if(rc(F))if(lc)J=Rm;else{J=Pm;var se=Em}else(Q=F.nodeName)&&Q.toLowerCase()==="input"&&(F.type==="checkbox"||F.type==="radio")&&(J=Tm);if(J&&(J=J(e,D))){sc(B,J,n,O);break e}se&&se(e,F,D),e==="focusout"&&(se=F._wrapperState)&&se.controlled&&F.type==="number"&&Bl(F,"number",F.value)}switch(se=D?An(D):window,e){case"focusin":(rc(se)||se.contentEditable==="true")&&($n=se,xa=D,Tr=null);break;case"focusout":Tr=xa=$n=null;break;case"mousedown":ga=!0;break;case"contextmenu":case"mouseup":case"dragend":ga=!1,mc(B,n,O);break;case"selectionchange":if(_m)break;case"keydown":case"keyup":mc(B,n,O)}var le;if(fa)e:{switch(e){case"compositionstart":var ae="onCompositionStart";break e;case"compositionend":ae="onCompositionEnd";break e;case"compositionupdate":ae="onCompositionUpdate";break e}ae=void 0}else Dn?tc(e,n)&&(ae="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ae="onCompositionStart");ae&&(Ji&&n.locale!=="ko"&&(Dn||ae!=="onCompositionStart"?ae==="onCompositionEnd"&&Dn&&(le=Gi()):(Yt=O,aa="value"in Yt?Yt.value:Yt.textContent,Dn=!0)),se=Ts(D,ae),0<se.length&&(ae=new Yi(ae,e,null,n,O),B.push({event:ae,listeners:se}),le?ae.data=le:(le=nc(n),le!==null&&(ae.data=le)))),(le=wm?Nm(e,n):km(e,n))&&(D=Ts(D,"onBeforeInput"),0<D.length&&(O=new Yi("onBeforeInput","beforeinput",null,n,O),B.push({event:O,listeners:D}),O.data=le))}Nc(B,t)})}function Mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ts(e,t){for(var n=t+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;o.tag===5&&c!==null&&(o=c,c=mr(e,n),c!=null&&l.unshift(Mr(e,c,o)),c=mr(e,t),c!=null&&l.push(Mr(e,c,o))),e=e.return}return l}function In(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Sc(e,t,n,l,o){for(var c=t._reactName,p=[];n!==null&&n!==l;){var N=n,b=N.alternate,D=N.stateNode;if(b!==null&&b===l)break;N.tag===5&&D!==null&&(N=D,o?(b=mr(n,c),b!=null&&p.unshift(Mr(n,b,N))):o||(b=mr(n,c),b!=null&&p.push(Mr(n,b,N)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var Im=/\r\n?/g,Fm=/\u0000|\uFFFD/g;function bc(e){return(typeof e=="string"?e:""+e).replace(Im,`
38
+ `).replace(Fm,"")}function Rs(e,t,n){if(t=bc(t),bc(e)!==t&&n)throw Error(i(425))}function Ls(){}var ka=null,Sa=null;function ba(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ca=typeof setTimeout=="function"?setTimeout:void 0,Am=typeof clearTimeout=="function"?clearTimeout:void 0,Cc=typeof Promise=="function"?Promise:void 0,Om=typeof queueMicrotask=="function"?queueMicrotask:typeof Cc<"u"?function(e){return Cc.resolve(null).then(e).catch(Bm)}:Ca;function Bm(e){setTimeout(function(){throw e})}function Ea(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(l===0){e.removeChild(o),Nr(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=o}while(n);Nr(t)}function Jt(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==="$?")break;if(t==="/$")return null}}return e}function Ec(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Fn,_r="__reactProps$"+Fn,zt="__reactContainer$"+Fn,Pa="__reactEvents$"+Fn,Um="__reactListeners$"+Fn,Vm="__reactHandles$"+Fn;function hn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zt]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ec(e);e!==null;){if(n=e[Rt])return n;e=Ec(e)}return t}e=n,n=e.parentNode}return null}function Dr(e){return e=e[Rt]||e[zt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function An(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Ms(e){return e[_r]||null}var Ta=[],On=-1;function Zt(e){return{current:e}}function Re(e){0>On||(e.current=Ta[On],Ta[On]=null,On--)}function Ee(e,t){On++,Ta[On]=e.current,e.current=t}var en={},Ye=Zt(en),nt=Zt(!1),xn=en;function Bn(e,t){var n=e.type.contextTypes;if(!n)return en;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var o={},c;for(c in n)o[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function _s(){Re(nt),Re(Ye)}function Pc(e,t,n){if(Ye.current!==en)throw Error(i(168));Ee(Ye,t),Ee(nt,n)}function Tc(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var o in l)if(!(o in t))throw Error(i(108,Ce(e)||"Unknown",o));return q({},n,l)}function Ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,xn=Ye.current,Ee(Ye,e),Ee(nt,nt.current),!0}function Rc(e,t,n){var l=e.stateNode;if(!l)throw Error(i(169));n?(e=Tc(e,t,xn),l.__reactInternalMemoizedMergedChildContext=e,Re(nt),Re(Ye),Ee(Ye,e)):Re(nt),Ee(nt,n)}var It=null,$s=!1,Ra=!1;function Lc(e){It===null?It=[e]:It.push(e)}function Hm(e){$s=!0,Lc(e)}function tn(){if(!Ra&&It!==null){Ra=!0;var e=0,t=Ne;try{var n=It;for(Ne=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}It=null,$s=!1}catch(o){throw It!==null&&(It=It.slice(e+1)),_i(Jl,tn),o}finally{Ne=t,Ra=!1}}return null}var Un=[],Vn=0,zs=null,Is=0,mt=[],pt=0,gn=null,Ft=1,At="";function yn(e,t){Un[Vn++]=Is,Un[Vn++]=zs,zs=e,Is=t}function Mc(e,t,n){mt[pt++]=Ft,mt[pt++]=At,mt[pt++]=gn,gn=e;var l=Ft;e=At;var o=32-jt(l)-1;l&=~(1<<o),n+=1;var c=32-jt(t)+o;if(30<c){var p=o-o%5;c=(l&(1<<p)-1).toString(32),l>>=p,o-=p,Ft=1<<32-jt(t)+o|n<<o|l,At=c+e}else Ft=1<<c|n<<o|l,At=e}function La(e){e.return!==null&&(yn(e,1),Mc(e,1,0))}function Ma(e){for(;e===zs;)zs=Un[--Vn],Un[Vn]=null,Is=Un[--Vn],Un[Vn]=null;for(;e===gn;)gn=mt[--pt],mt[pt]=null,At=mt[--pt],mt[pt]=null,Ft=mt[--pt],mt[pt]=null}var ut=null,dt=null,Me=!1,Nt=null;function _c(e,t){var n=yt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Dc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ut=e,dt=Jt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ut=e,dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:Ft,overflow:At}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ut=e,dt=null,!0):!1;default:return!1}}function _a(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Da(e){if(Me){var t=dt;if(t){var n=t;if(!Dc(e,t)){if(_a(e))throw Error(i(418));t=Jt(n.nextSibling);var l=ut;t&&Dc(e,t)?_c(l,n):(e.flags=e.flags&-4097|2,Me=!1,ut=e)}}else{if(_a(e))throw Error(i(418));e.flags=e.flags&-4097|2,Me=!1,ut=e}}}function $c(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ut=e}function Fs(e){if(e!==ut)return!1;if(!Me)return $c(e),Me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ba(e.type,e.memoizedProps)),t&&(t=dt)){if(_a(e))throw zc(),Error(i(418));for(;t;)_c(e,t),t=Jt(t.nextSibling)}if($c(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){dt=Jt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}dt=null}}else dt=ut?Jt(e.stateNode.nextSibling):null;return!0}function zc(){for(var e=dt;e;)e=Jt(e.nextSibling)}function Hn(){dt=ut=null,Me=!1}function $a(e){Nt===null?Nt=[e]:Nt.push(e)}var Wm=I.ReactCurrentBatchConfig;function $r(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(i(309));var l=n.stateNode}if(!l)throw Error(i(147,e));var o=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(p){var N=o.refs;p===null?delete N[c]:N[c]=p},t._stringRef=c,t)}if(typeof e!="string")throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function As(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ic(e){var t=e._init;return t(e._payload)}function Fc(e){function t(L,E){if(e){var _=L.deletions;_===null?(L.deletions=[E],L.flags|=16):_.push(E)}}function n(L,E){if(!e)return null;for(;E!==null;)t(L,E),E=E.sibling;return null}function l(L,E){for(L=new Map;E!==null;)E.key!==null?L.set(E.key,E):L.set(E.index,E),E=E.sibling;return L}function o(L,E){return L=un(L,E),L.index=0,L.sibling=null,L}function c(L,E,_){return L.index=_,e?(_=L.alternate,_!==null?(_=_.index,_<E?(L.flags|=2,E):_):(L.flags|=2,E)):(L.flags|=1048576,E)}function p(L){return e&&L.alternate===null&&(L.flags|=2),L}function N(L,E,_,U){return E===null||E.tag!==6?(E=Eo(_,L.mode,U),E.return=L,E):(E=o(E,_),E.return=L,E)}function b(L,E,_,U){var J=_.type;return J===ee?O(L,E,_.props.children,U,_.key):E!==null&&(E.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===be&&Ic(J)===E.type)?(U=o(E,_.props),U.ref=$r(L,E,_),U.return=L,U):(U=cl(_.type,_.key,_.props,null,L.mode,U),U.ref=$r(L,E,_),U.return=L,U)}function D(L,E,_,U){return E===null||E.tag!==4||E.stateNode.containerInfo!==_.containerInfo||E.stateNode.implementation!==_.implementation?(E=Po(_,L.mode,U),E.return=L,E):(E=o(E,_.children||[]),E.return=L,E)}function O(L,E,_,U,J){return E===null||E.tag!==7?(E=Cn(_,L.mode,U,J),E.return=L,E):(E=o(E,_),E.return=L,E)}function B(L,E,_){if(typeof E=="string"&&E!==""||typeof E=="number")return E=Eo(""+E,L.mode,_),E.return=L,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case z:return _=cl(E.type,E.key,E.props,null,L.mode,_),_.ref=$r(L,null,E),_.return=L,_;case W:return E=Po(E,L.mode,_),E.return=L,E;case be:var U=E._init;return B(L,U(E._payload),_)}if(ur(E)||ne(E))return E=Cn(E,L.mode,_,null),E.return=L,E;As(L,E)}return null}function F(L,E,_,U){var J=E!==null?E.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return J!==null?null:N(L,E,""+_,U);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case z:return _.key===J?b(L,E,_,U):null;case W:return _.key===J?D(L,E,_,U):null;case be:return J=_._init,F(L,E,J(_._payload),U)}if(ur(_)||ne(_))return J!==null?null:O(L,E,_,U,null);As(L,_)}return null}function Q(L,E,_,U,J){if(typeof U=="string"&&U!==""||typeof U=="number")return L=L.get(_)||null,N(E,L,""+U,J);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return L=L.get(U.key===null?_:U.key)||null,b(E,L,U,J);case W:return L=L.get(U.key===null?_:U.key)||null,D(E,L,U,J);case be:var se=U._init;return Q(L,E,_,se(U._payload),J)}if(ur(U)||ne(U))return L=L.get(_)||null,O(E,L,U,J,null);As(E,U)}return null}function Y(L,E,_,U){for(var J=null,se=null,le=E,ae=E=0,Ge=null;le!==null&&ae<_.length;ae++){le.index>ae?(Ge=le,le=null):Ge=le.sibling;var ge=F(L,le,_[ae],U);if(ge===null){le===null&&(le=Ge);break}e&&le&&ge.alternate===null&&t(L,le),E=c(ge,E,ae),se===null?J=ge:se.sibling=ge,se=ge,le=Ge}if(ae===_.length)return n(L,le),Me&&yn(L,ae),J;if(le===null){for(;ae<_.length;ae++)le=B(L,_[ae],U),le!==null&&(E=c(le,E,ae),se===null?J=le:se.sibling=le,se=le);return Me&&yn(L,ae),J}for(le=l(L,le);ae<_.length;ae++)Ge=Q(le,L,ae,_[ae],U),Ge!==null&&(e&&Ge.alternate!==null&&le.delete(Ge.key===null?ae:Ge.key),E=c(Ge,E,ae),se===null?J=Ge:se.sibling=Ge,se=Ge);return e&&le.forEach(function(dn){return t(L,dn)}),Me&&yn(L,ae),J}function X(L,E,_,U){var J=ne(_);if(typeof J!="function")throw Error(i(150));if(_=J.call(_),_==null)throw Error(i(151));for(var se=J=null,le=E,ae=E=0,Ge=null,ge=_.next();le!==null&&!ge.done;ae++,ge=_.next()){le.index>ae?(Ge=le,le=null):Ge=le.sibling;var dn=F(L,le,ge.value,U);if(dn===null){le===null&&(le=Ge);break}e&&le&&dn.alternate===null&&t(L,le),E=c(dn,E,ae),se===null?J=dn:se.sibling=dn,se=dn,le=Ge}if(ge.done)return n(L,le),Me&&yn(L,ae),J;if(le===null){for(;!ge.done;ae++,ge=_.next())ge=B(L,ge.value,U),ge!==null&&(E=c(ge,E,ae),se===null?J=ge:se.sibling=ge,se=ge);return Me&&yn(L,ae),J}for(le=l(L,le);!ge.done;ae++,ge=_.next())ge=Q(le,L,ae,ge.value,U),ge!==null&&(e&&ge.alternate!==null&&le.delete(ge.key===null?ae:ge.key),E=c(ge,E,ae),se===null?J=ge:se.sibling=ge,se=ge);return e&&le.forEach(function(Sp){return t(L,Sp)}),Me&&yn(L,ae),J}function Oe(L,E,_,U){if(typeof _=="object"&&_!==null&&_.type===ee&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case z:e:{for(var J=_.key,se=E;se!==null;){if(se.key===J){if(J=_.type,J===ee){if(se.tag===7){n(L,se.sibling),E=o(se,_.props.children),E.return=L,L=E;break e}}else if(se.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===be&&Ic(J)===se.type){n(L,se.sibling),E=o(se,_.props),E.ref=$r(L,se,_),E.return=L,L=E;break e}n(L,se);break}else t(L,se);se=se.sibling}_.type===ee?(E=Cn(_.props.children,L.mode,U,_.key),E.return=L,L=E):(U=cl(_.type,_.key,_.props,null,L.mode,U),U.ref=$r(L,E,_),U.return=L,L=U)}return p(L);case W:e:{for(se=_.key;E!==null;){if(E.key===se)if(E.tag===4&&E.stateNode.containerInfo===_.containerInfo&&E.stateNode.implementation===_.implementation){n(L,E.sibling),E=o(E,_.children||[]),E.return=L,L=E;break e}else{n(L,E);break}else t(L,E);E=E.sibling}E=Po(_,L.mode,U),E.return=L,L=E}return p(L);case be:return se=_._init,Oe(L,E,se(_._payload),U)}if(ur(_))return Y(L,E,_,U);if(ne(_))return X(L,E,_,U);As(L,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,E!==null&&E.tag===6?(n(L,E.sibling),E=o(E,_),E.return=L,L=E):(n(L,E),E=Eo(_,L.mode,U),E.return=L,L=E),p(L)):n(L,E)}return Oe}var Wn=Fc(!0),Ac=Fc(!1),Os=Zt(null),Bs=null,Qn=null,za=null;function Ia(){za=Qn=Bs=null}function Fa(e){var t=Os.current;Re(Os),e._currentValue=t}function Aa(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Gn(e,t){Bs=e,za=Qn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(st=!0),e.firstContext=null)}function ht(e){var t=e._currentValue;if(za!==e)if(e={context:e,memoizedValue:t,next:null},Qn===null){if(Bs===null)throw Error(i(308));Qn=e,Bs.dependencies={lanes:0,firstContext:e}}else Qn=Qn.next=e;return t}var vn=null;function Oa(e){vn===null?vn=[e]:vn.push(e)}function Oc(e,t,n,l){var o=t.interleaved;return o===null?(n.next=n,Oa(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ot(e,l)}function Ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var nn=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(pe&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,Ot(e,n)}return o=l.interleaved,o===null?(t.next=t,Oa(l)):(t.next=o.next,o.next=t),l.interleaved=t,Ot(e,n)}function Us(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ta(e,n)}}function Uc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var p={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};c===null?o=c=p:c=c.next=p,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vs(e,t,n,l){var o=e.updateQueue;nn=!1;var c=o.firstBaseUpdate,p=o.lastBaseUpdate,N=o.shared.pending;if(N!==null){o.shared.pending=null;var b=N,D=b.next;b.next=null,p===null?c=D:p.next=D,p=b;var O=e.alternate;O!==null&&(O=O.updateQueue,N=O.lastBaseUpdate,N!==p&&(N===null?O.firstBaseUpdate=D:N.next=D,O.lastBaseUpdate=b))}if(c!==null){var B=o.baseState;p=0,O=D=b=null,N=c;do{var F=N.lane,Q=N.eventTime;if((l&F)===F){O!==null&&(O=O.next={eventTime:Q,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Y=e,X=N;switch(F=t,Q=n,X.tag){case 1:if(Y=X.payload,typeof Y=="function"){B=Y.call(Q,B,F);break e}B=Y;break e;case 3:Y.flags=Y.flags&-65537|128;case 0:if(Y=X.payload,F=typeof Y=="function"?Y.call(Q,B,F):Y,F==null)break e;B=q({},B,F);break e;case 2:nn=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,F=o.effects,F===null?o.effects=[N]:F.push(N))}else Q={eventTime:Q,lane:F,tag:N.tag,payload:N.payload,callback:N.callback,next:null},O===null?(D=O=Q,b=B):O=O.next=Q,p|=F;if(N=N.next,N===null){if(N=o.shared.pending,N===null)break;F=N,N=F.next,F.next=null,o.lastBaseUpdate=F,o.shared.pending=null}}while(!0);if(O===null&&(b=B),o.baseState=b,o.firstBaseUpdate=D,o.lastBaseUpdate=O,t=o.shared.interleaved,t!==null){o=t;do p|=o.lane,o=o.next;while(o!==t)}else c===null&&(o.shared.lanes=0);Nn|=p,e.lanes=p,e.memoizedState=B}}function Vc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],o=l.callback;if(o!==null){if(l.callback=null,l=n,typeof o!="function")throw Error(i(191,o));o.call(l)}}}var zr={},Lt=Zt(zr),Ir=Zt(zr),Fr=Zt(zr);function jn(e){if(e===zr)throw Error(i(174));return e}function Ua(e,t){switch(Ee(Fr,t),Ee(Ir,e),Ee(Lt,zr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vl(t,e)}Re(Lt),Ee(Lt,t)}function Kn(){Re(Lt),Re(Ir),Re(Fr)}function Hc(e){jn(Fr.current);var t=jn(Lt.current),n=Vl(t,e.type);t!==n&&(Ee(Ir,e),Ee(Lt,n))}function Va(e){Ir.current===e&&(Re(Lt),Re(Ir))}var _e=Zt(0);function Hs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Ha=[];function Wa(){for(var e=0;e<Ha.length;e++)Ha[e]._workInProgressVersionPrimary=null;Ha.length=0}var Ws=I.ReactCurrentDispatcher,Qa=I.ReactCurrentBatchConfig,wn=0,De=null,Ve=null,We=null,Qs=!1,Ar=!1,Or=0,Qm=0;function Xe(){throw Error(i(321))}function Ga(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function Ka(e,t,n,l,o,c){if(wn=c,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ws.current=e===null||e.memoizedState===null?Ym:Xm,e=n(l,o),Ar){c=0;do{if(Ar=!1,Or=0,25<=c)throw Error(i(301));c+=1,We=Ve=null,t.updateQueue=null,Ws.current=Jm,e=n(l,o)}while(Ar)}if(Ws.current=qs,t=Ve!==null&&Ve.next!==null,wn=0,We=Ve=De=null,Qs=!1,t)throw Error(i(300));return e}function qa(){var e=Or!==0;return Or=0,e}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?De.memoizedState=We=e:We=We.next=e,We}function xt(){if(Ve===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=We===null?De.memoizedState:We.next;if(t!==null)We=t,Ve=e;else{if(e===null)throw Error(i(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},We===null?De.memoizedState=We=e:We=We.next=e}return We}function Br(e,t){return typeof t=="function"?t(e):t}function Ya(e){var t=xt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var l=Ve,o=l.baseQueue,c=n.pending;if(c!==null){if(o!==null){var p=o.next;o.next=c.next,c.next=p}l.baseQueue=o=c,n.pending=null}if(o!==null){c=o.next,l=l.baseState;var N=p=null,b=null,D=c;do{var O=D.lane;if((wn&O)===O)b!==null&&(b=b.next={lane:0,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),l=D.hasEagerState?D.eagerState:e(l,D.action);else{var B={lane:O,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null};b===null?(N=b=B,p=l):b=b.next=B,De.lanes|=O,Nn|=O}D=D.next}while(D!==null&&D!==c);b===null?p=l:b.next=N,wt(l,t.memoizedState)||(st=!0),t.memoizedState=l,t.baseState=p,t.baseQueue=b,n.lastRenderedState=l}if(e=n.interleaved,e!==null){o=e;do c=o.lane,De.lanes|=c,Nn|=c,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Xa(e){var t=xt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var l=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var p=o=o.next;do c=e(c,p.action),p=p.next;while(p!==o);wt(c,t.memoizedState)||(st=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function Wc(){}function Qc(e,t){var n=De,l=xt(),o=t(),c=!wt(l.memoizedState,o);if(c&&(l.memoizedState=o,st=!0),l=l.queue,Ja(qc.bind(null,n,l,e),[e]),l.getSnapshot!==t||c||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,Ur(9,Kc.bind(null,n,l,o,t),void 0,null),Qe===null)throw Error(i(349));(wn&30)!==0||Gc(n,t,o)}return o}function Gc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Kc(e,t,n,l){t.value=n,t.getSnapshot=l,Yc(t)&&Xc(e)}function qc(e,t,n){return n(function(){Yc(t)&&Xc(e)})}function Yc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function Xc(e){var t=Ot(e,1);t!==null&&Ct(t,e,1,-1)}function Jc(e){var t=Mt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Br,lastRenderedState:e},t.queue=e,e=e.dispatch=qm.bind(null,De,e),[t.memoizedState,e]}function Ur(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function Zc(){return xt().memoizedState}function Gs(e,t,n,l){var o=Mt();De.flags|=e,o.memoizedState=Ur(1|t,n,void 0,l===void 0?null:l)}function Ks(e,t,n,l){var o=xt();l=l===void 0?null:l;var c=void 0;if(Ve!==null){var p=Ve.memoizedState;if(c=p.destroy,l!==null&&Ga(l,p.deps)){o.memoizedState=Ur(t,n,c,l);return}}De.flags|=e,o.memoizedState=Ur(1|t,n,c,l)}function eu(e,t){return Gs(8390656,8,e,t)}function Ja(e,t){return Ks(2048,8,e,t)}function tu(e,t){return Ks(4,2,e,t)}function nu(e,t){return Ks(4,4,e,t)}function ru(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function su(e,t,n){return n=n!=null?n.concat([e]):null,Ks(4,4,ru.bind(null,t,e),n)}function Za(){}function lu(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ga(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function au(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Ga(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function ou(e,t,n){return(wn&21)===0?(e.baseState&&(e.baseState=!1,st=!0),e.memoizedState=n):(wt(n,t)||(n=Ii(),De.lanes|=n,Nn|=n,e.baseState=!0),t)}function Gm(e,t){var n=Ne;Ne=n!==0&&4>n?n:4,e(!0);var l=Qa.transition;Qa.transition={};try{e(!1),t()}finally{Ne=n,Qa.transition=l}}function iu(){return xt().memoizedState}function Km(e,t,n){var l=on(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},cu(e))uu(t,n);else if(n=Oc(e,t,n,l),n!==null){var o=tt();Ct(n,e,l,o),du(n,t,l)}}function qm(e,t,n){var l=on(e),o={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(cu(e))uu(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,N=c(p,n);if(o.hasEagerState=!0,o.eagerState=N,wt(N,p)){var b=t.interleaved;b===null?(o.next=o,Oa(t)):(o.next=b.next,b.next=o),t.interleaved=o;return}}catch{}finally{}n=Oc(e,t,o,l),n!==null&&(o=tt(),Ct(n,e,l,o),du(n,t,l))}}function cu(e){var t=e.alternate;return e===De||t!==null&&t===De}function uu(e,t){Ar=Qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function du(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,ta(e,n)}}var qs={readContext:ht,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useInsertionEffect:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useSyncExternalStore:Xe,useId:Xe,unstable_isNewReconciler:!1},Ym={readContext:ht,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:eu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gs(4194308,4,ru.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gs(4,2,e,t)},useMemo:function(e,t){var n=Mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Mt();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Km.bind(null,De,e),[l.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:Jc,useDebugValue:Za,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=Jc(!1),t=e[0];return e=Gm.bind(null,e[1]),Mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=De,o=Mt();if(Me){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qe===null)throw Error(i(349));(wn&30)!==0||Gc(l,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,eu(qc.bind(null,l,c,e),[e]),l.flags|=2048,Ur(9,Kc.bind(null,l,c,n,t),void 0,null),n},useId:function(){var e=Mt(),t=Qe.identifierPrefix;if(Me){var n=At,l=Ft;n=(l&~(1<<32-jt(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=Or++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Qm++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Xm={readContext:ht,useCallback:lu,useContext:ht,useEffect:Ja,useImperativeHandle:su,useInsertionEffect:tu,useLayoutEffect:nu,useMemo:au,useReducer:Ya,useRef:Zc,useState:function(){return Ya(Br)},useDebugValue:Za,useDeferredValue:function(e){var t=xt();return ou(t,Ve.memoizedState,e)},useTransition:function(){var e=Ya(Br)[0],t=xt().memoizedState;return[e,t]},useMutableSource:Wc,useSyncExternalStore:Qc,useId:iu,unstable_isNewReconciler:!1},Jm={readContext:ht,useCallback:lu,useContext:ht,useEffect:Ja,useImperativeHandle:su,useInsertionEffect:tu,useLayoutEffect:nu,useMemo:au,useReducer:Xa,useRef:Zc,useState:function(){return Xa(Br)},useDebugValue:Za,useDeferredValue:function(e){var t=xt();return Ve===null?t.memoizedState=e:ou(t,Ve.memoizedState,e)},useTransition:function(){var e=Xa(Br)[0],t=xt().memoizedState;return[e,t]},useMutableSource:Wc,useSyncExternalStore:Qc,useId:iu,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=q({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function eo(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:q({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={isMounted:function(e){return(e=e._reactInternals)?pn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=tt(),o=on(e),c=Bt(l,o);c.payload=t,n!=null&&(c.callback=n),t=rn(e,c,o),t!==null&&(Ct(t,e,o,l),Us(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=tt(),o=on(e),c=Bt(l,o);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=rn(e,c,o),t!==null&&(Ct(t,e,o,l),Us(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tt(),l=on(e),o=Bt(n,l);o.tag=2,t!=null&&(o.callback=t),t=rn(e,o,l),t!==null&&(Ct(t,e,l,n),Us(t,e,l))}};function fu(e,t,n,l,o,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,p):t.prototype&&t.prototype.isPureReactComponent?!Pr(n,l)||!Pr(o,c):!0}function mu(e,t,n){var l=!1,o=en,c=t.contextType;return typeof c=="object"&&c!==null?c=ht(c):(o=rt(t)?xn:Ye.current,l=t.contextTypes,c=(l=l!=null)?Bn(e,o):en),t=new t(n,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ys,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=c),t}function pu(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Ys.enqueueReplaceState(t,t.state,null)}function to(e,t,n,l){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ba(e);var c=t.contextType;typeof c=="object"&&c!==null?o.context=ht(c):(c=rt(t)?xn:Ye.current,o.context=Bn(e,c)),o.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(eo(e,t,c,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Ys.enqueueReplaceState(o,o.state,null),Vs(e,n,o,l),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function qn(e,t){try{var n="",l=t;do n+=he(l),l=l.return;while(l);var o=n}catch(c){o=`
39
+ Error generating stack: `+c.message+`
40
+ `+c.stack}return{value:e,source:t,stack:o,digest:null}}function no(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ro(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Zm=typeof WeakMap=="function"?WeakMap:Map;function hu(e,t,n){n=Bt(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){rl||(rl=!0,vo=l),ro(e,t)},n}function xu(e,t,n){n=Bt(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var o=t.value;n.payload=function(){return l(o)},n.callback=function(){ro(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){ro(e,t),typeof l!="function"&&(ln===null?ln=new Set([this]):ln.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),n}function gu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Zm;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(n)||(o.add(n),e=mp.bind(null,e,t,n),t.then(e,e))}function yu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vu(e,t,n,l,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bt(-1,1),t.tag=2,rn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var ep=I.ReactCurrentOwner,st=!1;function et(e,t,n,l){t.child=e===null?Ac(t,null,n,l):Wn(t,e.child,n,l)}function ju(e,t,n,l,o){n=n.render;var c=t.ref;return Gn(t,o),l=Ka(e,t,n,l,c,o),n=qa(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ut(e,t,o)):(Me&&n&&La(t),t.flags|=1,et(e,t,l,o),t.child)}function wu(e,t,n,l,o){if(e===null){var c=n.type;return typeof c=="function"&&!Co(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,Nu(e,t,c,l,o)):(e=cl(n.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&o)===0){var p=c.memoizedProps;if(n=n.compare,n=n!==null?n:Pr,n(p,l)&&e.ref===t.ref)return Ut(e,t,o)}return t.flags|=1,e=un(c,l),e.ref=t.ref,e.return=t,t.child=e}function Nu(e,t,n,l,o){if(e!==null){var c=e.memoizedProps;if(Pr(c,l)&&e.ref===t.ref)if(st=!1,t.pendingProps=l=c,(e.lanes&o)!==0)(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Ut(e,t,o)}return so(e,t,n,l,o)}function ku(e,t,n){var l=t.pendingProps,o=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(Xn,ft),ft|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ee(Xn,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:n,Ee(Xn,ft),ft|=l}else c!==null?(l=c.baseLanes|n,t.memoizedState=null):l=n,Ee(Xn,ft),ft|=l;return et(e,t,o,n),t.child}function Su(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function so(e,t,n,l,o){var c=rt(n)?xn:Ye.current;return c=Bn(t,c),Gn(t,o),n=Ka(e,t,n,l,c,o),l=qa(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ut(e,t,o)):(Me&&l&&La(t),t.flags|=1,et(e,t,n,o),t.child)}function bu(e,t,n,l,o){if(rt(n)){var c=!0;Ds(t)}else c=!1;if(Gn(t,o),t.stateNode===null)Js(e,t),mu(t,n,l),to(t,n,l,o),l=!0;else if(e===null){var p=t.stateNode,N=t.memoizedProps;p.props=N;var b=p.context,D=n.contextType;typeof D=="object"&&D!==null?D=ht(D):(D=rt(n)?xn:Ye.current,D=Bn(t,D));var O=n.getDerivedStateFromProps,B=typeof O=="function"||typeof p.getSnapshotBeforeUpdate=="function";B||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==l||b!==D)&&pu(t,p,l,D),nn=!1;var F=t.memoizedState;p.state=F,Vs(t,l,p,o),b=t.memoizedState,N!==l||F!==b||nt.current||nn?(typeof O=="function"&&(eo(t,n,O,l),b=t.memoizedState),(N=nn||fu(t,n,N,l,F,b,D))?(B||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=b),p.props=l,p.state=b,p.context=D,l=N):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{p=t.stateNode,Bc(e,t),N=t.memoizedProps,D=t.type===t.elementType?N:kt(t.type,N),p.props=D,B=t.pendingProps,F=p.context,b=n.contextType,typeof b=="object"&&b!==null?b=ht(b):(b=rt(n)?xn:Ye.current,b=Bn(t,b));var Q=n.getDerivedStateFromProps;(O=typeof Q=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==B||F!==b)&&pu(t,p,l,b),nn=!1,F=t.memoizedState,p.state=F,Vs(t,l,p,o);var Y=t.memoizedState;N!==B||F!==Y||nt.current||nn?(typeof Q=="function"&&(eo(t,n,Q,l),Y=t.memoizedState),(D=nn||fu(t,n,D,l,F,Y,b)||!1)?(O||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,Y,b),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,Y,b)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Y),p.props=l,p.state=Y,p.context=b,l=D):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),l=!1)}return lo(e,t,n,l,c,o)}function lo(e,t,n,l,o,c){Su(e,t);var p=(t.flags&128)!==0;if(!l&&!p)return o&&Rc(t,n,!1),Ut(e,t,c);l=t.stateNode,ep.current=t;var N=p&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&p?(t.child=Wn(t,e.child,null,c),t.child=Wn(t,null,N,c)):et(e,t,N,c),t.memoizedState=l.state,o&&Rc(t,n,!0),t.child}function Cu(e){var t=e.stateNode;t.pendingContext?Pc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pc(e,t.context,!1),Ua(e,t.containerInfo)}function Eu(e,t,n,l,o){return Hn(),$a(o),t.flags|=256,et(e,t,n,l),t.child}var ao={dehydrated:null,treeContext:null,retryLane:0};function oo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pu(e,t,n){var l=t.pendingProps,o=_e.current,c=!1,p=(t.flags&128)!==0,N;if((N=p)||(N=e!==null&&e.memoizedState===null?!1:(o&2)!==0),N?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ee(_e,o&1),e===null)return Da(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=l.children,e=l.fallback,c?(l=t.mode,c=t.child,p={mode:"hidden",children:p},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=p):c=ul(p,l,0,null),e=Cn(e,l,n,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=oo(n),t.memoizedState=ao,e):io(t,p));if(o=e.memoizedState,o!==null&&(N=o.dehydrated,N!==null))return tp(e,t,p,l,N,o,n);if(c){c=l.fallback,p=t.mode,o=e.child,N=o.sibling;var b={mode:"hidden",children:l.children};return(p&1)===0&&t.child!==o?(l=t.child,l.childLanes=0,l.pendingProps=b,t.deletions=null):(l=un(o,b),l.subtreeFlags=o.subtreeFlags&14680064),N!==null?c=un(N,c):(c=Cn(c,p,n,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,p=e.child.memoizedState,p=p===null?oo(n):{baseLanes:p.baseLanes|n,cachePool:null,transitions:p.transitions},c.memoizedState=p,c.childLanes=e.childLanes&~n,t.memoizedState=ao,l}return c=e.child,e=c.sibling,l=un(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function io(e,t){return t=ul({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xs(e,t,n,l){return l!==null&&$a(l),Wn(t,e.child,null,n),e=io(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tp(e,t,n,l,o,c,p){if(n)return t.flags&256?(t.flags&=-257,l=no(Error(i(422))),Xs(e,t,p,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,o=t.mode,l=ul({mode:"visible",children:l.children},o,0,null),c=Cn(c,o,p,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&Wn(t,e.child,null,p),t.child.memoizedState=oo(p),t.memoizedState=ao,c);if((t.mode&1)===0)return Xs(e,t,p,null);if(o.data==="$!"){if(l=o.nextSibling&&o.nextSibling.dataset,l)var N=l.dgst;return l=N,c=Error(i(419)),l=no(c,l,void 0),Xs(e,t,p,l)}if(N=(p&e.childLanes)!==0,st||N){if(l=Qe,l!==null){switch(p&-p){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(l.suspendedLanes|p))!==0?0:o,o!==0&&o!==c.retryLane&&(c.retryLane=o,Ot(e,o),Ct(l,e,o,-1))}return bo(),l=no(Error(i(421))),Xs(e,t,p,l)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=pp.bind(null,e),o._reactRetry=t,null):(e=c.treeContext,dt=Jt(o.nextSibling),ut=t,Me=!0,Nt=null,e!==null&&(mt[pt++]=Ft,mt[pt++]=At,mt[pt++]=gn,Ft=e.id,At=e.overflow,gn=t),t=io(t,l.children),t.flags|=4096,t)}function Tu(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Aa(e.return,t,n)}function co(e,t,n,l,o){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:o}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=n,c.tailMode=o)}function Ru(e,t,n){var l=t.pendingProps,o=l.revealOrder,c=l.tail;if(et(e,t,l.children,n),l=_e.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tu(e,n,t);else if(e.tag===19)Tu(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}l&=1}if(Ee(_e,l),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Hs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),co(t,!1,o,n,c);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Hs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}co(t,!0,n,null,c);break;case"together":co(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Js(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ut(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=un(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=un(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function np(e,t,n){switch(t.tag){case 3:Cu(t),Hn();break;case 5:Hc(t);break;case 1:rt(t.type)&&Ds(t);break;case 4:Ua(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,o=t.memoizedProps.value;Ee(Os,l._currentValue),l._currentValue=o;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(Ee(_e,_e.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Pu(e,t,n):(Ee(_e,_e.current&1),e=Ut(e,t,n),e!==null?e.sibling:null);Ee(_e,_e.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Ru(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ee(_e,_e.current),l)break;return null;case 22:case 23:return t.lanes=0,ku(e,t,n)}return Ut(e,t,n)}var Lu,uo,Mu,_u;Lu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},uo=function(){},Mu=function(e,t,n,l){var o=e.memoizedProps;if(o!==l){e=t.stateNode,jn(Lt.current);var c=null;switch(n){case"input":o=Al(e,o),l=Al(e,l),c=[];break;case"select":o=q({},o,{value:void 0}),l=q({},l,{value:void 0}),c=[];break;case"textarea":o=Ul(e,o),l=Ul(e,l),c=[];break;default:typeof o.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Ls)}Hl(n,l);var p;n=null;for(D in o)if(!l.hasOwnProperty(D)&&o.hasOwnProperty(D)&&o[D]!=null)if(D==="style"){var N=o[D];for(p in N)N.hasOwnProperty(p)&&(n||(n={}),n[p]="")}else D!=="dangerouslySetInnerHTML"&&D!=="children"&&D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&D!=="autoFocus"&&(f.hasOwnProperty(D)?c||(c=[]):(c=c||[]).push(D,null));for(D in l){var b=l[D];if(N=o!=null?o[D]:void 0,l.hasOwnProperty(D)&&b!==N&&(b!=null||N!=null))if(D==="style")if(N){for(p in N)!N.hasOwnProperty(p)||b&&b.hasOwnProperty(p)||(n||(n={}),n[p]="");for(p in b)b.hasOwnProperty(p)&&N[p]!==b[p]&&(n||(n={}),n[p]=b[p])}else n||(c||(c=[]),c.push(D,n)),n=b;else D==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,N=N?N.__html:void 0,b!=null&&N!==b&&(c=c||[]).push(D,b)):D==="children"?typeof b!="string"&&typeof b!="number"||(c=c||[]).push(D,""+b):D!=="suppressContentEditableWarning"&&D!=="suppressHydrationWarning"&&(f.hasOwnProperty(D)?(b!=null&&D==="onScroll"&&Te("scroll",e),c||N===b||(c=[])):(c=c||[]).push(D,b))}n&&(c=c||[]).push("style",n);var D=c;(t.updateQueue=D)&&(t.flags|=4)}},_u=function(e,t,n,l){n!==l&&(t.flags|=4)};function Vr(e,t){if(!Me)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 l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags&14680064,l|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function rp(e,t,n){var l=t.pendingProps;switch(Ma(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return rt(t.type)&&_s(),Je(t),null;case 3:return l=t.stateNode,Kn(),Re(nt),Re(Ye),Wa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nt!==null&&(No(Nt),Nt=null))),uo(e,t),Je(t),null;case 5:Va(t);var o=jn(Fr.current);if(n=t.type,e!==null&&t.stateNode!=null)Mu(e,t,n,l,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(i(166));return Je(t),null}if(e=jn(Lt.current),Fs(t)){l=t.stateNode,n=t.type;var c=t.memoizedProps;switch(l[Rt]=t,l[_r]=c,e=(t.mode&1)!==0,n){case"dialog":Te("cancel",l),Te("close",l);break;case"iframe":case"object":case"embed":Te("load",l);break;case"video":case"audio":for(o=0;o<Rr.length;o++)Te(Rr[o],l);break;case"source":Te("error",l);break;case"img":case"image":case"link":Te("error",l),Te("load",l);break;case"details":Te("toggle",l);break;case"input":mi(l,c),Te("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},Te("invalid",l);break;case"textarea":xi(l,c),Te("invalid",l)}Hl(n,c),o=null;for(var p in c)if(c.hasOwnProperty(p)){var N=c[p];p==="children"?typeof N=="string"?l.textContent!==N&&(c.suppressHydrationWarning!==!0&&Rs(l.textContent,N,e),o=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(c.suppressHydrationWarning!==!0&&Rs(l.textContent,N,e),o=["children",""+N]):f.hasOwnProperty(p)&&N!=null&&p==="onScroll"&&Te("scroll",l)}switch(n){case"input":os(l),hi(l,c,!0);break;case"textarea":os(l),yi(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=Ls)}l=o,t.updateQueue=l,l!==null&&(t.flags|=4)}else{p=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vi(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=p.createElement(n,{is:l.is}):(e=p.createElement(n),n==="select"&&(p=e,l.multiple?p.multiple=!0:l.size&&(p.size=l.size))):e=p.createElementNS(e,n),e[Rt]=t,e[_r]=l,Lu(e,t,!1,!1),t.stateNode=e;e:{switch(p=Wl(n,l),n){case"dialog":Te("cancel",e),Te("close",e),o=l;break;case"iframe":case"object":case"embed":Te("load",e),o=l;break;case"video":case"audio":for(o=0;o<Rr.length;o++)Te(Rr[o],e);o=l;break;case"source":Te("error",e),o=l;break;case"img":case"image":case"link":Te("error",e),Te("load",e),o=l;break;case"details":Te("toggle",e),o=l;break;case"input":mi(e,l),o=Al(e,l),Te("invalid",e);break;case"option":o=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},o=q({},l,{value:void 0}),Te("invalid",e);break;case"textarea":xi(e,l),o=Ul(e,l),Te("invalid",e);break;default:o=l}Hl(n,o),N=o;for(c in N)if(N.hasOwnProperty(c)){var b=N[c];c==="style"?Ni(e,b):c==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,b!=null&&ji(e,b)):c==="children"?typeof b=="string"?(n!=="textarea"||b!=="")&&dr(e,b):typeof b=="number"&&dr(e,""+b):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(f.hasOwnProperty(c)?b!=null&&c==="onScroll"&&Te("scroll",e):b!=null&&T(e,c,b,p))}switch(n){case"input":os(e),hi(e,l,!1);break;case"textarea":os(e),yi(e);break;case"option":l.value!=null&&e.setAttribute("value",""+we(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?Tn(e,!!l.multiple,c,!1):l.defaultValue!=null&&Tn(e,!!l.multiple,l.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ls)}switch(n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Je(t),null;case 6:if(e&&t.stateNode!=null)_u(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(n=jn(Fr.current),jn(Lt.current),Fs(t)){if(l=t.stateNode,n=t.memoizedProps,l[Rt]=t,(c=l.nodeValue!==n)&&(e=ut,e!==null))switch(e.tag){case 3:Rs(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rs(l.nodeValue,n,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[Rt]=t,t.stateNode=l}return Je(t),null;case 13:if(Re(_e),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Me&&dt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)zc(),Hn(),t.flags|=98560,c=!1;else if(c=Fs(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Rt]=t}else Hn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else Nt!==null&&(No(Nt),Nt=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(_e.current&1)!==0?He===0&&(He=3):bo())),t.updateQueue!==null&&(t.flags|=4),Je(t),null);case 4:return Kn(),uo(e,t),e===null&&Lr(t.stateNode.containerInfo),Je(t),null;case 10:return Fa(t.type._context),Je(t),null;case 17:return rt(t.type)&&_s(),Je(t),null;case 19:if(Re(_e),c=t.memoizedState,c===null)return Je(t),null;if(l=(t.flags&128)!==0,p=c.rendering,p===null)if(l)Vr(c,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=Hs(e),p!==null){for(t.flags|=128,Vr(c,!1),l=p.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)c=n,e=l,c.flags&=14680066,p=c.alternate,p===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,e=p.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ee(_e,_e.current&1|2),t.child}e=e.sibling}c.tail!==null&&Ae()>Jn&&(t.flags|=128,l=!0,Vr(c,!1),t.lanes=4194304)}else{if(!l)if(e=Hs(p),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vr(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!Me)return Je(t),null}else 2*Ae()-c.renderingStartTime>Jn&&n!==1073741824&&(t.flags|=128,l=!0,Vr(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(n=c.last,n!==null?n.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Ae(),t.sibling=null,n=_e.current,Ee(_e,l?n&1|2:n&1),t):(Je(t),null);case 22:case 23:return So(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(ft&1073741824)!==0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function sp(e,t){switch(Ma(t),t.tag){case 1:return rt(t.type)&&_s(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(),Re(nt),Re(Ye),Wa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Va(t),null;case 13:if(Re(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(_e),null;case 4:return Kn(),null;case 10:return Fa(t.type._context),null;case 22:case 23:return So(),null;case 24:return null;default:return null}}var Zs=!1,Ze=!1,lp=typeof WeakSet=="function"?WeakSet:Set,K=null;function Yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Ie(e,t,l)}else n.current=null}function fo(e,t,n){try{n()}catch(l){Ie(e,t,l)}}var Du=!1;function ap(e,t){if(ka=vs,e=fc(),ha(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var o=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,N=-1,b=-1,D=0,O=0,B=e,F=null;t:for(;;){for(var Q;B!==n||o!==0&&B.nodeType!==3||(N=p+o),B!==c||l!==0&&B.nodeType!==3||(b=p+l),B.nodeType===3&&(p+=B.nodeValue.length),(Q=B.firstChild)!==null;)F=B,B=Q;for(;;){if(B===e)break t;if(F===n&&++D===o&&(N=p),F===c&&++O===l&&(b=p),(Q=B.nextSibling)!==null)break;B=F,F=B.parentNode}B=Q}n=N===-1||b===-1?null:{start:N,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sa={focusedElem:e,selectionRange:n},vs=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var Y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Y!==null){var X=Y.memoizedProps,Oe=Y.memoizedState,L=t.stateNode,E=L.getSnapshotBeforeUpdate(t.elementType===t.type?X:kt(t.type,X),Oe);L.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(U){Ie(t,t.return,U)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return Y=Du,Du=!1,Y}function Hr(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var o=l=l.next;do{if((o.tag&e)===e){var c=o.destroy;o.destroy=void 0,c!==void 0&&fo(t,n,c)}o=o.next}while(o!==l)}}function el(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function mo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function $u(e){var t=e.alternate;t!==null&&(e.alternate=null,$u(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[_r],delete t[Pa],delete t[Um],delete t[Vm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function zu(e){return e.tag===5||e.tag===3||e.tag===4}function Iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zu(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.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 po(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ls));else if(l!==4&&(e=e.child,e!==null))for(po(e,t,n),e=e.sibling;e!==null;)po(e,t,n),e=e.sibling}function ho(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(ho(e,t,n),e=e.sibling;e!==null;)ho(e,t,n),e=e.sibling}var Ke=null,St=!1;function sn(e,t,n){for(n=n.child;n!==null;)Fu(e,t,n),n=n.sibling}function Fu(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(ms,n)}catch{}switch(n.tag){case 5:Ze||Yn(n,t);case 6:var l=Ke,o=St;Ke=null,sn(e,t,n),Ke=l,St=o,Ke!==null&&(St?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(St?(e=Ke,n=n.stateNode,e.nodeType===8?Ea(e.parentNode,n):e.nodeType===1&&Ea(e,n),Nr(e)):Ea(Ke,n.stateNode));break;case 4:l=Ke,o=St,Ke=n.stateNode.containerInfo,St=!0,sn(e,t,n),Ke=l,St=o;break;case 0:case 11:case 14:case 15:if(!Ze&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){o=l=l.next;do{var c=o,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&fo(n,t,p),o=o.next}while(o!==l)}sn(e,t,n);break;case 1:if(!Ze&&(Yn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(N){Ie(n,t,N)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(Ze=(l=Ze)||n.memoizedState!==null,sn(e,t,n),Ze=l):sn(e,t,n);break;default:sn(e,t,n)}}function Au(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lp),t.forEach(function(l){var o=hp.bind(null,e,l);n.has(l)||(n.add(l),l.then(o,o))})}}function bt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];try{var c=e,p=t,N=p;e:for(;N!==null;){switch(N.tag){case 5:Ke=N.stateNode,St=!1;break e;case 3:Ke=N.stateNode.containerInfo,St=!0;break e;case 4:Ke=N.stateNode.containerInfo,St=!0;break e}N=N.return}if(Ke===null)throw Error(i(160));Fu(c,p,o),Ke=null,St=!1;var b=o.alternate;b!==null&&(b.return=null),o.return=null}catch(D){Ie(o,t,D)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling}function Ou(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(bt(t,e),_t(e),l&4){try{Hr(3,e,e.return),el(3,e)}catch(X){Ie(e,e.return,X)}try{Hr(5,e,e.return)}catch(X){Ie(e,e.return,X)}}break;case 1:bt(t,e),_t(e),l&512&&n!==null&&Yn(n,n.return);break;case 5:if(bt(t,e),_t(e),l&512&&n!==null&&Yn(n,n.return),e.flags&32){var o=e.stateNode;try{dr(o,"")}catch(X){Ie(e,e.return,X)}}if(l&4&&(o=e.stateNode,o!=null)){var c=e.memoizedProps,p=n!==null?n.memoizedProps:c,N=e.type,b=e.updateQueue;if(e.updateQueue=null,b!==null)try{N==="input"&&c.type==="radio"&&c.name!=null&&pi(o,c),Wl(N,p);var D=Wl(N,c);for(p=0;p<b.length;p+=2){var O=b[p],B=b[p+1];O==="style"?Ni(o,B):O==="dangerouslySetInnerHTML"?ji(o,B):O==="children"?dr(o,B):T(o,O,B,D)}switch(N){case"input":Ol(o,c);break;case"textarea":gi(o,c);break;case"select":var F=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!c.multiple;var Q=c.value;Q!=null?Tn(o,!!c.multiple,Q,!1):F!==!!c.multiple&&(c.defaultValue!=null?Tn(o,!!c.multiple,c.defaultValue,!0):Tn(o,!!c.multiple,c.multiple?[]:"",!1))}o[_r]=c}catch(X){Ie(e,e.return,X)}}break;case 6:if(bt(t,e),_t(e),l&4){if(e.stateNode===null)throw Error(i(162));o=e.stateNode,c=e.memoizedProps;try{o.nodeValue=c}catch(X){Ie(e,e.return,X)}}break;case 3:if(bt(t,e),_t(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Nr(t.containerInfo)}catch(X){Ie(e,e.return,X)}break;case 4:bt(t,e),_t(e);break;case 13:bt(t,e),_t(e),o=e.child,o.flags&8192&&(c=o.memoizedState!==null,o.stateNode.isHidden=c,!c||o.alternate!==null&&o.alternate.memoizedState!==null||(yo=Ae())),l&4&&Au(e);break;case 22:if(O=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(D=Ze)||O,bt(t,e),Ze=D):bt(t,e),_t(e),l&8192){if(D=e.memoizedState!==null,(e.stateNode.isHidden=D)&&!O&&(e.mode&1)!==0)for(K=e,O=e.child;O!==null;){for(B=K=O;K!==null;){switch(F=K,Q=F.child,F.tag){case 0:case 11:case 14:case 15:Hr(4,F,F.return);break;case 1:Yn(F,F.return);var Y=F.stateNode;if(typeof Y.componentWillUnmount=="function"){l=F,n=F.return;try{t=l,Y.props=t.memoizedProps,Y.state=t.memoizedState,Y.componentWillUnmount()}catch(X){Ie(l,n,X)}}break;case 5:Yn(F,F.return);break;case 22:if(F.memoizedState!==null){Vu(B);continue}}Q!==null?(Q.return=F,K=Q):Vu(B)}O=O.sibling}e:for(O=null,B=e;;){if(B.tag===5){if(O===null){O=B;try{o=B.stateNode,D?(c=o.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(N=B.stateNode,b=B.memoizedProps.style,p=b!=null&&b.hasOwnProperty("display")?b.display:null,N.style.display=wi("display",p))}catch(X){Ie(e,e.return,X)}}}else if(B.tag===6){if(O===null)try{B.stateNode.nodeValue=D?"":B.memoizedProps}catch(X){Ie(e,e.return,X)}}else if((B.tag!==22&&B.tag!==23||B.memoizedState===null||B===e)&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===e)break e;for(;B.sibling===null;){if(B.return===null||B.return===e)break e;O===B&&(O=null),B=B.return}O===B&&(O=null),B.sibling.return=B.return,B=B.sibling}}break;case 19:bt(t,e),_t(e),l&4&&Au(e);break;case 21:break;default:bt(t,e),_t(e)}}function _t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(zu(n)){var l=n;break e}n=n.return}throw Error(i(160))}switch(l.tag){case 5:var o=l.stateNode;l.flags&32&&(dr(o,""),l.flags&=-33);var c=Iu(e);ho(e,c,o);break;case 3:case 4:var p=l.stateNode.containerInfo,N=Iu(e);po(e,N,p);break;default:throw Error(i(161))}}catch(b){Ie(e,e.return,b)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function op(e,t,n){K=e,Bu(e)}function Bu(e,t,n){for(var l=(e.mode&1)!==0;K!==null;){var o=K,c=o.child;if(o.tag===22&&l){var p=o.memoizedState!==null||Zs;if(!p){var N=o.alternate,b=N!==null&&N.memoizedState!==null||Ze;N=Zs;var D=Ze;if(Zs=p,(Ze=b)&&!D)for(K=o;K!==null;)p=K,b=p.child,p.tag===22&&p.memoizedState!==null?Hu(o):b!==null?(b.return=p,K=b):Hu(o);for(;c!==null;)K=c,Bu(c),c=c.sibling;K=o,Zs=N,Ze=D}Uu(e)}else(o.subtreeFlags&8772)!==0&&c!==null?(c.return=o,K=c):Uu(e)}}function Uu(e){for(;K!==null;){var t=K;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ze||el(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!Ze)if(n===null)l.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);l.componentDidUpdate(o,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Vc(t,c,l);break;case 3:var p=t.updateQueue;if(p!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Vc(t,p,n)}break;case 5:var N=t.stateNode;if(n===null&&t.flags&4){n=N;var b=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":b.autoFocus&&n.focus();break;case"img":b.src&&(n.src=b.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var D=t.alternate;if(D!==null){var O=D.memoizedState;if(O!==null){var B=O.dehydrated;B!==null&&Nr(B)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Ze||t.flags&512&&mo(t)}catch(F){Ie(t,t.return,F)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Vu(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Hu(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{el(4,t)}catch(b){Ie(t,n,b)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var o=t.return;try{l.componentDidMount()}catch(b){Ie(t,o,b)}}var c=t.return;try{mo(t)}catch(b){Ie(t,c,b)}break;case 5:var p=t.return;try{mo(t)}catch(b){Ie(t,p,b)}}}catch(b){Ie(t,t.return,b)}if(t===e){K=null;break}var N=t.sibling;if(N!==null){N.return=t.return,K=N;break}K=t.return}}var ip=Math.ceil,tl=I.ReactCurrentDispatcher,xo=I.ReactCurrentOwner,gt=I.ReactCurrentBatchConfig,pe=0,Qe=null,Ue=null,qe=0,ft=0,Xn=Zt(0),He=0,Wr=null,Nn=0,nl=0,go=0,Qr=null,lt=null,yo=0,Jn=1/0,Vt=null,rl=!1,vo=null,ln=null,sl=!1,an=null,ll=0,Gr=0,jo=null,al=-1,ol=0;function tt(){return(pe&6)!==0?Ae():al!==-1?al:al=Ae()}function on(e){return(e.mode&1)===0?1:(pe&2)!==0&&qe!==0?qe&-qe:Wm.transition!==null?(ol===0&&(ol=Ii()),ol):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:Qi(e.type)),e)}function Ct(e,t,n,l){if(50<Gr)throw Gr=0,jo=null,Error(i(185));gr(e,n,l),((pe&2)===0||e!==Qe)&&(e===Qe&&((pe&2)===0&&(nl|=n),He===4&&cn(e,qe)),at(e,l),n===1&&pe===0&&(t.mode&1)===0&&(Jn=Ae()+500,$s&&tn()))}function at(e,t){var n=e.callbackNode;Wf(e,t);var l=xs(e,e===Qe?qe:0);if(l===0)n!==null&&Di(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&Di(n),t===1)e.tag===0?Hm(Qu.bind(null,e)):Lc(Qu.bind(null,e)),Om(function(){(pe&6)===0&&tn()}),n=null;else{switch(Fi(l)){case 1:n=Jl;break;case 4:n=$i;break;case 16:n=fs;break;case 536870912:n=zi;break;default:n=fs}n=ed(n,Wu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Wu(e,t){if(al=-1,ol=0,(pe&6)!==0)throw Error(i(327));var n=e.callbackNode;if(Zn()&&e.callbackNode!==n)return null;var l=xs(e,e===Qe?qe:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=il(e,l);else{t=l;var o=pe;pe|=2;var c=Ku();(Qe!==e||qe!==t)&&(Vt=null,Jn=Ae()+500,Sn(e,t));do try{dp();break}catch(N){Gu(e,N)}while(!0);Ia(),tl.current=c,pe=o,Ue!==null?t=0:(Qe=null,qe=0,t=He)}if(t!==0){if(t===2&&(o=Zl(e),o!==0&&(l=o,t=wo(e,o))),t===1)throw n=Wr,Sn(e,0),cn(e,l),at(e,Ae()),n;if(t===6)cn(e,l);else{if(o=e.current.alternate,(l&30)===0&&!cp(o)&&(t=il(e,l),t===2&&(c=Zl(e),c!==0&&(l=c,t=wo(e,c))),t===1))throw n=Wr,Sn(e,0),cn(e,l),at(e,Ae()),n;switch(e.finishedWork=o,e.finishedLanes=l,t){case 0:case 1:throw Error(i(345));case 2:bn(e,lt,Vt);break;case 3:if(cn(e,l),(l&130023424)===l&&(t=yo+500-Ae(),10<t)){if(xs(e,0)!==0)break;if(o=e.suspendedLanes,(o&l)!==l){tt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ca(bn.bind(null,e,lt,Vt),t);break}bn(e,lt,Vt);break;case 4:if(cn(e,l),(l&4194240)===l)break;for(t=e.eventTimes,o=-1;0<l;){var p=31-jt(l);c=1<<p,p=t[p],p>o&&(o=p),l&=~c}if(l=o,l=Ae()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*ip(l/1960))-l,10<l){e.timeoutHandle=Ca(bn.bind(null,e,lt,Vt),l);break}bn(e,lt,Vt);break;case 5:bn(e,lt,Vt);break;default:throw Error(i(329))}}}return at(e,Ae()),e.callbackNode===n?Wu.bind(null,e):null}function wo(e,t){var n=Qr;return e.current.memoizedState.isDehydrated&&(Sn(e,t).flags|=256),e=il(e,t),e!==2&&(t=lt,lt=n,t!==null&&No(t)),e}function No(e){lt===null?lt=e:lt.push.apply(lt,e)}function cp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var o=n[l],c=o.getSnapshot;o=o.value;try{if(!wt(c(),o))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 cn(e,t){for(t&=~go,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),l=1<<n;e[n]=-1,t&=~l}}function Qu(e){if((pe&6)!==0)throw Error(i(327));Zn();var t=xs(e,0);if((t&1)===0)return at(e,Ae()),null;var n=il(e,t);if(e.tag!==0&&n===2){var l=Zl(e);l!==0&&(t=l,n=wo(e,l))}if(n===1)throw n=Wr,Sn(e,0),cn(e,t),at(e,Ae()),n;if(n===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bn(e,lt,Vt),at(e,Ae()),null}function ko(e,t){var n=pe;pe|=1;try{return e(t)}finally{pe=n,pe===0&&(Jn=Ae()+500,$s&&tn())}}function kn(e){an!==null&&an.tag===0&&(pe&6)===0&&Zn();var t=pe;pe|=1;var n=gt.transition,l=Ne;try{if(gt.transition=null,Ne=1,e)return e()}finally{Ne=l,gt.transition=n,pe=t,(pe&6)===0&&tn()}}function So(){ft=Xn.current,Re(Xn)}function Sn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Am(n)),Ue!==null)for(n=Ue.return;n!==null;){var l=n;switch(Ma(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&_s();break;case 3:Kn(),Re(nt),Re(Ye),Wa();break;case 5:Va(l);break;case 4:Kn();break;case 13:Re(_e);break;case 19:Re(_e);break;case 10:Fa(l.type._context);break;case 22:case 23:So()}n=n.return}if(Qe=e,Ue=e=un(e.current,null),qe=ft=t,He=0,Wr=null,go=nl=Nn=0,lt=Qr=null,vn!==null){for(t=0;t<vn.length;t++)if(n=vn[t],l=n.interleaved,l!==null){n.interleaved=null;var o=l.next,c=n.pending;if(c!==null){var p=c.next;c.next=o,l.next=p}n.pending=l}vn=null}return e}function Gu(e,t){do{var n=Ue;try{if(Ia(),Ws.current=qs,Qs){for(var l=De.memoizedState;l!==null;){var o=l.queue;o!==null&&(o.pending=null),l=l.next}Qs=!1}if(wn=0,We=Ve=De=null,Ar=!1,Or=0,xo.current=null,n===null||n.return===null){He=1,Wr=t,Ue=null;break}e:{var c=e,p=n.return,N=n,b=t;if(t=qe,N.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){var D=b,O=N,B=O.tag;if((O.mode&1)===0&&(B===0||B===11||B===15)){var F=O.alternate;F?(O.updateQueue=F.updateQueue,O.memoizedState=F.memoizedState,O.lanes=F.lanes):(O.updateQueue=null,O.memoizedState=null)}var Q=yu(p);if(Q!==null){Q.flags&=-257,vu(Q,p,N,c,t),Q.mode&1&&gu(c,D,t),t=Q,b=D;var Y=t.updateQueue;if(Y===null){var X=new Set;X.add(b),t.updateQueue=X}else Y.add(b);break e}else{if((t&1)===0){gu(c,D,t),bo();break e}b=Error(i(426))}}else if(Me&&N.mode&1){var Oe=yu(p);if(Oe!==null){(Oe.flags&65536)===0&&(Oe.flags|=256),vu(Oe,p,N,c,t),$a(qn(b,N));break e}}c=b=qn(b,N),He!==4&&(He=2),Qr===null?Qr=[c]:Qr.push(c),c=p;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var L=hu(c,b,t);Uc(c,L);break e;case 1:N=b;var E=c.type,_=c.stateNode;if((c.flags&128)===0&&(typeof E.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(ln===null||!ln.has(_)))){c.flags|=65536,t&=-t,c.lanes|=t;var U=xu(c,N,t);Uc(c,U);break e}}c=c.return}while(c!==null)}Yu(n)}catch(J){t=J,Ue===n&&n!==null&&(Ue=n=n.return);continue}break}while(!0)}function Ku(){var e=tl.current;return tl.current=qs,e===null?qs:e}function bo(){(He===0||He===3||He===2)&&(He=4),Qe===null||(Nn&268435455)===0&&(nl&268435455)===0||cn(Qe,qe)}function il(e,t){var n=pe;pe|=2;var l=Ku();(Qe!==e||qe!==t)&&(Vt=null,Sn(e,t));do try{up();break}catch(o){Gu(e,o)}while(!0);if(Ia(),pe=n,tl.current=l,Ue!==null)throw Error(i(261));return Qe=null,qe=0,He}function up(){for(;Ue!==null;)qu(Ue)}function dp(){for(;Ue!==null&&!zf();)qu(Ue)}function qu(e){var t=Zu(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Yu(e):Ue=t,xo.current=null}function Yu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=rp(n,t,ft),n!==null){Ue=n;return}}else{if(n=sp(n,t),n!==null){n.flags&=32767,Ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,Ue=null;return}}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);He===0&&(He=5)}function bn(e,t,n){var l=Ne,o=gt.transition;try{gt.transition=null,Ne=1,fp(e,t,n,l)}finally{gt.transition=o,Ne=l}return null}function fp(e,t,n,l){do Zn();while(an!==null);if((pe&6)!==0)throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var c=n.lanes|n.childLanes;if(Qf(e,c),e===Qe&&(Ue=Qe=null,qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||sl||(sl=!0,ed(fs,function(){return Zn(),null})),c=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||c){c=gt.transition,gt.transition=null;var p=Ne;Ne=1;var N=pe;pe|=4,xo.current=null,ap(e,n),Ou(n,e),Mm(Sa),vs=!!ka,Sa=ka=null,e.current=n,op(n),If(),pe=N,Ne=p,gt.transition=c}else e.current=n;if(sl&&(sl=!1,an=e,ll=o),c=e.pendingLanes,c===0&&(ln=null),Of(n.stateNode),at(e,Ae()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],l(o.value,{componentStack:o.stack,digest:o.digest});if(rl)throw rl=!1,e=vo,vo=null,e;return(ll&1)!==0&&e.tag!==0&&Zn(),c=e.pendingLanes,(c&1)!==0?e===jo?Gr++:(Gr=0,jo=e):Gr=0,tn(),null}function Zn(){if(an!==null){var e=Fi(ll),t=gt.transition,n=Ne;try{if(gt.transition=null,Ne=16>e?16:e,an===null)var l=!1;else{if(e=an,an=null,ll=0,(pe&6)!==0)throw Error(i(331));var o=pe;for(pe|=4,K=e.current;K!==null;){var c=K,p=c.child;if((K.flags&16)!==0){var N=c.deletions;if(N!==null){for(var b=0;b<N.length;b++){var D=N[b];for(K=D;K!==null;){var O=K;switch(O.tag){case 0:case 11:case 15:Hr(8,O,c)}var B=O.child;if(B!==null)B.return=O,K=B;else for(;K!==null;){O=K;var F=O.sibling,Q=O.return;if($u(O),O===D){K=null;break}if(F!==null){F.return=Q,K=F;break}K=Q}}}var Y=c.alternate;if(Y!==null){var X=Y.child;if(X!==null){Y.child=null;do{var Oe=X.sibling;X.sibling=null,X=Oe}while(X!==null)}}K=c}}if((c.subtreeFlags&2064)!==0&&p!==null)p.return=c,K=p;else e:for(;K!==null;){if(c=K,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:Hr(9,c,c.return)}var L=c.sibling;if(L!==null){L.return=c.return,K=L;break e}K=c.return}}var E=e.current;for(K=E;K!==null;){p=K;var _=p.child;if((p.subtreeFlags&2064)!==0&&_!==null)_.return=p,K=_;else e:for(p=E;K!==null;){if(N=K,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:el(9,N)}}catch(J){Ie(N,N.return,J)}if(N===p){K=null;break e}var U=N.sibling;if(U!==null){U.return=N.return,K=U;break e}K=N.return}}if(pe=o,tn(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(ms,e)}catch{}l=!0}return l}finally{Ne=n,gt.transition=t}}return!1}function Xu(e,t,n){t=qn(n,t),t=hu(e,t,1),e=rn(e,t,1),t=tt(),e!==null&&(gr(e,1,t),at(e,t))}function Ie(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ln===null||!ln.has(l))){e=qn(n,e),e=xu(t,e,1),t=rn(t,e,1),e=tt(),t!==null&&(gr(t,1,e),at(t,e));break}}t=t.return}}function mp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=tt(),e.pingedLanes|=e.suspendedLanes&n,Qe===e&&(qe&n)===n&&(He===4||He===3&&(qe&130023424)===qe&&500>Ae()-yo?Sn(e,0):go|=n),at(e,t)}function Ju(e,t){t===0&&((e.mode&1)===0?t=1:(t=hs,hs<<=1,(hs&130023424)===0&&(hs=4194304)));var n=tt();e=Ot(e,t),e!==null&&(gr(e,t,n),at(e,n))}function pp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function hp(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(t),Ju(e,n)}var Zu;Zu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)st=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return st=!1,np(e,t,n);st=(e.flags&131072)!==0}else st=!1,Me&&(t.flags&1048576)!==0&&Mc(t,Is,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Js(e,t),e=t.pendingProps;var o=Bn(t,Ye.current);Gn(t,n),o=Ka(null,t,l,e,o,n);var c=qa();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(l)?(c=!0,Ds(t)):c=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ba(t),o.updater=Ys,t.stateNode=o,o._reactInternals=t,to(t,l,e,n),t=lo(null,t,l,!0,c,n)):(t.tag=0,Me&&c&&La(t),et(null,t,o,n),t=t.child),t;case 16:l=t.elementType;e:{switch(Js(e,t),e=t.pendingProps,o=l._init,l=o(l._payload),t.type=l,o=t.tag=gp(l),e=kt(l,e),o){case 0:t=so(null,t,l,e,n);break e;case 1:t=bu(null,t,l,e,n);break e;case 11:t=ju(null,t,l,e,n);break e;case 14:t=wu(null,t,l,kt(l.type,e),n);break e}throw Error(i(306,l,""))}return t;case 0:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:kt(l,o),so(e,t,l,o,n);case 1:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:kt(l,o),bu(e,t,l,o,n);case 3:e:{if(Cu(t),e===null)throw Error(i(387));l=t.pendingProps,c=t.memoizedState,o=c.element,Bc(e,t),Vs(t,l,null,n);var p=t.memoizedState;if(l=p.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){o=qn(Error(i(423)),t),t=Eu(e,t,l,n,o);break e}else if(l!==o){o=qn(Error(i(424)),t),t=Eu(e,t,l,n,o);break e}else for(dt=Jt(t.stateNode.containerInfo.firstChild),ut=t,Me=!0,Nt=null,n=Ac(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hn(),l===o){t=Ut(e,t,n);break e}et(e,t,l,n)}t=t.child}return t;case 5:return Hc(t),e===null&&Da(t),l=t.type,o=t.pendingProps,c=e!==null?e.memoizedProps:null,p=o.children,ba(l,o)?p=null:c!==null&&ba(l,c)&&(t.flags|=32),Su(e,t),et(e,t,p,n),t.child;case 6:return e===null&&Da(t),null;case 13:return Pu(e,t,n);case 4:return Ua(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Wn(t,null,l,n):et(e,t,l,n),t.child;case 11:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:kt(l,o),ju(e,t,l,o,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,o=t.pendingProps,c=t.memoizedProps,p=o.value,Ee(Os,l._currentValue),l._currentValue=p,c!==null)if(wt(c.value,p)){if(c.children===o.children&&!nt.current){t=Ut(e,t,n);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var N=c.dependencies;if(N!==null){p=c.child;for(var b=N.firstContext;b!==null;){if(b.context===l){if(c.tag===1){b=Bt(-1,n&-n),b.tag=2;var D=c.updateQueue;if(D!==null){D=D.shared;var O=D.pending;O===null?b.next=b:(b.next=O.next,O.next=b),D.pending=b}}c.lanes|=n,b=c.alternate,b!==null&&(b.lanes|=n),Aa(c.return,n,t),N.lanes|=n;break}b=b.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=n,N=p.alternate,N!==null&&(N.lanes|=n),Aa(p,n,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}et(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,l=t.pendingProps.children,Gn(t,n),o=ht(o),l=l(o),t.flags|=1,et(e,t,l,n),t.child;case 14:return l=t.type,o=kt(l,t.pendingProps),o=kt(l.type,o),wu(e,t,l,o,n);case 15:return Nu(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,o=t.pendingProps,o=t.elementType===l?o:kt(l,o),Js(e,t),t.tag=1,rt(l)?(e=!0,Ds(t)):e=!1,Gn(t,n),mu(t,l,o),to(t,l,o,n),lo(null,t,l,!0,e,n);case 19:return Ru(e,t,n);case 22:return ku(e,t,n)}throw Error(i(156,t.tag))};function ed(e,t){return _i(e,t)}function xp(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,l){return new xp(e,t,n,l)}function Co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gp(e){if(typeof e=="function")return Co(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ze)return 11;if(e===Z)return 14}return 2}function un(e,t){var n=e.alternate;return n===null?(n=yt(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&14680064,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}function cl(e,t,n,l,o,c){var p=2;if(l=e,typeof e=="function")Co(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case ee:return Cn(n.children,o,c,t);case G:p=8,o|=8;break;case V:return e=yt(12,n,t,o|2),e.elementType=V,e.lanes=c,e;case re:return e=yt(13,n,t,o),e.elementType=re,e.lanes=c,e;case ve:return e=yt(19,n,t,o),e.elementType=ve,e.lanes=c,e;case me:return ul(n,o,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ye:p=10;break e;case Se:p=9;break e;case ze:p=11;break e;case Z:p=14;break e;case be:p=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=yt(p,n,t,o),t.elementType=e,t.type=l,t.lanes=c,t}function Cn(e,t,n,l){return e=yt(7,e,l,t),e.lanes=n,e}function ul(e,t,n,l){return e=yt(22,e,l,t),e.elementType=me,e.lanes=n,e.stateNode={isHidden:!1},e}function Eo(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function Po(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function yp(e,t,n,l,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ea(0),this.expirationTimes=ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.identifierPrefix=l,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function To(e,t,n,l,o,c,p,N,b){return e=new yp(e,t,n,N,b),t===1?(t=1,c===!0&&(t|=8)):t=0,c=yt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ba(c),e}function vp(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function td(e){if(!e)return en;e=e._reactInternals;e:{if(pn(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var n=e.type;if(rt(n))return Tc(e,n,t)}return t}function nd(e,t,n,l,o,c,p,N,b){return e=To(n,l,!0,e,o,c,p,N,b),e.context=td(null),n=e.current,l=tt(),o=on(n),c=Bt(l,o),c.callback=t??null,rn(n,c,o),e.current.lanes=o,gr(e,o,l),at(e,l),e}function dl(e,t,n,l){var o=t.current,c=tt(),p=on(o);return n=td(n),t.context===null?t.context=n:t.pendingContext=n,t=Bt(c,p),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=rn(o,t,p),e!==null&&(Ct(e,o,p,c),Us(e,o,p)),p}function fl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function rd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ro(e,t){rd(e,t),(e=e.alternate)&&rd(e,t)}function jp(){return null}var sd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lo(e){this._internalRoot=e}ml.prototype.render=Lo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));dl(e,t,null,null)},ml.prototype.unmount=Lo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;kn(function(){dl(null,e,null,null)}),t[zt]=null}};function ml(e){this._internalRoot=e}ml.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qt.length&&t!==0&&t<qt[n].priority;n++);qt.splice(n,0,e),n===0&&Hi(e)}};function Mo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ld(){}function wp(e,t,n,l,o){if(o){if(typeof l=="function"){var c=l;l=function(){var D=fl(p);c.call(D)}}var p=nd(t,l,e,0,null,!1,!1,"",ld);return e._reactRootContainer=p,e[zt]=p.current,Lr(e.nodeType===8?e.parentNode:e),kn(),p}for(;o=e.lastChild;)e.removeChild(o);if(typeof l=="function"){var N=l;l=function(){var D=fl(b);N.call(D)}}var b=To(e,0,!1,null,null,!1,!1,"",ld);return e._reactRootContainer=b,e[zt]=b.current,Lr(e.nodeType===8?e.parentNode:e),kn(function(){dl(t,b,n,l)}),b}function hl(e,t,n,l,o){var c=n._reactRootContainer;if(c){var p=c;if(typeof o=="function"){var N=o;o=function(){var b=fl(p);N.call(b)}}dl(t,p,e,o)}else p=wp(n,t,e,o,l);return fl(p)}Ai=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xr(t.pendingLanes);n!==0&&(ta(t,n|1),at(t,Ae()),(pe&6)===0&&(Jn=Ae()+500,tn()))}break;case 13:kn(function(){var l=Ot(e,1);if(l!==null){var o=tt();Ct(l,e,1,o)}}),Ro(e,1)}},na=function(e){if(e.tag===13){var t=Ot(e,134217728);if(t!==null){var n=tt();Ct(t,e,134217728,n)}Ro(e,134217728)}},Oi=function(e){if(e.tag===13){var t=on(e),n=Ot(e,t);if(n!==null){var l=tt();Ct(n,e,t,l)}Ro(e,t)}},Bi=function(){return Ne},Ui=function(e,t){var n=Ne;try{return Ne=e,t()}finally{Ne=n}},Kl=function(e,t,n){switch(t){case"input":if(Ol(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var o=Ms(l);if(!o)throw Error(i(90));fi(l),Ol(l,o)}}}break;case"textarea":gi(e,n);break;case"select":t=n.value,t!=null&&Tn(e,!!n.multiple,t,!1)}},Ci=ko,Ei=kn;var Np={usingClientEntryPoint:!1,Events:[Dr,An,Ms,Si,bi,ko]},Kr={findFiberByHostInstance:hn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kp={bundleType:Kr.bundleType,version:Kr.version,rendererPackageName:Kr.rendererPackageName,rendererConfig:Kr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Li(e),e===null?null:e.stateNode},findFiberByHostInstance:Kr.findFiberByHostInstance||jp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xl.isDisabled&&xl.supportsFiber)try{ms=xl.inject(kp),Tt=xl}catch{}}return ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Np,ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mo(t))throw Error(i(200));return vp(e,t,null,n)},ot.createRoot=function(e,t){if(!Mo(e))throw Error(i(299));var n=!1,l="",o=sd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=To(e,1,!1,null,null,n,!1,l,o),e[zt]=t.current,Lr(e.nodeType===8?e.parentNode:e),new Lo(t)},ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Li(t),e=e===null?null:e.stateNode,e},ot.flushSync=function(e){return kn(e)},ot.hydrate=function(e,t,n){if(!pl(t))throw Error(i(200));return hl(null,e,t,!0,n)},ot.hydrateRoot=function(e,t,n){if(!Mo(e))throw Error(i(405));var l=n!=null&&n.hydratedSources||null,o=!1,c="",p=sd;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),t=nd(t,null,e,1,n??null,o,!1,c,p),e[zt]=t.current,Lr(e),l)for(e=0;e<l.length;e++)n=l[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ml(t)},ot.render=function(e,t,n){if(!pl(t))throw Error(i(200));return hl(null,e,t,!1,n)},ot.unmountComponentAtNode=function(e){if(!pl(e))throw Error(i(40));return e._reactRootContainer?(kn(function(){hl(null,null,e,!1,function(){e._reactRootContainer=null,e[zt]=null})}),!0):!1},ot.unstable_batchedUpdates=ko,ot.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!pl(n))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return hl(e,t,n,!1,l)},ot.version="18.3.1-next-f1338f8080-20240426",ot}var md;function _p(){if(md)return $o.exports;md=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),$o.exports=Mp(),$o.exports}var pd;function Dp(){if(pd)return yl;pd=1;var s=_p();return yl.createRoot=s.createRoot,yl.hydrateRoot=s.hydrateRoot,yl}var $p=Dp();const zp=Wd($p);/**
41
+ * react-router v7.13.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var hd="popstate";function Ip(s={}){function a(d,f){let{pathname:u,search:m,hash:x}=d.location;return Wo("",{pathname:u,search:m,hash:x},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function i(d,f){return typeof f=="string"?f:ts(f)}return Ap(a,i,null,s)}function $e(s,a){if(s===!1||s===null||typeof s>"u")throw new Error(a)}function $t(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Fp(){return Math.random().toString(36).substring(2,10)}function xd(s,a){return{usr:s.state,key:s.key,idx:a}}function Wo(s,a,i=null,d){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof a=="string"?ar(a):a,state:i,key:a&&a.key||d||Fp()}}function ts({pathname:s="/",search:a="",hash:i=""}){return a&&a!=="?"&&(s+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(s+=i.charAt(0)==="#"?i:"#"+i),s}function ar(s){let a={};if(s){let i=s.indexOf("#");i>=0&&(a.hash=s.substring(i),s=s.substring(0,i));let d=s.indexOf("?");d>=0&&(a.search=s.substring(d),s=s.substring(0,d)),s&&(a.pathname=s)}return a}function Ap(s,a,i,d={}){let{window:f=document.defaultView,v5Compat:u=!1}=d,m=f.history,x="POP",y=null,w=v();w==null&&(w=0,m.replaceState({...m.state,idx:w},""));function v(){return(m.state||{idx:null}).idx}function j(){x="POP";let C=v(),P=C==null?null:C-w;w=C,y&&y({action:x,location:S.location,delta:P})}function k(C,P){x="PUSH";let M=Wo(S.location,C,P);w=v()+1;let T=xd(M,w),I=S.createHref(M);try{m.pushState(T,"",I)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;f.location.assign(I)}u&&y&&y({action:x,location:S.location,delta:1})}function g(C,P){x="REPLACE";let M=Wo(S.location,C,P);w=v();let T=xd(M,w),I=S.createHref(M);m.replaceState(T,"",I),u&&y&&y({action:x,location:S.location,delta:0})}function $(C){return Op(C)}let S={get action(){return x},get location(){return s(f,m)},listen(C){if(y)throw new Error("A history only accepts one active listener");return f.addEventListener(hd,j),y=C,()=>{f.removeEventListener(hd,j),y=null}},createHref(C){return a(f,C)},createURL:$,encodeLocation(C){let P=$(C);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:k,replace:g,go(C){return m.go(C)}};return S}function Op(s,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),$e(i,"No window.location.(origin|href) available to create URL");let d=typeof s=="string"?s:ts(s);return d=d.replace(/ $/,"%20"),!a&&d.startsWith("//")&&(d=i+d),new URL(d,i)}function Qd(s,a,i="/"){return Bp(s,a,i,!1)}function Bp(s,a,i,d){let f=typeof a=="string"?ar(a):a,u=Wt(f.pathname||"/",i);if(u==null)return null;let m=Gd(s);Up(m);let x=null;for(let y=0;x==null&&y<m.length;++y){let w=Zp(u);x=Xp(m[y],w,d)}return x}function Gd(s,a=[],i=[],d="",f=!1){let u=(m,x,y=f,w)=>{let v={relativePath:w===void 0?m.path||"":w,caseSensitive:m.caseSensitive===!0,childrenIndex:x,route:m};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(d)&&y)return;$e(v.relativePath.startsWith(d),`Absolute route path "${v.relativePath}" nested under path "${d}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(d.length)}let j=Ht([d,v.relativePath]),k=i.concat(v);m.children&&m.children.length>0&&($e(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),Gd(m.children,a,k,j,y)),!(m.path==null&&!m.index)&&a.push({path:j,score:qp(j,m.index),routesMeta:k})};return s.forEach((m,x)=>{var y;if(m.path===""||!((y=m.path)!=null&&y.includes("?")))u(m,x);else for(let w of Kd(m.path))u(m,x,!0,w)}),a}function Kd(s){let a=s.split("/");if(a.length===0)return[];let[i,...d]=a,f=i.endsWith("?"),u=i.replace(/\?$/,"");if(d.length===0)return f?[u,""]:[u];let m=Kd(d.join("/")),x=[];return x.push(...m.map(y=>y===""?u:[u,y].join("/"))),f&&x.push(...m),x.map(y=>s.startsWith("/")&&y===""?"/":y)}function Up(s){s.sort((a,i)=>a.score!==i.score?i.score-a.score:Yp(a.routesMeta.map(d=>d.childrenIndex),i.routesMeta.map(d=>d.childrenIndex)))}var Vp=/^:[\w-]+$/,Hp=3,Wp=2,Qp=1,Gp=10,Kp=-2,gd=s=>s==="*";function qp(s,a){let i=s.split("/"),d=i.length;return i.some(gd)&&(d+=Kp),a&&(d+=Wp),i.filter(f=>!gd(f)).reduce((f,u)=>f+(Vp.test(u)?Hp:u===""?Qp:Gp),d)}function Yp(s,a){return s.length===a.length&&s.slice(0,-1).every((d,f)=>d===a[f])?s[s.length-1]-a[a.length-1]:0}function Xp(s,a,i=!1){let{routesMeta:d}=s,f={},u="/",m=[];for(let x=0;x<d.length;++x){let y=d[x],w=x===d.length-1,v=u==="/"?a:a.slice(u.length)||"/",j=Ml({path:y.relativePath,caseSensitive:y.caseSensitive,end:w},v),k=y.route;if(!j&&w&&i&&!d[d.length-1].route.index&&(j=Ml({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},v)),!j)return null;Object.assign(f,j.params),m.push({params:f,pathname:Ht([u,j.pathname]),pathnameBase:rh(Ht([u,j.pathnameBase])),route:k}),j.pathnameBase!=="/"&&(u=Ht([u,j.pathnameBase]))}return m}function Ml(s,a){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[i,d]=Jp(s.path,s.caseSensitive,s.end),f=a.match(i);if(!f)return null;let u=f[0],m=u.replace(/(.)\/+$/,"$1"),x=f.slice(1);return{params:d.reduce((w,{paramName:v,isOptional:j},k)=>{if(v==="*"){let $=x[k]||"";m=u.slice(0,u.length-$.length).replace(/(.)\/+$/,"$1")}const g=x[k];return j&&!g?w[v]=void 0:w[v]=(g||"").replace(/%2F/g,"/"),w},{}),pathname:u,pathnameBase:m,pattern:s}}function Jp(s,a=!1,i=!0){$t(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let d=[],f="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,x,y)=>(d.push({paramName:x,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(d.push({paramName:"*"}),f+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?f+="\\/*$":s!==""&&s!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,a?void 0:"i"),d]}function Zp(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return $t(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),s}}function Wt(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,d=s.charAt(i);return d&&d!=="/"?null:s.slice(i)||"/"}var eh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function th(s,a="/"){let{pathname:i,search:d="",hash:f=""}=typeof s=="string"?ar(s):s,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=yd(i.substring(1),"/"):u=yd(i,a)):u=a,{pathname:u,search:sh(d),hash:lh(f)}}function yd(s,a){let i=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(f=>{f===".."?i.length>1&&i.pop():f!=="."&&i.push(f)}),i.length>1?i.join("/"):"/"}function Fo(s,a,i,d){return`Cannot include a '${s}' character in a manually specified \`to.${a}\` field [${JSON.stringify(d)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nh(s){return s.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function qd(s){let a=nh(s);return a.map((i,d)=>d===a.length-1?i.pathname:i.pathnameBase)}function Yd(s,a,i,d=!1){let f;typeof s=="string"?f=ar(s):(f={...s},$e(!f.pathname||!f.pathname.includes("?"),Fo("?","pathname","search",f)),$e(!f.pathname||!f.pathname.includes("#"),Fo("#","pathname","hash",f)),$e(!f.search||!f.search.includes("#"),Fo("#","search","hash",f)));let u=s===""||f.pathname==="",m=u?"/":f.pathname,x;if(m==null)x=i;else{let j=a.length-1;if(!d&&m.startsWith("..")){let k=m.split("/");for(;k[0]==="..";)k.shift(),j-=1;f.pathname=k.join("/")}x=j>=0?a[j]:"/"}let y=th(f,x),w=m&&m!=="/"&&m.endsWith("/"),v=(u||m===".")&&i.endsWith("/");return!y.pathname.endsWith("/")&&(w||v)&&(y.pathname+="/"),y}var Ht=s=>s.join("/").replace(/\/\/+/g,"/"),rh=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),sh=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,lh=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,ah=class{constructor(s,a,i,d=!1){this.status=s,this.statusText=a||"",this.internal=d,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function oh(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function ih(s){return s.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jd(s,a){let i=s;if(typeof i!="string"||!eh.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let d=i,f=!1;if(Xd)try{let u=new URL(window.location.href),m=i.startsWith("//")?new URL(u.protocol+i):new URL(i),x=Wt(m.pathname,a);m.origin===u.origin&&x!=null?i=x+m.search+m.hash:f=!0}catch{$t(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:d,isExternal:f,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Zd=["POST","PUT","PATCH","DELETE"];new Set(Zd);var ch=["GET",...Zd];new Set(ch);var or=h.createContext(null);or.displayName="DataRouter";var $l=h.createContext(null);$l.displayName="DataRouterState";var uh=h.createContext(!1),ef=h.createContext({isTransitioning:!1});ef.displayName="ViewTransition";var dh=h.createContext(new Map);dh.displayName="Fetchers";var fh=h.createContext(null);fh.displayName="Await";var vt=h.createContext(null);vt.displayName="Navigation";var rs=h.createContext(null);rs.displayName="Location";var Et=h.createContext({outlet:null,matches:[],isDataRoute:!1});Et.displayName="Route";var ei=h.createContext(null);ei.displayName="RouteError";var tf="REACT_ROUTER_ERROR",mh="REDIRECT",ph="ROUTE_ERROR_RESPONSE";function hh(s){if(s.startsWith(`${tf}:${mh}:{`))try{let a=JSON.parse(s.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function xh(s){if(s.startsWith(`${tf}:${ph}:{`))try{let a=JSON.parse(s.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new ah(a.status,a.statusText,a.data)}catch{}}function gh(s,{relative:a}={}){$e(ss(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:d}=h.useContext(vt),{hash:f,pathname:u,search:m}=ls(s,{relative:a}),x=u;return i!=="/"&&(x=u==="/"?i:Ht([i,u])),d.createHref({pathname:x,search:m,hash:f})}function ss(){return h.useContext(rs)!=null}function fn(){return $e(ss(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(rs).location}var nf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rf(s){h.useContext(vt).static||h.useLayoutEffect(s)}function ir(){let{isDataRoute:s}=h.useContext(Et);return s?Mh():yh()}function yh(){$e(ss(),"useNavigate() may be used only in the context of a <Router> component.");let s=h.useContext(or),{basename:a,navigator:i}=h.useContext(vt),{matches:d}=h.useContext(Et),{pathname:f}=fn(),u=JSON.stringify(qd(d)),m=h.useRef(!1);return rf(()=>{m.current=!0}),h.useCallback((y,w={})=>{if($t(m.current,nf),!m.current)return;if(typeof y=="number"){i.go(y);return}let v=Yd(y,JSON.parse(u),f,w.relative==="path");s==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Ht([a,v.pathname])),(w.replace?i.replace:i.push)(v,w.state,w)},[a,i,u,f,s])}var vh=h.createContext(null);function jh(s){let a=h.useContext(Et).outlet;return h.useMemo(()=>a&&h.createElement(vh.Provider,{value:s},a),[a,s])}function Pt(){let{matches:s}=h.useContext(Et),a=s[s.length-1];return a?a.params:{}}function ls(s,{relative:a}={}){let{matches:i}=h.useContext(Et),{pathname:d}=fn(),f=JSON.stringify(qd(i));return h.useMemo(()=>Yd(s,JSON.parse(f),d,a==="path"),[s,f,d,a])}function wh(s,a){return sf(s,a)}function sf(s,a,i,d,f){var M;$e(ss(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=h.useContext(vt),{matches:m}=h.useContext(Et),x=m[m.length-1],y=x?x.params:{},w=x?x.pathname:"/",v=x?x.pathnameBase:"/",j=x&&x.route;{let T=j&&j.path||"";af(w,!j||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${w}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let k=fn(),g;if(a){let T=typeof a=="string"?ar(a):a;$e(v==="/"||((M=T.pathname)==null?void 0:M.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${T.pathname}" was given in the \`location\` prop.`),g=T}else g=k;let $=g.pathname||"/",S=$;if(v!=="/"){let T=v.replace(/^\//,"").split("/");S="/"+$.replace(/^\//,"").split("/").slice(T.length).join("/")}let C=Qd(s,{pathname:S});$t(j||C!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),$t(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let P=Ch(C&&C.map(T=>Object.assign({},T,{params:Object.assign({},y,T.params),pathname:Ht([v,u.encodeLocation?u.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?v:Ht([v,u.encodeLocation?u.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),m,i,d,f);return a&&P?h.createElement(rs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},P):P}function Nh(){let s=Lh(),a=oh(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),i=s instanceof Error?s.stack:null,d="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:d},u={padding:"2px 4px",backgroundColor:d},m=null;return console.error("Error handled by React Router default ErrorBoundary:",s),m=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:u},"ErrorBoundary")," or"," ",h.createElement("code",{style:u},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),i?h.createElement("pre",{style:f},i):null,m)}var kh=h.createElement(Nh,null),lf=class extends h.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,a){return a.location!==s.location||a.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:a.error,location:a.location,revalidation:s.revalidation||a.revalidation}}componentDidCatch(s,a){this.props.onError?this.props.onError(s,a):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const i=xh(s.digest);i&&(s=i)}let a=s!==void 0?h.createElement(Et.Provider,{value:this.props.routeContext},h.createElement(ei.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?h.createElement(Sh,{error:s},a):a}};lf.contextType=uh;var Ao=new WeakMap;function Sh({children:s,error:a}){let{basename:i}=h.useContext(vt);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let d=hh(a.digest);if(d){let f=Ao.get(a);if(f)throw f;let u=Jd(d.location,i);if(Xd&&!Ao.get(a))if(u.isExternal||d.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:d.replace}));throw Ao.set(a,m),m}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return s}function bh({routeContext:s,match:a,children:i}){let d=h.useContext(or);return d&&d.static&&d.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(d.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement(Et.Provider,{value:s},i)}function Ch(s,a=[],i=null,d=null,f=null){if(s==null){if(!i)return null;if(i.errors)s=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)s=i.matches;else return null}let u=s,m=i==null?void 0:i.errors;if(m!=null){let v=u.findIndex(j=>j.route.id&&(m==null?void 0:m[j.route.id])!==void 0);$e(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),u=u.slice(0,Math.min(u.length,v+1))}let x=!1,y=-1;if(i)for(let v=0;v<u.length;v++){let j=u[v];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(y=v),j.route.id){let{loaderData:k,errors:g}=i,$=j.route.loader&&!k.hasOwnProperty(j.route.id)&&(!g||g[j.route.id]===void 0);if(j.route.lazy||$){x=!0,y>=0?u=u.slice(0,y+1):u=[u[0]];break}}}let w=i&&d?(v,j)=>{var k,g;d(v,{location:i.location,params:((g=(k=i.matches)==null?void 0:k[0])==null?void 0:g.params)??{},unstable_pattern:ih(i.matches),errorInfo:j})}:void 0;return u.reduceRight((v,j,k)=>{let g,$=!1,S=null,C=null;i&&(g=m&&j.route.id?m[j.route.id]:void 0,S=j.route.errorElement||kh,x&&(y<0&&k===0?(af("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),$=!0,C=null):y===k&&($=!0,C=j.route.hydrateFallbackElement||null)));let P=a.concat(u.slice(0,k+1)),M=()=>{let T;return g?T=S:$?T=C:j.route.Component?T=h.createElement(j.route.Component,null):j.route.element?T=j.route.element:T=v,h.createElement(bh,{match:j,routeContext:{outlet:v,matches:P,isDataRoute:i!=null},children:T})};return i&&(j.route.ErrorBoundary||j.route.errorElement||k===0)?h.createElement(lf,{location:i.location,revalidation:i.revalidation,component:S,error:g,children:M(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:w}):M()},null)}function ti(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Eh(s){let a=h.useContext(or);return $e(a,ti(s)),a}function Ph(s){let a=h.useContext($l);return $e(a,ti(s)),a}function Th(s){let a=h.useContext(Et);return $e(a,ti(s)),a}function ni(s){let a=Th(s),i=a.matches[a.matches.length-1];return $e(i.route.id,`${s} can only be used on routes that contain a unique "id"`),i.route.id}function Rh(){return ni("useRouteId")}function Lh(){var d;let s=h.useContext(ei),a=Ph("useRouteError"),i=ni("useRouteError");return s!==void 0?s:(d=a.errors)==null?void 0:d[i]}function Mh(){let{router:s}=Eh("useNavigate"),a=ni("useNavigate"),i=h.useRef(!1);return rf(()=>{i.current=!0}),h.useCallback(async(f,u={})=>{$t(i.current,nf),i.current&&(typeof f=="number"?await s.navigate(f):await s.navigate(f,{fromRouteId:a,...u}))},[s,a])}var vd={};function af(s,a,i){!a&&!vd[s]&&(vd[s]=!0,$t(!1,i))}h.memo(_h);function _h({routes:s,future:a,state:i,onError:d}){return sf(s,void 0,i,d,a)}function Dh(s){return jh(s.context)}function ke(s){$e(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function $h({basename:s="/",children:a=null,location:i,navigationType:d="POP",navigator:f,static:u=!1,unstable_useTransitions:m}){$e(!ss(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=s.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:x,navigator:f,static:u,unstable_useTransitions:m,future:{}}),[x,f,u,m]);typeof i=="string"&&(i=ar(i));let{pathname:w="/",search:v="",hash:j="",state:k=null,key:g="default"}=i,$=h.useMemo(()=>{let S=Wt(w,x);return S==null?null:{location:{pathname:S,search:v,hash:j,state:k,key:g},navigationType:d}},[x,w,v,j,k,g,d]);return $t($!=null,`<Router basename="${x}"> is not able to match the URL "${w}${v}${j}" because it does not start with the basename, so the <Router> won't render anything.`),$==null?null:h.createElement(vt.Provider,{value:y},h.createElement(rs.Provider,{children:a,value:$}))}function jd({children:s,location:a}){return wh(Qo(s),a)}function Qo(s,a=[]){let i=[];return h.Children.forEach(s,(d,f)=>{if(!h.isValidElement(d))return;let u=[...a,f];if(d.type===h.Fragment){i.push.apply(i,Qo(d.props.children,u));return}$e(d.type===ke,`[${typeof d.type=="string"?d.type:d.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$e(!d.props.index||!d.props.children,"An index route cannot have child routes.");let m={id:d.props.id||u.join("-"),caseSensitive:d.props.caseSensitive,element:d.props.element,Component:d.props.Component,index:d.props.index,path:d.props.path,middleware:d.props.middleware,loader:d.props.loader,action:d.props.action,hydrateFallbackElement:d.props.hydrateFallbackElement,HydrateFallback:d.props.HydrateFallback,errorElement:d.props.errorElement,ErrorBoundary:d.props.ErrorBoundary,hasErrorBoundary:d.props.hasErrorBoundary===!0||d.props.ErrorBoundary!=null||d.props.errorElement!=null,shouldRevalidate:d.props.shouldRevalidate,handle:d.props.handle,lazy:d.props.lazy};d.props.children&&(m.children=Qo(d.props.children,u)),i.push(m)}),i}var Pl="get",Tl="application/x-www-form-urlencoded";function zl(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function zh(s){return zl(s)&&s.tagName.toLowerCase()==="button"}function Ih(s){return zl(s)&&s.tagName.toLowerCase()==="form"}function Fh(s){return zl(s)&&s.tagName.toLowerCase()==="input"}function Ah(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function Oh(s,a){return s.button===0&&(!a||a==="_self")&&!Ah(s)}var vl=null;function Bh(){if(vl===null)try{new FormData(document.createElement("form"),0),vl=!1}catch{vl=!0}return vl}var Uh=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Oo(s){return s!=null&&!Uh.has(s)?($t(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tl}"`),null):s}function Vh(s,a){let i,d,f,u,m;if(Ih(s)){let x=s.getAttribute("action");d=x?Wt(x,a):null,i=s.getAttribute("method")||Pl,f=Oo(s.getAttribute("enctype"))||Tl,u=new FormData(s)}else if(zh(s)||Fh(s)&&(s.type==="submit"||s.type==="image")){let x=s.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=s.getAttribute("formaction")||x.getAttribute("action");if(d=y?Wt(y,a):null,i=s.getAttribute("formmethod")||x.getAttribute("method")||Pl,f=Oo(s.getAttribute("formenctype"))||Oo(x.getAttribute("enctype"))||Tl,u=new FormData(x,s),!Bh()){let{name:w,type:v,value:j}=s;if(v==="image"){let k=w?`${w}.`:"";u.append(`${k}x`,"0"),u.append(`${k}y`,"0")}else w&&u.append(w,j)}}else{if(zl(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Pl,d=null,f=Tl,m=s}return u&&f==="text/plain"&&(m=u,u=void 0),{action:d,method:i.toLowerCase(),encType:f,formData:u,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ri(s,a){if(s===!1||s===null||typeof s>"u")throw new Error(a)}function Hh(s,a,i,d){let f=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return i?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${d}`:f.pathname=`${f.pathname}.${d}`:f.pathname==="/"?f.pathname=`_root.${d}`:a&&Wt(f.pathname,a)==="/"?f.pathname=`${a.replace(/\/$/,"")}/_root.${d}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${d}`,f}async function Wh(s,a){if(s.id in a)return a[s.id];try{let i=await import(s.module);return a[s.id]=i,i}catch(i){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Qh(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function Gh(s,a,i){let d=await Promise.all(s.map(async f=>{let u=a.routes[f.route.id];if(u){let m=await Wh(u,i);return m.links?m.links():[]}return[]}));return Xh(d.flat(1).filter(Qh).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function wd(s,a,i,d,f,u){let m=(y,w)=>i[w]?y.route.id!==i[w].route.id:!0,x=(y,w)=>{var v;return i[w].pathname!==y.pathname||((v=i[w].route.path)==null?void 0:v.endsWith("*"))&&i[w].params["*"]!==y.params["*"]};return u==="assets"?a.filter((y,w)=>m(y,w)||x(y,w)):u==="data"?a.filter((y,w)=>{var j;let v=d.routes[y.route.id];if(!v||!v.hasLoader)return!1;if(m(y,w)||x(y,w))return!0;if(y.route.shouldRevalidate){let k=y.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((j=i[0])==null?void 0:j.params)||{},nextUrl:new URL(s,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof k=="boolean")return k}return!0}):[]}function Kh(s,a,{includeHydrateFallback:i}={}){return qh(s.map(d=>{let f=a.routes[d.route.id];if(!f)return[];let u=[f.module];return f.clientActionModule&&(u=u.concat(f.clientActionModule)),f.clientLoaderModule&&(u=u.concat(f.clientLoaderModule)),i&&f.hydrateFallbackModule&&(u=u.concat(f.hydrateFallbackModule)),f.imports&&(u=u.concat(f.imports)),u}).flat(1))}function qh(s){return[...new Set(s)]}function Yh(s){let a={},i=Object.keys(s).sort();for(let d of i)a[d]=s[d];return a}function Xh(s,a){let i=new Set;return new Set(a),s.reduce((d,f)=>{let u=JSON.stringify(Yh(f));return i.has(u)||(i.add(u),d.push({key:u,link:f})),d},[])}function of(){let s=h.useContext(or);return ri(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Jh(){let s=h.useContext($l);return ri(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var si=h.createContext(void 0);si.displayName="FrameworkContext";function cf(){let s=h.useContext(si);return ri(s,"You must render this element inside a <HydratedRouter> element"),s}function Zh(s,a){let i=h.useContext(si),[d,f]=h.useState(!1),[u,m]=h.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:w,onMouseLeave:v,onTouchStart:j}=a,k=h.useRef(null);h.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let S=P=>{P.forEach(M=>{m(M.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return k.current&&C.observe(k.current),()=>{C.disconnect()}}},[s]),h.useEffect(()=>{if(d){let S=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(S)}}},[d]);let g=()=>{f(!0)},$=()=>{f(!1),m(!1)};return i?s!=="intent"?[u,k,{}]:[u,k,{onFocus:Yr(x,g),onBlur:Yr(y,$),onMouseEnter:Yr(w,g),onMouseLeave:Yr(v,$),onTouchStart:Yr(j,g)}]:[!1,k,{}]}function Yr(s,a){return i=>{s&&s(i),i.defaultPrevented||a(i)}}function ex({page:s,...a}){let{router:i}=of(),d=h.useMemo(()=>Qd(i.routes,s,i.basename),[i.routes,s,i.basename]);return d?h.createElement(nx,{page:s,matches:d,...a}):null}function tx(s){let{manifest:a,routeModules:i}=cf(),[d,f]=h.useState([]);return h.useEffect(()=>{let u=!1;return Gh(s,a,i).then(m=>{u||f(m)}),()=>{u=!0}},[s,a,i]),d}function nx({page:s,matches:a,...i}){let d=fn(),{future:f,manifest:u,routeModules:m}=cf(),{basename:x}=of(),{loaderData:y,matches:w}=Jh(),v=h.useMemo(()=>wd(s,a,w,u,d,"data"),[s,a,w,u,d]),j=h.useMemo(()=>wd(s,a,w,u,d,"assets"),[s,a,w,u,d]),k=h.useMemo(()=>{if(s===d.pathname+d.search+d.hash)return[];let S=new Set,C=!1;if(a.forEach(M=>{var I;let T=u.routes[M.route.id];!T||!T.hasLoader||(!v.some(z=>z.route.id===M.route.id)&&M.route.id in y&&((I=m[M.route.id])!=null&&I.shouldRevalidate)||T.hasClientLoader?C=!0:S.add(M.route.id))}),S.size===0)return[];let P=Hh(s,x,f.unstable_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&P.searchParams.set("_routes",a.filter(M=>S.has(M.route.id)).map(M=>M.route.id).join(",")),[P.pathname+P.search]},[x,f.unstable_trailingSlashAwareDataRequests,y,d,u,v,a,s,m]),g=h.useMemo(()=>Kh(j,u),[j,u]),$=tx(j);return h.createElement(h.Fragment,null,k.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...i})),g.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...i})),$.map(({key:S,link:C})=>h.createElement("link",{key:S,nonce:i.nonce,...C,crossOrigin:C.crossOrigin??i.crossOrigin})))}function rx(...s){return a=>{s.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var sx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sx&&(window.__reactRouterVersion="7.13.0")}catch{}function lx({basename:s,children:a,unstable_useTransitions:i,window:d}){let f=h.useRef();f.current==null&&(f.current=Ip({window:d,v5Compat:!0}));let u=f.current,[m,x]=h.useState({action:u.action,location:u.location}),y=h.useCallback(w=>{i===!1?x(w):h.startTransition(()=>x(w))},[i]);return h.useLayoutEffect(()=>u.listen(y),[u,y]),h.createElement($h,{basename:s,children:a,location:m.location,navigationType:m.action,navigator:u,unstable_useTransitions:i})}var uf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_l=h.forwardRef(function({onClick:a,discover:i="render",prefetch:d="none",relative:f,reloadDocument:u,replace:m,state:x,target:y,to:w,preventScrollReset:v,viewTransition:j,unstable_defaultShouldRevalidate:k,...g},$){let{basename:S,unstable_useTransitions:C}=h.useContext(vt),P=typeof w=="string"&&uf.test(w),M=Jd(w,S);w=M.to;let T=gh(w,{relative:f}),[I,z,W]=Zh(d,g),ee=ix(w,{replace:m,state:x,target:y,preventScrollReset:v,relative:f,viewTransition:j,unstable_defaultShouldRevalidate:k,unstable_useTransitions:C});function G(ye){a&&a(ye),ye.defaultPrevented||ee(ye)}let V=h.createElement("a",{...g,...W,href:M.absoluteURL||T,onClick:M.isExternal||u?a:G,ref:rx($,z),target:y,"data-discover":!P&&i==="render"?"true":void 0});return I&&!P?h.createElement(h.Fragment,null,V,h.createElement(ex,{page:T})):V});_l.displayName="Link";var li=h.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:d="",end:f=!1,style:u,to:m,viewTransition:x,children:y,...w},v){let j=ls(m,{relative:w.relative}),k=fn(),g=h.useContext($l),{navigator:$,basename:S}=h.useContext(vt),C=g!=null&&mx(j)&&x===!0,P=$.encodeLocation?$.encodeLocation(j).pathname:j.pathname,M=k.pathname,T=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(M=M.toLowerCase(),T=T?T.toLowerCase():null,P=P.toLowerCase()),T&&S&&(T=Wt(T,S)||T);const I=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let z=M===P||!f&&M.startsWith(P)&&M.charAt(I)==="/",W=T!=null&&(T===P||!f&&T.startsWith(P)&&T.charAt(P.length)==="/"),ee={isActive:z,isPending:W,isTransitioning:C},G=z?a:void 0,V;typeof d=="function"?V=d(ee):V=[d,z?"active":null,W?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let ye=typeof u=="function"?u(ee):u;return h.createElement(_l,{...w,"aria-current":G,className:V,ref:v,style:ye,to:m,viewTransition:x},typeof y=="function"?y(ee):y)});li.displayName="NavLink";var ax=h.forwardRef(({discover:s="render",fetcherKey:a,navigate:i,reloadDocument:d,replace:f,state:u,method:m=Pl,action:x,onSubmit:y,relative:w,preventScrollReset:v,viewTransition:j,unstable_defaultShouldRevalidate:k,...g},$)=>{let{unstable_useTransitions:S}=h.useContext(vt),C=dx(),P=fx(x,{relative:w}),M=m.toLowerCase()==="get"?"get":"post",T=typeof x=="string"&&uf.test(x),I=z=>{if(y&&y(z),z.defaultPrevented)return;z.preventDefault();let W=z.nativeEvent.submitter,ee=(W==null?void 0:W.getAttribute("formmethod"))||m,G=()=>C(W||z.currentTarget,{fetcherKey:a,method:ee,navigate:i,replace:f,state:u,relative:w,preventScrollReset:v,viewTransition:j,unstable_defaultShouldRevalidate:k});S&&i!==!1?h.startTransition(()=>G()):G()};return h.createElement("form",{ref:$,method:M,action:P,onSubmit:d?y:I,...g,"data-discover":!T&&s==="render"?"true":void 0})});ax.displayName="Form";function ox(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function df(s){let a=h.useContext(or);return $e(a,ox(s)),a}function ix(s,{target:a,replace:i,state:d,preventScrollReset:f,relative:u,viewTransition:m,unstable_defaultShouldRevalidate:x,unstable_useTransitions:y}={}){let w=ir(),v=fn(),j=ls(s,{relative:u});return h.useCallback(k=>{if(Oh(k,a)){k.preventDefault();let g=i!==void 0?i:ts(v)===ts(j),$=()=>w(s,{replace:g,state:d,preventScrollReset:f,relative:u,viewTransition:m,unstable_defaultShouldRevalidate:x});y?h.startTransition(()=>$()):$()}},[v,w,j,i,d,a,s,f,u,m,x,y])}var cx=0,ux=()=>`__${String(++cx)}__`;function dx(){let{router:s}=df("useSubmit"),{basename:a}=h.useContext(vt),i=Rh(),d=s.fetch,f=s.navigate;return h.useCallback(async(u,m={})=>{let{action:x,method:y,encType:w,formData:v,body:j}=Vh(u,a);if(m.navigate===!1){let k=m.fetcherKey||ux();await d(k,i,m.action||x,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:j,formMethod:m.method||y,formEncType:m.encType||w,flushSync:m.flushSync})}else await f(m.action||x,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:v,body:j,formMethod:m.method||y,formEncType:m.encType||w,replace:m.replace,state:m.state,fromRouteId:i,flushSync:m.flushSync,viewTransition:m.viewTransition})},[d,f,a,i])}function fx(s,{relative:a}={}){let{basename:i}=h.useContext(vt),d=h.useContext(Et);$e(d,"useFormAction must be used inside a RouteContext");let[f]=d.matches.slice(-1),u={...ls(s||".",{relative:a})},m=fn();if(s==null){u.search=m.search;let x=new URLSearchParams(u.search),y=x.getAll("index");if(y.some(v=>v==="")){x.delete("index"),y.filter(j=>j).forEach(j=>x.append("index",j));let v=x.toString();u.search=v?`?${v}`:""}}return(!s||s===".")&&f.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Ht([i,u.pathname])),ts(u)}function mx(s,{relative:a}={}){let i=h.useContext(ef);$e(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:d}=df("useViewTransitionState"),f=ls(s,{relative:a});if(!i.isTransitioning)return!1;let u=Wt(i.currentLocation.pathname,d)||i.currentLocation.pathname,m=Wt(i.nextLocation.pathname,d)||i.nextLocation.pathname;return Ml(f.pathname,m)!=null||Ml(f.pathname,u)!=null}/**
52
+ * @license lucide-react v0.468.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const px=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ff=(...s)=>s.filter((a,i,d)=>!!a&&a.trim()!==""&&d.indexOf(a)===i).join(" ").trim();/**
57
+ * @license lucide-react v0.468.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var hx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
+ * @license lucide-react v0.468.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const xx=h.forwardRef(({color:s="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:d,className:f="",children:u,iconNode:m,...x},y)=>h.createElement("svg",{ref:y,...hx,width:a,height:a,stroke:s,strokeWidth:d?Number(i)*24/Number(a):i,className:ff("lucide",f),...x},[...m.map(([w,v])=>h.createElement(w,v)),...Array.isArray(u)?u:[u]]));/**
67
+ * @license lucide-react v0.468.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const te=(s,a)=>{const i=h.forwardRef(({className:d,...f},u)=>h.createElement(xx,{ref:u,iconNode:a,className:ff(`lucide-${px(s)}`,d),...f}));return i.displayName=`${s}`,i};/**
72
+ * @license lucide-react v0.468.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const gx=te("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
77
+ * @license lucide-react v0.468.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const yx=te("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
82
+ * @license lucide-react v0.468.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const mf=te("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
87
+ * @license lucide-react v0.468.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const vx=te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
92
+ * @license lucide-react v0.468.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Go=te("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
97
+ * @license lucide-react v0.468.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Ko=te("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
102
+ * @license lucide-react v0.468.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const pf=te("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
107
+ * @license lucide-react v0.468.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Pn=te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
112
+ * @license lucide-react v0.468.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const jx=te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
117
+ * @license lucide-react v0.468.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const sr=te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
122
+ * @license lucide-react v0.468.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const hf=te("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
127
+ * @license lucide-react v0.468.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const wx=te("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
132
+ * @license lucide-react v0.468.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const as=te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
137
+ * @license lucide-react v0.468.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Nx=te("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
142
+ * @license lucide-react v0.468.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Il=te("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
147
+ * @license lucide-react v0.468.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const ai=te("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
152
+ * @license lucide-react v0.468.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const kx=te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
157
+ * @license lucide-react v0.468.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const xf=te("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
162
+ * @license lucide-react v0.468.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Sx=te("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
167
+ * @license lucide-react v0.468.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const jl=te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
172
+ * @license lucide-react v0.468.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const bx=te("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
177
+ * @license lucide-react v0.468.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const qo=te("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
182
+ * @license lucide-react v0.468.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const gf=te("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
187
+ * @license lucide-react v0.468.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const Cx=te("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
192
+ * @license lucide-react v0.468.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const Ex=te("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
197
+ * @license lucide-react v0.468.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const Px=te("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
202
+ * @license lucide-react v0.468.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const Tx=te("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
207
+ * @license lucide-react v0.468.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const Rx=te("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
212
+ * @license lucide-react v0.468.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const Lx=te("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
217
+ * @license lucide-react v0.468.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const Mx=te("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
222
+ * @license lucide-react v0.468.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const oi=te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
227
+ * @license lucide-react v0.468.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const _x=te("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
232
+ * @license lucide-react v0.468.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const Dx=te("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
237
+ * @license lucide-react v0.468.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const yf=te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
242
+ * @license lucide-react v0.468.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const ii=te("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
247
+ * @license lucide-react v0.468.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const vf=te("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
252
+ * @license lucide-react v0.468.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Yo=te("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
257
+ * @license lucide-react v0.468.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const lr=te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
262
+ * @license lucide-react v0.468.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const En=te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
267
+ * @license lucide-react v0.468.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const $x=te("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
272
+ * @license lucide-react v0.468.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const jf=te("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
277
+ * @license lucide-react v0.468.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const mn=te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
282
+ * @license lucide-react v0.468.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const Dl=te("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
287
+ * @license lucide-react v0.468.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const zx=te("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
292
+ * @license lucide-react v0.468.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const wf=te("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
297
+ * @license lucide-react v0.468.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Ix=te("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
302
+ * @license lucide-react v0.468.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const Fx=te("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
307
+ * @license lucide-react v0.468.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Ax=te("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
312
+ * @license lucide-react v0.468.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const Nf=te("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
317
+ * @license lucide-react v0.468.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const Ox=te("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
322
+ * @license lucide-react v0.468.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const kf=te("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/**
327
+ * @license lucide-react v0.468.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const Sf=te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
332
+ * @license lucide-react v0.468.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const Bx=te("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
337
+ * @license lucide-react v0.468.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const ns=te("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
342
+ * @license lucide-react v0.468.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const Ux=te("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
347
+ * @license lucide-react v0.468.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const Vx=te("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
352
+ * @license lucide-react v0.468.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const Fl=te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Nd=s=>{let a;const i=new Set,d=(w,v)=>{const j=typeof w=="function"?w(a):w;if(!Object.is(j,a)){const k=a;a=v??(typeof j!="object"||j===null)?j:Object.assign({},a,j),i.forEach(g=>g(a,k))}},f=()=>a,x={setState:d,getState:f,getInitialState:()=>y,subscribe:w=>(i.add(w),()=>i.delete(w))},y=a=s(d,f,x);return x},Hx=(s=>s?Nd(s):Nd),Wx=s=>s;function Qx(s,a=Wx){const i=Zr.useSyncExternalStore(s.subscribe,Zr.useCallback(()=>a(s.getState()),[s,a]),Zr.useCallback(()=>a(s.getInitialState()),[s,a]));return Zr.useDebugValue(i),i}const kd=s=>{const a=Hx(s),i=d=>Qx(a,d);return Object.assign(i,a),i},cr=(s=>s?kd(s):kd),Bo="tlc-selected-project-id",Sd={roots:[],projects:[],selectedProjectId:null,isConfigured:!1,isScanning:!1,lastScan:null},Pe=cr(s=>({...Sd,setRoots:a=>s({roots:a,isConfigured:a.length>0}),setProjects:a=>s({projects:a}),selectProject:a=>{a===null?localStorage.removeItem(Bo):localStorage.setItem(Bo,a),s({selectedProjectId:a})},restoreSelectedProject:()=>{const a=localStorage.getItem(Bo);a&&s({selectedProjectId:a})},setIsScanning:a=>s({isScanning:a}),setLastScan:a=>s({lastScan:a}),reset:()=>s(Sd)})),Xo=h.forwardRef(({collapsed:s=!1,onToggle:a,className:i="",...d},f)=>{const u=Pe(y=>y.selectedProjectId),m=s?"w-16":"w-60",x=h.useMemo(()=>[{path:u?`/projects/${u}`:"/",label:"Dashboard",icon:r.jsx(Rx,{className:"h-5 w-5"})},{path:"/projects",label:"Projects",icon:r.jsx(qo,{className:"h-5 w-5"})},{path:u?`/projects/${u}/roadmap`:"/roadmap",label:"Roadmap",icon:r.jsx(_x,{className:"h-5 w-5"})},{path:u?`/projects/${u}/tasks`:"/tasks",label:"Tasks",icon:r.jsx(Fx,{className:"h-5 w-5"})},{path:u?`/projects/${u}/tests`:"/tests",label:"Tests",icon:r.jsx(kf,{className:"h-5 w-5"})},{path:u?`/projects/${u}/bugs`:"/bugs",label:"Bugs",icon:r.jsx(pf,{className:"h-5 w-5"})},{path:u?`/projects/${u}/logs`:"/logs",label:"Logs",icon:r.jsx(jf,{className:"h-5 w-5"})},{path:u?`/projects/${u}/memory`:"/memory",label:"Memory",icon:r.jsx(Ko,{className:"h-5 w-5"})},{path:"/docker",label:"Docker",icon:r.jsx(Go,{className:"h-5 w-5"})},{path:"/vps",label:"VPS",icon:r.jsx(Dl,{className:"h-5 w-5"})},{path:"/settings",label:"Settings",icon:r.jsx(zx,{className:"h-5 w-5"})}],[u]);return r.jsxs("aside",{ref:f,"data-testid":"sidebar",className:`
357
+ ${m}
358
+ h-screen
359
+ bg-bg-secondary
360
+ border-r border-border
361
+ flex flex-col
362
+ transition-all duration-300
363
+ ${s?"collapsed":""}
364
+ ${i}
365
+ `,...d,children:[r.jsx("div",{className:"h-14 flex items-center px-4 border-b border-border",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent flex items-center justify-center text-white font-bold",children:"T"}),!s&&r.jsx("span",{className:"font-semibold text-text-primary",children:"TLC"})]})}),r.jsx("nav",{className:"flex-1 py-4 overflow-y-auto",children:r.jsx("ul",{className:"space-y-1 px-2",children:x.map(y=>r.jsx("li",{children:r.jsxs(li,{to:y.path,end:!0,className:({isActive:w})=>`flex items-center gap-3 px-3 py-2 rounded-md transition-colors
366
+ ${w?"bg-accent text-white active":"text-text-secondary hover:bg-bg-tertiary hover:text-text-primary"}
367
+ ${s?"justify-center":""}`,title:s?y.label:void 0,children:[y.icon,!s&&r.jsx("span",{children:y.label})]})},y.path))})}),r.jsx("div",{className:"p-2 border-t border-border",children:r.jsx("button",{onClick:a,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-text-secondary hover:bg-bg-tertiary hover:text-text-primary transition-colors","aria-label":s?"Expand sidebar":"Collapse sidebar",children:s?r.jsx(sr,{className:"h-5 w-5"}):r.jsxs(r.Fragment,{children:[r.jsx(jx,{className:"h-5 w-5"}),r.jsx("span",{children:"Collapse"})]})})})]})});Xo.displayName="Sidebar";const Gx={primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost",danger:"btn-danger",outline:"btn-outline border border-border bg-transparent hover:bg-surface-secondary",destructive:"btn-danger"},Kx={sm:"btn-sm",md:"",lg:"btn-lg"},oe=h.forwardRef(({variant:s="primary",size:a="md",loading:i=!1,leftIcon:d,rightIcon:f,children:u,className:m="",disabled:x,...y},w)=>{const v=["btn",Gx[s],Kx[a],m].filter(Boolean).join(" "),j=r.jsxs(r.Fragment,{children:[i?r.jsx(oi,{className:"h-4 w-4 animate-spin","data-testid":"spinner"}):d,r.jsx("span",{children:u}),!i&&f]});return"href"in y&&y.href?r.jsx("a",{ref:w,className:v,...y,children:j}):r.jsx("button",{ref:w,className:v,disabled:x||i,...y,children:j})});oe.displayName="Button";const bf=h.forwardRef(({title:s,breadcrumbs:a=[],theme:i="dark",onThemeToggle:d,onMobileMenuToggle:f,onSearchClick:u,className:m="",...x},y)=>r.jsxs("header",{ref:y,"data-testid":"header",className:`
368
+ h-14
369
+ bg-bg-secondary
370
+ border-b border-border
371
+ flex items-center justify-between
372
+ px-4
373
+ ${m}
374
+ `,...x,children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("button",{onClick:f,className:"md:hidden p-2 text-text-secondary hover:text-text-primary","aria-label":"Open menu","data-testid":"mobile-menu-button",children:r.jsx(Dx,{className:"h-5 w-5"})}),r.jsx("nav",{"aria-label":"Breadcrumb",className:"hidden sm:block",children:r.jsx("ol",{className:"flex items-center gap-2 text-sm",children:a.length>0?a.map((w,v)=>r.jsxs("li",{className:"flex items-center gap-2",children:[v>0&&r.jsx("span",{className:"text-text-muted",children:"/"}),w.href?r.jsx("a",{href:w.href,className:"text-text-secondary hover:text-text-primary",children:w.label}):r.jsx("span",{className:"text-text-primary font-medium",children:w.label})]},w.label)):s?r.jsx("li",{className:"text-text-primary font-medium",children:s}):null})})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:u,className:"p-2 text-text-secondary hover:text-text-primary hover:bg-bg-tertiary rounded-md transition-colors","aria-label":"Search","data-testid":"search-button",children:r.jsx(mn,{className:"h-5 w-5"})}),r.jsx("button",{onClick:d,className:"p-2 text-text-secondary hover:text-text-primary hover:bg-bg-tertiary rounded-md transition-colors","aria-label":i==="dark"?"Switch to light theme":"Switch to dark theme","data-testid":"theme-toggle",children:i==="dark"?r.jsx(Nf,{className:"h-5 w-5"}):r.jsx(vf,{className:"h-5 w-5"})}),r.jsx(oe,{variant:"ghost",className:"p-2","aria-label":"User menu",children:r.jsx(ns,{className:"h-5 w-5"})})]})]}));bf.displayName="Header";const wl="tlc-theme";function Uo(s,a){try{localStorage.setItem(s,a)}catch{}}function qx(s){try{return localStorage.getItem(s)}catch{return null}}function Nl(s){return s==="system"?typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark":s}function Xr(s){typeof document<"u"&&document.documentElement.setAttribute("data-theme",s)}const bd={theme:"dark",themePreference:"system",sidebarCollapsed:!1,isCommandPaletteOpen:!1,activeView:"dashboard",isMobileMenuOpen:!1},Be=cr(s=>({...bd,setTheme:a=>{Uo(wl,a),Xr(a),s({theme:a,themePreference:a})},setThemePreference:a=>{Uo(wl,a);const i=Nl(a);Xr(i),s({themePreference:a,theme:i})},toggleTheme:()=>{s(a=>{const i=["dark","light","system"],d=i.indexOf(a.themePreference),f=d===-1?0:(d+1)%i.length,u=i[f],m=Nl(u);return Uo(wl,u),Xr(m),{themePreference:u,theme:m}})},setSidebarCollapsed:a=>s({sidebarCollapsed:a}),toggleSidebar:()=>s(a=>({sidebarCollapsed:!a.sidebarCollapsed})),openCommandPalette:()=>s({isCommandPaletteOpen:!0}),closeCommandPalette:()=>s({isCommandPaletteOpen:!1}),toggleCommandPalette:()=>s(a=>({isCommandPaletteOpen:!a.isCommandPaletteOpen})),setActiveView:a=>s({activeView:a}),toggleMobileMenu:()=>s(a=>({isMobileMenuOpen:!a.isMobileMenuOpen})),closeMobileMenu:()=>s({isMobileMenuOpen:!1}),initFromStorage:()=>{const a=qx(wl);if(a==="light"||a==="dark"||a==="system"){const i=Nl(a);Xr(i),s({themePreference:a,theme:i})}else{const i=Nl("system");Xr(i),s({themePreference:"system",theme:i})}},reset:()=>s(bd)})),Cd={project:null,status:null,loading:!1,error:null},Yx=cr(s=>({...Cd,setProject:a=>s({project:a,loading:!1,error:null}),setStatus:a=>s({status:a}),setLoading:a=>s({loading:a}),setError:a=>s({error:a,loading:!1}),clearError:()=>s({error:null}),reset:()=>s(Cd)})),Xx=s=>(a,i,d)=>{const f=d.subscribe;return d.subscribe=((m,x,y)=>{let w=m;if(x){const v=(y==null?void 0:y.equalityFn)||Object.is;let j=m(d.getState());w=k=>{const g=m(k);if(!v(j,g)){const $=j;x(j=g,$)}},y!=null&&y.fireImmediately&&x(j,j)}return f(w)}),s(a,i,d)},ci=Xx,Rl={status:null,assignee:null,phase:null,priority:null},er=(s,a)=>s.filter(i=>!(a.status&&i.status!==a.status||a.assignee&&i.assignee!==a.assignee||a.phase&&i.phase!==a.phase||a.priority&&i.priority!==a.priority)),kl=s=>({pending:s.filter(a=>a.status==="pending"),in_progress:s.filter(a=>a.status==="in_progress"),completed:s.filter(a=>a.status==="completed")}),Ed={tasks:[],selectedTask:null,filters:Rl,loading:!1},Jx=cr()(ci(s=>({...Ed,filteredTasks:[],tasksByStatus:{pending:[],in_progress:[],completed:[]},setTasks:a=>s({tasks:a,loading:!1,filteredTasks:er(a,Rl),tasksByStatus:kl(a)}),addTask:a=>s(i=>{const d=[...i.tasks,a];return{tasks:d,filteredTasks:er(d,i.filters),tasksByStatus:kl(d)}}),updateTask:(a,i)=>s(d=>{var m;const f=d.tasks.map(x=>x.id===a?{...x,...i}:x),u=((m=d.selectedTask)==null?void 0:m.id)===a?{...d.selectedTask,...i}:d.selectedTask;return{tasks:f,selectedTask:u,filteredTasks:er(f,d.filters),tasksByStatus:kl(f)}}),removeTask:a=>s(i=>{var f;const d=i.tasks.filter(u=>u.id!==a);return{tasks:d,selectedTask:((f=i.selectedTask)==null?void 0:f.id)===a?null:i.selectedTask,filteredTasks:er(d,i.filters),tasksByStatus:kl(d)}}),selectTask:a=>s({selectedTask:a}),setFilter:(a,i)=>s(d=>{const f={...d.filters,[a]:i};return{filters:f,filteredTasks:er(d.tasks,f)}}),clearFilters:()=>s(a=>({filters:Rl,filteredTasks:er(a.tasks,Rl)})),setLoading:a=>s({loading:a}),reset:()=>s({...Ed,filteredTasks:[],tasksByStatus:{pending:[],in_progress:[],completed:[]}})}))),Pd=1e3,Cf={app:[],test:[],git:[],system:[]},Td={logs:Cf,activeType:"app",searchQuery:"",autoScroll:!0},Rd=()=>Math.random().toString(36).slice(2),Ld=(s,a,i)=>{const f=[...s[a],...i],u=f.length>Pd?f.slice(f.length-Pd):f;return{...s,[a]:u}},Sl=(s,a)=>s[a],tr=(s,a,i)=>{const d=s[a];if(!i)return d;const f=i.toLowerCase();return d.filter(u=>u.text.toLowerCase().includes(f))},Jo=cr()(ci(s=>({...Td,currentLogs:[],filteredLogs:[],addLog:a=>s(i=>{const d={...a,id:a.id||Rd(),timestamp:a.timestamp||new Date().toISOString()},f=Ld(i.logs,a.type,[d]);return{logs:f,currentLogs:Sl(f,i.activeType),filteredLogs:tr(f,i.activeType,i.searchQuery)}}),addBatchLogs:a=>s(i=>{const d={};for(const u of a){const m={...u,id:u.id||Rd(),timestamp:u.timestamp||new Date().toISOString()};d[u.type]||(d[u.type]=[]),d[u.type].push(m)}let f={...i.logs};for(const[u,m]of Object.entries(d))f=Ld(f,u,m);return{logs:f,currentLogs:Sl(f,i.activeType),filteredLogs:tr(f,i.activeType,i.searchQuery)}}),setLogType:a=>s(i=>({activeType:a,currentLogs:Sl(i.logs,a),filteredLogs:tr(i.logs,a,i.searchQuery)})),clearLogs:a=>s(i=>{const d={...i.logs,[a]:[]};return{logs:d,currentLogs:Sl(d,i.activeType),filteredLogs:tr(d,i.activeType,i.searchQuery)}}),clearAllLogs:()=>s(()=>({logs:Cf,currentLogs:[],filteredLogs:[]})),setSearchQuery:a=>s(i=>({searchQuery:a,filteredLogs:tr(i.logs,i.activeType,a)})),clearSearch:()=>s(a=>({searchQuery:"",filteredLogs:tr(a.logs,a.activeType,"")})),setAutoScroll:a=>s({autoScroll:a}),reset:()=>s({...Td,currentLogs:[],filteredLogs:[]})}))),Zx=10,eg=1e3,tg=3e4,ng=s=>{const a=eg*Math.pow(2,s);return Math.min(a,tg)},nr={status:"disconnected",reconnectAttempts:0,lastConnected:null,error:null},rr=(s,a)=>({isConnected:s==="connected",shouldReconnect:s!=="connected"&&a<Zx,reconnectDelay:ng(a)}),Dt=cr()(ci(s=>({...nr,...rr(nr.status,nr.reconnectAttempts),setStatus:a=>s(i=>a==="connected"?{status:a,lastConnected:Date.now(),reconnectAttempts:0,error:null,...rr(a,0)}:{status:a,...rr(a,i.reconnectAttempts)}),incrementReconnectAttempts:()=>s(a=>{const i=a.reconnectAttempts+1;return{reconnectAttempts:i,...rr(a.status,i)}}),resetReconnectAttempts:()=>s(a=>({reconnectAttempts:0,...rr(a.status,0)})),setError:a=>s({error:a}),clearError:()=>s({error:null}),reset:()=>s({...nr,...rr(nr.status,nr.reconnectAttempts)})}))),Ef=h.forwardRef(({children:s,className:a="",...i},d)=>{const[f,u]=h.useState(!1),[m,x]=h.useState(!1),y=Be(k=>k.theme),w=Be(k=>k.toggleTheme),v=()=>{u(!f)},j=()=>{x(!m)};return r.jsxs("div",{ref:d,className:`flex h-screen bg-bg-primary ${a}`,...i,children:[r.jsx("a",{href:"#main-content",className:"skip-link",children:"Skip to main content"}),r.jsx("div",{className:"hidden md:block",children:r.jsx(Xo,{collapsed:f,onToggle:v})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 md:hidden",onClick:()=>x(!1),"data-testid":"mobile-overlay"}),r.jsx("div",{className:`
375
+ fixed inset-y-0 left-0 z-50 md:hidden
376
+ transform transition-transform duration-300
377
+ ${m?"translate-x-0":"-translate-x-full"}
378
+ `,"data-testid":"mobile-sidebar",children:r.jsx(Xo,{onToggle:()=>x(!1)})}),r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsx(bf,{theme:y,onThemeToggle:w,onMobileMenuToggle:j}),r.jsx("main",{id:"main-content",className:"flex-1 overflow-auto bg-bg-primary",tabIndex:-1,children:s})]})]})});Ef.displayName="Shell";class rg extends h.Component{constructor(i){super(i);gl(this,"handleRetry",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,d){this.setState({errorInfo:d}),this.props.onError&&this.props.onError(i,d),this.props.reportToServer&&this.props.reportToServer(i,d)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:r.jsxs("div",{className:"p-6 text-center",children:[r.jsx("h2",{className:"text-xl font-semibold text-error mb-2",children:"Something went wrong"}),r.jsx("p",{className:"text-text-secondary mb-4",children:"We're sorry, an unexpected error occurred."}),this.props.showError&&this.state.error&&r.jsx("pre",{className:"bg-surface-elevated p-4 rounded text-sm text-left overflow-auto mb-4",children:this.state.error.message}),r.jsx("button",{onClick:this.handleRetry,className:"btn btn-primary",children:"Retry"})]}):this.props.children}}function sg(s,a){s=s.toLowerCase(),a=a.toLowerCase();let i=0;for(let d=0;d<a.length&&i<s.length;d++)a[d]===s[i]&&i++;return i===s.length}function lg({commands:s,open:a,onClose:i,className:d=""}){const[f,u]=h.useState(""),[m,x]=h.useState(0),y=h.useRef(null),w=f?s.filter(k=>sg(f,k.label)):s;h.useEffect(()=>{var k;a&&(u(""),x(0),(k=y.current)==null||k.focus())},[a]),h.useEffect(()=>{x(0)},[f]);const v=k=>{k.action(),i()},j=k=>{k.key==="Escape"?i():k.key==="ArrowDown"?(k.preventDefault(),x(g=>Math.min(g+1,w.length-1))):k.key==="ArrowUp"?(k.preventDefault(),x(g=>Math.max(g-1,0))):k.key==="Enter"&&w[m]&&(k.preventDefault(),v(w[m]))};return a?r.jsxs("div",{"data-testid":"command-palette",className:`fixed inset-0 z-50 flex items-start justify-center pt-[20vh] ${d}`,children:[r.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:i}),r.jsxs("div",{className:"relative w-full max-w-lg bg-surface border border-border rounded-lg shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"flex items-center px-4 border-b border-border",children:[r.jsx(mn,{className:"w-5 h-5 text-muted-foreground"}),r.jsx("input",{ref:y,type:"text",value:f,onChange:k=>u(k.target.value),onKeyDown:j,placeholder:"Type a command...",className:"flex-1 px-3 py-4 bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]}),r.jsx("div",{className:"max-h-80 overflow-auto py-2",children:w.length===0?r.jsx("div",{className:"px-4 py-8 text-center text-muted-foreground",children:"No commands found"}):w.map((k,g)=>r.jsxs("button",{onClick:()=>v(k),className:`
379
+ w-full flex items-center justify-between px-4 py-3 text-left
380
+ ${g===m?"bg-muted":"hover:bg-muted/50"}
381
+ transition-colors
382
+ `,children:[r.jsx("span",{className:"text-foreground",children:k.label}),k.shortcut&&r.jsx("kbd",{className:"px-2 py-1 text-xs bg-muted rounded border border-border",children:k.shortcut})]},k.id))})]})]}):null}const ag={success:"bg-success",warning:"bg-warning",error:"bg-error",info:"bg-info",neutral:"bg-text-muted"},og={none:"",sm:"p-3",md:"p-4",lg:"p-6"},ie=h.forwardRef(({status:s,clickable:a=!1,padding:i="md",children:d,className:f="",onClick:u,...m},x)=>{const y=["card",og[i],a&&"card-hover",f].filter(Boolean).join(" "),w=r.jsxs(r.Fragment,{children:[s&&r.jsx("div",{className:`absolute left-0 top-0 bottom-0 w-1 rounded-l-lg ${ag[s]}`,"data-testid":"status-indicator"}),d]});return a||u?r.jsx("div",{ref:x,role:"button",tabIndex:0,"data-testid":"card",className:`${y} relative`,onClick:u,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),u==null||u(v))},...m,children:w}):r.jsx("div",{ref:x,"data-testid":"card",className:`${y} relative`,...m,children:w})});ie.displayName="Card";const es=h.forwardRef(({children:s,className:a="",...i},d)=>r.jsx("div",{ref:d,className:`border-b border-border pb-3 mb-3 ${a}`,...i,children:s}));es.displayName="CardHeader";const ig=h.forwardRef(({children:s,className:a="",...i},d)=>r.jsx("div",{ref:d,className:`border-t border-border pt-3 mt-3 ${a}`,...i,children:s}));ig.displayName="CardFooter";const cg={running:"badge-success",success:"badge-success",stopped:"badge-neutral",pending:"badge-neutral",building:"badge-warning",error:"badge-error"},ug={primary:"badge-primary bg-primary/10 text-primary border-primary/20",success:"badge-success bg-success/10 text-success border-success/20",warning:"badge-warning bg-warning/10 text-warning border-warning/20",danger:"badge-error bg-danger/10 text-danger border-danger/20",info:"badge-info bg-info/10 text-info border-info/20",neutral:"badge-neutral bg-text-muted/10 text-text-secondary border-border",secondary:"badge-secondary bg-text-muted/10 text-text-secondary border-border",error:"badge-error bg-danger/10 text-danger border-danger/20",outline:"badge-outline bg-transparent text-text-primary border-border",destructive:"badge-destructive bg-danger/10 text-danger border-danger/20"},dg={running:"bg-success",success:"bg-success",stopped:"bg-text-muted",pending:"bg-text-muted",building:"bg-warning",error:"bg-error"},fg={sm:"text-xs px-1.5 py-0.5",md:"text-sm px-2 py-0.5",lg:"text-base px-3 py-1"},Fe=h.forwardRef(({status:s="pending",variant:a,size:i="sm",dot:d=!1,icon:f,children:u,className:m="",...x},y)=>{const v=["badge inline-flex items-center gap-1 rounded-full border",a?ug[a]:cg[s],fg[i],m].filter(Boolean).join(" ");return r.jsxs("span",{ref:y,className:v,...x,children:[d&&r.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${dg[s]}`,"data-testid":"dot-indicator"}),f&&r.jsx("span",{className:"flex-shrink-0",children:f}),u]})});Fe.displayName="Badge";const mg={rectangular:"rounded-none",rounded:"rounded-md",circular:"rounded-full"};function ce({width:s,height:a="1rem",variant:i="rounded",className:d="",testId:f="skeleton"}){return r.jsx("div",{"data-testid":f,className:`
383
+ animate-pulse bg-muted
384
+ ${mg[i]}
385
+ ${d}
386
+ `,style:{width:s,height:a}})}const Vo=s=>{switch(s){case"debug":case"info":case"warn":case"error":return s;default:return"info"}},pg=s=>{if(!s.endsWith("-log"))return null;const a=s.replace("-log","");return a==="app"||a==="test"||a==="git"||a==="system"?a:null};function hg(s){const{url:a,autoConnect:i=!0,projectId:d,onMessage:f,onOpen:u,onClose:m,onError:x}=s,y=h.useRef(null),w=h.useRef(null),v=h.useRef(!1),j=h.useRef(!1),k=h.useRef(a);h.useEffect(()=>{k.current=a},[a]);const g=h.useRef(d);h.useEffect(()=>{g.current=d},[d]);const $=h.useRef(f),S=h.useRef(u),C=h.useRef(m),P=h.useRef(x);h.useEffect(()=>{$.current=f,S.current=u,C.current=m,P.current=x},[f,u,m,x]);const M=Dt(G=>G.isConnected),T=Jo(G=>G.addLog),I=Jo(G=>G.addBatchLogs),z=h.useCallback(()=>{var V,ye;if(((V=y.current)==null?void 0:V.readyState)===WebSocket.OPEN||((ye=y.current)==null?void 0:ye.readyState)===WebSocket.CONNECTING)return;v.current=!1,Dt.getState().setStatus("connecting");const G=new WebSocket(k.current);y.current=G,G.onopen=()=>{var Se;if(!j.current){G.close();return}Dt.getState().setStatus("connected"),(Se=S.current)==null||Se.call(S)},G.onclose=()=>{var Se;if(Dt.getState().setStatus("disconnected"),(Se=C.current)==null||Se.call(C),!v.current&&j.current&&Dt.getState().shouldReconnect){Dt.getState().incrementReconnectAttempts();const re=Dt.getState().reconnectDelay;w.current=setTimeout(()=>{j.current&&z()},re)}},G.onerror=Se=>{var ze;Dt.getState().setError("WebSocket connection error"),(ze=P.current)==null||ze.call(P,Se)},G.onmessage=Se=>{var ze;try{const re=JSON.parse(Se.data);if(g.current&&re.projectId&&re.projectId!==g.current)return;if(re.type==="init"&&re.data){const Z=re.data;if(Z.logs){const be=[];for(const[me,H]of Object.entries(Z.logs))if(!(me!=="app"&&me!=="test"&&me!=="git"&&me!=="system"))for(const ne of H)be.push({id:"",text:ne.text??"",level:Vo(ne.level),timestamp:ne.time??new Date().toISOString(),type:me});be.length>0&&I(be)}}const ve=pg(re.type);if(ve){const Z=re.data??re.payload;Z!=null&&Z.data&&T({id:"",text:Z.data,level:Vo(Z.level),timestamp:new Date().toISOString(),type:ve})}if(re.type==="log"){const Z=re.payload??re.data;if(Z!=null&&Z.text){const be=Z.type==="app"||Z.type==="test"||Z.type==="git"||Z.type==="system"?Z.type:"app";T({id:Z.id??"",text:Z.text,level:Vo(Z.level),timestamp:new Date().toISOString(),type:be})}}(ze=$.current)==null||ze.call($,re)}catch{}}},[T,I]),W=h.useCallback(()=>{v.current=!0,w.current&&(clearTimeout(w.current),w.current=null);const G=y.current;G&&(G.onopen=null,G.onclose=null,G.onerror=null,G.onmessage=null,(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING)&&G.close(),y.current=null),Dt.getState().setStatus("disconnected")},[]),ee=h.useCallback(G=>{var V;((V=y.current)==null?void 0:V.readyState)===WebSocket.OPEN&&y.current.send(JSON.stringify(G))},[]);return h.useEffect(()=>{if(j.current=!0,!!i)return z(),()=>{j.current=!1,W()}},[i,z,W,a,d]),h.useEffect(()=>{var G;d&&((G=y.current)==null?void 0:G.readyState)===WebSocket.OPEN&&ee({type:"subscribe",projectId:d})},[d,ee]),{isConnected:M,send:ee,connect:z,disconnect:W}}class xg extends Error{constructor(i,d,f){super(i);gl(this,"status");gl(this,"statusText");this.name="ApiError",this.status=d,this.statusText=f}}const gg="";function yg(s={}){const a=s.baseUrl||gg,i={"Content-Type":"application/json",...s.headers},d=(u,m)=>u?u.endsWith("/")&&m.startsWith("/")?`${u.slice(0,-1)}${m}`:`${u}${m}`:m;async function f(u,m,x,y){const w=d(a,m),v={...i,...y==null?void 0:y.headers},j={method:u,headers:v,signal:y==null?void 0:y.signal};x!==void 0&&(j.body=JSON.stringify(x));const k=await fetch(w,j);if(!k.ok){let g=k.statusText;try{g=(await k.json()).message||g}catch{}throw new xg(g,k.status,k.statusText)}return k.json()}return{get(u,m){return f("GET",u,void 0,m)},post(u,m,x){return f("POST",u,m,x)},put(u,m,x){return f("PUT",u,m,x)},patch(u,m,x){return f("PATCH",u,m,x)},delete(u,m){return f("DELETE",u,void 0,m)}}}const vg=yg();function jg(s){return{project:{getProject(){return s.get("/api/project")},getStatus(){return s.get("/api/status")},getChangelog(){return s.get("/api/changelog")}},tasks:{getTasks(){return s.get("/api/tasks").then(a=>a.items??[])},getTask(a){return s.get(`/api/tasks/${a}`)},createTask(a){return s.post("/api/tasks",a)},updateTask(a,i){return s.patch(`/api/tasks/${a}`,i)},deleteTask(a){return s.delete(`/api/tasks/${a}`)}},logs:{getLogs(a){return s.get(`/api/logs/${a}`)},clearLogs(a){return s.delete(`/api/logs/${a}`)}},agents:{getAgents(){return s.get("/api/agents")},getAgent(a){return s.get(`/api/agents/${a}`)},stopAgent(a){return s.post(`/api/agents/${a}/stop`)}},health:{getHealth(){return s.get("/api/health")}},commands:{runCommand(a,i){return s.post(`/api/commands/${a}`,i)},getHistory(){return s.get("/api/commands/history")}},bugs:{getBugs(){return s.get("/api/bugs")},createBug(a){return s.post("/api/bug",a)}},config:{getConfig(){return s.get("/api/config")},saveConfig(a){return s.put("/api/config",a)}},workspace:{getConfig(){return s.get("/api/workspace/config")},setConfig(a){return s.put("/api/workspace/config",{roots:a})},scan(){return s.post("/api/workspace/scan")},async getProjects(){return(await s.get("/api/workspace/projects")).projects},async getGroups(){return(await s.get("/api/workspace/groups")).groups}},projects:{async getById(a){return(await s.get(`/api/projects/${a}`)).project},async getStatus(a){return(await s.get(`/api/projects/${a}/status`)).status},async getTasks(a){return(await s.get(`/api/projects/${a}/tasks`)).tasks},async getBugs(a){return(await s.get(`/api/projects/${a}/bugs`)).bugs},async getRoadmap(a){return s.get(`/api/projects/${a}/roadmap`)},async getTestInventory(a){return s.get(`/api/projects/${a}/tests`)},async runTests(a){return s.post(`/api/projects/${a}/tests/run`)},async updateTaskStatus(a,i,d,f){return s.put(`/api/projects/${a}/tasks/${i}/status`,{status:d,owner:f})},async updateTask(a,i,d){return s.put(`/api/projects/${a}/tasks/${i}`,d)},async createTask(a,i){return s.post(`/api/projects/${a}/tasks`,i)},async updateBugStatus(a,i,d){return s.put(`/api/projects/${a}/bugs/${i}/status`,{status:d})},async updateBug(a,i,d){return s.put(`/api/projects/${a}/bugs/${i}`,d)},async createBug(a,i){return s.post(`/api/projects/${a}/bugs`,i)},async getMemoryDecisions(a){return(await s.get(`/api/projects/${a}/memory/decisions`)).decisions},async getMemoryGotchas(a){return(await s.get(`/api/projects/${a}/memory/gotchas`)).gotchas},async getMemoryStats(a){return s.get(`/api/projects/${a}/memory/stats`)},async getFile(a,i){return s.get(`/api/projects/${a}/files/${i}`)}}}}const je=jg(vg);function wg(s){const{project:a,status:i,loading:d,error:f,setProject:u,setStatus:m,setLoading:x,setError:y}=Yx(),w=h.useCallback(async()=>{u(null),m(null),x(!0);try{if(!s){x(!1);return}const[k,g]=await Promise.all([je.projects.getById(s),je.projects.getStatus(s).catch(()=>null)]),$=(g==null?void 0:g.currentPhase)??k.phase??0,S=(g==null?void 0:g.phaseName)??k.phaseName??void 0,C=(g==null?void 0:g.totalPhases)??k.totalPhases??0,P=(g==null?void 0:g.completedPhases)??k.completedPhases??0;u({id:k.id,name:k.name??"Unknown",path:k.path,hasTlc:k.hasTlc,hasPlanning:k.hasPlanning,version:k.version,phase:$,phaseName:S,totalPhases:C,completedPhases:P}),m({currentPhase:(g==null?void 0:g.currentPhase)??$,phaseName:(g==null?void 0:g.phaseName)??S,totalPhases:(g==null?void 0:g.totalPhases)??C,completedPhases:(g==null?void 0:g.completedPhases)??P,exists:g==null?void 0:g.exists,hasTlc:g==null?void 0:g.hasTlc,hasPlanning:g==null?void 0:g.hasPlanning,testsPass:(g==null?void 0:g.testsPass)??0,testsFail:(g==null?void 0:g.testsFail)??0,coverage:(g==null?void 0:g.coverage)??0})}catch(k){y(k instanceof Error?k.message:"Failed to fetch project")}},[s,x,u,m,y]),v=h.useCallback(async()=>{},[s]),j=h.useCallback(async()=>{await Promise.all([w(),v()])},[w,v]);return{project:a,status:i,loading:d,error:f,fetchProject:w,fetchStatus:v,refresh:j}}function ui(s){const{tasks:a,selectedTask:i,filters:d,loading:f,filteredTasks:u,tasksByStatus:m,setTasks:x,addTask:y,updateTask:w,removeTask:v,selectTask:j,setFilter:k,clearFilters:g,setLoading:$}=Jx(),S=h.useCallback(async()=>{$(!0);try{if(!s){x([]);return}const I=await je.projects.getTasks(s),W=(Array.isArray(I)?I:[]).map(ee=>({id:String(ee.num??ee.number??ee.id??""),title:ee.title??ee.subject??"Untitled",subject:ee.title??ee.subject??"Untitled",status:ee.status==="done"?"completed":ee.status??"pending",owner:ee.owner??null,priority:"medium"}));x(W)}catch(I){console.error("Failed to fetch tasks:",I),x([])}finally{$(!1)}},[s,$,x]),C=h.useCallback(async I=>{if(s)try{const z=await je.projects.createTask(s,{title:I.title||I.subject||"Untitled",goal:I.goal||I.description||""});return await S(),z.task}catch(z){throw console.error("Failed to create task:",z),z}try{const z=await je.tasks.createTask(I);return y(z),z}catch(z){throw console.error("Failed to create task:",z),z}},[y,s,S]),P=h.useCallback(async(I,z,W)=>{if(s)try{const ee=await je.projects.updateTaskStatus(s,parseInt(I,10),z,W);return w(I,{status:z==="done"?"completed":z,owner:W??null}),ee.task}catch(ee){throw console.error("Failed to update task status:",ee),ee}try{const ee=await je.tasks.updateTask(I,{status:z});return w(I,ee),ee}catch(ee){throw console.error("Failed to update task:",ee),ee}},[w,s]),M=h.useCallback(async(I,z)=>{if(s)try{const W=await je.projects.updateTask(s,parseInt(I,10),z);return w(I,W.task),W.task}catch(W){throw console.error("Failed to update task:",W),W}try{const W=await je.tasks.updateTask(I,z);return w(I,W),W}catch(W){throw console.error("Failed to update task:",W),W}},[w,s]),T=h.useCallback(async I=>{try{await je.tasks.deleteTask(I),v(I)}catch(z){throw console.error("Failed to delete task:",z),z}},[v]);return{tasks:a,selectedTask:i,filters:d,loading:f,isReadOnly:!1,filteredTasks:u,tasksByStatus:m,fetchTasks:S,createTask:C,updateTask:M,updateTaskStatus:P,deleteTask:T,selectTask:j,setFilter:k,clearFilters:g}}function Ng(){const[s,a]=h.useState(null),[i,d]=h.useState(!0),[f,u]=h.useState(!1),[m,x]=h.useState(null),y=h.useCallback(async()=>{d(!0),x(null);try{const j=await je.config.getConfig();a(j)}catch(j){x(j instanceof Error?j.message:"Failed to fetch config"),a(null)}finally{d(!1)}},[]);h.useEffect(()=>{y()},[y]);const w=h.useCallback(async j=>{u(!0),x(null);try{await je.config.saveConfig(j),a(j)}catch(k){const g=k instanceof Error?k.message:"Failed to save config";throw x(g),k}finally{u(!1)}},[]),v=h.useCallback(async()=>{await y()},[y]);return{config:s,loading:i,saving:f,error:m,saveConfig:w,refetch:v}}function di(s){const[a,i]=h.useState(null),[d,f]=h.useState(!1),[u,m]=h.useState(null),x=h.useCallback(async()=>{if(!s){i(null);return}f(!0),m(null);try{const y=await je.projects.getRoadmap(s);i(y)}catch(y){m(y instanceof Error?y.message:"Failed to fetch roadmap")}finally{f(!1)}},[s]);return h.useEffect(()=>{x()},[x]),{roadmap:a,loading:d,error:u,refresh:x}}function kg(s){const[a,i]=h.useState(null),[d,f]=h.useState(!1),[u,m]=h.useState(null),x=h.useCallback(async()=>{if(!s){i(null);return}f(!0),m(null);try{const w=await je.projects.getTestInventory(s);i(w)}catch(w){m(w instanceof Error?w.message:"Failed to fetch test inventory")}finally{f(!1)}},[s]),y=h.useCallback(async()=>{s&&await je.projects.runTests(s)},[s]);return h.useEffect(()=>{x()},[x]),{inventory:a,loading:d,error:u,refresh:x,runTests:y}}function Ho(){var ye,Se,ze;const s=ir(),{projectId:a}=Pt(),i=Pe(re=>re.selectProject),d=Pe(re=>re.selectedProjectId),f=a??d??void 0;h.useEffect(()=>{a&&a!==d&&i(a)},[a,d,i]);const{project:u,loading:m,fetchProject:x,fetchStatus:y}=wg(f),{fetchTasks:w}=ui(f),{roadmap:v,loading:j}=di(f),k=Be(re=>re.setActiveView),[g,$]=h.useState(null);h.useEffect(()=>{k("dashboard"),x(),y(),w()},[k,x,y,w,f]);const S=()=>s("/projects");if(m||j)return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsx(ce,{className:"h-8 w-64"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(re=>r.jsx(ce,{className:"h-32"},re))}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsx(ce,{className:"h-64"}),r.jsx(ce,{className:"h-64"})]})]});if(!u)return r.jsx("div",{className:"p-6",children:r.jsx(ie,{className:"p-8",children:r.jsxs("div",{className:"text-center",children:[r.jsx(gf,{className:"w-16 h-16 mx-auto text-text-muted mb-4"}),r.jsx("h2",{className:"text-xl font-semibold text-text-primary mb-2",children:"No Project Selected"}),r.jsx("p",{className:"text-text-secondary mb-6",children:"Select a project to view its dashboard and start working."}),r.jsx(oe,{onClick:S,children:"Get Started"})]})})});if(!u.hasTlc&&!u.hasPlanning&&(u.totalPhases??0)===0)return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:u.name}),r.jsx("p",{className:"text-text-secondary mt-1",children:u.path})]})}),r.jsx(ie,{className:"p-6",children:r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-text-secondary mb-2",children:"This project doesn't have TLC configured yet."}),r.jsxs("p",{className:"text-sm text-text-muted mb-4",children:["Run ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-tertiary rounded",children:"/tlc:init"})," in the project directory to start tracking phases, tasks, and tests."]}),r.jsxs("p",{className:"text-xs text-text-muted",children:["Version: ",u.version||"unknown"]})]})})]});const P=re=>re==="done"?"success":re==="in_progress"?"primary":"neutral",M=re=>{$(ve=>ve===re?null:re)},T=(v==null?void 0:v.completedPhases)??0,I=(v==null?void 0:v.totalPhases)??0,z=((ye=v==null?void 0:v.testSummary)==null?void 0:ye.totalTests)??0,W=((Se=v==null?void 0:v.testSummary)==null?void 0:Se.totalFiles)??0,ee=((ze=v==null?void 0:v.currentPhase)==null?void 0:ze.number)??0,G=v==null?void 0:v.projectInfo,V=(v==null?void 0:v.recentCommits)??[];return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{"data-testid":"project-name",className:"text-2xl font-semibold text-text-primary",children:(G==null?void 0:G.name)??u.name}),r.jsxs("span",{"data-testid":"project-version",className:"text-sm text-text-secondary font-mono",children:["v",(G==null?void 0:G.version)??u.version??"0.0.0"]})]}),r.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[(v==null?void 0:v.currentPhase)&&r.jsxs("p",{className:"text-text-secondary",children:["Phase ",v.currentPhase.number,": ",v.currentPhase.name]}),u.branch&&r.jsxs("span",{className:"flex items-center gap-1 text-text-secondary text-sm",children:[r.jsx(Cx,{className:"w-4 h-4"}),u.branch]})]})]})}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Phases"}),r.jsxs("div",{"data-testid":"stat-phases",className:"text-3xl font-bold text-text-primary mt-2",children:[T,"/",I]})]}),r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Tests"}),r.jsx("div",{"data-testid":"stat-tests",className:"text-3xl font-bold text-success mt-2",children:z})]}),r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Test Files"}),r.jsx("div",{"data-testid":"stat-files",className:"text-3xl font-bold text-primary mt-2",children:W})]}),r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Current Phase"}),r.jsxs("div",{"data-testid":"stat-current-phase",className:"text-3xl font-bold text-text-primary mt-2",children:["#",ee]})]})]}),r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsxs("div",{className:"space-y-4",children:[r.jsx("h3",{className:"font-medium text-text-primary",children:"Roadmap"}),v==null?void 0:v.milestones.map(re=>r.jsxs("div",{children:[r.jsx("h4",{"data-testid":"milestone-header",className:"text-sm font-semibold text-text-secondary uppercase tracking-wide mb-2",children:re.name}),r.jsx("div",{className:"space-y-1",children:re.phases.map(ve=>{var me;const Z=((me=v.currentPhase)==null?void 0:me.number)===ve.number,be=g===ve.number;return r.jsxs("div",{children:[r.jsxs("div",{"data-testid":"phase-row",className:`flex items-center justify-between p-2 rounded cursor-pointer hover:bg-bg-tertiary ${Z?"current-phase bg-primary/5 border border-primary/20":""}`,onClick:()=>M(ve.number),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-sm font-mono text-text-muted",children:[ve.number,"."]}),r.jsx("span",{className:"text-sm text-text-primary",children:ve.name}),r.jsx(Fe,{"data-testid":"phase-status",variant:P(ve.status),size:"sm",children:ve.status})]}),r.jsxs("span",{"data-testid":"phase-tasks",className:"text-xs text-text-muted font-mono",children:[ve.completedTaskCount,"/",ve.taskCount]})]}),be&&r.jsxs("div",{className:"ml-6 pl-3 border-l border-border mt-1 mb-2",children:[r.jsx("p",{"data-testid":"phase-goal",className:"text-sm text-text-secondary mb-2",children:ve.goal}),r.jsx("ul",{"data-testid":"phase-deliverables",className:"space-y-1",children:ve.deliverables.map((H,ne)=>r.jsxs("li",{className:"text-sm text-text-secondary flex items-center gap-2",children:[r.jsx("span",{children:H.done?"✓":"○"}),r.jsx("span",{children:H.text})]},ne))})]})]},ve.number)})})]},re.name))]}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-text-primary mb-4",children:"Recent Activity"}),r.jsxs("div",{"data-testid":"recent-commits",className:"space-y-2",children:[V.length===0&&r.jsx("p",{className:"text-sm text-text-muted",children:"No recent commits"}),V.map(re=>r.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[r.jsx("code",{"data-testid":"commit-hash",className:"text-xs font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded shrink-0",children:re.hash.slice(0,7)}),r.jsx("span",{"data-testid":"commit-message",className:"text-text-secondary truncate",children:re.message})]},re.hash))]})]})]})]})}const Sg={high:"bg-error text-white",medium:"bg-warning text-white",low:"bg-info text-white"};function bg({task:s,onClick:a,onDragStart:i,isDraggable:d=!1,isDragging:f=!1,className:u=""}){const m=()=>{a==null||a(s)},x=w=>{var v;(v=w.dataTransfer)==null||v.setData("text/plain",s.id),i==null||i(s)},y=s.testStatus.total===0?"bg-muted":s.testStatus.failed>0?"bg-error":"bg-success";return r.jsxs("div",{"data-testid":"task-card",onClick:m,onDragStart:x,draggable:d,className:`
387
+ p-3 bg-surface border border-border rounded-lg
388
+ hover:border-primary/50 hover:shadow-sm
389
+ transition-all cursor-pointer
390
+ ${f?"opacity-50 scale-95":""}
391
+ ${u}
392
+ `,children:[r.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[r.jsx("h4",{className:"font-medium text-foreground text-sm line-clamp-2",children:s.title}),r.jsx("span",{"data-testid":"priority-badge",className:`
393
+ px-1.5 py-0.5 text-xs font-medium rounded
394
+ ${Sg[s.priority]}
395
+ `,children:s.priority})]}),s.description&&r.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:s.description}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center gap-1.5",children:s.assignee?r.jsxs(r.Fragment,{children:[s.assignee.avatar?r.jsx("img",{"data-testid":"assignee-avatar",src:s.assignee.avatar,alt:s.assignee.name,className:"w-5 h-5 rounded-full"}):r.jsx("div",{"data-testid":"assignee-avatar",className:"w-5 h-5 rounded-full bg-primary/20 flex items-center justify-center",children:r.jsx("span",{className:"text-xs text-primary font-medium",children:s.assignee.name[0]})}),r.jsx("span",{className:"text-xs text-muted-foreground",children:s.assignee.name})]}):r.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[r.jsx(ns,{className:"w-4 h-4"}),r.jsx("span",{className:"text-xs",children:"Unassigned"})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{"data-testid":"test-status",className:"flex items-center gap-1",children:[r.jsx("div",{"data-testid":"test-indicator",className:`w-2 h-2 rounded-full ${y}`}),r.jsx(kf,{className:"w-3 h-3 text-muted-foreground"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.testStatus.passed,"/",s.testStatus.total]})]}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Phase ",s.phase]})]})]})]})}const bl=[{id:"todo",title:"To Do"},{id:"in_progress",title:"In Progress"},{id:"done",title:"Done"}];function Cg({tasks:s,onTaskMove:a,onTaskClick:i,isLoading:d=!1,className:f=""}){const[u,m]=h.useState(null),[x,y]=h.useState(null),[w,v]=h.useState(0),[j,k]=h.useState(-1),g=h.useCallback(T=>s.filter(I=>I.status===T),[s]),$=T=>{y(T.id)},S=(T,I)=>{T.preventDefault(),m(I)},C=()=>{m(null)},P=(T,I)=>{T.preventDefault();const z=T.dataTransfer.getData("text/plain");z&&a&&a(z,I),m(null),y(null)},M=T=>{const I=bl[w];if(!I)return;const z=g(I.id);switch(T.key){case"h":T.preventDefault(),v(W=>Math.max(0,W-1)),k(-1);break;case"l":T.preventDefault(),v(W=>Math.min(bl.length-1,W+1)),k(-1);break;case"j":T.preventDefault(),k(W=>Math.min(z.length-1,W+1));break;case"k":T.preventDefault(),k(W=>Math.max(0,W-1));break;case"Enter":T.preventDefault(),j>=0&&z[j]&&(i==null||i(z[j]));break}};return d?r.jsx("div",{"data-testid":"task-board",className:`grid grid-cols-1 md:grid-cols-3 gap-4 ${f}`,children:bl.map(T=>r.jsxs("div",{"data-testid":`column-${T.id}`,className:"bg-muted/30 rounded-lg p-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx(ce,{height:"1.25rem",className:"w-24"}),r.jsx(ce,{height:"1.25rem",className:"w-6"})]}),r.jsx("div",{className:"space-y-3",children:[1,2].map(I=>r.jsx(ce,{height:"100px",className:"w-full"},I))})]},T.id))}):s.length===0?r.jsx("div",{"data-testid":"task-board",className:f,children:r.jsxs("div",{"data-testid":"empty-state",className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4",children:r.jsx(Mx,{className:"w-8 h-8 text-muted-foreground"})}),r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"No tasks yet"}),r.jsxs("p",{className:"text-muted-foreground max-w-md",children:["Tasks will appear here when you run"," ",r.jsx("code",{className:"text-primary",children:"/tlc:plan"})," to create a phase plan."]})]})}):r.jsx("div",{"data-testid":"task-board",tabIndex:0,onKeyDown:M,className:`grid grid-cols-1 md:grid-cols-3 gap-4 outline-none ${f}`,children:bl.map((T,I)=>{const z=g(T.id),W=w===I,ee=u===T.id;return r.jsxs("div",{"data-testid":`column-${T.id}`,onDragOver:G=>S(G,T.id),onDragEnter:()=>m(T.id),onDragLeave:C,onDrop:G=>P(G,T.id),className:`
396
+ bg-muted/30 rounded-lg p-4 min-h-[400px]
397
+ transition-all
398
+ ${ee||W&&j===-1?"ring-2 ring-primary":""}
399
+ `,children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:T.title}),r.jsx("span",{"data-testid":`count-${T.id}`,className:"px-2 py-0.5 text-xs font-medium bg-muted rounded-full text-muted-foreground",children:z.length})]}),r.jsx("div",{className:"space-y-3",children:z.map((G,V)=>{const ye=W&&j===V,Se=x===G.id;return r.jsx(bg,{task:G,onClick:i,onDragStart:$,isDraggable:!!a,isDragging:Se,className:ye?"ring-2 ring-primary":""},G.id)})})]},T.id)})})}const Eg=[{id:"high",label:"High"},{id:"medium",label:"Medium"},{id:"low",label:"Low"}];function Pg({assignees:s,onFilterChange:a,initialFilters:i,className:d=""}){const[f,u]=h.useState(!1),[m,x]=h.useState(i||{assignees:[],priorities:[]}),y=h.useRef(null);h.useEffect(()=>{if(!f)return;const g=$=>{y.current&&!y.current.contains($.target)&&u(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[f]);const w=g=>{const $=m.assignees.includes(g)?m.assignees.filter(C=>C!==g):[...m.assignees,g],S={...m,assignees:$};x(S),a(S)},v=g=>{const $=m.priorities.includes(g)?m.priorities.filter(C=>C!==g):[...m.priorities,g],S={...m,priorities:$};x(S),a(S)},j=()=>{const g={assignees:[],priorities:[]};x(g),a(g)},k=m.assignees.length+m.priorities.length;return r.jsxs("div",{ref:y,className:`relative inline-block ${d}`,children:[r.jsxs("button",{"data-testid":"task-filter",onClick:()=>u(!f),className:`
400
+ flex items-center gap-2 px-3 py-2
401
+ bg-surface border border-border rounded-md
402
+ hover:bg-muted transition-colors
403
+ text-foreground text-sm
404
+ `,children:[r.jsx(bx,{className:"w-4 h-4"}),r.jsx("span",{children:"Filter"}),k>0&&r.jsx("span",{"data-testid":"filter-count",className:"px-1.5 py-0.5 text-xs font-medium bg-primary text-white rounded-full",children:k})]}),f&&r.jsxs("div",{"data-testid":"filter-panel",className:`\r
405
+ absolute z-50 mt-1 w-64\r
406
+ bg-surface border border-border rounded-md shadow-lg\r
407
+ p-4 right-0\r
408
+ `,children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("h4",{className:"font-medium text-foreground",children:"Filters"}),k>0&&r.jsx("button",{onClick:j,className:"text-xs text-primary hover:underline",children:"Clear all"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("h5",{className:"text-sm font-medium text-foreground mb-2",children:"Assignee"}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m.assignees.includes("unassigned"),onChange:()=>w("unassigned"),className:"rounded border-border"}),r.jsx("span",{className:"text-sm text-foreground",children:"Unassigned"})]}),s.map(g=>r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m.assignees.includes(g.id),onChange:()=>w(g.id),className:"rounded border-border"}),r.jsx("span",{className:"text-sm text-foreground",children:g.name})]},g.id))]})]}),r.jsxs("div",{children:[r.jsx("h5",{className:"text-sm font-medium text-foreground mb-2",children:"Priority"}),r.jsx("div",{className:"space-y-2",children:Eg.map(g=>r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m.priorities.includes(g.id),onChange:()=>v(g.id),className:"rounded border-border"}),r.jsx("span",{className:"text-sm text-foreground",children:g.label})]},g.id))})]})]})]})}const Tg={todo:"To Do",in_progress:"In Progress",done:"Done"},Rg={high:"bg-error text-white",medium:"bg-warning text-white",low:"bg-info text-white"};function Lg(s){const a=new Date(s),d=new Date().getTime()-a.getTime(),f=Math.floor(d/6e4),u=Math.floor(d/36e5),m=Math.floor(d/864e5);return f<1?"just now":f<60?`${f}m ago`:u<24?`${u}h ago`:m<7?`${m}d ago`:a.toLocaleDateString()}function Mg({task:s,acceptanceCriteria:a,activity:i,onClose:d,onCriteriaToggle:f,onClaim:u,onRelease:m,onComplete:x,currentUserId:y}){var k;const w=((k=s.assignee)==null?void 0:k.id)===y,v=!s.assignee,j=s.status==="in_progress";return r.jsxs("div",{className:"bg-surface border border-border rounded-lg max-w-2xl w-full max-h-[80vh] overflow-hidden flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between p-4 border-b border-border",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(Fe,{variant:"neutral",children:Tg[s.status]}),r.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium rounded ${Rg[s.priority]}`,children:s.priority}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Phase ",s.phase]})]}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.title}),r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[v&&u&&r.jsx(oe,{variant:"primary",size:"sm",onClick:()=>u(s.id),children:"Claim"}),j&&x&&r.jsx(oe,{variant:"primary",size:"sm",onClick:()=>x(s.id),children:"Complete"})]})]}),r.jsx("button",{onClick:d,"aria-label":"Close",className:"p-1 rounded hover:bg-muted transition-colors",children:r.jsx(Fl,{className:"w-5 h-5 text-muted-foreground"})})]}),r.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[s.description&&r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-medium text-foreground mb-2",children:"Description"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-medium text-foreground mb-2",children:"Assignee"}),s.assignee?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center",children:r.jsx("span",{className:"text-sm text-primary font-medium",children:s.assignee.name[0]})}),r.jsx("span",{className:"text-sm text-foreground",children:s.assignee.name}),w&&m&&r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>m(s.id),children:"Release"})]}):r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ns,{className:"w-5 h-5 text-muted-foreground"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Unassigned"}),v&&u&&r.jsx(oe,{variant:"primary",size:"sm",onClick:()=>u(s.id),children:"Claim Task"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-medium text-foreground mb-2",children:"Test Status"}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(wx,{className:"w-4 h-4 text-success"}),r.jsxs("span",{className:"text-sm text-foreground",children:[s.testStatus.passed," passed"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Nx,{className:"w-4 h-4 text-error"}),r.jsxs("span",{className:"text-sm text-foreground",children:[s.testStatus.failed," failed"]})]})]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"text-sm font-medium text-foreground mb-2",children:["Acceptance Criteria (",a.filter(g=>g.completed).length,"/",a.length,")"]}),r.jsx("div",{className:"space-y-2",children:a.map(g=>r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer group",children:[r.jsx("input",{type:"checkbox",checked:g.completed,onChange:$=>f==null?void 0:f(g.id,$.target.checked),className:"mt-0.5 rounded border-border"}),r.jsx("span",{className:`text-sm ${g.completed?"text-muted-foreground line-through":"text-foreground"}`,children:g.text})]},g.id))})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-medium text-foreground mb-2",children:"Activity"}),r.jsx("div",{className:"space-y-3",children:i.map(g=>r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("div",{className:"w-6 h-6 rounded-full bg-muted flex items-center justify-center flex-shrink-0 mt-0.5",children:g.type==="comment"?r.jsx(yf,{className:"w-3 h-3 text-muted-foreground"}):g.type==="status_change"?r.jsx(vx,{className:"w-3 h-3 text-muted-foreground"}):r.jsx(ns,{className:"w-3 h-3 text-muted-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("p",{className:"text-sm text-foreground",children:[r.jsx("span",{className:"font-medium",children:g.user})," ",r.jsx("span",{className:"text-muted-foreground",children:g.message})]}),r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[r.jsx(ai,{className:"w-3 h-3"}),Lg(g.timestamp)]})]})]},g.id))})]})]})]})}function _g(s){return{id:s.id,title:s.subject||s.title||"Untitled",description:s.goal||s.description||"",status:Dg(s.status),priority:s.priority||"medium",assignee:s.owner?{id:s.owner,name:s.owner}:void 0,testStatus:s.testStatus||{passed:0,failed:0,total:0},phase:s.phase||0,createdAt:s.createdAt||new Date().toISOString(),updatedAt:s.updatedAt||new Date().toISOString()}}function Dg(s){switch(s){case"completed":case"done":return"done";case"in_progress":return"in_progress";default:return"todo"}}function $g(s){const a=new Set,i=[];for(const d of s)d.assignee&&!a.has(d.assignee.id)&&(a.add(d.assignee.id),i.push(d.assignee));return i}const zg=[];function Ig(s,a){const i=a.find(d=>d.id===s.id);return i!=null&&i.acceptanceCriteria&&i.acceptanceCriteria.length>0?i.acceptanceCriteria.map((d,f)=>({id:String(f+1),text:d,completed:s.status==="done"})):[]}function Md(){const s=Be(Z=>Z.setActiveView),{projectId:a}=Pt(),i=Pe(Z=>Z.selectProject),d=Pe(Z=>Z.selectedProjectId),f=a??d??void 0;h.useEffect(()=>{a&&a!==d&&i(a)},[a,d,i]);const u=Pe(Z=>Z.projects.find(be=>be.id===(a??d))),{tasks:m,loading:x,fetchTasks:y,updateTaskStatus:w,createTask:v}=ui(f),[j,k]=h.useState(null),[g,$]=h.useState({assignees:[],priorities:[]}),[S,C]=h.useState(!1),[P,M]=h.useState(""),[T,I]=h.useState("");h.useEffect(()=>{s("tasks"),y()},[s,y,f]);const z=h.useMemo(()=>m.map(_g),[m]),W=h.useMemo(()=>$g(z),[z]),ee=h.useCallback(Z=>{$(Z)},[]),G=h.useCallback(Z=>{k(Z)},[]),V=h.useCallback(()=>{k(null)},[]),ye=h.useCallback(async(Z,be)=>{const me=be==="done"?"completed":be;try{await w(Z,me)}catch{y()}},[w,y]),Se=h.useCallback(async Z=>{try{await w(Z,"in_progress"),y()}catch{}},[w,y]),ze=h.useCallback(async Z=>{try{await w(Z,"done"),y()}catch{}},[w,y]),re=h.useCallback(async()=>{if(P.trim())try{await v({title:P,goal:T,description:T}),M(""),I(""),C(!1)}catch{}},[v,P,T]),ve=h.useMemo(()=>z.filter(Z=>!(g.assignees.length>0&&Z.assignee&&!g.assignees.includes(Z.assignee.id)||g.priorities.length>0&&!g.priorities.includes(Z.priority))),[z,g]);return x&&z.length===0?r.jsxs("div",{className:"h-full p-6 space-y-4",children:[r.jsx(ce,{className:"h-8 w-32"}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsx(ce,{className:"h-64"}),r.jsx(ce,{className:"h-64"}),r.jsx(ce,{className:"h-64"})]})]}):r.jsxs("div",{className:"h-full flex",children:[r.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r.jsx("div",{className:"p-4 border-b border-border",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h1",{className:"text-xl font-semibold text-text-primary",children:"Tasks"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{"data-testid":"create-task-btn",onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md bg-accent text-white hover:bg-accent-hover transition-colors",children:[r.jsx(lr,{className:"h-4 w-4"}),"Create Task"]}),r.jsx(Pg,{assignees:W,onFilterChange:ee,initialFilters:g})]})]})}),S&&r.jsxs("div",{"data-testid":"task-create-form",className:"p-4 border-b border-border bg-bg-secondary",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"text-sm font-medium text-text-primary",children:"New Task"}),r.jsx("button",{onClick:()=>C(!1),className:"p-1 rounded hover:bg-bg-tertiary transition-colors",children:r.jsx(Fl,{className:"h-4 w-4 text-text-muted"})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("input",{"data-testid":"task-title-input",type:"text",placeholder:"Task title...",value:P,onChange:Z=>M(Z.target.value),className:"w-full px-3 py-2 text-sm bg-bg-primary border border-border rounded-md text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-accent"}),r.jsx("textarea",{"data-testid":"task-goal-input",placeholder:"Goal / description...",value:T,onChange:Z=>I(Z.target.value),rows:2,className:"w-full px-3 py-2 text-sm bg-bg-primary border border-border rounded-md text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-accent resize-none"}),r.jsx("button",{"data-testid":"task-submit-btn",disabled:!P.trim(),onClick:re,className:"px-4 py-2 text-sm font-medium rounded-md bg-accent text-white hover:bg-accent-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Create"})]})]}),r.jsx("div",{className:"flex-1 overflow-auto p-4",children:z.length===0?r.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center",children:u&&!u.hasPlanning?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-text-secondary mb-2",children:"No TLC planning configured"}),r.jsxs("p",{className:"text-sm text-text-muted mb-4",children:["This project doesn't have a ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-tertiary rounded",children:".planning/"})," directory."]}),r.jsxs("p",{className:"text-sm text-text-muted",children:["Run ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-tertiary rounded",children:"/tlc:init"})," in the project to start tracking tasks."]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-text-secondary mb-2",children:"No tasks found"}),r.jsx("p",{className:"text-sm text-text-muted mb-4",children:u!=null&&u.hasPlanning?"No tasks in current phase plan files (.planning/phases/*-PLAN.md)":"Select a project with TLC configured to view tasks"}),r.jsxs("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md bg-accent text-white hover:bg-accent-hover transition-colors",children:[r.jsx(lr,{className:"h-4 w-4"}),"Create Task"]})]})}):r.jsx(Cg,{tasks:ve,onTaskMove:ye,onTaskClick:G})})]}),j&&r.jsx("div",{className:"w-96 border-l border-border",children:r.jsx(Mg,{task:j,acceptanceCriteria:Ig(j,m),activity:zg,onClose:V,onClaim:Se,onRelease:V,onComplete:ze})})]})}const _d={info:"text-info",warn:"text-warning",error:"text-error",debug:"text-muted-foreground"},Dd={info:"INFO",warn:"WARN",error:"ERROR",debug:"DEBUG"};function Fg(s){return new Date(s).toLocaleTimeString("en-US",{hour12:!1})}function Ag({logs:s,autoScroll:a=!0,showFilters:i=!1,showCount:d=!1,virtualized:f=!1,copyOnClick:u=!1,className:m=""}){const[x,y]=h.useState(!1),[w,v]=h.useState(new Set),j=h.useRef(null),k=h.useRef(0),g=w.size>0?s.filter(T=>w.has(T.level)):s,$=f?g.slice(-50):g;h.useEffect(()=>{a&&!x&&j.current&&(j.current.scrollTop=j.current.scrollHeight)},[s,a,x]);const S=h.useCallback(()=>{if(!j.current||!a)return;const{scrollTop:T,scrollHeight:I,clientHeight:z}=j.current,W=I-T-z<50;T<k.current&&!W&&y(!0),k.current=T},[a]),C=()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight,y(!1))},P=T=>{v(I=>{const z=new Set(I);return z.has(T)?z.delete(T):z.add(T),z})},M=T=>{u&&navigator.clipboard&&navigator.clipboard.writeText(`[${T.timestamp}] [${T.level}] ${T.message}`)};return s.length===0?r.jsx("div",{"data-testid":"log-stream",className:`bg-surface border border-border rounded-lg ${m}`,children:r.jsxs("div",{"data-testid":"empty-state",className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mb-4",children:r.jsx(jf,{className:"w-8 h-8 text-muted-foreground"})}),r.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"No logs yet"}),r.jsx("p",{className:"text-muted-foreground",children:"Logs will appear here when your services start running."})]})}):r.jsxs("div",{"data-testid":"log-stream",className:`bg-surface border border-border rounded-lg flex flex-col ${m}`,children:[(i||d)&&r.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[i&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-muted-foreground",children:"Filter:"}),["error","warn","info","debug"].map(T=>r.jsx("button",{"data-testid":`filter-${T}`,onClick:()=>P(T),className:`
409
+ px-2 py-1 text-xs font-medium rounded
410
+ transition-colors
411
+ ${w.has(T)?`${_d[T]} bg-current/10`:"text-muted-foreground hover:text-foreground"}
412
+ `,children:Dd[T]},T))]}),d&&r.jsx("span",{"data-testid":"log-count",className:"text-sm text-muted-foreground",children:g.length})]}),r.jsx("div",{ref:j,"data-testid":"log-container",onScroll:S,className:"flex-1 overflow-auto font-mono text-sm p-2 max-h-[400px]",children:$.map(T=>r.jsxs("div",{"data-testid":"log-entry",onClick:()=>M(T),className:`
413
+ flex items-start gap-2 py-1 px-2 rounded
414
+ hover:bg-muted/50
415
+ ${u?"cursor-pointer":""}
416
+ `,children:[r.jsx("span",{"data-testid":"log-timestamp",className:"text-muted-foreground flex-shrink-0",children:Fg(T.timestamp)}),r.jsx("span",{"data-testid":`level-${T.level}`,className:`w-12 flex-shrink-0 ${_d[T.level]}`,children:Dd[T.level]}),r.jsx("span",{className:"text-foreground break-all",children:T.message})]},T.id))}),x&&r.jsxs("div",{className:"flex items-center justify-center p-2 border-t border-border",children:[r.jsx("span",{"data-testid":"scroll-paused",className:"text-xs text-muted-foreground mr-2",children:"Auto-scroll paused"}),r.jsxs("button",{onClick:C,"aria-label":"Scroll to bottom",className:`\r
417
+ flex items-center gap-1 px-2 py-1\r
418
+ text-xs text-primary hover:underline\r
419
+ `,children:[r.jsx(yx,{className:"w-3 h-3"}),"Resume"]})]})]})}function Og({onSearch:s,searchQuery:a="",matchCount:i,totalCount:d,currentMatch:f,onNavigate:u,className:m=""}){const x=j=>{j.key==="Enter"?(j.preventDefault(),u==null||u(j.shiftKey?"prev":"next")):j.key==="Escape"&&s("")},y=()=>{s("")},w=i!==void 0&&i>0,v=a&&i===0;return r.jsxs("div",{"data-testid":"log-search",className:`flex items-center gap-2 ${m}`,children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search logs...",value:a,onChange:j=>s(j.target.value),onKeyDown:x,className:`\r
420
+ w-full pl-9 pr-8 py-2\r
421
+ bg-surface border border-border rounded-md\r
422
+ text-sm text-foreground\r
423
+ placeholder:text-muted-foreground\r
424
+ focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent\r
425
+ `}),a&&r.jsx("button",{onClick:y,"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted rounded",children:r.jsx(Fl,{className:"w-4 h-4 text-muted-foreground"})})]}),a&&r.jsx("div",{className:"flex items-center gap-2 text-sm",children:v?r.jsx("span",{className:"text-muted-foreground",children:"No matches"}):i!==void 0?f!==void 0?r.jsxs("span",{"data-testid":"current-match",className:"text-muted-foreground",children:[f," of ",i]}):r.jsxs("span",{"data-testid":"match-count",className:"text-muted-foreground",children:[i," of ",d]}):null}),u&&r.jsxs("div",{className:"flex items-center",children:[r.jsx("button",{onClick:()=>u("prev"),disabled:!w,"aria-label":"Previous match",className:`\r
426
+ p-1.5 rounded hover:bg-muted\r
427
+ disabled:opacity-50 disabled:cursor-not-allowed\r
428
+ transition-colors\r
429
+ `,children:r.jsx(hf,{className:"w-4 h-4"})}),r.jsx("button",{onClick:()=>u("next"),disabled:!w,"aria-label":"Next match",className:`\r
430
+ p-1.5 rounded hover:bg-muted\r
431
+ disabled:opacity-50 disabled:cursor-not-allowed\r
432
+ transition-colors\r
433
+ `,children:r.jsx(Pn,{className:"w-4 h-4"})})]})]})}const Bg=[{value:"app",label:"Application"},{value:"test",label:"Tests"},{value:"git",label:"Git"},{value:"system",label:"System"}];function $d(){const{activeType:s,searchQuery:a,autoScroll:i,filteredLogs:d,setLogType:f,setSearchQuery:u,clearLogs:m,setAutoScroll:x}=Jo(),y=Be(g=>g.setActiveView),{projectId:w}=Pt(),v=Pe(g=>g.selectProject),j=Pe(g=>g.selectedProjectId);h.useEffect(()=>{y("logs")},[y]),h.useEffect(()=>{w&&w!==j&&v(w)},[w,j,v]);const k=h.useMemo(()=>d.map(g=>({id:g.id,timestamp:g.timestamp,level:g.level,message:g.text,source:g.source||s})),[d,s]);return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsx("div",{className:"p-4 border-b border-border",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center gap-2",children:Bg.map(g=>r.jsx(oe,{variant:s===g.value?"primary":"ghost",size:"sm",onClick:()=>f(g.value),children:g.label},g.value))}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(Og,{onSearch:u,searchQuery:a}),r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>x(!i),children:i?"Auto-scroll ON":"Auto-scroll OFF"}),r.jsx(oe,{variant:"danger",size:"sm",onClick:()=>m(s),children:"Clear"})]})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:r.jsx(Ag,{logs:k,autoScroll:i})})]})}const Ll=h.forwardRef(({variant:s="default",label:a,error:i,leftIcon:d,rightIcon:f,onClear:u,className:m="",disabled:x,value:y,onChange:w,...v},j)=>{const[k,g]=h.useState(""),$=y!==void 0,S=$?y:k,C=z=>{$||g(z.target.value),w==null||w(z)},P=()=>{$||g(""),u==null||u()},M=s==="search",T=S&&String(S).length>0,I=["input",d||M?"pl-10":"",f||M&&T?"pr-10":"",i?"border-error focus:ring-error":"",m].filter(Boolean).join(" ");return r.jsxs("div",{className:"w-full",children:[a&&r.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:a}),r.jsxs("div",{className:"relative",children:[(d||M)&&r.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:d||r.jsx(mn,{className:"h-4 w-4"})}),r.jsx("input",{ref:j,className:I,disabled:x,value:S,onChange:C,...v}),M&&T&&r.jsx("button",{type:"button",onClick:P,className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary transition-colors","aria-label":"Clear search","data-testid":"clear-button",children:r.jsx(Fl,{className:"h-4 w-4"})}),f&&!M&&r.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:f})]}),i&&r.jsx("p",{className:"mt-1.5 text-sm text-error",role:"alert",children:i})]})});Ll.displayName="Input";function Ug({config:s,onSave:a,onCancel:i,saving:d=!1,className:f=""}){var k,g,$,S;const[u,m]=h.useState({project:s.project||"",coverageThreshold:((g=(k=s.quality)==null?void 0:k.coverageThreshold)==null?void 0:g.toString())||"80",qualityScoreThreshold:((S=($=s.quality)==null?void 0:$.qualityScoreThreshold)==null?void 0:S.toString())||"75"}),[x,y]=h.useState({}),w=(C,P)=>{m(M=>({...M,[C]:P})),y(M=>({...M,[C]:""}))},v=()=>{const C={},P=parseInt(u.coverageThreshold,10);(isNaN(P)||P<0||P>100)&&(C.coverageThreshold="Must be between 0 and 100");const M=parseInt(u.qualityScoreThreshold,10);return(isNaN(M)||M<0||M>100)&&(C.qualityScoreThreshold="Must be between 0 and 100"),y(C),Object.keys(C).length===0},j=()=>{v()&&a({...s,project:u.project,quality:{...s.quality,coverageThreshold:parseInt(u.coverageThreshold,10),qualityScoreThreshold:parseInt(u.qualityScoreThreshold,10)}})};return r.jsxs("div",{"data-testid":"settings-panel",className:`bg-surface border border-border rounded-lg p-6 ${f}`,children:[r.jsx("h2",{className:"text-xl font-semibold text-foreground mb-6",children:"Settings"}),r.jsxs("section",{className:"mb-6",children:[r.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-4",children:"General"}),r.jsx("div",{className:"space-y-4",children:r.jsxs("div",{children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground mb-1",children:"Project Name"}),r.jsx(Ll,{id:"project",value:u.project,onChange:C=>w("project",C.target.value)})]})})]}),r.jsxs("section",{className:"mb-6",children:[r.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-4",children:"Quality"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"coverageThreshold",className:"block text-sm font-medium text-foreground mb-1",children:"Coverage Threshold (%)"}),r.jsx(Ll,{id:"coverageThreshold",type:"number",min:"0",max:"100",value:u.coverageThreshold,onChange:C=>w("coverageThreshold",C.target.value)}),x.coverageThreshold&&r.jsx("p",{className:"text-sm text-error mt-1",children:x.coverageThreshold})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"qualityScoreThreshold",className:"block text-sm font-medium text-foreground mb-1",children:"Quality Score Threshold"}),r.jsx(Ll,{id:"qualityScoreThreshold",type:"number",min:"0",max:"100",value:u.qualityScoreThreshold,onChange:C=>w("qualityScoreThreshold",C.target.value)}),x.qualityScoreThreshold&&r.jsx("p",{className:"text-sm text-error mt-1",children:x.qualityScoreThreshold})]})]})]}),r.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-border",children:[i&&r.jsx(oe,{variant:"outline",onClick:i,children:"Cancel"}),r.jsx(oe,{onClick:j,disabled:d,children:d?"Saving...":"Save"})]})]})}const Vg={light:"Light",dark:"Dark",system:"System"};function Hg({theme:s,onToggle:a,showLabel:i=!1,className:d=""}){const f=()=>s==="dark"?"Switch to light mode":s==="light"?"Switch to dark mode":"Switch theme";return r.jsxs("button",{"data-testid":"theme-toggle",onClick:a,"aria-label":f(),className:`
434
+ flex items-center gap-2 p-2 rounded-md
435
+ hover:bg-muted transition-colors
436
+ ${d}
437
+ `,children:[s==="dark"&&r.jsx(Nf,{"data-testid":"sun-icon",className:"w-5 h-5"}),s==="light"&&r.jsx(vf,{"data-testid":"moon-icon",className:"w-5 h-5"}),s==="system"&&r.jsx(ii,{"data-testid":"system-icon",className:"w-5 h-5"}),i&&r.jsx("span",{className:"text-sm",children:Vg[s]})]})}function Wg(){const s=Be(w=>w.setActiveView),a=Be(w=>w.theme),i=Be(w=>w.toggleTheme),{config:d,loading:f,saving:u,error:m,saveConfig:x}=Ng();h.useEffect(()=>{s("settings")},[s]);const y=async w=>{try{await x(w)}catch{}};return f?r.jsxs("div",{className:"h-full overflow-auto p-6 space-y-6",children:[r.jsx(ce,{className:"h-8 w-48"}),r.jsx(ce,{className:"h-32"}),r.jsx(ce,{className:"h-64"})]}):r.jsxs("div",{className:"h-full overflow-auto p-6 space-y-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Settings"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Configure your TLC dashboard"})]}),m&&r.jsx("div",{className:"text-danger text-sm p-3 bg-danger/10 rounded-lg",children:m}),r.jsxs(ie,{className:"p-6",children:[r.jsx("h2",{className:"text-lg font-medium text-text-primary mb-4",children:"Appearance"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-text-primary",children:"Theme"}),r.jsx("div",{className:"text-sm text-text-secondary",children:"Switch between light and dark mode"})]}),r.jsx(Hg,{theme:a,onToggle:i})]})]}),r.jsxs(ie,{className:"p-6",children:[r.jsx("h2",{className:"text-lg font-medium text-text-primary mb-4",children:"Project Configuration"}),r.jsx(Ug,{config:d??{project:""},onSave:y,saving:u})]})]})}function Qg(){const[s,a]=h.useState([]),[i,d]=h.useState(!1),[f,u]=h.useState(null),m=h.useCallback(async()=>{d(!0),u(null);try{const x=await je.workspace.getGroups();a(x)}catch(x){u(x instanceof Error?x.message:"Failed to fetch workspace groups"),a([])}finally{d(!1)}},[]);return h.useEffect(()=>{m()},[m]),{groups:s,loading:i,error:f,fetchGroups:m}}function Gg(){const s=ir(),a=Be(g=>g.setActiveView),i=Pe(g=>g.selectProject),{groups:d,loading:f,error:u}=Qg(),[m,x]=h.useState(""),[y,w]=h.useState(null);h.useEffect(()=>{a("projects")},[a]);const v=d.filter(g=>m?g.name.toLowerCase().includes(m.toLowerCase())||g.repos.some($=>$.name.toLowerCase().includes(m.toLowerCase())):!0),j=g=>{if(g.repoCount===1){const $=g.repos[0];i($.id),s(`/projects/${$.id}`)}else w(g)},k=g=>{i(g.id),s(`/projects/${g.id}`)};return u?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Projects"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Manage your TLC projects"})]}),r.jsxs("div",{className:"text-error p-4",children:["Failed to load projects: ",u]})]}):f?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Projects"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Manage your TLC projects"})]}),r.jsx("div",{"data-testid":"loading",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(g=>r.jsx(ce,{className:"h-32"},g))})]}):y?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{"data-testid":"back-to-groups",onClick:()=>w(null),className:"flex items-center gap-2 text-text-secondary hover:text-text-primary mb-3 transition-colors",children:[r.jsx(mf,{className:"h-4 w-4"}),r.jsx("span",{children:"All Workspaces"})]}),r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:y.name}),r.jsxs("p",{className:"text-text-secondary mt-1",children:[y.repoCount," repositories"]})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:y.repos.map(g=>r.jsxs("div",{onClick:()=>k(g),className:"p-4 rounded-lg border border-border bg-bg-secondary hover:bg-bg-tertiary cursor-pointer transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("h3",{className:"font-medium text-text-primary truncate",children:g.name}),r.jsx(sr,{className:"h-4 w-4 text-text-muted flex-shrink-0"})]}),g.hasTlc&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{"data-testid":"tlc-badge",className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent/20 text-accent",children:"TLC"}),g.phaseName&&r.jsxs("span",{className:"text-text-secondary",children:["Phase ",g.phase,": ",g.phaseName]})]}),!g.hasTlc&&r.jsx("span",{className:"text-sm text-text-muted",children:"No TLC"})]},g.id))})]}):r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Projects"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Manage your TLC projects"})]}),r.jsx("div",{className:"mb-6",children:r.jsxs("div",{className:"relative max-w-md",children:[r.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-muted"}),r.jsx("input",{type:"text",placeholder:"Search workspaces and projects...",value:m,onChange:g=>x(g.target.value),className:"w-full pl-10 pr-4 py-2 text-sm bg-bg-secondary border border-border rounded-md text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent"})]})}),v.length===0?r.jsxs("div",{"data-testid":"empty-state",className:"flex flex-col items-center justify-center py-16 text-center",children:[r.jsx("div",{className:"w-16 h-16 bg-bg-tertiary rounded-full flex items-center justify-center mb-4",children:r.jsx(qo,{className:"w-8 h-8 text-text-muted"})}),r.jsx("h3",{className:"text-lg font-semibold text-text-primary mb-2",children:"No workspaces found"}),r.jsx("p",{className:"text-text-secondary max-w-md",children:"Configure workspace roots in Settings to discover projects."})]}):r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:v.map(g=>r.jsxs("div",{onClick:()=>j(g),className:"p-5 rounded-lg border border-border bg-bg-secondary hover:bg-bg-tertiary cursor-pointer transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-accent/10 flex items-center justify-center",children:r.jsx(qo,{className:"h-5 w-5 text-accent"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-semibold text-text-primary",children:g.name}),r.jsx("span",{"data-testid":`group-count-${g.name}`,className:"text-sm text-text-secondary",children:g.repoCount}),r.jsxs("span",{className:"text-sm text-text-secondary",children:[" ",g.repoCount===1?"repo":"repos"]})]})]}),r.jsx(sr,{className:"h-5 w-5 text-text-muted"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[g.hasTlc&&r.jsx("span",{"data-testid":"tlc-badge",className:"px-2 py-0.5 rounded-full text-xs font-medium bg-accent/20 text-accent",children:"TLC"}),g.repos.some($=>$.phaseName)&&r.jsxs("span",{className:"text-xs text-text-muted",children:[g.repos.filter($=>$.phaseName).length," active"]})]})]},g.name))})]})}const Kg={online:"bg-success",offline:"bg-muted",away:"bg-warning",busy:"bg-error"},zd={online:0,busy:1,away:2,offline:3};function qg(s){return s.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2)}function Yg({members:s,mode:a="vps",compact:i=!1,className:d=""}){if(a==="local")return null;const f=[...s].sort((m,x)=>zd[m.status]-zd[x.status]),u=s.filter(m=>m.status==="online").length;return s.length===0?r.jsx("div",{"data-testid":"team-presence",className:`bg-surface border border-border rounded-lg p-4 ${d}`,children:r.jsxs("div",{"data-testid":"empty-state",className:"text-center text-muted-foreground",children:[r.jsx(Ux,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{children:"No team members"})]})}):r.jsxs("div",{"data-testid":"team-presence",className:`bg-surface border border-border rounded-lg ${i?"compact p-2":"p-4"} ${d}`,children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Team"}),r.jsxs("span",{"data-testid":"online-count",className:"text-sm text-muted-foreground",children:[u," online"]})]}),r.jsx("div",{className:`space-y-${i?"1":"2"}`,children:f.map(m=>r.jsxs("div",{"data-testid":"team-member",className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative",children:[m.avatar?r.jsx("img",{src:m.avatar,alt:m.name,className:"w-8 h-8 rounded-full object-cover"}):r.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center text-xs font-medium",children:qg(m.name)}),r.jsx("span",{"data-testid":`status-${m.id}`,className:`absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full border-2 border-surface ${Kg[m.status]}`})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:m.name}),m.statusMessage?r.jsx("p",{className:"text-xs text-muted-foreground truncate",children:m.statusMessage}):m.lastSeen&&m.status!=="online"?r.jsx("p",{className:"text-xs text-muted-foreground",children:m.lastSeen}):null]})]},m.id))})]})}function Pf({items:s,onSelect:a,trigger:i,align:d="left",className:f=""}){const[u,m]=h.useState(!1),[x,y]=h.useState(-1),[w,v]=h.useState(""),j=h.useRef(null),k=h.useRef(null),g=h.useRef(null);h.useEffect(()=>{if(!u)return;const C=P=>{j.current&&!j.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]),h.useEffect(()=>{u||(y(-1),v(""))},[u]);const $=C=>{if(u)switch(C.key){case"ArrowDown":C.preventDefault(),y(M=>{const T=M+1;return T>=s.length?0:T});break;case"ArrowUp":C.preventDefault(),y(M=>{const T=M-1;return T<0?s.length-1:T});break;case"Enter":C.preventDefault();const P=s[x];x>=0&&P&&!P.disabled&&S(P);break;case"Escape":C.preventDefault(),m(!1);break;default:if(C.key.length===1&&C.key.match(/[a-z0-9]/i)){const M=w+C.key.toLowerCase();v(M);const T=s.findIndex(I=>I.label.toLowerCase().startsWith(M));T>=0&&y(T),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{v("")},500)}break}},S=C=>{C.disabled||(a(C),m(!1))};return r.jsxs("div",{ref:j,className:`relative inline-block ${f}`,children:[r.jsxs("button",{type:"button",onClick:()=>m(!u),className:`\r
438
+ flex items-center gap-2 px-3 py-2\r
439
+ bg-surface border border-border rounded-md\r
440
+ hover:bg-muted transition-colors\r
441
+ text-foreground\r
442
+ `,"aria-haspopup":"menu","aria-expanded":u,children:[i,r.jsx(Pn,{className:`w-4 h-4 transition-transform ${u?"rotate-180":""}`})]}),u&&r.jsx("div",{ref:k,role:"menu",tabIndex:-1,onKeyDown:$,className:`
443
+ absolute z-50 mt-1 min-w-[180px]
444
+ bg-surface border border-border rounded-md shadow-lg
445
+ py-1 max-h-60 overflow-auto
446
+ ${d==="left"?"left-0":"right-0"}
447
+ `,children:s.map((C,P)=>r.jsxs("div",{role:"menuitem",tabIndex:-1,"aria-disabled":C.disabled,onClick:()=>S(C),className:`
448
+ flex items-center gap-2 px-3 py-2 cursor-pointer
449
+ ${C.disabled?"opacity-50 cursor-not-allowed":"hover:bg-muted"}
450
+ ${x===P?"bg-muted":""}
451
+ ${C.disabled?"":"text-foreground"}
452
+ `,children:[C.icon&&r.jsx("span",{className:"flex-shrink-0",children:C.icon}),r.jsx("span",{children:C.label})]},C.id))})]})}const Xg={commit:r.jsx(Ex,{className:"w-4 h-4","data-testid":"icon-commit"}),task_claim:r.jsx(ns,{className:"w-4 h-4","data-testid":"icon-task_claim"}),task_complete:r.jsx(as,{className:"w-4 h-4","data-testid":"icon-task_complete"}),comment:r.jsx(yf,{className:"w-4 h-4","data-testid":"icon-comment"}),review:r.jsx(Sx,{className:"w-4 h-4","data-testid":"icon-review"})};function Jg(s){const a=new Date(s),d=new Date().getTime()-a.getTime(),f=Math.floor(d/6e4),u=Math.floor(d/36e5);return f<1?"Just now":f<60?`${f}m ago`:u<24?`${u}h ago`:a.toLocaleDateString()}function Zg(s){const a=new Date(s),i=new Date,d=new Date(i.getFullYear(),i.getMonth(),i.getDate()),f=new Date(d);f.setDate(f.getDate()-1);const u=new Date(a.getFullYear(),a.getMonth(),a.getDate());return u.getTime()===d.getTime()?"Today":u.getTime()===f.getTime()?"Yesterday":"Earlier"}function ey(s){const a={};return s.forEach(i=>{const d=Zg(i.timestamp);a[d]||(a[d]=[]),a[d].push(i)}),a}function ty({activities:s,showFilters:a=!1,pageSize:i=20,mode:d="vps",className:f=""}){const[u,m]=h.useState(null),[x,y]=h.useState(null),[w,v]=h.useState(i);if(d==="local")return null;const j=s.filter(P=>!(u&&P.type!==u||x&&P.user!==x)),k=j.slice(0,w),g=ey(k),$=j.length>w,C=[...new Set(s.map(P=>P.user))].map(P=>({id:P,label:P}));return s.length===0?r.jsx("div",{"data-testid":"activity-feed",className:`bg-surface border border-border rounded-lg p-4 ${f}`,children:r.jsxs("div",{"data-testid":"empty-state",className:"text-center text-muted-foreground",children:[r.jsx(gx,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),r.jsx("p",{children:"No activity yet"})]})}):r.jsxs("div",{"data-testid":"activity-feed",className:`bg-surface border border-border rounded-lg ${f}`,children:[a&&r.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-border",children:[r.jsx("button",{"data-testid":"filter-commit",onClick:()=>m(u==="commit"?null:"commit"),className:`px-2 py-1 text-xs rounded ${u==="commit"?"bg-primary text-primary-foreground":"bg-muted"}`,children:"Commits"}),r.jsx("button",{"data-testid":"filter-task_claim",onClick:()=>m(u==="task_claim"?null:"task_claim"),className:`px-2 py-1 text-xs rounded ${u==="task_claim"?"bg-primary text-primary-foreground":"bg-muted"}`,children:"Claims"}),r.jsx("div",{"data-testid":"filter-user",children:r.jsx(Pf,{items:C,onSelect:P=>y(x===P.id?null:P.id),trigger:r.jsx("span",{className:"text-xs",children:"User"})})})]}),r.jsx("div",{className:"p-3 space-y-4",children:["Today","Yesterday","Earlier"].map(P=>{const M=g[P];return!M||M.length===0?null:r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs font-semibold text-muted-foreground mb-2",children:P}),r.jsx("div",{className:"space-y-2",children:M.map(T=>r.jsxs("div",{"data-testid":"activity-item",className:"flex items-start gap-3",children:[r.jsx("div",{className:"text-muted-foreground mt-0.5",children:Xg[T.type]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("p",{className:"text-sm",children:[r.jsx("span",{className:"font-medium text-foreground",children:T.user}),r.jsx("span",{className:"text-muted-foreground ml-1",children:T.message})]}),r.jsx("span",{"data-testid":"activity-time",className:"text-xs text-muted-foreground",children:Jg(T.timestamp)})]})]},T.id))})]},P)})}),$&&r.jsx("div",{className:"p-3 border-t border-border",children:r.jsx("button",{onClick:()=>v(P=>P+i),className:"w-full text-sm text-primary hover:underline",children:"Load more"})})]})}const ny={local:{label:"Local",color:"bg-muted text-muted-foreground",icon:r.jsx(ii,{className:"w-3 h-3"})},vps:{label:"VPS",color:"bg-info text-info-foreground",icon:r.jsx(Dl,{className:"w-3 h-3"})},staging:{label:"Staging",color:"bg-warning text-warning-foreground",icon:r.jsx(Tx,{className:"w-3 h-3"})},production:{label:"Production",color:"bg-error text-error-foreground",icon:r.jsx(wf,{className:"w-3 h-3"})}},ry={sm:"text-xs px-1.5 py-0.5",md:"text-sm px-2 py-1",lg:"text-base px-3 py-1.5"};function sy({environment:s,showIcon:a=!1,tooltip:i,size:d="md",className:f=""}){const u=ny[s];return r.jsxs("span",{"data-testid":"env-badge",title:i,className:`
453
+ inline-flex items-center gap-1 rounded-full font-medium
454
+ ${u.color}
455
+ ${ry[d]}
456
+ ${f}
457
+ `,children:[a&&r.jsx("span",{"data-testid":"env-icon",children:u.icon}),u.label]})}function ly({members:s,activities:a,environment:i="local",mode:d="vps",loading:f=!1,connected:u=!0,collapsible:m=!1,className:x=""}){const[y,w]=h.useState("team"),[v,j]=h.useState(!1);return d==="local"?null:f?r.jsx("div",{"data-testid":"team-panel",className:`bg-surface border border-border rounded-lg p-4 ${x}`,children:r.jsxs("div",{"data-testid":"loading-skeleton",children:[r.jsx(ce,{className:"h-6 w-24 mb-4"}),r.jsx(ce,{className:"h-10 w-full mb-2"}),r.jsx(ce,{className:"h-10 w-full mb-2"}),r.jsx(ce,{className:"h-10 w-full"})]})}):r.jsxs("div",{"data-testid":"team-panel",className:`bg-surface border border-border rounded-lg ${v?"collapsed":""} ${x}`,children:[r.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:"Team"}),r.jsx("span",{"data-testid":"member-count",className:"text-xs bg-muted px-1.5 py-0.5 rounded-full",children:s.length}),i!=="local"&&r.jsx(sy,{environment:i,size:"sm"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{"data-testid":"connection-status",className:`w-2 h-2 rounded-full ${u?"bg-success":"bg-error"}`,title:u?"Connected":"Disconnected"}),m&&r.jsx("button",{onClick:()=>j(!v),"aria-label":v?"Expand team panel":"Collapse team panel",className:"p-1 hover:bg-muted rounded",children:v?r.jsx(Pn,{className:"w-4 h-4"}):r.jsx(hf,{className:"w-4 h-4"})})]})]}),!v&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex border-b border-border",role:"tablist",children:[r.jsx("button",{role:"tab","aria-selected":y==="team",onClick:()=>w("team"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${y==="team"?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:"Team"}),r.jsx("button",{role:"tab","aria-selected":y==="activity",onClick:()=>w("activity"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${y==="activity"?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:"Activity"})]}),r.jsx("div",{className:"p-3",children:y==="team"?r.jsx(Yg,{members:s,mode:"vps"}):r.jsx(ty,{activities:a,mode:"vps"})})]})]})}function ay(){const s=Be(w=>w.setActiveView),a=Dt(w=>w.status),[i,d]=h.useState([]),[f,u]=h.useState([]),[m,x]=h.useState(!0),y=h.useCallback(async()=>{x(!0);try{const v=(await je.project.getChangelog()||[]).slice(0,20),j=new Map;for(const g of v)g.author&&!j.has(g.author)&&j.set(g.author,{name:g.author,lastSeen:g.time||new Date().toISOString()});if(j.size>0){const g=Array.from(j.entries()).map(([,$],S)=>({id:`author-${S}`,name:$.name,email:"",status:S===0&&a==="connected"?"online":"offline",lastSeen:$.lastSeen}));d(g)}else d([]);const k=v.slice(0,10).map((g,$)=>({id:g.hash||String($),type:"commit",user:g.author||"Unknown",message:g.message||"",timestamp:g.time||new Date().toISOString()}));u(k)}catch{d([]),u([])}finally{x(!1)}},[a]);return h.useEffect(()=>{s("team"),y()},[s,y]),m?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Team"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Team presence and activity"})]}),r.jsx(ce,{className:"h-96"})]}):r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Team"}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Team presence and activity"})]}),r.jsx(ly,{members:i,activities:f,mode:"vps",connected:a==="connected"})]})}function oy(s){const a=Math.floor(s/86400),i=Math.floor(s%86400/3600),d=Math.floor(s%3600/60);return a>0?`${a} day${a>1?"s":""}`:i>0?`${i} hour${i>1?"s":""}`:`${d} minute${d>1?"s":""}`}function iy({status:s}){const a={healthy:"bg-success text-white",degraded:"bg-warning text-black",unhealthy:"bg-error text-white"}[s]||"bg-text-muted text-white";return r.jsx("span",{className:`px-2 py-1 rounded text-sm font-medium ${a}`,children:s})}function Cl({label:s,value:a,unit:i}){return r.jsxs("div",{className:"bg-surface-elevated p-4 rounded-lg",children:[r.jsx("p",{className:"text-text-muted text-sm",children:s}),r.jsxs("p",{className:"text-xl font-semibold",children:[a,i]})]})}function Id({value:s,testId:a}){return r.jsx("div",{"data-testid":a,className:"h-8 bg-surface-elevated rounded overflow-hidden",children:r.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,s))}%`}})})}function cy({health:s,loading:a,error:i,showGraphs:d,onRefresh:f,refreshInterval:u}){return h.useEffect(()=>{if(f&&u){const m=setInterval(()=>{f()},u);return()=>clearInterval(m)}},[f,u]),a?r.jsx("div",{className:"p-6 text-center",children:r.jsx("p",{className:"text-text-muted",children:"Loading health diagnostics..."})}):i?r.jsx("div",{className:"p-6 text-center",children:r.jsx("p",{className:"text-error",children:i})}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h2",{className:"text-lg font-semibold",children:"System Health"}),r.jsx(iy,{status:s.status})]}),r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[r.jsx(Cl,{label:"Memory",value:s.memory.percent,unit:"%"}),r.jsx(Cl,{label:"CPU",value:s.cpu.percent,unit:"%"}),r.jsx(Cl,{label:"Tests",value:s.tests.passed,unit:` / ${s.tests.total}`}),r.jsx(Cl,{label:"Uptime",value:oy(s.uptime)})]}),d&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-text-muted mb-2",children:"Memory Usage"}),r.jsx(Id,{value:s.memory.percent,testId:"memory-graph"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-text-muted mb-2",children:"CPU Usage"}),r.jsx(Id,{value:s.cpu.percent,testId:"cpu-graph"})]})]}),s.issues&&s.issues.length>0&&r.jsxs("div",{className:"bg-warning/10 border border-warning rounded-lg p-4",children:[r.jsx("h3",{className:"font-medium text-warning mb-2",children:"Issues"}),r.jsx("ul",{className:"list-disc list-inside space-y-1",children:s.issues.map((m,x)=>r.jsx("li",{className:"text-sm",children:m},x))})]}),s.alerts&&s.alerts.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-medium",children:"Alerts"}),s.alerts.map((m,x)=>r.jsx("div",{className:`p-3 rounded-lg ${m.severity==="warning"?"bg-warning/10 border border-warning":m.severity==="error"?"bg-error/10 border border-error":"bg-info/10 border border-info"}`,children:r.jsx("p",{className:"text-sm",children:m.message})},x))]}),s.router&&s.router.providers&&r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium mb-2",children:"Router Providers"}),r.jsx("div",{className:"space-y-2",children:s.router.providers.map((m,x)=>r.jsxs("div",{className:"flex items-center justify-between p-2 bg-surface-elevated rounded",children:[r.jsx("span",{children:m.name}),r.jsx("span",{className:`text-sm ${m.status==="active"?"text-success":m.status==="error"?"text-error":"text-text-muted"}`,children:m.status})]},x))})]})]}):r.jsx("div",{className:"p-6 text-center",children:r.jsx("p",{className:"text-text-muted",children:"No health data available"})})}function uy(){const s=Be(m=>m.setActiveView),[a,i]=h.useState(!0),[d,f]=h.useState(null),u=h.useCallback(async()=>{i(!0),f(null);try{await je.health.getHealth()}catch(m){f(m instanceof Error?m.message:"Failed to fetch health data")}finally{i(!1)}},[]);return h.useEffect(()=>{s("health"),u()},[s,u]),a?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsx("div",{className:"flex items-center justify-between mb-6",children:r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Health"})}),r.jsx("div",{className:"space-y-4",children:[1,2,3].map(m=>r.jsx(ce,{className:"h-24"},m))})]}):d?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Health"}),r.jsx(oe,{variant:"ghost",onClick:u,leftIcon:r.jsx(En,{className:"w-4 h-4"}),children:"Retry"})]}),r.jsxs("div",{className:"text-danger p-4",children:["Failed to load health data: ",d]})]}):r.jsxs("div",{className:"h-full overflow-auto",children:[r.jsxs("div",{className:"flex items-center justify-between p-6 pb-0",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Health"}),r.jsx(oe,{variant:"ghost",onClick:u,leftIcon:r.jsx(En,{className:"w-4 h-4"}),children:"Refresh"})]}),r.jsx(cy,{onRefresh:async()=>await je.health.getHealth()})]})}const Fd=[{type:"phone",label:"Phone",width:"375px",icon:r.jsx(Ix,{className:"w-4 h-4"})},{type:"tablet",label:"Tablet",width:"768px",icon:r.jsx(Ox,{className:"w-4 h-4"})},{type:"desktop",label:"Desktop",width:"100%",icon:r.jsx(ii,{className:"w-4 h-4"})}];function Ad({defaultUrl:s="http://localhost:3000",services:a}){var I;const i=Be(z=>z.setActiveView),{projectId:d}=Pt(),f=Pe(z=>z.selectProject),u=Pe(z=>z.selectedProjectId),[m,x]=h.useState("desktop"),[y,w]=h.useState(s),[v,j]=h.useState(0),[k,g]=h.useState((a==null?void 0:a[0])??null);h.useEffect(()=>{i("preview")},[i]),h.useEffect(()=>{d&&d!==u&&f(d)},[d,u,f]),h.useEffect(()=>{k&&w(k.url)},[k]);const $=h.useCallback(z=>{x(z)},[]),S=h.useCallback(()=>{j(z=>z+1)},[]),C=h.useCallback(()=>{window.open(y,"_blank")},[y]),P=h.useCallback(z=>{const W=a==null?void 0:a.find(ee=>ee.id===z.id);W&&g(W)},[a]),M=((I=Fd.find(z=>z.type===m))==null?void 0:I.width)??"100%",T=(a==null?void 0:a.map(z=>({id:z.id,label:z.label})))??[];return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsx("div",{className:"p-4 border-b border-border",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx("h1",{className:"text-xl font-semibold text-text-primary",children:"Preview"}),r.jsx("span",{className:"text-sm text-text-secondary",children:y})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[a&&a.length>0&&r.jsx(Pf,{items:T,onSelect:P,trigger:(k==null?void 0:k.label)??"Select Service"}),r.jsx("div",{className:"flex items-center gap-1 border-l border-border pl-2 ml-2",children:Fd.map(z=>r.jsx(oe,{variant:m===z.type?"primary":"ghost",size:"sm",onClick:()=>$(z.type),"aria-label":z.label,leftIcon:z.icon,children:z.label},z.type))}),r.jsxs("div",{className:"flex items-center gap-1 border-l border-border pl-2 ml-2",children:[r.jsx(oe,{variant:"ghost",size:"sm",onClick:S,"aria-label":"Refresh",leftIcon:r.jsx(En,{className:"w-4 h-4"}),children:"Refresh"}),r.jsx(oe,{variant:"ghost",size:"sm",onClick:C,"aria-label":"Open in new tab",leftIcon:r.jsx(xf,{className:"w-4 h-4"}),children:"Open in new tab"})]})]})]})}),r.jsx("div",{className:"flex-1 overflow-hidden bg-bg-tertiary p-4 flex justify-center",children:!(a!=null&&a.length)&&y===s?r.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[r.jsx("p",{className:"text-text-secondary mb-2",children:"No preview configured"}),r.jsxs("p",{className:"text-sm text-text-muted mb-4",children:["Configure a ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-elevated rounded",children:"start"})," command in ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-elevated rounded",children:".tlc.json"})," to enable live preview."]}),r.jsxs("p",{className:"text-sm text-text-muted",children:["Currently pointing to: ",r.jsx("code",{className:"px-1 py-0.5 bg-bg-elevated rounded",children:y})]})]}):r.jsx("div",{"data-testid":"iframe-container",className:"h-full bg-white rounded-lg shadow-lg overflow-hidden transition-all duration-300",style:{width:M,maxWidth:"100%"},children:r.jsx("iframe",{src:y,title:"App Preview",className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},v)})})]})}function Od(){const{projectId:s}=Pt(),a=Pe(M=>M.selectedProjectId),i=Pe(M=>M.selectProject),d=Be(M=>M.setActiveView),f=s??a??void 0;h.useEffect(()=>{s&&s!==a&&i(s)},[s,a,i]),h.useEffect(()=>{d("test-suite")},[d]);const{inventory:u,loading:m,runTests:x}=kg(f),[y,w]=h.useState(null),[v,j]=h.useState(""),[k,g]=h.useState(!1),$=h.useMemo(()=>{if(!(u!=null&&u.groups))return[];const M=[...u.groups];return(v?M.filter(I=>I.name.toLowerCase().includes(v.toLowerCase())):M).sort((I,z)=>z.testCount-I.testCount)},[u==null?void 0:u.groups,v]),S=async()=>{g(!0);try{await x()}catch{}finally{g(!1)}},C=M=>{w(T=>T===M?null:M)};if(m)return r.jsxs("div",{className:"p-6 space-y-6","data-testid":"loading-skeleton",children:[r.jsx(ce,{className:"h-8 w-48"}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[1,2,3].map(M=>r.jsx(ce,{className:"h-24"},M))}),r.jsx(ce,{className:"h-10 w-full"}),r.jsx("div",{className:"space-y-3",children:[1,2,3].map(M=>r.jsx(ce,{className:"h-14"},M))})]});if(!u||u.totalFiles===0&&u.groups.length===0)return r.jsxs("div",{className:"p-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Test Suite"}),r.jsx(oe,{"data-testid":"run-tests-btn",variant:"primary",onClick:S,loading:k,leftIcon:r.jsx(Yo,{className:"w-4 h-4"}),children:"Run Tests"})]}),r.jsx(ie,{className:"p-8","data-testid":"empty-state",children:r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-text-secondary text-lg",children:"No test files found"}),r.jsx("p",{className:"text-text-muted text-sm mt-2",children:"Add test files to your project to see them here."})]})})]});const P=M=>(M/1e3).toFixed(1);return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Test Suite"}),r.jsx(oe,{"data-testid":"run-tests-btn",variant:"primary",onClick:S,loading:k,leftIcon:r.jsx(Yo,{className:"w-4 h-4"}),children:"Run Tests"})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Files"}),r.jsx("div",{className:"text-3xl font-bold text-text-primary mt-1","data-testid":"summary-files",children:u.totalFiles})]}),r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Tests"}),r.jsx("div",{className:"text-3xl font-bold text-text-primary mt-1","data-testid":"summary-tests",children:u.totalTests})]}),r.jsxs(ie,{className:"p-4",children:[r.jsx("div",{className:"text-sm text-text-secondary",children:"Groups"}),r.jsx("div",{className:"text-3xl font-bold text-text-primary mt-1","data-testid":"summary-groups",children:u.groups.length})]})]}),u.lastRun&&r.jsx(ie,{className:"p-4","data-testid":"last-run",children:r.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[r.jsx("span",{className:"text-text-secondary",children:"Last Run:"}),r.jsxs(Fe,{variant:"success",children:[u.lastRun.passed," passed"]}),r.jsxs(Fe,{variant:"danger",children:[u.lastRun.failed," failed"]}),r.jsxs("span",{className:"text-text-muted",children:["(",P(u.lastRun.duration),"s)"]})]})}),r.jsxs("div",{className:"relative",children:[r.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted"}),r.jsx("input",{"data-testid":"search-input",type:"text",placeholder:"Search test files...",value:v,onChange:M=>j(M.target.value),className:"w-full pl-10 pr-4 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary"})]}),r.jsx("div",{className:"space-y-2",children:$.map(M=>{const T=y===M.name;return r.jsxs("div",{children:[r.jsxs("div",{"data-testid":"group-row",className:"flex items-center justify-between p-3 bg-bg-secondary rounded-lg cursor-pointer hover:bg-bg-tertiary transition-colors",onClick:()=>C(M.name),children:[r.jsxs("div",{className:"flex items-center gap-2",children:[T?r.jsx(Pn,{className:"w-4 h-4 text-text-muted"}):r.jsx(sr,{className:"w-4 h-4 text-text-muted"}),r.jsx("span",{className:"font-medium text-text-primary","data-testid":"group-name",children:M.name})]}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-text-secondary",children:[r.jsxs("span",{"data-testid":"group-files",children:[M.fileCount," files"]}),r.jsxs("span",{"data-testid":"group-tests",children:[M.testCount," tests"]})]})]}),T&&r.jsx("div",{className:"ml-6 mt-1 space-y-1",children:M.files.map(I=>r.jsxs("div",{"data-testid":"file-row",className:"flex items-center justify-between p-2 text-sm rounded hover:bg-bg-tertiary",children:[r.jsx("span",{className:"text-text-secondary","data-testid":"file-name",children:I.relativePath}),r.jsxs("span",{className:"text-text-muted","data-testid":"file-tests",children:[I.testCount," tests"]})]},I.relativePath))})]},M.name)})})]})}function dy(s){const[a,i]=h.useState([]),[d,f]=h.useState(!1),[u,m]=h.useState(null),x=h.useCallback(async()=>{if(!s){i([]);return}f(!0),m(null);try{const v=await je.projects.getBugs(s);i(Array.isArray(v)?v:[])}catch(v){m(v instanceof Error?v.message:"Failed to fetch bugs"),i([])}finally{f(!1)}},[s]),y=h.useCallback(async v=>{if(!s)throw new Error("No project selected");const j=await je.projects.createBug(s,v);return await x(),j},[s,x]),w=h.useCallback(async(v,j)=>{if(!s)throw new Error("No project selected");const k=await je.projects.updateBugStatus(s,v,j);return await x(),k},[s,x]);return{bugs:a,loading:d,error:u,fetchBugs:x,createBug:y,updateBugStatus:w}}const fy={critical:"danger",high:"warning",medium:"neutral",low:"info"};function Bd(){const{projectId:s}=Pt(),a=Pe(V=>V.selectedProjectId),i=Pe(V=>V.selectProject),d=Be(V=>V.setActiveView),f=s??a??void 0;h.useEffect(()=>{s&&s!==a&&i(s)},[s,a,i]);const{bugs:u,loading:m,error:x,fetchBugs:y,createBug:w,updateBugStatus:v}=dy(f),[j,k]=h.useState("all"),[g,$]=h.useState(null),[S,C]=h.useState(!1),[P,M]=h.useState({title:"",severity:"medium",description:"",url:""}),[T,I]=h.useState(!1);h.useEffect(()=>{d("bugs"),y()},[d,y,f]);const z=h.useMemo(()=>j==="all"?u:u.filter(V=>V.status===j),[u,j]),W=h.useMemo(()=>u.filter(V=>V.status==="open").length,[u]),ee=async V=>{if(V.preventDefault(),!(!P.title||!P.description)){I(!0);try{await w({title:P.title,severity:P.severity,description:P.description,url:P.url||void 0}),M({title:"",severity:"medium",description:"",url:""}),C(!1)}catch{}finally{I(!1)}}},G=async(V,ye)=>{try{await v(V,ye)}catch{}};return m?r.jsxs("div",{className:"p-6 space-y-6","data-testid":"loading",children:[r.jsx(ce,{className:"h-8 w-48"}),r.jsx(ce,{className:"h-10 w-full"}),[1,2,3].map(V=>r.jsx(ce,{className:"h-16"},V))]}):r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Bugs"}),W>0&&r.jsxs(Fe,{"data-testid":"open-count",variant:"danger",children:[W," open"]})]}),r.jsx(oe,{"data-testid":"report-bug-btn",variant:"primary",onClick:()=>C(!S),leftIcon:r.jsx(lr,{className:"w-4 h-4"}),children:"Report Bug"})]}),x&&r.jsx("div",{className:"text-danger text-sm p-3 bg-danger/10 rounded-lg",children:x}),S&&r.jsxs(ie,{className:"p-6","data-testid":"bug-form",children:[r.jsx("h2",{className:"text-lg font-medium text-text-primary mb-4",children:"Report a Bug"}),r.jsxs("form",{onSubmit:ee,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-title",className:"block text-sm font-medium text-text-secondary mb-1",children:"Title *"}),r.jsx("input",{id:"bug-title","data-testid":"bug-title-input",type:"text",required:!0,value:P.title,onChange:V=>M({...P,title:V.target.value}),className:"w-full px-3 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"Brief summary of the bug"})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-severity",className:"block text-sm font-medium text-text-secondary mb-1",children:"Severity *"}),r.jsxs("select",{id:"bug-severity","data-testid":"bug-severity-select",value:P.severity,onChange:V=>M({...P,severity:V.target.value}),className:"w-full px-3 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary",children:[r.jsx("option",{value:"critical",children:"Critical"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"low",children:"Low"})]})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-description",className:"block text-sm font-medium text-text-secondary mb-1",children:"Steps to Reproduce *"}),r.jsx("textarea",{id:"bug-description","data-testid":"bug-description-input",required:!0,rows:4,value:P.description,onChange:V=>M({...P,description:V.target.value}),className:"w-full px-3 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"1. Go to...\\n2. Click on...\\n3. Observe..."})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-url",className:"block text-sm font-medium text-text-secondary mb-1",children:"URL (optional)"}),r.jsx("input",{id:"bug-url","data-testid":"bug-url-input",type:"url",value:P.url,onChange:V=>M({...P,url:V.target.value}),className:"w-full px-3 py-2 bg-bg-secondary border border-border rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"http://localhost:3000/page-with-bug"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(oe,{type:"submit",variant:"primary",loading:T,disabled:!P.title||!P.description,children:"Submit Bug Report"}),r.jsx(oe,{type:"button",variant:"ghost",onClick:()=>C(!1),children:"Cancel"})]})]})]}),r.jsx("div",{className:"flex gap-2","data-testid":"status-filters",children:["all","open","fixed","closed"].map(V=>r.jsx("button",{"data-testid":`filter-${V}`,className:`px-3 py-1.5 text-sm rounded-md transition-colors ${j===V?"bg-accent text-white":"text-text-secondary hover:bg-bg-tertiary"}`,onClick:()=>k(V),children:V.charAt(0).toUpperCase()+V.slice(1)},V))}),z.length===0?r.jsx(ie,{className:"p-8","data-testid":"empty-state",children:r.jsxs("div",{className:"text-center",children:[r.jsx(pf,{className:"w-12 h-12 mx-auto text-text-muted mb-3"}),r.jsx("p",{className:"text-text-secondary",children:j==="all"?"No bugs reported yet":`No ${j} bugs`}),r.jsx(oe,{variant:"ghost",className:"mt-3",onClick:()=>C(!0),children:"Report a Bug"})]})}):r.jsx("div",{className:"space-y-2",children:z.map(V=>{const ye=g===V.id,Se=V.severity||"medium";return r.jsxs("div",{"data-testid":"bug-card",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-bg-secondary rounded-lg cursor-pointer hover:bg-bg-tertiary transition-colors",onClick:()=>$(ye?null:V.id),children:[r.jsxs("div",{className:"flex items-center gap-3",children:[ye?r.jsx(Pn,{className:"w-4 h-4 text-text-muted"}):r.jsx(sr,{className:"w-4 h-4 text-text-muted"}),r.jsx("span",{className:"font-mono text-xs text-text-muted","data-testid":"bug-id",children:V.id}),r.jsx("span",{className:"font-medium text-text-primary","data-testid":"bug-title",children:V.description||V.id}),r.jsx(Fe,{variant:fy[Se],size:"sm","data-testid":"bug-severity",children:Se})]}),r.jsx(Fe,{variant:V.status==="open"?"warning":V.status==="fixed"?"success":"neutral",size:"sm","data-testid":"bug-status",children:V.status})]}),ye&&r.jsxs("div",{className:"ml-10 mt-2 mb-3 p-4 bg-bg-tertiary rounded-lg space-y-3",children:[r.jsx("p",{className:"text-sm text-text-secondary whitespace-pre-line",children:V.description}),V.createdAt&&r.jsxs("p",{className:"text-xs text-text-muted",children:["Reported: ",V.createdAt]}),r.jsxs("div",{className:"flex items-center gap-2",children:[V.status==="open"&&r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:"sm",variant:"primary",onClick:()=>G(V.id,"fixed"),children:"Mark Fixed"}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>G(V.id,"closed"),children:"Close"})]}),V.status==="fixed"&&r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>G(V.id,"closed"),children:"Close"}),V.status==="closed"&&r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>G(V.id,"open"),children:"Reopen"}),r.jsx(oe,{size:"sm",variant:"ghost",leftIcon:r.jsx(xf,{className:"w-3 h-3"}),onClick:()=>{navigator.clipboard.writeText(`tlc://discuss?bug=${V.id}`)},children:"Discuss in CLI"})]})]})]},V.id)})})]})}const my=s=>s==="done"?r.jsx(as,{className:"w-4 h-4 text-success"}):s==="in_progress"?r.jsx(ai,{className:"w-4 h-4 text-primary"}):r.jsx(Il,{className:"w-4 h-4 text-text-muted"}),py=s=>s==="done"?"success":s==="in_progress"?"primary":"neutral";function Ud(){const{projectId:s}=Pt(),a=Pe(S=>S.selectedProjectId),i=Pe(S=>S.selectProject),d=Be(S=>S.setActiveView),f=ir(),u=s??a??void 0;h.useEffect(()=>{s&&s!==a&&i(s)},[s,a,i]);const{roadmap:m,loading:x}=di(u),[y,w]=h.useState(new Set),[v,j]=h.useState(!1);h.useEffect(()=>{d("roadmap")},[d]),h.useEffect(()=>{m!=null&&m.currentPhase&&w(new Set([m.currentPhase.number]))},[m==null?void 0:m.currentPhase]);const k=S=>{w(C=>{const P=new Set(C);return P.has(S)?P.delete(S):P.add(S),P})},g=()=>{if(v){const S=new Set;m==null||m.milestones.forEach(C=>C.phases.forEach(P=>S.add(P.number))),w(S)}else w(new Set);j(!v)},$=h.useMemo(()=>m!=null&&m.totalPhases?Math.round(m.completedPhases/m.totalPhases*100):0,[m]);return x?r.jsxs("div",{className:"p-6 space-y-6","data-testid":"loading",children:[r.jsx(ce,{className:"h-8 w-48"}),r.jsx(ce,{className:"h-4 w-full"}),[1,2,3,4].map(S=>r.jsx(ce,{className:"h-12"},S))]}):!m||m.milestones.length===0?r.jsx("div",{className:"p-6",children:r.jsx(ie,{className:"p-8","data-testid":"empty-state",children:r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-text-secondary",children:"No roadmap data available"}),r.jsx("p",{className:"text-sm text-text-muted mt-2",children:"This project may not have a ROADMAP.md file configured."})]})})}):r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Roadmap"}),r.jsxs("p",{className:"text-sm text-text-secondary mt-1",children:[m.completedPhases,"/",m.totalPhases," phases complete (",$,"%)"]})]}),r.jsx(oe,{variant:"ghost",onClick:g,"data-testid":"collapse-all-btn",children:v?"Expand All":"Collapse All"})]}),r.jsx("div",{className:"w-full h-2 bg-bg-tertiary rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-success rounded-full transition-all",style:{width:`${$}%`},"data-testid":"progress-bar"})}),m.milestones.map(S=>r.jsxs("div",{children:[r.jsx("h2",{"data-testid":"milestone-header",className:"text-sm font-bold text-text-secondary uppercase tracking-wider mb-3 mt-6",children:S.name}),r.jsx("div",{className:"space-y-1",children:S.phases.map(C=>{var I;const P=y.has(C.number),M=((I=m.currentPhase)==null?void 0:I.number)===C.number,T=C.taskCount>0?Math.round(C.completedTaskCount/C.taskCount*100):0;return r.jsxs("div",{children:[r.jsxs("div",{"data-testid":"phase-row",className:`flex items-center justify-between p-3 rounded-lg cursor-pointer hover:bg-bg-tertiary transition-colors ${M?"bg-primary/5 border border-primary/20":"bg-bg-secondary"}`,onClick:()=>{const z=u?`/projects/${u}`:"";f(`${z}/phases/${C.number}`)},children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{onClick:z=>{z.stopPropagation(),k(C.number)},className:"cursor-pointer","data-testid":"phase-chevron",children:P?r.jsx(Pn,{className:"w-4 h-4 text-text-muted"}):r.jsx(sr,{className:"w-4 h-4 text-text-muted"})}),my(C.status),r.jsxs("span",{className:"font-mono text-sm text-text-muted",children:[C.number,"."]}),r.jsx("span",{className:"text-sm font-medium text-text-primary",children:C.name}),r.jsx(Fe,{variant:py(C.status),size:"sm","data-testid":"phase-status",children:C.status==="in_progress"?"in progress":C.status}),C.verified&&r.jsx(Fe,{variant:"success",size:"sm",children:"verified"})]}),r.jsxs("div",{className:"flex items-center gap-4 text-xs text-text-muted",children:[r.jsxs("span",{"data-testid":"phase-tasks",children:[C.completedTaskCount,"/",C.taskCount," tasks"]}),C.hasTests&&r.jsxs("span",{"data-testid":"phase-tests",children:[C.testCount," tests"]}),r.jsx("div",{className:"w-16 h-1.5 bg-bg-tertiary rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-success rounded-full",style:{width:`${T}%`}})})]})]}),P&&r.jsxs("div",{className:"ml-10 mt-2 mb-3 p-4 bg-bg-tertiary rounded-lg space-y-4","data-testid":"phase-detail",children:[C.goal&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs font-semibold text-text-secondary uppercase mb-1",children:"Goal"}),r.jsx("p",{"data-testid":"phase-goal",className:"text-sm text-text-primary",children:C.goal})]}),C.deliverables&&C.deliverables.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-xs font-semibold text-text-secondary uppercase mb-1",children:"Deliverables"}),r.jsx("ul",{"data-testid":"phase-deliverables",className:"space-y-1",children:C.deliverables.map((z,W)=>r.jsxs("li",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[z.done?r.jsx(as,{className:"w-3.5 h-3.5 text-success shrink-0"}):r.jsx(Il,{className:"w-3.5 h-3.5 text-text-muted shrink-0"}),r.jsx("span",{className:z.done?"line-through opacity-60":"",children:z.text})]},W))})]}),r.jsxs("div",{className:"flex items-center gap-4 text-xs text-text-muted pt-2 border-t border-border",children:[r.jsxs("span",{children:[C.taskCount," tasks total"]}),r.jsxs("span",{children:[C.completedTaskCount," completed"]}),C.hasTests&&r.jsxs("span",{children:[C.testCount," tests / ",C.testFileCount," files"]})]})]})]},C.number)})})]},S.name))]})}function hy({tabs:s,basePath:a}){const i=fn();return r.jsx("nav",{"data-testid":"tab-bar",className:"flex gap-1 px-6 py-2 border-b border-border bg-bg-secondary overflow-x-auto sticky top-0 z-10",role:"tablist",children:s.map(d=>{const f=d.path===""?a:`${a}/${d.path}`,u=d.path===""?i.pathname===a||i.pathname===a+"/":i.pathname.startsWith(f);return r.jsx(li,{to:f,role:"tab","aria-selected":u,"data-testid":`tab-${d.id}`,className:`px-4 py-2 text-sm font-medium rounded-md whitespace-nowrap transition-colors ${u?"bg-accent text-white":"text-text-secondary hover:bg-bg-tertiary hover:text-text-primary"}`,children:d.label},d.id)})})}const xy=[{id:"overview",label:"Overview",path:""},{id:"roadmap",label:"Roadmap",path:"roadmap"},{id:"tasks",label:"Tasks",path:"tasks"},{id:"tests",label:"Tests",path:"tests"},{id:"bugs",label:"Bugs",path:"bugs"},{id:"logs",label:"Logs",path:"logs"},{id:"memory",label:"Memory",path:"memory"},{id:"info",label:"Info",path:"info"}];function gy(){const{projectId:s}=Pt(),a=Pe(u=>u.selectProject),i=Pe(u=>u.selectedProjectId),d=ir();if(h.useEffect(()=>{s&&s!==i&&a(s)},[s,i,a]),h.useEffect(()=>{s||d("/projects")},[s,d]),!s)return null;const f=`/projects/${s}`;return r.jsxs("div",{className:"flex flex-col h-full","data-testid":"project-detail",children:[r.jsx(hy,{tabs:xy,basePath:f}),r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx(Dh,{})})]})}function yy({project:s,updates:a=[],loading:i=!1,error:d,onBugSubmit:f}){const[u,m]=h.useState(""),[x,y]=h.useState(""),[w,v]=h.useState(!1);if(i)return r.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:r.jsx("p",{className:"text-text-muted",children:"Loading project details..."})});if(d)return r.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:r.jsx(ie,{status:"error",className:"max-w-md",children:r.jsx("p",{className:"text-error",children:d})})});if(!s)return r.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:r.jsx("p",{className:"text-text-muted",children:"No project data available"})});const j=async k=>{if(k.preventDefault(),!(!f||!u||!x)){v(!0);try{await f({title:u,description:x}),m(""),y("")}finally{v(!1)}}};return r.jsxs("div",{className:"space-y-6 p-6",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-text-primary",children:s.name}),r.jsx("p",{className:"text-text-secondary mt-1",children:"Project Overview"})]}),r.jsxs(ie,{children:[r.jsx(es,{children:r.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Overall Progress"})}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"text-text-secondary",children:"Completion"}),r.jsxs("span",{className:"text-xl font-bold text-text-primary",children:[s.progress,"%"]})]}),r.jsx("div",{role:"progressbar","aria-valuenow":s.progress,"aria-valuemin":0,"aria-valuemax":100,className:"h-3 bg-bg-tertiary rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-success rounded-full transition-all duration-300",style:{width:`${s.progress}%`}})})]})]}),r.jsxs(ie,{children:[r.jsx(es,{children:r.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Phase Progress"})}),r.jsxs("div",{className:"space-y-4",children:[r.jsx("p",{className:"text-text-primary font-medium",children:s.currentPhase}),r.jsxs("p",{className:"text-text-secondary",children:[s.completedPhases," of ",s.totalPhases," phases complete"]}),r.jsx("div",{className:"h-2 bg-bg-tertiary rounded-full overflow-hidden","aria-hidden":"true",children:r.jsx("div",{className:"h-full bg-info rounded-full transition-all duration-300",style:{width:`${s.completedPhases/s.totalPhases*100}%`}})})]})]}),a.length>0&&r.jsxs(ie,{children:[r.jsx(es,{children:r.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Recent Updates"})}),r.jsx("ul",{className:"space-y-3",children:a.map((k,g)=>r.jsxs("li",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"text-text-muted text-sm whitespace-nowrap",children:k.date}),r.jsx("span",{className:"text-text-primary",children:k.message})]},g))})]}),r.jsxs(ie,{children:[r.jsx(es,{children:r.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Report an Issue"})}),r.jsxs("form",{onSubmit:j,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-title",className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Title"}),r.jsx("input",{id:"bug-title",type:"text",value:u,onChange:k=>m(k.target.value),className:"input w-full",placeholder:"Brief summary of the issue"})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"bug-description",className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Description"}),r.jsx("textarea",{id:"bug-description",value:x,onChange:k=>y(k.target.value),className:"input w-full min-h-[100px]",placeholder:"Please describe what happened and what you expected"})]}),r.jsx(oe,{type:"submit",loading:w,disabled:!u||!x,children:"Submit Issue"})]})]})]})}function vy(s){const[a,i]=h.useState([]),[d,f]=h.useState([]),[u,m]=h.useState(null),[x,y]=h.useState(!1),[w,v]=h.useState(null),j=h.useCallback(async()=>{if(!s){i([]),f([]),m(null);return}y(!0),v(null);try{const[k,g,$]=await Promise.all([je.projects.getMemoryDecisions(s),je.projects.getMemoryGotchas(s),je.projects.getMemoryStats(s)]);i(k),f(g),m($)}catch(k){v(k instanceof Error?k.message:"Failed to fetch memory")}finally{y(!1)}},[s]);return h.useEffect(()=>{j()},[j]),{decisions:a,gotchas:d,stats:u,loading:x,error:w,refresh:j}}function jy(s,a,i=300){const[d,f]=h.useState(""),[u,m]=h.useState(""),x=h.useRef(null);h.useEffect(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{m(d)},i),()=>{x.current&&clearTimeout(x.current)}),[d,i]);const y=h.useMemo(()=>{if(!u)return s;const v=u.toLowerCase();return s.filter(j=>{var k;return j.text.toLowerCase().includes(v)||((k=j.context)==null?void 0:k.toLowerCase().includes(v))})},[s,u]),w=h.useMemo(()=>{if(!u)return a;const v=u.toLowerCase();return a.filter(j=>{var k;return j.text.toLowerCase().includes(v)||((k=j.context)==null?void 0:k.toLowerCase().includes(v))})},[a,u]);return{query:d,setQuery:f,filteredDecisions:y,filteredGotchas:w}}function wy(){const{projectId:s}=Pt(),a=Pe(S=>S.selectedProjectId),i=Pe(S=>S.selectProject),d=Be(S=>S.setActiveView),f=s??a??void 0;h.useEffect(()=>{s&&s!==a&&i(s)},[s,a,i]);const{decisions:u,gotchas:m,stats:x,loading:y,error:w}=vy(f),{query:v,setQuery:j,filteredDecisions:k,filteredGotchas:g}=jy(u,m);if(h.useEffect(()=>{d("memory")},[d]),y)return r.jsxs("div",{className:"p-6 space-y-6","data-testid":"loading",children:[r.jsx(ce,{className:"h-8 w-48"}),[1,2,3].map(S=>r.jsx(ce,{className:"h-20"},S))]});const $=u.length===0&&m.length===0;return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ko,{className:"w-6 h-6 text-accent"}),r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Memory"}),x&&r.jsxs(Fe,{variant:"neutral",children:[x.totalEntries," entries"]})]})}),w&&r.jsx("div",{className:"text-danger text-sm p-3 bg-danger/10 rounded-lg",children:w}),!$&&r.jsxs("div",{className:"relative max-w-md",children:[r.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-muted"}),r.jsx("input",{type:"text","data-testid":"memory-search",placeholder:"Search memory...",value:v,onChange:S=>j(S.target.value),className:"w-full pl-10 pr-4 py-2 text-sm bg-bg-secondary border border-border rounded-md text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent"})]}),x&&r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[r.jsxs(ie,{className:"p-4 text-center",children:[r.jsx("div",{className:"text-2xl font-bold text-text-primary",children:x.totalEntries}),r.jsx("div",{className:"text-sm text-text-secondary",children:"Total Entries"})]}),x.decisions!=null&&r.jsxs(ie,{className:"p-4 text-center",children:[r.jsx("div",{className:"text-2xl font-bold text-accent",children:x.decisions}),r.jsx("div",{className:"text-sm text-text-secondary",children:"Decisions"})]}),x.gotchas!=null&&r.jsxs(ie,{className:"p-4 text-center",children:[r.jsx("div",{className:"text-2xl font-bold text-warning",children:x.gotchas}),r.jsx("div",{className:"text-sm text-text-secondary",children:"Gotchas"})]}),x.conversations!=null&&r.jsxs(ie,{className:"p-4 text-center",children:[r.jsx("div",{className:"text-2xl font-bold text-text-primary",children:x.conversations}),r.jsx("div",{className:"text-sm text-text-secondary",children:"Conversations"})]})]}),$?r.jsx(ie,{className:"p-8","data-testid":"empty-state",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Ko,{className:"w-12 h-12 mx-auto text-text-muted mb-3"}),r.jsx("p",{className:"text-text-secondary",children:"No memory entries found for this project."}),r.jsx("p",{className:"text-text-muted text-sm mt-1",children:"Decisions and gotchas are captured automatically during TLC sessions."})]})}):r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(Lx,{className:"w-5 h-5 text-accent"}),r.jsx("h2",{className:"text-lg font-medium text-text-primary",children:"Decisions"}),r.jsx(Fe,{variant:"neutral",size:"sm",children:k.length})]}),r.jsxs("div",{className:"space-y-2",children:[k.map(S=>r.jsxs(ie,{className:"p-3",children:[r.jsx("p",{className:"text-sm text-text-primary",children:S.text}),r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[S.context&&r.jsx(Fe,{variant:"info",size:"sm",children:S.context}),S.timestamp&&r.jsx("span",{className:"text-xs text-text-muted",children:S.timestamp})]})]},S.id)),k.length===0&&r.jsx("p",{className:"text-sm text-text-muted",children:"No decisions recorded yet."})]})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(Bx,{className:"w-5 h-5 text-warning"}),r.jsx("h2",{className:"text-lg font-medium text-text-primary",children:"Gotchas"}),r.jsx(Fe,{variant:"warning",size:"sm",children:g.length})]}),r.jsxs("div",{className:"space-y-2",children:[g.map(S=>r.jsxs(ie,{className:"p-3 border-warning/30",children:[r.jsx("p",{className:"text-sm text-text-primary",children:S.text}),r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[S.context&&r.jsx(Fe,{variant:"warning",size:"sm",children:S.context}),S.timestamp&&r.jsx("span",{className:"text-xs text-text-muted",children:S.timestamp})]})]},S.id)),g.length===0&&r.jsx("p",{className:"text-sm text-text-muted",children:"No gotchas recorded yet."})]})]})]})]})}function Ny(s,a){const[i,d]=h.useState(null),[f,u]=h.useState(null),[m,x]=h.useState(!1),[y,w]=h.useState(null),v=h.useCallback(async()=>{if(!s||!a){d(null),u(null);return}x(!0),w(null);try{const j=await je.projects.getFile(s,a);d(j.content),u(j.filename)}catch(j){w(j instanceof Error?j.message:"Failed to fetch file"),d(null)}finally{x(!1)}},[s,a]);return h.useEffect(()=>{v()},[v]),{content:i,filename:f,loading:m,error:y,refresh:v}}const ky=[{name:"PROJECT.md",label:"PROJECT.md"},{name:"ROADMAP.md",label:"ROADMAP.md"},{name:"CODING-STANDARDS.md",label:"CODING-STANDARDS.md"}];function Sy(s){const a=s.split(`
458
+ `),i=[];let d=0;for(let f=0;f<a.length;f++){const u=a[f],m=u.match(/^# (.+)$/);if(m){i.push(r.jsx("h1",{className:"text-2xl font-bold text-text-primary mb-3 mt-6 first:mt-0",children:m[1]},d++));continue}const x=u.match(/^## (.+)$/);if(x){i.push(r.jsx("h2",{className:"text-xl font-semibold text-text-primary mb-2 mt-5",children:x[1]},d++));continue}const y=u.match(/^### (.+)$/);if(y){i.push(r.jsx("h3",{className:"text-lg font-medium text-text-primary mb-2 mt-4",children:y[1]},d++));continue}const w=u.match(/^[-*]\s+(.+)$/);if(w){i.push(r.jsx("li",{className:"text-sm text-text-secondary ml-4 list-disc",children:w[1]},d++));continue}const v=u.match(/^- \[(x| )\]\s+(.+)$/);if(v){const j=v[1]==="x";i.push(r.jsxs("li",{className:`text-sm ml-4 list-none flex items-center gap-2 ${j?"text-text-muted line-through":"text-text-secondary"}`,children:[r.jsx("span",{children:j?"☑":"☐"}),r.jsx("span",{children:v[2]})]},d++));continue}if(u.trim()===""){i.push(r.jsx("div",{className:"h-2"},d++));continue}if(u.startsWith("```")){const j=[];for(f++;f<a.length&&!a[f].startsWith("```");)j.push(a[f]),f++;i.push(r.jsx("pre",{className:"bg-bg-tertiary border border-border rounded-lg p-3 text-sm font-mono text-text-primary overflow-x-auto my-2",children:j.join(`
459
+ `)},d++));continue}i.push(r.jsx("p",{className:"text-sm text-text-secondary leading-relaxed",children:u},d++))}return i}function by(){const{projectId:s}=Pt(),a=Pe(j=>j.selectedProjectId),i=Pe(j=>j.selectProject),d=Be(j=>j.setActiveView),f=s??a??void 0;h.useEffect(()=>{s&&s!==a&&i(s)},[s,a,i]);const[u,m]=h.useState("PROJECT.md"),{content:x,filename:y,loading:w,error:v}=Ny(f,u);return h.useEffect(()=>{d("info")},[d]),w?r.jsxs("div",{className:"p-6 space-y-6","data-testid":"loading",children:[r.jsx(ce,{className:"h-8 w-48"}),r.jsx(ce,{className:"h-4 w-full"}),r.jsx(ce,{className:"h-4 w-3/4"}),r.jsx(ce,{className:"h-4 w-5/6"})]}):r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(jl,{className:"w-6 h-6 text-accent"}),r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Project Info"})]}),r.jsx("div",{className:"flex gap-2 flex-wrap",children:ky.map(j=>r.jsxs("button",{onClick:()=>m(j.name),className:`px-3 py-1.5 text-sm rounded-md transition-colors flex items-center gap-1 ${u===j.name?"bg-accent text-white":"text-text-secondary hover:bg-bg-tertiary"}`,children:[r.jsx(jl,{className:"w-3.5 h-3.5"}),j.label]},j.name))}),v&&r.jsx("div",{className:"text-danger text-sm p-3 bg-danger/10 rounded-lg",children:v}),!x&&!w&&!v?r.jsx(ie,{className:"p-8","data-testid":"empty-state",children:r.jsxs("div",{className:"text-center",children:[r.jsx(jl,{className:"w-12 h-12 mx-auto text-text-muted mb-3"}),r.jsx("p",{className:"text-text-secondary",children:"No documentation found."}),r.jsxs("p",{className:"text-text-muted text-sm mt-1",children:["Add a ",u," file to your project's .planning/ directory."]})]})}):x?r.jsxs(ie,{className:"p-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4 pb-3 border-b border-border",children:[r.jsx(jl,{className:"w-4 h-4 text-text-muted"}),r.jsx("span",{className:"text-sm font-medium text-text-secondary",children:y})]}),r.jsx("div",{className:"prose-sm",children:Sy(x)})]}):null]})}const Cy=s=>s==="done"||s==="completed"?r.jsx(as,{className:"w-4 h-4 text-success"}):s==="in_progress"?r.jsx(ai,{className:"w-4 h-4 text-primary"}):r.jsx(Il,{className:"w-4 h-4 text-text-muted"}),Vd=s=>s==="done"||s==="completed"?"success":s==="in_progress"?"primary":"neutral",Hd=s=>s==="in_progress"?"in progress":s==="completed"?"done":s;function Ey(){const{projectId:s,phaseNumber:a}=Pt(),i=Pe(g=>g.selectedProjectId),d=Pe(g=>g.selectProject),f=Be(g=>g.setActiveView),u=s??i??void 0,m=a?parseInt(a,10):NaN;h.useEffect(()=>{s&&s!==i&&d(s)},[s,i,d]),h.useEffect(()=>{f("roadmap")},[f]);const{roadmap:x,loading:y}=di(u),{tasks:w}=ui(u),v=h.useMemo(()=>{if(!(!x||isNaN(m)))for(const g of x.milestones){const $=g.phases.find(S=>S.number===m);if($)return $}},[x,m]),j=h.useMemo(()=>!w||isNaN(m)?[]:w.filter(g=>g.phase===m),[w,m]);if(y)return r.jsxs("div",{className:"p-6 space-y-6","data-testid":"phase-detail-loading",children:[r.jsx(ce,{className:"h-8 w-64"}),r.jsx(ce,{className:"h-4 w-full"}),r.jsx(ce,{className:"h-24"}),[1,2,3].map(g=>r.jsx(ce,{className:"h-12"},g))]});if(!v)return r.jsx("div",{className:"p-6","data-testid":"phase-not-found",children:r.jsx(ie,{className:"p-8",children:r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-text-secondary",children:"Phase not found"}),r.jsxs("p",{className:"text-sm text-text-muted mt-2",children:["Phase ",a," does not exist in this project's roadmap."]}),r.jsx(_l,{to:u?`/projects/${u}/roadmap`:"/roadmap",className:"text-sm text-primary mt-4 inline-block hover:underline","data-testid":"back-to-roadmap",children:"Back to Roadmap"})]})})});const k=v.taskCount>0?Math.round(v.completedTaskCount/v.taskCount*100):0;return r.jsxs("div",{className:"p-6 space-y-6",children:[r.jsxs(_l,{to:u?`/projects/${u}/roadmap`:"/roadmap",className:"flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary transition-colors","data-testid":"back-to-roadmap",children:[r.jsx(mf,{className:"w-4 h-4"}),"Back to Roadmap"]}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("h1",{className:"text-2xl font-semibold text-text-primary",children:["Phase ",v.number,": ",v.name]}),r.jsx(Fe,{variant:Vd(v.status),"data-testid":"phase-status-badge",children:Hd(v.status)}),v.verified&&r.jsx(Fe,{variant:"success",children:"verified"})]}),r.jsxs("div",{className:"flex items-center gap-4 text-sm text-text-secondary",children:[r.jsxs("span",{children:[v.completedTaskCount,"/",v.taskCount," tasks complete (",k,"%)"]}),v.hasTests&&r.jsxs("span",{children:[v.testCount," tests / ",v.testFileCount," files"]})]}),r.jsx("div",{className:"w-full h-2 bg-bg-tertiary rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-success rounded-full transition-all",style:{width:`${k}%`}})}),v.goal&&r.jsxs(ie,{className:"p-4",children:[r.jsx("h3",{className:"text-xs font-semibold text-text-secondary uppercase mb-2",children:"Goal"}),r.jsx("p",{className:"text-sm text-text-primary",children:v.goal})]}),v.deliverables&&v.deliverables.length>0&&r.jsxs(ie,{className:"p-4",children:[r.jsx("h3",{className:"text-xs font-semibold text-text-secondary uppercase mb-2",children:"Deliverables"}),r.jsx("ul",{className:"space-y-2",children:v.deliverables.map((g,$)=>r.jsxs("li",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[g.done?r.jsx(as,{className:"w-4 h-4 text-success shrink-0"}):r.jsx(Il,{className:"w-4 h-4 text-text-muted shrink-0"}),r.jsx("span",{className:g.done?"line-through opacity-60":"",children:g.text})]},$))})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-xs font-semibold text-text-secondary uppercase mb-3",children:"Tasks"}),j.length===0?r.jsx("p",{className:"text-sm text-text-muted",children:"No tasks found for this phase."}):r.jsx("div",{className:"space-y-1",children:j.map(g=>r.jsxs("div",{className:"flex items-center justify-between p-3 bg-bg-secondary rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[Cy(g.status),r.jsx("span",{className:"text-sm font-medium text-text-primary",children:g.title})]}),r.jsxs("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[r.jsx(Fe,{variant:Vd(g.status),size:"sm",children:Hd(g.status)}),g.owner&&r.jsx("span",{children:g.owner})]})]},g.id))})]})]})}const Jr="";function Py(s){const a=s==="running"?"success":s==="exited"?"danger":"warning";return r.jsx(Fe,{variant:a,children:s})}function Ty(s){return s>1e9?`${(s/1e9).toFixed(1)} GB`:s>1e6?`${(s/1e6).toFixed(1)} MB`:`${(s/1e3).toFixed(1)} KB`}function Ry(){const s=Be(P=>P.setActiveView),[a,i]=h.useState("containers"),[d,f]=h.useState([]),[u,m]=h.useState([]),[x,y]=h.useState([]),[w,v]=h.useState(!0),[j,k]=h.useState(!0),[g,$]=h.useState(null);h.useEffect(()=>{s("docker")},[s]);const S=h.useCallback(async()=>{k(!0),$(null);try{if((await fetch(`${Jr}/api/docker/status`)).status===503){v(!1),k(!1);return}v(!0);const[M,T,I]=await Promise.all([fetch(`${Jr}/api/docker/containers?all=true`),fetch(`${Jr}/api/docker/images`),fetch(`${Jr}/api/docker/volumes`)]);f(await M.json()),m(await T.json()),y(await I.json())}catch(P){$(P instanceof Error?P.message:"Failed to fetch Docker data")}finally{k(!1)}},[]);h.useEffect(()=>{S()},[S]);const C=async(P,M)=>{await fetch(`${Jr}/api/docker/containers/${P}/${M}`,{method:"POST"}),S()};return w?r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Docker"}),r.jsx(oe,{variant:"ghost",onClick:S,leftIcon:r.jsx(En,{className:"w-4 h-4"}),children:"Refresh"})]}),r.jsx("div",{className:"flex gap-2 mb-6 border-b border-border",children:["containers","images","volumes"].map(P=>r.jsxs("button",{onClick:()=>i(P),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${a===P?"border-accent text-accent":"border-transparent text-text-secondary hover:text-text-primary"}`,children:[P==="containers"&&r.jsx(Go,{className:"w-4 h-4 inline mr-1"}),P==="images"&&r.jsx(Px,{className:"w-4 h-4 inline mr-1"}),P==="volumes"&&r.jsx(kx,{className:"w-4 h-4 inline mr-1"}),P.charAt(0).toUpperCase()+P.slice(1),r.jsxs("span",{className:"ml-1 text-text-secondary",children:["(",P==="containers"?d.length:P==="images"?u.length:x.length,")"]})]},P))}),j&&r.jsx("div",{className:"text-text-secondary",children:"Loading..."}),g&&r.jsx("div",{className:"text-danger",children:g}),a==="containers"&&!j&&r.jsxs("div",{className:"space-y-2",children:[d.map(P=>r.jsxs(ie,{className:"p-4 flex items-center justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-medium text-text-primary",children:P.name}),Py(P.state)]}),r.jsxs("div",{className:"text-sm text-text-secondary mt-1",children:[P.image," · ",P.status,P.ports.length>0&&r.jsxs("span",{children:[" · ",P.ports.map(M=>`${M.public}:${M.private}`).join(", ")]})]})]}),r.jsxs("div",{className:"flex gap-1",children:[P.state!=="running"&&r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>C(P.id,"start"),children:r.jsx(Yo,{className:"w-3 h-3"})}),P.state==="running"&&r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>C(P.id,"stop"),children:r.jsx(Ax,{className:"w-3 h-3"})}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>C(P.id,"restart"),children:r.jsx($x,{className:"w-3 h-3"})})]})]},P.id)),d.length===0&&r.jsx("div",{className:"text-text-secondary text-center py-8",children:"No containers found"})]}),a==="images"&&!j&&r.jsx("div",{className:"space-y-2",children:u.map(P=>r.jsxs(ie,{className:"p-4",children:[r.jsx("span",{className:"font-medium text-text-primary",children:P.tags.join(", ")||"<untagged>"}),r.jsx("span",{className:"text-sm text-text-secondary ml-2",children:Ty(P.size)})]},P.id))}),a==="volumes"&&!j&&r.jsx("div",{className:"space-y-2",children:x.map(P=>r.jsxs(ie,{className:"p-4",children:[r.jsx("span",{className:"font-medium text-text-primary",children:P.name}),r.jsx("span",{className:"text-sm text-text-secondary ml-2",children:P.driver})]},P.name))})]}):r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary mb-6",children:"Docker"}),r.jsxs(ie,{className:"p-8 text-center",children:[r.jsx(Go,{className:"w-12 h-12 mx-auto mb-4 text-text-secondary"}),r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Docker Not Available"}),r.jsx("p",{className:"text-text-secondary mb-4",children:"Mount the Docker socket to enable container management:"}),r.jsx("code",{className:"block bg-bg-secondary p-3 rounded text-sm",children:"-v /var/run/docker.sock:/var/run/docker.sock"})]})]})}const El="";function Ly(){const s=Be(S=>S.setActiveView),[a,i]=h.useState([]),[d,f]=h.useState(!0),[u,m]=h.useState(!1),[x,y]=h.useState({name:"",host:"",username:"deploy",port:22,privateKeyPath:"~/.ssh/id_rsa",domain:""}),[w,v]=h.useState(null);h.useEffect(()=>{s("vps")},[s]);const j=h.useCallback(async()=>{f(!0);try{const S=await fetch(`${El}/api/vps/servers`);i(await S.json())}catch{}finally{f(!1)}},[]);h.useEffect(()=>{j()},[j]);const k=async()=>{(await fetch(`${El}/api/vps/servers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)})).ok&&(m(!1),y({name:"",host:"",username:"deploy",port:22,privateKeyPath:"~/.ssh/id_rsa",domain:""}),j())},g=async S=>{v(S);try{await fetch(`${El}/api/vps/servers/${S}/test`,{method:"POST"}),j()}catch{}finally{v(null)}},$=async S=>{await fetch(`${El}/api/vps/servers/${S}`,{method:"DELETE"}),j()};return r.jsxs("div",{className:"h-full overflow-auto p-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"VPS Servers"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(oe,{variant:"ghost",onClick:j,leftIcon:r.jsx(En,{className:"w-4 h-4"}),children:"Refresh"}),r.jsx(oe,{onClick:()=>m(!u),leftIcon:r.jsx(lr,{className:"w-4 h-4"}),children:"Add Server"})]})]}),u&&r.jsxs(ie,{className:"p-4 mb-6",children:[r.jsx("h3",{className:"font-medium mb-3",children:"Register New VPS"}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"Name (e.g. dev-1)",value:x.name,onChange:S=>y({...x,name:S.target.value})}),r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"Host / IP",value:x.host,onChange:S=>y({...x,host:S.target.value})}),r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"Username",value:x.username,onChange:S=>y({...x,username:S.target.value})}),r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"Domain (optional)",value:x.domain,onChange:S=>y({...x,domain:S.target.value})}),r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"SSH Key Path",value:x.privateKeyPath,onChange:S=>y({...x,privateKeyPath:S.target.value})}),r.jsx("input",{className:"border border-border rounded px-3 py-2 bg-bg-secondary text-text-primary",placeholder:"Port",type:"number",value:x.port,onChange:S=>y({...x,port:parseInt(S.target.value)||22})})]}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[r.jsx(oe,{onClick:k,children:"Save"}),r.jsx(oe,{variant:"ghost",onClick:()=>m(!1),children:"Cancel"})]})]}),d&&r.jsx("div",{className:"text-text-secondary",children:"Loading..."}),!d&&a.length===0&&r.jsxs(ie,{className:"p-8 text-center",children:[r.jsx(Dl,{className:"w-12 h-12 mx-auto mb-4 text-text-secondary"}),r.jsx("h2",{className:"text-lg font-medium mb-2",children:"No VPS Servers"}),r.jsx("p",{className:"text-text-secondary mb-4",children:"Register a VPS to start deploying your projects."}),r.jsx(oe,{onClick:()=>m(!0),leftIcon:r.jsx(lr,{className:"w-4 h-4"}),children:"Add Server"})]}),!d&&a.map(S=>r.jsx(ie,{className:"p-4 mb-3",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Dl,{className:"w-4 h-4 text-text-secondary"}),r.jsx("span",{className:"font-medium text-text-primary",children:S.name}),r.jsx(Fe,{variant:S.status==="online"?"success":"warning",children:S.status}),S.pool&&r.jsx(Fe,{variant:"neutral",children:"pool"}),S.bootstrapped&&r.jsxs(Fe,{variant:"success",children:[r.jsx(wf,{className:"w-3 h-3 mr-1 inline"}),"bootstrapped"]})]}),r.jsxs("div",{className:"text-sm text-text-secondary mt-1",children:[S.username,"@",S.host,":",S.port,S.domain&&r.jsxs("span",{children:[" · ",S.domain]}),S.assignedProjects.length>0&&r.jsxs("span",{children:[" · ",S.assignedProjects.length," project(s)"]})]})]}),r.jsxs("div",{className:"flex gap-1",children:[r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>g(S.id),disabled:w===S.id,children:w===S.id?r.jsx(En,{className:"w-3 h-3 animate-spin"}):r.jsx(Vx,{className:"w-3 h-3"})}),r.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>$(S.id),children:r.jsx(Sf,{className:"w-3 h-3"})})]})]})},S.id))]})}function My(){const{isConfigured:s,projects:a,selectedProjectId:i,isScanning:d,lastScan:f,setRoots:u,setProjects:m,selectProject:x,restoreSelectedProject:y,setIsScanning:w,setLastScan:v}=Pe(),[j,k]=h.useState(null),[g,$]=h.useState(!1);h.useEffect(()=>{y(),je.workspace.getConfig().then(M=>{if(u(M.roots),M.lastScans&&Object.keys(M.lastScans).length>0){const T=Object.values(M.lastScans).filter(I=>typeof I=="number");if(T.length>0){const I=Math.max(...T);Number.isNaN(I)||v(new Date(I).toISOString())}}return M.roots.length>0?je.workspace.getProjects():(m([]),$(!0),null)}).then(M=>{M&&(m(M),$(!0))}).catch(M=>{k(M instanceof Error?M.message:"Failed to fetch workspace config"),$(!0)})},[u,m,y,v]);const S=h.useCallback(M=>{x(M)},[x]);h.useEffect(()=>{g&&i&&a.length>0&&!a.some(M=>M.id===i)&&x(null)},[g,a,i,x]);const C=h.useCallback(async()=>{k(null),w(!0);try{const M=await je.workspace.scan();if(M!=null&&M.projects)m(M.projects);else{const T=await je.workspace.getProjects();m(T)}M!=null&&M.scannedAt?v(new Date(M.scannedAt).toISOString()):v(new Date().toISOString())}catch(M){k(M instanceof Error?M.message:"Scan failed")}finally{w(!1)}},[w,m,v]),P=a.find(M=>M.id===i)??null;return{isConfigured:s,projects:a,selectedProject:P,selectProject:S,scan:C,isScanning:d,lastScan:f?new Date(f).getTime():null,error:j}}function _y({onScan:s,onScanComplete:a,isScanning:i=!1,error:d=null}){const[f,u]=h.useState([]),[m,x]=h.useState(""),[y,w]=h.useState(null),v=()=>{const C=m.trim();if(!C){w("Please enter a path");return}if(f.includes(C)){x("");return}u([...f,C]),x(""),w(null)},j=C=>{u(f.filter((P,M)=>M!==C))},k=C=>{x(C.target.value),y&&w(null)},g=C=>{C.key==="Enter"&&v()},$=async()=>{f.length===0||i||(await s(f),a())},S=f.length===0||i;return r.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-8",children:r.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[r.jsxs("div",{"data-testid":"welcome-message",className:"text-center space-y-2",children:[r.jsx(gf,{className:"w-12 h-12 text-primary mx-auto"}),r.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to TLC Dashboard"}),r.jsx("p",{className:"text-muted-foreground",children:"A workspace is a collection of project root folders that TLC will scan and monitor. Add one or more root folders below to get started."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"root-path-input",className:"block text-sm font-medium text-foreground",children:"Root Folder Path"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{id:"root-path-input","data-testid":"root-path-input",type:"text",value:m,onChange:k,onKeyDown:g,placeholder:"~/Projects",className:`flex-1 px-3 py-2 text-sm bg-surface border border-border rounded-md\r
460
+ text-foreground placeholder:text-muted-foreground\r
461
+ focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary`}),r.jsxs("button",{"data-testid":"add-root-button",onClick:v,className:`inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium\r
462
+ rounded-md border border-border bg-surface hover:bg-muted\r
463
+ text-foreground transition-colors cursor-pointer`,children:[r.jsx(lr,{className:"w-4 h-4"}),"Add Root"]})]}),y&&r.jsx("p",{"data-testid":"validation-error",className:"text-sm text-error",children:y})]}),f.length>0&&r.jsxs("div",{"data-testid":"root-list",className:"space-y-2",children:[r.jsxs("h2",{className:"text-sm font-medium text-foreground",children:["Root Folders (",f.length,")"]}),r.jsx("ul",{className:"space-y-1",children:f.map((C,P)=>r.jsxs("li",{"data-testid":`root-item-${P}`,className:`flex items-center justify-between px-3 py-2\r
464
+ bg-surface border border-border rounded-md`,children:[r.jsx("span",{className:"text-sm text-foreground truncate",children:C}),r.jsx("button",{"data-testid":`remove-root-${P}`,onClick:()=>j(P),"aria-label":`Remove ${C}`,className:`ml-2 p-1 text-muted-foreground hover:text-error\r
465
+ transition-colors rounded cursor-pointer`,children:r.jsx(Sf,{className:"w-4 h-4"})})]},C))})]}),d&&r.jsx("p",{"data-testid":"scan-error",className:"text-sm text-error text-center",children:d}),i&&r.jsxs("div",{"data-testid":"scan-spinner",className:"flex items-center justify-center gap-2",children:[r.jsx(oi,{className:"w-5 h-5 text-primary animate-spin"}),r.jsx("span",{className:"text-sm text-muted-foreground",children:"Scanning projects..."})]}),r.jsxs("button",{"data-testid":"scan-button",onClick:$,disabled:S,className:`
466
+ w-full inline-flex items-center justify-center gap-2 px-4 py-2.5
467
+ text-sm font-medium rounded-md transition-colors
468
+ ${S?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground border border-border":"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer"}
469
+ `,children:[r.jsx(mn,{className:"w-4 h-4"}),"Scan Projects"]})]})})}function Dy(s){const i=Date.now()-s,d=Math.floor(i/1e3),f=Math.floor(i/6e4),u=Math.floor(i/36e5),m=Math.floor(i/864e5);return d<60?"just now":f<60?f===1?"1 minute ago":`${f} minutes ago`:u<24?u===1?"1 hour ago":`${u} hours ago`:m===1?"1 day ago":`${m} days ago`}function $y({onScan:s,lastScan:a,isScanning:i,projectCount:d,error:f}){const u=d===1?"project":"projects",m=a!==null?`Last scanned: ${Dy(a)}`:"Never scanned";return r.jsxs("div",{className:"flex items-center justify-between p-3 bg-surface border border-border rounded-lg",children:[r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsxs("span",{"data-testid":"project-count",className:"text-sm font-medium text-foreground",children:[d," ",u]}),r.jsx("span",{"data-testid":"last-scan",className:"text-sm text-muted-foreground",children:m})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[f&&r.jsx("span",{"data-testid":"scan-error",className:"text-sm text-error",children:f}),i&&r.jsx(oi,{"data-testid":"scan-spinner",className:"w-4 h-4 text-primary animate-spin"}),r.jsxs("button",{"data-testid":"refresh-button",onClick:s,disabled:i,className:`
470
+ inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium
471
+ rounded-md border border-border
472
+ transition-colors
473
+ ${i?"opacity-50 cursor-not-allowed bg-muted text-muted-foreground":"bg-surface hover:bg-muted text-foreground cursor-pointer"}
474
+ `,children:[r.jsx(En,{className:"w-4 h-4"}),"Refresh"]})]})]})}function zy({projects:s,selectedProjectId:a,onSelect:i}){const d=s.length===1?"project":"projects";return r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative",children:[r.jsxs("select",{"data-testid":"project-selector",value:a??"",onChange:f=>{f.target.value&&i(f.target.value)},className:`\r
475
+ appearance-none\r
476
+ w-56 pl-3 pr-8 py-1.5\r
477
+ text-sm font-medium\r
478
+ bg-bg-secondary border border-border rounded-md\r
479
+ text-text-primary\r
480
+ cursor-pointer\r
481
+ focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent\r
482
+ `,children:[r.jsx("option",{value:"",children:"Select a project..."}),s.map(f=>r.jsx("option",{value:f.id,children:f.name},f.id))]}),r.jsx(Pn,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none"})]}),r.jsxs("span",{"data-testid":"project-selector-count",className:"text-sm text-text-muted",children:[s.length," ",d]})]})}const Iy=(s,a)=>{const i=`${window.location.protocol}//${window.location.host}`;let d;try{d=new URL(i,window.location.origin)}catch{d=new URL(`${window.location.protocol}//${window.location.host}`)}const u=`${d.protocol==="https:"?"wss:":"ws:"}//${d.host}`,m=new URL("/ws",u);return a&&m.searchParams.set("projectId",a),m.toString()};function Fy(){var w,v,j,k;const s=ir(),{isCommandPaletteOpen:a,closeCommandPalette:i,initFromStorage:d,toggleTheme:f}=Be(),u=My();h.useEffect(()=>{d()},[d]);const m=h.useMemo(()=>{var g;return Iy(void 0,(g=u.selectedProject)==null?void 0:g.id)},[(w=u.selectedProject)==null?void 0:w.id]);hg({url:m,autoConnect:!0,projectId:(v=u.selectedProject)==null?void 0:v.id});const x=(j=u.selectedProject)==null?void 0:j.id,y=h.useMemo(()=>[{id:"nav-dashboard",label:"Go to Dashboard",shortcut:"g d",action:()=>{s(x?`/projects/${x}`:"/"),i()}},{id:"nav-projects",label:"Go to Projects",shortcut:"g p",action:()=>{s("/projects"),i()}},{id:"nav-tasks",label:"Go to Tasks",shortcut:"g t",action:()=>{s(x?`/projects/${x}/tasks`:"/tasks"),i()}},{id:"nav-logs",label:"Go to Logs",shortcut:"g l",action:()=>{s(x?`/projects/${x}/logs`:"/logs"),i()}},{id:"nav-settings",label:"Go to Settings",shortcut:"g s",action:()=>{s("/settings"),i()}},{id:"nav-team",label:"Go to Team",shortcut:"g m",action:()=>{s("/team"),i()}},{id:"nav-health",label:"Go to Health",shortcut:"g h",action:()=>{s("/health"),i()}},{id:"nav-preview",label:"Go to Preview",shortcut:"g v",action:()=>{s(x?`/projects/${x}/preview`:"/preview"),i()}},{id:"nav-tests",label:"Go to Tests",shortcut:"g x",action:()=>{s(x?`/projects/${x}/tests`:"/tests"),i()}},{id:"nav-bugs",label:"Go to Bugs",shortcut:"g b",action:()=>{s(x?`/projects/${x}/bugs`:"/bugs"),i()}},{id:"nav-roadmap",label:"Go to Roadmap",shortcut:"g r",action:()=>{s(x?`/projects/${x}/roadmap`:"/roadmap"),i()}},{id:"nav-docker",label:"Go to Docker",shortcut:"g k",action:()=>{s("/docker"),i()}},{id:"nav-vps",label:"Go to VPS",shortcut:"g j",action:()=>{s("/vps"),i()}},{id:"nav-setup",label:"Workspace Setup",shortcut:"g w",action:()=>{s("/setup"),i()}},{id:"toggle-theme",label:"Toggle Theme",shortcut:"t",action:()=>{f(),i()}}],[s,i,f,x]);return r.jsxs(r.Fragment,{children:[r.jsxs(jd,{children:[r.jsx(ke,{path:"/setup",element:r.jsx(_y,{onScan:async g=>{await je.workspace.setConfig(g),await u.scan()},onScanComplete:()=>s("/projects"),isScanning:u.isScanning,error:u.error})}),r.jsx(ke,{path:"/*",element:r.jsxs(Ef,{children:[r.jsxs("div",{className:"flex items-center gap-4 px-6 py-3 border-b border-border bg-bg-secondary",children:[u.projects.length>0&&r.jsx(zy,{projects:u.projects,selectedProjectId:((k=u.selectedProject)==null?void 0:k.id)??null,onSelect:g=>{u.selectProject(g),s(`/projects/${g}`)}}),r.jsx($y,{onScan:()=>u.scan(),lastScan:u.lastScan,isScanning:u.isScanning,projectCount:u.projects.length,error:u.error})]}),r.jsxs(jd,{children:[r.jsxs(ke,{path:"/projects/:projectId/*",element:r.jsx(gy,{}),children:[r.jsx(ke,{index:!0,element:r.jsx(Ho,{})}),r.jsx(ke,{path:"roadmap",element:r.jsx(Ud,{})}),r.jsx(ke,{path:"tasks",element:r.jsx(Md,{})}),r.jsx(ke,{path:"tests",element:r.jsx(Od,{})}),r.jsx(ke,{path:"bugs",element:r.jsx(Bd,{})}),r.jsx(ke,{path:"logs",element:r.jsx($d,{})}),r.jsx(ke,{path:"preview",element:r.jsx(Ad,{})}),r.jsx(ke,{path:"memory",element:r.jsx(wy,{})}),r.jsx(ke,{path:"info",element:r.jsx(by,{})}),r.jsx(ke,{path:"phases/:phaseNumber",element:r.jsx(Ey,{})})]}),r.jsx(ke,{path:"/",element:r.jsx(Ho,{})}),r.jsx(ke,{path:"/dashboard",element:r.jsx(Ho,{})}),r.jsx(ke,{path:"/projects",element:r.jsx(Gg,{})}),r.jsx(ke,{path:"/tasks",element:r.jsx(Md,{})}),r.jsx(ke,{path:"/logs",element:r.jsx($d,{})}),r.jsx(ke,{path:"/settings",element:r.jsx(Wg,{})}),r.jsx(ke,{path:"/team",element:r.jsx(ay,{})}),r.jsx(ke,{path:"/health",element:r.jsx(uy,{})}),r.jsx(ke,{path:"/preview",element:r.jsx(Ad,{})}),r.jsx(ke,{path:"/tests",element:r.jsx(Od,{})}),r.jsx(ke,{path:"/bugs",element:r.jsx(Bd,{})}),r.jsx(ke,{path:"/roadmap",element:r.jsx(Ud,{})}),r.jsx(ke,{path:"/client",element:r.jsx(yy,{})}),r.jsx(ke,{path:"/docker",element:r.jsx(Ry,{})}),r.jsx(ke,{path:"/vps",element:r.jsx(Ly,{})})]})]})})]}),r.jsx(lg,{commands:y,open:a,onClose:i})]})}function Ay(){return r.jsx(rg,{children:r.jsx(Fy,{})})}zp.createRoot(document.getElementById("root")).render(r.jsx(Zr.StrictMode,{children:r.jsx(lx,{children:r.jsx(Ay,{})})}));
483
+ //# sourceMappingURL=index-CwNPPVpg.js.map