specweave 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/README.md +15 -6
- package/dist/dashboard/assets/index-BeKUULf0.css +1 -0
- package/dist/dashboard/assets/index-Bf5TF0_l.js +13 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/src/cli/commands/sync.d.ts.map +1 -1
- package/dist/src/cli/commands/sync.js +23 -5
- package/dist/src/cli/commands/sync.js.map +1 -1
- package/dist/src/core/doctor/checkers/hooks-checker.d.ts +2 -2
- package/dist/src/core/doctor/checkers/hooks-checker.d.ts.map +1 -1
- package/dist/src/core/doctor/checkers/hooks-checker.js +6 -5
- package/dist/src/core/doctor/checkers/hooks-checker.js.map +1 -1
- package/dist/src/core/hooks/handlers/session-start.d.ts.map +1 -1
- package/dist/src/core/hooks/handlers/session-start.js +20 -0
- package/dist/src/core/hooks/handlers/session-start.js.map +1 -1
- package/dist/src/core/intent/portable-context.d.ts +4 -0
- package/dist/src/core/intent/portable-context.d.ts.map +1 -0
- package/dist/src/core/intent/portable-context.js +68 -0
- package/dist/src/core/intent/portable-context.js.map +1 -0
- package/dist/src/core/intent/types.d.ts +28 -0
- package/dist/src/core/intent/types.d.ts.map +1 -0
- package/dist/src/core/intent/types.js +3 -0
- package/dist/src/core/intent/types.js.map +1 -0
- package/dist/src/core/intent/validation.d.ts +5 -0
- package/dist/src/core/intent/validation.d.ts.map +1 -0
- package/dist/src/core/intent/validation.js +39 -0
- package/dist/src/core/intent/validation.js.map +1 -0
- package/dist/src/core/session/handoff-git-state.d.ts +3 -14
- package/dist/src/core/session/handoff-git-state.d.ts.map +1 -1
- package/dist/src/core/session/handoff-git-state.js +68 -124
- package/dist/src/core/session/handoff-git-state.js.map +1 -1
- package/dist/src/core/session/handoff-pointer.d.ts +4 -0
- package/dist/src/core/session/handoff-pointer.d.ts.map +1 -0
- package/dist/src/core/session/handoff-pointer.js +60 -0
- package/dist/src/core/session/handoff-pointer.js.map +1 -0
- package/dist/src/core/session/work-handoff.d.ts.map +1 -1
- package/dist/src/core/session/work-handoff.js +10 -3
- package/dist/src/core/session/work-handoff.js.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.d.ts +1 -0
- package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.js +10 -90
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
- package/dist/src/dashboard/server/data/cost-aggregator.d.ts +10 -5
- package/dist/src/dashboard/server/data/cost-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/cost-aggregator.js +31 -33
- package/dist/src/dashboard/server/data/cost-aggregator.js.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +0 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +14 -66
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-task-board.d.ts +4 -0
- package/dist/src/dashboard/server/data/dashboard-task-board.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/dashboard-task-board.js +56 -0
- package/dist/src/dashboard/server/data/dashboard-task-board.js.map +1 -0
- package/dist/src/dashboard/server/data/intent-store.d.ts +19 -0
- package/dist/src/dashboard/server/data/intent-store.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/intent-store.js +268 -0
- package/dist/src/dashboard/server/data/intent-store.js.map +1 -0
- package/dist/src/dashboard/server/data/local-sessions.d.ts +15 -0
- package/dist/src/dashboard/server/data/local-sessions.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/local-sessions.js +197 -0
- package/dist/src/dashboard/server/data/local-sessions.js.map +1 -0
- package/dist/src/dashboard/server/data/work-projection.d.ts +8 -0
- package/dist/src/dashboard/server/data/work-projection.d.ts.map +1 -0
- package/dist/src/dashboard/server/data/work-projection.js +175 -0
- package/dist/src/dashboard/server/data/work-projection.js.map +1 -0
- package/dist/src/dashboard/server/file-watcher.d.ts.map +1 -1
- package/dist/src/dashboard/server/file-watcher.js +2 -1
- package/dist/src/dashboard/server/file-watcher.js.map +1 -1
- package/dist/src/dashboard/server/local-request.d.ts +4 -0
- package/dist/src/dashboard/server/local-request.d.ts.map +1 -0
- package/dist/src/dashboard/server/local-request.js +29 -0
- package/dist/src/dashboard/server/local-request.js.map +1 -0
- package/dist/src/dashboard/server/routes/work-routes.d.ts +5 -0
- package/dist/src/dashboard/server/routes/work-routes.d.ts.map +1 -0
- package/dist/src/dashboard/server/routes/work-routes.js +37 -0
- package/dist/src/dashboard/server/routes/work-routes.js.map +1 -0
- package/dist/src/dashboard/types.d.ts +3 -3
- package/dist/src/dashboard/types.d.ts.map +1 -1
- package/dist/src/dashboard/work-types.d.ts +39 -0
- package/dist/src/dashboard/work-types.d.ts.map +1 -0
- package/dist/src/dashboard/work-types.js +3 -0
- package/dist/src/dashboard/work-types.js.map +1 -0
- package/dist/src/sync/external-change-puller.d.ts +19 -0
- package/dist/src/sync/external-change-puller.d.ts.map +1 -1
- package/dist/src/sync/external-change-puller.js +87 -77
- package/dist/src/sync/external-change-puller.js.map +1 -1
- package/package.json +3 -3
- package/plugins/specweave/.claude-plugin/plugin.json +2 -2
- package/plugins/specweave/hooks/hooks.json +3 -30
- package/plugins/specweave/hooks/run-worker.mjs +229 -0
- package/plugins/specweave/hooks/run.mjs +83 -217
- package/plugins/specweave/skills/increment/SKILL.md +7 -5
- package/src/templates/AGENTS.md.template +5 -5
- package/src/templates/CLAUDE.md.template +5 -5
- package/dist/dashboard/assets/index-BiJhGDZV.js +0 -13
- package/dist/dashboard/assets/index-heYRtWFf.css +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const x of d)if(x.type==="childList")for(const m of x.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function o(d){const x={};return d.integrity&&(x.integrity=d.integrity),d.referrerPolicy&&(x.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?x.credentials="include":d.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(d){if(d.ep)return;d.ep=!0;const x=o(d);fetch(d.href,x)}})();var to={exports:{}},Zn={};var k0;function Ng(){if(k0)return Zn;k0=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(c,d,x){var m=null;if(x!==void 0&&(m=""+x),d.key!==void 0&&(m=""+d.key),"key"in d){x={};for(var j in d)j!=="key"&&(x[j]=d[j])}else x=d;return d=x.ref,{$$typeof:r,type:c,key:m,ref:d!==void 0?d:null,props:x}}return Zn.Fragment=u,Zn.jsx=o,Zn.jsxs=o,Zn}var L0;function Sg(){return L0||(L0=1,to.exports=Ng()),to.exports}var l=Sg(),ao={exports:{}},de={};var U0;function wg(){if(U0)return de;U0=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),m=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),C=Symbol.iterator;function _(S){return S===null||typeof S!="object"?null:(S=C&&S[C]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,v={};function w(S,q,Z){this.props=S,this.context=q,this.refs=v,this.updater=Z||z}w.prototype.isReactComponent={},w.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,q,"setState")},w.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=w.prototype;function O(S,q,Z){this.props=S,this.context=q,this.refs=v,this.updater=Z||z}var W=O.prototype=new T;W.constructor=O,A(W,w.prototype),W.isPureReactComponent=!0;var X=Array.isArray;function le(){}var K={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function H(S,q,Z){var ee=Z.ref;return{$$typeof:r,type:S,key:q,ref:ee!==void 0?ee:null,props:Z}}function F(S,q){return H(S.type,q,S.props)}function P(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function se(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Z){return q[Z]})}var ze=/\/+/g;function Ae(S,q){return typeof S=="object"&&S!==null&&S.key!=null?se(""+S.key):q.toString(36)}function V(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(le,le):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function R(S,q,Z,ee,ue){var me=typeof S;(me==="undefined"||me==="boolean")&&(S=null);var te=!1;if(S===null)te=!0;else switch(me){case"bigint":case"string":case"number":te=!0;break;case"object":switch(S.$$typeof){case r:case u:te=!0;break;case N:return te=S._init,R(te(S._payload),q,Z,ee,ue)}}if(te)return ue=ue(S),te=ee===""?"."+Ae(S,0):ee,X(ue)?(Z="",te!=null&&(Z=te.replace(ze,"$&/")+"/"),R(ue,q,Z,"",function(Il){return Il})):ue!=null&&(P(ue)&&(ue=F(ue,Z+(ue.key==null||S&&S.key===ue.key?"":(""+ue.key).replace(ze,"$&/")+"/")+te)),q.push(ue)),1;te=0;var Je=ee===""?".":ee+":";if(X(S))for(var qe=0;qe<S.length;qe++)ee=S[qe],me=Je+Ae(ee,qe),te+=R(ee,q,Z,me,ue);else if(qe=_(S),typeof qe=="function")for(S=qe.call(S),qe=0;!(ee=S.next()).done;)ee=ee.value,me=Je+Ae(ee,qe++),te+=R(ee,q,Z,me,ue);else if(me==="object"){if(typeof S.then=="function")return R(V(S),q,Z,ee,ue);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return te}function Q(S,q,Z){if(S==null)return S;var ee=[],ue=0;return R(S,ee,"","",function(me){return q.call(Z,me,ue++)}),ee}function ne(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(Z){(S._status===0||S._status===-1)&&(S._status=1,S._result=Z)},function(Z){(S._status===0||S._status===-1)&&(S._status=2,S._result=Z)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var ve=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},je={map:Q,forEach:function(S,q,Z){Q(S,function(){q.apply(this,arguments)},Z)},count:function(S){var q=0;return Q(S,function(){q++}),q},toArray:function(S){return Q(S,function(q){return q})||[]},only:function(S){if(!P(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return de.Activity=y,de.Children=je,de.Component=w,de.Fragment=o,de.Profiler=d,de.PureComponent=O,de.StrictMode=c,de.Suspense=p,de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,de.__COMPILER_RUNTIME={__proto__:null,c:function(S){return K.H.useMemoCache(S)}},de.cache=function(S){return function(){return S.apply(null,arguments)}},de.cacheSignal=function(){return null},de.cloneElement=function(S,q,Z){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var ee=A({},S.props),ue=S.key;if(q!=null)for(me in q.key!==void 0&&(ue=""+q.key),q)!J.call(q,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&q.ref===void 0||(ee[me]=q[me]);var me=arguments.length-2;if(me===1)ee.children=Z;else if(1<me){for(var te=Array(me),Je=0;Je<me;Je++)te[Je]=arguments[Je+2];ee.children=te}return H(S.type,ue,ee)},de.createContext=function(S){return S={$$typeof:m,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:x,_context:S},S},de.createElement=function(S,q,Z){var ee,ue={},me=null;if(q!=null)for(ee in q.key!==void 0&&(me=""+q.key),q)J.call(q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ue[ee]=q[ee]);var te=arguments.length-2;if(te===1)ue.children=Z;else if(1<te){for(var Je=Array(te),qe=0;qe<te;qe++)Je[qe]=arguments[qe+2];ue.children=Je}if(S&&S.defaultProps)for(ee in te=S.defaultProps,te)ue[ee]===void 0&&(ue[ee]=te[ee]);return H(S,me,ue)},de.createRef=function(){return{current:null}},de.forwardRef=function(S){return{$$typeof:j,render:S}},de.isValidElement=P,de.lazy=function(S){return{$$typeof:N,_payload:{_status:-1,_result:S},_init:ne}},de.memo=function(S,q){return{$$typeof:h,type:S,compare:q===void 0?null:q}},de.startTransition=function(S){var q=K.T,Z={};K.T=Z;try{var ee=S(),ue=K.S;ue!==null&&ue(Z,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(le,ve)}catch(me){ve(me)}finally{q!==null&&Z.types!==null&&(q.types=Z.types),K.T=q}},de.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},de.use=function(S){return K.H.use(S)},de.useActionState=function(S,q,Z){return K.H.useActionState(S,q,Z)},de.useCallback=function(S,q){return K.H.useCallback(S,q)},de.useContext=function(S){return K.H.useContext(S)},de.useDebugValue=function(){},de.useDeferredValue=function(S,q){return K.H.useDeferredValue(S,q)},de.useEffect=function(S,q){return K.H.useEffect(S,q)},de.useEffectEvent=function(S){return K.H.useEffectEvent(S)},de.useId=function(){return K.H.useId()},de.useImperativeHandle=function(S,q,Z){return K.H.useImperativeHandle(S,q,Z)},de.useInsertionEffect=function(S,q){return K.H.useInsertionEffect(S,q)},de.useLayoutEffect=function(S,q){return K.H.useLayoutEffect(S,q)},de.useMemo=function(S,q){return K.H.useMemo(S,q)},de.useOptimistic=function(S,q){return K.H.useOptimistic(S,q)},de.useReducer=function(S,q,Z){return K.H.useReducer(S,q,Z)},de.useRef=function(S){return K.H.useRef(S)},de.useState=function(S){return K.H.useState(S)},de.useSyncExternalStore=function(S,q,Z){return K.H.useSyncExternalStore(S,q,Z)},de.useTransition=function(){return K.H.useTransition()},de.version="19.2.8",de}var H0;function bo(){return H0||(H0=1,ao.exports=wg()),ao.exports}var b=bo(),lo={exports:{}},Kn={},no={exports:{}},so={};var B0;function Eg(){return B0||(B0=1,(function(r){function u(R,Q){var ne=R.length;R.push(Q);e:for(;0<ne;){var ve=ne-1>>>1,je=R[ve];if(0<d(je,Q))R[ve]=Q,R[ne]=je,ne=ve;else break e}}function o(R){return R.length===0?null:R[0]}function c(R){if(R.length===0)return null;var Q=R[0],ne=R.pop();if(ne!==Q){R[0]=ne;e:for(var ve=0,je=R.length,S=je>>>1;ve<S;){var q=2*(ve+1)-1,Z=R[q],ee=q+1,ue=R[ee];if(0>d(Z,ne))ee<je&&0>d(ue,Z)?(R[ve]=ue,R[ee]=ne,ve=ee):(R[ve]=Z,R[q]=ne,ve=q);else if(ee<je&&0>d(ue,ne))R[ve]=ue,R[ee]=ne,ve=ee;else break e}}return Q}function d(R,Q){var ne=R.sortIndex-Q.sortIndex;return ne!==0?ne:R.id-Q.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;r.unstable_now=function(){return x.now()}}else{var m=Date,j=m.now();r.unstable_now=function(){return m.now()-j}}var p=[],h=[],N=1,y=null,C=3,_=!1,z=!1,A=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function W(R){for(var Q=o(h);Q!==null;){if(Q.callback===null)c(h);else if(Q.startTime<=R)c(h),Q.sortIndex=Q.expirationTime,u(p,Q);else break;Q=o(h)}}function X(R){if(A=!1,W(R),!z)if(o(p)!==null)z=!0,le||(le=!0,se());else{var Q=o(h);Q!==null&&V(X,Q.startTime-R)}}var le=!1,K=-1,J=5,H=-1;function F(){return v?!0:!(r.unstable_now()-H<J)}function P(){if(v=!1,le){var R=r.unstable_now();H=R;var Q=!0;try{e:{z=!1,A&&(A=!1,T(K),K=-1),_=!0;var ne=C;try{t:{for(W(R),y=o(p);y!==null&&!(y.expirationTime>R&&F());){var ve=y.callback;if(typeof ve=="function"){y.callback=null,C=y.priorityLevel;var je=ve(y.expirationTime<=R);if(R=r.unstable_now(),typeof je=="function"){y.callback=je,W(R),Q=!0;break t}y===o(p)&&c(p),W(R)}else c(p);y=o(p)}if(y!==null)Q=!0;else{var S=o(h);S!==null&&V(X,S.startTime-R),Q=!1}}break e}finally{y=null,C=ne,_=!1}Q=void 0}}finally{Q?se():le=!1}}}var se;if(typeof O=="function")se=function(){O(P)};else if(typeof MessageChannel<"u"){var ze=new MessageChannel,Ae=ze.port2;ze.port1.onmessage=P,se=function(){Ae.postMessage(null)}}else se=function(){w(P,0)};function V(R,Q){K=w(function(){R(r.unstable_now())},Q)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(R){R.callback=null},r.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<R?Math.floor(1e3/R):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_next=function(R){switch(C){case 1:case 2:case 3:var Q=3;break;default:Q=C}var ne=C;C=Q;try{return R()}finally{C=ne}},r.unstable_requestPaint=function(){v=!0},r.unstable_runWithPriority=function(R,Q){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var ne=C;C=R;try{return Q()}finally{C=ne}},r.unstable_scheduleCallback=function(R,Q,ne){var ve=r.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ve+ne:ve):ne=ve,R){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=ne+je,R={id:N++,callback:Q,priorityLevel:R,startTime:ne,expirationTime:je,sortIndex:-1},ne>ve?(R.sortIndex=ne,u(h,R),o(p)===null&&R===o(h)&&(A?(T(K),K=-1):A=!0,V(X,ne-ve))):(R.sortIndex=je,u(p,R),z||_||(z=!0,le||(le=!0,se()))),R},r.unstable_shouldYield=F,r.unstable_wrapCallback=function(R){var Q=C;return function(){var ne=C;C=Q;try{return R.apply(this,arguments)}finally{C=ne}}}})(so)),so}var $0;function Cg(){return $0||($0=1,no.exports=Eg()),no.exports}var ro={exports:{}},rt={};var q0;function Tg(){if(q0)return rt;q0=1;var r=bo();function u(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)h+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(u(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function x(p,h,N){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:p,containerInfo:h,implementation:N}}var m=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function j(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,rt.createPortal=function(p,h){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(u(299));return x(p,h,null,N)},rt.flushSync=function(p){var h=m.T,N=c.p;try{if(m.T=null,c.p=2,p)return p()}finally{m.T=h,c.p=N,c.d.f()}},rt.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(p,h))},rt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},rt.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var N=h.as,y=j(N,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,_=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;N==="style"?c.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:C,fetchPriority:_}):N==="script"&&c.d.X(p,{crossOrigin:y,integrity:C,fetchPriority:_,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},rt.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var N=j(h.as,h.crossOrigin);c.d.M(p,{crossOrigin:N,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&c.d.M(p)},rt.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var N=h.as,y=j(N,h.crossOrigin);c.d.L(p,N,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},rt.preloadModule=function(p,h){if(typeof p=="string")if(h){var N=j(h.as,h.crossOrigin);c.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:N,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else c.d.m(p)},rt.requestFormReset=function(p){c.d.r(p)},rt.unstable_batchedUpdates=function(p,h){return p(h)},rt.useFormState=function(p,h,N){return m.H.useFormState(p,h,N)},rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},rt.version="19.2.8",rt}var Y0;function Ag(){if(Y0)return ro.exports;Y0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(u){console.error(u)}}return r(),ro.exports=Tg(),ro.exports}var G0;function Rg(){if(G0)return Kn;G0=1;var r=Cg(),u=bo(),o=Ag();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(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 j(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(x(e)!==e)throw Error(c(188))}function h(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===a)return p(s),e;if(i===n)return p(s),t;i=i.sibling}throw Error(c(188))}if(a.return!==n.return)a=s,n=i;else{for(var f=!1,g=s.child;g;){if(g===a){f=!0,a=s,n=i;break}if(g===n){f=!0,n=s,a=i;break}g=g.sibling}if(!f){for(g=i.child;g;){if(g===a){f=!0,a=i,n=s;break}if(g===n){f=!0,n=i,a=s;break}g=g.sibling}if(!f)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,C=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ze?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case X:return"Suspense";case le:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case O:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}var V=Array.isArray,R=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ve=[],je=-1;function S(e){return{current:e}}function q(e){0>je||(e.current=ve[je],ve[je]=null,je--)}function Z(e,t){je++,ve[je]=e.current,e.current=t}var ee=S(null),ue=S(null),me=S(null),te=S(null);function Je(e,t){switch(Z(me,t),Z(ue,e),Z(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?n0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=n0(t),e=s0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ee),Z(ee,e)}function qe(){q(ee),q(ue),q(me)}function Il(e){e.memoizedState!==null&&Z(te,e);var t=ee.current,a=s0(t,e.type);t!==a&&(Z(ue,e),Z(ee,a))}function rs(e){ue.current===e&&(q(ee),q(ue)),te.current===e&&(q(te),Gn._currentValue=ne)}var Ur,zo;function Ya(e){if(Ur===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ur=t&&t[1]||"",zo=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ur+e+zo}var Hr=!1;function Br(e,t){if(!e||Hr)return"";Hr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(B){var U=B}Reflect.construct(e,[],G)}else{try{G.call()}catch(B){U=B}e.call(G.prototype)}}else{try{throw Error()}catch(B){U=B}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(B){if(B&&U&&typeof B.stack=="string")return[B.stack,U.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),f=i[0],g=i[1];if(f&&g){var E=f.split(`
|
|
4
|
+
`),L=g.split(`
|
|
5
|
+
`);for(s=n=0;n<E.length&&!E[n].includes("DetermineComponentFrameRoot");)n++;for(;s<L.length&&!L[s].includes("DetermineComponentFrameRoot");)s++;if(n===E.length||s===L.length)for(n=E.length-1,s=L.length-1;1<=n&&0<=s&&E[n]!==L[s];)s--;for(;1<=n&&0<=s;n--,s--)if(E[n]!==L[s]){if(n!==1||s!==1)do if(n--,s--,0>s||E[n]!==L[s]){var $=`
|
|
6
|
+
`+E[n].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=n&&0<=s);break}}}finally{Hr=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ya(a):""}function Ix(e,t){switch(e.tag){case 26:case 27:case 5:return Ya(e.type);case 16:return Ya("Lazy");case 13:return e.child!==t&&t!==null?Ya("Suspense Fallback"):Ya("Suspense");case 19:return Ya("SuspenseList");case 0:case 15:return Br(e.type,!1);case 11:return Br(e.type.render,!1);case 1:return Br(e.type,!0);case 31:return Ya("Activity");default:return""}}function Oo(e){try{var t="",a=null;do t+=Ix(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
|
+
Error generating stack: `+n.message+`
|
|
8
|
+
`+n.stack}}var $r=Object.prototype.hasOwnProperty,qr=r.unstable_scheduleCallback,Yr=r.unstable_cancelCallback,em=r.unstable_shouldYield,tm=r.unstable_requestPaint,ht=r.unstable_now,am=r.unstable_getCurrentPriorityLevel,ko=r.unstable_ImmediatePriority,Lo=r.unstable_UserBlockingPriority,is=r.unstable_NormalPriority,lm=r.unstable_LowPriority,Uo=r.unstable_IdlePriority,nm=r.log,sm=r.unstable_setDisableYieldValue,en=null,gt=null;function ha(e){if(typeof nm=="function"&&sm(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(en,e)}catch{}}var pt=Math.clz32?Math.clz32:cm,rm=Math.log,im=Math.LN2;function cm(e){return e>>>=0,e===0?32:31-(rm(e)/im|0)|0}var cs=256,os=262144,us=4194304;function Ga(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ds(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=n&134217727;return g!==0?(n=g&~i,n!==0?s=Ga(n):(f&=g,f!==0?s=Ga(f):a||(a=g&~e,a!==0&&(s=Ga(a))))):(g=n&~i,g!==0?s=Ga(g):f!==0?s=Ga(f):a||(a=n&~e,a!==0&&(s=Ga(a)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:s}function tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function om(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ho(){var e=us;return us<<=1,(us&62914560)===0&&(us=4194304),e}function Gr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function an(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function um(e,t,a,n,s,i){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var g=e.entanglements,E=e.expirationTimes,L=e.hiddenUpdates;for(a=f&~a;0<a;){var $=31-pt(a),G=1<<$;g[$]=0,E[$]=-1;var U=L[$];if(U!==null)for(L[$]=null,$=0;$<U.length;$++){var B=U[$];B!==null&&(B.lane&=-536870913)}a&=~G}n!==0&&Bo(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(f&~t))}function Bo(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function $o(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-pt(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function qo(e,t){var a=t&-t;return a=(a&42)!==0?1:Vr(a),(a&(e.suspendedLanes|t))!==0?0:a}function Vr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yo(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:A0(e.type))}function Go(e,t){var a=Q.p;try{return Q.p=e,t()}finally{Q.p=a}}var ga=Math.random().toString(36).slice(2),tt="__reactFiber$"+ga,ct="__reactProps$"+ga,cl="__reactContainer$"+ga,Xr="__reactEvents$"+ga,dm="__reactListeners$"+ga,fm="__reactHandles$"+ga,Vo="__reactResources$"+ga,ln="__reactMarker$"+ga;function Zr(e){delete e[tt],delete e[ct],delete e[Xr],delete e[dm],delete e[fm]}function ol(e){var t=e[tt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[cl]||a[tt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=f0(e);e!==null;){if(a=e[tt])return a;e=f0(e)}return t}e=a,a=e.parentNode}return null}function ul(e){if(e=e[tt]||e[cl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function dl(e){var t=e[Vo];return t||(t=e[Vo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[ln]=!0}var Qo=new Set,Xo={};function Va(e,t){fl(e,t),fl(e+"Capture",t)}function fl(e,t){for(Xo[e]=t,e=0;e<t.length;e++)Qo.add(t[e])}var xm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Zo={},Ko={};function mm(e){return $r.call(Ko,e)?!0:$r.call(Zo,e)?!1:xm.test(e)?Ko[e]=!0:(Zo[e]=!0,!1)}function fs(e,t,a){if(mm(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function xs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Jt(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Et(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hm(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){a=""+f,i.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kr(e){if(!e._valueTracker){var t=Jo(e)?"checked":"value";e._valueTracker=hm(e,t,""+e[t])}}function Wo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Jo(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ms(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var gm=/[\n"\\]/g;function Ct(e){return e.replace(gm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jr(e,t,a,n,s,i,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Et(t)):e.value!==""+Et(t)&&(e.value=""+Et(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Wr(e,f,Et(t)):a!=null?Wr(e,f,Et(a)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Et(g):e.removeAttribute("name")}function Fo(e,t,a,n,s,i,f,g){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Kr(e);return}a=a!=null?""+Et(a):"",t=t!=null?""+Et(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=g?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Kr(e)}function Wr(e,t,a){t==="number"&&ms(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function xl(e,t,a,n){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Et(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Po(e,t,a){if(t!=null&&(t=""+Et(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Et(a):""}function Io(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(V(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Et(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Kr(e)}function ml(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var pm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function eu(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||pm.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function tu(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&a[s]!==n&&eu(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&eu(e,i,t[i])}function Fr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ym=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vm=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hs(e){return vm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Pr=null;function Ir(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hl=null,gl=null;function au(e){var t=ul(e);if(t&&(e=t.stateNode)){var a=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Jr(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Ct(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[ct]||null;if(!s)throw Error(c(90));Jr(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Wo(n)}break e;case"textarea":Po(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&xl(e,!!a.multiple,t,!1)}}}var ei=!1;function lu(e,t,a){if(ei)return e(t,a);ei=!0;try{var n=e(t);return n}finally{if(ei=!1,(hl!==null||gl!==null)&&(ar(),hl&&(t=hl,e=gl,gl=hl=null,au(t),e)))for(t=0;t<e.length;t++)au(e[t])}}function sn(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ct]||null;if(n===null)return null;a=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ti=!1;if(Ft)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){ti=!0}}),window.addEventListener("test",rn,rn),window.removeEventListener("test",rn,rn)}catch{ti=!1}var pa=null,ai=null,gs=null;function nu(){if(gs)return gs;var e,t=ai,a=t.length,n,s="value"in pa?pa.value:pa.textContent,i=s.length;for(e=0;e<a&&t[e]===s[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===s[i-n];n++);return gs=s.slice(e,1<n?1-n:void 0)}function ps(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 ys(){return!0}function su(){return!1}function ot(e){function t(a,n,s,i,f){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(i):i[g]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ys:su,this.isPropagationStopped=su,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ys)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ys)},persist:function(){},isPersistent:ys}),t}var Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vs=ot(Qa),cn=y({},Qa,{view:0,detail:0}),bm=ot(cn),li,ni,on,bs=y({},cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ri,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!==on&&(on&&e.type==="mousemove"?(li=e.screenX-on.screenX,ni=e.screenY-on.screenY):ni=li=0,on=e),li)},movementY:function(e){return"movementY"in e?e.movementY:ni}}),ru=ot(bs),jm=y({},bs,{dataTransfer:0}),Nm=ot(jm),Sm=y({},cn,{relatedTarget:0}),si=ot(Sm),wm=y({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),Em=ot(wm),Cm=y({},Qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tm=ot(Cm),Am=y({},Qa,{data:0}),iu=ot(Am),Rm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mm={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"},Dm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _m(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dm[e])?!!t[e]:!1}function ri(){return _m}var zm=y({},cn,{key:function(e){if(e.key){var t=Rm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ps(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ri,charCode:function(e){return e.type==="keypress"?ps(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ps(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Om=ot(zm),km=y({},bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cu=ot(km),Lm=y({},cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ri}),Um=ot(Lm),Hm=y({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bm=ot(Hm),$m=y({},bs,{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}),qm=ot($m),Ym=y({},Qa,{newState:0,oldState:0}),Gm=ot(Ym),Vm=[9,13,27,32],ii=Ft&&"CompositionEvent"in window,un=null;Ft&&"documentMode"in document&&(un=document.documentMode);var Qm=Ft&&"TextEvent"in window&&!un,ou=Ft&&(!ii||un&&8<un&&11>=un),uu=" ",du=!1;function fu(e,t){switch(e){case"keyup":return Vm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pl=!1;function Xm(e,t){switch(e){case"compositionend":return xu(t);case"keypress":return t.which!==32?null:(du=!0,uu);case"textInput":return e=t.data,e===uu&&du?null:e;default:return null}}function Zm(e,t){if(pl)return e==="compositionend"||!ii&&fu(e,t)?(e=nu(),gs=ai=pa=null,pl=!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 ou&&t.locale!=="ko"?null:t.data;default:return null}}var Km={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 mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Km[e.type]:t==="textarea"}function hu(e,t,a,n){hl?gl?gl.push(n):gl=[n]:hl=n,t=or(t,"onChange"),0<t.length&&(a=new vs("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var dn=null,fn=null;function Jm(e){Pf(e,0)}function js(e){var t=nn(e);if(Wo(t))return e}function gu(e,t){if(e==="change")return t}var pu=!1;if(Ft){var ci;if(Ft){var oi="oninput"in document;if(!oi){var yu=document.createElement("div");yu.setAttribute("oninput","return;"),oi=typeof yu.oninput=="function"}ci=oi}else ci=!1;pu=ci&&(!document.documentMode||9<document.documentMode)}function vu(){dn&&(dn.detachEvent("onpropertychange",bu),fn=dn=null)}function bu(e){if(e.propertyName==="value"&&js(fn)){var t=[];hu(t,fn,e,Ir(e)),lu(Jm,t)}}function Wm(e,t,a){e==="focusin"?(vu(),dn=t,fn=a,dn.attachEvent("onpropertychange",bu)):e==="focusout"&&vu()}function Fm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return js(fn)}function Pm(e,t){if(e==="click")return js(t)}function Im(e,t){if(e==="input"||e==="change")return js(t)}function eh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:eh;function xn(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var s=a[n];if(!$r.call(t,s)||!yt(e[s],t[s]))return!1}return!0}function ju(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nu(e,t){var a=ju(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ju(a)}}function Su(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Su(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ms(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ms(e.document)}return t}function ui(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var th=Ft&&"documentMode"in document&&11>=document.documentMode,yl=null,di=null,mn=null,fi=!1;function Eu(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;fi||yl==null||yl!==ms(n)||(n=yl,"selectionStart"in n&&ui(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),mn&&xn(mn,n)||(mn=n,n=or(di,"onSelect"),0<n.length&&(t=new vs("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=yl)))}function Xa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var vl={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},xi={},Cu={};Ft&&(Cu=document.createElement("div").style,"AnimationEvent"in window||(delete vl.animationend.animation,delete vl.animationiteration.animation,delete vl.animationstart.animation),"TransitionEvent"in window||delete vl.transitionend.transition);function Za(e){if(xi[e])return xi[e];if(!vl[e])return e;var t=vl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Cu)return xi[e]=t[a];return e}var Tu=Za("animationend"),Au=Za("animationiteration"),Ru=Za("animationstart"),ah=Za("transitionrun"),lh=Za("transitionstart"),nh=Za("transitioncancel"),Mu=Za("transitionend"),Du=new Map,mi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");mi.push("scrollEnd");function Ut(e,t){Du.set(e,t),Va(t,[e])}var Ns=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Tt=[],bl=0,hi=0;function Ss(){for(var e=bl,t=hi=bl=0;t<e;){var a=Tt[t];Tt[t++]=null;var n=Tt[t];Tt[t++]=null;var s=Tt[t];Tt[t++]=null;var i=Tt[t];if(Tt[t++]=null,n!==null&&s!==null){var f=n.pending;f===null?s.next=s:(s.next=f.next,f.next=s),n.pending=s}i!==0&&_u(a,s,i)}}function ws(e,t,a,n){Tt[bl++]=e,Tt[bl++]=t,Tt[bl++]=a,Tt[bl++]=n,hi|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function gi(e,t,a,n){return ws(e,t,a,n),Es(e)}function Ka(e,t){return ws(e,null,null,t),Es(e)}function _u(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-pt(a),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),i):null}function Es(e){if(50<Ln)throw Ln=0,Ec=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var jl={};function sh(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,a,n){return new sh(e,t,a,n)}function pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pt(e,t){var a=e.alternate;return a===null?(a=vt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function zu(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cs(e,t,a,n,s,i){var f=0;if(n=e,typeof e=="function")pi(e)&&(f=1);else if(typeof e=="string")f=ug(e,a,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=vt(31,a,t,s),e.elementType=H,e.lanes=i,e;case A:return Ja(a.children,s,i,t);case v:f=8,s|=24;break;case w:return e=vt(12,a,t,s|2),e.elementType=w,e.lanes=i,e;case X:return e=vt(13,a,t,s),e.elementType=X,e.lanes=i,e;case le:return e=vt(19,a,t,s),e.elementType=le,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:f=10;break e;case T:f=9;break e;case W:f=11;break e;case K:f=14;break e;case J:f=16,n=null;break e}f=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=vt(f,a,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ja(e,t,a,n){return e=vt(7,e,n,t),e.lanes=a,e}function yi(e,t,a){return e=vt(6,e,null,t),e.lanes=a,e}function Ou(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function vi(e,t,a){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ku=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=ku.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Oo(t)},ku.set(e,t),t)}return{value:e,source:t,stack:Oo(t)}}var Nl=[],Sl=0,Ts=null,hn=0,Rt=[],Mt=0,ya=null,Vt=1,Qt="";function It(e,t){Nl[Sl++]=hn,Nl[Sl++]=Ts,Ts=e,hn=t}function Lu(e,t,a){Rt[Mt++]=Vt,Rt[Mt++]=Qt,Rt[Mt++]=ya,ya=e;var n=Vt;e=Qt;var s=32-pt(n)-1;n&=~(1<<s),a+=1;var i=32-pt(t)+s;if(30<i){var f=s-s%5;i=(n&(1<<f)-1).toString(32),n>>=f,s-=f,Vt=1<<32-pt(t)+s|a<<s|n,Qt=i+e}else Vt=1<<i|a<<s|n,Qt=e}function bi(e){e.return!==null&&(It(e,1),Lu(e,1,0))}function ji(e){for(;e===Ts;)Ts=Nl[--Sl],Nl[Sl]=null,hn=Nl[--Sl],Nl[Sl]=null;for(;e===ya;)ya=Rt[--Mt],Rt[Mt]=null,Qt=Rt[--Mt],Rt[Mt]=null,Vt=Rt[--Mt],Rt[Mt]=null}function Uu(e,t){Rt[Mt++]=Vt,Rt[Mt++]=Qt,Rt[Mt++]=ya,Vt=t.id,Qt=t.overflow,ya=e}var at=null,Oe=null,be=!1,va=null,Dt=!1,Ni=Error(c(519));function ba(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw gn(At(t,e)),Ni}function Hu(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[tt]=e,t[ct]=n,a){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(a=0;a<Hn.length;a++)ge(Hn[a],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),Fo(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),Io(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||a0(t.textContent,a)?(n.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),n.onScroll!=null&&ge("scroll",t),n.onScrollEnd!=null&&ge("scrollend",t),n.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||ba(e,!0)}function Bu(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:Dt=!1;return;case 27:case 3:Dt=!0;return;default:at=at.return}}function wl(e){if(e!==at)return!1;if(!be)return Bu(e),be=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||$c(e.type,e.memoizedProps)),a=!a),a&&Oe&&ba(e),Bu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Oe=d0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Oe=d0(e)}else t===27?(t=Oe,Oa(e.type)?(e=Qc,Qc=null,Oe=e):Oe=t):Oe=at?zt(e.stateNode.nextSibling):null;return!0}function Wa(){Oe=at=null,be=!1}function Si(){var e=va;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),va=null),e}function gn(e){va===null?va=[e]:va.push(e)}var wi=S(null),Fa=null,ea=null;function ja(e,t,a){Z(wi,t._currentValue),t._currentValue=a}function ta(e){e._currentValue=wi.current,q(wi)}function Ei(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Ci(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var f=s.child;i=i.firstContext;e:for(;i!==null;){var g=i;i=s;for(var E=0;E<t.length;E++)if(g.context===t[E]){i.lanes|=a,g=i.alternate,g!==null&&(g.lanes|=a),Ei(i.return,a,e),n||(f=null);break e}i=g.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(c(341));f.lanes|=a,i=f.alternate,i!==null&&(i.lanes|=a),Ei(f,a,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function El(e,t,a,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var g=s.type;yt(s.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(s===te.current){if(f=s.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Gn):e=[Gn])}s=s.return}e!==null&&Ci(t,e,a,n),t.flags|=262144}function As(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Pa(e){Fa=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return $u(Fa,e)}function Rs(e,t){return Fa===null&&Pa(e),$u(e,t)}function $u(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ea===null){if(e===null)throw Error(c(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return a}var rh=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},ih=r.unstable_scheduleCallback,ch=r.unstable_NormalPriority,Qe={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ti(){return{controller:new rh,data:new Map,refCount:0}}function pn(e){e.refCount--,e.refCount===0&&ih(ch,function(){e.controller.abort()})}var yn=null,Ai=0,Cl=0,Tl=null;function oh(e,t){if(yn===null){var a=yn=[];Ai=0,Cl=Dc(),Tl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Ai++,t.then(qu,qu),t}function qu(){if(--Ai===0&&yn!==null){Tl!==null&&(Tl.status="fulfilled");var e=yn;yn=null,Cl=0,Tl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function uh(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),n}var Yu=R.S;R.S=function(e,t){Cf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&oh(e,t),Yu!==null&&Yu(e,t)};var Ia=S(null);function Ri(){var e=Ia.current;return e!==null?e:_e.pooledCache}function Ms(e,t){t===null?Z(Ia,Ia.current):Z(Ia,t.pool)}function Gu(){var e=Ri();return e===null?null:{parent:Qe._currentValue,pool:e}}var Al=Error(c(460)),Mi=Error(c(474)),Ds=Error(c(542)),_s={then:function(){}};function Vu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qu(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Wt,Wt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zu(e),e;default:if(typeof t.status=="string")t.then(Wt,Wt);else{if(e=_e,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Zu(e),e}throw tl=t,Al}}function el(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(tl=a,Al):a}}var tl=null;function Xu(){if(tl===null)throw Error(c(459));var e=tl;return tl=null,e}function Zu(e){if(e===Al||e===Ds)throw Error(c(483))}var Rl=null,vn=0;function zs(e){var t=vn;return vn+=1,Rl===null&&(Rl=[]),Qu(Rl,e,t)}function bn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Os(e,t){throw t.$$typeof===C?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ku(e){function t(D,M){if(e){var k=D.deletions;k===null?(D.deletions=[M],D.flags|=16):k.push(M)}}function a(D,M){if(!e)return null;for(;M!==null;)t(D,M),M=M.sibling;return null}function n(D){for(var M=new Map;D!==null;)D.key!==null?M.set(D.key,D):M.set(D.index,D),D=D.sibling;return M}function s(D,M){return D=Pt(D,M),D.index=0,D.sibling=null,D}function i(D,M,k){return D.index=k,e?(k=D.alternate,k!==null?(k=k.index,k<M?(D.flags|=67108866,M):k):(D.flags|=67108866,M)):(D.flags|=1048576,M)}function f(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function g(D,M,k,Y){return M===null||M.tag!==6?(M=yi(k,D.mode,Y),M.return=D,M):(M=s(M,k),M.return=D,M)}function E(D,M,k,Y){var re=k.type;return re===A?$(D,M,k.props.children,Y,k.key):M!==null&&(M.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===J&&el(re)===M.type)?(M=s(M,k.props),bn(M,k),M.return=D,M):(M=Cs(k.type,k.key,k.props,null,D.mode,Y),bn(M,k),M.return=D,M)}function L(D,M,k,Y){return M===null||M.tag!==4||M.stateNode.containerInfo!==k.containerInfo||M.stateNode.implementation!==k.implementation?(M=vi(k,D.mode,Y),M.return=D,M):(M=s(M,k.children||[]),M.return=D,M)}function $(D,M,k,Y,re){return M===null||M.tag!==7?(M=Ja(k,D.mode,Y,re),M.return=D,M):(M=s(M,k),M.return=D,M)}function G(D,M,k){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=yi(""+M,D.mode,k),M.return=D,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case _:return k=Cs(M.type,M.key,M.props,null,D.mode,k),bn(k,M),k.return=D,k;case z:return M=vi(M,D.mode,k),M.return=D,M;case J:return M=el(M),G(D,M,k)}if(V(M)||se(M))return M=Ja(M,D.mode,k,null),M.return=D,M;if(typeof M.then=="function")return G(D,zs(M),k);if(M.$$typeof===O)return G(D,Rs(D,M),k);Os(D,M)}return null}function U(D,M,k,Y){var re=M!==null?M.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return re!==null?null:g(D,M,""+k,Y);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case _:return k.key===re?E(D,M,k,Y):null;case z:return k.key===re?L(D,M,k,Y):null;case J:return k=el(k),U(D,M,k,Y)}if(V(k)||se(k))return re!==null?null:$(D,M,k,Y,null);if(typeof k.then=="function")return U(D,M,zs(k),Y);if(k.$$typeof===O)return U(D,M,Rs(D,k),Y);Os(D,k)}return null}function B(D,M,k,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return D=D.get(k)||null,g(M,D,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case _:return D=D.get(Y.key===null?k:Y.key)||null,E(M,D,Y,re);case z:return D=D.get(Y.key===null?k:Y.key)||null,L(M,D,Y,re);case J:return Y=el(Y),B(D,M,k,Y,re)}if(V(Y)||se(Y))return D=D.get(k)||null,$(M,D,Y,re,null);if(typeof Y.then=="function")return B(D,M,k,zs(Y),re);if(Y.$$typeof===O)return B(D,M,k,Rs(M,Y),re);Os(M,Y)}return null}function I(D,M,k,Y){for(var re=null,Ne=null,ae=M,xe=M=0,ye=null;ae!==null&&xe<k.length;xe++){ae.index>xe?(ye=ae,ae=null):ye=ae.sibling;var Se=U(D,ae,k[xe],Y);if(Se===null){ae===null&&(ae=ye);break}e&&ae&&Se.alternate===null&&t(D,ae),M=i(Se,M,xe),Ne===null?re=Se:Ne.sibling=Se,Ne=Se,ae=ye}if(xe===k.length)return a(D,ae),be&&It(D,xe),re;if(ae===null){for(;xe<k.length;xe++)ae=G(D,k[xe],Y),ae!==null&&(M=i(ae,M,xe),Ne===null?re=ae:Ne.sibling=ae,Ne=ae);return be&&It(D,xe),re}for(ae=n(ae);xe<k.length;xe++)ye=B(ae,D,xe,k[xe],Y),ye!==null&&(e&&ye.alternate!==null&&ae.delete(ye.key===null?xe:ye.key),M=i(ye,M,xe),Ne===null?re=ye:Ne.sibling=ye,Ne=ye);return e&&ae.forEach(function(Ba){return t(D,Ba)}),be&&It(D,xe),re}function ce(D,M,k,Y){if(k==null)throw Error(c(151));for(var re=null,Ne=null,ae=M,xe=M=0,ye=null,Se=k.next();ae!==null&&!Se.done;xe++,Se=k.next()){ae.index>xe?(ye=ae,ae=null):ye=ae.sibling;var Ba=U(D,ae,Se.value,Y);if(Ba===null){ae===null&&(ae=ye);break}e&&ae&&Ba.alternate===null&&t(D,ae),M=i(Ba,M,xe),Ne===null?re=Ba:Ne.sibling=Ba,Ne=Ba,ae=ye}if(Se.done)return a(D,ae),be&&It(D,xe),re;if(ae===null){for(;!Se.done;xe++,Se=k.next())Se=G(D,Se.value,Y),Se!==null&&(M=i(Se,M,xe),Ne===null?re=Se:Ne.sibling=Se,Ne=Se);return be&&It(D,xe),re}for(ae=n(ae);!Se.done;xe++,Se=k.next())Se=B(ae,D,xe,Se.value,Y),Se!==null&&(e&&Se.alternate!==null&&ae.delete(Se.key===null?xe:Se.key),M=i(Se,M,xe),Ne===null?re=Se:Ne.sibling=Se,Ne=Se);return e&&ae.forEach(function(jg){return t(D,jg)}),be&&It(D,xe),re}function De(D,M,k,Y){if(typeof k=="object"&&k!==null&&k.type===A&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case _:e:{for(var re=k.key;M!==null;){if(M.key===re){if(re=k.type,re===A){if(M.tag===7){a(D,M.sibling),Y=s(M,k.props.children),Y.return=D,D=Y;break e}}else if(M.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===J&&el(re)===M.type){a(D,M.sibling),Y=s(M,k.props),bn(Y,k),Y.return=D,D=Y;break e}a(D,M);break}else t(D,M);M=M.sibling}k.type===A?(Y=Ja(k.props.children,D.mode,Y,k.key),Y.return=D,D=Y):(Y=Cs(k.type,k.key,k.props,null,D.mode,Y),bn(Y,k),Y.return=D,D=Y)}return f(D);case z:e:{for(re=k.key;M!==null;){if(M.key===re)if(M.tag===4&&M.stateNode.containerInfo===k.containerInfo&&M.stateNode.implementation===k.implementation){a(D,M.sibling),Y=s(M,k.children||[]),Y.return=D,D=Y;break e}else{a(D,M);break}else t(D,M);M=M.sibling}Y=vi(k,D.mode,Y),Y.return=D,D=Y}return f(D);case J:return k=el(k),De(D,M,k,Y)}if(V(k))return I(D,M,k,Y);if(se(k)){if(re=se(k),typeof re!="function")throw Error(c(150));return k=re.call(k),ce(D,M,k,Y)}if(typeof k.then=="function")return De(D,M,zs(k),Y);if(k.$$typeof===O)return De(D,M,Rs(D,k),Y);Os(D,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,M!==null&&M.tag===6?(a(D,M.sibling),Y=s(M,k),Y.return=D,D=Y):(a(D,M),Y=yi(k,D.mode,Y),Y.return=D,D=Y),f(D)):a(D,M)}return function(D,M,k,Y){try{vn=0;var re=De(D,M,k,Y);return Rl=null,re}catch(ae){if(ae===Al||ae===Ds)throw ae;var Ne=vt(29,ae,null,D.mode);return Ne.lanes=Y,Ne.return=D,Ne}}}var al=Ku(!0),Ju=Ku(!1),Na=!1;function Di(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _i(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(we&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Es(e),_u(e,null,a),t}return ws(e,n,t,a),Es(e)}function jn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,$o(e,a)}}function zi(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=f:i=i.next=f,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Oi=!1;function Nn(){if(Oi){var e=Tl;if(e!==null)throw e}}function Sn(e,t,a,n){Oi=!1;var s=e.updateQueue;Na=!1;var i=s.firstBaseUpdate,f=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var E=g,L=E.next;E.next=null,f===null?i=L:f.next=L,f=E;var $=e.alternate;$!==null&&($=$.updateQueue,g=$.lastBaseUpdate,g!==f&&(g===null?$.firstBaseUpdate=L:g.next=L,$.lastBaseUpdate=E))}if(i!==null){var G=s.baseState;f=0,$=L=E=null,g=i;do{var U=g.lane&-536870913,B=U!==g.lane;if(B?(pe&U)===U:(n&U)===U){U!==0&&U===Cl&&(Oi=!0),$!==null&&($=$.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var I=e,ce=g;U=t;var De=a;switch(ce.tag){case 1:if(I=ce.payload,typeof I=="function"){G=I.call(De,G,U);break e}G=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ce.payload,U=typeof I=="function"?I.call(De,G,U):I,U==null)break e;G=y({},G,U);break e;case 2:Na=!0}}U=g.callback,U!==null&&(e.flags|=64,B&&(e.flags|=8192),B=s.callbacks,B===null?s.callbacks=[U]:B.push(U))}else B={lane:U,tag:g.tag,payload:g.payload,callback:g.callback,next:null},$===null?(L=$=B,E=G):$=$.next=B,f|=U;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;B=g,g=B.next,B.next=null,s.lastBaseUpdate=B,s.shared.pending=null}}while(!0);$===null&&(E=G),s.baseState=E,s.firstBaseUpdate=L,s.lastBaseUpdate=$,i===null&&(s.shared.lanes=0),Ra|=f,e.lanes=f,e.memoizedState=G}}function Wu(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Fu(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Wu(a[e],t)}var Ml=S(null),ks=S(0);function Pu(e,t){e=ua,Z(ks,e),Z(Ml,t),ua=e|t.baseLanes}function ki(){Z(ks,ua),Z(Ml,Ml.current)}function Li(){ua=ks.current,q(Ml),q(ks)}var bt=S(null),_t=null;function Ea(e){var t=e.alternate;Z(Ye,Ye.current&1),Z(bt,e),_t===null&&(t===null||Ml.current!==null||t.memoizedState!==null)&&(_t=e)}function Ui(e){Z(Ye,Ye.current),Z(bt,e),_t===null&&(_t=e)}function Iu(e){e.tag===22?(Z(Ye,Ye.current),Z(bt,e),_t===null&&(_t=e)):Ca()}function Ca(){Z(Ye,Ye.current),Z(bt,bt.current)}function jt(e){q(bt),_t===e&&(_t=null),q(Ye)}var Ye=S(0);function Ls(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Gc(a)||Vc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var aa=0,fe=null,Re=null,Xe=null,Us=!1,Dl=!1,ll=!1,Hs=0,wn=0,_l=null,dh=0;function Be(){throw Error(c(321))}function Hi(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!yt(e[a],t[a]))return!1;return!0}function Bi(e,t,a,n,s,i){return aa=i,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?Ld:ec,ll=!1,i=a(n,s),ll=!1,Dl&&(i=td(t,a,n,s)),ed(e),i}function ed(e){R.H=Tn;var t=Re!==null&&Re.next!==null;if(aa=0,Xe=Re=fe=null,Us=!1,wn=0,_l=null,t)throw Error(c(300));e===null||Ze||(e=e.dependencies,e!==null&&As(e)&&(Ze=!0))}function td(e,t,a,n){fe=e;var s=0;do{if(Dl&&(_l=null),wn=0,Dl=!1,25<=s)throw Error(c(301));if(s+=1,Xe=Re=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}R.H=Ud,i=t(a,n)}while(Dl);return i}function fh(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?En(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(fe.flags|=1024),t}function $i(){var e=Hs!==0;return Hs=0,e}function qi(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Yi(e){if(Us){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Us=!1}aa=0,Xe=Re=fe=null,Dl=!1,wn=Hs=0,_l=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?fe.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ge(){if(Re===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Xe===null?fe.memoizedState:Xe.next;if(t!==null)Xe=t,Re=e;else{if(e===null)throw fe.alternate===null?Error(c(467)):Error(c(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Xe===null?fe.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Bs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function En(e){var t=wn;return wn+=1,_l===null&&(_l=[]),e=Qu(_l,e,t),t=fe,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?Ld:ec),e}function $s(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return En(e);if(e.$$typeof===O)return lt(e)}throw Error(c(438,String(e)))}function Gi(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=fe.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Bs(),fe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=F;return t.index++,a}function la(e,t){return typeof t=="function"?t(e):t}function qs(e){var t=Ge();return Vi(t,Re,e)}function Vi(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var f=s.next;s.next=i.next,i.next=f}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var g=f=null,E=null,L=t,$=!1;do{var G=L.lane&-536870913;if(G!==L.lane?(pe&G)===G:(aa&G)===G){var U=L.revertLane;if(U===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),G===Cl&&($=!0);else if((aa&U)===U){L=L.next,U===Cl&&($=!0);continue}else G={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(g=E=G,f=i):E=E.next=G,fe.lanes|=U,Ra|=U;G=L.action,ll&&a(i,G),i=L.hasEagerState?L.eagerState:a(i,G)}else U={lane:G,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},E===null?(g=E=U,f=i):E=E.next=U,fe.lanes|=G,Ra|=G;L=L.next}while(L!==null&&L!==t);if(E===null?f=i:E.next=g,!yt(i,e.memoizedState)&&(Ze=!0,$&&(a=Tl,a!==null)))throw a;e.memoizedState=i,e.baseState=f,e.baseQueue=E,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Qi(e){var t=Ge(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,i=t.memoizedState;if(s!==null){a.pending=null;var f=s=s.next;do i=e(i,f.action),f=f.next;while(f!==s);yt(i,t.memoizedState)||(Ze=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function ad(e,t,a){var n=fe,s=Ge(),i=be;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var f=!yt((Re||s).memoizedState,a);if(f&&(s.memoizedState=a,Ze=!0),s=s.queue,Ki(sd.bind(null,n,s,e),[e]),s.getSnapshot!==t||f||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,zl(9,{destroy:void 0},nd.bind(null,n,s,a,t),null),_e===null)throw Error(c(349));i||(aa&127)!==0||ld(n,t,a)}return a}function ld(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=Bs(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function nd(e,t,a,n){t.value=a,t.getSnapshot=n,rd(t)&&id(e)}function sd(e,t,a){return a(function(){rd(t)&&id(e)})}function rd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!yt(e,a)}catch{return!0}}function id(e){var t=Ka(e,2);t!==null&&mt(t,e,2)}function Xi(e){var t=it();if(typeof e=="function"){var a=e;if(e=a(),ll){ha(!0);try{a()}finally{ha(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},t}function cd(e,t,a,n){return e.baseState=a,Vi(e,Re,typeof n=="function"?n:la)}function xh(e,t,a,n,s){if(Vs(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){i.listeners.push(f)}};R.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,od(t,i)):(i.next=a.next,t.pending=a.next=i)}}function od(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=R.T,f={};R.T=f;try{var g=a(s,n),E=R.S;E!==null&&E(f,g),ud(e,t,g)}catch(L){Zi(e,t,L)}finally{i!==null&&f.types!==null&&(i.types=f.types),R.T=i}}else try{i=a(s,n),ud(e,t,i)}catch(L){Zi(e,t,L)}}function ud(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){dd(e,t,n)},function(n){return Zi(e,t,n)}):dd(e,t,a)}function dd(e,t,a){t.status="fulfilled",t.value=a,fd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,od(e,a)))}function Zi(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,fd(t),t=t.next;while(t!==n)}e.action=null}function fd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xd(e,t){return t}function md(e,t){if(be){var a=_e.formState;if(a!==null){e:{var n=fe;if(be){if(Oe){t:{for(var s=Oe,i=Dt;s.nodeType!==8;){if(!i){s=null;break t}if(s=zt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){Oe=zt(s.nextSibling),n=s.data==="F!";break e}}ba(n)}n=!1}n&&(t=a[0])}}return a=it(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xd,lastRenderedState:t},a.queue=n,a=zd.bind(null,fe,n),n.dispatch=a,n=Xi(!1),i=Ii.bind(null,fe,!1,n.queue),n=it(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=xh.bind(null,fe,s,i,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function hd(e){var t=Ge();return gd(t,Re,e)}function gd(e,t,a){if(t=Vi(e,t,xd)[0],e=qs(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=En(t)}catch(f){throw f===Al?Ds:f}else n=t;t=Ge();var s=t.queue,i=s.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,zl(9,{destroy:void 0},mh.bind(null,s,a),null)),[n,i,e]}function mh(e,t){e.action=t}function pd(e){var t=Ge(),a=Re;if(a!==null)return gd(t,a,e);Ge(),t=t.memoizedState,a=Ge();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=fe.updateQueue,t===null&&(t=Bs(),fe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function yd(){return Ge().memoizedState}function Ys(e,t,a,n){var s=it();fe.flags|=e,s.memoizedState=zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Gs(e,t,a,n){var s=Ge();n=n===void 0?null:n;var i=s.memoizedState.inst;Re!==null&&n!==null&&Hi(n,Re.memoizedState.deps)?s.memoizedState=zl(t,i,a,n):(fe.flags|=e,s.memoizedState=zl(1|t,i,a,n))}function vd(e,t){Ys(8390656,8,e,t)}function Ki(e,t){Gs(2048,8,e,t)}function hh(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=Bs(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function bd(e){var t=Ge().memoizedState;return hh({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function jd(e,t){return Gs(4,2,e,t)}function Nd(e,t){return Gs(4,4,e,t)}function Sd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wd(e,t,a){a=a!=null?a.concat([e]):null,Gs(4,4,Sd.bind(null,t,e),a)}function Ji(){}function Ed(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Hi(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Cd(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Hi(t,n[1]))return n[0];if(n=e(),ll){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n}function Wi(e,t,a){return a===void 0||(aa&1073741824)!==0&&(pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Af(),fe.lanes|=e,Ra|=e,a)}function Td(e,t,a,n){return yt(a,t)?a:Ml.current!==null?(e=Wi(e,a,n),yt(e,t)||(Ze=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(pe&261930)===0?(Ze=!0,e.memoizedState=a):(e=Af(),fe.lanes|=e,Ra|=e,t)}function Ad(e,t,a,n,s){var i=Q.p;Q.p=i!==0&&8>i?i:8;var f=R.T,g={};R.T=g,Ii(e,!1,t,a);try{var E=s(),L=R.S;if(L!==null&&L(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var $=uh(E,n);Cn(e,t,$,wt(e))}else Cn(e,t,n,wt(e))}catch(G){Cn(e,t,{then:function(){},status:"rejected",reason:G},wt())}finally{Q.p=i,f!==null&&g.types!==null&&(f.types=g.types),R.T=f}}function gh(){}function Fi(e,t,a,n){if(e.tag!==5)throw Error(c(476));var s=Rd(e).queue;Ad(e,s,t,ne,a===null?gh:function(){return Md(e),a(n)})}function Rd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Md(e){var t=Rd(e);t.next===null&&(t=e.alternate.memoizedState),Cn(e,t.next.queue,{},wt())}function Pi(){return lt(Gn)}function Dd(){return Ge().memoizedState}function _d(){return Ge().memoizedState}function ph(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=wt();e=Sa(a);var n=wa(t,e,a);n!==null&&(mt(n,t,a),jn(n,t,a)),t={cache:Ti()},e.payload=t;return}t=t.return}}function yh(e,t,a){var n=wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Od(t,a):(a=gi(e,t,a,n),a!==null&&(mt(a,e,n),kd(a,t,n)))}function zd(e,t,a){var n=wt();Cn(e,t,a,n)}function Cn(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Od(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var f=t.lastRenderedState,g=i(f,a);if(s.hasEagerState=!0,s.eagerState=g,yt(g,f))return ws(e,t,s,0),_e===null&&Ss(),!1}catch{}if(a=gi(e,t,s,n),a!==null)return mt(a,e,n),kd(a,t,n),!0}return!1}function Ii(e,t,a,n){if(n={lane:2,revertLane:Dc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(c(479))}else t=gi(e,a,n,2),t!==null&&mt(t,e,2)}function Vs(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function Od(e,t){Dl=Us=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,$o(e,a)}}var Tn={readContext:lt,use:$s,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useLayoutEffect:Be,useInsertionEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useSyncExternalStore:Be,useId:Be,useHostTransitionStatus:Be,useFormState:Be,useActionState:Be,useOptimistic:Be,useMemoCache:Be,useCacheRefresh:Be};Tn.useEffectEvent=Be;var Ld={readContext:lt,use:$s,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:vd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ys(4194308,4,Sd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ys(4194308,4,e,t)},useInsertionEffect:function(e,t){Ys(4,2,e,t)},useMemo:function(e,t){var a=it();t=t===void 0?null:t;var n=e();if(ll){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=it();if(a!==void 0){var s=a(t);if(ll){ha(!0);try{a(t)}finally{ha(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=yh.bind(null,fe,e),[n.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Xi(e);var t=e.queue,a=zd.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ji,useDeferredValue:function(e,t){var a=it();return Wi(a,e,t)},useTransition:function(){var e=Xi(!1);return e=Ad.bind(null,fe,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=fe,s=it();if(be){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),_e===null)throw Error(c(349));(pe&127)!==0||ld(n,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,vd(sd.bind(null,n,i,e),[e]),n.flags|=2048,zl(9,{destroy:void 0},nd.bind(null,n,i,a,t),null),a},useId:function(){var e=it(),t=_e.identifierPrefix;if(be){var a=Qt,n=Vt;a=(n&~(1<<32-pt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Hs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=dh++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Pi,useFormState:md,useActionState:md,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ii.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Gi,useCacheRefresh:function(){return it().memoizedState=ph.bind(null,fe)},useEffectEvent:function(e){var t=it(),a={impl:e};return t.memoizedState=a,function(){if((we&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},ec={readContext:lt,use:$s,useCallback:Ed,useContext:lt,useEffect:Ki,useImperativeHandle:wd,useInsertionEffect:jd,useLayoutEffect:Nd,useMemo:Cd,useReducer:qs,useRef:yd,useState:function(){return qs(la)},useDebugValue:Ji,useDeferredValue:function(e,t){var a=Ge();return Td(a,Re.memoizedState,e,t)},useTransition:function(){var e=qs(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:En(e),t]},useSyncExternalStore:ad,useId:Dd,useHostTransitionStatus:Pi,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var a=Ge();return cd(a,Re,e,t)},useMemoCache:Gi,useCacheRefresh:_d};ec.useEffectEvent=bd;var Ud={readContext:lt,use:$s,useCallback:Ed,useContext:lt,useEffect:Ki,useImperativeHandle:wd,useInsertionEffect:jd,useLayoutEffect:Nd,useMemo:Cd,useReducer:Qi,useRef:yd,useState:function(){return Qi(la)},useDebugValue:Ji,useDeferredValue:function(e,t){var a=Ge();return Re===null?Wi(a,e,t):Td(a,Re.memoizedState,e,t)},useTransition:function(){var e=Qi(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:En(e),t]},useSyncExternalStore:ad,useId:Dd,useHostTransitionStatus:Pi,useFormState:pd,useActionState:pd,useOptimistic:function(e,t){var a=Ge();return Re!==null?cd(a,Re,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Gi,useCacheRefresh:_d};Ud.useEffectEvent=bd;function tc(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ac={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=wt(),s=Sa(n);s.payload=t,a!=null&&(s.callback=a),t=wa(e,s,n),t!==null&&(mt(t,e,n),jn(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=wt(),s=Sa(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=wa(e,s,n),t!==null&&(mt(t,e,n),jn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=wt(),n=Sa(a);n.tag=2,t!=null&&(n.callback=t),t=wa(e,n,a),t!==null&&(mt(t,e,a),jn(t,e,a))}};function Hd(e,t,a,n,s,i,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,f):t.prototype&&t.prototype.isPureReactComponent?!xn(a,n)||!xn(s,i):!0}function Bd(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&ac.enqueueReplaceState(t,t.state,null)}function nl(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function $d(e){Ns(e)}function qd(e){console.error(e)}function Yd(e){Ns(e)}function Qs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Gd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function lc(e,t,a){return a=Sa(a),a.tag=3,a.payload={element:null},a.callback=function(){Qs(e,t)},a}function Vd(e){return e=Sa(e),e.tag=3,e}function Qd(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){Gd(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Gd(t,a,n),typeof s!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var g=n.stack;this.componentDidCatch(n.value,{componentStack:g!==null?g:""})})}function vh(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&El(t,a,s,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return _t===null?lr():a.alternate===null&&$e===0&&($e=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===_s?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Ac(e,n,s)),!1;case 22:return a.flags|=65536,n===_s?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),Ac(e,n,s)),!1}throw Error(c(435,a.tag))}return Ac(e,n,s),lr(),!1}if(be)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==Ni&&(e=Error(c(422),{cause:n}),gn(At(e,a)))):(n!==Ni&&(t=Error(c(423),{cause:n}),gn(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=At(n,a),s=lc(e.stateNode,n,s),zi(e,s),$e!==4&&($e=2)),!1;var i=Error(c(520),{cause:n});if(i=At(i,a),kn===null?kn=[i]:kn.push(i),$e!==4&&($e=2),t===null)return!0;n=At(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=lc(a.stateNode,n,e),zi(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ma===null||!Ma.has(i))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Vd(s),Qd(s,e,a,n),zi(a,s),!1}a=a.return}while(a!==null);return!1}var nc=Error(c(461)),Ze=!1;function nt(e,t,a,n){t.child=e===null?Ju(t,null,a,n):al(t,e.child,a,n)}function Xd(e,t,a,n,s){a=a.render;var i=t.ref;if("ref"in n){var f={};for(var g in n)g!=="ref"&&(f[g]=n[g])}else f=n;return Pa(t),n=Bi(e,t,a,f,i,s),g=$i(),e!==null&&!Ze?(qi(e,t,s),na(e,t,s)):(be&&g&&bi(t),t.flags|=1,nt(e,t,n,s),t.child)}function Zd(e,t,a,n,s){if(e===null){var i=a.type;return typeof i=="function"&&!pi(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Kd(e,t,i,n,s)):(e=Cs(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!fc(e,s)){var f=i.memoizedProps;if(a=a.compare,a=a!==null?a:xn,a(f,n)&&e.ref===t.ref)return na(e,t,s)}return t.flags|=1,e=Pt(i,n),e.ref=t.ref,e.return=t,t.child=e}function Kd(e,t,a,n,s){if(e!==null){var i=e.memoizedProps;if(xn(i,n)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=n=i,fc(e,s))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,na(e,t,s)}return sc(e,t,a,n,s)}function Jd(e,t,a,n){var s=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~i}else n=0,t.child=null;return Wd(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ms(t,i!==null?i.cachePool:null),i!==null?Pu(t,i):ki(),Iu(t);else return n=t.lanes=536870912,Wd(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Ms(t,i.cachePool),Pu(t,i),Ca(),t.memoizedState=null):(e!==null&&Ms(t,null),ki(),Ca());return nt(e,t,s,a),t.child}function An(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wd(e,t,a,n,s){var i=Ri();return i=i===null?null:{parent:Qe._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ms(t,null),ki(),Iu(t),e!==null&&El(e,t,n,!0),t.childLanes=s,null}function Xs(e,t){return t=Ks({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fd(e,t,a){return al(t,e.child,null,a),e=Xs(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function bh(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(be){if(n.mode==="hidden")return e=Xs(t,n),t.lanes=536870912,An(null,e);if(Ui(t),(e=Oe)?(e=u0(e,Dt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},a=Ou(e),a.return=t,t.child=a,at=t,Oe=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Xs(t,n)}var i=e.memoizedState;if(i!==null){var f=i.dehydrated;if(Ui(t),s)if(t.flags&256)t.flags&=-257,t=Fd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ze||El(e,t,a,!1),s=(a&e.childLanes)!==0,Ze||s){if(n=_e,n!==null&&(f=qo(n,a),f!==0&&f!==i.retryLane))throw i.retryLane=f,Ka(e,f),mt(n,e,f),nc;lr(),t=Fd(e,t,a)}else e=i.treeContext,Oe=zt(f.nextSibling),at=t,be=!0,va=null,Dt=!1,e!==null&&Uu(t,e),t=Xs(t,n),t.flags|=4096;return t}return e=Pt(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function sc(e,t,a,n,s){return Pa(t),a=Bi(e,t,a,n,void 0,s),n=$i(),e!==null&&!Ze?(qi(e,t,s),na(e,t,s)):(be&&n&&bi(t),t.flags|=1,nt(e,t,a,s),t.child)}function Pd(e,t,a,n,s,i){return Pa(t),t.updateQueue=null,a=td(t,n,a,s),ed(e),n=$i(),e!==null&&!Ze?(qi(e,t,i),na(e,t,i)):(be&&n&&bi(t),t.flags|=1,nt(e,t,a,i),t.child)}function Id(e,t,a,n,s){if(Pa(t),t.stateNode===null){var i=jl,f=a.contextType;typeof f=="object"&&f!==null&&(i=lt(f)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=ac,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Di(t),f=a.contextType,i.context=typeof f=="object"&&f!==null?lt(f):jl,i.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(tc(t,a,f,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(f=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),f!==i.state&&ac.enqueueReplaceState(i,i.state,null),Sn(t,n,i,s),Nn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var g=t.memoizedProps,E=nl(a,g);i.props=E;var L=i.context,$=a.contextType;f=jl,typeof $=="object"&&$!==null&&(f=lt($));var G=a.getDerivedStateFromProps;$=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,$||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(g||L!==f)&&Bd(t,i,n,f),Na=!1;var U=t.memoizedState;i.state=U,Sn(t,n,i,s),Nn(),L=t.memoizedState,g||U!==L||Na?(typeof G=="function"&&(tc(t,a,G,n),L=t.memoizedState),(E=Na||Hd(t,a,E,n,U,L,f))?($||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=L),i.props=n,i.state=L,i.context=f,n=E):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,_i(e,t),f=t.memoizedProps,$=nl(a,f),i.props=$,G=t.pendingProps,U=i.context,L=a.contextType,E=jl,typeof L=="object"&&L!==null&&(E=lt(L)),g=a.getDerivedStateFromProps,(L=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f!==G||U!==E)&&Bd(t,i,n,E),Na=!1,U=t.memoizedState,i.state=U,Sn(t,n,i,s),Nn();var B=t.memoizedState;f!==G||U!==B||Na||e!==null&&e.dependencies!==null&&As(e.dependencies)?(typeof g=="function"&&(tc(t,a,g,n),B=t.memoizedState),($=Na||Hd(t,a,$,n,U,B,E)||e!==null&&e.dependencies!==null&&As(e.dependencies))?(L||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,B,E),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,B,E)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=B),i.props=n,i.state=B,i.context=E,n=$):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Zs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=al(t,e.child,null,s),t.child=al(t,null,a,s)):nt(e,t,a,s),t.memoizedState=i.state,e=t.child):e=na(e,t,s),e}function ef(e,t,a,n){return Wa(),t.flags|=256,nt(e,t,a,n),t.child}var rc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ic(e){return{baseLanes:e,cachePool:Gu()}}function cc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=St),e}function tf(e,t,a){var n=t.pendingProps,s=!1,i=(t.flags&128)!==0,f;if((f=i)||(f=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(be){if(s?Ea(t):Ca(),(e=Oe)?(e=u0(e,Dt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},a=Ou(e),a.return=t,t.child=a,at=t,Oe=null)):e=null,e===null)throw ba(t);return Vc(e)?t.lanes=32:t.lanes=536870912,null}var g=n.children;return n=n.fallback,s?(Ca(),s=t.mode,g=Ks({mode:"hidden",children:g},s),n=Ja(n,s,a,null),g.return=t,n.return=t,g.sibling=n,t.child=g,n=t.child,n.memoizedState=ic(a),n.childLanes=cc(e,f,a),t.memoizedState=rc,An(null,n)):(Ea(t),oc(t,g))}var E=e.memoizedState;if(E!==null&&(g=E.dehydrated,g!==null)){if(i)t.flags&256?(Ea(t),t.flags&=-257,t=uc(e,t,a)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),g=n.fallback,s=t.mode,n=Ks({mode:"visible",children:n.children},s),g=Ja(g,s,a,null),g.flags|=2,n.return=t,g.return=t,n.sibling=g,t.child=n,al(t,e.child,null,a),n=t.child,n.memoizedState=ic(a),n.childLanes=cc(e,f,a),t.memoizedState=rc,t=An(null,n));else if(Ea(t),Vc(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var L=f.dgst;f=L,n=Error(c(419)),n.stack="",n.digest=f,gn({value:n,source:null,stack:null}),t=uc(e,t,a)}else if(Ze||El(e,t,a,!1),f=(a&e.childLanes)!==0,Ze||f){if(f=_e,f!==null&&(n=qo(f,a),n!==0&&n!==E.retryLane))throw E.retryLane=n,Ka(e,n),mt(f,e,n),nc;Gc(g)||lr(),t=uc(e,t,a)}else Gc(g)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,Oe=zt(g.nextSibling),at=t,be=!0,va=null,Dt=!1,e!==null&&Uu(t,e),t=oc(t,n.children),t.flags|=4096);return t}return s?(Ca(),g=n.fallback,s=t.mode,E=e.child,L=E.sibling,n=Pt(E,{mode:"hidden",children:n.children}),n.subtreeFlags=E.subtreeFlags&65011712,L!==null?g=Pt(L,g):(g=Ja(g,s,a,null),g.flags|=2),g.return=t,n.return=t,n.sibling=g,t.child=n,An(null,n),n=t.child,g=e.child.memoizedState,g===null?g=ic(a):(s=g.cachePool,s!==null?(E=Qe._currentValue,s=s.parent!==E?{parent:E,pool:E}:s):s=Gu(),g={baseLanes:g.baseLanes|a,cachePool:s}),n.memoizedState=g,n.childLanes=cc(e,f,a),t.memoizedState=rc,An(e.child,n)):(Ea(t),a=e.child,e=a.sibling,a=Pt(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function oc(e,t){return t=Ks({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ks(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function uc(e,t,a){return al(t,e.child,null,a),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function af(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Ei(e.return,t,a)}function dc(e,t,a,n,s,i){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:i}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=s,f.treeForkCount=i)}function lf(e,t,a){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var f=Ye.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,Z(Ye,f),nt(e,t,n,a),n=be?hn:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&af(e,a,t);else if(e.tag===19)af(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&Ls(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),dc(t,!1,s,a,i,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ls(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}dc(t,!0,a,null,i,n);break;case"together":dc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function na(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(El(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Pt(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Pt(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function fc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&As(e)))}function jh(e,t,a){switch(t.tag){case 3:Je(t,t.stateNode.containerInfo),ja(t,Qe,e.memoizedState.cache),Wa();break;case 27:case 5:Il(t);break;case 4:Je(t,t.stateNode.containerInfo);break;case 10:ja(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ui(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ea(t),t.flags|=128,null):(a&t.child.childLanes)!==0?tf(e,t,a):(Ea(t),e=na(e,t,a),e!==null?e.sibling:null);Ea(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(El(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return lf(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Z(Ye,Ye.current),n)break;return null;case 22:return t.lanes=0,Jd(e,t,a,t.pendingProps);case 24:ja(t,Qe,e.memoizedState.cache)}return na(e,t,a)}function nf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!fc(e,a)&&(t.flags&128)===0)return Ze=!1,jh(e,t,a);Ze=(e.flags&131072)!==0}else Ze=!1,be&&(t.flags&1048576)!==0&&Lu(t,hn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=el(t.elementType),t.type=e,typeof e=="function")pi(e)?(n=nl(e,n),t.tag=1,t=Id(null,t,e,n,a)):(t.tag=0,t=sc(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===W){t.tag=11,t=Xd(null,t,e,n,a);break e}else if(s===K){t.tag=14,t=Zd(null,t,e,n,a);break e}}throw t=Ae(e)||e,Error(c(306,t,""))}}return t;case 0:return sc(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=nl(n,t.pendingProps),Id(e,t,n,s,a);case 3:e:{if(Je(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,_i(e,t),Sn(t,n,null,a);var f=t.memoizedState;if(n=f.cache,ja(t,Qe,n),n!==i.cache&&Ci(t,[Qe],a,!0),Nn(),n=f.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=ef(e,t,n,a);break e}else if(n!==s){s=At(Error(c(424)),t),gn(s),t=ef(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Oe=zt(e.firstChild),at=t,be=!0,va=null,Dt=!0,a=Ju(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Wa(),n===s){t=na(e,t,a);break e}nt(e,t,n,a)}t=t.child}return t;case 26:return Zs(e,t),e===null?(a=g0(t.type,null,t.pendingProps,null))?t.memoizedState=a:be||(a=t.type,e=t.pendingProps,n=ur(me.current).createElement(a),n[tt]=t,n[ct]=e,st(n,a,e),Pe(n),t.stateNode=n):t.memoizedState=g0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Il(t),e===null&&be&&(n=t.stateNode=x0(t.type,t.pendingProps,me.current),at=t,Dt=!0,s=Oe,Oa(t.type)?(Qc=s,Oe=zt(n.firstChild)):Oe=s),nt(e,t,t.pendingProps.children,a),Zs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&be&&((s=n=Oe)&&(n=Fh(n,t.type,t.pendingProps,Dt),n!==null?(t.stateNode=n,at=t,Oe=zt(n.firstChild),Dt=!1,s=!0):s=!1),s||ba(t)),Il(t),s=t.type,i=t.pendingProps,f=e!==null?e.memoizedProps:null,n=i.children,$c(s,i)?n=null:f!==null&&$c(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Bi(e,t,fh,null,null,a),Gn._currentValue=s),Zs(e,t),nt(e,t,n,a),t.child;case 6:return e===null&&be&&((e=a=Oe)&&(a=Ph(a,t.pendingProps,Dt),a!==null?(t.stateNode=a,at=t,Oe=null,e=!0):e=!1),e||ba(t)),null;case 13:return tf(e,t,a);case 4:return Je(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=al(t,null,n,a):nt(e,t,n,a),t.child;case 11:return Xd(e,t,t.type,t.pendingProps,a);case 7:return nt(e,t,t.pendingProps,a),t.child;case 8:return nt(e,t,t.pendingProps.children,a),t.child;case 12:return nt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ja(t,t.type,n.value),nt(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,Pa(t),s=lt(s),n=n(s),t.flags|=1,nt(e,t,n,a),t.child;case 14:return Zd(e,t,t.type,t.pendingProps,a);case 15:return Kd(e,t,t.type,t.pendingProps,a);case 19:return lf(e,t,a);case 31:return bh(e,t,a);case 22:return Jd(e,t,a,t.pendingProps);case 24:return Pa(t),n=lt(Qe),e===null?(s=Ri(),s===null&&(s=_e,i=Ti(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=a),s=i),t.memoizedState={parent:n,cache:s},Di(t),ja(t,Qe,s)):((e.lanes&a)!==0&&(_i(e,t),Sn(t,null,null,a),Nn()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ja(t,Qe,n)):(n=i.cache,ja(t,Qe,n),n!==s.cache&&Ci(t,[Qe],a,!0))),nt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function sa(e){e.flags|=4}function xc(e,t,a,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(_f())e.flags|=8192;else throw tl=_s,Mi}else e.flags&=-16777217}function sf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!j0(t))if(_f())e.flags|=8192;else throw tl=_s,Mi}function Js(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ho():536870912,e.lanes|=t,Ul|=t)}function Rn(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ke(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function Nh(e,t,a){var n=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ke(t),null;case 1:return ke(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(Qe),qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(wl(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Si())),ke(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(sa(t),i!==null?(ke(t),sf(t,i)):(ke(t),xc(t,s,null,n,a))):i?i!==e.memoizedState?(sa(t),ke(t),sf(t,i)):(ke(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&sa(t),ke(t),xc(t,s,e,n,a)),null;case 27:if(rs(t),a=me.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return ke(t),null}e=ee.current,wl(t)?Hu(t):(e=x0(s,n,a),t.stateNode=e,sa(t))}return ke(t),null;case 5:if(rs(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return ke(t),null}if(i=ee.current,wl(t))Hu(t);else{var f=ur(me.current);switch(i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?f.createElement(s,{is:n.is}):f.createElement(s)}}i[tt]=t,i[ct]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=i;e:switch(st(i,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&sa(t)}}return ke(t),xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=me.current,wl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=at,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[tt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||a0(e.nodeValue,a)),e||ba(t,!0)}else e=ur(e).createTextNode(n),e[tt]=t,t.stateNode=e}return ke(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=wl(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[tt]=t}else Wa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ke(t),e=!1}else a=Si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return ke(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=wl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(317));s[tt]=t}else Wa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ke(t),s=!1}else s=Si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Js(t,t.updateQueue),ke(t),null);case 4:return qe(),e===null&&kc(t.stateNode.containerInfo),ke(t),null;case 10:return ta(t.type),ke(t),null;case 19:if(q(Ye),n=t.memoizedState,n===null)return ke(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Rn(n,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ls(e),i!==null){for(t.flags|=128,Rn(n,!1),e=i.updateQueue,t.updateQueue=e,Js(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)zu(a,e),a=a.sibling;return Z(Ye,Ye.current&1|2),be&&It(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ht()>er&&(t.flags|=128,s=!0,Rn(n,!1),t.lanes=4194304)}else{if(!s)if(e=Ls(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Js(t,e),Rn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!be)return ke(t),null}else 2*ht()-n.renderingStartTime>er&&a!==536870912&&(t.flags|=128,s=!0,Rn(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ht(),e.sibling=null,a=Ye.current,Z(Ye,s?a&1|2:a&1),be&&It(t,n.treeForkCount),e):(ke(t),null);case 22:case 23:return jt(t),Li(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(ke(t),t.subtreeFlags&6&&(t.flags|=8192)):ke(t),a=t.updateQueue,a!==null&&Js(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&q(Ia),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ta(Qe),ke(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Sh(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(Qe),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rs(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));Wa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Wa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return qe(),null;case 10:return ta(t.type),null;case 22:case 23:return jt(t),Li(),e!==null&&q(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(Qe),null;case 25:return null;default:return null}}function rf(e,t){switch(ji(t),t.tag){case 3:ta(Qe),qe();break;case 26:case 27:case 5:rs(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:q(Ye);break;case 10:ta(t.type);break;case 22:case 23:jt(t),Li(),e!==null&&q(Ia);break;case 24:ta(Qe)}}function Mn(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){n=void 0;var i=a.create,f=a.inst;n=i(),f.destroy=n}a=a.next}while(a!==s)}}catch(g){Ce(t,t.return,g)}}function Ta(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var f=n.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,s=t;var E=a,L=g;try{L()}catch($){Ce(s,E,$)}}}n=n.next}while(n!==i)}}catch($){Ce(t,t.return,$)}}function cf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Fu(t,a)}catch(n){Ce(e,e.return,n)}}}function of(e,t,a){a.props=nl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ce(e,t,n)}}function Dn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(s){Ce(e,t,s)}}function Xt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){Ce(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Ce(e,t,s)}else a.current=null}function uf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(s){Ce(e,e.return,s)}}function mc(e,t,a){try{var n=e.stateNode;Qh(n,e.type,a,t),n[ct]=t}catch(s){Ce(e,e.return,s)}}function df(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||df(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Oa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Wt));else if(n!==4&&(n===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function Ws(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ws(e,t,a),e=e.sibling;e!==null;)Ws(e,t,a),e=e.sibling}function ff(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);st(t,n,a),t[tt]=e,t[ct]=a}catch(i){Ce(e,e.return,i)}}var ra=!1,Ke=!1,pc=!1,xf=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function wh(e,t){if(e=e.containerInfo,Hc=pr,e=wu(e),ui(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var f=0,g=-1,E=-1,L=0,$=0,G=e,U=null;t:for(;;){for(var B;G!==a||s!==0&&G.nodeType!==3||(g=f+s),G!==i||n!==0&&G.nodeType!==3||(E=f+n),G.nodeType===3&&(f+=G.nodeValue.length),(B=G.firstChild)!==null;)U=G,G=B;for(;;){if(G===e)break t;if(U===a&&++L===s&&(g=f),U===i&&++$===n&&(E=f),(B=G.nextSibling)!==null)break;G=U,U=G.parentNode}G=B}a=g===-1||E===-1?null:{start:g,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Bc={focusedElem:e,selectionRange:a},pr=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){switch(t=Ie,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,s=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var I=nl(a.type,s);e=n.getSnapshotBeforeUpdate(I,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(ce){Ce(a,a.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Yc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Yc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Ie=e;break}Ie=t.return}}function mf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a),n&4&&Mn(5,a);break;case 1:if(ca(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){Ce(a,a.return,f)}else{var s=nl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ce(a,a.return,f)}}n&64&&cf(a),n&512&&Dn(a,a.return);break;case 3:if(ca(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Fu(e,t)}catch(f){Ce(a,a.return,f)}}break;case 27:t===null&&n&4&&ff(a);case 26:case 5:ca(e,a),t===null&&n&4&&uf(a),n&512&&Dn(a,a.return);break;case 12:ca(e,a);break;case 31:ca(e,a),n&4&&pf(e,a);break;case 13:ca(e,a),n&4&&yf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=zh.bind(null,a),Ih(e,a))));break;case 22:if(n=a.memoizedState!==null||ra,!n){t=t!==null&&t.memoizedState!==null||Ke,s=ra;var i=Ke;ra=n,(Ke=t)&&!i?oa(e,a,(a.subtreeFlags&8772)!==0):ca(e,a),ra=s,Ke=i}break;case 30:break;default:ca(e,a)}}function hf(e){var t=e.alternate;t!==null&&(e.alternate=null,hf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Zr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ue=null,ut=!1;function ia(e,t,a){for(a=a.child;a!==null;)gf(e,t,a),a=a.sibling}function gf(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(en,a)}catch{}switch(a.tag){case 26:Ke||Xt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ke||Xt(a,t);var n=Ue,s=ut;Oa(a.type)&&(Ue=a.stateNode,ut=!1),ia(e,t,a),$n(a.stateNode),Ue=n,ut=s;break;case 5:Ke||Xt(a,t);case 6:if(n=Ue,s=ut,Ue=null,ia(e,t,a),Ue=n,ut=s,Ue!==null)if(ut)try{(Ue.nodeType===9?Ue.body:Ue.nodeName==="HTML"?Ue.ownerDocument.body:Ue).removeChild(a.stateNode)}catch(i){Ce(a,t,i)}else try{Ue.removeChild(a.stateNode)}catch(i){Ce(a,t,i)}break;case 18:Ue!==null&&(ut?(e=Ue,c0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ql(e)):c0(Ue,a.stateNode));break;case 4:n=Ue,s=ut,Ue=a.stateNode.containerInfo,ut=!0,ia(e,t,a),Ue=n,ut=s;break;case 0:case 11:case 14:case 15:Ta(2,a,t),Ke||Ta(4,a,t),ia(e,t,a);break;case 1:Ke||(Xt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&of(a,t,n)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:Ke=(n=Ke)||a.memoizedState!==null,ia(e,t,a),Ke=n;break;default:ia(e,t,a)}}function pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ql(e)}catch(a){Ce(t,t.return,a)}}}function yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ql(e)}catch(a){Ce(t,t.return,a)}}function Eh(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xf),t;default:throw Error(c(435,e.tag))}}function Fs(e,t){var a=Eh(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Oh.bind(null,e,n);n.then(s,s)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],i=e,f=t,g=f;e:for(;g!==null;){switch(g.tag){case 27:if(Oa(g.type)){Ue=g.stateNode,ut=!1;break e}break;case 5:Ue=g.stateNode,ut=!1;break e;case 3:case 4:Ue=g.stateNode.containerInfo,ut=!0;break e}g=g.return}if(Ue===null)throw Error(c(160));gf(i,f,s),Ue=null,ut=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vf(t,e),t=t.sibling}var Ht=null;function vf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),ft(e),n&4&&(Ta(3,e,e.return),Mn(3,e),Ta(5,e,e.return));break;case 1:dt(t,e),ft(e),n&512&&(Ke||a===null||Xt(a,a.return)),n&64&&ra&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var s=Ht;if(dt(t,e),ft(e),n&512&&(Ke||a===null||Xt(a,a.return)),n&4){var i=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":i=s.getElementsByTagName("title")[0],(!i||i[ln]||i[tt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),st(i,n,a),i[tt]=e,Pe(i),n=i;break e;case"link":var f=v0("link","href",s).get(n+(a.href||""));if(f){for(var g=0;g<f.length;g++)if(i=f[g],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(g,1);break t}}i=s.createElement(n),st(i,n,a),s.head.appendChild(i);break;case"meta":if(f=v0("meta","content",s).get(n+(a.content||""))){for(g=0;g<f.length;g++)if(i=f[g],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(g,1);break t}}i=s.createElement(n),st(i,n,a),s.head.appendChild(i);break;default:throw Error(c(468,n))}i[tt]=e,Pe(i),n=i}e.stateNode=n}else b0(s,e.type,e.stateNode);else e.stateNode=y0(s,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?b0(s,e.type,e.stateNode):y0(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&mc(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),ft(e),n&512&&(Ke||a===null||Xt(a,a.return)),a!==null&&n&4&&mc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),ft(e),n&512&&(Ke||a===null||Xt(a,a.return)),e.flags&32){s=e.stateNode;try{ml(s,"")}catch(I){Ce(e,e.return,I)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,mc(e,s,a!==null?a.memoizedProps:s)),n&1024&&(pc=!0);break;case 6:if(dt(t,e),ft(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(I){Ce(e,e.return,I)}}break;case 3:if(xr=null,s=Ht,Ht=dr(t.containerInfo),dt(t,e),Ht=s,ft(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Ql(t.containerInfo)}catch(I){Ce(e,e.return,I)}pc&&(pc=!1,bf(e));break;case 4:n=Ht,Ht=dr(e.stateNode.containerInfo),dt(t,e),ft(e),Ht=n;break;case 12:dt(t,e),ft(e);break;case 31:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 13:dt(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Is=ht()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 22:s=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,L=ra,$=Ke;if(ra=L||s,Ke=$||E,dt(t,e),Ke=$,ra=L,ft(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||E||ra||Ke||sl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(i=E.stateNode,s)f=i.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=E.stateNode;var G=E.memoizedProps.style,U=G!=null&&G.hasOwnProperty("display")?G.display:null;g.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(I){Ce(E,E.return,I)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=s?"":E.memoizedProps}catch(I){Ce(E,E.return,I)}}}else if(t.tag===18){if(a===null){E=t;try{var B=E.stateNode;s?o0(B,!0):o0(E.stateNode,!1)}catch(I){Ce(E,E.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Fs(e,a))));break;case 19:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Fs(e,n)));break;case 30:break;case 21:break;default:dt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(df(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var s=a.stateNode,i=hc(e);Ws(e,i,s);break;case 5:var f=a.stateNode;a.flags&32&&(ml(f,""),a.flags&=-33);var g=hc(e);Ws(e,g,f);break;case 3:case 4:var E=a.stateNode.containerInfo,L=hc(e);gc(e,L,E);break;default:throw Error(c(161))}}catch($){Ce(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mf(e,t.alternate,t),t=t.sibling}function sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ta(4,t,t.return),sl(t);break;case 1:Xt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&of(t,t.return,a),sl(t);break;case 27:$n(t.stateNode);case 26:case 5:Xt(t,t.return),sl(t);break;case 22:t.memoizedState===null&&sl(t);break;case 30:sl(t);break;default:sl(t)}e=e.sibling}}function oa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,i=t,f=i.flags;switch(i.tag){case 0:case 11:case 15:oa(s,i,a),Mn(4,i);break;case 1:if(oa(s,i,a),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(L){Ce(n,n.return,L)}if(n=i,s=n.updateQueue,s!==null){var g=n.stateNode;try{var E=s.shared.hiddenCallbacks;if(E!==null)for(s.shared.hiddenCallbacks=null,s=0;s<E.length;s++)Wu(E[s],g)}catch(L){Ce(n,n.return,L)}}a&&f&64&&cf(i),Dn(i,i.return);break;case 27:ff(i);case 26:case 5:oa(s,i,a),a&&n===null&&f&4&&uf(i),Dn(i,i.return);break;case 12:oa(s,i,a);break;case 31:oa(s,i,a),a&&f&4&&pf(s,i);break;case 13:oa(s,i,a),a&&f&4&&yf(s,i);break;case 22:i.memoizedState===null&&oa(s,i,a),Dn(i,i.return);break;case 30:break;default:oa(s,i,a)}t=t.sibling}}function yc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&pn(a))}function vc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pn(e))}function Bt(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jf(e,t,a,n),t=t.sibling}function jf(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,a,n),s&2048&&Mn(9,t);break;case 1:Bt(e,t,a,n);break;case 3:Bt(e,t,a,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pn(e)));break;case 12:if(s&2048){Bt(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,f=i.id,g=i.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Ce(t,t.return,E)}}else Bt(e,t,a,n);break;case 31:Bt(e,t,a,n);break;case 13:Bt(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,f=t.alternate,t.memoizedState!==null?i._visibility&2?Bt(e,t,a,n):_n(e,t):i._visibility&2?Bt(e,t,a,n):(i._visibility|=2,Ol(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&yc(f,t);break;case 24:Bt(e,t,a,n),s&2048&&vc(t.alternate,t);break;default:Bt(e,t,a,n)}}function Ol(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,f=t,g=a,E=n,L=f.flags;switch(f.tag){case 0:case 11:case 15:Ol(i,f,g,E,s),Mn(8,f);break;case 23:break;case 22:var $=f.stateNode;f.memoizedState!==null?$._visibility&2?Ol(i,f,g,E,s):_n(i,f):($._visibility|=2,Ol(i,f,g,E,s)),s&&L&2048&&yc(f.alternate,f);break;case 24:Ol(i,f,g,E,s),s&&L&2048&&vc(f.alternate,f);break;default:Ol(i,f,g,E,s)}t=t.sibling}}function _n(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,s=n.flags;switch(n.tag){case 22:_n(a,n),s&2048&&yc(n.alternate,n);break;case 24:_n(a,n),s&2048&&vc(n.alternate,n);break;default:_n(a,n)}t=t.sibling}}var zn=8192;function kl(e,t,a){if(e.subtreeFlags&zn)for(e=e.child;e!==null;)Nf(e,t,a),e=e.sibling}function Nf(e,t,a){switch(e.tag){case 26:kl(e,t,a),e.flags&zn&&e.memoizedState!==null&&dg(a,Ht,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,a);break;case 3:case 4:var n=Ht;Ht=dr(e.stateNode.containerInfo),kl(e,t,a),Ht=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=zn,zn=16777216,kl(e,t,a),zn=n):kl(e,t,a));break;default:kl(e,t,a)}}function Sf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function On(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ie=n,Ef(n,e)}Sf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wf(e),e=e.sibling}function wf(e){switch(e.tag){case 0:case 11:case 15:On(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:On(e);break;case 12:On(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ps(e)):On(e);break;default:On(e)}}function Ps(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ie=n,Ef(n,e)}Sf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ta(8,t,t.return),Ps(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ps(t));break;default:Ps(t)}e=e.sibling}}function Ef(e,t){for(;Ie!==null;){var a=Ie;switch(a.tag){case 0:case 11:case 15:Ta(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:pn(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Ie=n;else e:for(a=e;Ie!==null;){n=Ie;var s=n.sibling,i=n.return;if(hf(n),n===a){Ie=null;break e}if(s!==null){s.return=i,Ie=s;break e}Ie=i}}}var Ch={getCacheForType:function(e){var t=lt(Qe),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return lt(Qe).controller.signal}},Th=typeof WeakMap=="function"?WeakMap:Map,we=0,_e=null,he=null,pe=0,Ee=0,Nt=null,Aa=!1,Ll=!1,bc=!1,ua=0,$e=0,Ra=0,rl=0,jc=0,St=0,Ul=0,kn=null,xt=null,Nc=!1,Is=0,Cf=0,er=1/0,tr=null,Ma=null,We=0,Da=null,Hl=null,da=0,Sc=0,wc=null,Tf=null,Ln=0,Ec=null;function wt(){return(we&2)!==0&&pe!==0?pe&-pe:R.T!==null?Dc():Yo()}function Af(){if(St===0)if((pe&536870912)===0||be){var e=os;os<<=1,(os&3932160)===0&&(os=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,a){(e===_e&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)&&(Bl(e,0),_a(e,pe,St,!1)),an(e,a),((we&2)===0||e!==_e)&&(e===_e&&((we&2)===0&&(rl|=a),$e===4&&_a(e,pe,St,!1)),Zt(e))}function Rf(e,t,a){if((we&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||tn(e,t),s=n?Mh(e,t):Tc(e,t,!0),i=n;do{if(s===0){Ll&&!n&&_a(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Ah(a)){s=Tc(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;s=kn;var E=g.current.memoizedState.isDehydrated;if(E&&(Bl(g,f).flags|=256),f=Tc(g,f,!1),f!==2){if(bc&&!E){g.errorRecoveryDisabledLanes|=i,rl|=i,s=4;break e}i=xt,xt=s,i!==null&&(xt===null?xt=i:xt.push.apply(xt,i))}s=f}if(i=!1,s!==2)continue}}if(s===1){Bl(e,0),_a(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:_a(n,t,St,!Aa);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(s=Is+300-ht(),10<s)){if(_a(n,t,St,!Aa),ds(n,0,!0)!==0)break e;da=t,n.timeoutHandle=r0(Mf.bind(null,n,a,xt,tr,Nc,t,St,rl,Ul,Aa,i,"Throttled",-0,0),s);break e}Mf(n,a,xt,tr,Nc,t,St,rl,Ul,Aa,i,null,-0,0)}}break}while(!0);Zt(e)}function Mf(e,t,a,n,s,i,f,g,E,L,$,G,U,B){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},Nf(t,i,G);var I=(i&62914560)===i?Is-ht():(i&4194048)===i?Cf-ht():0;if(I=fg(G,I),I!==null){da=i,e.cancelPendingCommit=I(Hf.bind(null,e,t,i,a,n,s,f,g,E,$,G,null,U,B)),_a(e,i,f,!L);return}}Hf(e,t,i,a,n,s,f,g,E)}function Ah(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var s=a[n],i=s.getSnapshot;s=s.value;try{if(!yt(i(),s))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 _a(e,t,a,n){t&=~jc,t&=~rl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-pt(s),f=1<<i;n[i]=-1,s&=~f}a!==0&&Bo(e,a,t)}function ar(){return(we&6)===0?(Un(0),!1):!0}function Cc(){if(he!==null){if(Ee===0)var e=he.return;else e=he,ea=Fa=null,Yi(e),Rl=null,vn=0,e=he;for(;e!==null;)rf(e.alternate,e),e=e.return;he=null}}function Bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Kh(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),da=0,Cc(),_e=e,he=a=Pt(e.current,null),pe=t,Ee=0,Nt=null,Aa=!1,Ll=tn(e,t),bc=!1,Ul=St=jc=rl=Ra=$e=0,xt=kn=null,Nc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-pt(n),i=1<<s;t|=e[s],n&=~i}return ua=t,Ss(),a}function Df(e,t){fe=null,R.H=Tn,t===Al||t===Ds?(t=Xu(),Ee=3):t===Mi?(t=Xu(),Ee=4):Ee=t===nc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,he===null&&($e=1,Qs(e,At(t,e.current)))}function _f(){var e=bt.current;return e===null?!0:(pe&4194048)===pe?_t===null:(pe&62914560)===pe||(pe&536870912)!==0?e===_t:!1}function zf(){var e=R.H;return R.H=Tn,e===null?Tn:e}function Of(){var e=R.A;return R.A=Ch,e}function lr(){$e=4,Aa||(pe&4194048)!==pe&&bt.current!==null||(Ll=!0),(Ra&134217727)===0&&(rl&134217727)===0||_e===null||_a(_e,pe,St,!1)}function Tc(e,t,a){var n=we;we|=2;var s=zf(),i=Of();(_e!==e||pe!==t)&&(tr=null,Bl(e,t)),t=!1;var f=$e;e:do try{if(Ee!==0&&he!==null){var g=he,E=Nt;switch(Ee){case 8:Cc(),f=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var L=Ee;if(Ee=0,Nt=null,$l(e,g,E,L),a&&Ll){f=0;break e}break;default:L=Ee,Ee=0,Nt=null,$l(e,g,E,L)}}Rh(),f=$e;break}catch($){Df(e,$)}while(!0);return t&&e.shellSuspendCounter++,ea=Fa=null,we=n,R.H=s,R.A=i,he===null&&(_e=null,pe=0,Ss()),f}function Rh(){for(;he!==null;)kf(he)}function Mh(e,t){var a=we;we|=2;var n=zf(),s=Of();_e!==e||pe!==t?(tr=null,er=ht()+500,Bl(e,t)):Ll=tn(e,t);e:do try{if(Ee!==0&&he!==null){t=he;var i=Nt;t:switch(Ee){case 1:Ee=0,Nt=null,$l(e,t,i,1);break;case 2:case 9:if(Vu(i)){Ee=0,Nt=null,Lf(t);break}t=function(){Ee!==2&&Ee!==9||_e!==e||(Ee=7),Zt(e)},i.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:Vu(i)?(Ee=0,Nt=null,Lf(t)):(Ee=0,Nt=null,$l(e,t,i,7));break;case 5:var f=null;switch(he.tag){case 26:f=he.memoizedState;case 5:case 27:var g=he;if(f?j0(f):g.stateNode.complete){Ee=0,Nt=null;var E=g.sibling;if(E!==null)he=E;else{var L=g.return;L!==null?(he=L,nr(L)):he=null}break t}}Ee=0,Nt=null,$l(e,t,i,5);break;case 6:Ee=0,Nt=null,$l(e,t,i,6);break;case 8:Cc(),$e=6;break e;default:throw Error(c(462))}}Dh();break}catch($){Df(e,$)}while(!0);return ea=Fa=null,R.H=n,R.A=s,we=a,he!==null?0:(_e=null,pe=0,Ss(),$e)}function Dh(){for(;he!==null&&!em();)kf(he)}function kf(e){var t=nf(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?nr(e):he=t}function Lf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Pd(a,t,t.pendingProps,t.type,void 0,pe);break;case 11:t=Pd(a,t,t.pendingProps,t.type.render,t.ref,pe);break;case 5:Yi(t);default:rf(a,t),t=he=zu(t,ua),t=nf(a,t,ua)}e.memoizedProps=e.pendingProps,t===null?nr(e):he=t}function $l(e,t,a,n){ea=Fa=null,Yi(t),Rl=null,vn=0;var s=t.return;try{if(vh(e,s,t,a,pe)){$e=1,Qs(e,At(a,e.current)),he=null;return}}catch(i){if(s!==null)throw he=s,i;$e=1,Qs(e,At(a,e.current)),he=null;return}t.flags&32768?(be||n===1?e=!0:Ll||(pe&536870912)!==0?e=!1:(Aa=e=!0,(n===2||n===9||n===3||n===6)&&(n=bt.current,n!==null&&n.tag===13&&(n.flags|=16384))),Uf(t,e)):nr(t)}function nr(e){var t=e;do{if((t.flags&32768)!==0){Uf(t,Aa);return}e=t.return;var a=Nh(t.alternate,t,ua);if(a!==null){he=a;return}if(t=t.sibling,t!==null){he=t;return}he=t=e}while(t!==null);$e===0&&($e=5)}function Uf(e,t){do{var a=Sh(e.alternate,e);if(a!==null){a.flags&=32767,he=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){he=e;return}he=e=a}while(e!==null);$e=6,he=null}function Hf(e,t,a,n,s,i,f,g,E){e.cancelPendingCommit=null;do sr();while(We!==0);if((we&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=hi,um(e,a,i,f,g,E),e===_e&&(he=_e=null,pe=0),Hl=t,Da=e,da=a,Sc=i,wc=s,Tf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,kh(is,function(){return Gf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=R.T,R.T=null,s=Q.p,Q.p=2,f=we,we|=4;try{wh(e,t,a)}finally{we=f,Q.p=s,R.T=n}}We=1,Bf(),$f(),qf()}}function Bf(){if(We===1){We=0;var e=Da,t=Hl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=R.T,R.T=null;var n=Q.p;Q.p=2;var s=we;we|=4;try{vf(t,e);var i=Bc,f=wu(e.containerInfo),g=i.focusedElem,E=i.selectionRange;if(f!==g&&g&&g.ownerDocument&&Su(g.ownerDocument.documentElement,g)){if(E!==null&&ui(g)){var L=E.start,$=E.end;if($===void 0&&($=L),"selectionStart"in g)g.selectionStart=L,g.selectionEnd=Math.min($,g.value.length);else{var G=g.ownerDocument||document,U=G&&G.defaultView||window;if(U.getSelection){var B=U.getSelection(),I=g.textContent.length,ce=Math.min(E.start,I),De=E.end===void 0?ce:Math.min(E.end,I);!B.extend&&ce>De&&(f=De,De=ce,ce=f);var D=Nu(g,ce),M=Nu(g,De);if(D&&M&&(B.rangeCount!==1||B.anchorNode!==D.node||B.anchorOffset!==D.offset||B.focusNode!==M.node||B.focusOffset!==M.offset)){var k=G.createRange();k.setStart(D.node,D.offset),B.removeAllRanges(),ce>De?(B.addRange(k),B.extend(M.node,M.offset)):(k.setEnd(M.node,M.offset),B.addRange(k))}}}}for(G=[],B=g;B=B.parentNode;)B.nodeType===1&&G.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<G.length;g++){var Y=G[g];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}pr=!!Hc,Bc=Hc=null}finally{we=s,Q.p=n,R.T=a}}e.current=t,We=2}}function $f(){if(We===2){We=0;var e=Da,t=Hl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=R.T,R.T=null;var n=Q.p;Q.p=2;var s=we;we|=4;try{mf(e,t.alternate,t)}finally{we=s,Q.p=n,R.T=a}}We=3}}function qf(){if(We===4||We===3){We=0,tm();var e=Da,t=Hl,a=da,n=Tf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?We=5:(We=0,Hl=Da=null,Yf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ma=null),Qr(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(en,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=R.T,s=Q.p,Q.p=2,R.T=null;try{for(var i=e.onRecoverableError,f=0;f<n.length;f++){var g=n[f];i(g.value,{componentStack:g.stack})}}finally{R.T=t,Q.p=s}}(da&3)!==0&&sr(),Zt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===Ec?Ln++:(Ln=0,Ec=e):Ln=0,Un(0)}}function Yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,pn(t)))}function sr(){return Bf(),$f(),qf(),Gf()}function Gf(){if(We!==5)return!1;var e=Da,t=Sc;Sc=0;var a=Qr(da),n=R.T,s=Q.p;try{Q.p=32>a?32:a,R.T=null,a=wc,wc=null;var i=Da,f=da;if(We=0,Hl=Da=null,da=0,(we&6)!==0)throw Error(c(331));var g=we;if(we|=4,wf(i.current),jf(i,i.current,f,a),we=g,Un(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(en,i)}catch{}return!0}finally{Q.p=s,R.T=n,Yf(e,t)}}function Vf(e,t,a){t=At(a,t),t=lc(e.stateNode,t,2),e=wa(e,t,2),e!==null&&(an(e,2),Zt(e))}function Ce(e,t,a){if(e.tag===3)Vf(e,e,a);else for(;t!==null;){if(t.tag===3){Vf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ma===null||!Ma.has(n))){e=At(a,e),a=Vd(2),n=wa(t,a,2),n!==null&&(Qd(a,n,t,e),an(n,2),Zt(n));break}}t=t.return}}function Ac(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Th;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(a)||(bc=!0,s.add(a),e=_h.bind(null,e,t,a),t.then(e,e))}function _h(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,_e===e&&(pe&a)===a&&($e===4||$e===3&&(pe&62914560)===pe&&300>ht()-Is?(we&2)===0&&Bl(e,0):jc|=a,Ul===pe&&(Ul=0)),Zt(e)}function Qf(e,t){t===0&&(t=Ho()),e=Ka(e,t),e!==null&&(an(e,t),Zt(e))}function zh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Qf(e,a)}function Oh(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),Qf(e,a)}function kh(e,t){return qr(e,t)}var rr=null,ql=null,Rc=!1,ir=!1,Mc=!1,za=0;function Zt(e){e!==ql&&e.next===null&&(ql===null?rr=ql=e:ql=ql.next=e),ir=!0,Rc||(Rc=!0,Uh())}function Un(e,t){if(!Mc&&ir){Mc=!0;do for(var a=!1,n=rr;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var f=n.suspendedLanes,g=n.pingedLanes;i=(1<<31-pt(42|e)+1)-1,i&=s&~(f&~g),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Jf(n,i))}else i=pe,i=ds(n,n===_e?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||tn(n,i)||(a=!0,Jf(n,i));n=n.next}while(a);Mc=!1}}function Lh(){Xf()}function Xf(){ir=Rc=!1;var e=0;za!==0&&Zh()&&(e=za);for(var t=ht(),a=null,n=rr;n!==null;){var s=n.next,i=Zf(n,t);i===0?(n.next=null,a===null?rr=s:a.next=s,s===null&&(ql=a)):(a=n,(e!==0||(i&3)!==0)&&(ir=!0)),n=s}We!==0&&We!==5||Un(e),za!==0&&(za=0)}function Zf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var f=31-pt(i),g=1<<f,E=s[f];E===-1?((g&a)===0||(g&n)!==0)&&(s[f]=om(g,t)):E<=t&&(e.expiredLanes|=g),i&=~g}if(t=_e,a=pe,a=ds(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Yr(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||tn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Yr(n),Qr(a)){case 2:case 8:a=Lo;break;case 32:a=is;break;case 268435456:a=Uo;break;default:a=is}return n=Kf.bind(null,e),a=qr(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Yr(n),e.callbackPriority=2,e.callbackNode=null,2}function Kf(e,t){if(We!==0&&We!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(sr()&&e.callbackNode!==a)return null;var n=pe;return n=ds(e,e===_e?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Rf(e,n,t),Zf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Kf.bind(null,e):null)}function Jf(e,t){if(sr())return null;Rf(e,t,!0)}function Uh(){Jh(function(){(we&6)!==0?qr(ko,Lh):Xf()})}function Dc(){if(za===0){var e=Cl;e===0&&(e=cs,cs<<=1,(cs&261888)===0&&(cs=256)),za=e}return za}function Wf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hs(""+e)}function Ff(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Hh(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var i=Wf((s[ct]||null).action),f=n.submitter;f&&(t=(t=f[ct]||null)?Wf(t.formAction):f.getAttribute("formAction"),t!==null&&(i=t,f=null));var g=new vs("action","action",null,n,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(za!==0){var E=f?Ff(s,f):new FormData(s);Fi(a,{pending:!0,data:E,method:s.method,action:i},null,E)}}else typeof i=="function"&&(g.preventDefault(),E=f?Ff(s,f):new FormData(s),Fi(a,{pending:!0,data:E,method:s.method,action:i},i,E))},currentTarget:s}]})}}for(var _c=0;_c<mi.length;_c++){var zc=mi[_c],Bh=zc.toLowerCase(),$h=zc[0].toUpperCase()+zc.slice(1);Ut(Bh,"on"+$h)}Ut(Tu,"onAnimationEnd"),Ut(Au,"onAnimationIteration"),Ut(Ru,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(ah,"onTransitionRun"),Ut(lh,"onTransitionStart"),Ut(nh,"onTransitionCancel"),Ut(Mu,"onTransitionEnd"),fl("onMouseEnter",["mouseout","mouseover"]),fl("onMouseLeave",["mouseout","mouseover"]),fl("onPointerEnter",["pointerout","pointerover"]),fl("onPointerLeave",["pointerout","pointerover"]),Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Va("onBeforeInput",["compositionend","keypress","textInput","paste"]),Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hn="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(" "),qh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hn));function Pf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var f=n.length-1;0<=f;f--){var g=n[f],E=g.instance,L=g.currentTarget;if(g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=L;try{i(s)}catch($){Ns($)}s.currentTarget=null,i=E}else for(f=0;f<n.length;f++){if(g=n[f],E=g.instance,L=g.currentTarget,g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=L;try{i(s)}catch($){Ns($)}s.currentTarget=null,i=E}}}}function ge(e,t){var a=t[Xr];a===void 0&&(a=t[Xr]=new Set);var n=e+"__bubble";a.has(n)||(If(t,e,2,!1),a.add(n))}function Oc(e,t,a){var n=0;t&&(n|=4),If(a,e,n,t)}var cr="_reactListening"+Math.random().toString(36).slice(2);function kc(e){if(!e[cr]){e[cr]=!0,Qo.forEach(function(a){a!=="selectionchange"&&(qh.has(a)||Oc(a,!1,e),Oc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cr]||(t[cr]=!0,Oc("selectionchange",!1,t))}}function If(e,t,a,n){switch(A0(t)){case 2:var s=hg;break;case 8:s=gg;break;default:s=Wc}a=s.bind(null,t,a,e),s=void 0,!ti||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function Lc(e,t,a,n,s){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var g=n.stateNode.containerInfo;if(g===s)break;if(f===4)for(f=n.return;f!==null;){var E=f.tag;if((E===3||E===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;g!==null;){if(f=ol(g),f===null)return;if(E=f.tag,E===5||E===6||E===26||E===27){n=i=f;continue e}g=g.parentNode}}n=n.return}lu(function(){var L=i,$=Ir(a),G=[];e:{var U=Du.get(e);if(U!==void 0){var B=vs,I=e;switch(e){case"keypress":if(ps(a)===0)break e;case"keydown":case"keyup":B=Om;break;case"focusin":I="focus",B=si;break;case"focusout":I="blur",B=si;break;case"beforeblur":case"afterblur":B=si;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Nm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Um;break;case Tu:case Au:case Ru:B=Em;break;case Mu:B=Bm;break;case"scroll":case"scrollend":B=bm;break;case"wheel":B=qm;break;case"copy":case"cut":case"paste":B=Tm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=cu;break;case"toggle":case"beforetoggle":B=Gm}var ce=(t&4)!==0,De=!ce&&(e==="scroll"||e==="scrollend"),D=ce?U!==null?U+"Capture":null:U;ce=[];for(var M=L,k;M!==null;){var Y=M;if(k=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||k===null||D===null||(Y=sn(M,D),Y!=null&&ce.push(Bn(M,Y,k))),De)break;M=M.return}0<ce.length&&(U=new B(U,I,null,a,$),G.push({event:U,listeners:ce}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",U&&a!==Pr&&(I=a.relatedTarget||a.fromElement)&&(ol(I)||I[cl]))break e;if((B||U)&&(U=$.window===$?$:(U=$.ownerDocument)?U.defaultView||U.parentWindow:window,B?(I=a.relatedTarget||a.toElement,B=L,I=I?ol(I):null,I!==null&&(De=x(I),ce=I.tag,I!==De||ce!==5&&ce!==27&&ce!==6)&&(I=null)):(B=null,I=L),B!==I)){if(ce=ru,Y="onMouseLeave",D="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ce=cu,Y="onPointerLeave",D="onPointerEnter",M="pointer"),De=B==null?U:nn(B),k=I==null?U:nn(I),U=new ce(Y,M+"leave",B,a,$),U.target=De,U.relatedTarget=k,Y=null,ol($)===L&&(ce=new ce(D,M+"enter",I,a,$),ce.target=k,ce.relatedTarget=De,Y=ce),De=Y,B&&I)t:{for(ce=Yh,D=B,M=I,k=0,Y=D;Y;Y=ce(Y))k++;Y=0;for(var re=M;re;re=ce(re))Y++;for(;0<k-Y;)D=ce(D),k--;for(;0<Y-k;)M=ce(M),Y--;for(;k--;){if(D===M||M!==null&&D===M.alternate){ce=D;break t}D=ce(D),M=ce(M)}ce=null}else ce=null;B!==null&&e0(G,U,B,ce,!1),I!==null&&De!==null&&e0(G,De,I,ce,!0)}}e:{if(U=L?nn(L):window,B=U.nodeName&&U.nodeName.toLowerCase(),B==="select"||B==="input"&&U.type==="file")var Ne=gu;else if(mu(U))if(pu)Ne=Im;else{Ne=Fm;var ae=Wm}else B=U.nodeName,!B||B.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?L&&Fr(L.elementType)&&(Ne=gu):Ne=Pm;if(Ne&&(Ne=Ne(e,L))){hu(G,Ne,a,$);break e}ae&&ae(e,U,L),e==="focusout"&&L&&U.type==="number"&&L.memoizedProps.value!=null&&Wr(U,"number",U.value)}switch(ae=L?nn(L):window,e){case"focusin":(mu(ae)||ae.contentEditable==="true")&&(yl=ae,di=L,mn=null);break;case"focusout":mn=di=yl=null;break;case"mousedown":fi=!0;break;case"contextmenu":case"mouseup":case"dragend":fi=!1,Eu(G,a,$);break;case"selectionchange":if(th)break;case"keydown":case"keyup":Eu(G,a,$)}var xe;if(ii)e:{switch(e){case"compositionstart":var ye="onCompositionStart";break e;case"compositionend":ye="onCompositionEnd";break e;case"compositionupdate":ye="onCompositionUpdate";break e}ye=void 0}else pl?fu(e,a)&&(ye="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ye="onCompositionStart");ye&&(ou&&a.locale!=="ko"&&(pl||ye!=="onCompositionStart"?ye==="onCompositionEnd"&&pl&&(xe=nu()):(pa=$,ai="value"in pa?pa.value:pa.textContent,pl=!0)),ae=or(L,ye),0<ae.length&&(ye=new iu(ye,e,null,a,$),G.push({event:ye,listeners:ae}),xe?ye.data=xe:(xe=xu(a),xe!==null&&(ye.data=xe)))),(xe=Qm?Xm(e,a):Zm(e,a))&&(ye=or(L,"onBeforeInput"),0<ye.length&&(ae=new iu("onBeforeInput","beforeinput",null,a,$),G.push({event:ae,listeners:ye}),ae.data=xe)),Hh(G,e,L,a,$)}Pf(G,t)})}function Bn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function or(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=sn(e,a),s!=null&&n.unshift(Bn(e,s,i)),s=sn(e,t),s!=null&&n.push(Bn(e,s,i))),e.tag===3)return n;e=e.return}return[]}function Yh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function e0(e,t,a,n,s){for(var i=t._reactName,f=[];a!==null&&a!==n;){var g=a,E=g.alternate,L=g.stateNode;if(g=g.tag,E!==null&&E===n)break;g!==5&&g!==26&&g!==27||L===null||(E=L,s?(L=sn(a,i),L!=null&&f.unshift(Bn(a,L,E))):s||(L=sn(a,i),L!=null&&f.push(Bn(a,L,E)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var Gh=/\r\n?/g,Vh=/\u0000|\uFFFD/g;function t0(e){return(typeof e=="string"?e:""+e).replace(Gh,`
|
|
9
|
+
`).replace(Vh,"")}function a0(e,t){return t=t0(t),t0(e)===t}function Me(e,t,a,n,s,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||ml(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&ml(e,""+n);break;case"className":xs(e,"class",n);break;case"tabIndex":xs(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(e,a,n);break;case"style":tu(e,n,i);break;case"data":if(t!=="object"){xs(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=hs(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&Me(e,t,"name",s.name,s,null),Me(e,t,"formEncType",s.formEncType,s,null),Me(e,t,"formMethod",s.formMethod,s,null),Me(e,t,"formTarget",s.formTarget,s,null)):(Me(e,t,"encType",s.encType,s,null),Me(e,t,"method",s.method,s,null),Me(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=hs(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"onScroll":n!=null&&ge("scroll",e);break;case"onScrollEnd":n!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=hs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":ge("beforetoggle",e),ge("toggle",e),fs(e,"popover",n);break;case"xlinkActuate":Jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Jt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Jt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Jt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Jt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":fs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ym.get(a)||a,fs(e,a,n))}}function Uc(e,t,a,n,s,i){switch(a){case"style":tu(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?ml(e,n):(typeof n=="number"||typeof n=="bigint")&&ml(e,""+n);break;case"onScroll":n!=null&&ge("scroll",e);break;case"onScrollEnd":n!=null&&ge("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xo.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),i=e[ct]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,s);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):fs(e,a,n)}}}function st(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var n=!1,s=!1,i;for(i in a)if(a.hasOwnProperty(i)){var f=a[i];if(f!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Me(e,t,i,f,a,null)}}s&&Me(e,t,"srcSet",a.srcSet,a,null),n&&Me(e,t,"src",a.src,a,null);return;case"input":ge("invalid",e);var g=i=f=s=null,E=null,L=null;for(n in a)if(a.hasOwnProperty(n)){var $=a[n];if($!=null)switch(n){case"name":s=$;break;case"type":f=$;break;case"checked":E=$;break;case"defaultChecked":L=$;break;case"value":i=$;break;case"defaultValue":g=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(c(137,t));break;default:Me(e,t,n,$,a,null)}}Fo(e,i,g,E,L,f,s,!1);return;case"select":ge("invalid",e),n=f=i=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":i=g;break;case"defaultValue":f=g;break;case"multiple":n=g;default:Me(e,t,s,g,a,null)}t=i,a=f,e.multiple=!!n,t!=null?xl(e,!!n,t,!1):a!=null&&xl(e,!!n,a,!0);return;case"textarea":ge("invalid",e),i=s=n=null;for(f in a)if(a.hasOwnProperty(f)&&(g=a[f],g!=null))switch(f){case"value":n=g;break;case"defaultValue":s=g;break;case"children":i=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Me(e,t,f,g,a,null)}Io(e,n,s,i);return;case"option":for(E in a)a.hasOwnProperty(E)&&(n=a[E],n!=null)&&(E==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Me(e,t,E,n,a,null));return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(n=0;n<Hn.length;n++)ge(Hn[n],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in a)if(a.hasOwnProperty(L)&&(n=a[L],n!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Me(e,t,L,n,a,null)}return;default:if(Fr(t)){for($ in a)a.hasOwnProperty($)&&(n=a[$],n!==void 0&&Uc(e,t,$,n,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(n=a[g],n!=null&&Me(e,t,g,n,a,null))}function Qh(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,i=null,f=null,g=null,E=null,L=null,$=null;for(B in a){var G=a[B];if(a.hasOwnProperty(B)&&G!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":E=G;default:n.hasOwnProperty(B)||Me(e,t,B,null,n,G)}}for(var U in n){var B=n[U];if(G=a[U],n.hasOwnProperty(U)&&(B!=null||G!=null))switch(U){case"type":i=B;break;case"name":s=B;break;case"checked":L=B;break;case"defaultChecked":$=B;break;case"value":f=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:B!==G&&Me(e,t,U,B,n,G)}}Jr(e,f,g,E,L,$,i,s);return;case"select":B=f=g=U=null;for(i in a)if(E=a[i],a.hasOwnProperty(i)&&E!=null)switch(i){case"value":break;case"multiple":B=E;default:n.hasOwnProperty(i)||Me(e,t,i,null,n,E)}for(s in n)if(i=n[s],E=a[s],n.hasOwnProperty(s)&&(i!=null||E!=null))switch(s){case"value":U=i;break;case"defaultValue":g=i;break;case"multiple":f=i;default:i!==E&&Me(e,t,s,i,n,E)}t=g,a=f,n=B,U!=null?xl(e,!!a,U,!1):!!n!=!!a&&(t!=null?xl(e,!!a,t,!0):xl(e,!!a,a?[]:"",!1));return;case"textarea":B=U=null;for(g in a)if(s=a[g],a.hasOwnProperty(g)&&s!=null&&!n.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Me(e,t,g,null,n,s)}for(f in n)if(s=n[f],i=a[f],n.hasOwnProperty(f)&&(s!=null||i!=null))switch(f){case"value":U=s;break;case"defaultValue":B=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==i&&Me(e,t,f,s,n,i)}Po(e,U,B);return;case"option":for(var I in a)U=a[I],a.hasOwnProperty(I)&&U!=null&&!n.hasOwnProperty(I)&&(I==="selected"?e.selected=!1:Me(e,t,I,null,n,U));for(E in n)U=n[E],B=a[E],n.hasOwnProperty(E)&&U!==B&&(U!=null||B!=null)&&(E==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":Me(e,t,E,U,n,B));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ce in a)U=a[ce],a.hasOwnProperty(ce)&&U!=null&&!n.hasOwnProperty(ce)&&Me(e,t,ce,null,n,U);for(L in n)if(U=n[L],B=a[L],n.hasOwnProperty(L)&&U!==B&&(U!=null||B!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:Me(e,t,L,U,n,B)}return;default:if(Fr(t)){for(var De in a)U=a[De],a.hasOwnProperty(De)&&U!==void 0&&!n.hasOwnProperty(De)&&Uc(e,t,De,void 0,n,U);for($ in n)U=n[$],B=a[$],!n.hasOwnProperty($)||U===B||U===void 0&&B===void 0||Uc(e,t,$,U,n,B);return}}for(var D in a)U=a[D],a.hasOwnProperty(D)&&U!=null&&!n.hasOwnProperty(D)&&Me(e,t,D,null,n,U);for(G in n)U=n[G],B=a[G],!n.hasOwnProperty(G)||U===B||U==null&&B==null||Me(e,t,G,U,n,B)}function l0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xh(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var s=a[n],i=s.transferSize,f=s.initiatorType,g=s.duration;if(i&&g&&l0(f)){for(f=0,g=s.responseEnd,n+=1;n<a.length;n++){var E=a[n],L=E.startTime;if(L>g)break;var $=E.transferSize,G=E.initiatorType;$&&l0(G)&&(E=E.responseEnd,f+=$*(E<g?1:(g-L)/(E-L)))}if(--n,t+=8*(i+f)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Hc=null,Bc=null;function ur(e){return e.nodeType===9?e:e.ownerDocument}function n0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function s0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function $c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qc=null;function Zh(){var e=window.event;return e&&e.type==="popstate"?e===qc?!1:(qc=e,!0):(qc=null,!1)}var r0=typeof setTimeout=="function"?setTimeout:void 0,Kh=typeof clearTimeout=="function"?clearTimeout:void 0,i0=typeof Promise=="function"?Promise:void 0,Jh=typeof queueMicrotask=="function"?queueMicrotask:typeof i0<"u"?function(e){return i0.resolve(null).then(e).catch(Wh)}:r0;function Wh(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function c0(e,t){var a=t,n=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(s),Ql(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")$n(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,$n(a);for(var i=a.firstChild;i;){var f=i.nextSibling,g=i.nodeName;i[ln]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=f}}else a==="body"&&$n(e.ownerDocument.body);a=s}while(a);Ql(t)}function o0(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Yc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Yc(a),Zr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Fh(e,t,a,n){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ln])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=zt(e.nextSibling),e===null)break}return null}function Ph(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=zt(e.nextSibling),e===null))return null;return e}function u0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=zt(e.nextSibling),e===null))return null;return e}function Gc(e){return e.data==="$?"||e.data==="$~"}function Vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ih(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function zt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Qc=null;function d0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return zt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function f0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function x0(e,t,a){switch(t=ur(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function $n(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Zr(e)}var Ot=new Map,m0=new Set;function dr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=Q.d;Q.d={f:eg,r:tg,D:ag,C:lg,L:ng,m:sg,X:ig,S:rg,M:cg};function eg(){var e=fa.f(),t=ar();return e||t}function tg(e){var t=ul(e);t!==null&&t.tag===5&&t.type==="form"?Md(t):fa.r(e)}var Yl=typeof document>"u"?null:document;function h0(e,t,a){var n=Yl;if(n&&typeof t=="string"&&t){var s=Ct(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),m0.has(s)||(m0.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),st(t,"link",e),Pe(t),n.head.appendChild(t)))}}function ag(e){fa.D(e),h0("dns-prefetch",e,null)}function lg(e,t){fa.C(e,t),h0("preconnect",e,t)}function ng(e,t,a){fa.L(e,t,a);var n=Yl;if(n&&e&&t){var s='link[rel="preload"][as="'+Ct(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+Ct(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+Ct(a.imageSizes)+'"]')):s+='[href="'+Ct(e)+'"]';var i=s;switch(t){case"style":i=Gl(e);break;case"script":i=Vl(e)}Ot.has(i)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ot.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(qn(i))||t==="script"&&n.querySelector(Yn(i))||(t=n.createElement("link"),st(t,"link",e),Pe(t),n.head.appendChild(t)))}}function sg(e,t){fa.m(e,t);var a=Yl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ct(n)+'"][href="'+Ct(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Vl(e)}if(!Ot.has(i)&&(e=y({rel:"modulepreload",href:e},t),Ot.set(i,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Yn(i)))return}n=a.createElement("link"),st(n,"link",e),Pe(n),a.head.appendChild(n)}}}function rg(e,t,a){fa.S(e,t,a);var n=Yl;if(n&&e){var s=dl(n).hoistableStyles,i=Gl(e);t=t||"default";var f=s.get(i);if(!f){var g={loading:0,preload:null};if(f=n.querySelector(qn(i)))g.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ot.get(i))&&Xc(e,a);var E=f=n.createElement("link");Pe(E),st(E,"link",e),E._p=new Promise(function(L,$){E.onload=L,E.onerror=$}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,fr(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:g},s.set(i,f)}}}function ig(e,t){fa.X(e,t);var a=Yl;if(a&&e){var n=dl(a).hoistableScripts,s=Vl(e),i=n.get(s);i||(i=a.querySelector(Yn(s)),i||(e=y({src:e,async:!0},t),(t=Ot.get(s))&&Zc(e,t),i=a.createElement("script"),Pe(i),st(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function cg(e,t){fa.M(e,t);var a=Yl;if(a&&e){var n=dl(a).hoistableScripts,s=Vl(e),i=n.get(s);i||(i=a.querySelector(Yn(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=Ot.get(s))&&Zc(e,t),i=a.createElement("script"),Pe(i),st(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function g0(e,t,a,n){var s=(s=me.current)?dr(s):null;if(!s)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Gl(a.href),a=dl(s).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Gl(a.href);var i=dl(s).hoistableStyles,f=i.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,f),(i=s.querySelector(qn(e)))&&!i._p&&(f.instance=i,f.state.loading=5),Ot.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ot.set(e,a),i||og(s,e,a,f.state))),t&&n===null)throw Error(c(528,""));return f}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Vl(a),a=dl(s).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Gl(e){return'href="'+Ct(e)+'"'}function qn(e){return'link[rel="stylesheet"]['+e+"]"}function p0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function og(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),st(t,"link",a),Pe(t),e.head.appendChild(t))}function Vl(e){return'[src="'+Ct(e)+'"]'}function Yn(e){return"script[async]"+e}function y0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Ct(a.href)+'"]');if(n)return t.instance=n,Pe(n),n;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Pe(n),st(n,"style",s),fr(n,a.precedence,e),t.instance=n;case"stylesheet":s=Gl(a.href);var i=e.querySelector(qn(s));if(i)return t.state.loading|=4,t.instance=i,Pe(i),i;n=p0(a),(s=Ot.get(s))&&Xc(n,s),i=(e.ownerDocument||e).createElement("link"),Pe(i);var f=i;return f._p=new Promise(function(g,E){f.onload=g,f.onerror=E}),st(i,"link",n),t.state.loading|=4,fr(i,a.precedence,e),t.instance=i;case"script":return i=Vl(a.src),(s=e.querySelector(Yn(i)))?(t.instance=s,Pe(s),s):(n=a,(s=Ot.get(i))&&(n=y({},a),Zc(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),Pe(s),st(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,fr(n,a.precedence,e));return t.instance}function fr(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,f=0;f<n.length;f++){var g=n[f];if(g.dataset.precedence===t)i=g;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xr=null;function v0(e,t,a){if(xr===null){var n=new Map,s=xr=new Map;s.set(a,n)}else s=xr,n=s.get(a),n||(n=new Map,s.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var i=a[s];if(!(i[ln]||i[tt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var f=i.getAttribute(t)||"";f=e+f;var g=n.get(f);g?g.push(i):n.set(f,[i])}}return n}function b0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function ug(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function j0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dg(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Gl(n.href),i=t.querySelector(qn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=mr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Pe(i);return}i=t.ownerDocument||t,n=p0(n),(s=Ot.get(s))&&Xc(n,s),i=i.createElement("link"),Pe(i);var f=i;f._p=new Promise(function(g,E){f.onload=g,f.onerror=E}),st(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=mr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Kc=0;function fg(e,t){return e.stylesheets&&e.count===0&&gr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Kc===0&&(Kc=62500*Xh());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Kc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function mr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hr=null;function gr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hr=new Map,t.forEach(xg,e),hr=null,mr.call(e))}function xg(e,t){if(!(t.state.loading&4)){var a=hr.get(e);if(a)var n=a.get(null);else{a=new Map,hr.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var f=s[i];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}s=t.instance,f=s.getAttribute("data-precedence"),i=a.get(f)||n,i===n&&a.set(null,s),a.set(f,s),this.count++,n=mr.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Gn={$$typeof:O,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function mg(e,t,a,n,s,i,f,g,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Gr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gr(0),this.hiddenUpdates=Gr(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function N0(e,t,a,n,s,i,f,g,E,L,$,G){return e=new mg(e,t,a,f,E,L,$,G,g),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=Ti(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},Di(i),e}function S0(e){return e?(e=jl,e):jl}function w0(e,t,a,n,s,i){s=S0(s),n.context===null?n.context=s:n.pendingContext=s,n=Sa(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=wa(e,n,t),a!==null&&(mt(a,e,t),jn(a,e,t))}function E0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Jc(e,t){E0(e,t),(e=e.alternate)&&E0(e,t)}function C0(e){if(e.tag===13||e.tag===31){var t=Ka(e,67108864);t!==null&&mt(t,e,67108864),Jc(e,67108864)}}function T0(e){if(e.tag===13||e.tag===31){var t=wt();t=Vr(t);var a=Ka(e,t);a!==null&&mt(a,e,t),Jc(e,t)}}var pr=!0;function hg(e,t,a,n){var s=R.T;R.T=null;var i=Q.p;try{Q.p=2,Wc(e,t,a,n)}finally{Q.p=i,R.T=s}}function gg(e,t,a,n){var s=R.T;R.T=null;var i=Q.p;try{Q.p=8,Wc(e,t,a,n)}finally{Q.p=i,R.T=s}}function Wc(e,t,a,n){if(pr){var s=Fc(n);if(s===null)Lc(e,t,n,yr,a),R0(e,n);else if(yg(s,e,t,a,n))n.stopPropagation();else if(R0(e,n),t&4&&-1<pg.indexOf(e)){for(;s!==null;){var i=ul(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var f=Ga(i.pendingLanes);if(f!==0){var g=i;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var E=1<<31-pt(f);g.entanglements[1]|=E,f&=~E}Zt(i),(we&6)===0&&(er=ht()+500,Un(0))}}break;case 31:case 13:g=Ka(i,2),g!==null&&mt(g,i,2),ar(),Jc(i,2)}if(i=Fc(n),i===null&&Lc(e,t,n,yr,a),i===s)break;s=i}s!==null&&n.stopPropagation()}else Lc(e,t,n,null,a)}}function Fc(e){return e=Ir(e),Pc(e)}var yr=null;function Pc(e){if(yr=null,e=ol(e),e!==null){var t=x(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=j(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yr=e,null}function A0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(am()){case ko:return 2;case Lo:return 8;case is:case lm:return 32;case Uo:return 268435456;default:return 32}default:return 32}}var Ic=!1,ka=null,La=null,Ua=null,Vn=new Map,Qn=new Map,Ha=[],pg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R0(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":Vn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qn.delete(t.pointerId)}}function Xn(e,t,a,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ul(t),t!==null&&C0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function yg(e,t,a,n,s){switch(t){case"focusin":return ka=Xn(ka,e,t,a,n,s),!0;case"dragenter":return La=Xn(La,e,t,a,n,s),!0;case"mouseover":return Ua=Xn(Ua,e,t,a,n,s),!0;case"pointerover":var i=s.pointerId;return Vn.set(i,Xn(Vn.get(i)||null,e,t,a,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Qn.set(i,Xn(Qn.get(i)||null,e,t,a,n,s)),!0}return!1}function M0(e){var t=ol(e.target);if(t!==null){var a=x(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,Go(e.priority,function(){T0(a)});return}}else if(t===31){if(t=j(a),t!==null){e.blockedOn=t,Go(e.priority,function(){T0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Fc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Pr=n,a.target.dispatchEvent(n),Pr=null}else return t=ul(a),t!==null&&C0(t),e.blockedOn=a,!1;t.shift()}return!0}function D0(e,t,a){vr(e)&&a.delete(t)}function vg(){Ic=!1,ka!==null&&vr(ka)&&(ka=null),La!==null&&vr(La)&&(La=null),Ua!==null&&vr(Ua)&&(Ua=null),Vn.forEach(D0),Qn.forEach(D0)}function br(e,t){e.blockedOn===t&&(e.blockedOn=null,Ic||(Ic=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,vg)))}var jr=null;function _0(e){jr!==e&&(jr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){jr===e&&(jr=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Pc(n||a)===null)continue;break}var i=ul(a);i!==null&&(e.splice(t,3),t-=3,Fi(i,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function Ql(e){function t(E){return br(E,e)}ka!==null&&br(ka,e),La!==null&&br(La,e),Ua!==null&&br(Ua,e),Vn.forEach(t),Qn.forEach(t);for(var a=0;a<Ha.length;a++){var n=Ha[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ha.length&&(a=Ha[0],a.blockedOn===null);)M0(a),a.blockedOn===null&&Ha.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],i=a[n+1],f=s[ct]||null;if(typeof i=="function")f||_0(a);else if(f){var g=null;if(i&&i.hasAttribute("formAction")){if(s=i,f=i[ct]||null)g=f.formAction;else if(Pc(s)!==null)continue}else g=f.action;typeof g=="function"?a[n+1]=g:(a.splice(n,3),n-=3),_0(a)}}}function z0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function eo(e){this._internalRoot=e}Nr.prototype.render=eo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=wt();w0(a,n,e,t,null,null)},Nr.prototype.unmount=eo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;w0(e.current,2,null,e,null,null),ar(),t[cl]=null}};function Nr(e){this._internalRoot=e}Nr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yo();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ha.length&&t!==0&&t<Ha[a].priority;a++);Ha.splice(a,0,e),a===0&&M0(e)}};var O0=u.version;if(O0!=="19.2.8")throw Error(c(527,O0,"19.2.8"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=h(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var bg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sr.isDisabled&&Sr.supportsFiber)try{en=Sr.inject(bg),gt=Sr}catch{}}return Kn.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",s=$d,i=qd,f=Yd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=N0(e,1,!1,null,null,a,n,null,s,i,f,z0),e[cl]=t.current,kc(e),new eo(t)},Kn.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,s="",i=$d,f=qd,g=Yd,E=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=N0(e,1,!0,t,a??null,n,s,E,i,f,g,z0),t.context=S0(null),a=t.current,n=wt(),n=Vr(n),s=Sa(n),s.callback=null,wa(a,s,n),a=n,t.current.lanes=a,an(t,a),Zt(t),e[cl]=t.current,kc(e),new Nr(t)},Kn.version="19.2.8",Kn}var V0;function Mg(){if(V0)return lo.exports;V0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(u){console.error(u)}}return r(),lo.exports=Rg(),lo.exports}var Dg=Mg();var jo=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,vx=/^[\\/]{2}/;function _g(r,u){return u+r.replace(/\\/g,"/")}var Q0="popstate";function X0(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function zg(r={}){function u(c,d){let x=d.state?.masked,{pathname:m,search:j,hash:p}=x||c.location;return ho("",{pathname:m,search:j,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",x?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function o(c,d){return typeof d=="string"?d:ts(d)}return kg(u,o,null,r)}function He(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function qt(r,u){if(!r){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function Og(){return Math.random().toString(36).substring(2,10)}function Z0(r,u){return{usr:r.state,key:r.key,idx:u,masked:r.mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function ho(r,u,o=null,c,d){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof u=="string"?Fl(u):u,state:o,key:u&&u.key||c||Og(),mask:d}}function ts({pathname:r="/",search:u="",hash:o=""}){return u&&u!=="?"&&(r+=u.charAt(0)==="?"?u:"?"+u),o&&o!=="#"&&(r+=o.charAt(0)==="#"?o:"#"+o),r}function Fl(r){let u={};if(r){let o=r.indexOf("#");o>=0&&(u.hash=r.substring(o),r=r.substring(0,o));let c=r.indexOf("?");c>=0&&(u.search=r.substring(c),r=r.substring(0,c)),r&&(u.pathname=r)}return u}function kg(r,u,o,c={}){let{window:d=document.defaultView,v5Compat:x=!1}=c,m=d.history,j="POP",p=null,h=N();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function N(){return(m.state||{idx:null}).idx}function y(){j="POP";let v=N(),w=v==null?null:v-h;h=v,p&&p({action:j,location:A.location,delta:w})}function C(v,w){j="PUSH";let T=X0(v)?v:ho(A.location,v,w);h=N()+1;let O=Z0(T,h),W=A.createHref(T.mask||T);try{m.pushState(O,"",W)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;d.location.assign(W)}x&&p&&p({action:j,location:A.location,delta:1})}function _(v,w){j="REPLACE";let T=X0(v)?v:ho(A.location,v,w);h=N();let O=Z0(T,h),W=A.createHref(T.mask||T);m.replaceState(O,"",W),x&&p&&p({action:j,location:A.location,delta:0})}function z(v){return Lg(d,v)}let A={get action(){return j},get location(){return r(d,m)},listen(v){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(Q0,y),p=v,()=>{d.removeEventListener(Q0,y),p=null}},createHref(v){return u(d,v)},createURL:z,encodeLocation(v){let w=z(v);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:C,replace:_,go(v){return m.go(v)}};return A}function Lg(r,u,o=!1){let c="http://localhost";r&&(c=r.location.origin!=="null"?r.location.origin:r.location.href),He(c,"No window.location.(origin|href) available to create URL");let d=typeof u=="string"?u:ts(u);return d=d.replace(/ $/,"%20"),!o&&vx.test(d)&&(d=c+d),new URL(d,c)}function bx(r,u,o="/"){return Ug(r,u,o,!1)}function Ug(r,u,o,c,d){let x=typeof u=="string"?Fl(u):u,m=ma(x.pathname||"/",o);if(m==null)return null;let j=Hg(r),p=null,h=Jg(m);for(let N=0;p==null&&N<j.length;++N)p=Kg(j[N],h,c);return p}function Hg(r){let u=jx(r);return Bg(u),u}function jx(r,u=[],o=[],c="",d=!1){let x=(m,j,p=d,h)=>{let N={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:j,route:m};if(N.relativePath.startsWith("/")){if(!N.relativePath.startsWith(c)&&p)return;He(N.relativePath.startsWith(c),`Absolute route path "${N.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),N.relativePath=N.relativePath.slice(c.length)}let y=$t([c,N.relativePath]),C=o.concat(N);m.children&&m.children.length>0&&(He(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),jx(m.children,u,C,y,p)),!(m.path==null&&!m.index)&&u.push({path:y,score:Xg(y,m.index),routesMeta:C.map((_,z)=>{let[A,v]=wx(_.relativePath,_.caseSensitive,z===C.length-1);return{..._,matcher:A,compiledParams:v}})})};return r.forEach((m,j)=>{if(m.path===""||!m.path?.includes("?"))x(m,j);else for(let p of Nx(m.path))x(m,j,!0,p)}),u}function Nx(r){let u=r.split("/");if(u.length===0)return[];let[o,...c]=u,d=o.endsWith("?"),x=o.replace(/\?$/,"");if(c.length===0)return d?[x,""]:[x];let m=Nx(c.join("/")),j=[];return j.push(...m.map(p=>p===""?x:[x,p].join("/"))),d&&j.push(...m),j.map(p=>r.startsWith("/")&&p===""?"/":p)}function Bg(r){r.sort((u,o)=>u.score!==o.score?o.score-u.score:Zg(u.routesMeta.map(c=>c.childrenIndex),o.routesMeta.map(c=>c.childrenIndex)))}var $g=/^:[\w-]+$/,qg=3,Yg=2,Gg=1,Vg=10,Qg=-2,K0=r=>r==="*";function Xg(r,u){let o=r.split("/"),c=o.length;return o.some(K0)&&(c+=Qg),u&&(c+=Yg),o.filter(d=>!K0(d)).reduce((d,x)=>d+($g.test(x)?qg:x===""?Gg:Vg),c)}function Zg(r,u){return r.length===u.length&&r.slice(0,-1).every((c,d)=>c===u[d])?r[r.length-1]-u[u.length-1]:0}function Kg(r,u,o=!1){let{routesMeta:c}=r,d={},x="/",m=[];for(let j=0;j<c.length;++j){let p=c[j],h=j===c.length-1,N=x==="/"?u:u.slice(x.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:h},C=p.matcher&&p.compiledParams?Sx(y,N,p.matcher,p.compiledParams):Rr(y,N),_=p.route;if(!C&&h&&o&&!c[c.length-1].route.index&&(C=Rr({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},N)),!C)return null;Object.assign(d,C.params),m.push({params:d,pathname:$t([x,C.pathname]),pathnameBase:Pg($t([x,C.pathnameBase])),route:_}),C.pathnameBase!=="/"&&(x=$t([x,C.pathnameBase]))}return m}function Rr(r,u){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[o,c]=wx(r.path,r.caseSensitive,r.end);return Sx(r,u,o,c)}function Sx(r,u,o,c){let d=u.match(o);if(!d)return null;let x=d[0],m=x.replace(/(.)\/+$/,"$1"),j=d.slice(1);return{params:c.reduce((h,{paramName:N,isOptional:y},C)=>{if(N==="*"){let z=j[C]||"";m=x.slice(0,x.length-z.length).replace(/(.)\/+$/,"$1")}const _=j[C];return y&&!_?h[N]=void 0:h[N]=(_||"").replace(/%2F/g,"/"),h},{}),pathname:x,pathnameBase:m,pattern:r}}function wx(r,u=!1,o=!0){qt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let c=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,j,p,h,N)=>{if(c.push({paramName:j,isOptional:p!=null}),p){let y=N.charAt(h+m.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,u?void 0:"i"),c]}function Jg(r){try{return r.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return qt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),r}}function ma(r,u){if(u==="/")return r;if(!r.toLowerCase().startsWith(u.toLowerCase()))return null;let o=u.endsWith("/")?u.length-1:u.length,c=r.charAt(o);return c&&c!=="/"?null:r.slice(o)||"/"}function Wg(r,u="/"){let{pathname:o,search:c="",hash:d=""}=typeof r=="string"?Fl(r):r,x;return o?(o=Cx(o),o.startsWith("/")?x=J0(o.substring(1),"/"):x=J0(o,u)):x=u,{pathname:x,search:Ig(c),hash:ep(d)}}function J0(r,u){let o=Mr(u).split("/");return r.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function io(r,u,o,c){return`Cannot include a '${r}' character in a manually specified \`to.${u}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Fg(r){return r.filter((u,o)=>o===0||u.route.path&&u.route.path.length>0)}function Ex(r){let u=Fg(r);return u.map((o,c)=>c===u.length-1?o.pathname:o.pathnameBase)}function No(r,u,o,c=!1){let d;typeof r=="string"?d=Fl(r):(d={...r},He(!d.pathname||!d.pathname.includes("?"),io("?","pathname","search",d)),He(!d.pathname||!d.pathname.includes("#"),io("#","pathname","hash",d)),He(!d.search||!d.search.includes("#"),io("#","search","hash",d)));let x=r===""||d.pathname==="",m=x?"/":d.pathname,j;if(m==null)j=o;else{let y=u.length-1;if(!c&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),y-=1;d.pathname=C.join("/")}j=y>=0?u[y]:"/"}let p=Wg(d,j),h=m&&m!=="/"&&m.endsWith("/"),N=(x||m===".")&&o.endsWith("/");return!p.pathname.endsWith("/")&&(h||N)&&(p.pathname+="/"),p}var Cx=r=>r.replace(/[\\/]{2,}/g,"/"),$t=r=>Cx(r.join("/")),Mr=r=>r.replace(/\/+$/,""),Pg=r=>Mr(r).replace(/^\/*/,"/"),Ig=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,ep=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,tp=class{constructor(r,u,o,c=!1){this.status=r,this.statusText=u||"",this.internal=c,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function ap(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function lp(r){let u=r.map(o=>o.route.path).filter(Boolean);return $t(u)||"/"}var Tx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ax(r,u){let o=r;if(typeof o!="string"||!jo.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let c=o,d=!1;if(Tx)try{let x=new URL(window.location.href),m=vx.test(o)?new URL(_g(o,x.protocol)):new URL(o),j=ma(m.pathname,u);m.origin===x.origin&&j!=null?o=j+m.search+m.hash:d=!0}catch{qt(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Rx=["POST","PUT","PATCH","DELETE"];new Set(Rx);var np=["GET",...Rx];new Set(np);var sp=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function rp(r){try{return sp.includes(new URL(r).protocol)}catch{return!1}}var Pl=b.createContext(null);Pl.displayName="DataRouter";var Dr=b.createContext(null);Dr.displayName="DataRouterState";var Mx=b.createContext(!1);function ip(){return b.useContext(Mx)}var Dx=b.createContext({isTransitioning:!1});Dx.displayName="ViewTransition";var cp=b.createContext(new Map);cp.displayName="Fetchers";var op=b.createContext(null);op.displayName="Await";var Lt=b.createContext(null);Lt.displayName="Navigation";var as=b.createContext(null);as.displayName="Location";var Kt=b.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var So=b.createContext(null);So.displayName="RouteError";var _x="REACT_ROUTER_ERROR",up="REDIRECT",dp="ROUTE_ERROR_RESPONSE";function fp(r){if(r.startsWith(`${_x}:${up}:{`))try{let u=JSON.parse(r.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function xp(r){if(r.startsWith(`${_x}:${dp}:{`))try{let u=JSON.parse(r.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new tp(u.status,u.statusText,u.data)}catch{}}function mp(r,{relative:u}={}){He(ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:c}=b.useContext(Lt),{hash:d,pathname:x,search:m}=ns(r,{relative:u}),j=x;return o!=="/"&&(j=x==="/"?o:$t([o,x])),c.createHref({pathname:j,search:m,hash:d})}function ls(){return b.useContext(as)!=null}function Yt(){return He(ls(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(as).location}var zx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ox(r){b.useContext(Lt).static||b.useLayoutEffect(r)}function wo(){let{isDataRoute:r}=b.useContext(Kt);return r?Ap():hp()}function hp(){He(ls(),"useNavigate() may be used only in the context of a <Router> component.");let r=b.useContext(Pl),{basename:u,navigator:o}=b.useContext(Lt),{matches:c}=b.useContext(Kt),{pathname:d}=Yt(),x=JSON.stringify(Ex(c)),m=b.useRef(!1);return Ox(()=>{m.current=!0}),b.useCallback((p,h={})=>{if(qt(m.current,zx),!m.current)return;if(typeof p=="number"){o.go(p);return}let N=No(p,JSON.parse(x),d,h.relative==="path");r==null&&u!=="/"&&(N.pathname=N.pathname==="/"?u:$t([u,N.pathname])),(h.replace?o.replace:o.push)(N,h.state,h)},[u,o,x,d,r])}b.createContext(null);function gp(){let{matches:r}=b.useContext(Kt);return r[r.length-1]?.params??{}}function ns(r,{relative:u}={}){let{matches:o}=b.useContext(Kt),{pathname:c}=Yt(),d=JSON.stringify(Ex(o));return b.useMemo(()=>No(r,JSON.parse(d),c,u==="path"),[r,d,c,u])}function pp(r,u){return kx(r,u)}function kx(r,u,o){He(ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=b.useContext(Lt),{matches:d}=b.useContext(Kt),x=d[d.length-1],m=x?x.params:{},j=x?x.pathname:"/",p=x?x.pathnameBase:"/",h=x&&x.route;{let v=h&&h.path||"";Ux(j,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${j}" (under <Route path="${v}">) 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.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let N=Yt(),y;if(u){let v=typeof u=="string"?Fl(u):u;He(p==="/"||v.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${v.pathname}" was given in the \`location\` prop.`),y=v}else y=N;let C=y.pathname||"/",_=C;if(p!=="/"){let v=p.replace(/^\//,"").split("/");_="/"+C.replace(/^\//,"").split("/").slice(v.length).join("/")}let z=o&&o.state.matches.length?o.state.matches.map(v=>Object.assign(v,{route:o.manifest[v.route.id]||v.route})):bx(r,{pathname:_});qt(h||z!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),qt(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=Np(z&&z.map(v=>Object.assign({},v,{params:Object.assign({},m,v.params),pathname:$t([p,c.encodeLocation?c.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?p:$t([p,c.encodeLocation?c.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),d,o);return u&&A?b.createElement(as.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},A):A}function yp(){let r=Tp(),u=ap(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),o=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},x={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",r),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:x},"ErrorBoundary")," or"," ",b.createElement("code",{style:x},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},u),o?b.createElement("pre",{style:d},o):null,m)}var vp=b.createElement(yp,null),Lx=class extends b.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,u){return u.location!==r.location||u.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:u.error,location:u.location,revalidation:r.revalidation||u.revalidation}}componentDidCatch(r,u){this.props.onError?this.props.onError(r,u):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const o=xp(r.digest);o&&(r=o)}let u=r!==void 0?b.createElement(Kt.Provider,{value:this.props.routeContext},b.createElement(So.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?b.createElement(bp,{error:r},u):u}};Lx.contextType=Mx;var co=new WeakMap;function bp({children:r,error:u}){let{basename:o}=b.useContext(Lt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let c=fp(u.digest);if(c){let d=co.get(u);if(d)throw d;let x=Ax(c.location,o),m=x.absoluteURL||x.to;if(rp(m))throw new Error("Invalid redirect location");if(Tx&&!co.get(u))if(x.isExternal||c.reloadDocument)window.location.href=m;else{const j=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:c.replace}));throw co.set(u,j),j}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m}`})}}return r}function jp({routeContext:r,match:u,children:o}){let c=b.useContext(Pl);return c&&c.static&&c.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=u.route.id),b.createElement(Kt.Provider,{value:r},o)}function Np(r,u=[],o){let c=o?.state;if(r==null){if(!c)return null;if(c.errors)r=c.matches;else if(u.length===0&&!c.initialized&&c.matches.length>0)r=c.matches;else return null}let d=r,x=c?.errors;if(x!=null){let N=d.findIndex(y=>y.route.id&&x?.[y.route.id]!==void 0);He(N>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),d=d.slice(0,Math.min(d.length,N+1))}let m=!1,j=-1;if(o&&c){m=c.renderFallback;for(let N=0;N<d.length;N++){let y=d[N];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(j=N),y.route.id){let{loaderData:C,errors:_}=c,z=y.route.loader&&!C.hasOwnProperty(y.route.id)&&(!_||_[y.route.id]===void 0);if(y.route.lazy||z){o.isStatic&&(m=!0),j>=0?d=d.slice(0,j+1):d=[d[0]];break}}}}let p=o?.onError,h=c&&p?(N,y)=>{p(N,{location:c.location,params:c.matches?.[0]?.params??{},pattern:lp(c.matches),errorInfo:y})}:void 0;return d.reduceRight((N,y,C)=>{let _,z=!1,A=null,v=null;c&&(_=x&&y.route.id?x[y.route.id]:void 0,A=y.route.errorElement||vp,m&&(j<0&&C===0?(Ux("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,v=null):j===C&&(z=!0,v=y.route.hydrateFallbackElement||null)));let w=u.concat(d.slice(0,C+1)),T=()=>{let O;return _?O=A:z?O=v:y.route.Component?O=b.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=N,b.createElement(jp,{match:y,routeContext:{outlet:N,matches:w,isDataRoute:c!=null},children:O})};return c&&(y.route.ErrorBoundary||y.route.errorElement||C===0)?b.createElement(Lx,{location:c.location,revalidation:c.revalidation,component:A,error:_,children:T(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:h}):T()},null)}function Eo(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sp(r){let u=b.useContext(Pl);return He(u,Eo(r)),u}function wp(r){let u=b.useContext(Dr);return He(u,Eo(r)),u}function Ep(r){let u=b.useContext(Kt);return He(u,Eo(r)),u}function Co(r){let u=Ep(r),o=u.matches[u.matches.length-1];return He(o.route.id,`${r} can only be used on routes that contain a unique "id"`),o.route.id}function Cp(){return Co("useRouteId")}function Tp(){let r=b.useContext(So),u=wp("useRouteError"),o=Co("useRouteError");return r!==void 0?r:u.errors?.[o]}function Ap(){let{router:r}=Sp("useNavigate"),u=Co("useNavigate"),o=b.useRef(!1);return Ox(()=>{o.current=!0}),b.useCallback(async(d,x={})=>{qt(o.current,zx),o.current&&(typeof d=="number"?await r.navigate(d):await r.navigate(d,{fromRouteId:u,...x}))},[r,u])}var W0={};function Ux(r,u,o){!u&&!W0[r]&&(W0[r]=!0,qt(!1,o))}b.memo(Rp);function Rp({routes:r,manifest:u,future:o,state:c,isStatic:d,onError:x}){return kx(r,void 0,{manifest:u,state:c,isStatic:d,onError:x})}function Ve(r){He(!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 Mp({basename:r="/",children:u=null,location:o,navigationType:c="POP",navigator:d,static:x=!1,useTransitions:m}){He(!ls(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let j=r.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:j,navigator:d,static:x,useTransitions:m,future:{}}),[j,d,x,m]);typeof o=="string"&&(o=Fl(o));let{pathname:h="/",search:N="",hash:y="",state:C=null,key:_="default",mask:z}=o,A=b.useMemo(()=>{let v=ma(h,j);return v==null?null:{location:{pathname:v,search:N,hash:y,state:C,key:_,mask:z},navigationType:c}},[j,h,N,y,C,_,c,z]);return qt(A!=null,`<Router basename="${j}"> is not able to match the URL "${h}${N}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:b.createElement(Lt.Provider,{value:p},b.createElement(as.Provider,{children:u,value:A}))}function Dp({children:r,location:u}){return pp(go(r),u)}function go(r,u=[]){let o=[];return b.Children.forEach(r,(c,d)=>{if(!b.isValidElement(c))return;let x=[...u,d];if(c.type===b.Fragment){o.push.apply(o,go(c.props.children,x));return}He(c.type===Ve,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||x.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=go(c.props.children,x)),o.push(m)}),o}var Cr="get",Tr="application/x-www-form-urlencoded";function _r(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function _p(r){return _r(r)&&r.tagName.toLowerCase()==="button"}function zp(r){return _r(r)&&r.tagName.toLowerCase()==="form"}function Op(r){return _r(r)&&r.tagName.toLowerCase()==="input"}function kp(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Lp(r,u){return r.button===0&&(!u||u==="_self")&&!kp(r)}function po(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((u,o)=>{let c=r[o];return u.concat(Array.isArray(c)?c.map(d=>[o,d]):[[o,c]])},[]))}function Up(r,u){let o=po(r);return u&&u.forEach((c,d)=>{o.has(d)||u.getAll(d).forEach(x=>{o.append(d,x)})}),o}var wr=null;function Hp(){if(wr===null)try{new FormData(document.createElement("form"),0),wr=!1}catch{wr=!0}return wr}var Bp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function oo(r){return r!=null&&!Bp.has(r)?(qt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tr}"`),null):r}function $p(r,u){let o,c,d,x,m;if(zp(r)){let j=r.getAttribute("action");c=j?ma(j,u):null,o=r.getAttribute("method")||Cr,d=oo(r.getAttribute("enctype"))||Tr,x=new FormData(r)}else if(_p(r)||Op(r)&&(r.type==="submit"||r.type==="image")){let j=r.form;if(j==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=r.getAttribute("formaction")||j.getAttribute("action");if(c=p?ma(p,u):null,o=r.getAttribute("formmethod")||j.getAttribute("method")||Cr,d=oo(r.getAttribute("formenctype"))||oo(j.getAttribute("enctype"))||Tr,x=new FormData(j,r),!Hp()){let{name:h,type:N,value:y}=r;if(N==="image"){let C=h?`${h}.`:"";x.append(`${C}x`,"0"),x.append(`${C}y`,"0")}else h&&x.append(h,y)}}else{if(_r(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Cr,c=null,d=Tr,m=r}return x&&d==="text/plain"&&(m=x,x=void 0),{action:c,method:o.toLowerCase(),encType:d,formData:x,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function To(r,u){if(r===!1||r===null||typeof r>"u")throw new Error(u)}function Hx(r,u,o,c){let d=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return o?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:u&&ma(d.pathname,u)==="/"?d.pathname=`${Mr(u)}/_root.${c}`:d.pathname=`${Mr(d.pathname)}.${c}`,d}async function qp(r,u){if(r.id in u)return u[r.id];try{let o=await import(r.module);return u[r.id]=o,o}catch(o){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Yp(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Gp(r,u,o){let c=await Promise.all(r.map(async d=>{let x=u.routes[d.route.id];if(x){let m=await qp(x,o);return m.links?m.links():[]}return[]}));return Zp(c.flat(1).filter(Yp).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function F0(r,u,o,c,d,x){let m=(p,h)=>o[h]?p.route.id!==o[h].route.id:!0,j=(p,h)=>o[h].pathname!==p.pathname||o[h].route.path?.endsWith("*")&&o[h].params["*"]!==p.params["*"];return x==="assets"?u.filter((p,h)=>m(p,h)||j(p,h)):x==="data"?u.filter((p,h)=>{let N=c.routes[p.route.id];if(!N||!N.hasLoader)return!1;if(m(p,h)||j(p,h))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function Vp(r,u,{includeHydrateFallback:o}={}){return Qp(r.map(c=>{let d=u.routes[c.route.id];if(!d)return[];let x=[d.module];return d.clientActionModule&&(x=x.concat(d.clientActionModule)),d.clientLoaderModule&&(x=x.concat(d.clientLoaderModule)),o&&d.hydrateFallbackModule&&(x=x.concat(d.hydrateFallbackModule)),d.imports&&(x=x.concat(d.imports)),x}).flat(1))}function Qp(r){return[...new Set(r)]}function Xp(r){let u={},o=Object.keys(r).sort();for(let c of o)u[c]=r[c];return u}function Zp(r,u){let o=new Set;return new Set(u),r.reduce((c,d)=>{let x=JSON.stringify(Xp(d));return o.has(x)||(o.add(x),c.push({key:x,link:d})),c},[])}function Ao(){let r=b.useContext(Pl);return To(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function Kp(){let r=b.useContext(Dr);return To(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Ro=b.createContext(void 0);Ro.displayName="FrameworkContext";function zr(){let r=b.useContext(Ro);return To(r,"You must render this element inside a <HydratedRouter> element"),r}function Jp(r,u){let o=b.useContext(Ro),[c,d]=b.useState(!1),[x,m]=b.useState(!1),{onFocus:j,onBlur:p,onMouseEnter:h,onMouseLeave:N,onTouchStart:y}=u,C=b.useRef(null);b.useEffect(()=>{if(r==="render"&&m(!0),r==="viewport"){let A=w=>{w.forEach(T=>{m(T.isIntersecting)})},v=new IntersectionObserver(A,{threshold:.5});return C.current&&v.observe(C.current),()=>{v.disconnect()}}},[r]),b.useEffect(()=>{if(c){let A=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(A)}}},[c]);let _=()=>{d(!0)},z=()=>{d(!1),m(!1)};return o?r!=="intent"?[x,C,{}]:[x,C,{onFocus:Jn(j,_),onBlur:Jn(p,z),onMouseEnter:Jn(h,_),onMouseLeave:Jn(N,z),onTouchStart:Jn(y,_)}]:[!1,C,{}]}function Jn(r,u){return o=>{r&&r(o),o.defaultPrevented||u(o)}}function Wp({page:r,...u}){let o=ip(),{nonce:c}=zr(),{router:d}=Ao(),x=b.useMemo(()=>bx(d.routes,r,d.basename),[d.routes,r,d.basename]);return x?(u.nonce==null&&c&&(u={...u,nonce:c}),o?b.createElement(Pp,{page:r,matches:x,...u}):b.createElement(Ip,{page:r,matches:x,...u})):null}function Fp(r){let{manifest:u,routeModules:o}=zr(),[c,d]=b.useState([]);return b.useEffect(()=>{let x=!1;return Gp(r,u,o).then(m=>{x||d(m)}),()=>{x=!0}},[r,u,o]),c}function Pp({page:r,matches:u,...o}){let c=Yt(),{future:d}=zr(),{basename:x}=Ao(),m=b.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let j=Hx(r,x,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,h=[];for(let N of u)typeof N.route.shouldRevalidate=="function"?p=!0:h.push(N.route.id);return p&&h.length>0&&j.searchParams.set("_routes",h.join(",")),[j.pathname+j.search]},[x,d.v8_trailingSlashAwareDataRequests,r,c,u]);return b.createElement(b.Fragment,null,m.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...o})))}function Ip({page:r,matches:u,...o}){let c=Yt(),{future:d,manifest:x,routeModules:m}=zr(),{basename:j}=Ao(),{loaderData:p,matches:h}=Kp(),N=b.useMemo(()=>F0(r,u,h,x,c,"data"),[r,u,h,x,c]),y=b.useMemo(()=>F0(r,u,h,x,c,"assets"),[r,u,h,x,c]),C=b.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let A=new Set,v=!1;if(u.forEach(T=>{let O=x.routes[T.route.id];!O||!O.hasLoader||(!N.some(W=>W.route.id===T.route.id)&&T.route.id in p&&m[T.route.id]?.shouldRevalidate||O.hasClientLoader?v=!0:A.add(T.route.id))}),A.size===0)return[];let w=Hx(r,j,d.v8_trailingSlashAwareDataRequests,"data");return v&&A.size>0&&w.searchParams.set("_routes",u.filter(T=>A.has(T.route.id)).map(T=>T.route.id).join(",")),[w.pathname+w.search]},[j,d.v8_trailingSlashAwareDataRequests,p,c,x,N,u,r,m]),_=b.useMemo(()=>Vp(y,x),[y,x]),z=Fp(y);return b.createElement(b.Fragment,null,C.map(A=>b.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...o})),_.map(A=>b.createElement("link",{key:A,rel:"modulepreload",href:A,...o})),z.map(({key:A,link:v})=>b.createElement("link",{key:A,nonce:o.nonce,...v,crossOrigin:v.crossOrigin??o.crossOrigin})))}function ey(...r){return u=>{r.forEach(o=>{typeof o=="function"?o(u):o!=null&&(o.current=u)})}}var ty=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ty&&(window.__reactRouterVersion="7.18.2")}catch{}function ay({basename:r,children:u,useTransitions:o,window:c}){let d=b.useRef();d.current==null&&(d.current=zg({window:c,v5Compat:!0}));let x=d.current,[m,j]=b.useState({action:x.action,location:x.location}),p=b.useCallback(h=>{o===!1?j(h):b.startTransition(()=>j(h))},[o]);return b.useLayoutEffect(()=>x.listen(p),[x,p]),b.createElement(Mp,{basename:r,children:u,location:m.location,navigationType:m.action,navigator:x,useTransitions:o})}var Fe=b.forwardRef(function({onClick:u,discover:o="render",prefetch:c="none",relative:d,reloadDocument:x,replace:m,mask:j,state:p,target:h,to:N,preventScrollReset:y,viewTransition:C,defaultShouldRevalidate:_,...z},A){let{basename:v,navigator:w,useTransitions:T}=b.useContext(Lt),O=typeof N=="string"&&jo.test(N),W=Ax(N,v);N=W.to;let X=mp(N,{relative:d}),le=Yt(),K=null;if(j){let V=No(j,[],le.mask?le.mask.pathname:"/",!0);v!=="/"&&(V.pathname=V.pathname==="/"?v:$t([v,V.pathname])),K=w.createHref(V)}let[J,H,F]=Jp(c,z),P=sy(N,{replace:m,mask:j,state:p,target:h,preventScrollReset:y,relative:d,viewTransition:C,defaultShouldRevalidate:_,useTransitions:T});function se(V){u&&u(V),V.defaultPrevented||P(V)}let ze=!(W.isExternal||x),Ae=b.createElement("a",{...z,...F,href:(ze?K:void 0)||W.absoluteURL||X,onClick:ze?se:u,ref:ey(A,H),target:h,"data-discover":!O&&o==="render"?"true":void 0});return J&&!O?b.createElement(b.Fragment,null,Ae,b.createElement(Wp,{page:X})):Ae});Fe.displayName="Link";var yo=b.forwardRef(function({"aria-current":u="page",caseSensitive:o=!1,className:c="",end:d=!1,style:x,to:m,viewTransition:j,children:p,...h},N){let y=ns(m,{relative:h.relative}),C=Yt(),_=b.useContext(Dr),{navigator:z,basename:A}=b.useContext(Lt),v=_!=null&&uy(y)&&j===!0,w=z.encodeLocation?z.encodeLocation(y).pathname:y.pathname,T=C.pathname,O=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;o||(T=T.toLowerCase(),O=O?O.toLowerCase():null,w=w.toLowerCase()),O&&A&&(O=ma(O,A)||O);const W=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let X=T===w||!d&&T.startsWith(w)&&T.charAt(W)==="/",le=O!=null&&(O===w||!d&&O.startsWith(w)&&O.charAt(w.length)==="/"),K={isActive:X,isPending:le,isTransitioning:v},J=X?u:void 0,H;typeof c=="function"?H=c(K):H=[c,X?"active":null,le?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let F=typeof x=="function"?x(K):x;return b.createElement(Fe,{...h,"aria-current":J,className:H,ref:N,style:F,to:m,viewTransition:j},typeof p=="function"?p(K):p)});yo.displayName="NavLink";var ly=b.forwardRef(({discover:r="render",fetcherKey:u,navigate:o,reloadDocument:c,replace:d,state:x,method:m=Cr,action:j,onSubmit:p,relative:h,preventScrollReset:N,viewTransition:y,defaultShouldRevalidate:C,..._},z)=>{let{useTransitions:A}=b.useContext(Lt),v=cy(),w=oy(j,{relative:h}),T=m.toLowerCase()==="get"?"get":"post",O=typeof j=="string"&&jo.test(j),W=X=>{if(p&&p(X),X.defaultPrevented)return;X.preventDefault();let le=X.nativeEvent.submitter,K=le?.getAttribute("formmethod")||m,J=()=>v(le||X.currentTarget,{fetcherKey:u,method:K,navigate:o,replace:d,state:x,relative:h,preventScrollReset:N,viewTransition:y,defaultShouldRevalidate:C});A&&o!==!1?b.startTransition(()=>J()):J()};return b.createElement("form",{ref:z,method:T,action:w,onSubmit:c?p:W,..._,"data-discover":!O&&r==="render"?"true":void 0})});ly.displayName="Form";function ny(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bx(r){let u=b.useContext(Pl);return He(u,ny(r)),u}function sy(r,{target:u,replace:o,mask:c,state:d,preventScrollReset:x,relative:m,viewTransition:j,defaultShouldRevalidate:p,useTransitions:h}={}){let N=wo(),y=Yt(),C=ns(r,{relative:m});return b.useCallback(_=>{if(Lp(_,u)){_.preventDefault();let z=o!==void 0?o:ts(y)===ts(C),A=()=>N(r,{replace:z,mask:c,state:d,preventScrollReset:x,relative:m,viewTransition:j,defaultShouldRevalidate:p});h?b.startTransition(()=>A()):A()}},[y,N,C,o,c,d,u,r,x,m,j,p,h])}function Or(r){qt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let u=b.useRef(po(r)),o=b.useRef(!1),c=Yt(),d=b.useMemo(()=>Up(c.search,o.current?null:u.current),[c.search]),x=wo(),m=b.useCallback((j,p)=>{const h=po(typeof j=="function"?j(new URLSearchParams(d)):j);o.current=!0,x("?"+h,p)},[x,d]);return[d,m]}var ry=0,iy=()=>`__${String(++ry)}__`;function cy(){let{router:r}=Bx("useSubmit"),{basename:u}=b.useContext(Lt),o=Cp(),c=r.fetch,d=r.navigate;return b.useCallback(async(x,m={})=>{let{action:j,method:p,encType:h,formData:N,body:y}=$p(x,u);if(m.navigate===!1){let C=m.fetcherKey||iy();await c(C,o,m.action||j,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:N,body:y,formMethod:m.method||p,formEncType:m.encType||h,flushSync:m.flushSync})}else await d(m.action||j,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:N,body:y,formMethod:m.method||p,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[c,d,u,o])}function oy(r,{relative:u}={}){let{basename:o}=b.useContext(Lt),c=b.useContext(Kt);He(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),x={...ns(r||".",{relative:u})},m=Yt();if(r==null){x.search=m.search;let j=new URLSearchParams(x.search),p=j.getAll("index");if(p.some(N=>N==="")){j.delete("index"),p.filter(y=>y).forEach(y=>j.append("index",y));let N=j.toString();x.search=N?`?${N}`:""}}return(!r||r===".")&&d.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(x.pathname=x.pathname==="/"?o:$t([o,x.pathname])),ts(x)}function uy(r,{relative:u}={}){let o=b.useContext(Dx);He(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Bx("useViewTransitionState"),d=ns(r,{relative:u});if(!o.isTransitioning)return!1;let x=ma(o.currentLocation.pathname,c)||o.currentLocation.pathname,m=ma(o.nextLocation.pathname,c)||o.nextLocation.pathname;return Rr(d.pathname,m)!=null||Rr(d.pathname,x)!=null}function $x(r,u){const{timeout:o=3e4,retries:c=1,retryDelay:d=2e3}={},[x,m]=b.useState(null),[j,p]=b.useState(!0),[h,N]=b.useState(null),[y,C]=b.useState(0),[_,z]=b.useState(null),A=b.useCallback(()=>C(v=>v+1),[]);return b.useEffect(()=>{if(!r){p(!1),m(null),N(null);return}let v=!1;p(!0),N(null);async function w(T){const O=new AbortController,W=setTimeout(()=>O.abort(),o);try{const X=await fetch(r,{signal:O.signal});if(clearTimeout(W),!X.ok)throw new Error(`HTTP ${X.status}`);const le=X.headers.get("content-type")||"";if(!le.includes("application/json"))throw new Error(`Expected JSON response but got ${le||"unknown"} — server may be restarting`);const K=await X.json();v||(m(K.data??K),N(null),z(new Date),p(!1))}catch(X){if(clearTimeout(W),v)return;if(T>0&&X.name!=="AbortError")return await new Promise(le=>setTimeout(le,d)),v?void 0:w(T-1);X.name==="AbortError"?N(`Request timed out (${Math.round(o/1e3)}s)`):N(String(X.message||X)),p(!1)}}return w(c),()=>{v=!0}},[r,y,o,c,d]),{data:x,loading:j,error:h,refetch:A,fetchedAt:_}}const qx=b.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function qa(){return b.useContext(qx)}function dy(){const[r,u]=b.useState([]),[o,c]=Or(),d=b.useCallback(async()=>{try{const h=await(await fetch("/api/projects")).json();h.ok&&u(h.data||[])}catch{}},[]);b.useEffect(()=>{d()},[d]);const x=o.get("project"),m=x?r.find(p=>p.id===x)||r[0]||null:r[0]||null,j=b.useCallback(p=>{c(h=>(h.set("project",p),h))},[c]);return{projects:r,activeProject:m,setActiveProject:j,refreshProjects:d}}function Te(r,u){const{activeProject:o}=qa(),c=r.includes("?")?"&":"?",d=o?`${r}${c}project=${o.id}`:r;return $x(d)}const Mo=b.createContext(null),fy=["heartbeat","increment-update","analytics-event","cost-update","notification","sync-update","sync-audit","error-detected","config-changed","activity","command-output","command-complete","job-progress","marketplace-scan","submission-update","verification-complete","hook-event","hook-agent"];function xy({url:r="/api/events",children:u}){const[o,c]=b.useState("connecting"),d=b.useRef(null),x=b.useRef(null),m=b.useRef(new Map),j=b.useCallback(()=>{d.current&&d.current.close(),c("connecting");const h=new EventSource(r);d.current=h;for(const N of fy)h.addEventListener(N,y=>{let C;try{C=JSON.parse(y.data)}catch{return}const _=m.current.get(N);if(_)for(const z of _)try{z(C)}catch{}});h.onopen=()=>c("connected"),h.onerror=()=>{h.close(),c("disconnected"),x.current=setTimeout(()=>{d.current===h&&j()},3e3)}},[r]);b.useEffect(()=>(j(),()=>{x.current&&(clearTimeout(x.current),x.current=null),d.current?.close(),d.current=null}),[j]);const p=b.useCallback((h,N)=>(m.current.has(h)||m.current.set(h,new Set),m.current.get(h).add(N),()=>{const y=m.current.get(h);y&&(y.delete(N),y.size===0&&m.current.delete(h))}),[]);return l.jsx(Mo.Provider,{value:{status:o,subscribe:p},children:u})}function Le(r,u){const o=b.useContext(Mo),c=b.useRef(u);c.current=u,b.useEffect(()=>{if(!o)return;const d=x=>c.current(x);return o.subscribe(r,d)},[o,r])}function Yx(){return b.useContext(Mo)?.status??"disconnected"}const P0=["backlog","active","blocked","review","done"],Wn={backlog:"Backlog",active:"In progress",blocked:"Blocked",review:"Review",done:"Done"},Ar=r=>r?new Date(r).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Unknown",Kl=r=>r||"Unknown";function I0({title:r,children:u,onClose:o}){const c=b.useRef(null);return b.useEffect(()=>{c.current?.showModal()},[]),l.jsxs("dialog",{ref:c,className:"work-dialog",onCancel:o,onClose:o,"aria-label":r,children:[l.jsxs("div",{className:"work-dialog-heading",children:[l.jsx("h2",{children:r}),l.jsx("button",{type:"button",className:"work-icon-button","aria-label":"Close dialog",onClick:o,children:"×"})]}),u]})}function ex({sessionsOnly:r=!1}){const{activeProject:u}=qa(),{data:o,error:c,loading:d,refetch:x}=Te("/api/work"),[m,j]=b.useState(""),[p,h]=b.useState(null),[N,y]=b.useState(!1),[C,_]=b.useState(!1),[z,A]=b.useState(""),[v,w]=b.useState(""),[T,O]=b.useState(null),W=u?`?project=${encodeURIComponent(u.id)}`:"",{data:X,loading:le,refetch:K}=$x(r||p?`/api/work/sessions${W}`:""),J=Yx();Le("increment-update",x),b.useEffect(()=>{const V=setInterval(()=>{x(),(r||p)&&K()},15e3);return()=>clearInterval(V)},[x,K,r,p]),b.useEffect(()=>{h(null),y(!1)},[u?.id]);async function H(V,R,Q){if(C)return!1;_(!0),w("");try{const ne=u?`?project=${encodeURIComponent(u.id)}`:"",ve=await fetch(`/api/work${V}${ne}`,{method:R,headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)}),je=await ve.json();if(!ve.ok||!je.ok)throw new Error(je.error||"Could not save work");return x(),!0}catch(ne){return w(ne instanceof Error?ne.message:"Could not save work"),x(),!1}finally{_(!1)}}async function F(V,R){R!==V.state&&await H(`/${encodeURIComponent(V.id)}`,"PATCH",{revision:V.revision,state:R})&&A(`${V.title} moved to ${Wn[R]}.`)}const P=(o?.items??[]).filter(V=>`${V.title} ${V.summary} ${V.incrementId??""}`.toLowerCase().includes(m.toLowerCase())),se=o?.items.find(V=>V.id===p),ze=[...new Map((o?.items??[]).filter(V=>V.incrementId).map(V=>[V.incrementId,V])).values()],Ae=u?`?project=${encodeURIComponent(u.id)}`:"";return l.jsxs("div",{className:"work-page",children:[l.jsxs("div",{className:"work-eyebrow",children:[l.jsx("span",{className:`work-live-dot ${J==="connected"?"connected":""}`}),J==="connected"?"LIVE WORKSPACE":"WORKSPACE",l.jsx("span",{children:"LOCAL · NO MODEL CALLS"})]}),l.jsxs("div",{className:"work-heading",children:[l.jsxs("div",{children:[l.jsx("h1",{children:r?"Execution history":"Work, without the reset."}),l.jsx("p",{children:r?"Follow the tools and people that carried each intent forward.":"Keep the intent. See the progress. Pick up with any tool."})]}),!r&&l.jsx("button",{className:"work-primary",onClick:()=>y(!0),children:"+ New intent"})]}),l.jsxs("div",{className:"work-metrics",children:[l.jsxs("div",{children:[l.jsx("span",{children:"In progress"}),l.jsx("strong",{children:o?.counts.active??"—"}),l.jsx("small",{children:"moving forward"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Needs attention"}),l.jsx("strong",{className:"work-amber",children:o?.counts.blocked??"—"}),l.jsx("small",{children:"blocked or stale claims"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Tasks complete"}),l.jsxs("strong",{children:[o?.totals.done??"—",l.jsxs("em",{children:[" / ",o?.totals.tasks??"—"]})]}),l.jsx("small",{children:"from the task ledger"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Verification passed"}),l.jsx("strong",{children:o?.totals.verified??"—"}),l.jsx("small",{children:"linked increments with current reports"})]})]}),l.jsxs("div",{className:"work-toolbar",children:[l.jsxs("div",{className:"work-view-label",children:[r?"SETUPS & CONTINUATIONS":"INTENT BOARD",l.jsxs("span",{children:[P.length," items"]})]}),l.jsxs("label",{className:"work-search",children:[l.jsx("span",{"aria-hidden":"true",children:"⌕"}),l.jsx("input",{"aria-label":"Search work",value:m,onChange:V=>j(V.target.value),placeholder:"Find an intent or increment…"})]})]}),(v||c)&&l.jsxs("div",{role:"alert",className:"work-error",children:[v||c,l.jsx("button",{onClick:x,children:"Retry"})]}),l.jsx("span",{className:"work-sr-only",role:"status","aria-live":"polite",children:z}),o?.warnings.map(V=>l.jsx("p",{className:"work-warning",children:V},V)),d&&!o?l.jsx("p",{className:"work-empty",children:"Reading local work…"}):r?l.jsxs("div",{className:"work-session-list",children:[l.jsx(my,{sessions:X||[],loading:le,items:o?.items||[],saving:C,link:async(V,R)=>{await H(`/${encodeURIComponent(R.id)}`,"PATCH",{revision:R.revision,sessionRef:V})&&A("Session linked to intent.")}}),P.filter(V=>V.executions.length).map(V=>l.jsxs("section",{className:"work-session-group",children:[l.jsxs("button",{onClick:()=>h(V.id),children:[V.title," ",l.jsx("span",{children:"↗"})]}),l.jsx(vo,{item:V})]},V.id)),!P.some(V=>V.executions.length)&&l.jsx("p",{className:"work-empty",children:"No execution history yet. Claims appear automatically; add a setup to an intent to record its model and effort."})]}):l.jsx("div",{className:"work-board-scroll",children:l.jsx("div",{className:"work-board",children:P0.map(V=>l.jsxs("section",{className:`work-column state-${V} ${T===V?"is-drop-target":""}`,"aria-label":`${Wn[V]} column`,onDragOver:R=>{R.dataTransfer.types.includes("application/specweave-intent")&&(R.preventDefault(),O(V))},onDragLeave:R=>{R.currentTarget.contains(R.relatedTarget)||O(null)},onDrop:R=>{R.preventDefault(),O(null);const Q=o?.items.find(ne=>ne.id===R.dataTransfer.getData("application/specweave-intent"));Q&&F(Q,V)},children:[l.jsxs("div",{className:"work-column-title",children:[l.jsx("span",{className:"work-state-dot"}),l.jsx("h2",{children:Wn[V]}),l.jsx("span",{className:"work-count",children:P.filter(R=>R.state===V).length})]}),l.jsxs("div",{className:"work-cards",children:[P.filter(R=>R.state===V).map(R=>l.jsxs("article",{className:"work-card","data-intent-id":R.id,draggable:!C,onDragStart:Q=>{Q.dataTransfer.setData("application/specweave-intent",R.id),Q.dataTransfer.effectAllowed="move"},onDragEnd:()=>O(null),children:[l.jsxs("div",{className:"work-card-top",children:[l.jsx("span",{children:R.incrementId?`INC ${R.incrementId.split("-")[0]}`:"INTENT"}),l.jsx("span",{className:"work-drag","aria-hidden":"true",children:"⠿"})]}),l.jsx("button",{className:"work-card-title",onClick:()=>h(R.id),children:R.title}),l.jsx("p",{className:"work-card-summary",children:R.summary||"Add a short outcome so the next session starts with context."}),R.tasks.total>0&&l.jsxs("div",{className:"work-progress",children:[l.jsxs("div",{children:[l.jsxs("span",{children:[R.tasks.done,"/",R.tasks.total," tasks"]}),l.jsxs("span",{children:[R.acs.done,"/",R.acs.total," ACs"]})]}),l.jsx("progress",{"aria-label":`${R.title} task progress`,value:R.tasks.done,max:R.tasks.total}),R.tasks.skipped>0&&l.jsxs("small",{children:[R.tasks.skipped," skipped"]})]}),l.jsxs("div",{className:"work-card-proof",children:[l.jsx("span",{className:`proof-${R.verification.status}`,children:R.verification.status==="passed"?"✓ Verified":R.verification.status==="failed"?"× Check failed":R.verification.status==="stale"?"↻ Recheck needed":R.incrementId?"○ Not verified":"○ No increment"}),R.incrementId&&l.jsx(Fe,{to:`/increments/${encodeURIComponent(R.incrementId)}${Ae}`,"aria-label":`Evidence for ${R.title}`,children:"Evidence ↗"})]}),R.executions.length>0&&l.jsxs("div",{className:"work-card-actor",children:[l.jsx("span",{className:"work-avatar",children:(R.executions[R.executions.length-1]?.harness||"?").slice(0,1).toUpperCase()}),l.jsxs("span",{children:[Kl(R.executions[R.executions.length-1].harness),l.jsx("small",{children:R.executions[R.executions.length-1].model||"Model unknown"})]}),R.executions.length>1&&l.jsxs("span",{className:"work-setup-count",children:["+",R.executions.length-1]})]}),l.jsxs("label",{className:"work-state-control",children:[l.jsxs("span",{className:"work-sr-only",children:["State for ",R.title]}),l.jsx("select",{value:R.state,disabled:C,onChange:Q=>{F(R,Q.target.value)},children:P0.map(Q=>l.jsx("option",{value:Q,children:Wn[Q]},Q))})]})]},R.id)),!P.some(R=>R.state===V)&&l.jsx("div",{className:"work-column-empty",children:V==="backlog"?"A clear intent is enough to start.":V==="done"?"Finished work lands here.":"No work here yet."})]})]},V))})}),l.jsxs("div",{className:"work-footnote",children:[l.jsx("span",{children:"Board state organizes work. Verification comes from linked increments."}),l.jsx("span",{children:o?`Updated ${Ar(o.generatedAt)}`:""})]}),N&&l.jsx(I0,{title:"Capture an intent",onClose:()=>y(!1),children:l.jsxs("form",{className:"work-form",onSubmit:async V=>{V.preventDefault();const R=new FormData(V.currentTarget);await H("","POST",Object.fromEntries(R))&&(y(!1),A("Intent created."))},children:[l.jsx("p",{children:"Describe the outcome. Small work can start without an increment."}),l.jsxs("label",{children:["Title",l.jsx("input",{name:"title",required:!0,maxLength:180,autoFocus:!0,placeholder:"What should be different when this is done?"})]}),l.jsxs("label",{children:["Intent",l.jsx("textarea",{name:"summary",rows:3,maxLength:2e3,placeholder:"Why it matters, expected result, or context for the next session."})]}),l.jsxs("label",{children:["Linked increment",l.jsxs("select",{name:"incrementId",children:[l.jsx("option",{value:"",children:"No increment yet"}),ze.map(V=>l.jsx("option",{value:V.incrementId,children:V.incrementId},V.incrementId))]})]}),v&&l.jsx("p",{role:"alert",className:"work-error",children:v}),l.jsx("button",{disabled:C,className:"work-primary",children:C?"Saving…":"Create intent"})]})}),se&&l.jsx(I0,{title:se.title,onClose:()=>h(null),children:l.jsxs("div",{className:"work-detail",children:[l.jsxs("div",{className:"work-detail-meta",children:[l.jsx("span",{children:Wn[se.state]}),l.jsx("span",{children:se.incrementId||"No increment linked"})]}),l.jsxs("form",{className:"work-form",onSubmit:async V=>{V.preventDefault();const R=Object.fromEntries(new FormData(V.currentTarget));await H(`/${encodeURIComponent(se.id)}`,"PATCH",{...R,revision:se.revision})&&A("Intent updated.")},children:[l.jsxs("label",{children:["Intent",l.jsx("textarea",{name:"summary",defaultValue:se.summary,rows:3,maxLength:2e3})]}),l.jsxs("label",{children:["Linked increment",l.jsxs("select",{name:"incrementId",defaultValue:se.incrementId||"",children:[l.jsx("option",{value:"",children:"No increment"}),ze.map(V=>l.jsx("option",{value:V.incrementId,children:V.incrementId},V.incrementId))]})]}),l.jsx("button",{className:"work-secondary",disabled:C,children:"Save context"})]},`${se.id}-summary`),l.jsxs("section",{className:"work-evidence",children:[l.jsx("h3",{children:"Delivery evidence"}),l.jsxs("div",{children:[l.jsxs("strong",{children:[se.tasks.done,"/",se.tasks.total]}),l.jsxs("span",{children:["tasks complete · ",se.evidenceCount," with ledger evidence"]})]}),l.jsxs("p",{children:[se.acs.done,"/",se.acs.total," acceptance criteria · Verification"," ",se.verification.status,se.verification.ranAt?` · ${Ar(se.verification.ranAt)}`:""]}),se.incrementId?l.jsx(Fe,{to:`/increments/${encodeURIComponent(se.incrementId)}${Ae}`,children:"Open specification, tasks and verification ↗"}):l.jsx("p",{children:"Attach an increment when this work needs a specification and checks."})]}),l.jsxs("section",{children:[l.jsx("h3",{children:"Execution history"}),l.jsx("p",{className:"work-muted",children:"A tool change keeps the same intent. Ledger actors are observed; added setups are declared. Unknown facts remain unknown."}),l.jsx(vo,{item:se})]}),l.jsxs("details",{className:"work-add-setup",children:[l.jsx("summary",{children:"Link a local Codex or Claude Code session"}),l.jsx("p",{className:"work-muted",children:"Only sessions rooted in this project appear. Linking associates the observed setup with this intent; it never imports conversation text."}),le?l.jsx("p",{className:"work-muted",children:"Reading metadata…"}):l.jsxs("form",{className:"work-form",onSubmit:async V=>{V.preventDefault();const R=new FormData(V.currentTarget).get("sessionRef");await H(`/${encodeURIComponent(se.id)}`,"PATCH",{revision:se.revision,sessionRef:R})&&A("Session linked.")},children:[l.jsxs("label",{children:["Local session",l.jsxs("select",{"aria-label":"Local session",name:"sessionRef",required:!0,defaultValue:"",children:[l.jsx("option",{value:"",disabled:!0,children:"Select a session"}),(X||[]).map(V=>l.jsxs("option",{value:V.key,children:[V.harness," · ",V.sessionId.slice(0,8)," · ",Ar(V.updatedAt)]},V.key))]})]}),l.jsx("button",{className:"work-secondary",disabled:C||!X?.length,children:"Link observed session"}),!X?.length&&l.jsx("p",{children:"No supported local session metadata found. Record a setup below."})]})]}),l.jsxs("details",{className:"work-add-setup",children:[l.jsx("summary",{children:"+ Record a setup or continuation"}),l.jsxs("form",{className:"work-form",onSubmit:async V=>{V.preventDefault();const R=V.currentTarget,Q=Object.fromEntries(new FormData(R));await H(`/${encodeURIComponent(se.id)}/executions`,"POST",{...Q,revision:se.revision})&&(R.reset(),A("Execution setup recorded."))},children:[l.jsxs("div",{className:"work-form-grid",children:[l.jsxs("label",{children:["Harness",l.jsx("input",{name:"harness",required:!0,placeholder:"Codex, Claude Code, Cursor…",maxLength:120})]}),l.jsxs("label",{children:["Model",l.jsx("input",{name:"model",placeholder:"Exact model ID, if known",maxLength:120})]}),l.jsxs("label",{children:["Effort",l.jsx("input",{name:"effort",placeholder:"e.g. high",maxLength:80})]}),l.jsxs("label",{children:["Provider",l.jsx("input",{name:"provider",placeholder:"e.g. OpenAI, OpenRouter",maxLength:120})]}),l.jsxs("label",{children:["Surface",l.jsx("input",{name:"surface",placeholder:"Desktop, terminal, VS Code…",maxLength:120})]}),l.jsxs("label",{children:["Session ID",l.jsx("input",{name:"sessionId",placeholder:"Optional source session",maxLength:200})]})]}),l.jsxs("label",{children:["Continuation note",l.jsx("input",{name:"note",placeholder:"What changed or where to continue",maxLength:500})]}),l.jsx("button",{className:"work-primary",disabled:C,children:"Record setup"})]})]}),se.handoff&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Latest handoff"}),l.jsx("pre",{children:se.handoff})]}),v&&l.jsx("p",{role:"alert",className:"work-error",children:v})]})})]})}function vo({item:r}){return r.executions.length?l.jsx("ol",{className:"work-timeline",children:r.executions.map(u=>l.jsxs("li",{children:[l.jsx("div",{className:"work-timeline-dot"}),l.jsxs("div",{children:[l.jsxs("div",{className:"work-timeline-title",children:[l.jsx("strong",{children:Kl(u.harness)}),l.jsx("span",{children:Kl(u.model)}),l.jsx("small",{children:u.source==="ledger"?"Ledger":u.source==="session"?"Observed":"Declared"})]}),l.jsxs("p",{children:["Effort ",Kl(u.effort)," · Provider ",Kl(u.provider)," · ",Kl(u.surface)]}),l.jsxs("p",{children:[Ar(u.startedAt)," · ",u.actor,u.sessionId?` · ${u.sessionId}`:""]}),u.note&&l.jsx("p",{className:"work-timeline-note",children:u.note})]})]},u.id))}):l.jsx("p",{className:"work-empty small",children:"No execution recorded. Task claims will appear here automatically."})}function my({sessions:r,loading:u,items:o,saving:c,link:d}){return l.jsxs("section",{className:"work-local-sessions",children:[l.jsx("h2",{children:"Local sessions"}),l.jsx("p",{className:"work-muted",children:"Project-scoped Codex and Claude Code metadata. Associate sessions with an intent explicitly. Model changes in large logs may be missing between observed windows."}),u&&l.jsx("p",{className:"work-empty",children:"Reading local metadata…"}),!u&&!r.length&&l.jsx("p",{className:"work-empty",children:"No supported session metadata found for this project."}),r.map(x=>l.jsxs("article",{className:"work-session-group",children:[l.jsxs("div",{className:"work-local-session-heading",children:[l.jsx("strong",{children:x.harness}),l.jsx("span",{children:x.sessionId.slice(0,8)}),l.jsx("small",{children:x.coverage==="partial"?"Partial log coverage":"Full log coverage"})]}),l.jsx(vo,{item:{executions:x.segments}}),l.jsxs("form",{className:"work-session-link",onSubmit:async m=>{m.preventDefault();const j=o.find(p=>p.id===new FormData(m.currentTarget).get("intent"));j&&await d(x.key,j)},children:[l.jsxs("label",{children:[l.jsxs("span",{className:"work-sr-only",children:["Intent for session ",x.sessionId]}),l.jsxs("select",{name:"intent",required:!0,defaultValue:"",children:[l.jsx("option",{value:"",disabled:!0,children:"Link to an intent…"}),o.map(m=>l.jsx("option",{value:m.id,children:m.title},m.id))]})]}),l.jsx("button",{className:"work-secondary",disabled:c||!o.length,children:"Link session"})]})]},x.key))]})}const hy=[["/","Work board","▥"],["/increments","Evidence","▤"],["/sessions","Sessions","↗"],["/sync","Connections","⇄"]],gy=[["/overview","Overview"],["/activity","Activity"],["/costs","Usage & estimates"],["/analytics","Analytics"],["/errors","Errors"],["/notifications","Notifications"],["/workspace","Workspace"],["/repos","Repositories"],["/plugins","Plugins"],["/marketplace","Marketplace"],["/hooks","Hooks"],["/agents","Agents"],["/services","Services"],["/config","Settings"]];function py(){const{projects:r,activeProject:u,setActiveProject:o}=qa(),[c]=Or(),d=Yx(),x=m=>c.get("project")?`${m}?project=${encodeURIComponent(c.get("project"))}`:m;return l.jsxs("aside",{className:"work-sidebar",children:[l.jsx(yy,{}),l.jsxs("div",{className:"work-project-select",children:[l.jsx("label",{htmlFor:"workspace-project",children:"WORKSPACE"}),l.jsx("select",{id:"workspace-project",value:u?.id||"",onChange:m=>o(m.target.value),children:r.map(m=>l.jsx("option",{value:m.id,children:m.name},m.id))})]}),l.jsx("nav",{"aria-label":"Main navigation",className:"work-navigation",children:hy.map(([m,j,p])=>l.jsxs(yo,{title:j,end:m==="/",to:x(m),className:({isActive:h})=>h?"active":"",children:[l.jsx("span",{"aria-hidden":"true",className:"work-nav-icon",children:p}),l.jsx("span",{className:"work-nav-label",children:j})]},m))}),l.jsxs("div",{className:"work-sidebar-note",children:[l.jsx("span",{children:"ONE INTENT."}),l.jsxs("strong",{children:["Every tool.",l.jsx("br",{}),"Every next step."]}),l.jsx("p",{children:"Your work stays in your project."})]}),l.jsxs("details",{className:"work-advanced",children:[l.jsx("summary",{title:"Diagnostics and settings",children:"Diagnostics & settings"}),l.jsx("nav",{"aria-label":"Advanced navigation",children:gy.map(([m,j])=>l.jsx(yo,{to:x(m),children:j},m))})]}),l.jsxs("div",{className:"work-sidebar-footer",children:[l.jsx("span",{className:`work-live-dot ${d==="connected"?"connected":""}`}),l.jsx("span",{children:d==="connected"?"Live connection":"Reconnecting…"})]})]})}function yy(){return l.jsxs("div",{className:"work-brand",children:[l.jsxs("div",{"aria-hidden":"true",className:"work-brand-mark",children:["S",l.jsx("span",{children:"W"})]}),l.jsxs("span",{children:["SpecWeave",l.jsx("small",{children:"WORK CONTINUITY"})]})]})}function vy(){const{activeProject:r}=qa();return l.jsxs("header",{className:"work-header",children:[l.jsxs("span",{children:["Workspace ",l.jsx("b",{children:"/"})," ",l.jsx("strong",{children:r?.name||"Project"})]}),l.jsx("span",{children:"Intent → evidence → continuation"})]})}class by extends b.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}componentDidCatch(u,o){console.error("[Dashboard ErrorBoundary]",u,o.componentStack)}componentDidUpdate(u){this.state.hasError&&u.resetKey!==this.props.resetKey&&this.setState({hasError:!1,error:null})}render(){return this.state.hasError?l.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:l.jsxs("div",{className:"max-w-md text-center space-y-4",children:[l.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 flex items-center justify-center",children:l.jsx("svg",{className:"w-6 h-6 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),l.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-gray-500",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 justify-center",children:[l.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),className:"px-4 py-2 text-sm bg-gray-800 text-gray-300 rounded-lg hover:bg-gray-700 transition-colors",children:"Try Again"}),l.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors",children:"Reload Page"}),l.jsx("a",{href:"/",className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors",children:"Go Home"})]})]})}):this.props.children}}const jy={indigo:"from-indigo-500/10 to-indigo-500/5 border-indigo-500/20",emerald:"from-emerald-500/10 to-emerald-500/5 border-emerald-500/20",amber:"from-amber-500/10 to-amber-500/5 border-amber-500/20",rose:"from-rose-500/10 to-rose-500/5 border-rose-500/20",cyan:"from-cyan-500/10 to-cyan-500/5 border-cyan-500/20"},Ny={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function ie({title:r,value:u,subtitle:o,tooltip:c,color:d="indigo"}){return l.jsxs("div",{className:`bg-gradient-to-br ${jy[d]} border rounded-xl p-4 relative group`,title:c,children:[l.jsx("div",{className:"text-gray-400 text-xs font-medium uppercase tracking-wider mb-2",children:r}),l.jsx("div",{className:`text-2xl font-bold ${Ny[d]}`,children:u}),o&&l.jsx("div",{className:"text-gray-500 text-xs mt-1",children:o}),c&&l.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2.5 py-1.5 bg-gray-800 border border-gray-700 rounded-lg text-[10px] text-gray-300 whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 shadow-lg",children:[c,l.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-4 border-transparent border-t-gray-800"})]})]})}const Sy={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function wy(r){return Sy[r]||"#6b7280"}function Ey({segments:r,size:u=160,centerLabel:o,centerValue:c}){const d=r.reduce((p,h)=>p+h.value,0);if(d===0)return l.jsx("div",{className:"flex items-center justify-center",style:{width:u,height:u},children:l.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const x=52,m=2*Math.PI*x;let j=0;return l.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:u,height:u},children:[l.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:r.map((p,h)=>{const y=p.value/d*m,C=j;return j+=y,l.jsx("circle",{cx:"64",cy:"64",r:x,fill:"none",stroke:p.color,strokeWidth:"12",strokeDasharray:`${y} ${m-y}`,strokeDashoffset:-C,className:"transition-all duration-500"},h)})}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c!=null&&l.jsx("span",{className:"text-xl font-bold text-white",children:c}),o&&l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:o})]})]})}function Cy(r){return Object.entries(r).filter(([u,o])=>o>0).map(([u,o])=>({label:u,value:o,color:wy(u)}))}const Ty={default:"bg-gray-800 text-gray-300",success:"bg-emerald-500/15 text-emerald-400",warning:"bg-amber-500/15 text-amber-400",error:"bg-rose-500/15 text-rose-400",info:"bg-cyan-500/15 text-cyan-400"};function oe({label:r,variant:u="default"}){return l.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${Ty[u]}`,children:r})}function kr(r){switch(r){case"active":case"running":return"info";case"completed":case"success":return"success";case"paused":case"pending":case"planning":return"warning";case"failed":case"abandoned":case"error":return"error";default:return"default"}}function Ay({size:r="md"}){const u={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return l.jsxs("svg",{className:`${u[r]} animate-spin text-indigo-400`,viewBox:"0 0 24 24",fill:"none",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function et(){return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(Ay,{size:"lg"})})}function Gt({message:r,onRetry:u,title:o="Something went wrong"}){const c=r.toLowerCase().includes("timed out");return l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-5 py-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-rose-300",children:o}),l.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:r})]}),u&&l.jsx("button",{onClick:u,className:"text-xs text-rose-400 hover:text-rose-200 px-3 py-1.5 border border-rose-700 rounded transition-colors flex-shrink-0",children:"Retry"})]}),c&&l.jsx("p",{className:"text-[10px] text-rose-400/60",children:"The server may be processing a large number of session logs. Try again in a moment."})]})})}function tx(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function Ry(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}const ax=r=>r.billingContext?.planType==="subscription";function My(){const[r,u]=b.useState(0),{data:o,loading:c,error:d,refetch:x}=Te(`/api/overview?_r=${r}`),[m,j]=b.useState([]),[p,h]=b.useState([]),[N,y]=b.useState([]),{activeProject:C}=qa();Le("increment-update",()=>u(v=>v+1)),Le("notification",()=>u(v=>v+1)),Le("sync-update",()=>u(v=>v+1)),Le("sync-error",()=>u(v=>v+1)),Le("cost-update",()=>u(v=>v+1));const _=b.useRef(null);b.useEffect(()=>{if(!C||_.current===C.id)return;_.current=C.id;const v=`project=${C.id}`;fetch(`/api/activity/stream?limit=20&${v}`).then(w=>w.json()).then(w=>{w.ok&&Array.isArray(w.data)&&j(w.data)}).catch(()=>{})},[C]);const z=b.useCallback(v=>{j(w=>[v,...w].slice(0,20))},[]);if(Le("activity",z),b.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=5").then(v=>v.json()).then(v=>{v.ok&&Array.isArray(v.data)&&h(v.data)}).catch(()=>{}),fetch("/api/sync/gaps").then(v=>v.json()).then(v=>{v.ok&&Array.isArray(v.data)&&y(v.data)}).catch(()=>{})},[r]),c)return l.jsx(et,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!o)return null;const A=Cy(o.project.statusBreakdown);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("h2",{className:"text-lg font-semibold text-gray-200",children:[o.project.name||"Project"," Overview"]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Fe,{to:"/increments?status=active",className:"group",children:l.jsx(ie,{title:"Active Increments",value:o.project.activeIncrements,subtitle:`${o.project.totalIncrements} total`,color:"indigo"})}),l.jsx(Fe,{to:"/increments?status=completed",className:"group",children:l.jsx(ie,{title:"Completed",value:o.project.completedIncrements,subtitle:`${Math.round(o.project.completedIncrements/Math.max(o.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),l.jsx(Fe,{to:"/costs",className:"group",children:l.jsx(ie,{title:"Estimated API Value",value:o.costs.totalCost==null?"Unknown":`$${o.costs.totalCost.toFixed(2)}`,subtitle:ax(o.costs)?`via Claude Code · $${o.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`Claude Code · ${o.costs.sessionCount.toLocaleString()} sessions · legacy estimates`,color:"amber"})}),l.jsx(Fe,{to:"/analytics",className:"group",children:l.jsx(ie,{title:"Events Today",value:o.analytics.last24hEvents,subtitle:`${o.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),l.jsx(Dy,{}),ax(o.costs)&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(oe,{label:"Subscription",variant:"info"}),l.jsx("span",{className:"text-xs text-gray-300",children:"Legacy rate estimates from Claude Code logs; actual bills may differ."})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Status"}),l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(Ey,{segments:A,centerValue:o.project.totalIncrements,centerLabel:"total"})}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:A.map(v=>l.jsxs(Fe,{to:`/increments?status=${v.label.toLowerCase()}`,className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:v.color}}),l.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[v.label," (",v.value,")"]})]},v.label))})]}),l.jsxs(Fe,{to:"/sync",className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 hover:border-gray-700 transition-colors block",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Health"}),l.jsx("div",{className:"space-y-3",children:Object.entries(o.sync.platforms).length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(o.sync.platforms).map(([v,w])=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:v}),w.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:w.configDetail}),!w.configDetail&&w.lastImport&&l.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(w.lastImport).toLocaleDateString()]})]}),l.jsx(oe,{label:Ry(w.connectionStatus||w.lastSyncResult),variant:tx(w.connectionStatus)!=="default"?tx(w.connectionStatus):kr(w.lastSyncResult||"")})]},v))}),l.jsx("div",{className:"mt-4 pt-4 border-t border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Notifications"}),l.jsxs("div",{className:"flex gap-2",children:[o.notifications.criticalCount>0&&l.jsx(Fe,{to:"/notifications",onClick:v=>v.stopPropagation(),children:l.jsx(oe,{label:`${o.notifications.criticalCount} critical`,variant:"error"})}),l.jsx(Fe,{to:"/notifications",onClick:v=>v.stopPropagation(),children:l.jsx(oe,{label:`${o.notifications.pendingCount} pending`,variant:o.notifications.pendingCount>0?"warning":"default"})})]})]})})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Live Activity"}),l.jsx(Fe,{to:"/activity",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:m.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):m.map((v,w)=>l.jsxs("div",{className:"flex items-start gap-2 py-1 slide-in",children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 ${v.severity==="error"?"bg-rose-400":v.severity==="warning"?"bg-amber-400":"bg-gray-600"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-gray-400 truncate",children:v.title}),l.jsxs("div",{className:"text-[10px] text-gray-600",children:[v.category,v.timestamp&&` · ${lx(v.timestamp)}`]})]})]},w))})]})]}),N.length>0&&l.jsxs(Fe,{to:"/sync",className:"bg-amber-500/10 border border-amber-500/20 rounded-xl px-4 py-3 flex items-center gap-3 hover:border-amber-500/30 transition-colors block",children:[l.jsx(oe,{label:`${N.length} gaps`,variant:"warning"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[N.length," increment",N.length!==1?"s have":" has"," partial sync coverage"]})]}),p.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sync Errors"}),l.jsx(Fe,{to:"/sync",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2",children:p.map((v,w)=>l.jsxs("div",{className:"flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:v.provider}),l.jsx(oe,{label:v.incrementId,variant:"default"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:v.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:lx(v.timestamp)})]})]},w))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Types"}),l.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(o.project.typeBreakdown).map(([v,w])=>l.jsxs(Fe,{to:`/increments?type=${v}`,className:"flex items-center gap-2 px-3 py-2 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors",children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:v}),l.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:w})]},v))})]})]})}function Dy(){const[r,u]=b.useState(0);Le("error-detected",()=>u(_=>_+1));const{data:o}=Te(`/api/prompt-health?_r=${r}`);if(!o?.health||o.health.warningLevel==="normal")return null;const{health:c,alert:d}=o,x=d?.level==="emergency",m=c.warningLevel==="critical"||x,j=m?"border-rose-500/30":"border-amber-500/20",p=m?"bg-rose-500/10":"bg-amber-500/10",h=m?"text-rose-400":"text-amber-400",N=Math.round(c.baseline/1e3),y=Math.min(Math.round(c.baseline/2e5*100),100),C=m?"bg-rose-500":"bg-amber-500";return l.jsxs("div",{className:`${p} border ${j} rounded-xl px-4 py-3 space-y-2`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(oe,{label:m?"Critical":"Warning",variant:m?"error":"warning"}),l.jsxs("span",{className:`text-xs ${h}`,children:["Prompt baseline: ",N,"KB (",y,"% of context window)"]})]}),l.jsx(Fe,{to:"/errors",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Details"})]}),l.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5",children:l.jsx("div",{className:`${C} h-1.5 rounded-full`,style:{width:`${y}%`}})}),l.jsxs("div",{className:"flex gap-4 text-[10px] text-gray-500",children:[l.jsxs("span",{children:["CLAUDE.md: ",Math.round(c.claudeMdSize/1e3),"KB"]}),l.jsxs("span",{children:["MEMORY.md: ",Math.round(c.memoryMdSize/1e3),"KB"]}),l.jsxs("span",{children:["Skills: ",Math.round(c.skillBudget/1e3),"KB"]}),d&&l.jsxs("span",{className:h,children:["Compactions: ",d.compactionCount]})]})]})}function lx(r){try{const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function _y(){const r=wo(),[u]=Or();return b.useCallback(o=>{const c=u.get("project");if(c){const d=o.includes("?")?"&":"?";r(`${o}${d}project=${encodeURIComponent(c)}`)}else r(o)},[r,u])}const In=new Map;let uo=!1,Gx=null;function zy(){uo||(uo=!0,queueMicrotask(()=>{uo=!1;const r=Gx;if(!r||In.size===0){In.clear();return}const u=new Map(In);In.clear(),r(o=>{const c=new URLSearchParams(o);for(const[d,{value:x,defaultValue:m}]of u)x&&x!==m?c.set(d,x):c.delete(d);return c})}))}function kt(r,u=""){const[o,c]=Or(),d=o.get(r)??u,x=b.useCallback(m=>{Gx=c,In.set(r,{value:m,defaultValue:u}),zy()},[r,u,c]);return[d,x]}function Do({title:r,description:u}){return l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),l.jsx("h3",{className:"text-gray-400 text-sm font-medium",children:r}),u&&l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:u})]})}const Fn=50;function Oy(){const[r,u]=b.useState(0),[o,c]=b.useState(0),[d,x]=kt("status","all"),[m,j]=kt("type","all"),p=_y(),h=b.useRef(void 0);Le("increment-update",()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>u(O=>O+1),500)}),b.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const N=new URLSearchParams({_r:String(r),limit:String(Fn),offset:String(o)});d!=="all"&&N.set("status",d),m!=="all"&&N.set("type",m);const{data:y,loading:C,error:_,refetch:z}=Te(`/api/increments?${N}`),A=b.useRef(d),v=b.useRef(m);if(b.useEffect(()=>{(A.current!==d||v.current!==m)&&(c(0),A.current=d,v.current=m)},[d,m]),C&&o===0)return l.jsx(et,{});if(_)return l.jsx(Gt,{message:_,onRetry:z});if(!y)return null;const w=Object.keys(y.summary).filter(O=>O!=="total"&&y.summary[O]>0),T=y.pagination;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Increments"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[T?.total??y.increments.length," total"]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Status:"}),l.jsxs("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[l.jsx(fo,{label:"All",active:d==="all",onClick:()=>x("all"),count:y.summary.total}),w.map(O=>l.jsx(fo,{label:O,active:d===O,onClick:()=>x(O),count:y.summary[O]},O))]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Type:"}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:l.jsx(fo,{label:"All",active:m==="all",onClick:()=>j("all")})})]}),T&&T.total>0&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",o+1,"–",Math.min(o+Fn,T.total)," of ",T.total]})]}),y.increments.length===0?l.jsx(Do,{title:"No increments match filters",description:"Try adjusting your filters"}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ID"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Title"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Type"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Priority"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Tasks"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ACs"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Last Activity"})]})}),l.jsx("tbody",{children:y.increments.map(O=>l.jsxs("tr",{onClick:()=>p(`/increments/${O.id}`),className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors cursor-pointer",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:O.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-sm text-gray-300",children:O.title})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(oe,{label:O.status,variant:kr(O.status)})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:O.type})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ky,{priority:O.priority})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(nx,{completed:O.tasks.completed,total:O.tasks.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(nx,{completed:O.acs.completed,total:O.acs.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-500",children:O.lastActivity?Ly(O.lastActivity):"-"})})]},O.id))})]})}),T&&T.total>Fn&&l.jsxs("div",{className:"flex justify-center gap-2",children:[l.jsx("button",{onClick:()=>c(Math.max(0,o-Fn)),disabled:o===0,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Previous"}),l.jsx("button",{onClick:()=>c(o+Fn),disabled:!T.hasMore,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Next"})]})]})}function fo({label:r,active:u,onClick:o,count:c}){return l.jsxs("button",{onClick:o,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${u?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[r,c!==void 0&&l.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function nx({completed:r,total:u}){const o=u>0?Math.round(r/u*100):0;return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${o}%`}})}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r,"/",u]})]})}function ky({priority:r}){const u={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${u[r]||u.P2}`,children:r})}function Ly(r){try{const u=new Date(r),c=new Date().getTime()-u.getTime(),d=Math.floor(c/6e4);if(d<1)return"Just now";if(d<60)return`${d}m ago`;const x=Math.floor(d/60);if(x<24)return`${x}h ago`;const m=Math.floor(x/24);return m<7?`${m}d ago`:u.toLocaleDateString()}catch{return r}}function Uy(){const[r,u]=b.useState("skills"),[o,c]=b.useState(!1),[d,x]=b.useState(0);Le("analytics-event",()=>x(w=>w+1));const{data:m,loading:j,error:p,refetch:h,fetchedAt:N}=Te(`/api/analytics/summary?_r=${d}`),{data:y,loading:C,refetch:_}=Te(`/api/analytics/skills?_r=${d}`);if(j||C)return l.jsx(et,{});if(p)return l.jsx(Gt,{message:p,onRetry:h});if(!m)return null;const z=m.topCommands?.reduce((w,T)=>w+T.count,0)||0,A=m.topSkills?.reduce((w,T)=>w+T.count,0)||0,v=m.topAgents?.reduce((w,T)=>w+T.count,0)||0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Analytics"}),l.jsxs("div",{className:"flex items-center gap-3",children:[N&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",N.toLocaleTimeString()]}),l.jsxs("span",{className:"text-sm text-gray-500",children:[m.totalEvents.toLocaleString()," total events"]}),l.jsx("button",{onClick:()=>{c(!0),h(),_(),setTimeout(()=>c(!1),600)},disabled:o,className:"p-1.5 text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50",title:"Refresh analytics",children:l.jsx("svg",{className:`w-4 h-4 ${o?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Total Events",value:m.totalEvents.toLocaleString(),subtitle:`${m.successRate}% success rate`,color:"indigo",tooltip:`${m.totalEvents} events tracked from analytics JSONL`}),l.jsx(ie,{title:"Commands",value:z.toLocaleString(),subtitle:`${m.topCommands?.length||0} unique`,color:"cyan",tooltip:`${z} total command invocations across ${m.topCommands?.length||0} distinct commands`}),l.jsx(ie,{title:"Skills",value:A.toLocaleString(),subtitle:`${m.topSkills?.length||0} unique`,color:"emerald",tooltip:`${A} total skill activations across ${m.topSkills?.length||0} distinct skills`}),l.jsx(ie,{title:"Agents",value:v.toLocaleString(),subtitle:`${m.topAgents?.length||0} unique`,color:"amber",tooltip:`${v} agent spawns across ${m.topAgents?.length||0} distinct agent types`})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{key:"skills",label:"Skills"},{key:"commands",label:"Commands"},{key:"agents",label:"Agents"},{key:"daily",label:"Daily Trends"}].map(w=>l.jsx("button",{onClick:()=>u(w.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===w.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:w.label},w.key))}),r==="commands"&&l.jsx(Hy,{commands:m.topCommands||[]}),r==="skills"&&l.jsx(By,{skills:y||[]}),r==="agents"&&l.jsx($y,{agents:m.topAgents||[]}),r==="daily"&&l.jsx(qy,{days:m.dailySummaries||[]})]})}function Hy({commands:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No command data available"})});const u=[...r].sort((c,d)=>d.count-c.count),o=u[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Commands"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Command"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:u.map((c,d)=>{const x=Math.max(2,c.count/o*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-indigo-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function By({skills:r}){const u=[...r].sort((o,c)=>c.count-o.count);return u.length===0?l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No skill usage data available"})}):l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Skill Usage Leaderboard"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Skill Name"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Plugin"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Invocations"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Success Rate"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Last Used"})]})}),l.jsx("tbody",{children:u.map((o,c)=>{const d=o.count>0?Math.round(o.successCount/o.count*100):100,x=d>=90?"success":d>=70?"warning":"error";return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",c+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:o.name})}),l.jsx("td",{className:"px-4 py-2.5",children:o.plugin&&l.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:o.plugin})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:o.count.toLocaleString()}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsx(oe,{label:`${d}%`,variant:x})}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:o.lastUsed?Yy(o.lastUsed):"-"})]},o.name)})})]})]})}function $y({agents:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No agent data available"})});const u=[...r].sort((c,d)=>d.count-c.count),o=u[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Agents"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Agent"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:u.map((c,d)=>{const x=Math.max(2,c.count/o*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-cyan-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function qy({days:r}){const u=r.slice(-14);if(u.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No daily data available"})});const o=Math.max(...u.map(x=>x.totalEvents),1),c=u.reduce((x,m)=>x+m.totalEvents,0),d=Math.round(c/u.length);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(ie,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${u.length} days`,color:"indigo"}),l.jsx(ie,{title:"Daily Average",value:d.toLocaleString(),color:"cyan"}),l.jsx(ie,{title:"Peak Day",value:o.toLocaleString(),subtitle:u.find(x=>x.totalEvents===o)?.date||"",color:"emerald"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:["Daily Events (Last ",u.length," Days)"]}),l.jsx("div",{className:"flex items-end gap-1.5 h-40",children:u.map(x=>{const m=Math.max(2,x.totalEvents/o*100),j=x.date.slice(5);return l.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-gray-500",children:x.totalEvents}),l.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${m}%`},title:`${x.date}: ${x.totalEvents} events`}),l.jsx("span",{className:"text-[8px] text-gray-700",children:j})]},x.date)})})]})]})}function Yy(r){if(!r)return"";try{const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function Vx({items:r,maxBars:u=10}){const o=[...r].sort((d,x)=>x.value-d.value).slice(0,u),c=Math.max(...o.map(d=>d.value),1);return l.jsx("div",{className:"space-y-2",children:o.map((d,x)=>l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xs text-gray-400 w-28 truncate text-right",title:d.label,children:d.label}),l.jsx("div",{className:"flex-1 h-5 bg-gray-800 rounded overflow-hidden",children:l.jsx("div",{className:"h-full rounded transition-all duration-500",style:{width:`${d.value/c*100}%`,backgroundColor:d.color||"#6366f1"}})}),l.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:d.value})]},x))})}const Gy={anthropic:"#6366f1",openai:"#10b981",google:"#f59e0b",mistral:"#ef4444",groq:"#8b5cf6",together:"#06b6d4","aws-bedrock":"#f97316","azure-openai":"#3b82f6"};function Vy({data:r,showProviderLines:u=!1,height:o=200}){if(!r||r.length===0)return l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 text-sm",children:"No spend data available"});const c={top:20,right:20,bottom:30,left:50},d=600,x=d-c.left-c.right,m=o-c.top-c.bottom,j=Math.max(...r.map(A=>A.total_cost),.01),p=A=>c.left+A/Math.max(r.length-1,1)*x,h=A=>c.top+m-A/j*m,N=r.map((A,v)=>`${v===0?"M":"L"} ${p(v).toFixed(1)} ${h(A.total_cost).toFixed(1)}`).join(" "),y=[];if(u){const A=new Set;r.forEach(v=>Object.keys(v.providers).forEach(w=>A.add(w)));for(const v of A){const w=r.map((T,O)=>{const W=T.providers[v]?.cost??0;return`${O===0?"M":"L"} ${p(O).toFixed(1)} ${h(W).toFixed(1)}`}).join(" ");y.push({provider:v,path:w,color:Gy[v]||"#9ca3af"})}}const C=[0,j/2,j].map(A=>({value:A,y:h(A),label:`$${A<1?A.toFixed(2):A.toFixed(0)}`})),_=Math.min(r.length,5),z=Array.from({length:_},(A,v)=>{const w=Math.round(v/Math.max(_-1,1)*(r.length-1));return{x:p(w),label:r[w].date.slice(5)}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("svg",{viewBox:`0 0 ${d} ${o}`,className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[C.map((A,v)=>l.jsx("line",{x1:c.left,y1:A.y,x2:d-c.right,y2:A.y,stroke:"#374151",strokeDasharray:"4 4"},v)),C.map((A,v)=>l.jsx("text",{x:c.left-8,y:A.y+4,textAnchor:"end",fill:"#9ca3af",fontSize:"10",children:A.label},`y-${v}`)),z.map((A,v)=>l.jsx("text",{x:A.x,y:o-5,textAnchor:"middle",fill:"#9ca3af",fontSize:"10",children:A.label},`x-${v}`)),y.map(A=>l.jsx("path",{d:A.path,fill:"none",stroke:A.color,strokeWidth:"1.5",strokeOpacity:"0.5"},A.provider)),l.jsx("path",{d:N,fill:"none",stroke:"#6366f1",strokeWidth:"2.5"}),r.map((A,v)=>l.jsx("circle",{cx:p(v),cy:h(A.total_cost),r:"3",fill:"#6366f1",className:"hover:r-5 transition-all",children:l.jsx("title",{children:`${A.date}: $${A.total_cost.toFixed(4)}`})},v))]}),u&&y.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-gray-400",children:y.map(A=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:A.color}}),l.jsx("span",{children:A.provider})]},A.provider))})]})}const Qy={anthropic:"bg-indigo-500/20 text-indigo-400",openai:"bg-emerald-500/20 text-emerald-400",google:"bg-amber-500/20 text-amber-400",mistral:"bg-red-500/20 text-red-400",groq:"bg-violet-500/20 text-violet-400",together:"bg-cyan-500/20 text-cyan-400","aws-bedrock":"bg-orange-500/20 text-orange-400","azure-openai":"bg-blue-500/20 text-blue-400"};function sx(r){return r<.01?`$${r.toFixed(4)}`:`$${r.toFixed(2)}`}function rx(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r)}function Xy({data:r}){const[u,o]=b.useState(null);if(!r||Object.keys(r).length===0)return l.jsx("div",{className:"text-sm text-gray-500 py-4 text-center",children:"No multi-provider spend data"});const c=Object.entries(r).sort((d,x)=>x[1].total_cost-d[1].total_cost);return l.jsx("div",{className:"space-y-2",children:c.map(([d,x])=>l.jsxs("div",{children:[l.jsxs("button",{className:"w-full flex items-center justify-between p-2 rounded hover:bg-gray-800/50 transition-colors",onClick:()=>o(u===d?null:d),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Qy[d]||"bg-gray-500/20 text-gray-400"}`,children:d}),l.jsxs("span",{className:"text-xs text-gray-500",children:[x.sessions," sessions"]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{className:"text-gray-400",children:[rx(x.total_tokens)," tokens"]}),l.jsx("span",{className:"text-white font-medium",children:sx(x.total_cost)}),l.jsx("span",{className:"text-gray-600",children:u===d?"▲":"▼"})]})]}),u===d&&l.jsx("div",{className:"ml-6 mt-1 space-y-1",children:Object.entries(x.models).sort((m,j)=>j[1].cost-m[1].cost).map(([m,j])=>l.jsxs("div",{className:"flex items-center justify-between py-1 px-2 text-xs text-gray-400",children:[l.jsx("span",{className:"truncate max-w-48",children:m}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{children:rx(j.tokens)}),l.jsx("span",{className:"text-gray-300",children:sx(j.cost)})]})]},m))})]},d))})}function Zy({currentSpend:r,monthlyLimit:u}){if(!u)return null;const o=r/u*100,c=Math.min(o,100);let d="bg-emerald-500",x="";return o>=100?(d="bg-red-500",x="animate-pulse ring-1 ring-red-500/50"):o>=80&&(d="bg-amber-500"),l.jsxs("div",{className:`rounded-lg p-3 bg-gray-800/50 ${x}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Monthly Budget"}),l.jsxs("span",{className:"text-sm font-medium text-gray-200",children:["$",r.toFixed(2)," / $",u.toFixed(2)]})]}),l.jsx("div",{className:"h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d}`,style:{width:`${c}%`}})}),l.jsx("div",{className:"mt-1 text-right",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[o.toFixed(1),"%"]})})]})}function Ky(){const[r,u]=b.useState("overview"),[o,c]=b.useState(null),[d,x]=b.useState(0);Le("cost-update",()=>x(T=>T+1));const{data:m,loading:j,error:p,refetch:h}=Te(`/api/costs/summary?_r=${d}`);if(j)return l.jsx(et,{});if(p)return l.jsx(Gt,{message:p,onRetry:h});if(!m)return null;const N=m.sessions||[],y=m.billingContext?.planType==="subscription",C=m.modelBreakdown?Object.entries(m.modelBreakdown).map(([T,O])=>({model:T,...O})).sort((T,O)=>(O.cost??-1)-(T.cost??-1)):Wy(N),_=N.reduce((T,O)=>T+(O.inputTokens||0),0),z=N.reduce((T,O)=>T+(O.outputTokens||0),0),A=N.reduce((T,O)=>T+(O.cacheReadTokens||0),0),v=N.reduce((T,O)=>T+(O.cacheWriteTokens||0),0),w=_+z+A+v;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("svg",{className:"w-5 h-5 text-amber-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),l.jsx("path",{d:"M2 17l10 5 10-5"}),l.jsx("path",{d:"M2 12l10 5 10-5"})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Claude Code Usage"}),l.jsx("span",{className:"text-xs text-gray-500",children:y&&m.billingContext?.monthlyAmount?`$${m.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),l.jsxs("p",{className:"text-xs text-gray-400 border border-gray-800 rounded-lg px-4 py-3",children:["Local Claude Code logs only. Prices use exact matches in the ",m.pricingAsOf||"2026-03"," legacy rate table. These are API estimates, not bills. Unknown or mixed-model sessions are unpriced.",!!m.unpricedSessionCount&&l.jsxs("span",{className:"block mt-1 text-amber-300",children:[m.unpricedSessionCount," unpriced session",m.unpricedSessionCount===1?"":"s"," · Priced subtotal: ",il(m.estimatedSubtotal)]})]}),y&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(oe,{label:"Subscription",variant:"info"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[m.billingContext?.monthlyAmount?`$${m.billingContext.monthlyAmount}/mo plan. `:"","Costs shown as API-equivalent value for usage analytics."]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Estimated API Value",value:il(m.totalCost),subtitle:y&&m.billingContext?.monthlyAmount?`Your plan: $${m.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),l.jsx(ie,{title:"Estimated Cache Savings",value:il(m.totalSavings),subtitle:y?"API-equivalent savings from cache":void 0,color:"emerald"}),l.jsx(ie,{title:"Total Tokens",value:Jl(m.totalTokens),subtitle:Fy(m.totalTokens),color:"indigo"}),l.jsx(ie,{title:"Sessions",value:m.sessionCount.toLocaleString(),color:"cyan"})]}),m.budget&&m.budget.monthlyLimit>0&&l.jsx(Zy,{currentSpend:m.budget.currentSpend,monthlyLimit:m.budget.monthlyLimit}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["overview","trends","providers","sessions"].map(T=>{const O={overview:"Breakdown",trends:"Trends",providers:"Providers",sessions:`Sessions (${N.length})`};return l.jsx("button",{onClick:()=>u(T),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===T?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:O[T]},T)})}),r==="overview"&&l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Priced Model Estimates"}),C.some(T=>T.cost!=null)?l.jsx(Vx,{items:C.filter(T=>T.cost!=null).map(T=>({label:T.model,value:Number(T.cost?.toFixed(2)),color:"#f59e0b"}))}):l.jsx("p",{className:"text-gray-600 text-xs",children:"No priced model estimates"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Token Breakdown"}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(Er,{label:"Input",value:_,total:w,color:"bg-indigo-500"}),l.jsx(Er,{label:"Output",value:z,total:w,color:"bg-cyan-500"}),A>0&&l.jsx(Er,{label:"Cache Read",value:A,total:w,color:"bg-emerald-500"}),v>0&&l.jsx(Er,{label:"Cache Write",value:v,total:w,color:"bg-amber-500"})]})]}),C.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden lg:col-span-2",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Model Details"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tokens"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Estimate"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Avg/Session"})]})}),l.jsx("tbody",{children:C.map(T=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:T.model}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T.sessions.toLocaleString()}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Jl(T.tokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:il(T.cost)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:il(T.cost!=null&&T.sessions>0?T.cost/T.sessions:null,4)})]},T.model))})]})]})]}),r==="trends"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Daily Cost Trends"}),l.jsx(Vy,{data:m.trends||[],showProviderLines:!0,height:250})]}),r==="providers"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Provider Breakdown"}),l.jsx(Xy,{data:m.providerBreakdown})]}),r==="sessions"&&l.jsx(Jy,{sessions:N,expandedSession:o,onToggle:T=>c(o===T?null:T)}),l.jsx("div",{className:"text-center py-4 border-t border-gray-800/50",children:l.jsx("span",{className:"text-xs text-gray-600",children:"More providers coming soon"})})]})}const xo=37,ix=210,cx=5;function Jy({sessions:r,expandedSession:u,onToggle:o}){const c=b.useRef(null),[d,x]=b.useState(0),m=b.useCallback(()=>{c.current&&x(c.current.scrollTop)},[]),j=b.useMemo(()=>r.map(A=>(A.sessionId||"-")===u?ix:xo),[r,u]),p=b.useMemo(()=>{const A=[];let v=0;for(const w of j)A.push(v),v+=w;return A},[j]),h=p.length>0?p[p.length-1]+j[j.length-1]:0,N=Math.min(h,xo*20),y=b.useMemo(()=>{if(r.length===0)return{start:0,end:0};const A=d,v=d+N;let w=0,T=r.length-1;for(;w<T;){const X=w+T>>1;p[X]+j[X]<=A?w=X+1:T=X}const O=Math.max(0,w-cx);for(w=O,T=r.length-1;w<T;){const X=w+T+1>>1;p[X]>=v?T=X-1:w=X}const W=Math.min(r.length,w+cx+1);return{start:O,end:W}},[d,N,r.length,p,j]);if(b.useEffect(()=>{if(!u||!c.current)return;const A=r.findIndex(O=>(O.sessionId||"-")===u);if(A<0)return;const v=p[A],w=v+ix,T=c.current;w>T.scrollTop+N?T.scrollTop=w-N:v<T.scrollTop&&(T.scrollTop=v)},[u,r,p,N]),r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No session data available"})});const C=r.slice(y.start,y.end),_=y.start>0?p[y.start]:0,z=y.end<r.length?h-p[y.end]:0;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r.length," sessions"]})]}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-8"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Input"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Output"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cache"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Estimate"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"When"})]})})}),l.jsx("div",{ref:c,onScroll:m,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${N}px`},children:l.jsxs("div",{style:{height:`${h}px`,position:"relative"},children:[_>0&&l.jsx("div",{style:{height:`${_}px`}}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("tbody",{children:C.map(A=>{const v=A.sessionId||"-",w=u===v,T=(A.cacheReadTokens||0)+(A.cacheWriteTokens||0);return l.jsxs(b.Fragment,{children:[l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${xo}px`},onClick:()=>o(v),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 w-8",children:l.jsx("span",{className:`inline-block transition-transform ${w?"rotate-90":""}`,children:"▸"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:v.slice(0,8)}),l.jsx("td",{className:"px-4 py-2",title:A.models?.join(" → "),children:l.jsx(oe,{label:A.model||"unknown",variant:"default"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Jl(A.inputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Jl(A.outputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T>0?Jl(T):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:il(A.cost,4)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:A.duration?ox(A.duration):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Py(A.timestamp)})]}),w&&l.jsx("tr",{className:"border-b border-gray-800/50",children:l.jsx("td",{colSpan:9,className:"px-6 py-3 bg-gray-800/20",children:l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs",children:[l.jsxs("div",{className:"col-span-full",children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Observed model IDs"}),l.jsx("span",{className:"text-gray-300 font-mono break-all",children:A.models?.join(" → ")||A.model||"unknown"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Input Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:A.inputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Output Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:A.outputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Write"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(A.cacheWriteTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Read"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(A.cacheReadTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"API Estimate"}),l.jsx("span",{className:"text-amber-400 font-mono",children:il(A.cost,6)})]}),A.savings!=null&&A.savings>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Savings"}),l.jsxs("span",{className:"text-emerald-400 font-mono",children:["$",A.savings.toFixed(6)]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Duration"}),l.jsx("span",{className:"text-gray-300",children:A.duration?ox(A.duration):"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Session ID"}),l.jsx("span",{className:"text-gray-400 font-mono text-[10px]",children:A.sessionId})]})]})})})]},v)})})}),z>0&&l.jsx("div",{style:{height:`${z}px`}})]})})]})}function Er({label:r,value:u,total:o,color:c}){const d=o>0?u/o*100:0,x={"bg-indigo-500":"rgb(99 102 241 / 0.6)","bg-cyan-500":"rgb(6 182 212 / 0.6)","bg-emerald-500":"rgb(16 185 129 / 0.6)","bg-amber-500":"rgb(245 158 11 / 0.6)"};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[Jl(u)," (",d.toFixed(1),"%)"]})]}),l.jsx("div",{className:"h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full",style:{width:`${d}%`,backgroundColor:x[c]||c}})})]})}function Wy(r){const u=new Map;for(const o of r){const c=o.model||"unknown",d=u.get(c)||{cost:0,tokens:0,sessions:0};d.cost=d.cost==null||o.cost==null?null:d.cost+o.cost,d.tokens+=(o.inputTokens||0)+(o.outputTokens||0),d.sessions++,u.set(c,d)}return Array.from(u.entries()).map(([o,c])=>({model:o,...c})).sort((o,c)=>(c.cost??-1)-(o.cost??-1))}function Jl(r){return r?r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r):"0"}function Fy(r){return r?r.toLocaleString():"0"}function ox(r){const u=Math.round(r);if(u<60)return`${u}s`;const o=Math.floor(u/60),c=u%60;return o<60?`${o}m ${c}s`:`${Math.floor(o/60)}h ${o%60}m`}function Py(r){if(!r)return"-";try{const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function il(r,u=2){return r==null?"Unknown":`$${r.toFixed(u)}`}function Lr(){const[r,u]=b.useState(!1),[o,c]=b.useState(null),[d,x]=b.useState(null),[m,j]=b.useState([]),[p,h]=b.useState("idle"),N=b.useRef(null),y=b.useRef(null);Le("command-output",z=>{const A=z;y.current&&A.executionId===y.current&&A.line&&j(v=>[...v,A.line])}),Le("command-complete",z=>{const A=z;if(y.current&&A.executionId===y.current){if(N.current&&(clearTimeout(N.current),N.current=null),u(!1),A.exitCode===0)h("success"),j(v=>[...v,"Command completed successfully."]);else{h("error");const v=`Command failed (exit code ${A.exitCode??"unknown"})`;x(v),j(w=>[...w,v])}y.current=null}}),b.useEffect(()=>()=>{N.current&&clearTimeout(N.current)},[]);const C=b.useCallback(async(z,A)=>{const v=A?.queryParams,w=A?.timeoutMs??6e4;u(!0),x(null),j([`> specweave ${z}${v?` (${Object.values(v).join(", ")})`:""}`]),h("running");try{const T=v?"?"+new URLSearchParams(v).toString():"",W=await(await fetch(`/api/commands/${z}${T}`,{method:"POST"})).json();if(!W.ok)return x(W.error||"Command failed"),h("error"),j(le=>[...le,`Error: ${W.error||"Command failed"}`]),u(!1),null;c(W.data),y.current=W.data?.id||null;const X=Math.round(w/1e3);return N.current=setTimeout(()=>{y.current&&(y.current=null,u(!1),h("error"),x(`Command timed out after ${X} seconds`),j(le=>[...le,`Timed out after ${X} seconds.`]))},w),W.data}catch(T){return x(String(T)),h("error"),j(O=>[...O,`Error: ${String(T)}`]),u(!1),null}},[]),_=b.useCallback(()=>{u(!1),c(null),x(null),j([]),h("idle"),y.current=null,N.current&&(clearTimeout(N.current),N.current=null)},[]);return{execute:C,running:r,result:o,error:d,output:m,status:p,reset:_}}function Iy(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function ev(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}function tv(){const[r,u]=b.useState("health"),[o,c]=b.useState(null),[d,x]=b.useState(0),[m,j]=b.useState([]);Le("sync-update",()=>x(H=>H+1)),Le("sync-error",()=>x(H=>H+1));const{data:p,loading:h,error:N,refetch:y}=Te(`/api/sync/status?_r=${d}`);b.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=20").then(H=>H.json()).then(H=>{H.ok&&Array.isArray(H.data)&&j(H.data)}).catch(()=>{})},[d]);const{data:C,loading:_}=Te(`/api/sync/audit?limit=100&_r=${d}`),{data:z,loading:A}=Te(`/api/sync/audit/summary?_r=${d}`),{execute:v,running:w}=Lr(),T=async(H,F)=>{const P=F?`${F}-${H}`:H;c(P);try{const se=new URLSearchParams(window.location.search).get("project")||"",ze=new URLSearchParams;ze.set("platform",H),F&&ze.set("repo",F),se&&ze.set("project",se);const Ae=new AbortController,V=setTimeout(()=>Ae.abort(),3e4);await fetch(`/api/sync/verify?${ze.toString()}`,{method:"POST",signal:Ae.signal}),clearTimeout(V),y()}catch{}c(null)};if(h||_||A)return l.jsx(et,{});if(N)return l.jsx(Gt,{message:N,onRetry:y});if(!p)return null;const O=C?.length||0,W=C?.filter(H=>H.result==="error").length||0,X=C?.filter(H=>H.conflict)||[],le=p.isUmbrella&&p.repos&&p.repos.length>0;let K=0,J=0;if(le&&p.repos)for(const H of p.repos){const F=Object.values(H.platforms).filter(P=>P.connectionStatus!=="not_configured");J+=F.length,K+=F.filter(P=>P.connectionStatus==="connected").length}else{const H=Object.entries(p.platforms).filter(([F])=>["github","jira","ado"].includes(F));J=H.length,K=H.filter(([,F])=>F.connectionStatus==="connected").length}return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Sync Health"}),!le&&l.jsx("button",{onClick:()=>v("sync-push"),disabled:w,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:w?"Syncing...":"Sync Now"})]}),p.permissions&&l.jsx(av,{permissions:p.permissions,onSave:y}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:le?"Repos":"Platforms",value:le?p.repos.length:J,subtitle:`${K} connected`,color:"indigo"}),l.jsx(ie,{title:"Audit Entries",value:O,color:"cyan"}),l.jsx(ie,{title:"Errors",value:W,color:"rose"}),l.jsx(ie,{title:"Conflicts",value:X.length,color:"amber"})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["health","audit","conflicts"].map(H=>l.jsx("button",{onClick:()=>u(H),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===H?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H==="health"?"Platform Health":H==="audit"?"Audit Log":`Conflicts (${X.length})`},H))}),r==="health"&&l.jsx(l.Fragment,{children:le&&p.repos?l.jsx(lv,{repos:p.repos,auditSummary:z,verifying:o,onVerify:T,execute:v,running:w}):l.jsx(nv,{platforms:p.platforms,auditSummary:z,verifying:o,onVerify:T})}),r==="health"&&m.length>0&&l.jsx(sv,{errors:m}),r==="audit"&&l.jsx(ux,{entries:C||[]}),r==="conflicts"&&l.jsx(ux,{entries:X}),p.lastUpdated&&l.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(p.lastUpdated).toLocaleString()]})]})}function av({permissions:r,onSave:u}){const[o,c]=b.useState(r),[d,x]=b.useState(!1),[m,j]=b.useState(null),p=JSON.stringify(o)!==JSON.stringify(r),h=async()=>{x(!0),j(null);try{const y=new URLSearchParams(window.location.search).get("project")||"",C=y?`?project=${y}`:"",_=await fetch(`/api/config${C}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:o}})});if(_.ok)u();else{const z=await _.json().catch(()=>({}));j(z.error||`Save failed (HTTP ${_.status})`)}}catch(y){j(String(y))}x(!1)},N=[{key:"canUpsertInternalItems",label:"Create/Update Internal",desc:"Can create/update items created by SpecWeave"},{key:"canUpdateExternalItems",label:"Update External",desc:"Can modify items originally from external tools"},{key:"canUpdateStatus",label:"Update Status",desc:"Can close/reopen issues on external platforms"},{key:"autoSyncOnCompletion",label:"Auto-Sync",desc:"Automatically sync when tasks are completed"}];return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Sync Permissions"}),p&&l.jsx("button",{onClick:h,disabled:d,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:d?"Saving...":"Save"})]}),m&&l.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",m]}),l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:N.map(({key:y,label:C,desc:_})=>l.jsxs("button",{onClick:()=>c(z=>({...z,[y]:!z[y]})),className:`text-left p-2.5 rounded-lg border transition-colors ${o[y]?"bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50":"bg-gray-800/30 border-gray-800 hover:border-gray-700"}`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${o[y]?"bg-emerald-400":"bg-gray-600"}`}),l.jsx("span",{className:"text-xs font-medium text-gray-300",children:C})]}),l.jsx("p",{className:"text-[10px] text-gray-500 leading-tight",children:_})]},y))})]})}function lv({repos:r,auditSummary:u,verifying:o,onVerify:c,execute:d,running:x}){return r.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No child repositories configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Add repos in umbrella.childRepos in config.json"})]}):l.jsx("div",{className:"space-y-4",children:r.map(m=>{const p=Object.entries(m.platforms).filter(([h])=>["github","jira","ado"].includes(h)).filter(([,h])=>h.connectionStatus!=="not_configured");return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:m.repoName}),m.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-emerald-500/15 text-emerald-400 rounded",children:".specweave"}),!m.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-gray-700/50 text-gray-500 rounded",children:"no .specweave"})]}),l.jsx("span",{className:"text-[10px] text-gray-600",children:m.repoPath})]}),l.jsx("button",{onClick:()=>d("sync-push",{queryParams:{repo:m.repoId}}),disabled:x||!m.hasSpecweave,title:m.hasSpecweave?"Sync this repository":"Initialize .specweave in this repo to enable sync",className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs rounded-lg transition-colors",children:x?"Syncing...":"Sync Now"})]}),p.length===0?l.jsxs("div",{className:"text-xs text-gray-600 p-3 bg-gray-800/20 rounded-lg",children:["No platforms configured for this repository.",l.jsx(Fe,{to:"/config",className:"ml-1 text-indigo-400 hover:text-indigo-300",children:"Configure"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:p.map(([h,N])=>l.jsx(Qx,{platform:h,info:N,summary:u?.[h],verifying:o===`${m.repoId}-${h}`,onVerify:()=>c(h,m.repoId)},h))})]},m.repoId)})})}function nv({platforms:r,auditSummary:u,verifying:o,onVerify:c}){const d=Object.entries(r).filter(([x])=>["github","jira","ado"].includes(x));return d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No sync platforms configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Configure GitHub, JIRA, or ADO in your config"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(([x,m])=>l.jsx(Qx,{platform:x,info:m,summary:u?.[x],verifying:o===x,onVerify:()=>c(x)},x))})}function Qx({platform:r,info:u,summary:o,verifying:c,onVerify:d}){const x=u.connectionStatus||"unknown";return l.jsxs("div",{className:"bg-gray-800/30 border border-gray-800/50 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Xx,{platform:r}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:r}),u.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:u.configDetail})]})]}),l.jsx(oe,{label:ev(x),variant:Iy(x)})]}),u.diagnosticMessage&&l.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:u.diagnosticMessage}),x==="not_configured"&&l.jsx(Fe,{to:"/config",className:"block text-center text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors",children:"Configure in Settings"}),x==="configured_never_synced"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors disabled:opacity-50",children:c?"Verifying...":"Verify Connection"}),x==="sync_failed"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-amber-400 hover:text-amber-300 py-2 border border-amber-500/20 rounded-lg hover:border-amber-500/40 transition-colors disabled:opacity-50",children:c?"Verifying...":"Retry Sync"}),l.jsxs("div",{className:"space-y-2 mt-3",children:[u.lastImport&&l.jsx(Xl,{label:"Last Import",value:new Date(u.lastImport).toLocaleString()}),x==="connected"&&!u.lastImport&&l.jsx(Xl,{label:"Status",value:"Connected, no imports yet"}),u.lastImportCount!=null&&u.lastImportCount>0&&l.jsx(Xl,{label:"Items Imported",value:u.lastImportCount.toLocaleString()}),u.lastSkippedCount!=null&&u.lastSkippedCount>0&&l.jsx(Xl,{label:"Skipped",value:u.lastSkippedCount.toLocaleString()}),o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-gray-800 my-2"}),l.jsx(Xl,{label:"Total Ops",value:o.total.toLocaleString()}),l.jsx(Xl,{label:"Success",value:o.success.toLocaleString()}),o.errors>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Errors"}),l.jsx(oe,{label:String(o.errors),variant:"error"})]})]})]})]})}function sv({errors:r}){const[u,o]=b.useState(null);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Errors (last 24h)"}),l.jsx("div",{className:"space-y-2",children:r.map((c,d)=>{const x=`${c.provider}-${c.incrementId}-${d}`,m=u===x;return l.jsxs("div",{children:[l.jsxs("button",{"data-testid":`sync-error-row-${d}`,onClick:()=>o(m?null:x),className:"w-full flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors text-left",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:c.provider}),l.jsx(oe,{label:c.incrementId,variant:"default"}),l.jsx(oe,{label:c.outcome,variant:"error"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:c.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Zx(c.timestamp)})]}),l.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:m?"▲":"▼"})]}),m&&l.jsxs("div",{"data-testid":`sync-error-detail-${d}`,className:"mt-1 p-3 bg-gray-800/30 rounded-lg border border-gray-800/50",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2 font-medium",children:"Full Error"}),l.jsx("pre",{className:"text-xs text-gray-500 whitespace-pre-wrap font-mono mb-2",children:c.error}),c.errorStack&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1 font-medium",children:"Stack Trace"}),l.jsx("pre",{className:"text-xs text-gray-600 whitespace-pre-wrap font-mono max-h-32 overflow-y-auto",children:c.errorStack.split(`
|
|
12
|
+
`).slice(0,3).join(`
|
|
13
|
+
`)})]})]})]},x)})})]})}function ux({entries:r}){const[u,o]=b.useState(null);if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No audit entries"})});const c={success:"success",error:"error",denied:"warning",skipped:"default"};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Time"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Platform"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Operation"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Item"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Direction"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Result"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"})]})}),l.jsx("tbody",{children:r.map((d,x)=>{const m=!!d.message,j=u===x;return l.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 ${m?"cursor-pointer":""}`,onClick:()=>m&&o(j?null:x),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Zx(d.timestamp)}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Xx,{platform:d.platform}),l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:d.platform})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:d.operation}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:d.itemId||"-"}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(oe,{label:d.direction,variant:d.direction==="push"?"info":"default"})}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(oe,{label:d.result,variant:c[d.result]||"default"}),m&&l.jsx("span",{className:"text-[10px] text-gray-600",children:j?"▲":"▼"})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:d.duration?`${d.duration}ms`:"-"})]},x)})})]}),u!==null&&r[u]?.message&&l.jsx("div",{className:"border-t border-gray-800 px-4 py-3 bg-gray-800/20",children:l.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-mono max-h-40 overflow-y-auto",children:r[u].message})})]})}function Xl({label:r,value:u}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:r}),l.jsx("span",{className:"text-xs text-gray-400",children:u})]})}function Xx({platform:r}){const u={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-5 h-5 rounded ${u[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-[9px] text-white font-bold",children:r[0]?.toUpperCase()})})}function Zx(r){if(!r)return"-";try{const u=new Date(r).getTime();if(isNaN(u))return"-";const o=Date.now()-u,c=Math.floor(o/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}catch{return"-"}}const Kx={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},es=50;function rv(){const[r,u]=kt("tab","groups"),[o,c]=kt("type",""),[d,x]=kt("q",""),[m,j]=kt("session",""),[p,h]=b.useState(0),[N,y]=b.useState(d),C=p*es,_=o?`&type=${encodeURIComponent(o)}`:"",z=d?`&search=${encodeURIComponent(d)}`:"",[A,v]=b.useState(0);Le("error-detected",()=>v(te=>te+1));const{data:w,loading:T,error:O}=Te(r==="groups"?`/api/errors/groups?_r=${A}`:""),{data:W,loading:X,error:le}=Te(r==="errors"||r==="groups"?`/api/errors/recent?limit=${es}&offset=${C}${_}${z}&_r=${A}`:""),{data:K,loading:J,error:H}=Te(r==="sessions"||m?`/api/errors/sessions?limit=50&_r=${A}`:""),{data:F,loading:P,error:se}=Te(r==="timeline"?`/api/errors/timeline?bucket=60&_r=${A}`:""),ze=b.useCallback(()=>{x(N.trim()),h(0),N.trim()&&u("errors")},[N,x,u]);b.useEffect(()=>{m&&K&&!K.find(te=>te.sessionId===m)&&j("")},[m,K,j]);const Ae=r==="groups"&&T||r==="errors"&&X||r==="timeline"&&P||r==="sessions"&&J,V=O||le||(r==="sessions"?H:null)||(r==="timeline"?se:null),R=W?.total||0,Q=W?.errors||[],ne=w?.length||0,ve=w?.reduce((te,Je)=>te+Je.sessions,0)||0,je=w?.[0]?.type||"-",S=m?K?.find(te=>te.sessionId===m):null,q=o?(K||[]).filter(te=>te.errors.some(Je=>Je.type===o)):K||[],Z=Math.ceil(R/es),ee=te=>{c(te),u("errors"),j(""),h(0)},ue=te=>{u(te),j(""),te!=="errors"&&h(0)},me=()=>{c(""),x(""),y(""),h(0)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Error Tracing"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Observability for Claude Code sessions"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:"text",value:N,onChange:te=>y(te.target.value),onKeyDown:te=>te.key==="Enter"&&ze(),placeholder:"Search errors by message, tool name, or context...",className:"w-full px-3 py-2 text-sm bg-gray-900/50 border border-gray-700 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/30"}),d&&l.jsx("button",{onClick:()=>{x(""),y(""),h(0)},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 text-xs",children:"clear"})]}),l.jsx("button",{onClick:ze,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors",children:"Search"})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Total Errors",value:R,color:"rose"}),l.jsx(ie,{title:"Error Types",value:ne,color:"amber"}),l.jsx(ie,{title:"Affected Sessions",value:ve,color:"indigo"}),l.jsx(ie,{title:"Most Common",value:je,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["groups","errors","timeline","sessions"].map(te=>l.jsx("button",{onClick:()=>ue(te),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===te?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:te==="groups"?"Error Groups":te==="errors"?"All Errors":te==="timeline"?"Timeline":"Sessions"},te))}),(o||d)&&l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx(oe,{label:`type: ${o.replace(/_/g," ")}`,variant:"info"}),d&&l.jsx(oe,{label:`search: ${d.slice(0,20)}`,variant:"default"}),l.jsx("button",{onClick:me,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),V&&l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-3 flex items-center justify-between",children:[l.jsx("div",{className:"text-sm text-rose-300",children:V}),l.jsx("button",{onClick:()=>window.location.reload(),className:"text-xs text-rose-400 hover:text-rose-200 px-2 py-1 border border-rose-700 rounded transition-colors",children:"Retry"})]}),m&&S&&l.jsx(dv,{session:S,onClose:()=>j("")}),Ae&&!m&&l.jsx(et,{}),!m&&!Ae&&r==="groups"&&l.jsx(iv,{groups:w||[],onGroupClick:ee}),!m&&!Ae&&r==="errors"&&l.jsx(cv,{errors:Q,total:R,page:p,totalPages:Z,onPageChange:h,onSessionClick:te=>{j(te),u("sessions")}}),!m&&!Ae&&r==="timeline"&&l.jsx(ov,{buckets:F||[],errors:Q,onSessionClick:te=>j(te)}),!m&&!Ae&&r==="sessions"&&l.jsx(uv,{sessions:q,onSelect:te=>j(te)}),!Ae&&!V&&R===0&&!m&&l.jsx(Do,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function iv({groups:r,onGroupClick:u}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Groups"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Type"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Last Seen"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Sample Message"})]})}),l.jsx("tbody",{children:r.map(o=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:l.jsx(oe,{label:o.type.replace(/_/g," "),variant:Kx[o.type]||"default"})}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsx("button",{onClick:()=>u(o.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${o.count} errors of this type`,children:o.count})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.sessions}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Wl(o.lastSeen),children:ss(o.lastSeen)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:o.recentMessages[0]||"-"})]},o.type))})]})]})}function cv({errors:r,total:u,page:o,totalPages:c,onPageChange:d,onSessionClick:x}){const[m,j]=b.useState(new Set),p=b.useCallback(y=>{j(C=>{const _=new Set(C);return _.has(y)?_.delete(y):_.add(y),_})},[]);if(r.length===0)return l.jsx(Do,{title:"No errors",description:"No errors match the current filter"});const h=o*es+1,N=Math.min(o*es+r.length,u);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Errors ",h,"–",N," of ",u]}),c>1&&l.jsx(dx,{page:o,totalPages:c,onChange:d})]}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:r.map((y,C)=>{const _=m.has(C),z=y.message.length>120;return l.jsx("div",{className:"px-4 py-3 hover:bg-gray-800/20 transition-colors",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx(oe,{label:y.type.replace(/_/g," "),variant:Kx[y.type]||"default"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:`text-xs text-gray-300 ${_?"whitespace-pre-wrap break-words":"truncate"} ${z?"cursor-pointer":""}`,onClick:()=>z&&p(C),title:z?_?"Click to collapse":"Click to expand details":void 0,children:[z&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:_?"▼":"▶"}),_?y.message:y.message.slice(0,200),!_&&z&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),y.context?.toolName&&l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:y.context.toolName}),y.context.toolInput&&l.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:y.context.toolInput})]}),_&&l.jsx(Jx,{context:y.context})]}),l.jsxs("div",{className:"flex-shrink-0 text-right",children:[l.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Wl(y.timestamp),children:ss(y.timestamp)}),l.jsx("div",{className:"text-[10px] text-gray-600",children:Wl(y.timestamp)}),l.jsx("button",{onClick:()=>x(y.sessionId),className:"text-[10px] text-indigo-400 hover:text-indigo-300 font-mono mt-0.5 transition-colors",title:"View full session",children:y.sessionId.slice(0,8)}),y.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",y.context.messageIndex]})]})]})},`${y.sessionId}-${y.timestamp}-${C}`)})}),c>1&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:l.jsx(dx,{page:o,totalPages:c,onChange:d})})]})}function Jx({context:r}){if(!r)return null;const{precedingAction:u,recentTools:o}=r;return!u&&(!o||o.length===0)?null:l.jsxs("div",{className:"mt-2 p-2 bg-gray-900/60 border border-gray-800 rounded-lg space-y-1.5",children:[u&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"What preceded this error:"}),l.jsx("div",{className:"text-[11px] text-gray-400 font-mono mt-0.5",children:u})]}),o&&o.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Recent tool chain:"}),l.jsx("div",{className:"flex flex-col gap-0.5 mt-0.5",children:o.map((c,d)=>l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[l.jsxs("span",{className:"text-gray-600",children:[o.length-d,"."]}),l.jsx("span",{className:"font-mono text-amber-400/80",children:c.name}),c.input&&l.jsx("span",{className:"text-gray-600 font-mono truncate max-w-sm",children:c.input})]},d))})]})]})}function dx({page:r,totalPages:u,onChange:o}){return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>o(Math.max(0,r-1)),disabled:r===0,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Prev"}),l.jsxs("span",{className:"text-[10px] text-gray-500 px-2",children:[r+1," / ",u]}),l.jsx("button",{onClick:()=>o(Math.min(u-1,r+1)),disabled:r>=u-1,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Next"})]})}function ov({buckets:r,errors:u,onSessionClick:o}){const[c,d]=b.useState(null),x=Math.max(...r.map(h=>h.count),1),m={tool_failure:"bg-blue-500",prompt_too_long:"bg-rose-500",api_error:"bg-amber-500",hook_error:"bg-gray-500",rate_limit:"bg-amber-400",unknown:"bg-gray-600"},j=c?u.filter(h=>{const N=new Date(h.timestamp).getTime();return N>=new Date(c.start).getTime()&&N<new Date(c.end).getTime()}):u,p=h=>{try{return new Date(h).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return h}};return l.jsxs("div",{className:"space-y-4",children:[r.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Density (per hour)"}),c&&l.jsx("button",{onClick:()=>d(null),className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"Clear filter"})]}),l.jsx("div",{className:"flex items-end gap-px h-24",children:r.map((h,N)=>{const y=h.count/x*100,C=c?.start===h.start;return l.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>d(C?null:h),title:`${p(h.start)}: ${h.count} errors`,children:l.jsx("div",{className:`w-full min-h-[2px] rounded-t transition-all ${C?"bg-indigo-400":"bg-rose-500/70 group-hover:bg-rose-400"}`,style:{height:`${Math.max(y,2)}%`}})},N)})}),l.jsxs("div",{className:"flex justify-between mt-1",children:[l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[0].start):""}),l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[r.length-1].start):""})]}),l.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(m).map(([h,N])=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${N}`}),l.jsx("span",{className:"text-[9px] text-gray-600",children:h.replace(/_/g," ")})]},h))})]}),c&&l.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",j.length," errors from ",p(c.start)]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:c?"Filtered Errors":"Recent Errors"}),l.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-y-auto custom-scrollbar",children:[j.length===0&&l.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),j.slice(0,100).map((h,N)=>l.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>o(h.sessionId),children:[l.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${m[h.type]||"bg-gray-500"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:h.type.replace(/_/g," ")}),h.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:h.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:ss(h.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Wl(h.timestamp)})]}),l.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:h.message}),h.context?.precedingAction&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",h.context.precedingAction]})]})]},N))]})]})]})}function uv({sessions:r,onSelect:u}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Branch"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Messages"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tool Calls"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Errors"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Started"})]})}),l.jsx("tbody",{children:r.map(o=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>u(o.sessionId),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:o.sessionId.slice(0,8)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:o.gitBranch||"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.messageCount}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.toolCallCount}),l.jsx("td",{className:"px-4 py-2 text-right",children:o.errors.length>0?l.jsx(oe,{label:String(o.errors.length),variant:"error"}):l.jsx("span",{className:"text-xs text-gray-600",children:"0"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Wl(o.startTime),children:ss(o.startTime)})]},o.sessionId))})]})]})}function dv({session:r,onClose:u}){const[o,c]=b.useState(new Set),d=x=>{c(m=>{const j=new Set(m);return j.has(x)?j.delete(x):j.add(x),j})};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Session: ",l.jsx("span",{className:"font-mono",children:r.sessionId.slice(0,12)})]}),l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",r.version," | ",r.gitBranch," | ",r.messageCount," messages | ",r.toolCallCount," tool calls"]})]}),l.jsx("button",{onClick:u,className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:"Back"})]}),l.jsxs("div",{className:"flex gap-3 mb-4",children:[l.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(r.startTime).toLocaleString()]}),r.endTime&&l.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(r.endTime).toLocaleString()]})]}),r.errors.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No errors in this session"}):l.jsx("div",{className:"space-y-2",children:r.errors.map((x,m)=>{const j=o.has(m),p=x.message.length>150;return l.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border-l-2 border-rose-500/50",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(oe,{label:x.type.replace(/_/g," "),variant:"error"}),x.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:x.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:ss(x.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Wl(x.timestamp)})]}),l.jsxs("div",{className:`text-xs text-gray-400 ${j?"whitespace-pre-wrap break-words":""} ${p?"cursor-pointer":""}`,onClick:()=>p&&d(m),title:p?j?"Click to collapse":"Click to expand":void 0,children:[p&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:j?"▼":"▶"}),j?x.message:x.message.slice(0,300),!j&&p&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),x.context?.toolInput&&l.jsx("div",{className:"text-[10px] text-gray-500 font-mono mt-1.5 bg-gray-900/50 px-2 py-1 rounded",children:x.context.toolInput}),x.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",x.context.messageIndex]}),j&&l.jsx(Jx,{context:x.context})]},m)})})]})}function Wl(r){if(!r)return"-";const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function ss(r){if(!r)return"-";try{return new Date(r).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return r}}const fv=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],xv=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function mv(){const[r,u]=kt("category","all"),[o,c]=kt("severity","all"),d=r||"all",x=o||"all",[m,j]=b.useState([]),[p,h]=b.useState(200),[N,y]=b.useState(null),C=new URLSearchParams;C.set("limit",String(p)),d!=="all"&&C.set("categories",d),x!=="all"&&C.set("severity",x);const{data:_,loading:z}=Te(`/api/activity/stream?${C.toString()}`),A=b.useCallback(H=>{j(F=>[H,...F].slice(0,50))},[]);if(Le("activity",A),z)return l.jsx(et,{});const v=[...m,..._||[]],w=new Set,T=[];for(const H of v){const F=`${H.timestamp}:${H.title}`;w.has(F)||(w.add(F),T.push(H))}const O=T.filter(H=>!(d!=="all"&&H.category!==d||x!=="all"&&H.severity!==x)),W=T.filter(H=>H.severity==="error").length,X=T.filter(H=>H.severity==="warning").length,le=new Set(T.map(H=>H.source)),K=H=>{y(F=>F===H?null:H)},J=()=>{h(H=>H+200)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Activity Stream"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 pulse-dot"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Total Events",value:T.length,color:"indigo"}),l.jsx(ie,{title:"Errors",value:W,color:"rose"}),l.jsx(ie,{title:"Warnings",value:X,color:"amber"}),l.jsx(ie,{title:"Sources",value:le.size,color:"cyan"})]}),l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:fv.map(H=>l.jsx("button",{onClick:()=>u(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${d===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:xv.map(H=>l.jsx("button",{onClick:()=>c(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${x===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsxs("span",{className:"text-xs text-gray-500 self-center",children:[O.length," events"]})]}),l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl divide-y divide-gray-800/50",children:O.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No events match filters"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Try adjusting category or severity filters"})]}):l.jsxs(l.Fragment,{children:[O.slice(0,p).map((H,F)=>{const P=`${H.timestamp}-${F}`,se=N===P;return l.jsx(hv,{event:H,isExpanded:se,onToggle:()=>K(P)},P)}),O.length>=p&&l.jsx("div",{className:"p-4 text-center",children:l.jsx("button",{onClick:J,className:"px-4 py-2 text-xs text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded-lg transition-colors",children:"Load more events"})})]})})]})}function hv({event:r,isExpanded:u,onToggle:o}){const c=r.severity==="error"?"bg-rose-400":r.severity==="warning"?"bg-amber-400":"bg-gray-600",d={command:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",hook:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",cost:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1",sync:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581"},x=r.detail||r.metadata&&Object.keys(r.metadata).length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${x?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:x?o:void 0,children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-2 flex-shrink-0 ${c}`}),l.jsx("div",{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-gray-500",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:d[r.category]||d.command})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-gray-300",children:r.title}),l.jsx(oe,{label:r.category,variant:kr(r.severity)})]}),r.detail&&!u&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:r.detail}),r.source&&l.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",r.source]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.timestamp&&l.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:gv(r.timestamp)}),x&&l.jsx("svg",{className:`w-4 h-4 text-gray-600 transition-transform duration-200 ${u?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),u&&l.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[r.detail&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Detail"}),l.jsx("p",{className:"text-xs text-gray-300 whitespace-pre-wrap",children:r.detail})]}),r.metadata&&Object.keys(r.metadata).length>0&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Metadata"}),l.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(r.metadata,null,2)})]})]})]})}function gv(r){if(!r)return"-";const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function pv(){const[r,u]=b.useState(0);Le("config-changed",()=>u(J=>J+1));const{data:o,loading:c,error:d,refetch:x}=Te(`/api/config?_r=${r}`),{activeProject:m}=qa(),[j,p]=b.useState(new Set),[h,N]=b.useState({}),[y,C]=b.useState(!1),[_,z]=b.useState(null),[A,v]=b.useState([]);if(c)return l.jsx(et,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!o)return null;const w=J=>{p(H=>{const F=new Set(H);return F.has(J)?F.delete(J):F.add(J),F})},T=Object.keys(h).length>0,O=(J,H)=>{N(F=>({...F,[J]:H})),v(F=>F.filter(P=>P.path!==J))},W=async()=>{if(T){C(!0),z(null),v([]);try{const J={};for(const[Ae,V]of Object.entries(h))vv(J,Ae,V);const H=m?`?project=${m.id}`:"",P=await(await fetch(`/api/config/validate${H}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)})).json();if(P.errors&&P.errors.length>0){v(P.errors),z("Validation failed. Fix errors before saving."),C(!1);return}const ze=await(await fetch(`/api/config${H}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)})).json();ze.ok?(z("Saved successfully"),N({}),v([]),x(),setTimeout(()=>z(null),3e3)):z(`Error: ${ze.error}`)}catch(J){z(`Error: ${J}`)}finally{C(!1)}}},X=()=>{N({}),z(null),v([])},le=Object.entries(o).filter(([J,H])=>typeof H=="object"&&H!==null),K=Object.entries(o).filter(([J,H])=>typeof H!="object"||H===null);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Configuration"}),l.jsx("span",{className:"text-xs text-gray-500",children:".specweave/config.json"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[_&&l.jsx("span",{className:`text-xs ${_.startsWith("Error")||_.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:_}),T&&l.jsxs(l.Fragment,{children:[l.jsx(oe,{label:`${Object.keys(h).length} changes`,variant:"warning"}),l.jsx("button",{onClick:X,className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors",children:"Discard"}),l.jsx("button",{onClick:W,disabled:y,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:y?"Saving...":"Save Changes"})]})]})]}),_&&!T&&_==="Saved successfully"&&l.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-4 py-2 flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),l.jsx("span",{className:"text-xs text-emerald-400",children:"Configuration saved successfully"})]}),A.length>0&&l.jsxs("div",{className:"bg-rose-500/10 border border-rose-500/30 rounded-lg px-4 py-3 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-400"}),l.jsx("span",{className:"text-xs text-rose-400 font-medium",children:"Validation errors"})]}),A.map((J,H)=>l.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[l.jsx("span",{className:"font-mono text-rose-400",children:J.path}),": ",J.message]},H))]}),K.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"General"}),l.jsx("div",{className:"space-y-3",children:K.map(([J,H])=>l.jsx(Fx,{path:J,label:J,value:h[J]!==void 0?h[J]:H,original:H,onChange:F=>O(J,F),edited:h[J]!==void 0,validationError:A.find(F=>F.path===J)?.message},J))})]}),le.map(([J,H])=>l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("button",{onClick:()=>w(J),className:"w-full px-5 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 capitalize",children:J}),fx(h,J)>0&&l.jsx(oe,{label:`${fx(h,J)} edited`,variant:"warning"}),A.some(F=>F.path.startsWith(J+"."))&&l.jsx(oe,{label:"errors",variant:"error"})]}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${j.has(J)?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),j.has(J)&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:l.jsx(Wx,{data:H,path:J,edits:h,onChange:O,validationErrors:A,depth:0})})]},J))]})}function Wx({data:r,path:u,edits:o,onChange:c,validationErrors:d,depth:x}){return x>4?l.jsx("span",{className:"text-xs text-gray-600",children:"..."}):l.jsx("div",{className:"space-y-3",style:{marginLeft:x>0?16:0},children:Object.entries(r).map(([m,j])=>{const p=`${u}.${m}`;return j&&typeof j=="object"&&!Array.isArray(j)?l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:m}),l.jsx(Wx,{data:j,path:p,edits:o,onChange:c,validationErrors:d,depth:x+1})]},m):l.jsx(Fx,{path:p,label:m,value:o[p]!==void 0?o[p]:j,original:j,onChange:h=>c(p,h),edited:o[p]!==void 0,validationError:d.find(h=>h.path===p)?.message},m)})})}function Fx({path:r,label:u,value:o,original:c,onChange:d,edited:x,validationError:m}){return typeof c=="boolean"||typeof o=="boolean"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:u}),l.jsx("button",{onClick:()=>d(!o),className:`relative w-9 h-5 rounded-full transition-colors ${o?"bg-indigo-600":"bg-gray-700"} ${x?"ring-1 ring-amber-500/50":""}`,children:l.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-transform ${o?"left-[18px]":"left-0.5"}`})})]}),m&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:m})]}):typeof c=="number"||typeof o=="number"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:u}),l.jsx("input",{type:"number",value:String(o??""),onChange:j=>d(j.target.value?Number(j.target.value):0),className:`bg-gray-800 border text-xs text-amber-400 font-mono rounded px-2 py-1 w-24 text-right ${m?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),m&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:m})]}):Array.isArray(c)||Array.isArray(o)?l.jsx(yv,{path:r,label:u,value:Array.isArray(o)?o:Array.isArray(c)?c:[],edited:x,onChange:d,validationError:m}):l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:u}),l.jsx("input",{type:"text",value:String(o??""),onChange:j=>d(j.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${m?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),m&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:m})]})}function yv({path:r,label:u,value:o,edited:c,onChange:d,validationError:x}){const[m,j]=b.useState(!1),[p,h]=b.useState(""),N=_=>{const z=[...o];z.splice(_,1),d(z)},y=()=>{const _=p.trim();_&&(d([...o,_]),h(""))},C=_=>{_.key==="Enter"&&(_.preventDefault(),y())};return l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{onClick:()=>j(_=>!_),className:"flex items-center justify-between w-full group",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:u}),l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),l.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["[",o.length," items]"]}),l.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${m?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),m&&l.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[o.length===0&&l.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),o.map((_,z)=>l.jsxs("div",{className:"flex items-center gap-2 group/item",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",children:String(_)}),l.jsx("button",{onClick:()=>N(z),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},z)),l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[l.jsx("input",{type:"text",value:p,onChange:_=>h(_.target.value),onKeyDown:C,placeholder:"Add item...",className:"bg-gray-800 border border-gray-700 text-xs text-gray-300 rounded px-2 py-1 flex-1 focus:ring-indigo-500 focus:border-indigo-500"}),l.jsx("button",{onClick:y,disabled:!p.trim(),className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded disabled:opacity-50 transition-colors",children:"Add"})]})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:x})]})}function fx(r,u){return Object.keys(r).filter(o=>o.startsWith(u+".")).length}function vv(r,u,o){const c=u.split(".");let d=r;for(let x=0;x<c.length-1;x++)(!d[c[x]]||typeof d[c[x]]!="object")&&(d[c[x]]={}),d=d[c[x]];d[c[c.length-1]]=o}function _o({lines:r,status:u,onDismiss:o}){const c=b.useRef(null);return b.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[r]),r.length===0&&u==="idle"?null:l.jsxs("div",{className:"mt-4 rounded-lg bg-gray-950 border border-gray-700 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${u==="running"?"bg-yellow-400 animate-pulse":u==="success"?"bg-green-400":u==="error"?"bg-red-400":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:u==="running"?"Running...":u==="success"?"Completed":u==="error"?"Failed":"Output"})]}),u!=="running"&&o&&l.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-300 text-xs",children:"Dismiss"})]}),l.jsxs("div",{className:"p-3 max-h-48 overflow-y-auto font-mono text-xs text-gray-300 whitespace-pre-wrap",children:[r.map((d,x)=>l.jsx("div",{children:d},x)),l.jsx("div",{ref:c})]})]})}function bv(){const{data:r,loading:u}=Te("/api/plugins/full"),{execute:o,running:c,output:d,status:x,reset:m}=Lr(),[j,p]=b.useState(null);if(u)return l.jsx(et,{});const h=r?.plugins||[],N=r?.skills||[],y=r?.lsp,C=r?.warmup,_=r?.triggerCount||0,z=h.reduce((T,O)=>T+O.skillCount,0),A=h.reduce((T,O)=>T+O.commandCount,0),v=T=>N.filter(O=>O.plugin===T).sort((O,W)=>W.count-O.count),w=T=>{p(O=>O===T?null:T)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Plugins & LSP"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>o("lsp-status"),disabled:c,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Check LSP"}),l.jsx("button",{onClick:()=>o("refresh-plugins"),disabled:c,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:c?"Running...":"Refresh Plugins"})]})]}),l.jsx(_o,{lines:d,status:x,onDismiss:m}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx($a,{label:"Plugins",value:h.length}),l.jsx($a,{label:"Total Skills",value:z}),l.jsx($a,{label:"Total Commands",value:A}),l.jsx($a,{label:"Trigger Keywords",value:_})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Installed Plugins"})}),h.length===0?l.jsx("div",{className:"p-5 text-gray-500 text-xs",children:"No plugins installed"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:h.map(T=>{const O=j===T.name,W=v(T.name);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>w(T.name),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("span",{className:"text-sm text-gray-300",children:T.name}),l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:T.version})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(oe,{label:`${T.skillCount} skills`,variant:"info"}),l.jsx(oe,{label:`${T.commandCount} cmds`,variant:"default"}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${O?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),O&&l.jsx("div",{className:"px-4 pb-4 bg-gray-800/20",children:W.length===0?l.jsx("p",{className:"text-xs text-gray-600 py-2",children:"No skill usage data for this plugin"}):l.jsxs("div",{className:"space-y-1 mt-1",children:[l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1",children:[l.jsx("span",{className:"text-[10px] text-gray-600 uppercase",children:"Skill"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Invocations"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Success"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Last Used"})]}),W.map(X=>l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1.5 bg-gray-800/40 rounded",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono truncate",children:X.name}),l.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:X.count}),l.jsxs("span",{className:"text-xs text-right font-mono",children:[l.jsx("span",{className:"text-emerald-400",children:X.successCount}),X.failureCount>0&&l.jsxs("span",{className:"text-rose-400",children:["/",X.failureCount]})]}),l.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:X.lastUsed?jv(X.lastUsed):"-"})]},X.name))]})})]},T.name)})})]}),N.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Skill Usage Leaderboard"}),l.jsx(Vx,{items:N.sort((T,O)=>O.count-T.count).slice(0,20).map(T=>({label:T.name,value:T.count,color:"#10b981"})),maxBars:20})]}),y&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Status"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(oe,{label:y.status,variant:y.status==="ok"?"success":"warning"}),y.checked&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(y.checked).toLocaleDateString()]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[l.jsx($a,{label:"Total Languages",value:y.stats.totalLanguages}),l.jsx($a,{label:"Checked",value:y.stats.checkedLanguages}),l.jsx($a,{label:"Binary Missing",value:y.stats.binaryMissing}),l.jsx($a,{label:"Plugin Missing",value:y.stats.pluginMissing})]}),y.missing.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),y.missing.map((T,O)=>l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-800/50 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(oe,{label:T.type,variant:T.type==="binary"?"warning":"default"}),l.jsx("span",{className:"text-xs text-gray-300",children:T.language})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-[10px] text-gray-500",children:T.binaryInstall}),T.message&&l.jsx("span",{className:"text-[10px] text-gray-600 max-w-[200px] truncate",children:T.message})]})]},O))]})]}),C&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Warmup Status"}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[C.elapsed?`${(C.elapsed/1e3).toFixed(1)}s`:""," |"," ",C.timestamp?new Date(C.timestamp).toLocaleString():""]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[C.warmedUp.map(T=>l.jsx(oe,{label:T,variant:"success"},T)),C.failed.map(T=>l.jsx(oe,{label:T,variant:"error"},T))]}),C.warmedUp.length===0&&C.failed.length===0&&l.jsx("p",{className:"text-gray-600 text-xs",children:"No warmup data"})]})]})}function $a({label:r,value:u}){return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-3 text-center",children:[l.jsx("div",{className:"text-lg font-bold text-gray-300",children:u}),l.jsx("div",{className:"text-[10px] text-gray-500",children:r})]})}function jv(r){if(!r)return"-";const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Nv(){const{data:r,loading:u}=Te("/api/links"),{data:o,loading:c,refetch:d}=Te("/api/services"),{execute:x,running:m,output:j,status:p,reset:h}=Lr();if(u||c)return l.jsx(et,{});const N=(o||[]).filter(v=>v.status==="running").length,y=(o||[]).length,C=new Map;for(const v of o||[])if(v.port>0&&v.status==="running"){const w=C.get(v.port)||[];w.push(v.name),C.set(v.port,w)}const _=Array.from(C.entries()).filter(([,v])=>v.length>1),z=async v=>{await x(v,{timeoutMs:3e5}),setTimeout(()=>d(),3e3)},A=async v=>{await x(v,{timeoutMs:3e5}),setTimeout(()=>d(),2e3)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Services & Links"}),l.jsx(_o,{lines:j,status:p,onDismiss:h}),_.length>0&&l.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-4 flex items-start gap-3",children:[l.jsx("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-amber-300",children:"Port Conflict Detected"}),l.jsx("div",{className:"text-xs text-amber-400/80 mt-1",children:_.map(([v,w])=>l.jsxs("span",{className:"block",children:["Port ",v," is used by: ",w.join(", ")]},v))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Services",value:y,color:"indigo",tooltip:`${y} managed services`}),l.jsx(ie,{title:"Running",value:N,color:"emerald",tooltip:`${N} services currently active`}),l.jsx(ie,{title:"External Links",value:(r||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),l.jsx(ie,{title:"Stopped",value:y-N,color:"rose",tooltip:`${y-N} services not running`})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Service Status"}),l.jsx("div",{className:"space-y-3",children:(o||[]).map((v,w)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${v.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300",children:v.name}),l.jsx("div",{className:"text-[10px] text-gray-600",children:v.status==="running"&&v.detail?l.jsx("a",{href:v.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:v.detail}):v.detail})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[v.status==="running"&&v.port>0&&l.jsx(oe,{label:`Port ${v.port}`,variant:"info"}),v.status==="running"?l.jsx(oe,{label:"Running",variant:"success"}):l.jsx(oe,{label:"Stopped",variant:"default"}),v.startCommand&&v.stopCommand?v.status==="running"?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("a",{href:v.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"}),l.jsx("button",{onClick:()=>A(v.stopCommand),disabled:m,className:"px-2 py-1 text-[10px] text-rose-400 hover:text-rose-300 border border-rose-500/30 rounded transition-colors disabled:opacity-50",children:"Stop"})]}):l.jsx("button",{onClick:()=>z(v.startCommand),disabled:m,className:"px-2 py-1 text-[10px] text-emerald-400 hover:text-emerald-300 border border-emerald-500/30 rounded transition-colors disabled:opacity-50",children:m?"Starting...":"Start"}):v.status==="running"&&l.jsx("a",{href:v.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"})]})]},w))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"External Links"}),(r||[]).length===0?l.jsx("p",{className:"text-xs text-gray-500",children:"No external links configured"}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(r||[]).map((v,w)=>l.jsxs("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800 transition-colors group",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Sv,{type:v.type}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:v.name}),l.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:v.url})]})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]},w))})]})]})}function Sv({type:r}){const u={docs:"bg-indigo-600",github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-8 h-8 rounded-lg ${u[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-xs text-white font-bold",children:r[0]?.toUpperCase()})})}const xx={critical:0,warning:1,info:2};function wv(){const[r,u]=b.useState("pending"),[o,c]=b.useState(null),[d,x]=b.useState(0);Le("notification",()=>x(H=>H+1));const{activeProject:m}=qa(),{data:j,loading:p,error:h,refetch:N}=Te(`/api/notifications?_r=${d}`);if(p)return l.jsx(et,{});if(h)return l.jsx(Gt,{message:h,onRetry:N});const y=j||[],C=y.filter(H=>!H.dismissedAt),_=y.filter(H=>!!H.dismissedAt),z=C.filter(H=>H.severity==="critical"),A=C.filter(H=>H.severity==="warning"),w=[...r==="pending"?C:r==="dismissed"?_:y].sort((H,F)=>{const P=xx[H.severity]??3,se=xx[F.severity]??3;return P!==se?P-se:new Date(F.createdAt).getTime()-new Date(H.createdAt).getTime()}),T=async H=>{c(H);try{const F=m?`?project=${m.id}`:"";(await fetch(`/api/notifications/${H}/dismiss${F}`,{method:"POST"})).ok&&N()}finally{c(null)}},O=async()=>{c("__all__");try{const H=m?`?project=${m.id}`:"";for(const F of C)await fetch(`/api/notifications/${F.id}/dismiss${H}`,{method:"POST"});N()}finally{c(null)}},W=H=>H==="critical"?"error":H==="warning"?"warning":"info",X=H=>H==="critical"?"border-l-rose-500":H==="warning"?"border-l-amber-500":"border-l-blue-500",K=(H=>{const F={};for(const P of H)F[P.severity]||(F[P.severity]=[]),F[P.severity].push(P);return F})(w),J={critical:"Critical",warning:"Warnings",info:"Informational"};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Notifications"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Pending",value:C.length,color:"indigo"}),l.jsx(ie,{title:"Critical",value:z.length,color:"rose"}),l.jsx(ie,{title:"Warnings",value:A.length,color:"amber"}),l.jsx(ie,{title:"Dismissed",value:_.length,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{value:"pending",label:`Pending (${C.length})`},{value:"dismissed",label:`Dismissed (${_.length})`},{value:"all",label:`All (${y.length})`}].map(H=>l.jsx("button",{onClick:()=>u(H.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${r===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),C.length>0&&l.jsx("button",{onClick:O,disabled:o==="__all__",className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors disabled:opacity-50",children:o==="__all__"?"Dismissing...":"Dismiss All"})]}),w.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mx-auto mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})}),l.jsx("p",{className:"text-gray-400 text-sm font-medium",children:r==="pending"?"No pending notifications":"No notifications"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs mx-auto",children:"Notifications appear here when imports complete, discrepancies are found, or syncs fail"})]}):l.jsx("div",{className:"space-y-4",children:["critical","warning","info"].map(H=>{const F=K[H];return!F||F.length===0?null:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h3",{className:"text-xs font-medium text-gray-400 uppercase",children:J[H]||H}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",F.length,")"]})]}),l.jsx("div",{className:"space-y-2",children:F.map(P=>l.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${X(P.severity)} rounded-xl p-4 flex items-start gap-4 ${P.dismissedAt?"opacity-60":""}`,children:[l.jsx(Ev,{severity:P.severity}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:P.title}),l.jsx(oe,{label:P.severity,variant:W(P.severity)}),P.type&&l.jsx(oe,{label:P.type,variant:"default"})]}),P.message&&l.jsx("p",{className:"text-xs text-gray-400 mb-2",children:P.message}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[l.jsx("span",{children:new Date(P.createdAt).toLocaleString()}),P.source&&l.jsxs("span",{children:["via ",P.source]}),P.dismissedAt&&l.jsxs("span",{children:["Dismissed ",new Date(P.dismissedAt).toLocaleString()]})]})]}),!P.dismissedAt&&l.jsx("button",{onClick:()=>T(P.id),disabled:o===P.id,className:"px-2 py-1 text-xs text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded transition-colors disabled:opacity-50 flex-shrink-0",children:o===P.id?"...":"Dismiss"})]},P.id))})]},H)})})]})}function Ev({severity:r}){return r==="critical"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-rose-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})}):r==="warning"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}):l.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}function Cv(r){if(!r)return null;if(r.startsWith("https://"))return r.replace(/\.git$/,"");const u=r.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(u)return`https://${u[1]}/${u[2]}`;const o=r.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return o?`https://${o[1]}/${o[2]}`:null}function Tv(){const{data:r,loading:u,error:o,refetch:c}=Te("/api/repos");if(u)return l.jsx(et,{});if(o)return l.jsx(Gt,{message:o,onRetry:c});const d=r||[],x=[...new Set(d.map(p=>p.org))],m=d.filter(p=>p.hasSpecweave||p.isUmbrellaManaged).length,j=d.find(p=>p.isCurrent);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Repositories"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Repositories",value:d.length,color:"indigo"}),l.jsx(ie,{title:"Organizations",value:x.length,color:"cyan"}),l.jsx(ie,{title:"With SpecWeave",value:m,color:"emerald"}),l.jsx(ie,{title:"Current",value:j?j.name:"-",subtitle:j?`${j.org}/${j.name}`:"No current project",color:"amber"})]}),d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"This project doesn't use multi-repo mode, or the repositories/ directory hasn't been set up yet"})]}):l.jsx(l.Fragment,{children:x.map(p=>{const h=d.filter(N=>N.org===p);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Av,{}),l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:p}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[h.length," ",h.length===1?"repo":"repos"]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:h.map(N=>{const y=Cv(N.remote);return l.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${N.isCurrent?"border-indigo-500/30":"border-gray-800"}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Rv,{}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:N.name})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[N.isCurrent&&l.jsx(oe,{label:"Current Project",variant:"info"}),l.jsx(oe,{label:N.hasSpecweave?"SpecWeave":N.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:N.hasSpecweave?"success":N.isUmbrellaManaged?"info":"default"})]})]}),l.jsxs("div",{className:"space-y-1.5 mt-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Organization"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:N.org})]}),N.branch&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),l.jsx(oe,{label:N.branch,variant:"default"})]}),y&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-400 hover:text-indigo-300 hover:underline truncate max-w-[180px]",title:y,children:y.replace("https://","")})]}),!y&&N.remote&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:N.remote,children:N.remote})]}),N.path&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Path"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:N.path,children:N.path.split("/").slice(-3).join("/")})]}),N.lastModified&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Last Modified"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Dv(N.lastModified)})]})]}),y&&l.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"mt-3 flex items-center justify-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 py-2 border border-gray-800 rounded-lg hover:border-gray-700 transition-colors",children:[l.jsx(Mv,{}),"Open on GitHub"]})]},N.path||`${N.org}/${N.name}`)})})]},p)})})]})}function Av(){return l.jsx("div",{className:"w-6 h-6 rounded bg-gray-700 flex items-center justify-center",children:l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}function Rv(){return l.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function Mv(){return l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}function Dv(r){if(!r)return"-";try{const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const _v=[{value:"",label:"All"},{value:"discovered",label:"Discovered"},{value:"scanning",label:"Scanning"},{value:"tier1_passed",label:"Passed"},{value:"tier1_failed",label:"Failed"},{value:"verified",label:"Verified"},{value:"rejected",label:"Rejected"}],xa=20;function zv(r){switch(r){case"discovered":return"default";case"queued":return"info";case"scanning":return"warning";case"tier1_passed":return"success";case"tier1_failed":return"error";case"tier2_pending":return"info";case"verified":return"success";case"rejected":return"error";default:return"default"}}function Ov(r){switch(r){case"discovered":return"Discovered";case"queued":return"Queued";case"scanning":return"Scanning";case"tier1_passed":return"T1 Passed";case"tier1_failed":return"T1 Failed";case"tier2_pending":return"T2 Pending";case"verified":return"Verified";case"rejected":return"Rejected";default:return r}}function mx(r){if(!r)return"-";try{const u=Date.now()-new Date(r).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function kv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Px(r){const u=r.tier1Result?.score??0,o=r.tier2Result?.score??0;return u&&o?Math.round((u+o)/2):u||o}function Lv(r){return r>=80?"bg-emerald-500":r>=50?"bg-amber-500":"bg-rose-500"}function Uv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Hv(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function hx(r){const u=Math.log10(Math.max(r.stars,1))*20,o=Px(r);return u+o}function Bv(r,u){if(u===0)return"rose";const o=r/u;return o>.5?"emerald":o>.1?"amber":"rose"}function $v(){const[r,u]=b.useState(""),[o,c]=b.useState(0),[d,x]=b.useState(0),[m,j]=b.useState(null),[p,h]=b.useState(""),{output:N,status:y,reset:C}=Lr(),_=r?`status=${r}&limit=${xa}&offset=${o}`:`limit=${xa}&offset=${o}`,{data:z,loading:A,error:v,refetch:w}=Te(`/api/marketplace/scanner/status?_r=${d}`),{data:T,loading:O,refetch:W}=Te(`/api/marketplace/queue?${_}&_r=${d}`),{data:X,loading:le}=Te(`/api/marketplace/verified?_r=${d}`),{data:K,loading:J}=Te(`/api/marketplace/insights?_r=${d}`),H=b.useCallback(()=>{x(S=>S+1)},[]);Le("submission-update",b.useCallback(()=>{H()},[H])),Le("marketplace-scan",b.useCallback(()=>{H()},[H])),Le("verification-complete",b.useCallback(()=>{H()},[H]));const F=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/start${q}`,{method:"POST"}),w()}catch{}},P=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/stop${q}`,{method:"POST"}),w()}catch{}},se=async S=>{j(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Z=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/approve${Z}`,{method:"POST"}),W()}catch{}j(null)},ze=async S=>{j(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Z=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/reject${Z}`,{method:"POST"}),W()}catch{}j(null)};if(A&&O&&le&&J)return l.jsx(et,{});const V=T?.items||[],R=T?.total||0,Q=X||[],ne=Math.floor(o/xa)+1,ve=Math.ceil(R/xa),je=S=>S==="tier1_passed"||S==="tier2_pending";return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Marketplace Scanner"}),l.jsx("div",{className:"flex gap-2",children:z?.running?l.jsx("button",{onClick:P,className:"px-3 py-1.5 bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Stop Scanner"}):l.jsx("button",{onClick:F,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Start Scanner"})})]}),l.jsx(_o,{lines:N,status:y,onDismiss:C}),v&&l.jsx(Gt,{message:v,onRetry:w}),z?l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Scanner",value:z.running?"Running":"Stopped",subtitle:z.running?"Active":"Idle",color:z.running?"emerald":"amber"}),l.jsx(ie,{title:"Last Scan",value:z.lastScanTime?mx(z.lastScanTime):"Never",color:"cyan"}),l.jsx(ie,{title:"Repos Scanned",value:z.reposScanned,color:"indigo"}),l.jsx(ie,{title:"Rate Limit",value:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?`${z.rateLimitRemaining}/${z.rateLimitTotal}`:"No token",subtitle:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null&&z.rateLimitTotal>0?`${Math.round(z.rateLimitRemaining/z.rateLimitTotal*100)}% remaining`:"Set GITHUB_TOKEN in environment",color:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?Bv(z.rateLimitRemaining,z.rateLimitTotal):"amber"})]}):!A&&!v?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"text-gray-400 text-sm mb-2",children:"No scanner data available"}),l.jsx("p",{className:"text-gray-600 text-xs mb-4",children:"Start the marketplace scanner to discover and verify community skills."}),l.jsx("button",{onClick:F,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-sm rounded-lg transition-colors",children:"Start Scanner"})]}):null,l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Submission Queue"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[R," total"]})]}),l.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:_v.map(S=>l.jsx("button",{onClick:()=>{u(S.value),c(0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors whitespace-nowrap ${r===S.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300 hover:bg-gray-800"}`,children:S.label},S.value))}),O?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(et,{})}):V.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No submissions found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:r?"Try a different filter.":"Submissions will appear here once the scanner discovers repos."})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Repo"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Author"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Stars"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Tier"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Security"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Discovered"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Actions"})]})}),l.jsx("tbody",{children:V.map(S=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:S.repoUrl?l.jsx("a",{href:S.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:text-indigo-300 font-mono",children:S.repoFullName}):l.jsx("span",{className:"text-xs text-gray-300 font-mono",children:S.repoFullName})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.author}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:S.stars.toLocaleString()}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(oe,{label:Ov(S.status),variant:zv(S.status)})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.tier||"-"}),l.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${kv(S.securityScore)}`,children:S.securityScore!=null?S.securityScore:"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:mx(S.discoveredAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:je(S.status)&&l.jsxs("div",{className:"flex gap-1 justify-end",children:[l.jsx("button",{onClick:()=>se(S.id),disabled:m===S.id,className:"px-2 py-1 bg-emerald-600/20 hover:bg-emerald-600/40 text-emerald-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Approve"}),l.jsx("button",{onClick:()=>ze(S.id),disabled:m===S.id,className:"px-2 py-1 bg-rose-600/20 hover:bg-rose-600/40 text-rose-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Reject"})]})})]},S.id))})]})}),R>xa&&l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-800",children:[l.jsxs("span",{className:"text-xs text-gray-500",children:[o+1,"-",Math.min(o+xa,R)," of ",R]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{onClick:()=>c(Math.max(0,o-xa)),disabled:o===0,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Prev"}),l.jsxs("span",{className:"px-2 py-1 text-xs text-gray-500",children:["Page ",ne," of ",ve]}),l.jsx("button",{onClick:()=>c(o+xa),disabled:o+xa>=R,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between gap-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 shrink-0",children:"Popular Skills"}),Q.length>0&&l.jsxs("div",{className:"relative max-w-xs w-full",children:[l.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Discover popular skills...",value:p,onChange:S=>h(S.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-gray-800/50 border border-gray-700 rounded-lg text-xs text-gray-200 placeholder-gray-500 focus:outline-none focus:border-gray-600 transition-colors"})]})]}),le?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(et,{})}):Q.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No verified skills yet"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Skills will appear here after passing security verification."})]}):l.jsx(qv,{skills:Q,search:p})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Insights"})}),J?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(et,{})}):K?l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Discovered",value:K.totalDiscovered,color:"cyan"}),l.jsx(ie,{title:"Verified",value:K.totalVerified,color:"emerald"}),l.jsx(ie,{title:"Rejected",value:K.totalRejected,color:"rose"}),l.jsx(ie,{title:"Pending",value:K.totalPending,color:"amber"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(gx,{label:"Tier 1 Pass Rate",rate:K.tier1PassRate}),l.jsx(gx,{label:"Tier 2 Pass Rate",rate:K.tier2PassRate})]})]}):l.jsx("div",{className:"p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No insights data available"})})]})]})}function qv({skills:r,search:u}){const o=[...r].sort((x,m)=>hx(m)-hx(x)),c=new Set(o.slice(0,3).map(x=>x.id)),d=u?o.filter(x=>x.repoFullName.toLowerCase().includes(u.toLowerCase())||x.author.toLowerCase().includes(u.toLowerCase())):o;return d.length===0?l.jsx("div",{className:"p-8 text-center",children:l.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',u,'"']})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:d.map(x=>l.jsx(Yv,{skill:x,trending:c.has(x.id)},x.id))})}function Yv({skill:r,trending:u}){const o=Px(r),c=Lv(o),d=Uv(o);return l.jsxs("div",{className:"bg-gray-800/50 border border-gray-700/50 rounded-lg p-4 hover:border-gray-600 transition-colors",children:[l.jsxs("div",{className:"flex items-start justify-between mb-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[r.repoUrl?l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-indigo-300 truncate block transition-colors",children:r.repoFullName.split("/").pop()}):l.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:r.repoFullName.split("/").pop()}),l.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r.author})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[u&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-orange-500/15 text-orange-400 text-[10px] font-medium rounded",children:[l.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z",clipRule:"evenodd"})}),"Hot"]}),l.jsx(oe,{label:"Verified",variant:"success"})]})]}),l.jsxs("div",{className:"mb-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Trust"}),l.jsx("span",{className:`text-xs font-mono font-medium ${d}`,children:o})]}),l.jsx("div",{className:"w-full h-1.5 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${o}%`}})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[l.jsx("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),Hv(r.stars)]}),r.repoUrl&&l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-gray-500 hover:text-gray-300 transition-colors",children:"View on GitHub"})]})]})}function gx({label:r,rate:u}){const o=Math.round(u),c=o>=70?"bg-emerald-500":o>=40?"bg-amber-500":"bg-rose-500";return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[o,"%"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${o}%`}})})]})}function Gv(){const{id:r}=gp(),[u,o]=b.useState(0);Le("increment-update",()=>o(h=>h+1));const{data:c,loading:d,error:x,refetch:m}=Te(`/api/increments/${r||"_none"}?_r=${u}`);if(!r)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(d)return l.jsx(et,{});if(x)return l.jsx(Gt,{message:x,onRetry:m});if(!c)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"Increment not found"});const j=c.taskSummary.total>0?Math.round(c.taskSummary.completed/c.taskSummary.total*100):0,p=c.acSummary.total>0?Math.round(c.acSummary.completed/c.acSummary.total*100):0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:c.dirName}),l.jsx(oe,{label:c.metadata.status||"unknown",variant:kr(c.metadata.status||"")}),c.metadata.type&&l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:c.metadata.type}),c.metadata.priority&&l.jsx(Vv,{priority:c.metadata.priority})]}),l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:c.metadata.title||c.id}),c.metadata.project&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Project: ",c.metadata.project]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),l.jsx(ie,{title:"Task Progress",value:`${j}%`,color:"cyan"}),l.jsx(ie,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),l.jsx(ie,{title:"AC Progress",value:`${p}%`,color:"amber"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[l.jsx(px,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),l.jsx(px,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),l.jsxs("section",{className:"work-evidence",children:[l.jsx("h3",{children:"Verification and specification"}),l.jsxs("p",{children:["Verification ",c.verification?.status||"missing",c.verification?.ranAt?` · ${c.verification.ranAt}`:""]}),l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Read specification"}),l.jsx("pre",{children:c.spec||"No specification found."})]}),c.verify&&Object.keys(c.verify).length>0&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Verification report"}),l.jsx("pre",{children:JSON.stringify(c.verify,null,2)})]}),c.handoff&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Latest handoff"}),l.jsx("pre",{children:c.handoff})]}),l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Task evidence"}),c.tasks.map(h=>l.jsxs("div",{className:"py-3",children:[l.jsxs("strong",{children:[h.id," · ",h.status]}),l.jsx("p",{children:h.actor||"Actor unknown"}),l.jsx("pre",{children:h.evidence||h.note||"No ledger evidence recorded."})]},h.id))]})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Tasks (",c.tasks.length,")"]})}),c.tasks.length===0?l.jsx("div",{className:"p-5 text-center text-gray-500 text-xs",children:"No tasks found in tasks.md"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.tasks.map(h=>l.jsxs("div",{className:"px-5 py-3 flex items-center gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${h.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:h.status==="completed"&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:h.id}),l.jsx("span",{className:`text-sm ${h.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:h.title})]}),(h.userStory||h.acs)&&l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[h.userStory&&l.jsx("span",{className:"text-[10px] text-indigo-400",children:h.userStory}),h.acs?.map(N=>l.jsx("span",{className:"text-[10px] text-emerald-500",children:N},N))]})]})]},h.id))})]}),c.acs.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Acceptance Criteria (",c.acs.length,")"]})}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.acs.map(h=>l.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 mt-0.5 ${h.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:h.completed&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-emerald-500 font-mono",children:h.id}),l.jsx("span",{className:`text-sm ml-2 ${h.completed?"text-gray-500 line-through":"text-gray-300"}`,children:h.text})]})]},h.id))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"Metadata"}),l.jsx("div",{className:"space-y-1.5",children:Object.entries(c.metadata).filter(([h])=>!["title"].includes(h)).map(([h,N])=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:h}),l.jsx("span",{className:"text-xs text-gray-400",children:typeof N=="object"?JSON.stringify(N):String(N??"")})]},h))})]})]})}function px({label:r,completed:u,total:o,color:c}){const d=o>0?Math.round(u/o*100):0,x=c==="emerald"?"bg-emerald-500":"bg-indigo-500";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[u,"/",o," (",d,"%)"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${x} rounded-full transition-all`,style:{width:`${d}%`}})})]})}function Vv({priority:r}){const u={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${u[r]||u.P2}`,children:r})}const Qv=["All","PreToolUse","PostToolUse","Stop","SubagentStop","TaskCompleted","UserPromptSubmit","PostToolUseFailure","PermissionRequest","SessionStart","SessionEnd","Notification","SubagentStart","ConfigChange","PreCompact","TeammateIdle"],Xv=[{label:"All time",value:"0"},{label:"Last 1h",value:"3600000"},{label:"Last 6h",value:"21600000"},{label:"Last 24h",value:"86400000"}];function Zv(r){const u=Date.now()-new Date(r).getTime();return u<6e4?`${Math.floor(u/1e3)}s ago`:u<36e5?`${Math.floor(u/6e4)}m ago`:u<864e5?`${Math.floor(u/36e5)}h ago`:`${Math.floor(u/864e5)}d ago`}function Kv(r){const u=[];for(const o of r){const c=u[u.length-1];c&&c.type===o.eventName&&c.count<100?(c.count++,c.events.push(o)):u.push({type:o.eventName,count:1,events:[o],collapsed:!0})}return u}function Jv(){const{data:r,loading:u}=Te("/api/hooks/events?limit=200"),[o,c]=b.useState([]),[d,x]=kt("eventType","All"),[m,j]=kt("session",""),[p,h]=kt("range","0"),[N,y]=b.useState(null),[C,_]=b.useState(new Set);Le("hook-event",w=>{const T=w;T.id&&c(O=>[T,...O].slice(0,50))});const z=b.useMemo(()=>{const w=r?.data??[],T=new Set(w.map(W=>W.id));return[...o.filter(W=>!T.has(W.id)),...w].sort((W,X)=>new Date(X.timestamp).getTime()-new Date(W.timestamp).getTime())},[r,o]),A=b.useMemo(()=>{let w=z;d!=="All"&&(w=w.filter(O=>O.eventName===d)),m&&(w=w.filter(O=>O.sessionId.includes(m)));const T=parseInt(p,10);if(T>0){const O=Date.now()-T;w=w.filter(W=>new Date(W.timestamp).getTime()>O)}return w},[z,d,m,p]),v=b.useMemo(()=>Kv(A),[A]);return u&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading hook events..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Hook Events"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[A.length," events"]})]}),l.jsxs("div",{className:"flex gap-3 flex-wrap",children:[l.jsx("select",{value:d,onChange:w=>x(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:Qv.map(w=>l.jsx("option",{value:w,children:w},w))}),l.jsx("input",{type:"text",placeholder:"Filter by session ID...",value:m,onChange:w=>j(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5 w-48"}),l.jsx("select",{value:p,onChange:w=>h(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:Xv.map(w=>l.jsx("option",{value:w.value,children:w.label},w.value))})]}),l.jsxs("div",{className:"space-y-1",children:[v.map((w,T)=>{const O=C.has(T),W=w.count===1||O?w.events:[w.events[0]];return l.jsxs("div",{children:[w.count>1&&l.jsxs("button",{onClick:()=>{_(X=>{const le=new Set(X);return le.has(T)?le.delete(T):le.add(T),le})},className:"w-full text-left px-3 py-1 text-xs text-gray-500 hover:text-gray-300 bg-gray-900 rounded",children:[O?"▾":"▸"," ",w.count,"× ",w.type]}),W.map(X=>{const le=X.result?.decision==="deny"||X.result?.decision==="block";return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>y(N===X.id?null:X.id),className:`w-full text-left flex items-center gap-3 px-3 py-2 rounded text-sm hover:bg-gray-800/50 ${le?"bg-red-950/30 border border-red-900/40":""}`,children:[l.jsx("span",{className:"text-gray-500 text-xs font-mono w-16 shrink-0",children:Zv(X.timestamp)}),l.jsx(oe,{label:X.eventName,variant:le?"error":"default"}),l.jsx("span",{className:"text-gray-400 text-xs truncate",children:X.sessionId.slice(0,12)}),X.durationMs!=null&&l.jsxs("span",{className:"text-gray-600 text-xs ml-auto",children:[X.durationMs,"ms"]})]}),N===X.id&&l.jsx("pre",{className:"mx-3 mb-2 p-3 bg-gray-900 rounded text-xs text-gray-400 overflow-x-auto max-h-64",children:JSON.stringify(X.payload,null,2)})]},X.id)})]},T)}),v.length===0&&l.jsx("div",{className:"text-center text-gray-600 py-8",children:"No hook events yet"})]})]})}function yx(r){return r<1e3?`${r}ms`:r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function Wv(){const{data:r,loading:u}=Te("/api/hooks/agents"),[o,c]=b.useState([]),[d,x]=kt("session",""),[,m]=b.useState(0);Le("hook-agent",C=>{const _=C;_.agentId&&c(z=>{const A=z.findIndex(v=>v.agentId===_.agentId);if(A>=0){const v=[...z];return v[A]={...v[A],..._},v}return[_,...z]})});const j=b.useMemo(()=>{const C=r?.data??[],_=new Set(C.map(z=>z.agentId));return[...o.filter(z=>!_.has(z.agentId)),...C]},[r,o]),p=b.useMemo(()=>d?j.filter(C=>C.sessionId.includes(d)):j,[j,d]),h=b.useMemo(()=>{const C=new Set(j.map(_=>_.sessionId));return Array.from(C)},[j]),N=b.useMemo(()=>p.filter(C=>!C.stoppedAt).length,[p]);b.useEffect(()=>{if(N===0)return;const C=setInterval(()=>m(_=>_+1),1e3);return()=>clearInterval(C)},[N]);const y=b.useMemo(()=>{const C=p.filter(_=>_.durationMs!=null);return C.length===0?0:Math.round(C.reduce((_,z)=>_+(z.durationMs??0),0)/C.length)},[p]);return u&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading agents..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Agents"}),l.jsxs("div",{className:"flex gap-4 text-sm text-gray-400",children:[l.jsxs("span",{children:["Total: ",p.length]}),l.jsxs("span",{children:["Running: ",N]}),l.jsxs("span",{children:["Avg duration: ",yx(y)]})]})]}),l.jsx("div",{className:"flex gap-3",children:l.jsxs("select",{value:d,onChange:C=>x(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:[l.jsx("option",{value:"",children:"All sessions"}),h.map(C=>l.jsx("option",{value:C,children:C.slice(0,20)},C))]})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-left text-gray-500 border-b border-gray-800",children:[l.jsx("th",{className:"py-2 px-3",children:"Agent ID"}),l.jsx("th",{className:"py-2 px-3",children:"Type"}),l.jsx("th",{className:"py-2 px-3",children:"Session"}),l.jsx("th",{className:"py-2 px-3",children:"Started"}),l.jsx("th",{className:"py-2 px-3",children:"Stopped"}),l.jsx("th",{className:"py-2 px-3",children:"Duration"}),l.jsx("th",{className:"py-2 px-3",children:"Status"})]})}),l.jsxs("tbody",{children:[p.map(C=>{const _=!C.stoppedAt,z=_?Date.now()-new Date(C.startedAt).getTime():C.durationMs??0;return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"py-2 px-3 font-mono text-xs text-gray-300",children:C.agentId.slice(0,16)}),l.jsx("td",{className:"py-2 px-3 text-gray-300",children:C.agentType}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:C.sessionId.slice(0,12)}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:new Date(C.startedAt).toLocaleTimeString()}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:C.stoppedAt?new Date(C.stoppedAt).toLocaleTimeString():"—"}),l.jsx("td",{className:"py-2 px-3 text-gray-400 text-xs",children:yx(z)}),l.jsx("td",{className:"py-2 px-3",children:l.jsx(oe,{label:_?"running":"stopped",variant:_?"success":"default"})})]},C.agentId)}),p.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"py-8 text-center text-gray-600",children:"No agents tracked yet"})})]})]})})]})}function Pn({value:r,onSave:u,placeholder:o}){const[c,d]=b.useState(!1),[x,m]=b.useState(r),j=b.useRef(null);b.useEffect(()=>{c&&(j.current?.focus(),j.current?.select())},[c]);const p=()=>{x!==r&&u(x),d(!1)},h=()=>{m(r),d(!1)};return c?l.jsx("input",{ref:j,value:x,onChange:N=>m(N.target.value),onKeyDown:N=>{N.key==="Enter"&&p(),N.key==="Escape"&&h()},onBlur:p,className:"bg-gray-800 border border-indigo-500/50 text-gray-200 text-xs rounded px-2 py-1 w-full focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:o}):l.jsx("span",{onClick:()=>{m(r),d(!0)},className:"text-xs text-gray-400 cursor-pointer hover:text-gray-200 hover:bg-gray-800/50 rounded px-1.5 py-0.5 transition-colors min-w-[60px] inline-block",title:"Click to edit",children:r||l.jsx("span",{className:"text-gray-600 italic",children:o||"Click to set"})})}function Zl(r,u){return r?u==="github"&&r.github?`${r.github.owner}/${r.github.repo}`:u==="jira"&&r.jira?r.jira.projectKey:u==="ado"&&r.ado?r.ado.project:"":""}function mo(r,u){if(r==="github"){const o=u.split("/");return o.length===2?{github:{owner:o[0],repo:o[1]}}:{github:{owner:"",repo:u}}}return r==="jira"?{jira:{projectKey:u}}:r==="ado"?{ado:{project:u}}:{}}function Fv({onClose:r,onSubmit:u}){const[o,c]=b.useState(""),[d,x]=b.useState(""),[m,j]=b.useState(""),[p,h]=b.useState(""),[N,y]=b.useState(""),C=b.useRef(null);b.useEffect(()=>{C.current?.focus()},[]);const _=z=>{if(z.preventDefault(),!o.trim()||!d.trim()||!m.trim()){y("ID, Path, and Prefix are required");return}u({id:o.trim(),path:d.trim(),prefix:m.trim(),name:p.trim()||void 0})};return l.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:r,children:l.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 w-full max-w-md shadow-2xl",onClick:z=>z.stopPropagation(),children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-200 mb-4",children:"Add Repository"}),l.jsxs("form",{onSubmit:_,className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ID *"}),l.jsx("input",{ref:C,value:o,onChange:z=>c(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Path *"}),l.jsx("input",{value:d,onChange:z=>x(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., repositories/acme/frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Prefix *"}),l.jsx("input",{value:m,onChange:z=>j(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., FE"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Display Name"}),l.jsx("input",{value:p,onChange:z=>h(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., Frontend App"})]}),N&&l.jsx("p",{className:"text-xs text-rose-400",children:N}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx("button",{type:"button",onClick:r,className:"text-xs text-gray-400 hover:text-gray-200 px-3 py-1.5 border border-gray-700 rounded-lg transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",className:"text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-4 py-1.5 rounded-lg transition-colors",children:"Add Repo"})]})]})]})})}function Pv(){const{data:r,loading:u,error:o,refetch:c}=Te("/api/workspace"),{activeProject:d}=qa(),[x,m]=b.useState(!1),[j,p]=b.useState(null),h=d?.id?`?project=${d.id}`:"",N=b.useCallback(async(w,T)=>{try{p(null);const O=await fetch(`/api/workspace/repos/${encodeURIComponent(w)}${h}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!O.ok){const W=await O.json();p(W.error||`Failed to update ${w}`);return}c()}catch(O){p(O.message)}},[h,c]),y=b.useCallback(async w=>{try{p(null);const T=await fetch(`/api/workspace/repos${h}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!T.ok){const O=await T.json();p(O.error||"Failed to add repo");return}m(!1),c()}catch(T){p(T.message)}},[h,c]),C=b.useCallback(async w=>{if(confirm(`Remove "${w}" from workspace?`))try{p(null);const T=await fetch(`/api/workspace/repos/${encodeURIComponent(w)}${h}`,{method:"DELETE"});if(!T.ok&&T.status!==204){const O=await T.json();p(O.error||`Failed to remove ${w}`);return}c()}catch(T){p(T.message)}},[h,c]);if(u)return l.jsx(et,{});if(o)return l.jsx(Gt,{message:o,onRetry:c});const _=r||{name:"",rootRepo:null,repos:[]},z=_.repos.filter(w=>w.sync?.github).length,A=_.repos.filter(w=>w.sync?.jira).length,v=_.repos.filter(w=>w.sync?.ado).length;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Workspace"}),_.name&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:_.name})]}),l.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1.5 text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-3 py-1.5 rounded-lg transition-colors",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"Add Repo"]})]}),j&&l.jsx("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-2",children:l.jsx("p",{className:"text-xs text-rose-400",children:j})}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ie,{title:"Repositories",value:_.repos.length,color:"indigo"}),l.jsx(ie,{title:"GitHub Mapped",value:z,color:"cyan"}),l.jsx(ie,{title:"Jira Mapped",value:A,color:"amber"}),l.jsx(ie,{title:"ADO Mapped",value:v,color:"emerald"})]}),_.rootRepo&&l.jsxs("div",{className:"bg-gray-900/50 border border-indigo-500/20 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(oe,{label:"Root",variant:"info"}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Umbrella Repository"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"GitHub"}),l.jsx("span",{className:"text-xs text-gray-400",children:Zl(_.rootRepo,"github")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Jira"}),l.jsx("span",{className:"text-xs text-gray-400",children:Zl(_.rootRepo,"jira")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ADO"}),l.jsx("span",{className:"text-xs text-gray-400",children:Zl(_.rootRepo,"ado")||"-"})]})]})]}),_.repos.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories in workspace"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:'Click "Add Repo" to register your first repository'})]}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ID"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Name"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Prefix"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"GitHub"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Jira"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ADO"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Role"}),l.jsx("th",{className:"text-right text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3 w-10"})]})}),l.jsx("tbody",{children:_.repos.map(w=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs font-mono text-gray-300",children:w.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Pn,{value:w.name||"",onSave:T=>N(w.id,{name:T}),placeholder:"Set name"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(oe,{label:w.prefix,variant:"default"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Pn,{value:Zl(w.sync,"github"),onSave:T=>N(w.id,{sync:{...w.sync,...mo("github",T)}}),placeholder:"owner/repo"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Pn,{value:Zl(w.sync,"jira"),onSave:T=>N(w.id,{sync:{...w.sync,...mo("jira",T)}}),placeholder:"PROJECT"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Pn,{value:Zl(w.sync,"ado"),onSave:T=>N(w.id,{sync:{...w.sync,...mo("ado",T)}}),placeholder:"project"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Pn,{value:w.role||"",onSave:T=>N(w.id,{role:T}),placeholder:"Set role"})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx("button",{onClick:()=>C(w.id),className:"text-gray-600 hover:text-rose-400 transition-colors p-1",title:"Remove from workspace",children:l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})})]},w.id))})]})})}),x&&l.jsx(Fv,{onClose:()=>m(!1),onSubmit:y})]})}function Iv(){const r=dy(),u=Yt();return l.jsx(qx.Provider,{value:r,children:l.jsx(xy,{children:l.jsxs("div",{className:"work-shell flex min-h-screen text-gray-100",children:[l.jsx(py,{}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[l.jsx(vy,{}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:l.jsx(by,{resetKey:u.pathname,children:l.jsxs(Dp,{children:[l.jsx(Ve,{path:"/",element:l.jsx(ex,{})}),l.jsx(Ve,{path:"/sessions",element:l.jsx(ex,{sessionsOnly:!0})}),l.jsx(Ve,{path:"/overview",element:l.jsx(My,{})}),l.jsx(Ve,{path:"/increments",element:l.jsx(Oy,{})}),l.jsx(Ve,{path:"/increments/:id",element:l.jsx(Gv,{})}),l.jsx(Ve,{path:"/analytics",element:l.jsx(Uy,{})}),l.jsx(Ve,{path:"/costs",element:l.jsx(Ky,{})}),l.jsx(Ve,{path:"/sync",element:l.jsx(tv,{})}),l.jsx(Ve,{path:"/errors",element:l.jsx(rv,{})}),l.jsx(Ve,{path:"/activity",element:l.jsx(mv,{})}),l.jsx(Ve,{path:"/config",element:l.jsx(pv,{})}),l.jsx(Ve,{path:"/plugins",element:l.jsx(bv,{})}),l.jsx(Ve,{path:"/services",element:l.jsx(Nv,{})}),l.jsx(Ve,{path:"/notifications",element:l.jsx(wv,{})}),l.jsx(Ve,{path:"/repos",element:l.jsx(Tv,{})}),l.jsx(Ve,{path:"/marketplace",element:l.jsx($v,{})}),l.jsx(Ve,{path:"/hooks",element:l.jsx(Jv,{})}),l.jsx(Ve,{path:"/agents",element:l.jsx(Wv,{})}),l.jsx(Ve,{path:"/workspace",element:l.jsx(Pv,{})}),l.jsx(Ve,{path:"*",element:l.jsxs("div",{className:"p-6 text-center",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200 mb-2",children:"Page Not Found"}),l.jsx("p",{className:"text-sm text-gray-500",children:"The page you're looking for doesn't exist."})]})})]})})})]})]})})})}Dg.createRoot(document.getElementById("root")).render(l.jsx(b.StrictMode,{children:l.jsx(ay,{children:l.jsx(Iv,{})})}));
|