specweave 1.0.556 → 1.0.557
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/dist/dashboard/assets/index-C434W7yF.js +13 -0
- package/dist/dashboard/assets/index-YkogWPHY.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/src/core/auto/completion-evaluator.js +2 -2
- package/dist/src/core/auto/completion-evaluator.js.map +1 -1
- package/dist/src/core/cost/budget-monitor.d.ts +32 -0
- package/dist/src/core/cost/budget-monitor.d.ts.map +1 -0
- package/dist/src/core/cost/budget-monitor.js +63 -0
- package/dist/src/core/cost/budget-monitor.js.map +1 -0
- package/dist/src/core/cost/model-pricing-registry.d.ts +64 -0
- package/dist/src/core/cost/model-pricing-registry.d.ts.map +1 -0
- package/dist/src/core/cost/model-pricing-registry.js +113 -0
- package/dist/src/core/cost/model-pricing-registry.js.map +1 -0
- package/dist/src/core/cost/spend-aggregator.d.ts +68 -0
- package/dist/src/core/cost/spend-aggregator.d.ts.map +1 -0
- package/dist/src/core/cost/spend-aggregator.js +123 -0
- package/dist/src/core/cost/spend-aggregator.js.map +1 -0
- package/dist/src/core/cost/spend-pipeline.d.ts +27 -0
- package/dist/src/core/cost/spend-pipeline.d.ts.map +1 -0
- package/dist/src/core/cost/spend-pipeline.js +51 -0
- package/dist/src/core/cost/spend-pipeline.js.map +1 -0
- package/dist/src/core/cost/spend-record-reader.d.ts +23 -0
- package/dist/src/core/cost/spend-record-reader.d.ts.map +1 -0
- package/dist/src/core/cost/spend-record-reader.js +81 -0
- package/dist/src/core/cost/spend-record-reader.js.map +1 -0
- package/dist/src/core/cost/spend-record-writer.d.ts +18 -0
- package/dist/src/core/cost/spend-record-writer.d.ts.map +1 -0
- package/dist/src/core/cost/spend-record-writer.js +27 -0
- package/dist/src/core/cost/spend-record-writer.js.map +1 -0
- package/dist/src/core/cost/spend-record.d.ts +81 -0
- package/dist/src/core/cost/spend-record.d.ts.map +1 -0
- package/dist/src/core/cost/spend-record.js +60 -0
- package/dist/src/core/cost/spend-record.js.map +1 -0
- package/dist/src/core/cost/spend-tracking-provider.d.ts +43 -0
- package/dist/src/core/cost/spend-tracking-provider.d.ts.map +1 -0
- package/dist/src/core/cost/spend-tracking-provider.js +109 -0
- package/dist/src/core/cost/spend-tracking-provider.js.map +1 -0
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +3 -4
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/core/llm/provider-factory.d.ts.map +1 -1
- package/dist/src/core/llm/provider-factory.js +27 -8
- package/dist/src/core/llm/provider-factory.js.map +1 -1
- package/dist/src/core/llm/providers/claude-code-provider.d.ts.map +1 -1
- package/dist/src/core/llm/providers/claude-code-provider.js +2 -1
- package/dist/src/core/llm/providers/claude-code-provider.js.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.js +58 -1
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard/assets/index-BMm0qiMB.css +0 -1
- package/dist/dashboard/assets/index-CBXB9ta5.js +0 -13
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const x of f)if(x.type==="childList")for(const h of x.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function u(f){const x={};return f.integrity&&(x.integrity=f.integrity),f.referrerPolicy&&(x.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?x.credentials="include":f.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(f){if(f.ep)return;f.ep=!0;const x=u(f);fetch(f.href,x)}})();var Jc={exports:{}},Xn={};var T0;function ng(){if(T0)return Xn;T0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function u(c,f,x){var h=null;if(x!==void 0&&(h=""+x),f.key!==void 0&&(h=""+f.key),"key"in f){x={};for(var j in f)j!=="key"&&(x[j]=f[j])}else x=f;return f=x.ref,{$$typeof:r,type:c,key:h,ref:f!==void 0?f:null,props:x}}return Xn.Fragment=o,Xn.jsx=u,Xn.jsxs=u,Xn}var w0;function sg(){return w0||(w0=1,Jc.exports=ng()),Jc.exports}var n=sg(),Wc={exports:{}},ue={};var A0;function rg(){if(A0)return ue;A0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),h=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),T=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=T&&S[T]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,N={};function C(S,$,Q){this.props=S,this.context=$,this.refs=N,this.updater=Q||z}C.prototype.isReactComponent={},C.prototype.setState=function(S,$){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,$,"setState")},C.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function w(){}w.prototype=C.prototype;function U(S,$,Q){this.props=S,this.context=$,this.refs=N,this.updater=Q||z}var J=U.prototype=new w;J.constructor=U,O(J,C.prototype),J.isPureReactComponent=!0;var V=Array.isArray;function ae(){}var Z={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function H(S,$,Q){var P=Q.ref;return{$$typeof:r,type:S,key:$,ref:P!==void 0?P:null,props:Q}}function W(S,$){return H(S.type,$,S.props)}function I(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function Ee(S){var $={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return $[Q]})}var He=/\/+/g;function _e(S,$){return typeof S=="object"&&S!==null&&S.key!=null?Ee(""+S.key):$.toString(36)}function je(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ae,ae):(S.status="pending",S.then(function($){S.status==="pending"&&(S.status="fulfilled",S.value=$)},function($){S.status==="pending"&&(S.status="rejected",S.reason=$)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,$,Q,P,ce){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(fe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case r:case o:ee=!0;break;case v:return ee=S._init,k(ee(S._payload),$,Q,P,ce)}}if(ee)return ce=ce(S),ee=P===""?"."+_e(S,0):P,V(ce)?(Q="",ee!=null&&(Q=ee.replace(He,"$&/")+"/"),k(ce,$,Q,"",function(Fl){return Fl})):ce!=null&&(I(ce)&&(ce=W(ce,Q+(ce.key==null||S&&S.key===ce.key?"":(""+ce.key).replace(He,"$&/")+"/")+ee)),$.push(ce)),1;ee=0;var Ke=P===""?".":P+":";if(V(S))for(var $e=0;$e<S.length;$e++)P=S[$e],fe=Ke+_e(P,$e),ee+=k(P,$,Q,fe,ce);else if($e=M(S),typeof $e=="function")for(S=$e.call(S),$e=0;!(P=S.next()).done;)P=P.value,fe=Ke+_e(P,$e++),ee+=k(P,$,Q,fe,ce);else if(fe==="object"){if(typeof S.then=="function")return k(je(S),$,Q,P,ce);throw $=String(S),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ee}function X(S,$,Q){if(S==null)return S;var P=[],ce=0;return k(S,P,"","",function(fe){return $.call(Q,fe,ce++)}),P}function se(S){if(S._status===-1){var $=S._result;$=$(),$.then(function(Q){(S._status===0||S._status===-1)&&(S._status=1,S._result=Q)},function(Q){(S._status===0||S._status===-1)&&(S._status=2,S._result=Q)}),S._status===-1&&(S._status=0,S._result=$)}if(S._status===1)return S._result.default;throw S._result}var ye=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=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($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Ne={map:X,forEach:function(S,$,Q){X(S,function(){$.apply(this,arguments)},Q)},count:function(S){var $=0;return X(S,function(){$++}),$},toArray:function(S){return X(S,function($){return $})||[]},only:function(S){if(!I(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=y,ue.Children=Ne,ue.Component=C,ue.Fragment=u,ue.Profiler=f,ue.PureComponent=U,ue.StrictMode=c,ue.Suspense=p,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Z.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,$,Q){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var P=O({},S.props),ce=S.key;if($!=null)for(fe in $.key!==void 0&&(ce=""+$.key),$)!K.call($,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&$.ref===void 0||(P[fe]=$[fe]);var fe=arguments.length-2;if(fe===1)P.children=Q;else if(1<fe){for(var ee=Array(fe),Ke=0;Ke<fe;Ke++)ee[Ke]=arguments[Ke+2];P.children=ee}return H(S.type,ce,P)},ue.createContext=function(S){return S={$$typeof:h,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:x,_context:S},S},ue.createElement=function(S,$,Q){var P,ce={},fe=null;if($!=null)for(P in $.key!==void 0&&(fe=""+$.key),$)K.call($,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ce[P]=$[P]);var ee=arguments.length-2;if(ee===1)ce.children=Q;else if(1<ee){for(var Ke=Array(ee),$e=0;$e<ee;$e++)Ke[$e]=arguments[$e+2];ce.children=Ke}if(S&&S.defaultProps)for(P in ee=S.defaultProps,ee)ce[P]===void 0&&(ce[P]=ee[P]);return H(S,fe,ce)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(S){return{$$typeof:j,render:S}},ue.isValidElement=I,ue.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:se}},ue.memo=function(S,$){return{$$typeof:m,type:S,compare:$===void 0?null:$}},ue.startTransition=function(S){var $=Z.T,Q={};Z.T=Q;try{var P=S(),ce=Z.S;ce!==null&&ce(Q,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(ae,ye)}catch(fe){ye(fe)}finally{$!==null&&Q.types!==null&&($.types=Q.types),Z.T=$}},ue.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},ue.use=function(S){return Z.H.use(S)},ue.useActionState=function(S,$,Q){return Z.H.useActionState(S,$,Q)},ue.useCallback=function(S,$){return Z.H.useCallback(S,$)},ue.useContext=function(S){return Z.H.useContext(S)},ue.useDebugValue=function(){},ue.useDeferredValue=function(S,$){return Z.H.useDeferredValue(S,$)},ue.useEffect=function(S,$){return Z.H.useEffect(S,$)},ue.useEffectEvent=function(S){return Z.H.useEffectEvent(S)},ue.useId=function(){return Z.H.useId()},ue.useImperativeHandle=function(S,$,Q){return Z.H.useImperativeHandle(S,$,Q)},ue.useInsertionEffect=function(S,$){return Z.H.useInsertionEffect(S,$)},ue.useLayoutEffect=function(S,$){return Z.H.useLayoutEffect(S,$)},ue.useMemo=function(S,$){return Z.H.useMemo(S,$)},ue.useOptimistic=function(S,$){return Z.H.useOptimistic(S,$)},ue.useReducer=function(S,$,Q){return Z.H.useReducer(S,$,Q)},ue.useRef=function(S){return Z.H.useRef(S)},ue.useState=function(S){return Z.H.useState(S)},ue.useSyncExternalStore=function(S,$,Q){return Z.H.useSyncExternalStore(S,$,Q)},ue.useTransition=function(){return Z.H.useTransition()},ue.version="19.2.4",ue}var R0;function fu(){return R0||(R0=1,Wc.exports=rg()),Wc.exports}var b=fu(),Fc={exports:{}},Qn={},Pc={exports:{}},Ic={};var M0;function ig(){return M0||(M0=1,(function(r){function o(k,X){var se=k.length;k.push(X);e:for(;0<se;){var ye=se-1>>>1,Ne=k[ye];if(0<f(Ne,X))k[ye]=X,k[se]=Ne,se=ye;else break e}}function u(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var X=k[0],se=k.pop();if(se!==X){k[0]=se;e:for(var ye=0,Ne=k.length,S=Ne>>>1;ye<S;){var $=2*(ye+1)-1,Q=k[$],P=$+1,ce=k[P];if(0>f(Q,se))P<Ne&&0>f(ce,Q)?(k[ye]=ce,k[P]=se,ye=P):(k[ye]=Q,k[$]=se,ye=$);else if(P<Ne&&0>f(ce,se))k[ye]=ce,k[P]=se,ye=P;else break e}}return X}function f(k,X){var se=k.sortIndex-X.sortIndex;return se!==0?se:k.id-X.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 h=Date,j=h.now();r.unstable_now=function(){return h.now()-j}}var p=[],m=[],v=1,y=null,T=3,M=!1,z=!1,O=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function J(k){for(var X=u(m);X!==null;){if(X.callback===null)c(m);else if(X.startTime<=k)c(m),X.sortIndex=X.expirationTime,o(p,X);else break;X=u(m)}}function V(k){if(O=!1,J(k),!z)if(u(p)!==null)z=!0,ae||(ae=!0,Ee());else{var X=u(m);X!==null&&je(V,X.startTime-k)}}var ae=!1,Z=-1,K=5,H=-1;function W(){return N?!0:!(r.unstable_now()-H<K)}function I(){if(N=!1,ae){var k=r.unstable_now();H=k;var X=!0;try{e:{z=!1,O&&(O=!1,w(Z),Z=-1),M=!0;var se=T;try{t:{for(J(k),y=u(p);y!==null&&!(y.expirationTime>k&&W());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,T=y.priorityLevel;var Ne=ye(y.expirationTime<=k);if(k=r.unstable_now(),typeof Ne=="function"){y.callback=Ne,J(k),X=!0;break t}y===u(p)&&c(p),J(k)}else c(p);y=u(p)}if(y!==null)X=!0;else{var S=u(m);S!==null&&je(V,S.startTime-k),X=!1}}break e}finally{y=null,T=se,M=!1}X=void 0}}finally{X?Ee():ae=!1}}}var Ee;if(typeof U=="function")Ee=function(){U(I)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,_e=He.port2;He.port1.onmessage=I,Ee=function(){_e.postMessage(null)}}else Ee=function(){C(I,0)};function je(k,X){Z=C(function(){k(r.unstable_now())},X)}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(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return T},r.unstable_next=function(k){switch(T){case 1:case 2:case 3:var X=3;break;default:X=T}var se=T;T=X;try{return k()}finally{T=se}},r.unstable_requestPaint=function(){N=!0},r.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var se=T;T=k;try{return X()}finally{T=se}},r.unstable_scheduleCallback=function(k,X,se){var ye=r.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ye+se:ye):se=ye,k){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=se+Ne,k={id:v++,callback:X,priorityLevel:k,startTime:se,expirationTime:Ne,sortIndex:-1},se>ye?(k.sortIndex=se,o(m,k),u(p)===null&&k===u(m)&&(O?(w(Z),Z=-1):O=!0,je(V,se-ye))):(k.sortIndex=Ne,o(p,k),z||M||(z=!0,ae||(ae=!0,Ee()))),k},r.unstable_shouldYield=W,r.unstable_wrapCallback=function(k){var X=T;return function(){var se=T;T=X;try{return k.apply(this,arguments)}finally{T=se}}}})(Ic)),Ic}var z0;function cg(){return z0||(z0=1,Pc.exports=ig()),Pc.exports}var eu={exports:{}},rt={};var _0;function ug(){if(_0)return rt;_0=1;var r=fu();function o(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(o(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal");function x(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function j(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,rt.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(o(299));return x(p,m,null,v)},rt.flushSync=function(p){var m=h.T,v=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=m,c.p=v,c.d.f()}},rt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,c.d.C(p,m))},rt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},rt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=j(v,m.crossOrigin),T=typeof m.integrity=="string"?m.integrity:void 0,M=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?c.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:T,fetchPriority:M}):v==="script"&&c.d.X(p,{crossOrigin:y,integrity:T,fetchPriority:M,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},rt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=j(m.as,m.crossOrigin);c.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&c.d.M(p)},rt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=j(v,m.crossOrigin);c.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},rt.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=j(m.as,m.crossOrigin);c.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else c.d.m(p)},rt.requestFormReset=function(p){c.d.r(p)},rt.unstable_batchedUpdates=function(p,m){return p(m)},rt.useFormState=function(p,m,v){return h.H.useFormState(p,m,v)},rt.useFormStatus=function(){return h.H.useHostTransitionStatus()},rt.version="19.2.4",rt}var D0;function og(){if(D0)return eu.exports;D0=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(o){console.error(o)}}return r(),eu.exports=ug(),eu.exports}var O0;function dg(){if(O0)return Qn;O0=1;var r=cg(),o=fu(),u=og();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 f(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 h(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 m(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,l=t;;){var s=a.return;if(s===null)break;var i=s.alternate;if(i===null){if(l=s.return,l!==null){a=l;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===a)return p(s),e;if(i===l)return p(s),t;i=i.sibling}throw Error(c(188))}if(a.return!==l.return)a=s,l=i;else{for(var d=!1,g=s.child;g;){if(g===a){d=!0,a=s,l=i;break}if(g===l){d=!0,l=s,a=i;break}g=g.sibling}if(!d){for(g=i.child;g;){if(g===a){d=!0,a=i,l=s;break}if(g===l){d=!0,l=i,a=s;break}g=g.sibling}if(!d)throw Error(c(189))}}if(a.alternate!==l)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,T=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),U=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Ee(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var He=Symbol.for("react.client.reference");function _e(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===He?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case V:return"Suspense";case ae:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case U:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:_e(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var je=Array.isArray,k=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ye=[],Ne=-1;function S(e){return{current:e}}function $(e){0>Ne||(e.current=ye[Ne],ye[Ne]=null,Ne--)}function Q(e,t){Ne++,ye[Ne]=e.current,e.current=t}var P=S(null),ce=S(null),fe=S(null),ee=S(null);function Ke(e,t){switch(Q(fe,t),Q(ce,e),Q(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jf(t),e=Wf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(P),Q(P,e)}function $e(){$(P),$(ce),$(fe)}function Fl(e){e.memoizedState!==null&&Q(ee,e);var t=P.current,a=Wf(t,e.type);t!==a&&(Q(ce,e),Q(P,a))}function ls(e){ce.current===e&&($(P),$(ce)),ee.current===e&&($(ee),$n._currentValue=se)}var zr,Su;function $a(e){if(zr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);zr=t&&t[1]||"",Su=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+zr+e+Su}var _r=!1;function Dr(e,t){if(!e||_r)return"";_r=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={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 L=B}Reflect.construct(e,[],G)}else{try{G.call()}catch(B){L=B}e.call(G.prototype)}}else{try{throw Error()}catch(B){L=B}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(B){if(B&&L&&typeof B.stack=="string")return[B.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],g=i[1];if(d&&g){var E=d.split(`
|
|
4
|
-
`),D=g.split(`
|
|
5
|
-
`);for(s=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;if(l===E.length||s===D.length)for(l=E.length-1,s=D.length-1;1<=l&&0<=s&&E[l]!==D[s];)s--;for(;1<=l&&0<=s;l--,s--)if(E[l]!==D[s]){if(l!==1||s!==1)do if(l--,s--,0>s||E[l]!==D[s]){var q=`
|
|
6
|
-
`+E[l].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=l&&0<=s);break}}}finally{_r=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?$a(a):""}function Ux(e,t){switch(e.tag){case 26:case 27:case 5:return $a(e.type);case 16:return $a("Lazy");case 13:return e.child!==t&&t!==null?$a("Suspense Fallback"):$a("Suspense");case 19:return $a("SuspenseList");case 0:case 15:return Dr(e.type,!1);case 11:return Dr(e.type.render,!1);case 1:return Dr(e.type,!0);case 31:return $a("Activity");default:return""}}function Eu(e){try{var t="",a=null;do t+=Ux(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
-
Error generating stack: `+l.message+`
|
|
8
|
-
`+l.stack}}var Or=Object.prototype.hasOwnProperty,Ur=r.unstable_scheduleCallback,Lr=r.unstable_cancelCallback,Lx=r.unstable_shouldYield,Hx=r.unstable_requestPaint,ht=r.unstable_now,Bx=r.unstable_getCurrentPriorityLevel,Cu=r.unstable_ImmediatePriority,Tu=r.unstable_UserBlockingPriority,ns=r.unstable_NormalPriority,kx=r.unstable_LowPriority,wu=r.unstable_IdlePriority,qx=r.log,$x=r.unstable_setDisableYieldValue,Pl=null,gt=null;function ha(e){if(typeof qx=="function"&&$x(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Pl,e)}catch{}}var pt=Math.clz32?Math.clz32:Vx,Yx=Math.log,Gx=Math.LN2;function Vx(e){return e>>>=0,e===0?32:31-(Yx(e)/Gx|0)|0}var ss=256,rs=262144,is=4194304;function Ya(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 cs(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var s=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~i,l!==0?s=Ya(l):(d&=g,d!==0?s=Ya(d):a||(a=g&~e,a!==0&&(s=Ya(a))))):(g=l&~i,g!==0?s=Ya(g):d!==0?s=Ya(d):a||(a=l&~e,a!==0&&(s=Ya(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 Il(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xx(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 Au(){var e=is;return is<<=1,(is&62914560)===0&&(is=4194304),e}function Hr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function en(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qx(e,t,a,l,s,i){var d=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,D=e.hiddenUpdates;for(a=d&~a;0<a;){var q=31-pt(a),G=1<<q;g[q]=0,E[q]=-1;var L=D[q];if(L!==null)for(D[q]=null,q=0;q<L.length;q++){var B=L[q];B!==null&&(B.lane&=-536870913)}a&=~G}l!==0&&Ru(e,l,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function Ru(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-pt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Mu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-pt(a),s=1<<l;s&t|e[l]&t&&(e[l]|=t),a&=~s}}function zu(e,t){var a=t&-t;return a=(a&42)!==0?1:Br(a),(a&(e.suspendedLanes|t))!==0?0:a}function Br(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 kr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _u(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:v0(e.type))}function Du(e,t){var a=X.p;try{return X.p=e,t()}finally{X.p=a}}var ga=Math.random().toString(36).slice(2),et="__reactFiber$"+ga,ct="__reactProps$"+ga,il="__reactContainer$"+ga,qr="__reactEvents$"+ga,Zx="__reactListeners$"+ga,Kx="__reactHandles$"+ga,Ou="__reactResources$"+ga,tn="__reactMarker$"+ga;function $r(e){delete e[et],delete e[ct],delete e[qr],delete e[Zx],delete e[Kx]}function cl(e){var t=e[et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[il]||a[et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=l0(e);e!==null;){if(a=e[et])return a;e=l0(e)}return t}e=a,a=e.parentNode}return null}function ul(e){if(e=e[et]||e[il]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function an(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ol(e){var t=e[Ou];return t||(t=e[Ou]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Fe(e){e[tn]=!0}var Uu=new Set,Lu={};function Ga(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(Lu[e]=t,e=0;e<t.length;e++)Uu.add(t[e])}var Jx=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]*$"),Hu={},Bu={};function Wx(e){return Or.call(Bu,e)?!0:Or.call(Hu,e)?!1:Jx.test(e)?Bu[e]=!0:(Hu[e]=!0,!1)}function us(e,t,a){if(Wx(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function os(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,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ku(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fx(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){a=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yr(e){if(!e._valueTracker){var t=ku(e)?"checked":"value";e._valueTracker=Fx(e,t,""+e[t])}}function qu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=ku(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function ds(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 Px=/[\n"\\]/g;function Tt(e){return e.replace(Px,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gr(e,t,a,l,s,i,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Vr(e,d,Ct(t)):a!=null?Vr(e,d,Ct(a)):l!=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=""+Ct(g):e.removeAttribute("name")}function $u(e,t,a,l,s,i,d,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)){Yr(e);return}a=a!=null?""+Ct(a):"",t=t!=null?""+Ct(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Yr(e)}function Vr(e,t,a){t==="number"&&ds(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function fl(e,t,a,l){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&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ct(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Yu(e,t,a){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ct(a):""}function Gu(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(c(92));if(je(l)){if(1<l.length)throw Error(c(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Ct(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Yr(e)}function xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Ix=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 Vu(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Ix.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Xu(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var s in t)l=t[s],t.hasOwnProperty(s)&&a[s]!==l&&Vu(e,s,l)}else for(var i in t)t.hasOwnProperty(i)&&Vu(e,i,t[i])}function Xr(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 em=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"]]),tm=/^[\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 fs(e){return tm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Qr=null;function Zr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,hl=null;function Qu(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(Gr(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="'+Tt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var s=l[ct]||null;if(!s)throw Error(c(90));Gr(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&qu(l)}break e;case"textarea":Yu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&fl(e,!!a.multiple,t,!1)}}}var Kr=!1;function Zu(e,t,a){if(Kr)return e(t,a);Kr=!0;try{var l=e(t);return l}finally{if(Kr=!1,(ml!==null||hl!==null)&&(Is(),ml&&(t=ml,e=hl,hl=ml=null,Qu(t),e)))for(t=0;t<e.length;t++)Qu(e[t])}}function ln(e,t){var a=e.stateNode;if(a===null)return null;var l=a[ct]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(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"),Jr=!1;if(Ft)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){Jr=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{Jr=!1}var pa=null,Wr=null,xs=null;function Ku(){if(xs)return xs;var e,t=Wr,a=t.length,l,s="value"in pa?pa.value:pa.textContent,i=s.length;for(e=0;e<a&&t[e]===s[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===s[i-l];l++);return xs=s.slice(e,1<l?1-l:void 0)}function ms(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 hs(){return!0}function Ju(){return!1}function ut(e){function t(a,l,s,i,d){this._reactName=a,this._targetInst=s,this.type=l,this.nativeEvent=i,this.target=d,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)?hs:Ju,this.isPropagationStopped=Ju,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=hs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gs=ut(Va),sn=y({},Va,{view:0,detail:0}),am=ut(sn),Fr,Pr,rn,ps=y({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ei,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!==rn&&(rn&&e.type==="mousemove"?(Fr=e.screenX-rn.screenX,Pr=e.screenY-rn.screenY):Pr=Fr=0,rn=e),Fr)},movementY:function(e){return"movementY"in e?e.movementY:Pr}}),Wu=ut(ps),lm=y({},ps,{dataTransfer:0}),nm=ut(lm),sm=y({},sn,{relatedTarget:0}),Ir=ut(sm),rm=y({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),im=ut(rm),cm=y({},Va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),um=ut(cm),om=y({},Va,{data:0}),Fu=ut(om),dm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fm={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"},xm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xm[e])?!!t[e]:!1}function ei(){return mm}var hm=y({},sn,{key:function(e){if(e.key){var t=dm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ei,charCode:function(e){return e.type==="keypress"?ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gm=ut(hm),pm=y({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pu=ut(pm),ym=y({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ei}),vm=ut(ym),bm=y({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),jm=ut(bm),Nm=y({},ps,{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}),Sm=ut(Nm),Em=y({},Va,{newState:0,oldState:0}),Cm=ut(Em),Tm=[9,13,27,32],ti=Ft&&"CompositionEvent"in window,cn=null;Ft&&"documentMode"in document&&(cn=document.documentMode);var wm=Ft&&"TextEvent"in window&&!cn,Iu=Ft&&(!ti||cn&&8<cn&&11>=cn),eo=" ",to=!1;function ao(e,t){switch(e){case"keyup":return Tm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function Am(e,t){switch(e){case"compositionend":return lo(t);case"keypress":return t.which!==32?null:(to=!0,eo);case"textInput":return e=t.data,e===eo&&to?null:e;default:return null}}function Rm(e,t){if(gl)return e==="compositionend"||!ti&&ao(e,t)?(e=Ku(),xs=Wr=pa=null,gl=!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 Iu&&t.locale!=="ko"?null:t.data;default:return null}}var Mm={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 no(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mm[e.type]:t==="textarea"}function so(e,t,a,l){ml?hl?hl.push(l):hl=[l]:ml=l,t=rr(t,"onChange"),0<t.length&&(a=new gs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var un=null,on=null;function zm(e){Gf(e,0)}function ys(e){var t=an(e);if(qu(t))return e}function ro(e,t){if(e==="change")return t}var io=!1;if(Ft){var ai;if(Ft){var li="oninput"in document;if(!li){var co=document.createElement("div");co.setAttribute("oninput","return;"),li=typeof co.oninput=="function"}ai=li}else ai=!1;io=ai&&(!document.documentMode||9<document.documentMode)}function uo(){un&&(un.detachEvent("onpropertychange",oo),on=un=null)}function oo(e){if(e.propertyName==="value"&&ys(on)){var t=[];so(t,on,e,Zr(e)),Zu(zm,t)}}function _m(e,t,a){e==="focusin"?(uo(),un=t,on=a,un.attachEvent("onpropertychange",oo)):e==="focusout"&&uo()}function Dm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ys(on)}function Om(e,t){if(e==="click")return ys(t)}function Um(e,t){if(e==="input"||e==="change")return ys(t)}function Lm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:Lm;function dn(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),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var s=a[l];if(!Or.call(t,s)||!yt(e[s],t[s]))return!1}return!0}function fo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xo(e,t){var a=fo(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=fo(a)}}function mo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ho(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ds(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=ds(e.document)}return t}function ni(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 Hm=Ft&&"documentMode"in document&&11>=document.documentMode,pl=null,si=null,fn=null,ri=!1;function go(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ri||pl==null||pl!==ds(l)||(l=pl,"selectionStart"in l&&ni(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),fn&&dn(fn,l)||(fn=l,l=rr(si,"onSelect"),0<l.length&&(t=new gs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=pl)))}function Xa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var yl={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")},ii={},po={};Ft&&(po=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Qa(e){if(ii[e])return ii[e];if(!yl[e])return e;var t=yl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in po)return ii[e]=t[a];return e}var yo=Qa("animationend"),vo=Qa("animationiteration"),bo=Qa("animationstart"),Bm=Qa("transitionrun"),km=Qa("transitionstart"),qm=Qa("transitioncancel"),jo=Qa("transitionend"),No=new Map,ci="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(" ");ci.push("scrollEnd");function Ht(e,t){No.set(e,t),Ga(t,[e])}var vs=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)},wt=[],vl=0,ui=0;function bs(){for(var e=vl,t=ui=vl=0;t<e;){var a=wt[t];wt[t++]=null;var l=wt[t];wt[t++]=null;var s=wt[t];wt[t++]=null;var i=wt[t];if(wt[t++]=null,l!==null&&s!==null){var d=l.pending;d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s}i!==0&&So(a,s,i)}}function js(e,t,a,l){wt[vl++]=e,wt[vl++]=t,wt[vl++]=a,wt[vl++]=l,ui|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function oi(e,t,a,l){return js(e,t,a,l),Ns(e)}function Za(e,t){return js(e,null,null,t),Ns(e)}function So(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var s=!1,i=e.return;i!==null;)i.childLanes|=a,l=i.alternate,l!==null&&(l.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,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=a|536870912),i):null}function Ns(e){if(50<On)throw On=0,vc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bl={};function $m(e,t,a,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,a,l){return new $m(e,t,a,l)}function di(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 Eo(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 Ss(e,t,a,l,s,i){var d=0;if(l=e,typeof e=="function")di(e)&&(d=1);else if(typeof e=="string")d=Qh(e,a,P.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 O:return Ka(a.children,s,i,t);case N:d=8,s|=24;break;case C:return e=vt(12,a,t,s|2),e.elementType=C,e.lanes=i,e;case V:return e=vt(13,a,t,s),e.elementType=V,e.lanes=i,e;case ae:return e=vt(19,a,t,s),e.elementType=ae,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case U:d=10;break e;case w:d=9;break e;case J:d=11;break e;case Z:d=14;break e;case K:d=16,l=null;break e}d=29,a=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=vt(d,a,t,s),t.elementType=e,t.type=l,t.lanes=i,t}function Ka(e,t,a,l){return e=vt(7,e,l,t),e.lanes=a,e}function fi(e,t,a){return e=vt(6,e,null,t),e.lanes=a,e}function Co(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function xi(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 To=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=To.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Eu(t)},To.set(e,t),t)}return{value:e,source:t,stack:Eu(t)}}var jl=[],Nl=0,Es=null,xn=0,Rt=[],Mt=0,ya=null,Yt=1,Gt="";function It(e,t){jl[Nl++]=xn,jl[Nl++]=Es,Es=e,xn=t}function wo(e,t,a){Rt[Mt++]=Yt,Rt[Mt++]=Gt,Rt[Mt++]=ya,ya=e;var l=Yt;e=Gt;var s=32-pt(l)-1;l&=~(1<<s),a+=1;var i=32-pt(t)+s;if(30<i){var d=s-s%5;i=(l&(1<<d)-1).toString(32),l>>=d,s-=d,Yt=1<<32-pt(t)+s|a<<s|l,Gt=i+e}else Yt=1<<i|a<<s|l,Gt=e}function mi(e){e.return!==null&&(It(e,1),wo(e,1,0))}function hi(e){for(;e===Es;)Es=jl[--Nl],jl[Nl]=null,xn=jl[--Nl],jl[Nl]=null;for(;e===ya;)ya=Rt[--Mt],Rt[Mt]=null,Gt=Rt[--Mt],Rt[Mt]=null,Yt=Rt[--Mt],Rt[Mt]=null}function Ao(e,t){Rt[Mt++]=Yt,Rt[Mt++]=Gt,Rt[Mt++]=ya,Yt=t.id,Gt=t.overflow,ya=e}var tt=null,De=null,pe=!1,va=null,zt=!1,gi=Error(c(519));function ba(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mn(At(t,e)),gi}function Ro(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[et]=e,t[ct]=l,a){case"dialog":me("cancel",t),me("close",t);break;case"iframe":case"object":case"embed":me("load",t);break;case"video":case"audio":for(a=0;a<Ln.length;a++)me(Ln[a],t);break;case"source":me("error",t);break;case"img":case"image":case"link":me("error",t),me("load",t);break;case"details":me("toggle",t);break;case"input":me("invalid",t),$u(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":me("invalid",t);break;case"textarea":me("invalid",t),Gu(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Zf(t.textContent,a)?(l.popover!=null&&(me("beforetoggle",t),me("toggle",t)),l.onScroll!=null&&me("scroll",t),l.onScrollEnd!=null&&me("scrollend",t),l.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||ba(e,!0)}function Mo(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:zt=!1;return;case 27:case 3:zt=!0;return;default:tt=tt.return}}function Sl(e){if(e!==tt)return!1;if(!pe)return Mo(e),pe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Oc(e.type,e.memoizedProps)),a=!a),a&&De&&ba(e),Mo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=a0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=a0(e)}else t===27?(t=De,Oa(e.type)?(e=kc,kc=null,De=e):De=t):De=tt?Dt(e.stateNode.nextSibling):null;return!0}function Ja(){De=tt=null,pe=!1}function pi(){var e=va;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),va=null),e}function mn(e){va===null?va=[e]:va.push(e)}var yi=S(null),Wa=null,ea=null;function ja(e,t,a){Q(yi,t._currentValue),t._currentValue=a}function ta(e){e._currentValue=yi.current,$(yi)}function vi(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function bi(e,t,a,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var d=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),vi(i.return,a,e),l||(d=null);break e}i=g.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(c(341));d.lanes|=a,i=d.alternate,i!==null&&(i.lanes|=a),vi(d,a,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function El(e,t,a,l){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 d=s.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var g=s.type;yt(s.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(s===ee.current){if(d=s.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push($n):e=[$n])}s=s.return}e!==null&&bi(t,e,a,l),t.flags|=262144}function Cs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fa(e){Wa=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return zo(Wa,e)}function Ts(e,t){return Wa===null&&Fa(e),zo(e,t)}function zo(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 Ym=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Gm=r.unstable_scheduleCallback,Vm=r.unstable_NormalPriority,Ve={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ji(){return{controller:new Ym,data:new Map,refCount:0}}function hn(e){e.refCount--,e.refCount===0&&Gm(Vm,function(){e.controller.abort()})}var gn=null,Ni=0,Cl=0,Tl=null;function Xm(e,t){if(gn===null){var a=gn=[];Ni=0,Cl=Cc(),Tl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Ni++,t.then(_o,_o),t}function _o(){if(--Ni===0&&gn!==null){Tl!==null&&(Tl.status="fulfilled");var e=gn;gn=null,Cl=0,Tl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qm(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),l}var Do=k.S;k.S=function(e,t){pf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xm(e,t),Do!==null&&Do(e,t)};var Pa=S(null);function Si(){var e=Pa.current;return e!==null?e:ze.pooledCache}function ws(e,t){t===null?Q(Pa,Pa.current):Q(Pa,t.pool)}function Oo(){var e=Si();return e===null?null:{parent:Ve._currentValue,pool:e}}var wl=Error(c(460)),Ei=Error(c(474)),As=Error(c(542)),Rs={then:function(){}};function Uo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lo(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,Bo(e),e;default:if(typeof t.status=="string")t.then(Wt,Wt);else{if(e=ze,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bo(e),e}throw el=t,wl}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(el=a,wl):a}}var el=null;function Ho(){if(el===null)throw Error(c(459));var e=el;return el=null,e}function Bo(e){if(e===wl||e===As)throw Error(c(483))}var Al=null,pn=0;function Ms(e){var t=pn;return pn+=1,Al===null&&(Al=[]),Lo(Al,e,t)}function yn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zs(e,t){throw t.$$typeof===T?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ko(e){function t(R,A){if(e){var _=R.deletions;_===null?(R.deletions=[A],R.flags|=16):_.push(A)}}function a(R,A){if(!e)return null;for(;A!==null;)t(R,A),A=A.sibling;return null}function l(R){for(var A=new Map;R!==null;)R.key!==null?A.set(R.key,R):A.set(R.index,R),R=R.sibling;return A}function s(R,A){return R=Pt(R,A),R.index=0,R.sibling=null,R}function i(R,A,_){return R.index=_,e?(_=R.alternate,_!==null?(_=_.index,_<A?(R.flags|=67108866,A):_):(R.flags|=67108866,A)):(R.flags|=1048576,A)}function d(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function g(R,A,_,Y){return A===null||A.tag!==6?(A=fi(_,R.mode,Y),A.return=R,A):(A=s(A,_),A.return=R,A)}function E(R,A,_,Y){var le=_.type;return le===O?q(R,A,_.props.children,Y,_.key):A!==null&&(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type)?(A=s(A,_.props),yn(A,_),A.return=R,A):(A=Ss(_.type,_.key,_.props,null,R.mode,Y),yn(A,_),A.return=R,A)}function D(R,A,_,Y){return A===null||A.tag!==4||A.stateNode.containerInfo!==_.containerInfo||A.stateNode.implementation!==_.implementation?(A=xi(_,R.mode,Y),A.return=R,A):(A=s(A,_.children||[]),A.return=R,A)}function q(R,A,_,Y,le){return A===null||A.tag!==7?(A=Ka(_,R.mode,Y,le),A.return=R,A):(A=s(A,_),A.return=R,A)}function G(R,A,_){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=fi(""+A,R.mode,_),A.return=R,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case M:return _=Ss(A.type,A.key,A.props,null,R.mode,_),yn(_,A),_.return=R,_;case z:return A=xi(A,R.mode,_),A.return=R,A;case K:return A=Ia(A),G(R,A,_)}if(je(A)||Ee(A))return A=Ka(A,R.mode,_,null),A.return=R,A;if(typeof A.then=="function")return G(R,Ms(A),_);if(A.$$typeof===U)return G(R,Ts(R,A),_);zs(R,A)}return null}function L(R,A,_,Y){var le=A!==null?A.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return le!==null?null:g(R,A,""+_,Y);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case M:return _.key===le?E(R,A,_,Y):null;case z:return _.key===le?D(R,A,_,Y):null;case K:return _=Ia(_),L(R,A,_,Y)}if(je(_)||Ee(_))return le!==null?null:q(R,A,_,Y,null);if(typeof _.then=="function")return L(R,A,Ms(_),Y);if(_.$$typeof===U)return L(R,A,Ts(R,_),Y);zs(R,_)}return null}function B(R,A,_,Y,le){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return R=R.get(_)||null,g(A,R,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case M:return R=R.get(Y.key===null?_:Y.key)||null,E(A,R,Y,le);case z:return R=R.get(Y.key===null?_:Y.key)||null,D(A,R,Y,le);case K:return Y=Ia(Y),B(R,A,_,Y,le)}if(je(Y)||Ee(Y))return R=R.get(_)||null,q(A,R,Y,le,null);if(typeof Y.then=="function")return B(R,A,_,Ms(Y),le);if(Y.$$typeof===U)return B(R,A,_,Ts(A,Y),le);zs(A,Y)}return null}function F(R,A,_,Y){for(var le=null,ve=null,te=A,de=A=0,ge=null;te!==null&&de<_.length;de++){te.index>de?(ge=te,te=null):ge=te.sibling;var be=L(R,te,_[de],Y);if(be===null){te===null&&(te=ge);break}e&&te&&be.alternate===null&&t(R,te),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be,te=ge}if(de===_.length)return a(R,te),pe&&It(R,de),le;if(te===null){for(;de<_.length;de++)te=G(R,_[de],Y),te!==null&&(A=i(te,A,de),ve===null?le=te:ve.sibling=te,ve=te);return pe&&It(R,de),le}for(te=l(te);de<_.length;de++)ge=B(te,R,de,_[de],Y),ge!==null&&(e&&ge.alternate!==null&&te.delete(ge.key===null?de:ge.key),A=i(ge,A,de),ve===null?le=ge:ve.sibling=ge,ve=ge);return e&&te.forEach(function(ka){return t(R,ka)}),pe&&It(R,de),le}function re(R,A,_,Y){if(_==null)throw Error(c(151));for(var le=null,ve=null,te=A,de=A=0,ge=null,be=_.next();te!==null&&!be.done;de++,be=_.next()){te.index>de?(ge=te,te=null):ge=te.sibling;var ka=L(R,te,be.value,Y);if(ka===null){te===null&&(te=ge);break}e&&te&&ka.alternate===null&&t(R,te),A=i(ka,A,de),ve===null?le=ka:ve.sibling=ka,ve=ka,te=ge}if(be.done)return a(R,te),pe&&It(R,de),le;if(te===null){for(;!be.done;de++,be=_.next())be=G(R,be.value,Y),be!==null&&(A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return pe&&It(R,de),le}for(te=l(te);!be.done;de++,be=_.next())be=B(te,R,de,be.value,Y),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return e&&te.forEach(function(lg){return t(R,lg)}),pe&&It(R,de),le}function Me(R,A,_,Y){if(typeof _=="object"&&_!==null&&_.type===O&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case M:e:{for(var le=_.key;A!==null;){if(A.key===le){if(le=_.type,le===O){if(A.tag===7){a(R,A.sibling),Y=s(A,_.props.children),Y.return=R,R=Y;break e}}else if(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type){a(R,A.sibling),Y=s(A,_.props),yn(Y,_),Y.return=R,R=Y;break e}a(R,A);break}else t(R,A);A=A.sibling}_.type===O?(Y=Ka(_.props.children,R.mode,Y,_.key),Y.return=R,R=Y):(Y=Ss(_.type,_.key,_.props,null,R.mode,Y),yn(Y,_),Y.return=R,R=Y)}return d(R);case z:e:{for(le=_.key;A!==null;){if(A.key===le)if(A.tag===4&&A.stateNode.containerInfo===_.containerInfo&&A.stateNode.implementation===_.implementation){a(R,A.sibling),Y=s(A,_.children||[]),Y.return=R,R=Y;break e}else{a(R,A);break}else t(R,A);A=A.sibling}Y=xi(_,R.mode,Y),Y.return=R,R=Y}return d(R);case K:return _=Ia(_),Me(R,A,_,Y)}if(je(_))return F(R,A,_,Y);if(Ee(_)){if(le=Ee(_),typeof le!="function")throw Error(c(150));return _=le.call(_),re(R,A,_,Y)}if(typeof _.then=="function")return Me(R,A,Ms(_),Y);if(_.$$typeof===U)return Me(R,A,Ts(R,_),Y);zs(R,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,A!==null&&A.tag===6?(a(R,A.sibling),Y=s(A,_),Y.return=R,R=Y):(a(R,A),Y=fi(_,R.mode,Y),Y.return=R,R=Y),d(R)):a(R,A)}return function(R,A,_,Y){try{pn=0;var le=Me(R,A,_,Y);return Al=null,le}catch(te){if(te===wl||te===As)throw te;var ve=vt(29,te,null,R.mode);return ve.lanes=Y,ve.return=R,ve}}}var tl=ko(!0),qo=ko(!1),Na=!1;function Ci(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ti(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 Ea(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Se&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=Ns(e),So(e,null,a),t}return js(e,l,t,a),Ns(e)}function vn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Mu(e,a)}}function wi(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=d:i=i.next=d,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ai=!1;function bn(){if(Ai){var e=Tl;if(e!==null)throw e}}function jn(e,t,a,l){Ai=!1;var s=e.updateQueue;Na=!1;var i=s.firstBaseUpdate,d=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var E=g,D=E.next;E.next=null,d===null?i=D:d.next=D,d=E;var q=e.alternate;q!==null&&(q=q.updateQueue,g=q.lastBaseUpdate,g!==d&&(g===null?q.firstBaseUpdate=D:g.next=D,q.lastBaseUpdate=E))}if(i!==null){var G=s.baseState;d=0,q=D=E=null,g=i;do{var L=g.lane&-536870913,B=L!==g.lane;if(B?(he&L)===L:(l&L)===L){L!==0&&L===Cl&&(Ai=!0),q!==null&&(q=q.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var F=e,re=g;L=t;var Me=a;switch(re.tag){case 1:if(F=re.payload,typeof F=="function"){G=F.call(Me,G,L);break e}G=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=re.payload,L=typeof F=="function"?F.call(Me,G,L):F,L==null)break e;G=y({},G,L);break e;case 2:Na=!0}}L=g.callback,L!==null&&(e.flags|=64,B&&(e.flags|=8192),B=s.callbacks,B===null?s.callbacks=[L]:B.push(L))}else B={lane:L,tag:g.tag,payload:g.payload,callback:g.callback,next:null},q===null?(D=q=B,E=G):q=q.next=B,d|=L;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);q===null&&(E=G),s.baseState=E,s.firstBaseUpdate=D,s.lastBaseUpdate=q,i===null&&(s.shared.lanes=0),Ra|=d,e.lanes=d,e.memoizedState=G}}function $o(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Yo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)$o(a[e],t)}var Rl=S(null),_s=S(0);function Go(e,t){e=oa,Q(_s,e),Q(Rl,t),oa=e|t.baseLanes}function Ri(){Q(_s,oa),Q(Rl,Rl.current)}function Mi(){oa=_s.current,$(Rl),$(_s)}var bt=S(null),_t=null;function Ca(e){var t=e.alternate;Q(Ye,Ye.current&1),Q(bt,e),_t===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(_t=e)}function zi(e){Q(Ye,Ye.current),Q(bt,e),_t===null&&(_t=e)}function Vo(e){e.tag===22?(Q(Ye,Ye.current),Q(bt,e),_t===null&&(_t=e)):Ta()}function Ta(){Q(Ye,Ye.current),Q(bt,bt.current)}function jt(e){$(bt),_t===e&&(_t=null),$(Ye)}var Ye=S(0);function Ds(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Hc(a)||Bc(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,oe=null,Ae=null,Xe=null,Os=!1,Ml=!1,al=!1,Us=0,Nn=0,zl=null,Zm=0;function ke(){throw Error(c(321))}function _i(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 Di(e,t,a,l,s,i){return aa=i,oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?wd:Ki,al=!1,i=a(l,s),al=!1,Ml&&(i=Qo(t,a,l,s)),Xo(e),i}function Xo(e){k.H=Cn;var t=Ae!==null&&Ae.next!==null;if(aa=0,Xe=Ae=oe=null,Os=!1,Nn=0,zl=null,t)throw Error(c(300));e===null||Qe||(e=e.dependencies,e!==null&&Cs(e)&&(Qe=!0))}function Qo(e,t,a,l){oe=e;var s=0;do{if(Ml&&(zl=null),Nn=0,Ml=!1,25<=s)throw Error(c(301));if(s+=1,Xe=Ae=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}k.H=Ad,i=t(a,l)}while(Ml);return i}function Km(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Sn(t):t,e=e.useState()[0],(Ae!==null?Ae.memoizedState:null)!==e&&(oe.flags|=1024),t}function Oi(){var e=Us!==0;return Us=0,e}function Ui(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Li(e){if(Os){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Os=!1}aa=0,Xe=Ae=oe=null,Ml=!1,Nn=Us=0,zl=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ge(){if(Ae===null){var e=oe.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Xe===null?oe.memoizedState:Xe.next;if(t!==null)Xe=t,Ae=e;else{if(e===null)throw oe.alternate===null?Error(c(467)):Error(c(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sn(e){var t=Nn;return Nn+=1,zl===null&&(zl=[]),e=Lo(zl,e,t),t=oe,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?wd:Ki),e}function Hs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sn(e);if(e.$$typeof===U)return at(e)}throw Error(c(438,String(e)))}function Hi(e){var t=null,a=oe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=oe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ls(),oe.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=W;return t.index++,a}function la(e,t){return typeof t=="function"?t(e):t}function Bs(e){var t=Ge();return Bi(t,Ae,e)}function Bi(e,t,a){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=a;var s=e.baseQueue,i=l.pending;if(i!==null){if(s!==null){var d=s.next;s.next=i.next,i.next=d}t.baseQueue=s=i,l.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var g=d=null,E=null,D=t,q=!1;do{var G=D.lane&-536870913;if(G!==D.lane?(he&G)===G:(aa&G)===G){var L=D.revertLane;if(L===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),G===Cl&&(q=!0);else if((aa&L)===L){D=D.next,L===Cl&&(q=!0);continue}else G={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(g=E=G,d=i):E=E.next=G,oe.lanes|=L,Ra|=L;G=D.action,al&&a(i,G),i=D.hasEagerState?D.eagerState:a(i,G)}else L={lane:G,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(g=E=L,d=i):E=E.next=L,oe.lanes|=G,Ra|=G;D=D.next}while(D!==null&&D!==t);if(E===null?d=i:E.next=g,!yt(i,e.memoizedState)&&(Qe=!0,q&&(a=Tl,a!==null)))throw a;e.memoizedState=i,e.baseState=d,e.baseQueue=E,l.lastRenderedState=i}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function ki(e){var t=Ge(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var l=a.dispatch,s=a.pending,i=t.memoizedState;if(s!==null){a.pending=null;var d=s=s.next;do i=e(i,d.action),d=d.next;while(d!==s);yt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,l]}function Zo(e,t,a){var l=oe,s=Ge(),i=pe;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var d=!yt((Ae||s).memoizedState,a);if(d&&(s.memoizedState=a,Qe=!0),s=s.queue,Yi(Wo.bind(null,l,s,e),[e]),s.getSnapshot!==t||d||Xe!==null&&Xe.memoizedState.tag&1){if(l.flags|=2048,_l(9,{destroy:void 0},Jo.bind(null,l,s,a,t),null),ze===null)throw Error(c(349));i||(aa&127)!==0||Ko(l,t,a)}return a}function Ko(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=oe.updateQueue,t===null?(t=Ls(),oe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Jo(e,t,a,l){t.value=a,t.getSnapshot=l,Fo(t)&&Po(e)}function Wo(e,t,a){return a(function(){Fo(t)&&Po(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!yt(e,a)}catch{return!0}}function Po(e){var t=Za(e,2);t!==null&&mt(t,e,2)}function qi(e){var t=it();if(typeof e=="function"){var a=e;if(e=a(),al){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 Io(e,t,a,l){return e.baseState=a,Bi(e,Ae,typeof l=="function"?l:la)}function Jm(e,t,a,l,s){if($s(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(d){i.listeners.push(d)}};k.T!==null?a(!0):i.isTransition=!1,l(i),a=t.pending,a===null?(i.next=t.pending=i,ed(t,i)):(i.next=a.next,t.pending=a.next=i)}}function ed(e,t){var a=t.action,l=t.payload,s=e.state;if(t.isTransition){var i=k.T,d={};k.T=d;try{var g=a(s,l),E=k.S;E!==null&&E(d,g),td(e,t,g)}catch(D){$i(e,t,D)}finally{i!==null&&d.types!==null&&(i.types=d.types),k.T=i}}else try{i=a(s,l),td(e,t,i)}catch(D){$i(e,t,D)}}function td(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){ad(e,t,l)},function(l){return $i(e,t,l)}):ad(e,t,a)}function ad(e,t,a){t.status="fulfilled",t.value=a,ld(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,ed(e,a)))}function $i(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,ld(t),t=t.next;while(t!==l)}e.action=null}function ld(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nd(e,t){return t}function sd(e,t){if(pe){var a=ze.formState;if(a!==null){e:{var l=oe;if(pe){if(De){t:{for(var s=De,i=zt;s.nodeType!==8;){if(!i){s=null;break t}if(s=Dt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){De=Dt(s.nextSibling),l=s.data==="F!";break e}}ba(l)}l=!1}l&&(t=a[0])}}return a=it(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nd,lastRenderedState:t},a.queue=l,a=Ed.bind(null,oe,l),l.dispatch=a,l=qi(!1),i=Zi.bind(null,oe,!1,l.queue),l=it(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,a=Jm.bind(null,oe,s,i,a),s.dispatch=a,l.memoizedState=e,[t,a,!1]}function rd(e){var t=Ge();return id(t,Ae,e)}function id(e,t,a){if(t=Bi(e,t,nd)[0],e=Bs(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Sn(t)}catch(d){throw d===wl?As:d}else l=t;t=Ge();var s=t.queue,i=s.dispatch;return a!==t.memoizedState&&(oe.flags|=2048,_l(9,{destroy:void 0},Wm.bind(null,s,a),null)),[l,i,e]}function Wm(e,t){e.action=t}function cd(e){var t=Ge(),a=Ae;if(a!==null)return id(t,a,e);Ge(),t=t.memoizedState,a=Ge();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function _l(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=oe.updateQueue,t===null&&(t=Ls(),oe.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function ud(){return Ge().memoizedState}function ks(e,t,a,l){var s=it();oe.flags|=e,s.memoizedState=_l(1|t,{destroy:void 0},a,l===void 0?null:l)}function qs(e,t,a,l){var s=Ge();l=l===void 0?null:l;var i=s.memoizedState.inst;Ae!==null&&l!==null&&_i(l,Ae.memoizedState.deps)?s.memoizedState=_l(t,i,a,l):(oe.flags|=e,s.memoizedState=_l(1|t,i,a,l))}function od(e,t){ks(8390656,8,e,t)}function Yi(e,t){qs(2048,8,e,t)}function Fm(e){oe.flags|=4;var t=oe.updateQueue;if(t===null)t=Ls(),oe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function dd(e){var t=Ge().memoizedState;return Fm({ref:t,nextImpl:e}),function(){if((Se&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function fd(e,t){return qs(4,2,e,t)}function xd(e,t){return qs(4,4,e,t)}function md(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 hd(e,t,a){a=a!=null?a.concat([e]):null,qs(4,4,md.bind(null,t,e),a)}function Gi(){}function gd(e,t){var a=Ge();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&_i(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function pd(e,t){var a=Ge();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&_i(t,l[1]))return l[0];if(l=e(),al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[l,t],l}function Vi(e,t,a){return a===void 0||(aa&1073741824)!==0&&(he&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=vf(),oe.lanes|=e,Ra|=e,a)}function yd(e,t,a,l){return yt(a,t)?a:Rl.current!==null?(e=Vi(e,a,l),yt(e,t)||(Qe=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(he&261930)===0?(Qe=!0,e.memoizedState=a):(e=vf(),oe.lanes|=e,Ra|=e,t)}function vd(e,t,a,l,s){var i=X.p;X.p=i!==0&&8>i?i:8;var d=k.T,g={};k.T=g,Zi(e,!1,t,a);try{var E=s(),D=k.S;if(D!==null&&D(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var q=Qm(E,l);En(e,t,q,Et(e))}else En(e,t,l,Et(e))}catch(G){En(e,t,{then:function(){},status:"rejected",reason:G},Et())}finally{X.p=i,d!==null&&g.types!==null&&(d.types=g.types),k.T=d}}function Pm(){}function Xi(e,t,a,l){if(e.tag!==5)throw Error(c(476));var s=bd(e).queue;vd(e,s,t,se,a===null?Pm:function(){return jd(e),a(l)})}function bd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:se},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 jd(e){var t=bd(e);t.next===null&&(t=e.alternate.memoizedState),En(e,t.next.queue,{},Et())}function Qi(){return at($n)}function Nd(){return Ge().memoizedState}function Sd(){return Ge().memoizedState}function Im(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Et();e=Sa(a);var l=Ea(t,e,a);l!==null&&(mt(l,t,a),vn(l,t,a)),t={cache:ji()},e.payload=t;return}t=t.return}}function eh(e,t,a){var l=Et();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$s(e)?Cd(t,a):(a=oi(e,t,a,l),a!==null&&(mt(a,e,l),Td(a,t,l)))}function Ed(e,t,a){var l=Et();En(e,t,a,l)}function En(e,t,a,l){var s={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($s(e))Cd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,g=i(d,a);if(s.hasEagerState=!0,s.eagerState=g,yt(g,d))return js(e,t,s,0),ze===null&&bs(),!1}catch{}if(a=oi(e,t,s,l),a!==null)return mt(a,e,l),Td(a,t,l),!0}return!1}function Zi(e,t,a,l){if(l={lane:2,revertLane:Cc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$s(e)){if(t)throw Error(c(479))}else t=oi(e,a,l,2),t!==null&&mt(t,e,2)}function $s(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function Cd(e,t){Ml=Os=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Td(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Mu(e,a)}}var Cn={readContext:at,use:Hs,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useLayoutEffect:ke,useInsertionEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useSyncExternalStore:ke,useId:ke,useHostTransitionStatus:ke,useFormState:ke,useActionState:ke,useOptimistic:ke,useMemoCache:ke,useCacheRefresh:ke};Cn.useEffectEvent=ke;var wd={readContext:at,use:Hs,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:od,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ks(4194308,4,md.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var a=it();t=t===void 0?null:t;var l=e();if(al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=it();if(a!==void 0){var s=a(t);if(al){ha(!0);try{a(t)}finally{ha(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=eh.bind(null,oe,e),[l.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=qi(e);var t=e.queue,a=Ed.bind(null,oe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Gi,useDeferredValue:function(e,t){var a=it();return Vi(a,e,t)},useTransition:function(){var e=qi(!1);return e=vd.bind(null,oe,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=oe,s=it();if(pe){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),ze===null)throw Error(c(349));(he&127)!==0||Ko(l,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,od(Wo.bind(null,l,i,e),[e]),l.flags|=2048,_l(9,{destroy:void 0},Jo.bind(null,l,i,a,t),null),a},useId:function(){var e=it(),t=ze.identifierPrefix;if(pe){var a=Gt,l=Yt;a=(l&~(1<<32-pt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Zm++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Qi,useFormState:sd,useActionState:sd,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=Zi.bind(null,oe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Hi,useCacheRefresh:function(){return it().memoizedState=Im.bind(null,oe)},useEffectEvent:function(e){var t=it(),a={impl:e};return t.memoizedState=a,function(){if((Se&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Ki={readContext:at,use:Hs,useCallback:gd,useContext:at,useEffect:Yi,useImperativeHandle:hd,useInsertionEffect:fd,useLayoutEffect:xd,useMemo:pd,useReducer:Bs,useRef:ud,useState:function(){return Bs(la)},useDebugValue:Gi,useDeferredValue:function(e,t){var a=Ge();return yd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=Bs(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Zo,useId:Nd,useHostTransitionStatus:Qi,useFormState:rd,useActionState:rd,useOptimistic:function(e,t){var a=Ge();return Io(a,Ae,e,t)},useMemoCache:Hi,useCacheRefresh:Sd};Ki.useEffectEvent=dd;var Ad={readContext:at,use:Hs,useCallback:gd,useContext:at,useEffect:Yi,useImperativeHandle:hd,useInsertionEffect:fd,useLayoutEffect:xd,useMemo:pd,useReducer:ki,useRef:ud,useState:function(){return ki(la)},useDebugValue:Gi,useDeferredValue:function(e,t){var a=Ge();return Ae===null?Vi(a,e,t):yd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=ki(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Zo,useId:Nd,useHostTransitionStatus:Qi,useFormState:cd,useActionState:cd,useOptimistic:function(e,t){var a=Ge();return Ae!==null?Io(a,Ae,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Hi,useCacheRefresh:Sd};Ad.useEffectEvent=dd;function Ji(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Wi={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Et(),s=Sa(l);s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,l),t!==null&&(mt(t,e,l),vn(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Et(),s=Sa(l);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,l),t!==null&&(mt(t,e,l),vn(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Et(),l=Sa(a);l.tag=2,t!=null&&(l.callback=t),t=Ea(e,l,a),t!==null&&(mt(t,e,a),vn(t,e,a))}};function Rd(e,t,a,l,s,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!dn(a,l)||!dn(s,i):!0}function Md(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Wi.enqueueReplaceState(t,t.state,null)}function ll(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}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 zd(e){vs(e)}function _d(e){console.error(e)}function Dd(e){vs(e)}function Ys(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Od(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Fi(e,t,a){return a=Sa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ys(e,t)},a}function Ud(e){return e=Sa(e),e.tag=3,e}function Ld(e,t,a,l){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var i=l.value;e.payload=function(){return s(i)},e.callback=function(){Od(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Od(t,a,l),typeof s!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function th(e,t,a,l,s){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.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?er():a.alternate===null&&qe===0&&(qe=3),a.flags&=-257,a.flags|=65536,a.lanes=s,l===Rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),Nc(e,l,s)),!1;case 22:return a.flags|=65536,l===Rs?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),Nc(e,l,s)),!1}throw Error(c(435,a.tag))}return Nc(e,l,s),er(),!1}if(pe)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==gi&&(e=Error(c(422),{cause:l}),mn(At(e,a)))):(l!==gi&&(t=Error(c(423),{cause:l}),mn(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=At(l,a),s=Fi(e.stateNode,l,s),wi(e,s),qe!==4&&(qe=2)),!1;var i=Error(c(520),{cause:l});if(i=At(i,a),Dn===null?Dn=[i]:Dn.push(i),qe!==4&&(qe=2),t===null)return!0;l=At(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Fi(a.stateNode,l,e),wi(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=Ud(s),Ld(s,e,a,l),wi(a,s),!1}a=a.return}while(a!==null);return!1}var Pi=Error(c(461)),Qe=!1;function lt(e,t,a,l){t.child=e===null?qo(t,null,a,l):tl(t,e.child,a,l)}function Hd(e,t,a,l,s){a=a.render;var i=t.ref;if("ref"in l){var d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}else d=l;return Fa(t),l=Di(e,t,a,d,i,s),g=Oi(),e!==null&&!Qe?(Ui(e,t,s),na(e,t,s)):(pe&&g&&mi(t),t.flags|=1,lt(e,t,l,s),t.child)}function Bd(e,t,a,l,s){if(e===null){var i=a.type;return typeof i=="function"&&!di(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,kd(e,t,i,l,s)):(e=Ss(a.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!rc(e,s)){var d=i.memoizedProps;if(a=a.compare,a=a!==null?a:dn,a(d,l)&&e.ref===t.ref)return na(e,t,s)}return t.flags|=1,e=Pt(i,l),e.ref=t.ref,e.return=t,t.child=e}function kd(e,t,a,l,s){if(e!==null){var i=e.memoizedProps;if(dn(i,l)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=l=i,rc(e,s))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,na(e,t,s)}return Ii(e,t,a,l,s)}function qd(e,t,a,l){var s=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~i}else l=0,t.child=null;return $d(e,t,i,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ws(t,i!==null?i.cachePool:null),i!==null?Go(t,i):Ri(),Vo(t);else return l=t.lanes=536870912,$d(e,t,i!==null?i.baseLanes|a:a,a,l)}else i!==null?(ws(t,i.cachePool),Go(t,i),Ta(),t.memoizedState=null):(e!==null&&ws(t,null),Ri(),Ta());return lt(e,t,s,a),t.child}function Tn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $d(e,t,a,l,s){var i=Si();return i=i===null?null:{parent:Ve._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&ws(t,null),Ri(),Vo(t),e!==null&&El(e,t,l,!0),t.childLanes=s,null}function Gs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yd(e,t,a){return tl(t,e.child,null,a),e=Gs(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function ah(e,t,a){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(pe){if(l.mode==="hidden")return e=Gs(t,l),t.lanes=536870912,Tn(null,e);if(zi(t),(e=De)?(e=t0(e,zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},a=Co(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Gs(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(zi(t),s)if(t.flags&256)t.flags&=-257,t=Yd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Qe||El(e,t,a,!1),s=(a&e.childLanes)!==0,Qe||s){if(l=ze,l!==null&&(d=zu(l,a),d!==0&&d!==i.retryLane))throw i.retryLane=d,Za(e,d),mt(l,e,d),Pi;er(),t=Yd(e,t,a)}else e=i.treeContext,De=Dt(d.nextSibling),tt=t,pe=!0,va=null,zt=!1,e!==null&&Ao(t,e),t=Gs(t,l),t.flags|=4096;return t}return e=Pt(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(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 Ii(e,t,a,l,s){return Fa(t),a=Di(e,t,a,l,void 0,s),l=Oi(),e!==null&&!Qe?(Ui(e,t,s),na(e,t,s)):(pe&&l&&mi(t),t.flags|=1,lt(e,t,a,s),t.child)}function Gd(e,t,a,l,s,i){return Fa(t),t.updateQueue=null,a=Qo(t,l,a,s),Xo(e),l=Oi(),e!==null&&!Qe?(Ui(e,t,i),na(e,t,i)):(pe&&l&&mi(t),t.flags|=1,lt(e,t,a,i),t.child)}function Vd(e,t,a,l,s){if(Fa(t),t.stateNode===null){var i=bl,d=a.contextType;typeof d=="object"&&d!==null&&(i=at(d)),i=new a(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Wi,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},Ci(t),d=a.contextType,i.context=typeof d=="object"&&d!==null?at(d):bl,i.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Ji(t,a,d,l),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Wi.enqueueReplaceState(i,i.state,null),jn(t,l,i,s),bn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var g=t.memoizedProps,E=ll(a,g);i.props=E;var D=i.context,q=a.contextType;d=bl,typeof q=="object"&&q!==null&&(d=at(q));var G=a.getDerivedStateFromProps;q=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,q||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(g||D!==d)&&Md(t,i,l,d),Na=!1;var L=t.memoizedState;i.state=L,jn(t,l,i,s),bn(),D=t.memoizedState,g||L!==D||Na?(typeof G=="function"&&(Ji(t,a,G,l),D=t.memoizedState),(E=Na||Rd(t,a,E,l,L,D,d))?(q||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=l,t.memoizedState=D),i.props=l,i.state=D,i.context=d,l=E):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,Ti(e,t),d=t.memoizedProps,q=ll(a,d),i.props=q,G=t.pendingProps,L=i.context,D=a.contextType,E=bl,typeof D=="object"&&D!==null&&(E=at(D)),g=a.getDerivedStateFromProps,(D=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==G||L!==E)&&Md(t,i,l,E),Na=!1,L=t.memoizedState,i.state=L,jn(t,l,i,s),bn();var B=t.memoizedState;d!==G||L!==B||Na||e!==null&&e.dependencies!==null&&Cs(e.dependencies)?(typeof g=="function"&&(Ji(t,a,g,l),B=t.memoizedState),(q=Na||Rd(t,a,q,l,L,B,E)||e!==null&&e.dependencies!==null&&Cs(e.dependencies))?(D||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,B,E),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,B,E)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=B),i.props=l,i.state=B,i.context=E,l=q):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,Vs(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=tl(t,e.child,null,s),t.child=tl(t,null,a,s)):lt(e,t,a,s),t.memoizedState=i.state,e=t.child):e=na(e,t,s),e}function Xd(e,t,a,l){return Ja(),t.flags|=256,lt(e,t,a,l),t.child}var ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tc(e){return{baseLanes:e,cachePool:Oo()}}function ac(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=St),e}function Qd(e,t,a){var l=t.pendingProps,s=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(pe){if(s?Ca(t):Ta(),(e=De)?(e=t0(e,zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Yt,overflow:Gt}:null,retryLane:536870912,hydrationErrors:null},a=Co(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return Bc(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,s?(Ta(),s=t.mode,g=Xs({mode:"hidden",children:g},s),l=Ka(l,s,a,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=tc(a),l.childLanes=ac(e,d,a),t.memoizedState=ec,Tn(null,l)):(Ca(t),lc(t,g))}var E=e.memoizedState;if(E!==null&&(g=E.dehydrated,g!==null)){if(i)t.flags&256?(Ca(t),t.flags&=-257,t=nc(e,t,a)):t.memoizedState!==null?(Ta(),t.child=e.child,t.flags|=128,t=null):(Ta(),g=l.fallback,s=t.mode,l=Xs({mode:"visible",children:l.children},s),g=Ka(g,s,a,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,tl(t,e.child,null,a),l=t.child,l.memoizedState=tc(a),l.childLanes=ac(e,d,a),t.memoizedState=ec,t=Tn(null,l));else if(Ca(t),Bc(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var D=d.dgst;d=D,l=Error(c(419)),l.stack="",l.digest=d,mn({value:l,source:null,stack:null}),t=nc(e,t,a)}else if(Qe||El(e,t,a,!1),d=(a&e.childLanes)!==0,Qe||d){if(d=ze,d!==null&&(l=zu(d,a),l!==0&&l!==E.retryLane))throw E.retryLane=l,Za(e,l),mt(d,e,l),Pi;Hc(g)||er(),t=nc(e,t,a)}else Hc(g)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,De=Dt(g.nextSibling),tt=t,pe=!0,va=null,zt=!1,e!==null&&Ao(t,e),t=lc(t,l.children),t.flags|=4096);return t}return s?(Ta(),g=l.fallback,s=t.mode,E=e.child,D=E.sibling,l=Pt(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,D!==null?g=Pt(D,g):(g=Ka(g,s,a,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,Tn(null,l),l=t.child,g=e.child.memoizedState,g===null?g=tc(a):(s=g.cachePool,s!==null?(E=Ve._currentValue,s=s.parent!==E?{parent:E,pool:E}:s):s=Oo(),g={baseLanes:g.baseLanes|a,cachePool:s}),l.memoizedState=g,l.childLanes=ac(e,d,a),t.memoizedState=ec,Tn(e.child,l)):(Ca(t),a=e.child,e=a.sibling,a=Pt(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function lc(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function nc(e,t,a){return tl(t,e.child,null,a),e=lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zd(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),vi(e.return,t,a)}function sc(e,t,a,l,s,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:s,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=s,d.treeForkCount=i)}function Kd(e,t,a){var l=t.pendingProps,s=l.revealOrder,i=l.tail;l=l.children;var d=Ye.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,Q(Ye,d),lt(e,t,l,a),l=pe?xn:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zd(e,a,t);else if(e.tag===19)Zd(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&&Ds(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),sc(t,!1,s,a,i,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ds(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}sc(t,!0,a,null,i,l);break;case"together":sc(t,!1,null,null,void 0,l);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 rc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Cs(e)))}function lh(e,t,a){switch(t.tag){case 3:Ke(t,t.stateNode.containerInfo),ja(t,Ve,e.memoizedState.cache),Ja();break;case 27:case 5:Fl(t);break;case 4:Ke(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,zi(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ca(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Qd(e,t,a):(Ca(t),e=na(e,t,a),e!==null?e.sibling:null);Ca(t);break;case 19:var s=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(El(e,t,a,!1),l=(a&t.childLanes)!==0),s){if(l)return Kd(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Q(Ye,Ye.current),l)break;return null;case 22:return t.lanes=0,qd(e,t,a,t.pendingProps);case 24:ja(t,Ve,e.memoizedState.cache)}return na(e,t,a)}function Jd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!rc(e,a)&&(t.flags&128)===0)return Qe=!1,lh(e,t,a);Qe=(e.flags&131072)!==0}else Qe=!1,pe&&(t.flags&1048576)!==0&&wo(t,xn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e=="function")di(e)?(l=ll(e,l),t.tag=1,t=Vd(null,t,e,l,a)):(t.tag=0,t=Ii(null,t,e,l,a));else{if(e!=null){var s=e.$$typeof;if(s===J){t.tag=11,t=Hd(null,t,e,l,a);break e}else if(s===Z){t.tag=14,t=Bd(null,t,e,l,a);break e}}throw t=_e(e)||e,Error(c(306,t,""))}}return t;case 0:return Ii(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,s=ll(l,t.pendingProps),Vd(e,t,l,s,a);case 3:e:{if(Ke(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var i=t.memoizedState;s=i.element,Ti(e,t),jn(t,l,null,a);var d=t.memoizedState;if(l=d.cache,ja(t,Ve,l),l!==i.cache&&bi(t,[Ve],a,!0),bn(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Xd(e,t,l,a);break e}else if(l!==s){s=At(Error(c(424)),t),mn(s),t=Xd(e,t,l,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,De=Dt(e.firstChild),tt=t,pe=!0,va=null,zt=!0,a=qo(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ja(),l===s){t=na(e,t,a);break e}lt(e,t,l,a)}t=t.child}return t;case 26:return Vs(e,t),e===null?(a=i0(t.type,null,t.pendingProps,null))?t.memoizedState=a:pe||(a=t.type,e=t.pendingProps,l=ir(fe.current).createElement(a),l[et]=t,l[ct]=e,nt(l,a,e),Fe(l),t.stateNode=l):t.memoizedState=i0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fl(t),e===null&&pe&&(l=t.stateNode=n0(t.type,t.pendingProps,fe.current),tt=t,zt=!0,s=De,Oa(t.type)?(kc=s,De=Dt(l.firstChild)):De=s),lt(e,t,t.pendingProps.children,a),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pe&&((s=l=De)&&(l=Dh(l,t.type,t.pendingProps,zt),l!==null?(t.stateNode=l,tt=t,De=Dt(l.firstChild),zt=!1,s=!0):s=!1),s||ba(t)),Fl(t),s=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,Oc(s,i)?l=null:d!==null&&Oc(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Di(e,t,Km,null,null,a),$n._currentValue=s),Vs(e,t),lt(e,t,l,a),t.child;case 6:return e===null&&pe&&((e=a=De)&&(a=Oh(a,t.pendingProps,zt),a!==null?(t.stateNode=a,tt=t,De=null,e=!0):e=!1),e||ba(t)),null;case 13:return Qd(e,t,a);case 4:return Ke(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=tl(t,null,l,a):lt(e,t,l,a),t.child;case 11:return Hd(e,t,t.type,t.pendingProps,a);case 7:return lt(e,t,t.pendingProps,a),t.child;case 8:return lt(e,t,t.pendingProps.children,a),t.child;case 12:return lt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,ja(t,t.type,l.value),lt(e,t,l.children,a),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,Fa(t),s=at(s),l=l(s),t.flags|=1,lt(e,t,l,a),t.child;case 14:return Bd(e,t,t.type,t.pendingProps,a);case 15:return kd(e,t,t.type,t.pendingProps,a);case 19:return Kd(e,t,a);case 31:return ah(e,t,a);case 22:return qd(e,t,a,t.pendingProps);case 24:return Fa(t),l=at(Ve),e===null?(s=Si(),s===null&&(s=ze,i=ji(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=a),s=i),t.memoizedState={parent:l,cache:s},Ci(t),ja(t,Ve,s)):((e.lanes&a)!==0&&(Ti(e,t),jn(t,null,null,a),bn()),s=e.memoizedState,i=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ja(t,Ve,l)):(l=i.cache,ja(t,Ve,l),l!==s.cache&&bi(t,[Ve],a,!0))),lt(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 ic(e,t,a,l,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(Sf())e.flags|=8192;else throw el=Rs,Ei}else e.flags&=-16777217}function Wd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!f0(t))if(Sf())e.flags|=8192;else throw el=Rs,Ei}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Au():536870912,e.lanes|=t,Ll|=t)}function wn(e,t){if(!pe)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 l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function nh(e,t,a){var l=t.pendingProps;switch(hi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Oe(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ta(Ve),$e(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pi())),Oe(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(sa(t),i!==null?(Oe(t),Wd(t,i)):(Oe(t),ic(t,s,null,l,a))):i?i!==e.memoizedState?(sa(t),Oe(t),Wd(t,i)):(Oe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&sa(t),Oe(t),ic(t,s,e,l,a)),null;case 27:if(ls(t),a=fe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}e=P.current,Sl(t)?Ro(t):(e=n0(s,l,a),t.stateNode=e,sa(t))}return Oe(t),null;case 5:if(ls(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}if(i=P.current,Sl(t))Ro(t);else{var d=ir(fe.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(s,{is:l.is}):d.createElement(s)}}i[et]=t,i[ct]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(nt(i,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&sa(t)}}return Oe(t),ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&sa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=fe.current,Sl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,s=tt,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[et]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Zf(e.nodeValue,a)),e||ba(t,!0)}else e=ir(e).createTextNode(l),e[et]=t,t.stateNode=e}return Oe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Sl(t),a!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),e=!1}else a=pi(),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 Oe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Sl(t),l!==null&&l.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[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),s=!1}else s=pi(),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=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==s&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Qs(t,t.updateQueue),Oe(t),null);case 4:return $e(),e===null&&Rc(t.stateNode.containerInfo),Oe(t),null;case 10:return ta(t.type),Oe(t),null;case 19:if($(Ye),l=t.memoizedState,l===null)return Oe(t),null;if(s=(t.flags&128)!==0,i=l.rendering,i===null)if(s)wn(l,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ds(e),i!==null){for(t.flags|=128,wn(l,!1),e=i.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Eo(a,e),a=a.sibling;return Q(Ye,Ye.current&1|2),pe&&It(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ht()>Fs&&(t.flags|=128,s=!0,wn(l,!1),t.lanes=4194304)}else{if(!s)if(e=Ds(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),wn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!pe)return Oe(t),null}else 2*ht()-l.renderingStartTime>Fs&&a!==536870912&&(t.flags|=128,s=!0,wn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ht(),e.sibling=null,a=Ye.current,Q(Ye,s?a&1|2:a&1),pe&&It(t,l.treeForkCount),e):(Oe(t),null);case 22:case 23:return jt(t),Mi(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),a=t.updateQueue,a!==null&&Qs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&$(Pa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ta(Ve),Oe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function sh(e,t){switch(hi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(Ve),$e(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ls(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));Ja()}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));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Ye),null;case 4:return $e(),null;case 10:return ta(t.type),null;case 22:case 23:return jt(t),Mi(),e!==null&&$(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(Ve),null;case 25:return null;default:return null}}function Fd(e,t){switch(hi(t),t.tag){case 3:ta(Ve),$e();break;case 26:case 27:case 5:ls(t);break;case 4:$e();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:$(Ye);break;case 10:ta(t.type);break;case 22:case 23:jt(t),Mi(),e!==null&&$(Pa);break;case 24:ta(Ve)}}function An(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var s=l.next;a=s;do{if((a.tag&e)===e){l=void 0;var i=a.create,d=a.inst;l=i(),d.destroy=l}a=a.next}while(a!==s)}}catch(g){Te(t,t.return,g)}}function wa(e,t,a){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var i=s.next;l=i;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,s=t;var E=a,D=g;try{D()}catch(q){Te(s,E,q)}}}l=l.next}while(l!==i)}}catch(q){Te(t,t.return,q)}}function Pd(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Yo(t,a)}catch(l){Te(e,e.return,l)}}}function Id(e,t,a){a.props=ll(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Te(e,t,l)}}function Rn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(s){Te(e,t,s)}}function Vt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(s){Te(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){Te(e,t,s)}else a.current=null}function ef(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(s){Te(e,e.return,s)}}function cc(e,t,a){try{var l=e.stateNode;wh(l,e.type,a,t),l[ct]=t}catch(s){Te(e,e.return,s)}}function tf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&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 oc(e,t,a){var l=e.tag;if(l===5||l===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(l!==4&&(l===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(oc(e,t,a),e=e.sibling;e!==null;)oc(e,t,a),e=e.sibling}function Zs(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Zs(e,t,a),e=e.sibling;e!==null;)Zs(e,t,a),e=e.sibling}function af(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);nt(t,l,a),t[et]=e,t[ct]=a}catch(i){Te(e,e.return,i)}}var ra=!1,Ze=!1,dc=!1,lf=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function rh(e,t){if(e=e.containerInfo,_c=mr,e=ho(e),ni(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var s=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var d=0,g=-1,E=-1,D=0,q=0,G=e,L=null;t:for(;;){for(var B;G!==a||s!==0&&G.nodeType!==3||(g=d+s),G!==i||l!==0&&G.nodeType!==3||(E=d+l),G.nodeType===3&&(d+=G.nodeValue.length),(B=G.firstChild)!==null;)L=G,G=B;for(;;){if(G===e)break t;if(L===a&&++D===s&&(g=d),L===i&&++q===l&&(E=d),(B=G.nextSibling)!==null)break;G=L,L=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(Dc={focusedElem:e,selectionRange:a},mr=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,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,l=a.stateNode;try{var F=ll(a.type,s);e=l.getSnapshotBeforeUpdate(F,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(re){Te(a,a.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Lc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lc(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,Pe=e;break}Pe=t.return}}function nf(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a),l&4&&An(5,a);break;case 1:if(ca(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Te(a,a.return,d)}else{var s=ll(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Te(a,a.return,d)}}l&64&&Pd(a),l&512&&Rn(a,a.return);break;case 3:if(ca(e,a),l&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{Yo(e,t)}catch(d){Te(a,a.return,d)}}break;case 27:t===null&&l&4&&af(a);case 26:case 5:ca(e,a),t===null&&l&4&&ef(a),l&512&&Rn(a,a.return);break;case 12:ca(e,a);break;case 31:ca(e,a),l&4&&cf(e,a);break;case 13:ca(e,a),l&4&&uf(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=hh.bind(null,a),Uh(e,a))));break;case 22:if(l=a.memoizedState!==null||ra,!l){t=t!==null&&t.memoizedState!==null||Ze,s=ra;var i=Ze;ra=l,(Ze=t)&&!i?ua(e,a,(a.subtreeFlags&8772)!==0):ca(e,a),ra=s,Ze=i}break;case 30:break;default:ca(e,a)}}function sf(e){var t=e.alternate;t!==null&&(e.alternate=null,sf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$r(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 Le=null,ot=!1;function ia(e,t,a){for(a=a.child;a!==null;)rf(e,t,a),a=a.sibling}function rf(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Pl,a)}catch{}switch(a.tag){case 26:Ze||Vt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ze||Vt(a,t);var l=Le,s=ot;Oa(a.type)&&(Le=a.stateNode,ot=!1),ia(e,t,a),Bn(a.stateNode),Le=l,ot=s;break;case 5:Ze||Vt(a,t);case 6:if(l=Le,s=ot,Le=null,ia(e,t,a),Le=l,ot=s,Le!==null)if(ot)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(a.stateNode)}catch(i){Te(a,t,i)}else try{Le.removeChild(a.stateNode)}catch(i){Te(a,t,i)}break;case 18:Le!==null&&(ot?(e=Le,If(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Vl(e)):If(Le,a.stateNode));break;case 4:l=Le,s=ot,Le=a.stateNode.containerInfo,ot=!0,ia(e,t,a),Le=l,ot=s;break;case 0:case 11:case 14:case 15:wa(2,a,t),Ze||wa(4,a,t),ia(e,t,a);break;case 1:Ze||(Vt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Id(a,t,l)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:Ze=(l=Ze)||a.memoizedState!==null,ia(e,t,a),Ze=l;break;default:ia(e,t,a)}}function cf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vl(e)}catch(a){Te(t,t.return,a)}}}function uf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(a){Te(t,t.return,a)}}function ih(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lf),t;default:throw Error(c(435,e.tag))}}function Ks(e,t){var a=ih(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var s=gh.bind(null,e,l);l.then(s,s)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var s=a[l],i=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(Oa(g.type)){Le=g.stateNode,ot=!1;break e}break;case 5:Le=g.stateNode,ot=!1;break e;case 3:case 4:Le=g.stateNode.containerInfo,ot=!0;break e}g=g.return}if(Le===null)throw Error(c(160));rf(i,d,s),Le=null,ot=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)of(t,e),t=t.sibling}var Bt=null;function of(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),ft(e),l&4&&(wa(3,e,e.return),An(3,e),wa(5,e,e.return));break;case 1:dt(t,e),ft(e),l&512&&(Ze||a===null||Vt(a,a.return)),l&64&&ra&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var s=Bt;if(dt(t,e),ft(e),l&512&&(Ze||a===null||Vt(a,a.return)),l&4){var i=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":i=s.getElementsByTagName("title")[0],(!i||i[tn]||i[et]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(l),s.head.insertBefore(i,s.querySelector("head > title"))),nt(i,l,a),i[et]=e,Fe(i),l=i;break e;case"link":var d=o0("link","href",s).get(l+(a.href||""));if(d){for(var g=0;g<d.length;g++)if(i=d[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)){d.splice(g,1);break t}}i=s.createElement(l),nt(i,l,a),s.head.appendChild(i);break;case"meta":if(d=o0("meta","content",s).get(l+(a.content||""))){for(g=0;g<d.length;g++)if(i=d[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)){d.splice(g,1);break t}}i=s.createElement(l),nt(i,l,a),s.head.appendChild(i);break;default:throw Error(c(468,l))}i[et]=e,Fe(i),l=i}e.stateNode=l}else d0(s,e.type,e.stateNode);else e.stateNode=u0(s,l,e.memoizedProps);else i!==l?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,l===null?d0(s,e.type,e.stateNode):u0(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&cc(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),ft(e),l&512&&(Ze||a===null||Vt(a,a.return)),a!==null&&l&4&&cc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),ft(e),l&512&&(Ze||a===null||Vt(a,a.return)),e.flags&32){s=e.stateNode;try{xl(s,"")}catch(F){Te(e,e.return,F)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,cc(e,s,a!==null?a.memoizedProps:s)),l&1024&&(dc=!0);break;case 6:if(dt(t,e),ft(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(F){Te(e,e.return,F)}}break;case 3:if(or=null,s=Bt,Bt=cr(t.containerInfo),dt(t,e),Bt=s,ft(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(F){Te(e,e.return,F)}dc&&(dc=!1,df(e));break;case 4:l=Bt,Bt=cr(e.stateNode.containerInfo),dt(t,e),ft(e),Bt=l;break;case 12:dt(t,e),ft(e);break;case 31:dt(t,e),ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));break;case 13:dt(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ws=ht()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));break;case 22:s=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,D=ra,q=Ze;if(ra=D||s,Ze=q||E,dt(t,e),Ze=q,ra=D,ft(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||E||ra||Ze||nl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(i=E.stateNode,s)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=E.stateNode;var G=E.memoizedProps.style,L=G!=null&&G.hasOwnProperty("display")?G.display:null;g.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(F){Te(E,E.return,F)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=s?"":E.memoizedProps}catch(F){Te(E,E.return,F)}}}else if(t.tag===18){if(a===null){E=t;try{var B=E.stateNode;s?e0(B,!0):e0(E.stateNode,!1)}catch(F){Te(E,E.return,F)}}}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}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Ks(e,a))));break;case 19:dt(t,e),ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ks(e,l)));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,l=e.return;l!==null;){if(tf(l)){a=l;break}l=l.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var s=a.stateNode,i=uc(e);Zs(e,i,s);break;case 5:var d=a.stateNode;a.flags&32&&(xl(d,""),a.flags&=-33);var g=uc(e);Zs(e,g,d);break;case 3:case 4:var E=a.stateNode.containerInfo,D=uc(e);oc(e,D,E);break;default:throw Error(c(161))}}catch(q){Te(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function df(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;df(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nf(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:wa(4,t,t.return),nl(t);break;case 1:Vt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Id(t,t.return,a),nl(t);break;case 27:Bn(t.stateNode);case 26:case 5:Vt(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(t)}e=e.sibling}}function ua(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:ua(s,i,a),An(4,i);break;case 1:if(ua(s,i,a),l=i,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(D){Te(l,l.return,D)}if(l=i,s=l.updateQueue,s!==null){var g=l.stateNode;try{var E=s.shared.hiddenCallbacks;if(E!==null)for(s.shared.hiddenCallbacks=null,s=0;s<E.length;s++)$o(E[s],g)}catch(D){Te(l,l.return,D)}}a&&d&64&&Pd(i),Rn(i,i.return);break;case 27:af(i);case 26:case 5:ua(s,i,a),a&&l===null&&d&4&&ef(i),Rn(i,i.return);break;case 12:ua(s,i,a);break;case 31:ua(s,i,a),a&&d&4&&cf(s,i);break;case 13:ua(s,i,a),a&&d&4&&uf(s,i);break;case 22:i.memoizedState===null&&ua(s,i,a),Rn(i,i.return);break;case 30:break;default:ua(s,i,a)}t=t.sibling}}function fc(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&&hn(a))}function xc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hn(e))}function kt(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ff(e,t,a,l),t=t.sibling}function ff(e,t,a,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:kt(e,t,a,l),s&2048&&An(9,t);break;case 1:kt(e,t,a,l);break;case 3:kt(e,t,a,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hn(e)));break;case 12:if(s&2048){kt(e,t,a,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,g=i.onPostCommit;typeof g=="function"&&g(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Te(t,t.return,E)}}else kt(e,t,a,l);break;case 31:kt(e,t,a,l);break;case 13:kt(e,t,a,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?kt(e,t,a,l):Mn(e,t):i._visibility&2?kt(e,t,a,l):(i._visibility|=2,Dl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&fc(d,t);break;case 24:kt(e,t,a,l),s&2048&&xc(t.alternate,t);break;default:kt(e,t,a,l)}}function Dl(e,t,a,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,g=a,E=l,D=d.flags;switch(d.tag){case 0:case 11:case 15:Dl(i,d,g,E,s),An(8,d);break;case 23:break;case 22:var q=d.stateNode;d.memoizedState!==null?q._visibility&2?Dl(i,d,g,E,s):Mn(i,d):(q._visibility|=2,Dl(i,d,g,E,s)),s&&D&2048&&fc(d.alternate,d);break;case 24:Dl(i,d,g,E,s),s&&D&2048&&xc(d.alternate,d);break;default:Dl(i,d,g,E,s)}t=t.sibling}}function Mn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,s=l.flags;switch(l.tag){case 22:Mn(a,l),s&2048&&fc(l.alternate,l);break;case 24:Mn(a,l),s&2048&&xc(l.alternate,l);break;default:Mn(a,l)}t=t.sibling}}var zn=8192;function Ol(e,t,a){if(e.subtreeFlags&zn)for(e=e.child;e!==null;)xf(e,t,a),e=e.sibling}function xf(e,t,a){switch(e.tag){case 26:Ol(e,t,a),e.flags&zn&&e.memoizedState!==null&&Zh(a,Bt,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,a);break;case 3:case 4:var l=Bt;Bt=cr(e.stateNode.containerInfo),Ol(e,t,a),Bt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=zn,zn=16777216,Ol(e,t,a),zn=l):Ol(e,t,a));break;default:Ol(e,t,a)}}function mf(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 _n(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Pe=l,gf(l,e)}mf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)hf(e),e=e.sibling}function hf(e){switch(e.tag){case 0:case 11:case 15:_n(e),e.flags&2048&&wa(9,e,e.return);break;case 3:_n(e);break;case 12:_n(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Js(e)):_n(e);break;default:_n(e)}}function Js(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Pe=l,gf(l,e)}mf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wa(8,t,t.return),Js(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Js(t));break;default:Js(t)}e=e.sibling}}function gf(e,t){for(;Pe!==null;){var a=Pe;switch(a.tag){case 0:case 11:case 15:wa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:hn(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Pe=l;else e:for(a=e;Pe!==null;){l=Pe;var s=l.sibling,i=l.return;if(sf(l),l===a){Pe=null;break e}if(s!==null){s.return=i,Pe=s;break e}Pe=i}}}var ch={getCacheForType:function(e){var t=at(Ve),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return at(Ve).controller.signal}},uh=typeof WeakMap=="function"?WeakMap:Map,Se=0,ze=null,xe=null,he=0,Ce=0,Nt=null,Aa=!1,Ul=!1,mc=!1,oa=0,qe=0,Ra=0,sl=0,hc=0,St=0,Ll=0,Dn=null,xt=null,gc=!1,Ws=0,pf=0,Fs=1/0,Ps=null,Ma=null,Je=0,za=null,Hl=null,da=0,pc=0,yc=null,yf=null,On=0,vc=null;function Et(){return(Se&2)!==0&&he!==0?he&-he:k.T!==null?Cc():_u()}function vf(){if(St===0)if((he&536870912)===0||pe){var e=rs;rs<<=1,(rs&3932160)===0&&(rs=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,a){(e===ze&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Bl(e,0),_a(e,he,St,!1)),en(e,a),((Se&2)===0||e!==ze)&&(e===ze&&((Se&2)===0&&(sl|=a),qe===4&&_a(e,he,St,!1)),Xt(e))}function bf(e,t,a){if((Se&6)!==0)throw Error(c(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Il(e,t),s=l?fh(e,t):jc(e,t,!0),i=l;do{if(s===0){Ul&&!l&&_a(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!oh(a)){s=jc(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;s=Dn;var E=g.current.memoizedState.isDehydrated;if(E&&(Bl(g,d).flags|=256),d=jc(g,d,!1),d!==2){if(mc&&!E){g.errorRecoveryDisabledLanes|=i,sl|=i,s=4;break e}i=xt,xt=s,i!==null&&(xt===null?xt=i:xt.push.apply(xt,i))}s=d}if(i=!1,s!==2)continue}}if(s===1){Bl(e,0),_a(e,t,0,!0);break}e:{switch(l=e,i=s,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:_a(l,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=Ws+300-ht(),10<s)){if(_a(l,t,St,!Aa),cs(l,0,!0)!==0)break e;da=t,l.timeoutHandle=Ff(jf.bind(null,l,a,xt,Ps,gc,t,St,sl,Ll,Aa,i,"Throttled",-0,0),s);break e}jf(l,a,xt,Ps,gc,t,St,sl,Ll,Aa,i,null,-0,0)}}break}while(!0);Xt(e)}function jf(e,t,a,l,s,i,d,g,E,D,q,G,L,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},xf(t,i,G);var F=(i&62914560)===i?Ws-ht():(i&4194048)===i?pf-ht():0;if(F=Kh(G,F),F!==null){da=i,e.cancelPendingCommit=F(Rf.bind(null,e,t,i,a,l,s,d,g,E,q,G,null,L,B)),_a(e,i,d,!D);return}}Rf(e,t,i,a,l,s,d,g,E)}function oh(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 l=0;l<a.length;l++){var s=a[l],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,l){t&=~hc,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var i=31-pt(s),d=1<<i;l[i]=-1,s&=~d}a!==0&&Ru(e,a,t)}function Is(){return(Se&6)===0?(Un(0),!1):!0}function bc(){if(xe!==null){if(Ce===0)var e=xe.return;else e=xe,ea=Wa=null,Li(e),Al=null,pn=0,e=xe;for(;e!==null;)Fd(e.alternate,e),e=e.return;xe=null}}function Bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Mh(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),da=0,bc(),ze=e,xe=a=Pt(e.current,null),he=t,Ce=0,Nt=null,Aa=!1,Ul=Il(e,t),mc=!1,Ll=St=hc=sl=Ra=qe=0,xt=Dn=null,gc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-pt(l),i=1<<s;t|=e[s],l&=~i}return oa=t,bs(),a}function Nf(e,t){oe=null,k.H=Cn,t===wl||t===As?(t=Ho(),Ce=3):t===Ei?(t=Ho(),Ce=4):Ce=t===Pi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,xe===null&&(qe=1,Ys(e,At(t,e.current)))}function Sf(){var e=bt.current;return e===null?!0:(he&4194048)===he?_t===null:(he&62914560)===he||(he&536870912)!==0?e===_t:!1}function Ef(){var e=k.H;return k.H=Cn,e===null?Cn:e}function Cf(){var e=k.A;return k.A=ch,e}function er(){qe=4,Aa||(he&4194048)!==he&&bt.current!==null||(Ul=!0),(Ra&134217727)===0&&(sl&134217727)===0||ze===null||_a(ze,he,St,!1)}function jc(e,t,a){var l=Se;Se|=2;var s=Ef(),i=Cf();(ze!==e||he!==t)&&(Ps=null,Bl(e,t)),t=!1;var d=qe;e:do try{if(Ce!==0&&xe!==null){var g=xe,E=Nt;switch(Ce){case 8:bc(),d=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var D=Ce;if(Ce=0,Nt=null,kl(e,g,E,D),a&&Ul){d=0;break e}break;default:D=Ce,Ce=0,Nt=null,kl(e,g,E,D)}}dh(),d=qe;break}catch(q){Nf(e,q)}while(!0);return t&&e.shellSuspendCounter++,ea=Wa=null,Se=l,k.H=s,k.A=i,xe===null&&(ze=null,he=0,bs()),d}function dh(){for(;xe!==null;)Tf(xe)}function fh(e,t){var a=Se;Se|=2;var l=Ef(),s=Cf();ze!==e||he!==t?(Ps=null,Fs=ht()+500,Bl(e,t)):Ul=Il(e,t);e:do try{if(Ce!==0&&xe!==null){t=xe;var i=Nt;t:switch(Ce){case 1:Ce=0,Nt=null,kl(e,t,i,1);break;case 2:case 9:if(Uo(i)){Ce=0,Nt=null,wf(t);break}t=function(){Ce!==2&&Ce!==9||ze!==e||(Ce=7),Xt(e)},i.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Uo(i)?(Ce=0,Nt=null,wf(t)):(Ce=0,Nt=null,kl(e,t,i,7));break;case 5:var d=null;switch(xe.tag){case 26:d=xe.memoizedState;case 5:case 27:var g=xe;if(d?f0(d):g.stateNode.complete){Ce=0,Nt=null;var E=g.sibling;if(E!==null)xe=E;else{var D=g.return;D!==null?(xe=D,tr(D)):xe=null}break t}}Ce=0,Nt=null,kl(e,t,i,5);break;case 6:Ce=0,Nt=null,kl(e,t,i,6);break;case 8:bc(),qe=6;break e;default:throw Error(c(462))}}xh();break}catch(q){Nf(e,q)}while(!0);return ea=Wa=null,k.H=l,k.A=s,Se=a,xe!==null?0:(ze=null,he=0,bs(),qe)}function xh(){for(;xe!==null&&!Lx();)Tf(xe)}function Tf(e){var t=Jd(e.alternate,e,oa);e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function wf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Gd(a,t,t.pendingProps,t.type,void 0,he);break;case 11:t=Gd(a,t,t.pendingProps,t.type.render,t.ref,he);break;case 5:Li(t);default:Fd(a,t),t=xe=Eo(t,oa),t=Jd(a,t,oa)}e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function kl(e,t,a,l){ea=Wa=null,Li(t),Al=null,pn=0;var s=t.return;try{if(th(e,s,t,a,he)){qe=1,Ys(e,At(a,e.current)),xe=null;return}}catch(i){if(s!==null)throw xe=s,i;qe=1,Ys(e,At(a,e.current)),xe=null;return}t.flags&32768?(pe||l===1?e=!0:Ul||(he&536870912)!==0?e=!1:(Aa=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Af(t,e)):tr(t)}function tr(e){var t=e;do{if((t.flags&32768)!==0){Af(t,Aa);return}e=t.return;var a=nh(t.alternate,t,oa);if(a!==null){xe=a;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);qe===0&&(qe=5)}function Af(e,t){do{var a=sh(e.alternate,e);if(a!==null){a.flags&=32767,xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=a}while(e!==null);qe=6,xe=null}function Rf(e,t,a,l,s,i,d,g,E){e.cancelPendingCommit=null;do ar();while(Je!==0);if((Se&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=ui,Qx(e,a,i,d,g,E),e===ze&&(xe=ze=null,he=0),Hl=t,za=e,da=a,pc=i,yc=s,yf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ph(ns,function(){return Of(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null,s=X.p,X.p=2,d=Se,Se|=4;try{rh(e,t,a)}finally{Se=d,X.p=s,k.T=l}}Je=1,Mf(),zf(),_f()}}function Mf(){if(Je===1){Je=0;var e=za,t=Hl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var l=X.p;X.p=2;var s=Se;Se|=4;try{of(t,e);var i=Dc,d=ho(e.containerInfo),g=i.focusedElem,E=i.selectionRange;if(d!==g&&g&&g.ownerDocument&&mo(g.ownerDocument.documentElement,g)){if(E!==null&&ni(g)){var D=E.start,q=E.end;if(q===void 0&&(q=D),"selectionStart"in g)g.selectionStart=D,g.selectionEnd=Math.min(q,g.value.length);else{var G=g.ownerDocument||document,L=G&&G.defaultView||window;if(L.getSelection){var B=L.getSelection(),F=g.textContent.length,re=Math.min(E.start,F),Me=E.end===void 0?re:Math.min(E.end,F);!B.extend&&re>Me&&(d=Me,Me=re,re=d);var R=xo(g,re),A=xo(g,Me);if(R&&A&&(B.rangeCount!==1||B.anchorNode!==R.node||B.anchorOffset!==R.offset||B.focusNode!==A.node||B.focusOffset!==A.offset)){var _=G.createRange();_.setStart(R.node,R.offset),B.removeAllRanges(),re>Me?(B.addRange(_),B.extend(A.node,A.offset)):(_.setEnd(A.node,A.offset),B.addRange(_))}}}}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}}mr=!!_c,Dc=_c=null}finally{Se=s,X.p=l,k.T=a}}e.current=t,Je=2}}function zf(){if(Je===2){Je=0;var e=za,t=Hl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var l=X.p;X.p=2;var s=Se;Se|=4;try{nf(e,t.alternate,t)}finally{Se=s,X.p=l,k.T=a}}Je=3}}function _f(){if(Je===4||Je===3){Je=0,Hx();var e=za,t=Hl,a=da,l=yf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Hl=za=null,Df(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ma=null),kr(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=k.T,s=X.p,X.p=2,k.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var g=l[d];i(g.value,{componentStack:g.stack})}}finally{k.T=t,X.p=s}}(da&3)!==0&&ar(),Xt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===vc?On++:(On=0,vc=e):On=0,Un(0)}}function Df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hn(t)))}function ar(){return Mf(),zf(),_f(),Of()}function Of(){if(Je!==5)return!1;var e=za,t=pc;pc=0;var a=kr(da),l=k.T,s=X.p;try{X.p=32>a?32:a,k.T=null,a=yc,yc=null;var i=za,d=da;if(Je=0,Hl=za=null,da=0,(Se&6)!==0)throw Error(c(331));var g=Se;if(Se|=4,hf(i.current),ff(i,i.current,d,a),Se=g,Un(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Pl,i)}catch{}return!0}finally{X.p=s,k.T=l,Df(e,t)}}function Uf(e,t,a){t=At(a,t),t=Fi(e.stateNode,t,2),e=Ea(e,t,2),e!==null&&(en(e,2),Xt(e))}function Te(e,t,a){if(e.tag===3)Uf(e,e,a);else for(;t!==null;){if(t.tag===3){Uf(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ma===null||!Ma.has(l))){e=At(a,e),a=Ud(2),l=Ea(t,a,2),l!==null&&(Ld(a,l,t,e),en(l,2),Xt(l));break}}t=t.return}}function Nc(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new uh;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(a)||(mc=!0,s.add(a),e=mh.bind(null,e,t,a),t.then(e,e))}function mh(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ze===e&&(he&a)===a&&(qe===4||qe===3&&(he&62914560)===he&&300>ht()-Ws?(Se&2)===0&&Bl(e,0):hc|=a,Ll===he&&(Ll=0)),Xt(e)}function Lf(e,t){t===0&&(t=Au()),e=Za(e,t),e!==null&&(en(e,t),Xt(e))}function hh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Lf(e,a)}function gh(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Lf(e,a)}function ph(e,t){return Ur(e,t)}var lr=null,ql=null,Sc=!1,nr=!1,Ec=!1,Da=0;function Xt(e){e!==ql&&e.next===null&&(ql===null?lr=ql=e:ql=ql.next=e),nr=!0,Sc||(Sc=!0,vh())}function Un(e,t){if(!Ec&&nr){Ec=!0;do for(var a=!1,l=lr;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var i=0;else{var d=l.suspendedLanes,g=l.pingedLanes;i=(1<<31-pt(42|e)+1)-1,i&=s&~(d&~g),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,qf(l,i))}else i=he,i=cs(l,l===ze?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||Il(l,i)||(a=!0,qf(l,i));l=l.next}while(a);Ec=!1}}function yh(){Hf()}function Hf(){nr=Sc=!1;var e=0;Da!==0&&Rh()&&(e=Da);for(var t=ht(),a=null,l=lr;l!==null;){var s=l.next,i=Bf(l,t);i===0?(l.next=null,a===null?lr=s:a.next=s,s===null&&(ql=a)):(a=l,(e!==0||(i&3)!==0)&&(nr=!0)),l=s}Je!==0&&Je!==5||Un(e),Da!==0&&(Da=0)}function Bf(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-pt(i),g=1<<d,E=s[d];E===-1?((g&a)===0||(g&l)!==0)&&(s[d]=Xx(g,t)):E<=t&&(e.expiredLanes|=g),i&=~g}if(t=ze,a=he,a=cs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Lr(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Il(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Lr(l),kr(a)){case 2:case 8:a=Tu;break;case 32:a=ns;break;case 268435456:a=wu;break;default:a=ns}return l=kf.bind(null,e),a=Ur(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Lr(l),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ar()&&e.callbackNode!==a)return null;var l=he;return l=cs(e,e===ze?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(bf(e,l,t),Bf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?kf.bind(null,e):null)}function qf(e,t){if(ar())return null;bf(e,t,!0)}function vh(){zh(function(){(Se&6)!==0?Ur(Cu,yh):Hf()})}function Cc(){if(Da===0){var e=Cl;e===0&&(e=ss,ss<<=1,(ss&261888)===0&&(ss=256)),Da=e}return Da}function $f(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fs(""+e)}function Yf(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 bh(e,t,a,l,s){if(t==="submit"&&a&&a.stateNode===s){var i=$f((s[ct]||null).action),d=l.submitter;d&&(t=(t=d[ct]||null)?$f(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var g=new gs("action","action",null,l,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Da!==0){var E=d?Yf(s,d):new FormData(s);Xi(a,{pending:!0,data:E,method:s.method,action:i},null,E)}}else typeof i=="function"&&(g.preventDefault(),E=d?Yf(s,d):new FormData(s),Xi(a,{pending:!0,data:E,method:s.method,action:i},i,E))},currentTarget:s}]})}}for(var Tc=0;Tc<ci.length;Tc++){var wc=ci[Tc],jh=wc.toLowerCase(),Nh=wc[0].toUpperCase()+wc.slice(1);Ht(jh,"on"+Nh)}Ht(yo,"onAnimationEnd"),Ht(vo,"onAnimationIteration"),Ht(bo,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(Bm,"onTransitionRun"),Ht(km,"onTransitionStart"),Ht(qm,"onTransitionCancel"),Ht(jo,"onTransitionEnd"),dl("onMouseEnter",["mouseout","mouseover"]),dl("onMouseLeave",["mouseout","mouseover"]),dl("onPointerEnter",["pointerout","pointerover"]),dl("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="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(" "),Sh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ln));function Gf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],s=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var g=l[d],E=g.instance,D=g.currentTarget;if(g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=D;try{i(s)}catch(q){vs(q)}s.currentTarget=null,i=E}else for(d=0;d<l.length;d++){if(g=l[d],E=g.instance,D=g.currentTarget,g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=D;try{i(s)}catch(q){vs(q)}s.currentTarget=null,i=E}}}}function me(e,t){var a=t[qr];a===void 0&&(a=t[qr]=new Set);var l=e+"__bubble";a.has(l)||(Vf(t,e,2,!1),a.add(l))}function Ac(e,t,a){var l=0;t&&(l|=4),Vf(a,e,l,t)}var sr="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[sr]){e[sr]=!0,Uu.forEach(function(a){a!=="selectionchange"&&(Sh.has(a)||Ac(a,!1,e),Ac(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sr]||(t[sr]=!0,Ac("selectionchange",!1,t))}}function Vf(e,t,a,l){switch(v0(t)){case 2:var s=Fh;break;case 8:s=Ph;break;default:s=Vc}a=s.bind(null,t,a,e),s=void 0,!Jr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?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 Mc(e,t,a,l,s){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var g=l.stateNode.containerInfo;if(g===s)break;if(d===4)for(d=l.return;d!==null;){var E=d.tag;if((E===3||E===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;g!==null;){if(d=cl(g),d===null)return;if(E=d.tag,E===5||E===6||E===26||E===27){l=i=d;continue e}g=g.parentNode}}l=l.return}Zu(function(){var D=i,q=Zr(a),G=[];e:{var L=No.get(e);if(L!==void 0){var B=gs,F=e;switch(e){case"keypress":if(ms(a)===0)break e;case"keydown":case"keyup":B=gm;break;case"focusin":F="focus",B=Ir;break;case"focusout":F="blur",B=Ir;break;case"beforeblur":case"afterblur":B=Ir;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=Wu;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=vm;break;case yo:case vo:case bo:B=im;break;case jo:B=jm;break;case"scroll":case"scrollend":B=am;break;case"wheel":B=Sm;break;case"copy":case"cut":case"paste":B=um;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=Pu;break;case"toggle":case"beforetoggle":B=Cm}var re=(t&4)!==0,Me=!re&&(e==="scroll"||e==="scrollend"),R=re?L!==null?L+"Capture":null:L;re=[];for(var A=D,_;A!==null;){var Y=A;if(_=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||_===null||R===null||(Y=ln(A,R),Y!=null&&re.push(Hn(A,Y,_))),Me)break;A=A.return}0<re.length&&(L=new B(L,F,null,a,q),G.push({event:L,listeners:re}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",L&&a!==Qr&&(F=a.relatedTarget||a.fromElement)&&(cl(F)||F[il]))break e;if((B||L)&&(L=q.window===q?q:(L=q.ownerDocument)?L.defaultView||L.parentWindow:window,B?(F=a.relatedTarget||a.toElement,B=D,F=F?cl(F):null,F!==null&&(Me=x(F),re=F.tag,F!==Me||re!==5&&re!==27&&re!==6)&&(F=null)):(B=null,F=D),B!==F)){if(re=Wu,Y="onMouseLeave",R="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(re=Pu,Y="onPointerLeave",R="onPointerEnter",A="pointer"),Me=B==null?L:an(B),_=F==null?L:an(F),L=new re(Y,A+"leave",B,a,q),L.target=Me,L.relatedTarget=_,Y=null,cl(q)===D&&(re=new re(R,A+"enter",F,a,q),re.target=_,re.relatedTarget=Me,Y=re),Me=Y,B&&F)t:{for(re=Eh,R=B,A=F,_=0,Y=R;Y;Y=re(Y))_++;Y=0;for(var le=A;le;le=re(le))Y++;for(;0<_-Y;)R=re(R),_--;for(;0<Y-_;)A=re(A),Y--;for(;_--;){if(R===A||A!==null&&R===A.alternate){re=R;break t}R=re(R),A=re(A)}re=null}else re=null;B!==null&&Xf(G,L,B,re,!1),F!==null&&Me!==null&&Xf(G,Me,F,re,!0)}}e:{if(L=D?an(D):window,B=L.nodeName&&L.nodeName.toLowerCase(),B==="select"||B==="input"&&L.type==="file")var ve=ro;else if(no(L))if(io)ve=Um;else{ve=Dm;var te=_m}else B=L.nodeName,!B||B.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?D&&Xr(D.elementType)&&(ve=ro):ve=Om;if(ve&&(ve=ve(e,D))){so(G,ve,a,q);break e}te&&te(e,L,D),e==="focusout"&&D&&L.type==="number"&&D.memoizedProps.value!=null&&Vr(L,"number",L.value)}switch(te=D?an(D):window,e){case"focusin":(no(te)||te.contentEditable==="true")&&(pl=te,si=D,fn=null);break;case"focusout":fn=si=pl=null;break;case"mousedown":ri=!0;break;case"contextmenu":case"mouseup":case"dragend":ri=!1,go(G,a,q);break;case"selectionchange":if(Hm)break;case"keydown":case"keyup":go(G,a,q)}var de;if(ti)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else gl?ao(e,a)&&(ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ge="onCompositionStart");ge&&(Iu&&a.locale!=="ko"&&(gl||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&gl&&(de=Ku()):(pa=q,Wr="value"in pa?pa.value:pa.textContent,gl=!0)),te=rr(D,ge),0<te.length&&(ge=new Fu(ge,e,null,a,q),G.push({event:ge,listeners:te}),de?ge.data=de:(de=lo(a),de!==null&&(ge.data=de)))),(de=wm?Am(e,a):Rm(e,a))&&(ge=rr(D,"onBeforeInput"),0<ge.length&&(te=new Fu("onBeforeInput","beforeinput",null,a,q),G.push({event:te,listeners:ge}),te.data=de)),bh(G,e,D,a,q)}Gf(G,t)})}function Hn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function rr(e,t){for(var a=t+"Capture",l=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=ln(e,a),s!=null&&l.unshift(Hn(e,s,i)),s=ln(e,t),s!=null&&l.push(Hn(e,s,i))),e.tag===3)return l;e=e.return}return[]}function Eh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,a,l,s){for(var i=t._reactName,d=[];a!==null&&a!==l;){var g=a,E=g.alternate,D=g.stateNode;if(g=g.tag,E!==null&&E===l)break;g!==5&&g!==26&&g!==27||D===null||(E=D,s?(D=ln(a,i),D!=null&&d.unshift(Hn(a,D,E))):s||(D=ln(a,i),D!=null&&d.push(Hn(a,D,E)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Ch=/\r\n?/g,Th=/\u0000|\uFFFD/g;function Qf(e){return(typeof e=="string"?e:""+e).replace(Ch,`
|
|
9
|
-
`).replace(Th,"")}function Zf(e,t){return t=Qf(t),Qf(e)===t}function Re(e,t,a,l,s,i){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||xl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&xl(e,""+l);break;case"className":os(e,"class",l);break;case"tabIndex":os(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":os(e,a,l);break;case"style":Xu(e,l,i);break;case"data":if(t!=="object"){os(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=fs(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="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"&&Re(e,t,"name",s.name,s,null),Re(e,t,"formEncType",s.formEncType,s,null),Re(e,t,"formMethod",s.formMethod,s,null),Re(e,t,"formTarget",s.formTarget,s,null)):(Re(e,t,"encType",s.encType,s,null),Re(e,t,"method",s.method,s,null),Re(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=fs(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"onScroll":l!=null&&me("scroll",e);break;case"onScrollEnd":l!=null&&me("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(a=l.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=fs(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":me("beforetoggle",e),me("toggle",e),us(e,"popover",l);break;case"xlinkActuate":Jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Jt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Jt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Jt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Jt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":us(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=em.get(a)||a,us(e,a,l))}}function zc(e,t,a,l,s,i){switch(a){case"style":Xu(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(a=l.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof l=="string"?xl(e,l):(typeof l=="number"||typeof l=="bigint")&&xl(e,""+l);break;case"onScroll":l!=null&&me("scroll",e);break;case"onScrollEnd":l!=null&&me("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lu.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 l=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,s);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):us(e,a,l)}}}function nt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":me("error",e),me("load",e);var l=!1,s=!1,i;for(i in a)if(a.hasOwnProperty(i)){var d=a[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,i,d,a,null)}}s&&Re(e,t,"srcSet",a.srcSet,a,null),l&&Re(e,t,"src",a.src,a,null);return;case"input":me("invalid",e);var g=i=d=s=null,E=null,D=null;for(l in a)if(a.hasOwnProperty(l)){var q=a[l];if(q!=null)switch(l){case"name":s=q;break;case"type":d=q;break;case"checked":E=q;break;case"defaultChecked":D=q;break;case"value":i=q;break;case"defaultValue":g=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(c(137,t));break;default:Re(e,t,l,q,a,null)}}$u(e,i,g,E,D,d,s,!1);return;case"select":me("invalid",e),l=d=i=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":i=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:Re(e,t,s,g,a,null)}t=i,a=d,e.multiple=!!l,t!=null?fl(e,!!l,t,!1):a!=null&&fl(e,!!l,a,!0);return;case"textarea":me("invalid",e),i=s=l=null;for(d in a)if(a.hasOwnProperty(d)&&(g=a[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":s=g;break;case"children":i=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Re(e,t,d,g,a,null)}Gu(e,l,s,i);return;case"option":for(E in a)a.hasOwnProperty(E)&&(l=a[E],l!=null)&&(E==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Re(e,t,E,l,a,null));return;case"dialog":me("beforetoggle",e),me("toggle",e),me("cancel",e),me("close",e);break;case"iframe":case"object":me("load",e);break;case"video":case"audio":for(l=0;l<Ln.length;l++)me(Ln[l],e);break;case"image":me("error",e),me("load",e);break;case"details":me("toggle",e);break;case"embed":case"source":case"link":me("error",e),me("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(D in a)if(a.hasOwnProperty(D)&&(l=a[D],l!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,D,l,a,null)}return;default:if(Xr(t)){for(q in a)a.hasOwnProperty(q)&&(l=a[q],l!==void 0&&zc(e,t,q,l,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(l=a[g],l!=null&&Re(e,t,g,l,a,null))}function wh(e,t,a,l){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,d=null,g=null,E=null,D=null,q=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:l.hasOwnProperty(B)||Re(e,t,B,null,l,G)}}for(var L in l){var B=l[L];if(G=a[L],l.hasOwnProperty(L)&&(B!=null||G!=null))switch(L){case"type":i=B;break;case"name":s=B;break;case"checked":D=B;break;case"defaultChecked":q=B;break;case"value":d=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:B!==G&&Re(e,t,L,B,l,G)}}Gr(e,d,g,E,D,q,i,s);return;case"select":B=d=g=L=null;for(i in a)if(E=a[i],a.hasOwnProperty(i)&&E!=null)switch(i){case"value":break;case"multiple":B=E;default:l.hasOwnProperty(i)||Re(e,t,i,null,l,E)}for(s in l)if(i=l[s],E=a[s],l.hasOwnProperty(s)&&(i!=null||E!=null))switch(s){case"value":L=i;break;case"defaultValue":g=i;break;case"multiple":d=i;default:i!==E&&Re(e,t,s,i,l,E)}t=g,a=d,l=B,L!=null?fl(e,!!a,L,!1):!!l!=!!a&&(t!=null?fl(e,!!a,t,!0):fl(e,!!a,a?[]:"",!1));return;case"textarea":B=L=null;for(g in a)if(s=a[g],a.hasOwnProperty(g)&&s!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Re(e,t,g,null,l,s)}for(d in l)if(s=l[d],i=a[d],l.hasOwnProperty(d)&&(s!=null||i!=null))switch(d){case"value":L=s;break;case"defaultValue":B=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==i&&Re(e,t,d,s,l,i)}Yu(e,L,B);return;case"option":for(var F in a)L=a[F],a.hasOwnProperty(F)&&L!=null&&!l.hasOwnProperty(F)&&(F==="selected"?e.selected=!1:Re(e,t,F,null,l,L));for(E in l)L=l[E],B=a[E],l.hasOwnProperty(E)&&L!==B&&(L!=null||B!=null)&&(E==="selected"?e.selected=L&&typeof L!="function"&&typeof L!="symbol":Re(e,t,E,L,l,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 re in a)L=a[re],a.hasOwnProperty(re)&&L!=null&&!l.hasOwnProperty(re)&&Re(e,t,re,null,l,L);for(D in l)if(L=l[D],B=a[D],l.hasOwnProperty(D)&&L!==B&&(L!=null||B!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(c(137,t));break;default:Re(e,t,D,L,l,B)}return;default:if(Xr(t)){for(var Me in a)L=a[Me],a.hasOwnProperty(Me)&&L!==void 0&&!l.hasOwnProperty(Me)&&zc(e,t,Me,void 0,l,L);for(q in l)L=l[q],B=a[q],!l.hasOwnProperty(q)||L===B||L===void 0&&B===void 0||zc(e,t,q,L,l,B);return}}for(var R in a)L=a[R],a.hasOwnProperty(R)&&L!=null&&!l.hasOwnProperty(R)&&Re(e,t,R,null,l,L);for(G in l)L=l[G],B=a[G],!l.hasOwnProperty(G)||L===B||L==null&&B==null||Re(e,t,G,L,l,B)}function Kf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ah(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var s=a[l],i=s.transferSize,d=s.initiatorType,g=s.duration;if(i&&g&&Kf(d)){for(d=0,g=s.responseEnd,l+=1;l<a.length;l++){var E=a[l],D=E.startTime;if(D>g)break;var q=E.transferSize,G=E.initiatorType;q&&Kf(G)&&(E=E.responseEnd,d+=q*(E<g?1:(g-D)/(E-D)))}if(--l,t+=8*(i+d)/(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 _c=null,Dc=null;function ir(e){return e.nodeType===9?e:e.ownerDocument}function Jf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wf(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 Oc(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 Uc=null;function Rh(){var e=window.event;return e&&e.type==="popstate"?e===Uc?!1:(Uc=e,!0):(Uc=null,!1)}var Ff=typeof setTimeout=="function"?setTimeout:void 0,Mh=typeof clearTimeout=="function"?clearTimeout:void 0,Pf=typeof Promise=="function"?Promise:void 0,zh=typeof queueMicrotask=="function"?queueMicrotask:typeof Pf<"u"?function(e){return Pf.resolve(null).then(e).catch(_h)}:Ff;function _h(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function If(e,t){var a=t,l=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(s),Vl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Bn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Bn(a);for(var i=a.firstChild;i;){var d=i.nextSibling,g=i.nodeName;i[tn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=d}}else a==="body"&&Bn(e.ownerDocument.body);a=s}while(a);Vl(t)}function e0(e,t){var a=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function Lc(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":Lc(a),$r(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Dh(e,t,a,l){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[tn])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=Dt(e.nextSibling),e===null)break}return null}function Oh(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Dt(e.nextSibling),e===null))return null;return e}function t0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dt(e.nextSibling),e===null))return null;return e}function Hc(e){return e.data==="$?"||e.data==="$~"}function Bc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Uh(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Dt(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 kc=null;function a0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Dt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function l0(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 n0(e,t,a){switch(t=ir(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 Bn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$r(e)}var Ot=new Map,s0=new Set;function cr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=X.d;X.d={f:Lh,r:Hh,D:Bh,C:kh,L:qh,m:$h,X:Gh,S:Yh,M:Vh};function Lh(){var e=fa.f(),t=Is();return e||t}function Hh(e){var t=ul(e);t!==null&&t.tag===5&&t.type==="form"?jd(t):fa.r(e)}var $l=typeof document>"u"?null:document;function r0(e,t,a){var l=$l;if(l&&typeof t=="string"&&t){var s=Tt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),s0.has(s)||(s0.add(s),e={rel:e,crossOrigin:a,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),nt(t,"link",e),Fe(t),l.head.appendChild(t)))}}function Bh(e){fa.D(e),r0("dns-prefetch",e,null)}function kh(e,t){fa.C(e,t),r0("preconnect",e,t)}function qh(e,t,a){fa.L(e,t,a);var l=$l;if(l&&e&&t){var s='link[rel="preload"][as="'+Tt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+Tt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+Tt(a.imageSizes)+'"]')):s+='[href="'+Tt(e)+'"]';var i=s;switch(t){case"style":i=Yl(e);break;case"script":i=Gl(e)}Ot.has(i)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ot.set(i,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(kn(i))||t==="script"&&l.querySelector(qn(i))||(t=l.createElement("link"),nt(t,"link",e),Fe(t),l.head.appendChild(t)))}}function $h(e,t){fa.m(e,t);var a=$l;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Tt(l)+'"][href="'+Tt(e)+'"]',i=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Gl(e)}if(!Ot.has(i)&&(e=y({rel:"modulepreload",href:e},t),Ot.set(i,e),a.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(qn(i)))return}l=a.createElement("link"),nt(l,"link",e),Fe(l),a.head.appendChild(l)}}}function Yh(e,t,a){fa.S(e,t,a);var l=$l;if(l&&e){var s=ol(l).hoistableStyles,i=Yl(e);t=t||"default";var d=s.get(i);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(kn(i)))g.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ot.get(i))&&qc(e,a);var E=d=l.createElement("link");Fe(E),nt(E,"link",e),E._p=new Promise(function(D,q){E.onload=D,E.onerror=q}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ur(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},s.set(i,d)}}}function Gh(e,t){fa.X(e,t);var a=$l;if(a&&e){var l=ol(a).hoistableScripts,s=Gl(e),i=l.get(s);i||(i=a.querySelector(qn(s)),i||(e=y({src:e,async:!0},t),(t=Ot.get(s))&&$c(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(s,i))}}function Vh(e,t){fa.M(e,t);var a=$l;if(a&&e){var l=ol(a).hoistableScripts,s=Gl(e),i=l.get(s);i||(i=a.querySelector(qn(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=Ot.get(s))&&$c(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(s,i))}}function i0(e,t,a,l){var s=(s=fe.current)?cr(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=Yl(a.href),a=ol(s).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Yl(a.href);var i=ol(s).hoistableStyles,d=i.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=s.querySelector(kn(e)))&&!i._p&&(d.instance=i,d.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||Xh(s,e,a,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==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=Gl(a),a=ol(s).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Yl(e){return'href="'+Tt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function c0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Xh(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),nt(t,"link",a),Fe(t),e.head.appendChild(t))}function Gl(e){return'[src="'+Tt(e)+'"]'}function qn(e){return"script[async]"+e}function u0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Tt(a.href)+'"]');if(l)return t.instance=l,Fe(l),l;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Fe(l),nt(l,"style",s),ur(l,a.precedence,e),t.instance=l;case"stylesheet":s=Yl(a.href);var i=e.querySelector(kn(s));if(i)return t.state.loading|=4,t.instance=i,Fe(i),i;l=c0(a),(s=Ot.get(s))&&qc(l,s),i=(e.ownerDocument||e).createElement("link"),Fe(i);var d=i;return d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),nt(i,"link",l),t.state.loading|=4,ur(i,a.precedence,e),t.instance=i;case"script":return i=Gl(a.src),(s=e.querySelector(qn(i)))?(t.instance=s,Fe(s),s):(l=a,(s=Ot.get(i))&&(l=y({},a),$c(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),Fe(s),nt(s,"link",l),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&&(l=t.instance,t.state.loading|=4,ur(l,a.precedence,e));return t.instance}function ur(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,i=s,d=0;d<l.length;d++){var g=l[d];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 qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var or=null;function o0(e,t,a){if(or===null){var l=new Map,s=or=new Map;s.set(a,l)}else s=or,l=s.get(a),l||(l=new Map,s.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var i=a[s];if(!(i[tn]||i[et]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var g=l.get(d);g?g.push(i):l.set(d,[i])}}return l}function d0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Qh(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 f0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zh(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Yl(l.href),i=t.querySelector(kn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=dr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Fe(i);return}i=t.ownerDocument||t,l=c0(l),(s=Ot.get(s))&&qc(l,s),i=i.createElement("link"),Fe(i);var d=i;d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),nt(i,"link",l),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=dr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Yc=0;function Kh(e,t){return e.stylesheets&&e.count===0&&xr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Yc===0&&(Yc=62500*Ah());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Yc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function dr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fr=null;function xr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fr=new Map,t.forEach(Jh,e),fr=null,dr.call(e))}function Jh(e,t){if(!(t.state.loading&4)){var a=fr.get(e);if(a)var l=a.get(null);else{a=new Map,fr.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var d=s[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}s=t.instance,d=s.getAttribute("data-precedence"),i=a.get(d)||l,i===l&&a.set(null,s),a.set(d,s),this.count++,l=dr.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var $n={$$typeof:U,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function Wh(e,t,a,l,s,i,d,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=Hr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hr(0),this.hiddenUpdates=Hr(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function x0(e,t,a,l,s,i,d,g,E,D,q,G){return e=new Wh(e,t,a,d,E,D,q,G,g),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=ji(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:a,cache:t},Ci(i),e}function m0(e){return e?(e=bl,e):bl}function h0(e,t,a,l,s,i){s=m0(s),l.context===null?l.context=s:l.pendingContext=s,l=Sa(t),l.payload={element:a},i=i===void 0?null:i,i!==null&&(l.callback=i),a=Ea(e,l,t),a!==null&&(mt(a,e,t),vn(a,e,t))}function g0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Gc(e,t){g0(e,t),(e=e.alternate)&&g0(e,t)}function p0(e){if(e.tag===13||e.tag===31){var t=Za(e,67108864);t!==null&&mt(t,e,67108864),Gc(e,67108864)}}function y0(e){if(e.tag===13||e.tag===31){var t=Et();t=Br(t);var a=Za(e,t);a!==null&&mt(a,e,t),Gc(e,t)}}var mr=!0;function Fh(e,t,a,l){var s=k.T;k.T=null;var i=X.p;try{X.p=2,Vc(e,t,a,l)}finally{X.p=i,k.T=s}}function Ph(e,t,a,l){var s=k.T;k.T=null;var i=X.p;try{X.p=8,Vc(e,t,a,l)}finally{X.p=i,k.T=s}}function Vc(e,t,a,l){if(mr){var s=Xc(l);if(s===null)Mc(e,t,l,hr,a),b0(e,l);else if(eg(s,e,t,a,l))l.stopPropagation();else if(b0(e,l),t&4&&-1<Ih.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 d=Ya(i.pendingLanes);if(d!==0){var g=i;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var E=1<<31-pt(d);g.entanglements[1]|=E,d&=~E}Xt(i),(Se&6)===0&&(Fs=ht()+500,Un(0))}}break;case 31:case 13:g=Za(i,2),g!==null&&mt(g,i,2),Is(),Gc(i,2)}if(i=Xc(l),i===null&&Mc(e,t,l,hr,a),i===s)break;s=i}s!==null&&l.stopPropagation()}else Mc(e,t,l,null,a)}}function Xc(e){return e=Zr(e),Qc(e)}var hr=null;function Qc(e){if(hr=null,e=cl(e),e!==null){var t=x(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(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 hr=e,null}function v0(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(Bx()){case Cu:return 2;case Tu:return 8;case ns:case kx:return 32;case wu:return 268435456;default:return 32}default:return 32}}var Zc=!1,Ua=null,La=null,Ha=null,Yn=new Map,Gn=new Map,Ba=[],Ih="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 b0(e,t){switch(e){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(t.pointerId)}}function Vn(e,t,a,l,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ul(t),t!==null&&p0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function eg(e,t,a,l,s){switch(t){case"focusin":return Ua=Vn(Ua,e,t,a,l,s),!0;case"dragenter":return La=Vn(La,e,t,a,l,s),!0;case"mouseover":return Ha=Vn(Ha,e,t,a,l,s),!0;case"pointerover":var i=s.pointerId;return Yn.set(i,Vn(Yn.get(i)||null,e,t,a,l,s)),!0;case"gotpointercapture":return i=s.pointerId,Gn.set(i,Vn(Gn.get(i)||null,e,t,a,l,s)),!0}return!1}function j0(e){var t=cl(e.target);if(t!==null){var a=x(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Du(e.priority,function(){y0(a)});return}}else if(t===31){if(t=j(a),t!==null){e.blockedOn=t,Du(e.priority,function(){y0(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 gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Xc(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Qr=l,a.target.dispatchEvent(l),Qr=null}else return t=ul(a),t!==null&&p0(t),e.blockedOn=a,!1;t.shift()}return!0}function N0(e,t,a){gr(e)&&a.delete(t)}function tg(){Zc=!1,Ua!==null&&gr(Ua)&&(Ua=null),La!==null&&gr(La)&&(La=null),Ha!==null&&gr(Ha)&&(Ha=null),Yn.forEach(N0),Gn.forEach(N0)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Zc||(Zc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,tg)))}var yr=null;function S0(e){yr!==e&&(yr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){yr===e&&(yr=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Qc(l||a)===null)continue;break}var i=ul(a);i!==null&&(e.splice(t,3),t-=3,Xi(i,{pending:!0,data:s,method:a.method,action:l},l,s))}}))}function Vl(e){function t(E){return pr(E,e)}Ua!==null&&pr(Ua,e),La!==null&&pr(La,e),Ha!==null&&pr(Ha,e),Yn.forEach(t),Gn.forEach(t);for(var a=0;a<Ba.length;a++){var l=Ba[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ba.length&&(a=Ba[0],a.blockedOn===null);)j0(a),a.blockedOn===null&&Ba.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var s=a[l],i=a[l+1],d=s[ct]||null;if(typeof i=="function")d||S0(a);else if(d){var g=null;if(i&&i.hasAttribute("formAction")){if(s=i,d=i[ct]||null)g=d.formAction;else if(Qc(s)!==null)continue}else g=d.action;typeof g=="function"?a[l+1]=g:(a.splice(l,3),l-=3),S0(a)}}}function E0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(a,20)}function a(){if(!l&&!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 l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Kc(e){this._internalRoot=e}vr.prototype.render=Kc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,l=Et();h0(a,l,e,t,null,null)},vr.prototype.unmount=Kc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;h0(e.current,2,null,e,null,null),Is(),t[il]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=_u();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ba.length&&t!==0&&t<Ba[a].priority;a++);Ba.splice(a,0,e),a===0&&j0(e)}};var C0=o.version;if(C0!=="19.2.4")throw Error(c(527,C0,"19.2.4"));X.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=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var ag={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var br=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!br.isDisabled&&br.supportsFiber)try{Pl=br.inject(ag),gt=br}catch{}}return Qn.createRoot=function(e,t){if(!f(e))throw Error(c(299));var a=!1,l="",s=zd,i=_d,d=Dd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=x0(e,1,!1,null,null,a,l,null,s,i,d,E0),e[il]=t.current,Rc(e),new Kc(t)},Qn.hydrateRoot=function(e,t,a){if(!f(e))throw Error(c(299));var l=!1,s="",i=zd,d=_d,g=Dd,E=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=x0(e,1,!0,t,a??null,l,s,E,i,d,g,E0),t.context=m0(null),a=t.current,l=Et(),l=Br(l),s=Sa(l),s.callback=null,Ea(a,s,l),a=l,t.current.lanes=a,en(t,a),Xt(t),e[il]=t.current,Rc(e),new vr(t)},Qn.version="19.2.4",Qn}var U0;function fg(){if(U0)return Fc.exports;U0=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(o){console.error(o)}}return r(),Fc.exports=dg(),Fc.exports}var xg=fg();var L0="popstate";function H0(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function mg(r={}){function o(c,f){let x=f.state?.masked,{pathname:h,search:j,hash:p}=x||c.location;return uu("",{pathname:h,search:j,hash:p},f.state&&f.state.usr||null,f.state&&f.state.key||"default",x?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function u(c,f){return typeof f=="string"?f:Pn(f)}return gg(o,u,null,r)}function Be(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function qt(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function hg(){return Math.random().toString(36).substring(2,10)}function B0(r,o){return{usr:r.state,key:r.key,idx:o,masked:r.unstable_mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function uu(r,o,u=null,c,f){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?Jl(o):o,state:u,key:o&&o.key||c||hg(),unstable_mask:f}}function Pn({pathname:r="/",search:o="",hash:u=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),u&&u!=="#"&&(r+=u.charAt(0)==="#"?u:"#"+u),r}function Jl(r){let o={};if(r){let u=r.indexOf("#");u>=0&&(o.hash=r.substring(u),r=r.substring(0,u));let c=r.indexOf("?");c>=0&&(o.search=r.substring(c),r=r.substring(0,c)),r&&(o.pathname=r)}return o}function gg(r,o,u,c={}){let{window:f=document.defaultView,v5Compat:x=!1}=c,h=f.history,j="POP",p=null,m=v();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function v(){return(h.state||{idx:null}).idx}function y(){j="POP";let N=v(),C=N==null?null:N-m;m=N,p&&p({action:j,location:O.location,delta:C})}function T(N,C){j="PUSH";let w=H0(N)?N:uu(O.location,N,C);m=v()+1;let U=B0(w,m),J=O.createHref(w.unstable_mask||w);try{h.pushState(U,"",J)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;f.location.assign(J)}x&&p&&p({action:j,location:O.location,delta:1})}function M(N,C){j="REPLACE";let w=H0(N)?N:uu(O.location,N,C);m=v();let U=B0(w,m),J=O.createHref(w.unstable_mask||w);h.replaceState(U,"",J),x&&p&&p({action:j,location:O.location,delta:0})}function z(N){return pg(N)}let O={get action(){return j},get location(){return r(f,h)},listen(N){if(p)throw new Error("A history only accepts one active listener");return f.addEventListener(L0,y),p=N,()=>{f.removeEventListener(L0,y),p=null}},createHref(N){return o(f,N)},createURL:z,encodeLocation(N){let C=z(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:T,replace:M,go(N){return h.go(N)}};return O}function pg(r,o=!1){let u="http://localhost";typeof window<"u"&&(u=window.location.origin!=="null"?window.location.origin:window.location.href),Be(u,"No window.location.(origin|href) available to create URL");let c=typeof r=="string"?r:Pn(r);return c=c.replace(/ $/,"%20"),!o&&c.startsWith("//")&&(c=u+c),new URL(c,u)}function nx(r,o,u="/"){return yg(r,o,u,!1)}function yg(r,o,u,c){let f=typeof o=="string"?Jl(o):o,x=ma(f.pathname||"/",u);if(x==null)return null;let h=sx(r);vg(h);let j=null;for(let p=0;j==null&&p<h.length;++p){let m=Mg(x);j=Ag(h[p],m,c)}return j}function sx(r,o=[],u=[],c="",f=!1){let x=(h,j,p=f,m)=>{let v={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:j,route:h};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(c)&&p)return;Be(v.relativePath.startsWith(c),`Absolute route path "${v.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(c.length)}let y=Qt([c,v.relativePath]),T=u.concat(v);h.children&&h.children.length>0&&(Be(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),sx(h.children,o,T,y,p)),!(h.path==null&&!h.index)&&o.push({path:y,score:Tg(y,h.index),routesMeta:T})};return r.forEach((h,j)=>{if(h.path===""||!h.path?.includes("?"))x(h,j);else for(let p of rx(h.path))x(h,j,!0,p)}),o}function rx(r){let o=r.split("/");if(o.length===0)return[];let[u,...c]=o,f=u.endsWith("?"),x=u.replace(/\?$/,"");if(c.length===0)return f?[x,""]:[x];let h=rx(c.join("/")),j=[];return j.push(...h.map(p=>p===""?x:[x,p].join("/"))),f&&j.push(...h),j.map(p=>r.startsWith("/")&&p===""?"/":p)}function vg(r){r.sort((o,u)=>o.score!==u.score?u.score-o.score:wg(o.routesMeta.map(c=>c.childrenIndex),u.routesMeta.map(c=>c.childrenIndex)))}var bg=/^:[\w-]+$/,jg=3,Ng=2,Sg=1,Eg=10,Cg=-2,k0=r=>r==="*";function Tg(r,o){let u=r.split("/"),c=u.length;return u.some(k0)&&(c+=Cg),o&&(c+=Ng),u.filter(f=>!k0(f)).reduce((f,x)=>f+(bg.test(x)?jg:x===""?Sg:Eg),c)}function wg(r,o){return r.length===o.length&&r.slice(0,-1).every((c,f)=>c===o[f])?r[r.length-1]-o[o.length-1]:0}function Ag(r,o,u=!1){let{routesMeta:c}=r,f={},x="/",h=[];for(let j=0;j<c.length;++j){let p=c[j],m=j===c.length-1,v=x==="/"?o:o.slice(x.length)||"/",y=Cr({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},v),T=p.route;if(!y&&m&&u&&!c[c.length-1].route.index&&(y=Cr({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!y)return null;Object.assign(f,y.params),h.push({params:f,pathname:Qt([x,y.pathname]),pathnameBase:Og(Qt([x,y.pathnameBase])),route:T}),y.pathnameBase!=="/"&&(x=Qt([x,y.pathnameBase]))}return h}function Cr(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[u,c]=Rg(r.path,r.caseSensitive,r.end),f=o.match(u);if(!f)return null;let x=f[0],h=x.replace(/(.)\/+$/,"$1"),j=f.slice(1);return{params:c.reduce((m,{paramName:v,isOptional:y},T)=>{if(v==="*"){let z=j[T]||"";h=x.slice(0,x.length-z.length).replace(/(.)\/+$/,"$1")}const M=j[T];return y&&!M?m[v]=void 0:m[v]=(M||"").replace(/%2F/g,"/"),m},{}),pathname:x,pathnameBase:h,pattern:r}}function Rg(r,o=!1,u=!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=[],f="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,j,p,m,v)=>{if(c.push({paramName:j,isOptional:p!=null}),p){let y=v.charAt(m+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),f+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?f+="\\/*$":r!==""&&r!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,o?void 0:"i"),c]}function Mg(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){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 (${o}).`),r}}function ma(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let u=o.endsWith("/")?o.length-1:o.length,c=r.charAt(u);return c&&c!=="/"?null:r.slice(u)||"/"}var zg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _g(r,o="/"){let{pathname:u,search:c="",hash:f=""}=typeof r=="string"?Jl(r):r,x;return u?(u=u.replace(/\/\/+/g,"/"),u.startsWith("/")?x=q0(u.substring(1),"/"):x=q0(u,o)):x=o,{pathname:x,search:Ug(c),hash:Lg(f)}}function q0(r,o){let u=o.replace(/\/+$/,"").split("/");return r.split("/").forEach(f=>{f===".."?u.length>1&&u.pop():f!=="."&&u.push(f)}),u.length>1?u.join("/"):"/"}function tu(r,o,u,c){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dg(r){return r.filter((o,u)=>u===0||o.route.path&&o.route.path.length>0)}function ix(r){let o=Dg(r);return o.map((u,c)=>c===o.length-1?u.pathname:u.pathnameBase)}function xu(r,o,u,c=!1){let f;typeof r=="string"?f=Jl(r):(f={...r},Be(!f.pathname||!f.pathname.includes("?"),tu("?","pathname","search",f)),Be(!f.pathname||!f.pathname.includes("#"),tu("#","pathname","hash",f)),Be(!f.search||!f.search.includes("#"),tu("#","search","hash",f)));let x=r===""||f.pathname==="",h=x?"/":f.pathname,j;if(h==null)j=u;else{let y=o.length-1;if(!c&&h.startsWith("..")){let T=h.split("/");for(;T[0]==="..";)T.shift(),y-=1;f.pathname=T.join("/")}j=y>=0?o[y]:"/"}let p=_g(f,j),m=h&&h!=="/"&&h.endsWith("/"),v=(x||h===".")&&u.endsWith("/");return!p.pathname.endsWith("/")&&(m||v)&&(p.pathname+="/"),p}var Qt=r=>r.join("/").replace(/\/\/+/g,"/"),Og=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Ug=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Lg=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Hg=class{constructor(r,o,u,c=!1){this.status=r,this.statusText=o||"",this.internal=c,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function Bg(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function kg(r){return r.map(o=>o.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var cx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ux(r,o){let u=r;if(typeof u!="string"||!zg.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let c=u,f=!1;if(cx)try{let x=new URL(window.location.href),h=u.startsWith("//")?new URL(x.protocol+u):new URL(u),j=ma(h.pathname,o);h.origin===x.origin&&j!=null?u=j+h.search+h.hash:f=!0}catch{qt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:f,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ox=["POST","PUT","PATCH","DELETE"];new Set(ox);var qg=["GET",...ox];new Set(qg);var Wl=b.createContext(null);Wl.displayName="DataRouter";var Tr=b.createContext(null);Tr.displayName="DataRouterState";var $g=b.createContext(!1),dx=b.createContext({isTransitioning:!1});dx.displayName="ViewTransition";var Yg=b.createContext(new Map);Yg.displayName="Fetchers";var Gg=b.createContext(null);Gg.displayName="Await";var Lt=b.createContext(null);Lt.displayName="Navigation";var In=b.createContext(null);In.displayName="Location";var Zt=b.createContext({outlet:null,matches:[],isDataRoute:!1});Zt.displayName="Route";var mu=b.createContext(null);mu.displayName="RouteError";var fx="REACT_ROUTER_ERROR",Vg="REDIRECT",Xg="ROUTE_ERROR_RESPONSE";function Qg(r){if(r.startsWith(`${fx}:${Vg}:{`))try{let o=JSON.parse(r.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function Zg(r){if(r.startsWith(`${fx}:${Xg}:{`))try{let o=JSON.parse(r.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Hg(o.status,o.statusText,o.data)}catch{}}function Kg(r,{relative:o}={}){Be(es(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:c}=b.useContext(Lt),{hash:f,pathname:x,search:h}=ts(r,{relative:o}),j=x;return u!=="/"&&(j=x==="/"?u:Qt([u,x])),c.createHref({pathname:j,search:h,hash:f})}function es(){return b.useContext(In)!=null}function Kt(){return Be(es(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(In).location}var xx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mx(r){b.useContext(Lt).static||b.useLayoutEffect(r)}function hu(){let{isDataRoute:r}=b.useContext(Zt);return r?cp():Jg()}function Jg(){Be(es(),"useNavigate() may be used only in the context of a <Router> component.");let r=b.useContext(Wl),{basename:o,navigator:u}=b.useContext(Lt),{matches:c}=b.useContext(Zt),{pathname:f}=Kt(),x=JSON.stringify(ix(c)),h=b.useRef(!1);return mx(()=>{h.current=!0}),b.useCallback((p,m={})=>{if(qt(h.current,xx),!h.current)return;if(typeof p=="number"){u.go(p);return}let v=xu(p,JSON.parse(x),f,m.relative==="path");r==null&&o!=="/"&&(v.pathname=v.pathname==="/"?o:Qt([o,v.pathname])),(m.replace?u.replace:u.push)(v,m.state,m)},[o,u,x,f,r])}b.createContext(null);function Wg(){let{matches:r}=b.useContext(Zt),o=r[r.length-1];return o?o.params:{}}function ts(r,{relative:o}={}){let{matches:u}=b.useContext(Zt),{pathname:c}=Kt(),f=JSON.stringify(ix(u));return b.useMemo(()=>xu(r,JSON.parse(f),c,o==="path"),[r,f,c,o])}function Fg(r,o){return hx(r,o)}function hx(r,o,u){Be(es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=b.useContext(Lt),{matches:f}=b.useContext(Zt),x=f[f.length-1],h=x?x.params:{},j=x?x.pathname:"/",p=x?x.pathnameBase:"/",m=x&&x.route;{let N=m&&m.path||"";px(j,!m||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${j}" (under <Route path="${N}">) 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="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let v=Kt(),y;if(o){let N=typeof o=="string"?Jl(o):o;Be(p==="/"||N.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 "${N.pathname}" was given in the \`location\` prop.`),y=N}else y=v;let T=y.pathname||"/",M=T;if(p!=="/"){let N=p.replace(/^\//,"").split("/");M="/"+T.replace(/^\//,"").split("/").slice(N.length).join("/")}let z=nx(r,{pathname:M});qt(m||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 O=ap(z&&z.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:Qt([p,c.encodeLocation?c.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:Qt([p,c.encodeLocation?c.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),f,u);return o&&O?b.createElement(In.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},O):O}function Pg(){let r=ip(),o=Bg(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),u=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:c},x={padding:"2px 4px",backgroundColor:c},h=null;return console.error("Error handled by React Router default ErrorBoundary:",r),h=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"}},o),u?b.createElement("pre",{style:f},u):null,h)}var Ig=b.createElement(Pg,null),gx=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,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.onError?this.props.onError(r,o):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 u=Zg(r.digest);u&&(r=u)}let o=r!==void 0?b.createElement(Zt.Provider,{value:this.props.routeContext},b.createElement(mu.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?b.createElement(ep,{error:r},o):o}};gx.contextType=$g;var au=new WeakMap;function ep({children:r,error:o}){let{basename:u}=b.useContext(Lt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Qg(o.digest);if(c){let f=au.get(o);if(f)throw f;let x=ux(c.location,u);if(cx&&!au.get(o))if(x.isExternal||c.reloadDocument)window.location.href=x.absoluteURL||x.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:c.replace}));throw au.set(o,h),h}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x.absoluteURL||x.to}`})}}return r}function tp({routeContext:r,match:o,children:u}){let c=b.useContext(Wl);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),b.createElement(Zt.Provider,{value:r},u)}function ap(r,o=[],u){let c=u?.state;if(r==null){if(!c)return null;if(c.errors)r=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)r=c.matches;else return null}let f=r,x=c?.errors;if(x!=null){let v=f.findIndex(y=>y.route.id&&x?.[y.route.id]!==void 0);Be(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),f=f.slice(0,Math.min(f.length,v+1))}let h=!1,j=-1;if(u&&c){h=c.renderFallback;for(let v=0;v<f.length;v++){let y=f[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(j=v),y.route.id){let{loaderData:T,errors:M}=c,z=y.route.loader&&!T.hasOwnProperty(y.route.id)&&(!M||M[y.route.id]===void 0);if(y.route.lazy||z){u.isStatic&&(h=!0),j>=0?f=f.slice(0,j+1):f=[f[0]];break}}}}let p=u?.onError,m=c&&p?(v,y)=>{p(v,{location:c.location,params:c.matches?.[0]?.params??{},unstable_pattern:kg(c.matches),errorInfo:y})}:void 0;return f.reduceRight((v,y,T)=>{let M,z=!1,O=null,N=null;c&&(M=x&&y.route.id?x[y.route.id]:void 0,O=y.route.errorElement||Ig,h&&(j<0&&T===0?(px("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,N=null):j===T&&(z=!0,N=y.route.hydrateFallbackElement||null)));let C=o.concat(f.slice(0,T+1)),w=()=>{let U;return M?U=O:z?U=N:y.route.Component?U=b.createElement(y.route.Component,null):y.route.element?U=y.route.element:U=v,b.createElement(tp,{match:y,routeContext:{outlet:v,matches:C,isDataRoute:c!=null},children:U})};return c&&(y.route.ErrorBoundary||y.route.errorElement||T===0)?b.createElement(gx,{location:c.location,revalidation:c.revalidation,component:O,error:M,children:w(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:m}):w()},null)}function gu(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lp(r){let o=b.useContext(Wl);return Be(o,gu(r)),o}function np(r){let o=b.useContext(Tr);return Be(o,gu(r)),o}function sp(r){let o=b.useContext(Zt);return Be(o,gu(r)),o}function pu(r){let o=sp(r),u=o.matches[o.matches.length-1];return Be(u.route.id,`${r} can only be used on routes that contain a unique "id"`),u.route.id}function rp(){return pu("useRouteId")}function ip(){let r=b.useContext(mu),o=np("useRouteError"),u=pu("useRouteError");return r!==void 0?r:o.errors?.[u]}function cp(){let{router:r}=lp("useNavigate"),o=pu("useNavigate"),u=b.useRef(!1);return mx(()=>{u.current=!0}),b.useCallback(async(f,x={})=>{qt(u.current,xx),u.current&&(typeof f=="number"?await r.navigate(f):await r.navigate(f,{fromRouteId:o,...x}))},[r,o])}var $0={};function px(r,o,u){!o&&!$0[r]&&($0[r]=!0,qt(!1,u))}b.memo(up);function up({routes:r,future:o,state:u,isStatic:c,onError:f}){return hx(r,void 0,{state:u,isStatic:c,onError:f})}function We(r){Be(!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 op({basename:r="/",children:o=null,location:u,navigationType:c="POP",navigator:f,static:x=!1,unstable_useTransitions:h}){Be(!es(),"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:f,static:x,unstable_useTransitions:h,future:{}}),[j,f,x,h]);typeof u=="string"&&(u=Jl(u));let{pathname:m="/",search:v="",hash:y="",state:T=null,key:M="default",unstable_mask:z}=u,O=b.useMemo(()=>{let N=ma(m,j);return N==null?null:{location:{pathname:N,search:v,hash:y,state:T,key:M,unstable_mask:z},navigationType:c}},[j,m,v,y,T,M,c,z]);return qt(O!=null,`<Router basename="${j}"> is not able to match the URL "${m}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:b.createElement(Lt.Provider,{value:p},b.createElement(In.Provider,{children:o,value:O}))}function dp({children:r,location:o}){return Fg(ou(r),o)}function ou(r,o=[]){let u=[];return b.Children.forEach(r,(c,f)=>{if(!b.isValidElement(c))return;let x=[...o,f];if(c.type===b.Fragment){u.push.apply(u,ou(c.props.children,x));return}Be(c.type===We,`[${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>`),Be(!c.props.index||!c.props.children,"An index route cannot have child routes.");let h={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&&(h.children=ou(c.props.children,x)),u.push(h)}),u}var Sr="get",Er="application/x-www-form-urlencoded";function wr(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function fp(r){return wr(r)&&r.tagName.toLowerCase()==="button"}function xp(r){return wr(r)&&r.tagName.toLowerCase()==="form"}function mp(r){return wr(r)&&r.tagName.toLowerCase()==="input"}function hp(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function gp(r,o){return r.button===0&&(!o||o==="_self")&&!hp(r)}function du(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((o,u)=>{let c=r[u];return o.concat(Array.isArray(c)?c.map(f=>[u,f]):[[u,c]])},[]))}function pp(r,o){let u=du(r);return o&&o.forEach((c,f)=>{u.has(f)||o.getAll(f).forEach(x=>{u.append(f,x)})}),u}var jr=null;function yp(){if(jr===null)try{new FormData(document.createElement("form"),0),jr=!1}catch{jr=!0}return jr}var vp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lu(r){return r!=null&&!vp.has(r)?(qt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Er}"`),null):r}function bp(r,o){let u,c,f,x,h;if(xp(r)){let j=r.getAttribute("action");c=j?ma(j,o):null,u=r.getAttribute("method")||Sr,f=lu(r.getAttribute("enctype"))||Er,x=new FormData(r)}else if(fp(r)||mp(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,o):null,u=r.getAttribute("formmethod")||j.getAttribute("method")||Sr,f=lu(r.getAttribute("formenctype"))||lu(j.getAttribute("enctype"))||Er,x=new FormData(j,r),!yp()){let{name:m,type:v,value:y}=r;if(v==="image"){let T=m?`${m}.`:"";x.append(`${T}x`,"0"),x.append(`${T}y`,"0")}else m&&x.append(m,y)}}else{if(wr(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=Sr,c=null,f=Er,h=r}return x&&f==="text/plain"&&(h=x,x=void 0),{action:c,method:u.toLowerCase(),encType:f,formData:x,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function yu(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function jp(r,o,u,c){let f=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return u?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${c}`:f.pathname=`${f.pathname}.${c}`:f.pathname==="/"?f.pathname=`_root.${c}`:o&&ma(f.pathname,o)==="/"?f.pathname=`${o.replace(/\/$/,"")}/_root.${c}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${c}`,f}async function Np(r,o){if(r.id in o)return o[r.id];try{let u=await import(r.module);return o[r.id]=u,u}catch(u){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Sp(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 Ep(r,o,u){let c=await Promise.all(r.map(async f=>{let x=o.routes[f.route.id];if(x){let h=await Np(x,u);return h.links?h.links():[]}return[]}));return Ap(c.flat(1).filter(Sp).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Y0(r,o,u,c,f,x){let h=(p,m)=>u[m]?p.route.id!==u[m].route.id:!0,j=(p,m)=>u[m].pathname!==p.pathname||u[m].route.path?.endsWith("*")&&u[m].params["*"]!==p.params["*"];return x==="assets"?o.filter((p,m)=>h(p,m)||j(p,m)):x==="data"?o.filter((p,m)=>{let v=c.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(h(p,m)||j(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:u[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function Cp(r,o,{includeHydrateFallback:u}={}){return Tp(r.map(c=>{let f=o.routes[c.route.id];if(!f)return[];let x=[f.module];return f.clientActionModule&&(x=x.concat(f.clientActionModule)),f.clientLoaderModule&&(x=x.concat(f.clientLoaderModule)),u&&f.hydrateFallbackModule&&(x=x.concat(f.hydrateFallbackModule)),f.imports&&(x=x.concat(f.imports)),x}).flat(1))}function Tp(r){return[...new Set(r)]}function wp(r){let o={},u=Object.keys(r).sort();for(let c of u)o[c]=r[c];return o}function Ap(r,o){let u=new Set;return new Set(o),r.reduce((c,f)=>{let x=JSON.stringify(wp(f));return u.has(x)||(u.add(x),c.push({key:x,link:f})),c},[])}function yx(){let r=b.useContext(Wl);return yu(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function Rp(){let r=b.useContext(Tr);return yu(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var vu=b.createContext(void 0);vu.displayName="FrameworkContext";function vx(){let r=b.useContext(vu);return yu(r,"You must render this element inside a <HydratedRouter> element"),r}function Mp(r,o){let u=b.useContext(vu),[c,f]=b.useState(!1),[x,h]=b.useState(!1),{onFocus:j,onBlur:p,onMouseEnter:m,onMouseLeave:v,onTouchStart:y}=o,T=b.useRef(null);b.useEffect(()=>{if(r==="render"&&h(!0),r==="viewport"){let O=C=>{C.forEach(w=>{h(w.isIntersecting)})},N=new IntersectionObserver(O,{threshold:.5});return T.current&&N.observe(T.current),()=>{N.disconnect()}}},[r]),b.useEffect(()=>{if(c){let O=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(O)}}},[c]);let M=()=>{f(!0)},z=()=>{f(!1),h(!1)};return u?r!=="intent"?[x,T,{}]:[x,T,{onFocus:Zn(j,M),onBlur:Zn(p,z),onMouseEnter:Zn(m,M),onMouseLeave:Zn(v,z),onTouchStart:Zn(y,M)}]:[!1,T,{}]}function Zn(r,o){return u=>{r&&r(u),u.defaultPrevented||o(u)}}function zp({page:r,...o}){let{router:u}=yx(),c=b.useMemo(()=>nx(u.routes,r,u.basename),[u.routes,r,u.basename]);return c?b.createElement(Dp,{page:r,matches:c,...o}):null}function _p(r){let{manifest:o,routeModules:u}=vx(),[c,f]=b.useState([]);return b.useEffect(()=>{let x=!1;return Ep(r,o,u).then(h=>{x||f(h)}),()=>{x=!0}},[r,o,u]),c}function Dp({page:r,matches:o,...u}){let c=Kt(),{future:f,manifest:x,routeModules:h}=vx(),{basename:j}=yx(),{loaderData:p,matches:m}=Rp(),v=b.useMemo(()=>Y0(r,o,m,x,c,"data"),[r,o,m,x,c]),y=b.useMemo(()=>Y0(r,o,m,x,c,"assets"),[r,o,m,x,c]),T=b.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let O=new Set,N=!1;if(o.forEach(w=>{let U=x.routes[w.route.id];!U||!U.hasLoader||(!v.some(J=>J.route.id===w.route.id)&&w.route.id in p&&h[w.route.id]?.shouldRevalidate||U.hasClientLoader?N=!0:O.add(w.route.id))}),O.size===0)return[];let C=jp(r,j,f.unstable_trailingSlashAwareDataRequests,"data");return N&&O.size>0&&C.searchParams.set("_routes",o.filter(w=>O.has(w.route.id)).map(w=>w.route.id).join(",")),[C.pathname+C.search]},[j,f.unstable_trailingSlashAwareDataRequests,p,c,x,v,o,r,h]),M=b.useMemo(()=>Cp(y,x),[y,x]),z=_p(y);return b.createElement(b.Fragment,null,T.map(O=>b.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...u})),M.map(O=>b.createElement("link",{key:O,rel:"modulepreload",href:O,...u})),z.map(({key:O,link:N})=>b.createElement("link",{key:O,nonce:u.nonce,...N,crossOrigin:N.crossOrigin??u.crossOrigin})))}function Op(...r){return o=>{r.forEach(u=>{typeof u=="function"?u(o):u!=null&&(u.current=o)})}}var Up=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Up&&(window.__reactRouterVersion="7.13.1")}catch{}function Lp({basename:r,children:o,unstable_useTransitions:u,window:c}){let f=b.useRef();f.current==null&&(f.current=mg({window:c,v5Compat:!0}));let x=f.current,[h,j]=b.useState({action:x.action,location:x.location}),p=b.useCallback(m=>{u===!1?j(m):b.startTransition(()=>j(m))},[u]);return b.useLayoutEffect(()=>x.listen(p),[x,p]),b.createElement(op,{basename:r,children:o,location:h.location,navigationType:h.action,navigator:x,unstable_useTransitions:u})}var bx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,st=b.forwardRef(function({onClick:o,discover:u="render",prefetch:c="none",relative:f,reloadDocument:x,replace:h,unstable_mask:j,state:p,target:m,to:v,preventScrollReset:y,viewTransition:T,unstable_defaultShouldRevalidate:M,...z},O){let{basename:N,navigator:C,unstable_useTransitions:w}=b.useContext(Lt),U=typeof v=="string"&&bx.test(v),J=ux(v,N);v=J.to;let V=Kg(v,{relative:f}),ae=Kt(),Z=null;if(j){let je=xu(j,[],ae.unstable_mask?ae.unstable_mask.pathname:"/",!0);N!=="/"&&(je.pathname=je.pathname==="/"?N:Qt([N,je.pathname])),Z=C.createHref(je)}let[K,H,W]=Mp(c,z),I=kp(v,{replace:h,unstable_mask:j,state:p,target:m,preventScrollReset:y,relative:f,viewTransition:T,unstable_defaultShouldRevalidate:M,unstable_useTransitions:w});function Ee(je){o&&o(je),je.defaultPrevented||I(je)}let He=!(J.isExternal||x),_e=b.createElement("a",{...z,...W,href:(He?Z:void 0)||J.absoluteURL||V,onClick:He?Ee:o,ref:Op(O,H),target:m,"data-discover":!U&&u==="render"?"true":void 0});return K&&!U?b.createElement(b.Fragment,null,_e,b.createElement(zp,{page:V})):_e});st.displayName="Link";var jx=b.forwardRef(function({"aria-current":o="page",caseSensitive:u=!1,className:c="",end:f=!1,style:x,to:h,viewTransition:j,children:p,...m},v){let y=ts(h,{relative:m.relative}),T=Kt(),M=b.useContext(Tr),{navigator:z,basename:O}=b.useContext(Lt),N=M!=null&&Vp(y)&&j===!0,C=z.encodeLocation?z.encodeLocation(y).pathname:y.pathname,w=T.pathname,U=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;u||(w=w.toLowerCase(),U=U?U.toLowerCase():null,C=C.toLowerCase()),U&&O&&(U=ma(U,O)||U);const J=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let V=w===C||!f&&w.startsWith(C)&&w.charAt(J)==="/",ae=U!=null&&(U===C||!f&&U.startsWith(C)&&U.charAt(C.length)==="/"),Z={isActive:V,isPending:ae,isTransitioning:N},K=V?o:void 0,H;typeof c=="function"?H=c(Z):H=[c,V?"active":null,ae?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let W=typeof x=="function"?x(Z):x;return b.createElement(st,{...m,"aria-current":K,className:H,ref:v,style:W,to:h,viewTransition:j},typeof p=="function"?p(Z):p)});jx.displayName="NavLink";var Hp=b.forwardRef(({discover:r="render",fetcherKey:o,navigate:u,reloadDocument:c,replace:f,state:x,method:h=Sr,action:j,onSubmit:p,relative:m,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:T,...M},z)=>{let{unstable_useTransitions:O}=b.useContext(Lt),N=Yp(),C=Gp(j,{relative:m}),w=h.toLowerCase()==="get"?"get":"post",U=typeof j=="string"&&bx.test(j),J=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let ae=V.nativeEvent.submitter,Z=ae?.getAttribute("formmethod")||h,K=()=>N(ae||V.currentTarget,{fetcherKey:o,method:Z,navigate:u,replace:f,state:x,relative:m,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:T});O&&u!==!1?b.startTransition(()=>K()):K()};return b.createElement("form",{ref:z,method:w,action:C,onSubmit:c?p:J,...M,"data-discover":!U&&r==="render"?"true":void 0})});Hp.displayName="Form";function Bp(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nx(r){let o=b.useContext(Wl);return Be(o,Bp(r)),o}function kp(r,{target:o,replace:u,unstable_mask:c,state:f,preventScrollReset:x,relative:h,viewTransition:j,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let v=hu(),y=Kt(),T=ts(r,{relative:h});return b.useCallback(M=>{if(gp(M,o)){M.preventDefault();let z=u!==void 0?u:Pn(y)===Pn(T),O=()=>v(r,{replace:z,unstable_mask:c,state:f,preventScrollReset:x,relative:h,viewTransition:j,unstable_defaultShouldRevalidate:p});m?b.startTransition(()=>O()):O()}},[y,v,T,u,c,f,o,r,x,h,j,p,m])}function Ar(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 o=b.useRef(du(r)),u=b.useRef(!1),c=Kt(),f=b.useMemo(()=>pp(c.search,u.current?null:o.current),[c.search]),x=hu(),h=b.useCallback((j,p)=>{const m=du(typeof j=="function"?j(new URLSearchParams(f)):j);u.current=!0,x("?"+m,p)},[x,f]);return[f,h]}var qp=0,$p=()=>`__${String(++qp)}__`;function Yp(){let{router:r}=Nx("useSubmit"),{basename:o}=b.useContext(Lt),u=rp(),c=r.fetch,f=r.navigate;return b.useCallback(async(x,h={})=>{let{action:j,method:p,encType:m,formData:v,body:y}=bp(x,o);if(h.navigate===!1){let T=h.fetcherKey||$p();await c(T,u,h.action||j,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,flushSync:h.flushSync})}else await f(h.action||j,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,replace:h.replace,state:h.state,fromRouteId:u,flushSync:h.flushSync,viewTransition:h.viewTransition})},[c,f,o,u])}function Gp(r,{relative:o}={}){let{basename:u}=b.useContext(Lt),c=b.useContext(Zt);Be(c,"useFormAction must be used inside a RouteContext");let[f]=c.matches.slice(-1),x={...ts(r||".",{relative:o})},h=Kt();if(r==null){x.search=h.search;let j=new URLSearchParams(x.search),p=j.getAll("index");if(p.some(v=>v==="")){j.delete("index"),p.filter(y=>y).forEach(y=>j.append("index",y));let v=j.toString();x.search=v?`?${v}`:""}}return(!r||r===".")&&f.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(x.pathname=x.pathname==="/"?u:Qt([u,x.pathname])),Pn(x)}function Vp(r,{relative:o}={}){let u=b.useContext(dx);Be(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Nx("useViewTransitionState"),f=ts(r,{relative:o});if(!u.isTransitioning)return!1;let x=ma(u.currentLocation.pathname,c)||u.currentLocation.pathname,h=ma(u.nextLocation.pathname,c)||u.nextLocation.pathname;return Cr(f.pathname,h)!=null||Cr(f.pathname,x)!=null}const Sx=b.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function rl(){return b.useContext(Sx)}function Xp(){const[r,o]=b.useState([]),[u,c]=Ar(),f=b.useCallback(async()=>{try{const m=await(await fetch("/api/projects")).json();m.ok&&o(m.data||[])}catch{}},[]);b.useEffect(()=>{f()},[f]);const x=u.get("project"),h=x?r.find(p=>p.id===x)||r[0]||null:r[0]||null,j=b.useCallback(p=>{c(m=>(m.set("project",p),m))},[c]);return{projects:r,activeProject:h,setActiveProject:j,refreshProjects:f}}function Ex(r,o){const{timeout:u=3e4,retries:c=1,retryDelay:f=2e3}={},[x,h]=b.useState(null),[j,p]=b.useState(!0),[m,v]=b.useState(null),[y,T]=b.useState(0),[M,z]=b.useState(null),O=b.useCallback(()=>T(N=>N+1),[]);return b.useEffect(()=>{if(!r){p(!1),h(null),v(null);return}let N=!1;p(!0),v(null);async function C(w){const U=new AbortController,J=setTimeout(()=>U.abort(),u);try{const V=await fetch(r,{signal:U.signal});if(clearTimeout(J),!V.ok)throw new Error(`HTTP ${V.status}`);const ae=V.headers.get("content-type")||"";if(!ae.includes("application/json"))throw new Error(`Expected JSON response but got ${ae||"unknown"} — server may be restarting`);const Z=await V.json();N||(h(Z.data??Z),v(null),z(new Date),p(!1))}catch(V){if(clearTimeout(J),N)return;if(w>0&&V.name!=="AbortError")return await new Promise(ae=>setTimeout(ae,f)),N?void 0:C(w-1);V.name==="AbortError"?v(`Request timed out (${Math.round(u/1e3)}s)`):v(String(V.message||V)),p(!1)}}return C(c),()=>{N=!0}},[r,y,u,c,f]),{data:x,loading:j,error:m,refetch:O,fetchedAt:M}}function we(r,o){const{activeProject:u}=rl(),c=r.includes("?")?"&":"?",f=u?`${r}${c}project=${u.id}`:r;return Ex(f)}const bu=b.createContext(null),Qp=["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 Zp({url:r="/api/events",children:o}){const[u,c]=b.useState("connecting"),f=b.useRef(null),x=b.useRef(null),h=b.useRef(new Map),j=b.useCallback(()=>{f.current&&f.current.close(),c("connecting");const m=new EventSource(r);f.current=m;for(const v of Qp)m.addEventListener(v,y=>{let T;try{T=JSON.parse(y.data)}catch{return}const M=h.current.get(v);if(M)for(const z of M)try{z(T)}catch{}});m.onopen=()=>c("connected"),m.onerror=()=>{m.close(),c("disconnected"),x.current=setTimeout(()=>{f.current===m&&j()},3e3)}},[r]);b.useEffect(()=>(j(),()=>{x.current&&(clearTimeout(x.current),x.current=null),f.current?.close(),f.current=null}),[j]);const p=b.useCallback((m,v)=>(h.current.has(m)||h.current.set(m,new Set),h.current.get(m).add(v),()=>{const y=h.current.get(m);y&&(y.delete(v),y.size===0&&h.current.delete(m))}),[]);return n.jsx(bu.Provider,{value:{status:u,subscribe:p},children:o})}function Ue(r,o){const u=b.useContext(bu),c=b.useRef(o);c.current=o,b.useEffect(()=>{if(!u)return;const f=x=>c.current(x);return u.subscribe(r,f)},[u,r])}function Kp(){return b.useContext(bu)?.status??"disconnected"}const Jp=[{path:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1"},{path:"/increments",label:"Increments",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"},{path:"/analytics",label:"Analytics",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{path:"/costs",label:"Costs",icon:"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 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{path:"/sync",label:"Sync",icon:"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"},{path:"/errors",label:"Errors",icon:"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"},{path:"/activity",label:"Activity",icon:"M13 10V3L4 14h7v7l9-11h-7z"},{path:"/notifications",label:"Notifications",icon:"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",badge:!0},{path:"/config",label:"Config",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"},{path:"/plugins",label:"Plugins",icon:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"},{path:"/marketplace",label:"Marketplace",icon:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 100 4 2 2 0 000-4z"},{path:"/repos",label:"Repos",icon:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},{path:"/workspace",label:"Workspace",icon:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},{path:"/services",label:"Services",icon:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},{path:"/hooks",label:"Hooks",icon:"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"},{path:"/agents",label:"Agents",icon:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}];function Wp({d:r}){return n.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:r})})}function Fp(){const{projects:r,activeProject:o,setActiveProject:u}=rl(),[c]=Ar(),{data:f}=we("/api/overview"),[x,h]=b.useState(null),j=b.useCallback(T=>{const M=T;M?.pendingCount!=null&&h(M.pendingCount)},[]);Ue("notification",j);const p=Kp(),m=x??f?.notifications?.pendingCount??0,v=c.get("project"),y=T=>v?`${T}?project=${v}`:T;return n.jsxs("aside",{className:"w-56 bg-gray-900 border-r border-gray-800 flex flex-col h-screen sticky top-0",children:[n.jsx("div",{className:"px-4 py-5 border-b border-gray-800",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-500 rounded-lg flex items-center justify-center",children:n.jsx("span",{className:"text-white font-bold text-sm",children:"SW"})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white font-semibold text-sm",children:"SpecWeave"}),n.jsx("div",{className:"text-gray-500 text-xs",children:"Dashboard"})]})]})}),(r.length>0||v)&&n.jsxs("div",{className:"px-3 py-3 border-b border-gray-800",children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1 block",children:"Project"}),n.jsxs("select",{value:o?.id||v||"",onChange:T=>{T.target.value==="__add__"?window.location.href=y("/config"):u(T.target.value)},className:"w-full bg-gray-800 border border-gray-700 text-gray-300 text-xs rounded-lg px-2 py-1.5 focus:ring-indigo-500 focus:border-indigo-500",children:[r.map(T=>n.jsx("option",{value:T.id,children:T.name},T.id)),v&&!r.find(T=>T.id===v)&&n.jsxs("option",{value:v,children:[decodeURIComponent(v).split(/[-/]/).pop()||v," (not registered)"]}),n.jsx("option",{value:"__add__",children:"+ Add project..."})]})]}),n.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:Jp.map(T=>n.jsxs(jx,{to:y(T.path),end:T.path==="/",className:({isActive:M})=>`flex items-center gap-3 px-3 py-2 rounded-lg text-sm mb-0.5 transition-colors ${M?"bg-indigo-500/10 text-indigo-400":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[n.jsx(Wp,{d:T.icon}),n.jsx("span",{className:"flex-1",children:T.label}),T.badge&&m>0&&n.jsx("span",{className:"min-w-[18px] h-[18px] px-1 bg-rose-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center",children:m>99?"99+":m})]},T.path))}),n.jsx("div",{className:"px-4 py-3 border-t border-gray-800",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${p==="connected"?"bg-emerald-400 pulse-dot":p==="connecting"?"bg-amber-400 pulse-dot":"bg-gray-500"}`}),n.jsx("span",{className:"text-xs text-gray-500",children:p==="connected"?"Connected":p==="connecting"?"Connecting...":"Disconnected"})]}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[r.length," project",r.length!==1?"s":""]})]})})]})}function Pp(){const{data:r}=Ex("/api/health"),{activeProject:o}=rl(),u=o?.name||"Project",c=r?.uptime?Ip(r.uptime):"...";return n.jsxs("header",{className:"h-14 bg-gray-900/50 backdrop-blur border-b border-gray-800 flex items-center justify-between px-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("h1",{className:"text-gray-200 font-medium text-sm",children:u}),n.jsx("span",{className:"text-gray-600 text-xs",children:"|"}),n.jsxs("span",{className:"text-gray-500 text-xs",children:["Uptime: ",c]})]}),n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("span",{className:"text-gray-500 text-xs",children:[r?.connections??0," client",(r?.connections??0)!==1?"s":""]})})]})}function Ip(r){if(r<60)return`${Math.floor(r)}s`;if(r<3600)return`${Math.floor(r/60)}m`;const o=Math.floor(r/3600),u=Math.floor(r%3600/60);return`${o}h ${u}m`}class ey extends b.Component{constructor(o){super(o),this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,u){console.error("[Dashboard ErrorBoundary]",o,u.componentStack)}componentDidUpdate(o){this.state.hasError&&o.resetKey!==this.props.resetKey&&this.setState({hasError:!1,error:null})}render(){return this.state.hasError?n.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:n.jsxs("div",{className:"max-w-md text-center space-y-4",children:[n.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 flex items-center justify-center",children:n.jsx("svg",{className:"w-6 h-6 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.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"})})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:"Something went wrong"}),n.jsx("p",{className:"text-sm text-gray-500",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),n.jsxs("div",{className:"flex gap-3 justify-center",children:[n.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"}),n.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"}),n.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 ty={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"},ay={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function ne({title:r,value:o,subtitle:u,tooltip:c,color:f="indigo"}){return n.jsxs("div",{className:`bg-gradient-to-br ${ty[f]} border rounded-xl p-4 relative group`,title:c,children:[n.jsx("div",{className:"text-gray-400 text-xs font-medium uppercase tracking-wider mb-2",children:r}),n.jsx("div",{className:`text-2xl font-bold ${ay[f]}`,children:o}),u&&n.jsx("div",{className:"text-gray-500 text-xs mt-1",children:u}),c&&n.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,n.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-4 border-transparent border-t-gray-800"})]})]})}const ly={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function ny(r){return ly[r]||"#6b7280"}function sy({segments:r,size:o=160,centerLabel:u,centerValue:c}){const f=r.reduce((p,m)=>p+m.value,0);if(f===0)return n.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:n.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const x=52,h=2*Math.PI*x;let j=0;return n.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:o,height:o},children:[n.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:r.map((p,m)=>{const y=p.value/f*h,T=j;return j+=y,n.jsx("circle",{cx:"64",cy:"64",r:x,fill:"none",stroke:p.color,strokeWidth:"12",strokeDasharray:`${y} ${h-y}`,strokeDashoffset:-T,className:"transition-all duration-500"},m)})}),n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c!=null&&n.jsx("span",{className:"text-xl font-bold text-white",children:c}),u&&n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:u})]})]})}function ry(r){return Object.entries(r).filter(([o,u])=>u>0).map(([o,u])=>({label:o,value:u,color:ny(o)}))}const iy={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 ie({label:r,variant:o="default"}){return n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${iy[o]}`,children:r})}function Rr(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 cy({size:r="md"}){const o={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return n.jsxs("svg",{className:`${o[r]} animate-spin text-indigo-400`,viewBox:"0 0 24 24",fill:"none",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function Ie(){return n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(cy,{size:"lg"})})}function $t({message:r,onRetry:o,title:u="Something went wrong"}){const c=r.toLowerCase().includes("timed out");return n.jsx("div",{className:"p-6",children:n.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium text-rose-300",children:u}),n.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:r})]}),o&&n.jsx("button",{onClick:o,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&&n.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 G0(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function uy(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 nu=r=>r.billingContext?.planType==="subscription";function oy(){const[r,o]=b.useState(0),{data:u,loading:c,error:f,refetch:x}=we(`/api/overview?_r=${r}`),[h,j]=b.useState([]),[p,m]=b.useState([]),[v,y]=b.useState([]),{activeProject:T}=rl();Ue("increment-update",()=>o(N=>N+1)),Ue("notification",()=>o(N=>N+1)),Ue("sync-update",()=>o(N=>N+1)),Ue("sync-error",()=>o(N=>N+1)),Ue("cost-update",()=>o(N=>N+1));const M=b.useRef(null);b.useEffect(()=>{if(!T||M.current===T.id)return;M.current=T.id;const N=`project=${T.id}`;fetch(`/api/activity/stream?limit=20&${N}`).then(C=>C.json()).then(C=>{C.ok&&Array.isArray(C.data)&&j(C.data)}).catch(()=>{})},[T]);const z=b.useCallback(N=>{j(C=>[N,...C].slice(0,20))},[]);if(Ue("activity",z),b.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=5").then(N=>N.json()).then(N=>{N.ok&&Array.isArray(N.data)&&m(N.data)}).catch(()=>{}),fetch("/api/sync/gaps").then(N=>N.json()).then(N=>{N.ok&&Array.isArray(N.data)&&y(N.data)}).catch(()=>{})},[r]),c)return n.jsx(Ie,{});if(f)return n.jsx($t,{message:f,onRetry:x});if(!u)return null;const O=ry(u.project.statusBreakdown);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-200",children:[u.project.name||"Project"," Overview"]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(st,{to:"/increments?status=active",className:"group",children:n.jsx(ne,{title:"Active Increments",value:u.project.activeIncrements,subtitle:`${u.project.totalIncrements} total`,color:"indigo"})}),n.jsx(st,{to:"/increments?status=completed",className:"group",children:n.jsx(ne,{title:"Completed",value:u.project.completedIncrements,subtitle:`${Math.round(u.project.completedIncrements/Math.max(u.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),n.jsx(st,{to:"/costs",className:"group",children:n.jsx(ne,{title:nu(u.costs)?"Usage Value":"Total Cost",value:`$${u.costs.totalCost.toFixed(2)}`,subtitle:nu(u.costs)?`via Claude Code · $${u.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`via Claude Code · ${u.costs.sessionCount.toLocaleString()} sessions`,color:"amber"})}),n.jsx(st,{to:"/analytics",className:"group",children:n.jsx(ne,{title:"Events Today",value:u.analytics.last24hEvents,subtitle:`${u.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),n.jsx(dy,{}),nu(u.costs)&&n.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[n.jsx(ie,{label:"Subscription",variant:"info"}),n.jsx("span",{className:"text-xs text-gray-300",children:"Costs shown as API-equivalent usage value."})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Status"}),n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(sy,{segments:O,centerValue:u.project.totalIncrements,centerLabel:"total"})}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:O.map(N=>n.jsxs(st,{to:`/increments?status=${N.label.toLowerCase()}`,className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:N.color}}),n.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[N.label," (",N.value,")"]})]},N.label))})]}),n.jsxs(st,{to:"/sync",className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 hover:border-gray-700 transition-colors block",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Health"}),n.jsx("div",{className:"space-y-3",children:Object.entries(u.sync.platforms).length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(u.sync.platforms).map(([N,C])=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-gray-300 capitalize",children:N}),C.configDetail&&n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:C.configDetail}),!C.configDetail&&C.lastImport&&n.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(C.lastImport).toLocaleDateString()]})]}),n.jsx(ie,{label:uy(C.connectionStatus||C.lastSyncResult),variant:G0(C.connectionStatus)!=="default"?G0(C.connectionStatus):Rr(C.lastSyncResult||"")})]},N))}),n.jsx("div",{className:"mt-4 pt-4 border-t border-gray-800",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:"Notifications"}),n.jsxs("div",{className:"flex gap-2",children:[u.notifications.criticalCount>0&&n.jsx(st,{to:"/notifications",onClick:N=>N.stopPropagation(),children:n.jsx(ie,{label:`${u.notifications.criticalCount} critical`,variant:"error"})}),n.jsx(st,{to:"/notifications",onClick:N=>N.stopPropagation(),children:n.jsx(ie,{label:`${u.notifications.pendingCount} pending`,variant:u.notifications.pendingCount>0?"warning":"default"})})]})]})})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Live Activity"}),n.jsx(st,{to:"/activity",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),n.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:h.length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):h.map((N,C)=>n.jsxs("div",{className:"flex items-start gap-2 py-1 slide-in",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 ${N.severity==="error"?"bg-rose-400":N.severity==="warning"?"bg-amber-400":"bg-gray-600"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-xs text-gray-400 truncate",children:N.title}),n.jsxs("div",{className:"text-[10px] text-gray-600",children:[N.category,N.timestamp&&` · ${V0(N.timestamp)}`]})]})]},C))})]})]}),v.length>0&&n.jsxs(st,{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:[n.jsx(ie,{label:`${v.length} gaps`,variant:"warning"}),n.jsxs("span",{className:"text-xs text-gray-300",children:[v.length," increment",v.length!==1?"s have":" has"," partial sync coverage"]})]}),p.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sync Errors"}),n.jsx(st,{to:"/sync",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),n.jsx("div",{className:"space-y-2",children:p.map((N,C)=>n.jsxs("div",{className:"flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg",children:[n.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-300 capitalize",children:N.provider}),n.jsx(ie,{label:N.incrementId,variant:"default"})]}),n.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:N.error}),n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:V0(N.timestamp)})]})]},C))})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Types"}),n.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(u.project.typeBreakdown).map(([N,C])=>n.jsxs(st,{to:`/increments?type=${N}`,className:"flex items-center gap-2 px-3 py-2 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors",children:[n.jsx("span",{className:"text-sm text-gray-300 capitalize",children:N}),n.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:C})]},N))})]})]})}function dy(){const[r,o]=b.useState(0);Ue("error-detected",()=>o(M=>M+1));const{data:u}=we(`/api/prompt-health?_r=${r}`);if(!u?.health||u.health.warningLevel==="normal")return null;const{health:c,alert:f}=u,x=f?.level==="emergency",h=c.warningLevel==="critical"||x,j=h?"border-rose-500/30":"border-amber-500/20",p=h?"bg-rose-500/10":"bg-amber-500/10",m=h?"text-rose-400":"text-amber-400",v=Math.round(c.baseline/1e3),y=Math.min(Math.round(c.baseline/2e5*100),100),T=h?"bg-rose-500":"bg-amber-500";return n.jsxs("div",{className:`${p} border ${j} rounded-xl px-4 py-3 space-y-2`,children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ie,{label:h?"Critical":"Warning",variant:h?"error":"warning"}),n.jsxs("span",{className:`text-xs ${m}`,children:["Prompt baseline: ",v,"KB (",y,"% of context window)"]})]}),n.jsx(st,{to:"/errors",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Details"})]}),n.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5",children:n.jsx("div",{className:`${T} h-1.5 rounded-full`,style:{width:`${y}%`}})}),n.jsxs("div",{className:"flex gap-4 text-[10px] text-gray-500",children:[n.jsxs("span",{children:["CLAUDE.md: ",Math.round(c.claudeMdSize/1e3),"KB"]}),n.jsxs("span",{children:["MEMORY.md: ",Math.round(c.memoryMdSize/1e3),"KB"]}),n.jsxs("span",{children:["Skills: ",Math.round(c.skillBudget/1e3),"KB"]}),f&&n.jsxs("span",{className:m,children:["Compactions: ",f.compactionCount]})]})]})}function V0(r){try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function fy(){const r=hu(),[o]=Ar();return b.useCallback(u=>{const c=o.get("project");if(c){const f=u.includes("?")?"&":"?";r(`${u}${f}project=${encodeURIComponent(c)}`)}else r(u)},[r,o])}const Wn=new Map;let su=!1,Cx=null;function xy(){su||(su=!0,queueMicrotask(()=>{su=!1;const r=Cx;if(!r||Wn.size===0){Wn.clear();return}const o=new Map(Wn);Wn.clear(),r(u=>{const c=new URLSearchParams(u);for(const[f,{value:x,defaultValue:h}]of o)x&&x!==h?c.set(f,x):c.delete(f);return c})}))}function Ut(r,o=""){const[u,c]=Ar(),f=u.get(r)??o,x=b.useCallback(h=>{Cx=c,Wn.set(r,{value:h,defaultValue:o}),xy()},[r,o,c]);return[f,x]}function ju({title:r,description:o}){return n.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:n.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsx("h3",{className:"text-gray-400 text-sm font-medium",children:r}),o&&n.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:o})]})}const Kn=50;function my(){const[r,o]=b.useState(0),[u,c]=b.useState(0),[f,x]=Ut("status","all"),[h,j]=Ut("type","all"),p=fy(),m=b.useRef();Ue("increment-update",()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>o(U=>U+1),500)}),b.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const v=new URLSearchParams({_r:String(r),limit:String(Kn),offset:String(u)});f!=="all"&&v.set("status",f),h!=="all"&&v.set("type",h);const{data:y,loading:T,error:M,refetch:z}=we(`/api/increments?${v}`),O=b.useRef(f),N=b.useRef(h);if(b.useEffect(()=>{(O.current!==f||N.current!==h)&&(c(0),O.current=f,N.current=h)},[f,h]),T&&u===0)return n.jsx(Ie,{});if(M)return n.jsx($t,{message:M,onRetry:z});if(!y)return null;const C=Object.keys(y.summary).filter(U=>U!=="total"&&y.summary[U]>0),w=y.pagination;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Increments"}),n.jsxs("span",{className:"text-sm text-gray-500",children:[w?.total??y.increments.length," total"]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Status:"}),n.jsxs("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[n.jsx(ru,{label:"All",active:f==="all",onClick:()=>x("all"),count:y.summary.total}),C.map(U=>n.jsx(ru,{label:U,active:f===U,onClick:()=>x(U),count:y.summary[U]},U))]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Type:"}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:n.jsx(ru,{label:"All",active:h==="all",onClick:()=>j("all")})})]}),w&&w.total>0&&n.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",u+1,"–",Math.min(u+Kn,w.total)," of ",w.total]})]}),y.increments.length===0?n.jsx(ju,{title:"No increments match filters",description:"Try adjusting your filters"}):n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ID"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Title"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Status"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Type"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Priority"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Tasks"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ACs"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Last Activity"})]})}),n.jsx("tbody",{children:y.increments.map(U=>n.jsxs("tr",{onClick:()=>p(`/increments/${U.id}`),className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors cursor-pointer",children:[n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:U.id})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-sm text-gray-300",children:U.title})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(ie,{label:U.status,variant:Rr(U.status)})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:U.type})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(hy,{priority:U.priority})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(X0,{completed:U.tasks.completed,total:U.tasks.total})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(X0,{completed:U.acs.completed,total:U.acs.total})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-gray-500",children:U.lastActivity?gy(U.lastActivity):"-"})})]},U.id))})]})}),w&&w.total>Kn&&n.jsxs("div",{className:"flex justify-center gap-2",children:[n.jsx("button",{onClick:()=>c(Math.max(0,u-Kn)),disabled:u===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"}),n.jsx("button",{onClick:()=>c(u+Kn),disabled:!w.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 ru({label:r,active:o,onClick:u,count:c}){return n.jsxs("button",{onClick:u,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${o?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[r,c!==void 0&&n.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function X0({completed:r,total:o}){const u=o>0?Math.round(r/o*100):0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${u}%`}})}),n.jsxs("span",{className:"text-xs text-gray-500",children:[r,"/",o]})]})}function hy({priority:r}){const o={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 n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}function gy(r){try{const o=new Date(r),c=new Date().getTime()-o.getTime(),f=Math.floor(c/6e4);if(f<1)return"Just now";if(f<60)return`${f}m ago`;const x=Math.floor(f/60);if(x<24)return`${x}h ago`;const h=Math.floor(x/24);return h<7?`${h}d ago`:o.toLocaleDateString()}catch{return r}}function py(){const[r,o]=b.useState("skills"),[u,c]=b.useState(!1),[f,x]=b.useState(0);Ue("analytics-event",()=>x(C=>C+1));const{data:h,loading:j,error:p,refetch:m,fetchedAt:v}=we(`/api/analytics/summary?_r=${f}`),{data:y,loading:T,refetch:M}=we(`/api/analytics/skills?_r=${f}`);if(j||T)return n.jsx(Ie,{});if(p)return n.jsx($t,{message:p,onRetry:m});if(!h)return null;const z=h.topCommands?.reduce((C,w)=>C+w.count,0)||0,O=h.topSkills?.reduce((C,w)=>C+w.count,0)||0,N=h.topAgents?.reduce((C,w)=>C+w.count,0)||0;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Analytics"}),n.jsxs("div",{className:"flex items-center gap-3",children:[v&&n.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",v.toLocaleTimeString()]}),n.jsxs("span",{className:"text-sm text-gray-500",children:[h.totalEvents.toLocaleString()," total events"]}),n.jsx("button",{onClick:()=>{c(!0),m(),M(),setTimeout(()=>c(!1),600)},disabled:u,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:n.jsx("svg",{className:`w-4 h-4 ${u?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.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"})})})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Total Events",value:h.totalEvents.toLocaleString(),subtitle:`${h.successRate}% success rate`,color:"indigo",tooltip:`${h.totalEvents} events tracked from analytics JSONL`}),n.jsx(ne,{title:"Commands",value:z.toLocaleString(),subtitle:`${h.topCommands?.length||0} unique`,color:"cyan",tooltip:`${z} total command invocations across ${h.topCommands?.length||0} distinct commands`}),n.jsx(ne,{title:"Skills",value:O.toLocaleString(),subtitle:`${h.topSkills?.length||0} unique`,color:"emerald",tooltip:`${O} total skill activations across ${h.topSkills?.length||0} distinct skills`}),n.jsx(ne,{title:"Agents",value:N.toLocaleString(),subtitle:`${h.topAgents?.length||0} unique`,color:"amber",tooltip:`${N} agent spawns across ${h.topAgents?.length||0} distinct agent types`})]}),n.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(C=>n.jsx("button",{onClick:()=>o(C.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===C.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:C.label},C.key))}),r==="commands"&&n.jsx(yy,{commands:h.topCommands||[]}),r==="skills"&&n.jsx(vy,{skills:y||[]}),r==="agents"&&n.jsx(by,{agents:h.topAgents||[]}),r==="daily"&&n.jsx(jy,{days:h.dailySummaries||[]})]})}function yy({commands:r}){if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No command data available"})});const o=[...r].sort((c,f)=>f.count-c.count),u=o[0]?.count||1;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Commands"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Command"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),n.jsx("tbody",{children:o.map((c,f)=>{const x=Math.max(2,c.count/u*100);return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",f+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300 font-mono",children:c.name})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-indigo-500/60 transition-all",style:{width:`${x}%`}})})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function vy({skills:r}){const o=[...r].sort((u,c)=>c.count-u.count);return o.length===0?n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No skill usage data available"})}):n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Skill Usage Leaderboard"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Skill Name"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Plugin"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Invocations"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Success Rate"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Last Used"})]})}),n.jsx("tbody",{children:o.map((u,c)=>{const f=u.count>0?Math.round(u.successCount/u.count*100):100,x=f>=90?"success":f>=70?"warning":"error";return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",c+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300 font-mono",children:u.name})}),n.jsx("td",{className:"px-4 py-2.5",children:u.plugin&&n.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:u.plugin})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:u.count.toLocaleString()}),n.jsx("td",{className:"px-4 py-2.5 text-right",children:n.jsx(ie,{label:`${f}%`,variant:x})}),n.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:u.lastUsed?Ny(u.lastUsed):"-"})]},u.name)})})]})]})}function by({agents:r}){if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No agent data available"})});const o=[...r].sort((c,f)=>f.count-c.count),u=o[0]?.count||1;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Agents"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Agent"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),n.jsx("tbody",{children:o.map((c,f)=>{const x=Math.max(2,c.count/u*100);return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",f+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300",children:c.name})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-cyan-500/60 transition-all",style:{width:`${x}%`}})})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function jy({days:r}){const o=r.slice(-14);if(o.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No daily data available"})});const u=Math.max(...o.map(x=>x.totalEvents),1),c=o.reduce((x,h)=>x+h.totalEvents,0),f=Math.round(c/o.length);return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsx(ne,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${o.length} days`,color:"indigo"}),n.jsx(ne,{title:"Daily Average",value:f.toLocaleString(),color:"cyan"}),n.jsx(ne,{title:"Peak Day",value:u.toLocaleString(),subtitle:o.find(x=>x.totalEvents===u)?.date||"",color:"emerald"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:["Daily Events (Last ",o.length," Days)"]}),n.jsx("div",{className:"flex items-end gap-1.5 h-40",children:o.map(x=>{const h=Math.max(2,x.totalEvents/u*100),j=x.date.slice(5);return n.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[n.jsx("span",{className:"text-[9px] text-gray-500",children:x.totalEvents}),n.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${h}%`},title:`${x.date}: ${x.totalEvents} events`}),n.jsx("span",{className:"text-[8px] text-gray-700",children:j})]},x.date)})})]})]})}function Ny(r){if(!r)return"";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function Tx({items:r,maxBars:o=10}){const u=[...r].sort((f,x)=>x.value-f.value).slice(0,o),c=Math.max(...u.map(f=>f.value),1);return n.jsx("div",{className:"space-y-2",children:u.map((f,x)=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-xs text-gray-400 w-28 truncate text-right",title:f.label,children:f.label}),n.jsx("div",{className:"flex-1 h-5 bg-gray-800 rounded overflow-hidden",children:n.jsx("div",{className:"h-full rounded transition-all duration-500",style:{width:`${f.value/c*100}%`,backgroundColor:f.color||"#6366f1"}})}),n.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:f.value})]},x))})}function Sy(){const[r,o]=b.useState("overview"),[u,c]=b.useState(null),[f,x]=b.useState(0);Ue("cost-update",()=>x(w=>w+1));const{data:h,loading:j,error:p,refetch:m}=we(`/api/costs/summary?_r=${f}`);if(j)return n.jsx(Ie,{});if(p)return n.jsx($t,{message:p,onRetry:m});if(!h)return null;const v=h.sessions||[],y=h.billingContext?.planType==="subscription",T=h.modelBreakdown?Object.entries(h.modelBreakdown).map(([w,U])=>({model:w,...U})).sort((w,U)=>U.cost-w.cost):Cy(v),M=v.reduce((w,U)=>w+(U.inputTokens||0),0),z=v.reduce((w,U)=>w+(U.outputTokens||0),0),O=v.reduce((w,U)=>w+(U.cacheReadTokens||0),0),N=v.reduce((w,U)=>w+(U.cacheWriteTokens||0),0),C=M+z+O+N;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.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:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Claude Code Usage"}),n.jsx("span",{className:"text-xs text-gray-500",children:y&&h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),y&&n.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[n.jsx(ie,{label:"Subscription",variant:"info"}),n.jsxs("span",{className:"text-xs text-gray-300",children:[h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan. `:"","Costs shown as API-equivalent value for usage analytics."]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:y?"API-Equivalent Value":"Total Cost",value:`$${h.totalCost.toFixed(2)}`,subtitle:y&&h.billingContext?.monthlyAmount?`Your plan: $${h.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),n.jsx(ne,{title:y?"Cache Efficiency":"Cache Savings",value:`$${h.totalSavings.toFixed(2)}`,subtitle:y?"API-equivalent savings from cache":void 0,color:"emerald"}),n.jsx(ne,{title:"Total Tokens",value:Zl(h.totalTokens),subtitle:Ty(h.totalTokens),color:"indigo"}),n.jsx(ne,{title:"Sessions",value:h.sessionCount.toLocaleString(),color:"cyan"})]}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["overview","sessions"].map(w=>n.jsx("button",{onClick:()=>o(w),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===w?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:w==="overview"?"Breakdown":`Sessions (${v.length})`},w))}),r==="overview"&&n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:y?"Usage Value by Model":"Cost by Model"}),T.length>0?n.jsx(Tx,{items:T.map(w=>({label:w.model,value:parseFloat(w.cost.toFixed(2)),color:"#f59e0b"}))}):n.jsx("p",{className:"text-gray-600 text-xs",children:"No model data"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Token Breakdown"}),n.jsxs("div",{className:"space-y-3",children:[n.jsx(Nr,{label:"Input",value:M,total:C,color:"bg-indigo-500"}),n.jsx(Nr,{label:"Output",value:z,total:C,color:"bg-cyan-500"}),O>0&&n.jsx(Nr,{label:"Cache Read",value:O,total:C,color:"bg-emerald-500"}),N>0&&n.jsx(Nr,{label:"Cache Write",value:N,total:C,color:"bg-amber-500"})]})]}),T.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden lg:col-span-2",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Model Details"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tokens"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Avg/Session"})]})}),n.jsx("tbody",{children:T.map(w=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:w.model}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:w.sessions.toLocaleString()}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(w.tokens)}),n.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",w.cost.toFixed(2)]}),n.jsxs("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:["$",w.sessions>0?(w.cost/w.sessions).toFixed(4):"0"]})]},w.model))})]})]})]}),r==="sessions"&&n.jsx(Ey,{sessions:v,expandedSession:u,onToggle:w=>c(u===w?null:w)}),n.jsx("div",{className:"text-center py-4 border-t border-gray-800/50",children:n.jsx("span",{className:"text-xs text-gray-600",children:"More providers coming soon"})})]})}const iu=37,Q0=160,Z0=5;function Ey({sessions:r,expandedSession:o,onToggle:u}){const c=b.useRef(null),[f,x]=b.useState(0),h=b.useCallback(()=>{c.current&&x(c.current.scrollTop)},[]),j=b.useMemo(()=>r.map(O=>(O.sessionId||"-")===o?Q0:iu),[r,o]),p=b.useMemo(()=>{const O=[];let N=0;for(const C of j)O.push(N),N+=C;return O},[j]),m=p.length>0?p[p.length-1]+j[j.length-1]:0,v=Math.min(m,iu*20),y=b.useMemo(()=>{if(r.length===0)return{start:0,end:0};const O=f,N=f+v;let C=0,w=r.length-1;for(;C<w;){const V=C+w>>1;p[V]+j[V]<=O?C=V+1:w=V}const U=Math.max(0,C-Z0);for(C=U,w=r.length-1;C<w;){const V=C+w+1>>1;p[V]>=N?w=V-1:C=V}const J=Math.min(r.length,C+Z0+1);return{start:U,end:J}},[f,v,r.length,p,j]);if(b.useEffect(()=>{if(!o||!c.current)return;const O=r.findIndex(U=>(U.sessionId||"-")===o);if(O<0)return;const N=p[O],C=N+Q0,w=c.current;C>w.scrollTop+v?w.scrollTop=C-v:N<w.scrollTop&&(w.scrollTop=N)},[o,r,p,v]),r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No session data available"})});const T=r.slice(y.start,y.end),M=y.start>0?p[y.start]:0,z=y.end<r.length?m-p[y.end]:0;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"}),n.jsxs("span",{className:"text-xs text-gray-500",children:[r.length," sessions"]})]}),n.jsx("table",{className:"w-full table-fixed",children:n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-8"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Input"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Output"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cache"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"When"})]})})}),n.jsx("div",{ref:c,onScroll:h,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${v}px`},children:n.jsxs("div",{style:{height:`${m}px`,position:"relative"},children:[M>0&&n.jsx("div",{style:{height:`${M}px`}}),n.jsx("table",{className:"w-full table-fixed",children:n.jsx("tbody",{children:T.map(O=>{const N=O.sessionId||"-",C=o===N,w=(O.cacheReadTokens||0)+(O.cacheWriteTokens||0);return n.jsxs(b.Fragment,{children:[n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${iu}px`},onClick:()=>u(N),children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 w-8",children:n.jsx("span",{className:`inline-block transition-transform ${C?"rotate-90":""}`,children:"▸"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:N.slice(0,8)}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(ie,{label:O.model||"unknown",variant:"default"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(O.inputTokens)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(O.outputTokens)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:w>0?Zl(w):"-"}),n.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",O.cost?.toFixed(4)||"0.0000"]}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:O.duration?K0(O.duration):"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:wy(O.timestamp)})]}),C&&n.jsx("tr",{className:"border-b border-gray-800/50",children:n.jsx("td",{colSpan:9,className:"px-6 py-3 bg-gray-800/20",children:n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Input Tokens"}),n.jsx("span",{className:"text-gray-300 font-mono",children:O.inputTokens.toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Output Tokens"}),n.jsx("span",{className:"text-gray-300 font-mono",children:O.outputTokens.toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Write"}),n.jsx("span",{className:"text-gray-300 font-mono",children:(O.cacheWriteTokens||0).toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Read"}),n.jsx("span",{className:"text-gray-300 font-mono",children:(O.cacheReadTokens||0).toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cost"}),n.jsxs("span",{className:"text-amber-400 font-mono",children:["$",O.cost?.toFixed(6)||"0"]})]}),O.savings!=null&&O.savings>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Savings"}),n.jsxs("span",{className:"text-emerald-400 font-mono",children:["$",O.savings.toFixed(6)]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Duration"}),n.jsx("span",{className:"text-gray-300",children:O.duration?K0(O.duration):"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Session ID"}),n.jsx("span",{className:"text-gray-400 font-mono text-[10px]",children:O.sessionId})]})]})})})]},N)})})}),z>0&&n.jsx("div",{style:{height:`${z}px`}})]})})]})}function Nr({label:r,value:o,total:u,color:c}){const f=u>0?o/u*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 n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-xs text-gray-500",children:[Zl(o)," (",f.toFixed(1),"%)"]})]}),n.jsx("div",{className:"h-2 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${f}%`,backgroundColor:x[c]||c}})})]})}function Cy(r){const o=new Map;for(const u of r){const c=u.model||"unknown",f=o.get(c)||{cost:0,tokens:0,sessions:0};f.cost+=u.cost||0,f.tokens+=(u.inputTokens||0)+(u.outputTokens||0),f.sessions++,o.set(c,f)}return Array.from(o.entries()).map(([u,c])=>({model:u,...c})).sort((u,c)=>c.cost-u.cost)}function Zl(r){return r?r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r):"0"}function Ty(r){return r?r.toLocaleString():"0"}function K0(r){const o=Math.round(r);if(o<60)return`${o}s`;const u=Math.floor(o/60),c=o%60;return u<60?`${u}m ${c}s`:`${Math.floor(u/60)}h ${u%60}m`}function wy(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function Mr(){const[r,o]=b.useState(!1),[u,c]=b.useState(null),[f,x]=b.useState(null),[h,j]=b.useState([]),[p,m]=b.useState("idle"),v=b.useRef(null),y=b.useRef(null);Ue("command-output",z=>{const O=z;y.current&&O.executionId===y.current&&O.line&&j(N=>[...N,O.line])}),Ue("command-complete",z=>{const O=z;if(y.current&&O.executionId===y.current){if(v.current&&(clearTimeout(v.current),v.current=null),o(!1),O.exitCode===0)m("success"),j(N=>[...N,"Command completed successfully."]);else{m("error");const N=`Command failed (exit code ${O.exitCode??"unknown"})`;x(N),j(C=>[...C,N])}y.current=null}}),b.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const T=b.useCallback(async(z,O)=>{const N=O?.queryParams,C=O?.timeoutMs??6e4;o(!0),x(null),j([`> specweave ${z}${N?` (${Object.values(N).join(", ")})`:""}`]),m("running");try{const w=N?"?"+new URLSearchParams(N).toString():"",J=await(await fetch(`/api/commands/${z}${w}`,{method:"POST"})).json();if(!J.ok)return x(J.error||"Command failed"),m("error"),j(ae=>[...ae,`Error: ${J.error||"Command failed"}`]),o(!1),null;c(J.data),y.current=J.data?.id||null;const V=Math.round(C/1e3);return v.current=setTimeout(()=>{y.current&&(y.current=null,o(!1),m("error"),x(`Command timed out after ${V} seconds`),j(ae=>[...ae,`Timed out after ${V} seconds.`]))},C),J.data}catch(w){return x(String(w)),m("error"),j(U=>[...U,`Error: ${String(w)}`]),o(!1),null}},[]),M=b.useCallback(()=>{o(!1),c(null),x(null),j([]),m("idle"),y.current=null,v.current&&(clearTimeout(v.current),v.current=null)},[]);return{execute:T,running:r,result:u,error:f,output:h,status:p,reset:M}}function Ay(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"}}function My(){const[r,o]=b.useState("health"),[u,c]=b.useState(null),[f,x]=b.useState(0),[h,j]=b.useState([]);Ue("sync-update",()=>x(H=>H+1)),Ue("sync-error",()=>x(H=>H+1));const{data:p,loading:m,error:v,refetch:y}=we(`/api/sync/status?_r=${f}`);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(()=>{})},[f]);const{data:T,loading:M}=we(`/api/sync/audit?limit=100&_r=${f}`),{data:z,loading:O}=we(`/api/sync/audit/summary?_r=${f}`),{execute:N,running:C}=Mr(),w=async(H,W)=>{const I=W?`${W}-${H}`:H;c(I);try{const Ee=new URLSearchParams(window.location.search).get("project")||"",He=new URLSearchParams;He.set("platform",H),W&&He.set("repo",W),Ee&&He.set("project",Ee);const _e=new AbortController,je=setTimeout(()=>_e.abort(),3e4);await fetch(`/api/sync/verify?${He.toString()}`,{method:"POST",signal:_e.signal}),clearTimeout(je),y()}catch{}c(null)};if(m||M||O)return n.jsx(Ie,{});if(v)return n.jsx($t,{message:v,onRetry:y});if(!p)return null;const U=T?.length||0,J=T?.filter(H=>H.result==="error").length||0,V=T?.filter(H=>H.conflict)||[],ae=p.isUmbrella&&p.repos&&p.repos.length>0;let Z=0,K=0;if(ae&&p.repos)for(const H of p.repos){const W=Object.values(H.platforms).filter(I=>I.connectionStatus!=="not_configured");K+=W.length,Z+=W.filter(I=>I.connectionStatus==="connected").length}else{const H=Object.entries(p.platforms).filter(([W])=>["github","jira","ado"].includes(W));K=H.length,Z=H.filter(([,W])=>W.connectionStatus==="connected").length}return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Sync Health"}),!ae&&n.jsx("button",{onClick:()=>N("sync-push"),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?"Syncing...":"Sync Now"})]}),p.permissions&&n.jsx(zy,{permissions:p.permissions,onSave:y}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:ae?"Repos":"Platforms",value:ae?p.repos.length:K,subtitle:`${Z} connected`,color:"indigo"}),n.jsx(ne,{title:"Audit Entries",value:U,color:"cyan"}),n.jsx(ne,{title:"Errors",value:J,color:"rose"}),n.jsx(ne,{title:"Conflicts",value:V.length,color:"amber"})]}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["health","audit","conflicts"].map(H=>n.jsx("button",{onClick:()=>o(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 (${V.length})`},H))}),r==="health"&&n.jsx(n.Fragment,{children:ae&&p.repos?n.jsx(_y,{repos:p.repos,auditSummary:z,verifying:u,onVerify:w,execute:N,running:C}):n.jsx(Dy,{platforms:p.platforms,auditSummary:z,verifying:u,onVerify:w})}),r==="health"&&h.length>0&&n.jsx(Oy,{errors:h}),r==="audit"&&n.jsx(J0,{entries:T||[]}),r==="conflicts"&&n.jsx(J0,{entries:V}),p.lastUpdated&&n.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(p.lastUpdated).toLocaleString()]})]})}function zy({permissions:r,onSave:o}){const[u,c]=b.useState(r),[f,x]=b.useState(!1),[h,j]=b.useState(null),p=JSON.stringify(u)!==JSON.stringify(r),m=async()=>{x(!0),j(null);try{const y=new URLSearchParams(window.location.search).get("project")||"",T=y?`?project=${y}`:"",M=await fetch(`/api/config${T}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:u}})});if(M.ok)o();else{const z=await M.json().catch(()=>({}));j(z.error||`Save failed (HTTP ${M.status})`)}}catch(y){j(String(y))}x(!1)},v=[{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 n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Sync Permissions"}),p&&n.jsx("button",{onClick:m,disabled:f,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:f?"Saving...":"Save"})]}),h&&n.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",h]}),n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:v.map(({key:y,label:T,desc:M})=>n.jsxs("button",{onClick:()=>c(z=>({...z,[y]:!z[y]})),className:`text-left p-2.5 rounded-lg border transition-colors ${u[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:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${u[y]?"bg-emerald-400":"bg-gray-600"}`}),n.jsx("span",{className:"text-xs font-medium text-gray-300",children:T})]}),n.jsx("p",{className:"text-[10px] text-gray-500 leading-tight",children:M})]},y))})]})}function _y({repos:r,auditSummary:o,verifying:u,onVerify:c,execute:f,running:x}){return r.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No child repositories configured"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Add repos in umbrella.childRepos in config.json"})]}):n.jsx("div",{className:"space-y-4",children:r.map(h=>{const p=Object.entries(h.platforms).filter(([m])=>["github","jira","ado"].includes(m)).filter(([,m])=>m.connectionStatus!=="not_configured");return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium text-gray-200",children:h.repoName}),h.hasSpecweave&&n.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-emerald-500/15 text-emerald-400 rounded",children:".specweave"}),!h.hasSpecweave&&n.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-gray-700/50 text-gray-500 rounded",children:"no .specweave"})]}),n.jsx("span",{className:"text-[10px] text-gray-600",children:h.repoPath})]}),n.jsx("button",{onClick:()=>f("sync-push",{queryParams:{repo:h.repoId}}),disabled:x||!h.hasSpecweave,title:h.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?n.jsxs("div",{className:"text-xs text-gray-600 p-3 bg-gray-800/20 rounded-lg",children:["No platforms configured for this repository.",n.jsx(st,{to:"/config",className:"ml-1 text-indigo-400 hover:text-indigo-300",children:"Configure"})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:p.map(([m,v])=>n.jsx(wx,{platform:m,info:v,summary:o?.[m],verifying:u===`${h.repoId}-${m}`,onVerify:()=>c(m,h.repoId)},m))})]},h.repoId)})})}function Dy({platforms:r,auditSummary:o,verifying:u,onVerify:c}){const f=Object.entries(r).filter(([x])=>["github","jira","ado"].includes(x));return f.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No sync platforms configured"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Configure GitHub, JIRA, or ADO in your config"})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(([x,h])=>n.jsx(wx,{platform:x,info:h,summary:o?.[x],verifying:u===x,onVerify:()=>c(x)},x))})}function wx({platform:r,info:o,summary:u,verifying:c,onVerify:f}){const x=o.connectionStatus||"unknown";return n.jsxs("div",{className:"bg-gray-800/30 border border-gray-800/50 rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ax,{platform:r}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:r}),o.configDetail&&n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:o.configDetail})]})]}),n.jsx(ie,{label:Ry(x),variant:Ay(x)})]}),o.diagnosticMessage&&n.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:o.diagnosticMessage}),x==="not_configured"&&n.jsx(st,{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"&&n.jsx("button",{onClick:f,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"&&n.jsx("button",{onClick:f,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"}),n.jsxs("div",{className:"space-y-2 mt-3",children:[o.lastImport&&n.jsx(Xl,{label:"Last Import",value:new Date(o.lastImport).toLocaleString()}),x==="connected"&&!o.lastImport&&n.jsx(Xl,{label:"Status",value:"Connected, no imports yet"}),o.lastImportCount!=null&&o.lastImportCount>0&&n.jsx(Xl,{label:"Items Imported",value:o.lastImportCount.toLocaleString()}),o.lastSkippedCount!=null&&o.lastSkippedCount>0&&n.jsx(Xl,{label:"Skipped",value:o.lastSkippedCount.toLocaleString()}),u&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"border-t border-gray-800 my-2"}),n.jsx(Xl,{label:"Total Ops",value:u.total.toLocaleString()}),n.jsx(Xl,{label:"Success",value:u.success.toLocaleString()}),u.errors>0&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:"Errors"}),n.jsx(ie,{label:String(u.errors),variant:"error"})]})]})]})]})}function Oy({errors:r}){const[o,u]=b.useState(null);return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Errors (last 24h)"}),n.jsx("div",{className:"space-y-2",children:r.map((c,f)=>{const x=`${c.provider}-${c.incrementId}-${f}`,h=o===x;return n.jsxs("div",{children:[n.jsxs("button",{"data-testid":`sync-error-row-${f}`,onClick:()=>u(h?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:[n.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400 shrink-0"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-300 capitalize",children:c.provider}),n.jsx(ie,{label:c.incrementId,variant:"default"}),n.jsx(ie,{label:c.outcome,variant:"error"})]}),n.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:c.error}),n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Rx(c.timestamp)})]}),n.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:h?"▲":"▼"})]}),h&&n.jsxs("div",{"data-testid":`sync-error-detail-${f}`,className:"mt-1 p-3 bg-gray-800/30 rounded-lg border border-gray-800/50",children:[n.jsx("div",{className:"text-xs text-gray-400 mb-2 font-medium",children:"Full Error"}),n.jsx("pre",{className:"text-xs text-gray-500 whitespace-pre-wrap font-mono mb-2",children:c.error}),c.errorStack&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-xs text-gray-400 mb-1 font-medium",children:"Stack Trace"}),n.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 J0({entries:r}){const[o,u]=b.useState(null);if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No audit entries"})});const c={success:"success",error:"error",denied:"warning",skipped:"default"};return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Time"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Platform"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Operation"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Item"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Direction"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Result"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"})]})}),n.jsx("tbody",{children:r.map((f,x)=>{const h=!!f.message,j=o===x;return n.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 ${h?"cursor-pointer":""}`,onClick:()=>h&&u(j?null:x),children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Rx(f.timestamp)}),n.jsx("td",{className:"px-4 py-2",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Ax,{platform:f.platform}),n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:f.platform})]})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:f.operation}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:f.itemId||"-"}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(ie,{label:f.direction,variant:f.direction==="push"?"info":"default"})}),n.jsx("td",{className:"px-4 py-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ie,{label:f.result,variant:c[f.result]||"default"}),h&&n.jsx("span",{className:"text-[10px] text-gray-600",children:j?"▲":"▼"})]})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:f.duration?`${f.duration}ms`:"-"})]},x)})})]}),o!==null&&r[o]?.message&&n.jsx("div",{className:"border-t border-gray-800 px-4 py-3 bg-gray-800/20",children:n.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-mono max-h-40 overflow-y-auto",children:r[o].message})})]})}function Xl({label:r,value:o}){return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:r}),n.jsx("span",{className:"text-xs text-gray-400",children:o})]})}function Ax({platform:r}){const o={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return n.jsx("div",{className:`w-5 h-5 rounded ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:n.jsx("span",{className:"text-[9px] text-white font-bold",children:r[0]?.toUpperCase()})})}function Rx(r){if(!r)return"-";try{const o=new Date(r).getTime();if(isNaN(o))return"-";const u=Date.now()-o,c=Math.floor(u/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const f=Math.floor(c/60);return f<24?`${f}h ago`:`${Math.floor(f/24)}d ago`}catch{return"-"}}const Mx={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},Fn=50;function Uy(){const[r,o]=Ut("tab","groups"),[u,c]=Ut("type",""),[f,x]=Ut("q",""),[h,j]=Ut("session",""),[p,m]=b.useState(0),[v,y]=b.useState(f),T=p*Fn,M=u?`&type=${encodeURIComponent(u)}`:"",z=f?`&search=${encodeURIComponent(f)}`:"",[O,N]=b.useState(0);Ue("error-detected",()=>N(ee=>ee+1));const{data:C,loading:w,error:U}=we(r==="groups"?`/api/errors/groups?_r=${O}`:""),{data:J,loading:V,error:ae}=we(r==="errors"||r==="groups"?`/api/errors/recent?limit=${Fn}&offset=${T}${M}${z}&_r=${O}`:""),{data:Z,loading:K,error:H}=we(r==="sessions"||h?`/api/errors/sessions?limit=50&_r=${O}`:""),{data:W,loading:I,error:Ee}=we(r==="timeline"?`/api/errors/timeline?bucket=60&_r=${O}`:""),He=b.useCallback(()=>{x(v.trim()),m(0),v.trim()&&o("errors")},[v,x,o]);b.useEffect(()=>{h&&Z&&!Z.find(ee=>ee.sessionId===h)&&j("")},[h,Z,j]);const _e=r==="groups"&&w||r==="errors"&&V||r==="timeline"&&I||r==="sessions"&&K,je=U||ae||(r==="sessions"?H:null)||(r==="timeline"?Ee:null),k=J?.total||0,X=J?.errors||[],se=C?.length||0,ye=C?.reduce((ee,Ke)=>ee+Ke.sessions,0)||0,Ne=C?.[0]?.type||"-",S=h?Z?.find(ee=>ee.sessionId===h):null,$=u?(Z||[]).filter(ee=>ee.errors.some(Ke=>Ke.type===u)):Z||[],Q=Math.ceil(k/Fn),P=ee=>{c(ee),o("errors"),j(""),m(0)},ce=ee=>{o(ee),j(""),ee!=="errors"&&m(0)},fe=()=>{c(""),x(""),y(""),m(0)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Error Tracing"}),n.jsx("span",{className:"text-xs text-gray-500",children:"Observability for Claude Code sessions"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{type:"text",value:v,onChange:ee=>y(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&He(),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"}),f&&n.jsx("button",{onClick:()=>{x(""),y(""),m(0)},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 text-xs",children:"clear"})]}),n.jsx("button",{onClick:He,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors",children:"Search"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Total Errors",value:k,color:"rose"}),n.jsx(ne,{title:"Error Types",value:se,color:"amber"}),n.jsx(ne,{title:"Affected Sessions",value:ye,color:"indigo"}),n.jsx(ne,{title:"Most Common",value:Ne,color:"cyan"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["groups","errors","timeline","sessions"].map(ee=>n.jsx("button",{onClick:()=>ce(ee),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===ee?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:ee==="groups"?"Error Groups":ee==="errors"?"All Errors":ee==="timeline"?"Timeline":"Sessions"},ee))}),(u||f)&&n.jsxs("div",{className:"flex items-center gap-2",children:[u&&n.jsx(ie,{label:`type: ${u.replace(/_/g," ")}`,variant:"info"}),f&&n.jsx(ie,{label:`search: ${f.slice(0,20)}`,variant:"default"}),n.jsx("button",{onClick:fe,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),je&&n.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-3 flex items-center justify-between",children:[n.jsx("div",{className:"text-sm text-rose-300",children:je}),n.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"})]}),h&&S&&n.jsx(qy,{session:S,onClose:()=>j("")}),_e&&!h&&n.jsx(Ie,{}),!h&&!_e&&r==="groups"&&n.jsx(Ly,{groups:C||[],onGroupClick:P}),!h&&!_e&&r==="errors"&&n.jsx(Hy,{errors:X,total:k,page:p,totalPages:Q,onPageChange:m,onSessionClick:ee=>{j(ee),o("sessions")}}),!h&&!_e&&r==="timeline"&&n.jsx(By,{buckets:W||[],errors:X,onSessionClick:ee=>j(ee)}),!h&&!_e&&r==="sessions"&&n.jsx(ky,{sessions:$,onSelect:ee=>j(ee)}),!_e&&!je&&k===0&&!h&&n.jsx(ju,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function Ly({groups:r,onGroupClick:o}){return r.length===0?null:n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Groups"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Type"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Last Seen"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Sample Message"})]})}),n.jsx("tbody",{children:r.map(u=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2",children:n.jsx(ie,{label:u.type.replace(/_/g," "),variant:Mx[u.type]||"default"})}),n.jsx("td",{className:"px-4 py-2 text-right",children:n.jsx("button",{onClick:()=>o(u.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${u.count} errors of this type`,children:u.count})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.sessions}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.lastSeen),children:as(u.lastSeen)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:u.recentMessages[0]||"-"})]},u.type))})]})]})}function Hy({errors:r,total:o,page:u,totalPages:c,onPageChange:f,onSessionClick:x}){const[h,j]=b.useState(new Set),p=b.useCallback(y=>{j(T=>{const M=new Set(T);return M.has(y)?M.delete(y):M.add(y),M})},[]);if(r.length===0)return n.jsx(ju,{title:"No errors",description:"No errors match the current filter"});const m=u*Fn+1,v=Math.min(u*Fn+r.length,o);return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Errors ",m,"–",v," of ",o]}),c>1&&n.jsx(W0,{page:u,totalPages:c,onChange:f})]}),n.jsx("div",{className:"divide-y divide-gray-800/50",children:r.map((y,T)=>{const M=h.has(T),z=y.message.length>120;return n.jsx("div",{className:"px-4 py-3 hover:bg-gray-800/20 transition-colors",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.jsx(ie,{label:y.type.replace(/_/g," "),variant:Mx[y.type]||"default"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:`text-xs text-gray-300 ${M?"whitespace-pre-wrap break-words":"truncate"} ${z?"cursor-pointer":""}`,onClick:()=>z&&p(T),title:z?M?"Click to collapse":"Click to expand details":void 0,children:[z&&n.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:M?"▼":"▶"}),M?y.message:y.message.slice(0,200),!M&&z&&n.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),y.context?.toolName&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[n.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&&n.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:y.context.toolInput})]}),M&&n.jsx(zx,{context:y.context})]}),n.jsxs("div",{className:"flex-shrink-0 text-right",children:[n.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Kl(y.timestamp),children:as(y.timestamp)}),n.jsx("div",{className:"text-[10px] text-gray-600",children:Kl(y.timestamp)}),n.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&&n.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",y.context.messageIndex]})]})]})},`${y.sessionId}-${y.timestamp}-${T}`)})}),c>1&&n.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:n.jsx(W0,{page:u,totalPages:c,onChange:f})})]})}function zx({context:r}){if(!r)return null;const{precedingAction:o,recentTools:u}=r;return!o&&(!u||u.length===0)?null:n.jsxs("div",{className:"mt-2 p-2 bg-gray-900/60 border border-gray-800 rounded-lg space-y-1.5",children:[o&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"What preceded this error:"}),n.jsx("div",{className:"text-[11px] text-gray-400 font-mono mt-0.5",children:o})]}),u&&u.length>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Recent tool chain:"}),n.jsx("div",{className:"flex flex-col gap-0.5 mt-0.5",children:u.map((c,f)=>n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[n.jsxs("span",{className:"text-gray-600",children:[u.length-f,"."]}),n.jsx("span",{className:"font-mono text-amber-400/80",children:c.name}),c.input&&n.jsx("span",{className:"text-gray-600 font-mono truncate max-w-sm",children:c.input})]},f))})]})]})}function W0({page:r,totalPages:o,onChange:u}){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>u(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"}),n.jsxs("span",{className:"text-[10px] text-gray-500 px-2",children:[r+1," / ",o]}),n.jsx("button",{onClick:()=>u(Math.min(o-1,r+1)),disabled:r>=o-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 By({buckets:r,errors:o,onSessionClick:u}){const[c,f]=b.useState(null),x=Math.max(...r.map(m=>m.count),1),h={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?o.filter(m=>{const v=new Date(m.timestamp).getTime();return v>=new Date(c.start).getTime()&&v<new Date(c.end).getTime()}):o,p=m=>{try{return new Date(m).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return m}};return n.jsxs("div",{className:"space-y-4",children:[r.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Density (per hour)"}),c&&n.jsx("button",{onClick:()=>f(null),className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"Clear filter"})]}),n.jsx("div",{className:"flex items-end gap-px h-24",children:r.map((m,v)=>{const y=m.count/x*100,T=c?.start===m.start;return n.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>f(T?null:m),title:`${p(m.start)}: ${m.count} errors`,children:n.jsx("div",{className:`w-full min-h-[2px] rounded-t transition-all ${T?"bg-indigo-400":"bg-rose-500/70 group-hover:bg-rose-400"}`,style:{height:`${Math.max(y,2)}%`}})},v)})}),n.jsxs("div",{className:"flex justify-between mt-1",children:[n.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[0].start):""}),n.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[r.length-1].start):""})]}),n.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(h).map(([m,v])=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${v}`}),n.jsx("span",{className:"text-[9px] text-gray-600",children:m.replace(/_/g," ")})]},m))})]}),c&&n.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",j.length," errors from ",p(c.start)]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:c?"Filtered Errors":"Recent Errors"}),n.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-y-auto custom-scrollbar",children:[j.length===0&&n.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),j.slice(0,100).map((m,v)=>n.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>u(m.sessionId),children:[n.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${h[m.type]||"bg-gray-500"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:m.type.replace(/_/g," ")}),m.context?.toolName&&n.jsx("span",{className:"text-[10px] font-mono px-1 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:m.context.toolName}),n.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(m.timestamp)}),n.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(m.timestamp)})]}),n.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:m.message}),m.context?.precedingAction&&n.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",m.context.precedingAction]})]})]},v))]})]})]})}function ky({sessions:r,onSelect:o}){return r.length===0?null:n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Branch"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Messages"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tool Calls"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Errors"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Started"})]})}),n.jsx("tbody",{children:r.map(u=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>o(u.sessionId),children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:u.sessionId.slice(0,8)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:u.gitBranch||"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.messageCount}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.toolCallCount}),n.jsx("td",{className:"px-4 py-2 text-right",children:u.errors.length>0?n.jsx(ie,{label:String(u.errors.length),variant:"error"}):n.jsx("span",{className:"text-xs text-gray-600",children:"0"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.startTime),children:as(u.startTime)})]},u.sessionId))})]})]})}function qy({session:r,onClose:o}){const[u,c]=b.useState(new Set),f=x=>{c(h=>{const j=new Set(h);return j.has(x)?j.delete(x):j.add(x),j})};return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Session: ",n.jsx("span",{className:"font-mono",children:r.sessionId.slice(0,12)})]}),n.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",r.version," | ",r.gitBranch," | ",r.messageCount," messages | ",r.toolCallCount," tool calls"]})]}),n.jsx("button",{onClick:o,className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:"Back"})]}),n.jsxs("div",{className:"flex gap-3 mb-4",children:[n.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(r.startTime).toLocaleString()]}),r.endTime&&n.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(r.endTime).toLocaleString()]})]}),r.errors.length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No errors in this session"}):n.jsx("div",{className:"space-y-2",children:r.errors.map((x,h)=>{const j=u.has(h),p=x.message.length>150;return n.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border-l-2 border-rose-500/50",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(ie,{label:x.type.replace(/_/g," "),variant:"error"}),x.context?.toolName&&n.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}),n.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(x.timestamp)}),n.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(x.timestamp)})]}),n.jsxs("div",{className:`text-xs text-gray-400 ${j?"whitespace-pre-wrap break-words":""} ${p?"cursor-pointer":""}`,onClick:()=>p&&f(h),title:p?j?"Click to collapse":"Click to expand":void 0,children:[p&&n.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&&n.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),x.context?.toolInput&&n.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&&n.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",x.context.messageIndex]}),j&&n.jsx(zx,{context:x.context})]},h)})})]})}function Kl(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function as(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 $y=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],Yy=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function Gy(){const[r,o]=Ut("category","all"),[u,c]=Ut("severity","all"),f=r||"all",x=u||"all",[h,j]=b.useState([]),[p,m]=b.useState(200),[v,y]=b.useState(null),T=new URLSearchParams;T.set("limit",String(p)),f!=="all"&&T.set("categories",f),x!=="all"&&T.set("severity",x);const{data:M,loading:z}=we(`/api/activity/stream?${T.toString()}`),O=b.useCallback(H=>{j(W=>[H,...W].slice(0,50))},[]);if(Ue("activity",O),z)return n.jsx(Ie,{});const N=[...h,...M||[]],C=new Set,w=[];for(const H of N){const W=`${H.timestamp}:${H.title}`;C.has(W)||(C.add(W),w.push(H))}const U=w.filter(H=>!(f!=="all"&&H.category!==f||x!=="all"&&H.severity!==x)),J=w.filter(H=>H.severity==="error").length,V=w.filter(H=>H.severity==="warning").length,ae=new Set(w.map(H=>H.source)),Z=H=>{y(W=>W===H?null:H)},K=()=>{m(H=>H+200)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Activity Stream"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 pulse-dot"}),n.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Total Events",value:w.length,color:"indigo"}),n.jsx(ne,{title:"Errors",value:J,color:"rose"}),n.jsx(ne,{title:"Warnings",value:V,color:"amber"}),n.jsx(ne,{title:"Sources",value:ae.size,color:"cyan"})]}),n.jsxs("div",{className:"flex flex-wrap gap-4",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:$y.map(H=>n.jsx("button",{onClick:()=>o(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${f===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:Yy.map(H=>n.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))}),n.jsxs("span",{className:"text-xs text-gray-500 self-center",children:[U.length," events"]})]}),n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl divide-y divide-gray-800/50",children:U.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No events match filters"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Try adjusting category or severity filters"})]}):n.jsxs(n.Fragment,{children:[U.slice(0,p).map((H,W)=>{const I=`${H.timestamp}-${W}`,Ee=v===I;return n.jsx(Vy,{event:H,isExpanded:Ee,onToggle:()=>Z(I)},I)}),U.length>=p&&n.jsx("div",{className:"p-4 text-center",children:n.jsx("button",{onClick:K,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 Vy({event:r,isExpanded:o,onToggle:u}){const c=r.severity==="error"?"bg-rose-400":r.severity==="warning"?"bg-amber-400":"bg-gray-600",f={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 n.jsxs("div",{children:[n.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${x?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:x?u:void 0,children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-2 flex-shrink-0 ${c}`}),n.jsx("div",{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-gray-500",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:f[r.category]||f.command})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm text-gray-300",children:r.title}),n.jsx(ie,{label:r.category,variant:Rr(r.severity)})]}),r.detail&&!o&&n.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:r.detail}),r.source&&n.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",r.source]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.timestamp&&n.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:Xy(r.timestamp)}),x&&n.jsx("svg",{className:`w-4 h-4 text-gray-600 transition-transform duration-200 ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),o&&n.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[r.detail&&n.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Detail"}),n.jsx("p",{className:"text-xs text-gray-300 whitespace-pre-wrap",children:r.detail})]}),r.metadata&&Object.keys(r.metadata).length>0&&n.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Metadata"}),n.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(r.metadata,null,2)})]})]})]})}function Xy(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Qy(){const[r,o]=b.useState(0);Ue("config-changed",()=>o(K=>K+1));const{data:u,loading:c,error:f,refetch:x}=we(`/api/config?_r=${r}`),{activeProject:h}=rl(),[j,p]=b.useState(new Set),[m,v]=b.useState({}),[y,T]=b.useState(!1),[M,z]=b.useState(null),[O,N]=b.useState([]);if(c)return n.jsx(Ie,{});if(f)return n.jsx($t,{message:f,onRetry:x});if(!u)return null;const C=K=>{p(H=>{const W=new Set(H);return W.has(K)?W.delete(K):W.add(K),W})},w=Object.keys(m).length>0,U=(K,H)=>{v(W=>({...W,[K]:H})),N(W=>W.filter(I=>I.path!==K))},J=async()=>{if(w){T(!0),z(null),N([]);try{const K={};for(const[_e,je]of Object.entries(m))Ky(K,_e,je);const H=h?`?project=${h.id}`:"",I=await(await fetch(`/api/config/validate${H}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();if(I.errors&&I.errors.length>0){N(I.errors),z("Validation failed. Fix errors before saving."),T(!1);return}const He=await(await fetch(`/api/config${H}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();He.ok?(z("Saved successfully"),v({}),N([]),x(),setTimeout(()=>z(null),3e3)):z(`Error: ${He.error}`)}catch(K){z(`Error: ${K}`)}finally{T(!1)}}},V=()=>{v({}),z(null),N([])},ae=Object.entries(u).filter(([K,H])=>typeof H=="object"&&H!==null),Z=Object.entries(u).filter(([K,H])=>typeof H!="object"||H===null);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Configuration"}),n.jsx("span",{className:"text-xs text-gray-500",children:".specweave/config.json"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[M&&n.jsx("span",{className:`text-xs ${M.startsWith("Error")||M.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:M}),w&&n.jsxs(n.Fragment,{children:[n.jsx(ie,{label:`${Object.keys(m).length} changes`,variant:"warning"}),n.jsx("button",{onClick:V,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"}),n.jsx("button",{onClick:J,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"})]})]})]}),M&&!w&&M==="Saved successfully"&&n.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-4 py-2 flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),n.jsx("span",{className:"text-xs text-emerald-400",children:"Configuration saved successfully"})]}),O.length>0&&n.jsxs("div",{className:"bg-rose-500/10 border border-rose-500/30 rounded-lg px-4 py-3 space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-400"}),n.jsx("span",{className:"text-xs text-rose-400 font-medium",children:"Validation errors"})]}),O.map((K,H)=>n.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[n.jsx("span",{className:"font-mono text-rose-400",children:K.path}),": ",K.message]},H))]}),Z.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"General"}),n.jsx("div",{className:"space-y-3",children:Z.map(([K,H])=>n.jsx(Dx,{path:K,label:K,value:m[K]!==void 0?m[K]:H,original:H,onChange:W=>U(K,W),edited:m[K]!==void 0,validationError:O.find(W=>W.path===K)?.message},K))})]}),ae.map(([K,H])=>n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("button",{onClick:()=>C(K),className:"w-full px-5 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 capitalize",children:K}),F0(m,K)>0&&n.jsx(ie,{label:`${F0(m,K)} edited`,variant:"warning"}),O.some(W=>W.path.startsWith(K+"."))&&n.jsx(ie,{label:"errors",variant:"error"})]}),n.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${j.has(K)?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),j.has(K)&&n.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:n.jsx(_x,{data:H,path:K,edits:m,onChange:U,validationErrors:O,depth:0})})]},K))]})}function _x({data:r,path:o,edits:u,onChange:c,validationErrors:f,depth:x}){return x>4?n.jsx("span",{className:"text-xs text-gray-600",children:"..."}):n.jsx("div",{className:"space-y-3",style:{marginLeft:x>0?16:0},children:Object.entries(r).map(([h,j])=>{const p=`${o}.${h}`;return j&&typeof j=="object"&&!Array.isArray(j)?n.jsxs("div",{children:[n.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:h}),n.jsx(_x,{data:j,path:p,edits:u,onChange:c,validationErrors:f,depth:x+1})]},h):n.jsx(Dx,{path:p,label:h,value:u[p]!==void 0?u[p]:j,original:j,onChange:m=>c(p,m),edited:u[p]!==void 0,validationError:f.find(m=>m.path===p)?.message},h)})})}function Dx({path:r,label:o,value:u,original:c,onChange:f,edited:x,validationError:h}){return typeof c=="boolean"||typeof u=="boolean"?n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("button",{onClick:()=>f(!u),className:`relative w-9 h-5 rounded-full transition-colors ${u?"bg-indigo-600":"bg-gray-700"} ${x?"ring-1 ring-amber-500/50":""}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-transform ${u?"left-[18px]":"left-0.5"}`})})]}),h&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:h})]}):typeof c=="number"||typeof u=="number"?n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("input",{type:"number",value:String(u??""),onChange:j=>f(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 ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]}):Array.isArray(c)||Array.isArray(u)?n.jsx(Zy,{path:r,label:o,value:Array.isArray(u)?u:Array.isArray(c)?c:[],edited:x,onChange:f,validationError:h}):n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("input",{type:"text",value:String(u??""),onChange:j=>f(j.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]})}function Zy({path:r,label:o,value:u,edited:c,onChange:f,validationError:x}){const[h,j]=b.useState(!1),[p,m]=b.useState(""),v=M=>{const z=[...u];z.splice(M,1),f(z)},y=()=>{const M=p.trim();M&&(f([...u,M]),m(""))},T=M=>{M.key==="Enter"&&(M.preventDefault(),y())};return n.jsxs("div",{className:"py-1",children:[n.jsxs("button",{onClick:()=>j(M=>!M),className:"flex items-center justify-between w-full group",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsxs("div",{className:"flex items-center gap-2",children:[c&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),n.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["[",u.length," items]"]}),n.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),h&&n.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[u.length===0&&n.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),u.map((M,z)=>n.jsxs("div",{className:"flex items-center gap-2 group/item",children:[n.jsx("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",children:String(M)}),n.jsx("button",{onClick:()=>v(z),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},z)),n.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[n.jsx("input",{type:"text",value:p,onChange:M=>m(M.target.value),onKeyDown:T,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"}),n.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&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:x})]})}function F0(r,o){return Object.keys(r).filter(u=>u.startsWith(o+".")).length}function Ky(r,o,u){const c=o.split(".");let f=r;for(let x=0;x<c.length-1;x++)(!f[c[x]]||typeof f[c[x]]!="object")&&(f[c[x]]={}),f=f[c[x]];f[c[c.length-1]]=u}function Nu({lines:r,status:o,onDismiss:u}){const c=b.useRef(null);return b.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[r]),r.length===0&&o==="idle"?null:n.jsxs("div",{className:"mt-4 rounded-lg bg-gray-950 border border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${o==="running"?"bg-yellow-400 animate-pulse":o==="success"?"bg-green-400":o==="error"?"bg-red-400":"bg-gray-500"}`}),n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:o==="running"?"Running...":o==="success"?"Completed":o==="error"?"Failed":"Output"})]}),o!=="running"&&u&&n.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 text-xs",children:"Dismiss"})]}),n.jsxs("div",{className:"p-3 max-h-48 overflow-y-auto font-mono text-xs text-gray-300 whitespace-pre-wrap",children:[r.map((f,x)=>n.jsx("div",{children:f},x)),n.jsx("div",{ref:c})]})]})}function Jy(){const{data:r,loading:o}=we("/api/plugins/full"),{execute:u,running:c,output:f,status:x,reset:h}=Mr(),[j,p]=b.useState(null);if(o)return n.jsx(Ie,{});const m=r?.plugins||[],v=r?.skills||[],y=r?.lsp,T=r?.warmup,M=r?.triggerCount||0,z=m.reduce((w,U)=>w+U.skillCount,0),O=m.reduce((w,U)=>w+U.commandCount,0),N=w=>v.filter(U=>U.plugin===w).sort((U,J)=>J.count-U.count),C=w=>{p(U=>U===w?null:w)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Plugins & LSP"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>u("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"}),n.jsx("button",{onClick:()=>u("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"})]})]}),n.jsx(Nu,{lines:f,status:x,onDismiss:h}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[n.jsx(qa,{label:"Plugins",value:m.length}),n.jsx(qa,{label:"Total Skills",value:z}),n.jsx(qa,{label:"Total Commands",value:O}),n.jsx(qa,{label:"Trigger Keywords",value:M})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Installed Plugins"})}),m.length===0?n.jsx("div",{className:"p-5 text-gray-500 text-xs",children:"No plugins installed"}):n.jsx("div",{className:"divide-y divide-gray-800/50",children:m.map(w=>{const U=j===w.name,J=N(w.name);return n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>C(w.name),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors text-left",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-sm text-gray-300",children:w.name}),n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:w.version})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ie,{label:`${w.skillCount} skills`,variant:"info"}),n.jsx(ie,{label:`${w.commandCount} cmds`,variant:"default"}),n.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${U?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),U&&n.jsx("div",{className:"px-4 pb-4 bg-gray-800/20",children:J.length===0?n.jsx("p",{className:"text-xs text-gray-600 py-2",children:"No skill usage data for this plugin"}):n.jsxs("div",{className:"space-y-1 mt-1",children:[n.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1",children:[n.jsx("span",{className:"text-[10px] text-gray-600 uppercase",children:"Skill"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Invocations"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Success"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Last Used"})]}),J.map(V=>n.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1.5 bg-gray-800/40 rounded",children:[n.jsx("span",{className:"text-xs text-gray-300 font-mono truncate",children:V.name}),n.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:V.count}),n.jsxs("span",{className:"text-xs text-right font-mono",children:[n.jsx("span",{className:"text-emerald-400",children:V.successCount}),V.failureCount>0&&n.jsxs("span",{className:"text-rose-400",children:["/",V.failureCount]})]}),n.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:V.lastUsed?Wy(V.lastUsed):"-"})]},V.name))]})})]},w.name)})})]}),v.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Skill Usage Leaderboard"}),n.jsx(Tx,{items:v.sort((w,U)=>U.count-w.count).slice(0,20).map(w=>({label:w.name,value:w.count,color:"#10b981"})),maxBars:20})]}),y&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Status"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ie,{label:y.status,variant:y.status==="ok"?"success":"warning"}),y.checked&&n.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(y.checked).toLocaleDateString()]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[n.jsx(qa,{label:"Total Languages",value:y.stats.totalLanguages}),n.jsx(qa,{label:"Checked",value:y.stats.checkedLanguages}),n.jsx(qa,{label:"Binary Missing",value:y.stats.binaryMissing}),n.jsx(qa,{label:"Plugin Missing",value:y.stats.pluginMissing})]}),y.missing.length>0&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),y.missing.map((w,U)=>n.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-800/50 rounded",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ie,{label:w.type,variant:w.type==="binary"?"warning":"default"}),n.jsx("span",{className:"text-xs text-gray-300",children:w.language})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-[10px] text-gray-500",children:w.binaryInstall}),w.message&&n.jsx("span",{className:"text-[10px] text-gray-600 max-w-[200px] truncate",children:w.message})]})]},U))]})]}),T&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Warmup Status"}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[T.elapsed?`${(T.elapsed/1e3).toFixed(1)}s`:""," |"," ",T.timestamp?new Date(T.timestamp).toLocaleString():""]})]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[T.warmedUp.map(w=>n.jsx(ie,{label:w,variant:"success"},w)),T.failed.map(w=>n.jsx(ie,{label:w,variant:"error"},w))]}),T.warmedUp.length===0&&T.failed.length===0&&n.jsx("p",{className:"text-gray-600 text-xs",children:"No warmup data"})]})]})}function qa({label:r,value:o}){return n.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-lg font-bold text-gray-300",children:o}),n.jsx("div",{className:"text-[10px] text-gray-500",children:r})]})}function Wy(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Fy(){const{data:r,loading:o}=we("/api/links"),{data:u,loading:c,refetch:f}=we("/api/services"),{execute:x,running:h,output:j,status:p,reset:m}=Mr();if(o||c)return n.jsx(Ie,{});const v=(u||[]).filter(N=>N.status==="running").length,y=(u||[]).length,T=new Map;for(const N of u||[])if(N.port>0&&N.status==="running"){const C=T.get(N.port)||[];C.push(N.name),T.set(N.port,C)}const M=Array.from(T.entries()).filter(([,N])=>N.length>1),z=async N=>{await x(N,{timeoutMs:3e5}),setTimeout(()=>f(),3e3)},O=async N=>{await x(N,{timeoutMs:3e5}),setTimeout(()=>f(),2e3)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Services & Links"}),n.jsx(Nu,{lines:j,status:p,onDismiss:m}),M.length>0&&n.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-4 flex items-start gap-3",children:[n.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:n.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"})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-medium text-amber-300",children:"Port Conflict Detected"}),n.jsx("div",{className:"text-xs text-amber-400/80 mt-1",children:M.map(([N,C])=>n.jsxs("span",{className:"block",children:["Port ",N," is used by: ",C.join(", ")]},N))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Services",value:y,color:"indigo",tooltip:`${y} managed services`}),n.jsx(ne,{title:"Running",value:v,color:"emerald",tooltip:`${v} services currently active`}),n.jsx(ne,{title:"External Links",value:(r||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),n.jsx(ne,{title:"Stopped",value:y-v,color:"rose",tooltip:`${y-v} services not running`})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Service Status"}),n.jsx("div",{className:"space-y-3",children:(u||[]).map((N,C)=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${N.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-gray-300",children:N.name}),n.jsx("div",{className:"text-[10px] text-gray-600",children:N.status==="running"&&N.detail?n.jsx("a",{href:N.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:N.detail}):N.detail})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[N.status==="running"&&N.port>0&&n.jsx(ie,{label:`Port ${N.port}`,variant:"info"}),N.status==="running"?n.jsx(ie,{label:"Running",variant:"success"}):n.jsx(ie,{label:"Stopped",variant:"default"}),N.startCommand&&N.stopCommand?N.status==="running"?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("a",{href:N.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"}),n.jsx("button",{onClick:()=>O(N.stopCommand),disabled:h,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"})]}):n.jsx("button",{onClick:()=>z(N.startCommand),disabled:h,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:h?"Starting...":"Start"}):N.status==="running"&&n.jsx("a",{href:N.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"})]})]},C))})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"External Links"}),(r||[]).length===0?n.jsx("p",{className:"text-xs text-gray-500",children:"No external links configured"}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(r||[]).map((N,C)=>n.jsxs("a",{href:N.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:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Py,{type:N.type}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:N.name}),n.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:N.url})]})]}),n.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:n.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"})})]},C))})]})]})}function Py({type:r}){const o={docs:"bg-indigo-600",github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return n.jsx("div",{className:`w-8 h-8 rounded-lg ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:n.jsx("span",{className:"text-xs text-white font-bold",children:r[0]?.toUpperCase()})})}const P0={critical:0,warning:1,info:2};function Iy(){const[r,o]=b.useState("pending"),[u,c]=b.useState(null),[f,x]=b.useState(0);Ue("notification",()=>x(H=>H+1));const{activeProject:h}=rl(),{data:j,loading:p,error:m,refetch:v}=we(`/api/notifications?_r=${f}`);if(p)return n.jsx(Ie,{});if(m)return n.jsx($t,{message:m,onRetry:v});const y=j||[],T=y.filter(H=>!H.dismissedAt),M=y.filter(H=>!!H.dismissedAt),z=T.filter(H=>H.severity==="critical"),O=T.filter(H=>H.severity==="warning"),C=[...r==="pending"?T:r==="dismissed"?M:y].sort((H,W)=>{const I=P0[H.severity]??3,Ee=P0[W.severity]??3;return I!==Ee?I-Ee:new Date(W.createdAt).getTime()-new Date(H.createdAt).getTime()}),w=async H=>{c(H);try{const W=h?`?project=${h.id}`:"";(await fetch(`/api/notifications/${H}/dismiss${W}`,{method:"POST"})).ok&&v()}finally{c(null)}},U=async()=>{c("__all__");try{const H=h?`?project=${h.id}`:"";for(const W of T)await fetch(`/api/notifications/${W.id}/dismiss${H}`,{method:"POST"});v()}finally{c(null)}},J=H=>H==="critical"?"error":H==="warning"?"warning":"info",V=H=>H==="critical"?"border-l-rose-500":H==="warning"?"border-l-amber-500":"border-l-blue-500",Z=(H=>{const W={};for(const I of H)W[I.severity]||(W[I.severity]=[]),W[I.severity].push(I);return W})(C),K={critical:"Critical",warning:"Warnings",info:"Informational"};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Notifications"}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Pending",value:T.length,color:"indigo"}),n.jsx(ne,{title:"Critical",value:z.length,color:"rose"}),n.jsx(ne,{title:"Warnings",value:O.length,color:"amber"}),n.jsx(ne,{title:"Dismissed",value:M.length,color:"cyan"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{value:"pending",label:`Pending (${T.length})`},{value:"dismissed",label:`Dismissed (${M.length})`},{value:"all",label:`All (${y.length})`}].map(H=>n.jsx("button",{onClick:()=>o(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))}),T.length>0&&n.jsx("button",{onClick:U,disabled:u==="__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:u==="__all__"?"Dismissing...":"Dismiss All"})]}),C.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mx-auto mb-4",children:n.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.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"})})}),n.jsx("p",{className:"text-gray-400 text-sm font-medium",children:r==="pending"?"No pending notifications":"No notifications"}),n.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"})]}):n.jsx("div",{className:"space-y-4",children:["critical","warning","info"].map(H=>{const W=Z[H];return!W||W.length===0?null:n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("h3",{className:"text-xs font-medium text-gray-400 uppercase",children:K[H]||H}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",W.length,")"]})]}),n.jsx("div",{className:"space-y-2",children:W.map(I=>n.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${V(I.severity)} rounded-xl p-4 flex items-start gap-4 ${I.dismissedAt?"opacity-60":""}`,children:[n.jsx(ev,{severity:I.severity}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-sm font-medium text-gray-200",children:I.title}),n.jsx(ie,{label:I.severity,variant:J(I.severity)}),I.type&&n.jsx(ie,{label:I.type,variant:"default"})]}),I.message&&n.jsx("p",{className:"text-xs text-gray-400 mb-2",children:I.message}),n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[n.jsx("span",{children:new Date(I.createdAt).toLocaleString()}),I.source&&n.jsxs("span",{children:["via ",I.source]}),I.dismissedAt&&n.jsxs("span",{children:["Dismissed ",new Date(I.dismissedAt).toLocaleString()]})]})]}),!I.dismissedAt&&n.jsx("button",{onClick:()=>w(I.id),disabled:u===I.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:u===I.id?"...":"Dismiss"})]},I.id))})]},H)})})]})}function ev({severity:r}){return r==="critical"?n.jsx("div",{className:"w-8 h-8 rounded-full bg-rose-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.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"?n.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.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 tv(r){if(!r)return null;if(r.startsWith("https://"))return r.replace(/\.git$/,"");const o=r.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(o)return`https://${o[1]}/${o[2]}`;const u=r.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return u?`https://${u[1]}/${u[2]}`:null}function av(){const{data:r,loading:o,error:u,refetch:c}=we("/api/repos");if(o)return n.jsx(Ie,{});if(u)return n.jsx($t,{message:u,onRetry:c});const f=r||[],x=[...new Set(f.map(p=>p.org))],h=f.filter(p=>p.hasSpecweave||p.isUmbrellaManaged).length,j=f.find(p=>p.isCurrent);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Repositories"}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Repositories",value:f.length,color:"indigo"}),n.jsx(ne,{title:"Organizations",value:x.length,color:"cyan"}),n.jsx(ne,{title:"With SpecWeave",value:h,color:"emerald"}),n.jsx(ne,{title:"Current",value:j?j.name:"-",subtitle:j?`${j.org}/${j.name}`:"No current project",color:"amber"})]}),f.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories found"}),n.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"})]}):n.jsx(n.Fragment,{children:x.map(p=>{const m=f.filter(v=>v.org===p);return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(lv,{}),n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:p}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[m.length," ",m.length===1?"repo":"repos"]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:m.map(v=>{const y=tv(v.remote);return n.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${v.isCurrent?"border-indigo-500/30":"border-gray-800"}`,children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(nv,{}),n.jsx("span",{className:"text-sm font-medium text-gray-300",children:v.name})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[v.isCurrent&&n.jsx(ie,{label:"Current Project",variant:"info"}),n.jsx(ie,{label:v.hasSpecweave?"SpecWeave":v.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:v.hasSpecweave?"success":v.isUmbrellaManaged?"info":"default"})]})]}),n.jsxs("div",{className:"space-y-1.5 mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Organization"}),n.jsx("span",{className:"text-[10px] text-gray-400",children:v.org})]}),v.branch&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),n.jsx(ie,{label:v.branch,variant:"default"})]}),y&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),n.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&&v.remote&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),n.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.remote,children:v.remote})]}),v.path&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Path"}),n.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.path,children:v.path.split("/").slice(-3).join("/")})]}),v.lastModified&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Last Modified"}),n.jsx("span",{className:"text-[10px] text-gray-400",children:rv(v.lastModified)})]})]}),y&&n.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:[n.jsx(sv,{}),"Open on GitHub"]})]},v.path||`${v.org}/${v.name}`)})})]},p)})})]})}function lv(){return n.jsx("div",{className:"w-6 h-6 rounded bg-gray-700 flex items-center justify-center",children:n.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:n.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 nv(){return n.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.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 sv(){return n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:n.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 rv(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const iv=[{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 cv(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 uv(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 I0(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function ov(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Ox(r){const o=r.tier1Result?.score??0,u=r.tier2Result?.score??0;return o&&u?Math.round((o+u)/2):o||u}function dv(r){return r>=80?"bg-emerald-500":r>=50?"bg-amber-500":"bg-rose-500"}function fv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function xv(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function ex(r){const o=Math.log10(Math.max(r.stars,1))*20,u=Ox(r);return o+u}function mv(r,o){if(o===0)return"rose";const u=r/o;return u>.5?"emerald":u>.1?"amber":"rose"}function hv(){const[r,o]=b.useState(""),[u,c]=b.useState(0),[f,x]=b.useState(0),[h,j]=b.useState(null),[p,m]=b.useState(""),{output:v,status:y,reset:T}=Mr(),M=r?`status=${r}&limit=${xa}&offset=${u}`:`limit=${xa}&offset=${u}`,{data:z,loading:O,error:N,refetch:C}=we(`/api/marketplace/scanner/status?_r=${f}`),{data:w,loading:U,refetch:J}=we(`/api/marketplace/queue?${M}&_r=${f}`),{data:V,loading:ae}=we(`/api/marketplace/verified?_r=${f}`),{data:Z,loading:K}=we(`/api/marketplace/insights?_r=${f}`),H=b.useCallback(()=>{x(S=>S+1)},[]);Ue("submission-update",b.useCallback(()=>{H()},[H])),Ue("marketplace-scan",b.useCallback(()=>{H()},[H])),Ue("verification-complete",b.useCallback(()=>{H()},[H]));const W=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",$=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/start${$}`,{method:"POST"}),C()}catch{}},I=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",$=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/stop${$}`,{method:"POST"}),C()}catch{}},Ee=async S=>{j(S);try{const $=new URLSearchParams(window.location.search).get("project")||"",Q=$?`?project=${$}`:"";await fetch(`/api/marketplace/queue/${S}/approve${Q}`,{method:"POST"}),J()}catch{}j(null)},He=async S=>{j(S);try{const $=new URLSearchParams(window.location.search).get("project")||"",Q=$?`?project=${$}`:"";await fetch(`/api/marketplace/queue/${S}/reject${Q}`,{method:"POST"}),J()}catch{}j(null)};if(O&&U&&ae&&K)return n.jsx(Ie,{});const je=w?.items||[],k=w?.total||0,X=V||[],se=Math.floor(u/xa)+1,ye=Math.ceil(k/xa),Ne=S=>S==="tier1_passed"||S==="tier2_pending";return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Marketplace Scanner"}),n.jsx("div",{className:"flex gap-2",children:z?.running?n.jsx("button",{onClick:I,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"}):n.jsx("button",{onClick: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:"Start Scanner"})})]}),n.jsx(Nu,{lines:v,status:y,onDismiss:T}),N&&n.jsx($t,{message:N,onRetry:C}),z?n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Scanner",value:z.running?"Running":"Stopped",subtitle:z.running?"Active":"Idle",color:z.running?"emerald":"amber"}),n.jsx(ne,{title:"Last Scan",value:z.lastScanTime?I0(z.lastScanTime):"Never",color:"cyan"}),n.jsx(ne,{title:"Repos Scanned",value:z.reposScanned,color:"indigo"}),n.jsx(ne,{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?mv(z.rateLimitRemaining,z.rateLimitTotal):"amber"})]}):!O&&!N?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("div",{className:"text-gray-400 text-sm mb-2",children:"No scanner data available"}),n.jsx("p",{className:"text-gray-600 text-xs mb-4",children:"Start the marketplace scanner to discover and verify community skills."}),n.jsx("button",{onClick:W,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-sm rounded-lg transition-colors",children:"Start Scanner"})]}):null,n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Submission Queue"}),n.jsxs("span",{className:"text-xs text-gray-500",children:[k," total"]})]}),n.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:iv.map(S=>n.jsx("button",{onClick:()=>{o(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))}),U?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(Ie,{})}):je.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No submissions found"}),n.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."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Repo"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Author"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Stars"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Status"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Tier"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Security"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Discovered"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Actions"})]})}),n.jsx("tbody",{children:je.map(S=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2",children:S.repoUrl?n.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}):n.jsx("span",{className:"text-xs text-gray-300 font-mono",children:S.repoFullName})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.author}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:S.stars.toLocaleString()}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(ie,{label:uv(S.status),variant:cv(S.status)})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.tier||"-"}),n.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${ov(S.securityScore)}`,children:S.securityScore!=null?S.securityScore:"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:I0(S.discoveredAt)}),n.jsx("td",{className:"px-4 py-2 text-right",children:Ne(S.status)&&n.jsxs("div",{className:"flex gap-1 justify-end",children:[n.jsx("button",{onClick:()=>Ee(S.id),disabled:h===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"}),n.jsx("button",{onClick:()=>He(S.id),disabled:h===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))})]})}),k>xa&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-800",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[u+1,"-",Math.min(u+xa,k)," of ",k]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:()=>c(Math.max(0,u-xa)),disabled:u===0,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Prev"}),n.jsxs("span",{className:"px-2 py-1 text-xs text-gray-500",children:["Page ",se," of ",ye]}),n.jsx("button",{onClick:()=>c(u+xa),disabled:u+xa>=k,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between gap-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 shrink-0",children:"Popular Skills"}),X.length>0&&n.jsxs("div",{className:"relative max-w-xs w-full",children:[n.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:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),n.jsx("input",{type:"text",placeholder:"Discover popular skills...",value:p,onChange:S=>m(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"})]})]}),ae?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(Ie,{})}):X.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No verified skills yet"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Skills will appear here after passing security verification."})]}):n.jsx(gv,{skills:X,search:p})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Insights"})}),K?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(Ie,{})}):Z?n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Discovered",value:Z.totalDiscovered,color:"cyan"}),n.jsx(ne,{title:"Verified",value:Z.totalVerified,color:"emerald"}),n.jsx(ne,{title:"Rejected",value:Z.totalRejected,color:"rose"}),n.jsx(ne,{title:"Pending",value:Z.totalPending,color:"amber"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(tx,{label:"Tier 1 Pass Rate",rate:Z.tier1PassRate}),n.jsx(tx,{label:"Tier 2 Pass Rate",rate:Z.tier2PassRate})]})]}):n.jsx("div",{className:"p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No insights data available"})})]})]})}function gv({skills:r,search:o}){const u=[...r].sort((x,h)=>ex(h)-ex(x)),c=new Set(u.slice(0,3).map(x=>x.id)),f=o?u.filter(x=>x.repoFullName.toLowerCase().includes(o.toLowerCase())||x.author.toLowerCase().includes(o.toLowerCase())):u;return f.length===0?n.jsx("div",{className:"p-8 text-center",children:n.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',o,'"']})}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:f.map(x=>n.jsx(pv,{skill:x,trending:c.has(x.id)},x.id))})}function pv({skill:r,trending:o}){const u=Ox(r),c=dv(u),f=fv(u);return n.jsxs("div",{className:"bg-gray-800/50 border border-gray-700/50 rounded-lg p-4 hover:border-gray-600 transition-colors",children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[r.repoUrl?n.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()}):n.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:r.repoFullName.split("/").pop()}),n.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r.author})]}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[o&&n.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:[n.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"]}),n.jsx(ie,{label:"Verified",variant:"success"})]})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Trust"}),n.jsx("span",{className:`text-xs font-mono font-medium ${f}`,children:u})]}),n.jsx("div",{className:"w-full h-1.5 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:n.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"})}),xv(r.stars)]}),r.repoUrl&&n.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 tx({label:r,rate:o}){const u=Math.round(o),c=u>=70?"bg-emerald-500":u>=40?"bg-amber-500":"bg-rose-500";return n.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[u,"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]})}function yv(){const{id:r}=Wg(),[o,u]=b.useState(0);Ue("increment-update",()=>u(m=>m+1));const{data:c,loading:f,error:x,refetch:h}=we(`/api/increments/${r||"_none"}?_r=${o}`);if(!r)return n.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(f)return n.jsx(Ie,{});if(x)return n.jsx($t,{message:x,onRetry:h});if(!c)return n.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 n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:c.dirName}),n.jsx(ie,{label:c.metadata.status||"unknown",variant:Rr(c.metadata.status||"")}),c.metadata.type&&n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:c.metadata.type}),c.metadata.priority&&n.jsx(vv,{priority:c.metadata.priority})]}),n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:c.metadata.title||c.id}),c.metadata.project&&n.jsxs("span",{className:"text-xs text-gray-500",children:["Project: ",c.metadata.project]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),n.jsx(ne,{title:"Task Progress",value:`${j}%`,color:"cyan"}),n.jsx(ne,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),n.jsx(ne,{title:"AC Progress",value:`${p}%`,color:"amber"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[n.jsx(ax,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),n.jsx(ax,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Tasks (",c.tasks.length,")"]})}),c.tasks.length===0?n.jsx("div",{className:"p-5 text-center text-gray-500 text-xs",children:"No tasks found in tasks.md"}):n.jsx("div",{className:"divide-y divide-gray-800/50",children:c.tasks.map(m=>n.jsxs("div",{className:"px-5 py-3 flex items-center gap-3",children:[n.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${m.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:m.status==="completed"&&n.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m.id}),n.jsx("span",{className:`text-sm ${m.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:m.title})]}),(m.userStory||m.acs)&&n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[m.userStory&&n.jsx("span",{className:"text-[10px] text-indigo-400",children:m.userStory}),m.acs?.map(v=>n.jsx("span",{className:"text-[10px] text-emerald-500",children:v},v))]})]})]},m.id))})]}),c.acs.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Acceptance Criteria (",c.acs.length,")"]})}),n.jsx("div",{className:"divide-y divide-gray-800/50",children:c.acs.map(m=>n.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[n.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 mt-0.5 ${m.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:m.completed&&n.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-xs text-emerald-500 font-mono",children:m.id}),n.jsx("span",{className:`text-sm ml-2 ${m.completed?"text-gray-500 line-through":"text-gray-300"}`,children:m.text})]})]},m.id))})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"Metadata"}),n.jsx("div",{className:"space-y-1.5",children:Object.entries(c.metadata).filter(([m])=>!["title"].includes(m)).map(([m,v])=>n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m}),n.jsx("span",{className:"text-xs text-gray-400",children:typeof v=="object"?JSON.stringify(v):String(v??"")})]},m))})]})]})}function ax({label:r,completed:o,total:u,color:c}){const f=u>0?Math.round(o/u*100):0,x=c==="emerald"?"bg-emerald-500":"bg-indigo-500";return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-xs text-gray-500",children:[o,"/",u," (",f,"%)"]})]}),n.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${x} rounded-full transition-all`,style:{width:`${f}%`}})})]})}function vv({priority:r}){const o={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 n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}const bv=["All","PreToolUse","PostToolUse","Stop","SubagentStop","TaskCompleted","UserPromptSubmit","PostToolUseFailure","PermissionRequest","SessionStart","SessionEnd","Notification","SubagentStart","ConfigChange","PreCompact","TeammateIdle"],jv=[{label:"All time",value:"0"},{label:"Last 1h",value:"3600000"},{label:"Last 6h",value:"21600000"},{label:"Last 24h",value:"86400000"}];function Nv(r){const o=Date.now()-new Date(r).getTime();return o<6e4?`${Math.floor(o/1e3)}s ago`:o<36e5?`${Math.floor(o/6e4)}m ago`:o<864e5?`${Math.floor(o/36e5)}h ago`:`${Math.floor(o/864e5)}d ago`}function Sv(r){const o=[];for(const u of r){const c=o[o.length-1];c&&c.type===u.eventName&&c.count<100?(c.count++,c.events.push(u)):o.push({type:u.eventName,count:1,events:[u],collapsed:!0})}return o}function Ev(){const{data:r,loading:o}=we("/api/hooks/events?limit=200"),[u,c]=b.useState([]),[f,x]=Ut("eventType","All"),[h,j]=Ut("session",""),[p,m]=Ut("range","0"),[v,y]=b.useState(null),[T,M]=b.useState(new Set);Ue("hook-event",C=>{const w=C;w.id&&c(U=>[w,...U].slice(0,50))});const z=b.useMemo(()=>{const C=r?.data??[],w=new Set(C.map(J=>J.id));return[...u.filter(J=>!w.has(J.id)),...C].sort((J,V)=>new Date(V.timestamp).getTime()-new Date(J.timestamp).getTime())},[r,u]),O=b.useMemo(()=>{let C=z;f!=="All"&&(C=C.filter(U=>U.eventName===f)),h&&(C=C.filter(U=>U.sessionId.includes(h)));const w=parseInt(p,10);if(w>0){const U=Date.now()-w;C=C.filter(J=>new Date(J.timestamp).getTime()>U)}return C},[z,f,h,p]),N=b.useMemo(()=>Sv(O),[O]);return o&&!r?n.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading hook events..."}):n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Hook Events"}),n.jsxs("span",{className:"text-sm text-gray-500",children:[O.length," events"]})]}),n.jsxs("div",{className:"flex gap-3 flex-wrap",children:[n.jsx("select",{value:f,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:bv.map(C=>n.jsx("option",{value:C,children:C},C))}),n.jsx("input",{type:"text",placeholder:"Filter by session ID...",value:h,onChange:C=>j(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5 w-48"}),n.jsx("select",{value:p,onChange:C=>m(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:jv.map(C=>n.jsx("option",{value:C.value,children:C.label},C.value))})]}),n.jsxs("div",{className:"space-y-1",children:[N.map((C,w)=>{const U=T.has(w),J=C.count===1||U?C.events:[C.events[0]];return n.jsxs("div",{children:[C.count>1&&n.jsxs("button",{onClick:()=>{M(V=>{const ae=new Set(V);return ae.has(w)?ae.delete(w):ae.add(w),ae})},className:"w-full text-left px-3 py-1 text-xs text-gray-500 hover:text-gray-300 bg-gray-900 rounded",children:[U?"▾":"▸"," ",C.count,"× ",C.type]}),J.map(V=>{const ae=V.result?.decision==="deny"||V.result?.decision==="block";return n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>y(v===V.id?null:V.id),className:`w-full text-left flex items-center gap-3 px-3 py-2 rounded text-sm hover:bg-gray-800/50 ${ae?"bg-red-950/30 border border-red-900/40":""}`,children:[n.jsx("span",{className:"text-gray-500 text-xs font-mono w-16 shrink-0",children:Nv(V.timestamp)}),n.jsx(ie,{label:V.eventName,variant:ae?"error":"default"}),n.jsx("span",{className:"text-gray-400 text-xs truncate",children:V.sessionId.slice(0,12)}),V.durationMs!=null&&n.jsxs("span",{className:"text-gray-600 text-xs ml-auto",children:[V.durationMs,"ms"]})]}),v===V.id&&n.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(V.payload,null,2)})]},V.id)})]},w)}),N.length===0&&n.jsx("div",{className:"text-center text-gray-600 py-8",children:"No hook events yet"})]})]})}function lx(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 Cv(){const{data:r,loading:o}=we("/api/hooks/agents"),[u,c]=b.useState([]),[f,x]=Ut("session",""),[,h]=b.useState(0);Ue("hook-agent",T=>{const M=T;M.agentId&&c(z=>{const O=z.findIndex(N=>N.agentId===M.agentId);if(O>=0){const N=[...z];return N[O]={...N[O],...M},N}return[M,...z]})});const j=b.useMemo(()=>{const T=r?.data??[],M=new Set(T.map(z=>z.agentId));return[...u.filter(z=>!M.has(z.agentId)),...T]},[r,u]),p=b.useMemo(()=>f?j.filter(T=>T.sessionId.includes(f)):j,[j,f]),m=b.useMemo(()=>{const T=new Set(j.map(M=>M.sessionId));return Array.from(T)},[j]),v=b.useMemo(()=>p.filter(T=>!T.stoppedAt).length,[p]);b.useEffect(()=>{if(v===0)return;const T=setInterval(()=>h(M=>M+1),1e3);return()=>clearInterval(T)},[v]);const y=b.useMemo(()=>{const T=p.filter(M=>M.durationMs!=null);return T.length===0?0:Math.round(T.reduce((M,z)=>M+(z.durationMs??0),0)/T.length)},[p]);return o&&!r?n.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading agents..."}):n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Agents"}),n.jsxs("div",{className:"flex gap-4 text-sm text-gray-400",children:[n.jsxs("span",{children:["Total: ",p.length]}),n.jsxs("span",{children:["Running: ",v]}),n.jsxs("span",{children:["Avg duration: ",lx(y)]})]})]}),n.jsx("div",{className:"flex gap-3",children:n.jsxs("select",{value:f,onChange:T=>x(T.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:[n.jsx("option",{value:"",children:"All sessions"}),m.map(T=>n.jsx("option",{value:T,children:T.slice(0,20)},T))]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"text-left text-gray-500 border-b border-gray-800",children:[n.jsx("th",{className:"py-2 px-3",children:"Agent ID"}),n.jsx("th",{className:"py-2 px-3",children:"Type"}),n.jsx("th",{className:"py-2 px-3",children:"Session"}),n.jsx("th",{className:"py-2 px-3",children:"Started"}),n.jsx("th",{className:"py-2 px-3",children:"Stopped"}),n.jsx("th",{className:"py-2 px-3",children:"Duration"}),n.jsx("th",{className:"py-2 px-3",children:"Status"})]})}),n.jsxs("tbody",{children:[p.map(T=>{const M=!T.stoppedAt,z=M?Date.now()-new Date(T.startedAt).getTime():T.durationMs??0;return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"py-2 px-3 font-mono text-xs text-gray-300",children:T.agentId.slice(0,16)}),n.jsx("td",{className:"py-2 px-3 text-gray-300",children:T.agentType}),n.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:T.sessionId.slice(0,12)}),n.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:new Date(T.startedAt).toLocaleTimeString()}),n.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:T.stoppedAt?new Date(T.stoppedAt).toLocaleTimeString():"—"}),n.jsx("td",{className:"py-2 px-3 text-gray-400 text-xs",children:lx(z)}),n.jsx("td",{className:"py-2 px-3",children:n.jsx(ie,{label:M?"running":"stopped",variant:M?"success":"default"})})]},T.agentId)}),p.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-8 text-center text-gray-600",children:"No agents tracked yet"})})]})]})})]})}function Jn({value:r,onSave:o,placeholder:u}){const[c,f]=b.useState(!1),[x,h]=b.useState(r),j=b.useRef(null);b.useEffect(()=>{c&&(j.current?.focus(),j.current?.select())},[c]);const p=()=>{x!==r&&o(x),f(!1)},m=()=>{h(r),f(!1)};return c?n.jsx("input",{ref:j,value:x,onChange:v=>h(v.target.value),onKeyDown:v=>{v.key==="Enter"&&p(),v.key==="Escape"&&m()},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:u}):n.jsx("span",{onClick:()=>{h(r),f(!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||n.jsx("span",{className:"text-gray-600 italic",children:u||"Click to set"})})}function Ql(r,o){return r?o==="github"&&r.github?`${r.github.owner}/${r.github.repo}`:o==="jira"&&r.jira?r.jira.projectKey:o==="ado"&&r.ado?r.ado.project:"":""}function cu(r,o){if(r==="github"){const u=o.split("/");return u.length===2?{github:{owner:u[0],repo:u[1]}}:{github:{owner:"",repo:o}}}return r==="jira"?{jira:{projectKey:o}}:r==="ado"?{ado:{project:o}}:{}}function Tv({onClose:r,onSubmit:o}){const[u,c]=b.useState(""),[f,x]=b.useState(""),[h,j]=b.useState(""),[p,m]=b.useState(""),[v,y]=b.useState(""),T=b.useRef(null);b.useEffect(()=>{T.current?.focus()},[]);const M=z=>{if(z.preventDefault(),!u.trim()||!f.trim()||!h.trim()){y("ID, Path, and Prefix are required");return}o({id:u.trim(),path:f.trim(),prefix:h.trim(),name:p.trim()||void 0})};return n.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:r,children:n.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:[n.jsx("h3",{className:"text-sm font-semibold text-gray-200 mb-4",children:"Add Repository"}),n.jsxs("form",{onSubmit:M,className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ID *"}),n.jsx("input",{ref:T,value:u,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"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Path *"}),n.jsx("input",{value:f,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"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Prefix *"}),n.jsx("input",{value:h,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"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Display Name"}),n.jsx("input",{value:p,onChange:z=>m(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"})]}),v&&n.jsx("p",{className:"text-xs text-rose-400",children:v}),n.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[n.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"}),n.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 wv(){const{data:r,loading:o,error:u,refetch:c}=we("/api/workspace"),{activeProject:f}=rl(),[x,h]=b.useState(!1),[j,p]=b.useState(null),m=f?.id?`?project=${f.id}`:"",v=b.useCallback(async(C,w)=>{try{p(null);const U=await fetch(`/api/workspace/repos/${encodeURIComponent(C)}${m}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!U.ok){const J=await U.json();p(J.error||`Failed to update ${C}`);return}c()}catch(U){p(U.message)}},[m,c]),y=b.useCallback(async C=>{try{p(null);const w=await fetch(`/api/workspace/repos${m}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});if(!w.ok){const U=await w.json();p(U.error||"Failed to add repo");return}h(!1),c()}catch(w){p(w.message)}},[m,c]),T=b.useCallback(async C=>{if(confirm(`Remove "${C}" from workspace?`))try{p(null);const w=await fetch(`/api/workspace/repos/${encodeURIComponent(C)}${m}`,{method:"DELETE"});if(!w.ok&&w.status!==204){const U=await w.json();p(U.error||`Failed to remove ${C}`);return}c()}catch(w){p(w.message)}},[m,c]);if(o)return n.jsx(Ie,{});if(u)return n.jsx($t,{message:u,onRetry:c});const M=r||{name:"",rootRepo:null,repos:[]},z=M.repos.filter(C=>C.sync?.github).length,O=M.repos.filter(C=>C.sync?.jira).length,N=M.repos.filter(C=>C.sync?.ado).length;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Workspace"}),M.name&&n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:M.name})]}),n.jsxs("button",{onClick:()=>h(!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:[n.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"Add Repo"]})]}),j&&n.jsx("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-2",children:n.jsx("p",{className:"text-xs text-rose-400",children:j})}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(ne,{title:"Repositories",value:M.repos.length,color:"indigo"}),n.jsx(ne,{title:"GitHub Mapped",value:z,color:"cyan"}),n.jsx(ne,{title:"Jira Mapped",value:O,color:"amber"}),n.jsx(ne,{title:"ADO Mapped",value:N,color:"emerald"})]}),M.rootRepo&&n.jsxs("div",{className:"bg-gray-900/50 border border-indigo-500/20 rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(ie,{label:"Root",variant:"info"}),n.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Umbrella Repository"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"GitHub"}),n.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"github")||"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Jira"}),n.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"jira")||"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ADO"}),n.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"ado")||"-"})]})]})]}),M.repos.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories in workspace"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:'Click "Add Repo" to register your first repository'})]}):n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ID"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Name"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Prefix"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"GitHub"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Jira"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ADO"}),n.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Role"}),n.jsx("th",{className:"text-right text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3 w-10"})]})}),n.jsx("tbody",{children:M.repos.map(C=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors",children:[n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs font-mono text-gray-300",children:C.id})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(Jn,{value:C.name||"",onSave:w=>v(C.id,{name:w}),placeholder:"Set name"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(ie,{label:C.prefix,variant:"default"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(Jn,{value:Ql(C.sync,"github"),onSave:w=>v(C.id,{sync:{...C.sync,...cu("github",w)}}),placeholder:"owner/repo"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(Jn,{value:Ql(C.sync,"jira"),onSave:w=>v(C.id,{sync:{...C.sync,...cu("jira",w)}}),placeholder:"PROJECT"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(Jn,{value:Ql(C.sync,"ado"),onSave:w=>v(C.id,{sync:{...C.sync,...cu("ado",w)}}),placeholder:"project"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(Jn,{value:C.role||"",onSave:w=>v(C.id,{role:w}),placeholder:"Set role"})}),n.jsx("td",{className:"px-4 py-3 text-right",children:n.jsx("button",{onClick:()=>T(C.id),className:"text-gray-600 hover:text-rose-400 transition-colors p-1",title:"Remove from workspace",children:n.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.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"})})})})]},C.id))})]})})}),x&&n.jsx(Tv,{onClose:()=>h(!1),onSubmit:y})]})}function Av(){const r=Xp(),o=Kt();return n.jsx(Sx.Provider,{value:r,children:n.jsx(Zp,{children:n.jsxs("div",{className:"flex min-h-screen bg-gray-950 text-gray-100",children:[n.jsx(Fp,{}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[n.jsx(Pp,{}),n.jsx("main",{className:"flex-1 overflow-y-auto",children:n.jsx(ey,{resetKey:o.pathname,children:n.jsxs(dp,{children:[n.jsx(We,{path:"/",element:n.jsx(oy,{})}),n.jsx(We,{path:"/increments",element:n.jsx(my,{})}),n.jsx(We,{path:"/increments/:id",element:n.jsx(yv,{})}),n.jsx(We,{path:"/analytics",element:n.jsx(py,{})}),n.jsx(We,{path:"/costs",element:n.jsx(Sy,{})}),n.jsx(We,{path:"/sync",element:n.jsx(My,{})}),n.jsx(We,{path:"/errors",element:n.jsx(Uy,{})}),n.jsx(We,{path:"/activity",element:n.jsx(Gy,{})}),n.jsx(We,{path:"/config",element:n.jsx(Qy,{})}),n.jsx(We,{path:"/plugins",element:n.jsx(Jy,{})}),n.jsx(We,{path:"/services",element:n.jsx(Fy,{})}),n.jsx(We,{path:"/notifications",element:n.jsx(Iy,{})}),n.jsx(We,{path:"/repos",element:n.jsx(av,{})}),n.jsx(We,{path:"/marketplace",element:n.jsx(hv,{})}),n.jsx(We,{path:"/hooks",element:n.jsx(Ev,{})}),n.jsx(We,{path:"/agents",element:n.jsx(Cv,{})}),n.jsx(We,{path:"/workspace",element:n.jsx(wv,{})}),n.jsx(We,{path:"*",element:n.jsxs("div",{className:"p-6 text-center",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200 mb-2",children:"Page Not Found"}),n.jsx("p",{className:"text-sm text-gray-500",children:"The page you're looking for doesn't exist."})]})})]})})})]})]})})})}xg.createRoot(document.getElementById("root")).render(n.jsx(b.StrictMode,{children:n.jsx(Lp,{children:n.jsx(Av,{})})}));
|