@gavinc-cn/touchstone-dsh 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,473 +0,0 @@
1
- var Nm=e=>{throw TypeError(e)};var Cm=(e,t,n)=>t.has(e)||Nm("Cannot "+n);var hn=(e,t,n)=>(Cm(e,t,"read from private field"),n?n.call(e):t.get(e)),Em=(e,t,n)=>t.has(e)?Nm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),fu=(e,t,n,s)=>(Cm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);function Sj(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function ox(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lx={exports:{}},$c={},ax={exports:{}},He={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Aa=Symbol.for("react.element"),kj=Symbol.for("react.portal"),Nj=Symbol.for("react.fragment"),Cj=Symbol.for("react.strict_mode"),Ej=Symbol.for("react.profiler"),Rj=Symbol.for("react.provider"),Pj=Symbol.for("react.context"),Tj=Symbol.for("react.forward_ref"),Mj=Symbol.for("react.suspense"),$j=Symbol.for("react.memo"),Ij=Symbol.for("react.lazy"),Rm=Symbol.iterator;function Aj(e){return e===null||typeof e!="object"?null:(e=Rm&&e[Rm]||e["@@iterator"],typeof e=="function"?e:null)}var ix={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cx=Object.assign,ux={};function Tl(e,t,n){this.props=e,this.context=t,this.refs=ux,this.updater=n||ix}Tl.prototype.isReactComponent={};Tl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Tl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function dx(){}dx.prototype=Tl.prototype;function Df(e,t,n){this.props=e,this.context=t,this.refs=ux,this.updater=n||ix}var Ff=Df.prototype=new dx;Ff.constructor=Df;cx(Ff,Tl.prototype);Ff.isPureReactComponent=!0;var Pm=Array.isArray,fx=Object.prototype.hasOwnProperty,Bf={current:null},px={key:!0,ref:!0,__self:!0,__source:!0};function mx(e,t,n){var s,o={},l=null,a=null;if(t!=null)for(s in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)fx.call(t,s)&&!px.hasOwnProperty(s)&&(o[s]=t[s]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var c=Array(i),d=0;d<i;d++)c[d]=arguments[d+2];o.children=c}if(e&&e.defaultProps)for(s in i=e.defaultProps,i)o[s]===void 0&&(o[s]=i[s]);return{$$typeof:Aa,type:e,key:l,ref:a,props:o,_owner:Bf.current}}function Oj(e,t){return{$$typeof:Aa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Uf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Aa}function Lj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Tm=/\/+/g;function pu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lj(""+e.key):t.toString(36)}function $i(e,t,n,s,o){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Aa:case kj:a=!0}}if(a)return a=e,o=o(a),e=s===""?"."+pu(a,0):s,Pm(o)?(n="",e!=null&&(n=e.replace(Tm,"$&/")+"/"),$i(o,t,n,"",function(d){return d})):o!=null&&(Uf(o)&&(o=Oj(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Tm,"$&/")+"/")+e)),t.push(o)),1;if(a=0,s=s===""?".":s+":",Pm(e))for(var i=0;i<e.length;i++){l=e[i];var c=s+pu(l,i);a+=$i(l,t,n,c,o)}else if(c=Aj(e),typeof c=="function")for(e=c.call(e),i=0;!(l=e.next()).done;)l=l.value,c=s+pu(l,i++),a+=$i(l,t,n,c,o);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Qa(e,t,n){if(e==null)return e;var s=[],o=0;return $i(e,s,"","",function(l){return t.call(n,l,o++)}),s}function zj(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Cn={current:null},Ii={transition:null},Dj={ReactCurrentDispatcher:Cn,ReactCurrentBatchConfig:Ii,ReactCurrentOwner:Bf};function hx(){throw Error("act(...) is not supported in production builds of React.")}He.Children={map:Qa,forEach:function(e,t,n){Qa(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Qa(e,function(){t++}),t},toArray:function(e){return Qa(e,function(t){return t})||[]},only:function(e){if(!Uf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};He.Component=Tl;He.Fragment=Nj;He.Profiler=Ej;He.PureComponent=Df;He.StrictMode=Cj;He.Suspense=Mj;He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dj;He.act=hx;He.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=cx({},e.props),o=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=Bf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(c in t)fx.call(t,c)&&!px.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&i!==void 0?i[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){i=Array(c);for(var d=0;d<c;d++)i[d]=arguments[d+2];s.children=i}return{$$typeof:Aa,type:e.type,key:o,ref:l,props:s,_owner:a}};He.createContext=function(e){return e={$$typeof:Pj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Rj,_context:e},e.Consumer=e};He.createElement=mx;He.createFactory=function(e){var t=mx.bind(null,e);return t.type=e,t};He.createRef=function(){return{current:null}};He.forwardRef=function(e){return{$$typeof:Tj,render:e}};He.isValidElement=Uf;He.lazy=function(e){return{$$typeof:Ij,_payload:{_status:-1,_result:e},_init:zj}};He.memo=function(e,t){return{$$typeof:$j,type:e,compare:t===void 0?null:t}};He.startTransition=function(e){var t=Ii.transition;Ii.transition={};try{e()}finally{Ii.transition=t}};He.unstable_act=hx;He.useCallback=function(e,t){return Cn.current.useCallback(e,t)};He.useContext=function(e){return Cn.current.useContext(e)};He.useDebugValue=function(){};He.useDeferredValue=function(e){return Cn.current.useDeferredValue(e)};He.useEffect=function(e,t){return Cn.current.useEffect(e,t)};He.useId=function(){return Cn.current.useId()};He.useImperativeHandle=function(e,t,n){return Cn.current.useImperativeHandle(e,t,n)};He.useInsertionEffect=function(e,t){return Cn.current.useInsertionEffect(e,t)};He.useLayoutEffect=function(e,t){return Cn.current.useLayoutEffect(e,t)};He.useMemo=function(e,t){return Cn.current.useMemo(e,t)};He.useReducer=function(e,t,n){return Cn.current.useReducer(e,t,n)};He.useRef=function(e){return Cn.current.useRef(e)};He.useState=function(e){return Cn.current.useState(e)};He.useSyncExternalStore=function(e,t,n){return Cn.current.useSyncExternalStore(e,t,n)};He.useTransition=function(){return Cn.current.useTransition()};He.version="18.3.1";ax.exports=He;var u=ax.exports;const gx=ox(u),$o=Sj({__proto__:null,default:gx},[u]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Fj=u,Bj=Symbol.for("react.element"),Uj=Symbol.for("react.fragment"),Vj=Object.prototype.hasOwnProperty,Hj=Fj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wj={key:!0,ref:!0,__self:!0,__source:!0};function xx(e,t,n){var s,o={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(s in t)Vj.call(t,s)&&!Wj.hasOwnProperty(s)&&(o[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)o[s]===void 0&&(o[s]=t[s]);return{$$typeof:Bj,type:e,key:l,ref:a,props:o,_owner:Hj.current}}$c.Fragment=Uj;$c.jsx=xx;$c.jsxs=xx;lx.exports=$c;var r=lx.exports,vx={exports:{}},Zn={},yx={exports:{}},wx={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(L,Y){var z=L.length;L.push(Y);e:for(;0<z;){var we=z-1>>>1,X=L[we];if(0<o(X,Y))L[we]=Y,L[z]=X,z=we;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var Y=L[0],z=L.pop();if(z!==Y){L[0]=z;e:for(var we=0,X=L.length,Re=X>>>1;we<Re;){var Pe=2*(we+1)-1,ke=L[Pe],Z=Pe+1,ge=L[Z];if(0>o(ke,z))Z<X&&0>o(ge,ke)?(L[we]=ge,L[Z]=z,we=Z):(L[we]=ke,L[Pe]=z,we=Pe);else if(Z<X&&0>o(ge,z))L[we]=ge,L[Z]=z,we=Z;else break e}}return Y}function o(L,Y){var z=L.sortIndex-Y.sortIndex;return z!==0?z:L.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,i=a.now();e.unstable_now=function(){return a.now()-i}}var c=[],d=[],f=1,m=null,p=3,h=!1,g=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(L){for(var Y=n(d);Y!==null;){if(Y.callback===null)s(d);else if(Y.startTime<=L)s(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function b(L){if(w=!1,y(L),!g)if(n(c)!==null)g=!0,te(S);else{var Y=n(d);Y!==null&&V(b,Y.startTime-L)}}function S(L,Y){g=!1,w&&(w=!1,v(C),C=-1),h=!0;var z=p;try{for(y(Y),m=n(c);m!==null&&(!(m.expirationTime>Y)||L&&!D());){var we=m.callback;if(typeof we=="function"){m.callback=null,p=m.priorityLevel;var X=we(m.expirationTime<=Y);Y=e.unstable_now(),typeof X=="function"?m.callback=X:m===n(c)&&s(c),y(Y)}else s(c);m=n(c)}if(m!==null)var Re=!0;else{var Pe=n(d);Pe!==null&&V(b,Pe.startTime-Y),Re=!1}return Re}finally{m=null,p=z,h=!1}}var N=!1,k=null,C=-1,O=5,P=-1;function D(){return!(e.unstable_now()-P<O)}function W(){if(k!==null){var L=e.unstable_now();P=L;var Y=!0;try{Y=k(!0,L)}finally{Y?G():(N=!1,k=null)}}else N=!1}var G;if(typeof x=="function")G=function(){x(W)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,K=$.port2;$.port1.onmessage=W,G=function(){K.postMessage(null)}}else G=function(){j(W,0)};function te(L){k=L,N||(N=!0,G())}function V(L,Y){C=j(function(){L(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,te(S))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var Y=3;break;default:Y=p}var z=p;p=Y;try{return L()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,Y){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var z=p;p=L;try{return Y()}finally{p=z}},e.unstable_scheduleCallback=function(L,Y,z){var we=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?we+z:we):z=we,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=z+X,L={id:f++,callback:Y,priorityLevel:L,startTime:z,expirationTime:X,sortIndex:-1},z>we?(L.sortIndex=z,t(d,L),n(c)===null&&L===n(d)&&(w?(v(C),C=-1):w=!0,V(b,z-we))):(L.sortIndex=X,t(c,L),g||h||(g=!0,te(S))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var Y=p;return function(){var z=p;p=Y;try{return L.apply(this,arguments)}finally{p=z}}}})(wx);yx.exports=wx;var qj=yx.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Gj=u,Jn=qj;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jx=new Set,da={};function Io(e,t){xl(e,t),xl(e+"Capture",t)}function xl(e,t){for(da[e]=t,e=0;e<t.length;e++)jx.add(t[e])}var cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ud=Object.prototype.hasOwnProperty,Kj=/^[: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]*$/,Mm={},$m={};function Yj(e){return ud.call($m,e)?!0:ud.call(Mm,e)?!1:Kj.test(e)?$m[e]=!0:(Mm[e]=!0,!1)}function Qj(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Xj(e,t,n,s){if(t===null||typeof t>"u"||Qj(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function En(e,t,n,s,o,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){dn[e]=new En(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];dn[t]=new En(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){dn[e]=new En(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){dn[e]=new En(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){dn[e]=new En(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){dn[e]=new En(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){dn[e]=new En(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){dn[e]=new En(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){dn[e]=new En(e,5,!1,e.toLowerCase(),null,!1,!1)});var Vf=/[\-:]([a-z])/g;function Hf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Vf,Hf);dn[t]=new En(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Vf,Hf);dn[t]=new En(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Vf,Hf);dn[t]=new En(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){dn[e]=new En(e,1,!1,e.toLowerCase(),null,!1,!1)});dn.xlinkHref=new En("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){dn[e]=new En(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wf(e,t,n,s){var o=dn.hasOwnProperty(t)?dn[t]:null;(o!==null?o.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Xj(t,n,o,s)&&(n=null),s||o===null?Yj(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,s=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var gr=Gj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xa=Symbol.for("react.element"),Ko=Symbol.for("react.portal"),Yo=Symbol.for("react.fragment"),qf=Symbol.for("react.strict_mode"),dd=Symbol.for("react.profiler"),bx=Symbol.for("react.provider"),_x=Symbol.for("react.context"),Gf=Symbol.for("react.forward_ref"),fd=Symbol.for("react.suspense"),pd=Symbol.for("react.suspense_list"),Kf=Symbol.for("react.memo"),kr=Symbol.for("react.lazy"),Sx=Symbol.for("react.offscreen"),Im=Symbol.iterator;function Fl(e){return e===null||typeof e!="object"?null:(e=Im&&e[Im]||e["@@iterator"],typeof e=="function"?e:null)}var bt=Object.assign,mu;function Xl(e){if(mu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mu=t&&t[1]||""}return`
34
- `+mu+e}var hu=!1;function gu(e,t){if(!e||hu)return"";hu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var s=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){s=d}e.call(t.prototype)}else{try{throw Error()}catch(d){s=d}e()}}catch(d){if(d&&s&&typeof d.stack=="string"){for(var o=d.stack.split(`
35
- `),l=s.stack.split(`
36
- `),a=o.length-1,i=l.length-1;1<=a&&0<=i&&o[a]!==l[i];)i--;for(;1<=a&&0<=i;a--,i--)if(o[a]!==l[i]){if(a!==1||i!==1)do if(a--,i--,0>i||o[a]!==l[i]){var c=`
37
- `+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=i);break}}}finally{hu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xl(e):""}function Jj(e){switch(e.tag){case 5:return Xl(e.type);case 16:return Xl("Lazy");case 13:return Xl("Suspense");case 19:return Xl("SuspenseList");case 0:case 2:case 15:return e=gu(e.type,!1),e;case 11:return e=gu(e.type.render,!1),e;case 1:return e=gu(e.type,!0),e;default:return""}}function md(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yo:return"Fragment";case Ko:return"Portal";case dd:return"Profiler";case qf:return"StrictMode";case fd:return"Suspense";case pd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _x:return(e.displayName||"Context")+".Consumer";case bx:return(e._context.displayName||"Context")+".Provider";case Gf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Kf:return t=e.displayName||null,t!==null?t:md(e.type)||"Memo";case kr:t=e._payload,e=e._init;try{return md(e(t))}catch{}}return null}function Zj(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return md(t);case 8:return t===qf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function e1(e){var t=kx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){s=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(a){s=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ja(e){e._valueTracker||(e._valueTracker=e1(e))}function Nx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=kx(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ji(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hd(e,t){var n=t.checked;return bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Am(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Gr(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Cx(e,t){t=t.checked,t!=null&&Wf(e,"checked",t,!1)}function gd(e,t){Cx(e,t);var n=Gr(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xd(e,t.type,n):t.hasOwnProperty("defaultValue")&&xd(e,t.type,Gr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Om(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function xd(e,t,n){(t!=="number"||Ji(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jl=Array.isArray;function al(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Gr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function vd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return bt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Lm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(Jl(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Gr(n)}}function Ex(e,t){var n=Gr(t.value),s=Gr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function zm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Rx(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Rx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Za,Px=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Za=Za||document.createElement("div"),Za.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Za.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var na={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},t1=["Webkit","ms","Moz","O"];Object.keys(na).forEach(function(e){t1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),na[t]=na[e]})});function Tx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||na.hasOwnProperty(e)&&na[e]?(""+t).trim():t+"px"}function Mx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,o=Tx(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,o):e[n]=o}}var n1=bt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wd(e,t){if(t){if(n1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function jd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bd=null;function Yf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _d=null,il=null,cl=null;function Dm(e){if(e=za(e)){if(typeof _d!="function")throw Error(se(280));var t=e.stateNode;t&&(t=zc(t),_d(e.stateNode,e.type,t))}}function $x(e){il?cl?cl.push(e):cl=[e]:il=e}function Ix(){if(il){var e=il,t=cl;if(cl=il=null,Dm(e),t)for(e=0;e<t.length;e++)Dm(t[e])}}function Ax(e,t){return e(t)}function Ox(){}var xu=!1;function Lx(e,t,n){if(xu)return e(t,n);xu=!0;try{return Ax(e,t,n)}finally{xu=!1,(il!==null||cl!==null)&&(Ox(),Ix())}}function pa(e,t){var n=e.stateNode;if(n===null)return null;var s=zc(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(se(231,t,typeof n));return n}var Sd=!1;if(cr)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){Sd=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{Sd=!1}function s1(e,t,n,s,o,l,a,i,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(f){this.onError(f)}}var sa=!1,Zi=null,ec=!1,kd=null,r1={onError:function(e){sa=!0,Zi=e}};function o1(e,t,n,s,o,l,a,i,c){sa=!1,Zi=null,s1.apply(r1,arguments)}function l1(e,t,n,s,o,l,a,i,c){if(o1.apply(this,arguments),sa){if(sa){var d=Zi;sa=!1,Zi=null}else throw Error(se(198));ec||(ec=!0,kd=d)}}function Ao(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function zx(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 Fm(e){if(Ao(e)!==e)throw Error(se(188))}function a1(e){var t=e.alternate;if(!t){if(t=Ao(e),t===null)throw Error(se(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(o===null)break;var l=o.alternate;if(l===null){if(s=o.return,s!==null){n=s;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return Fm(o),e;if(l===s)return Fm(o),t;l=l.sibling}throw Error(se(188))}if(n.return!==s.return)n=o,s=l;else{for(var a=!1,i=o.child;i;){if(i===n){a=!0,n=o,s=l;break}if(i===s){a=!0,s=o,n=l;break}i=i.sibling}if(!a){for(i=l.child;i;){if(i===n){a=!0,n=l,s=o;break}if(i===s){a=!0,s=l,n=o;break}i=i.sibling}if(!a)throw Error(se(189))}}if(n.alternate!==s)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function Dx(e){return e=a1(e),e!==null?Fx(e):null}function Fx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Fx(e);if(t!==null)return t;e=e.sibling}return null}var Bx=Jn.unstable_scheduleCallback,Bm=Jn.unstable_cancelCallback,i1=Jn.unstable_shouldYield,c1=Jn.unstable_requestPaint,At=Jn.unstable_now,u1=Jn.unstable_getCurrentPriorityLevel,Qf=Jn.unstable_ImmediatePriority,Ux=Jn.unstable_UserBlockingPriority,tc=Jn.unstable_NormalPriority,d1=Jn.unstable_LowPriority,Vx=Jn.unstable_IdlePriority,Ic=null,Hs=null;function f1(e){if(Hs&&typeof Hs.onCommitFiberRoot=="function")try{Hs.onCommitFiberRoot(Ic,e,void 0,(e.current.flags&128)===128)}catch{}}var Ns=Math.clz32?Math.clz32:h1,p1=Math.log,m1=Math.LN2;function h1(e){return e>>>=0,e===0?32:31-(p1(e)/m1|0)|0}var ei=64,ti=4194304;function Zl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function nc(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,o=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var i=a&~o;i!==0?s=Zl(i):(l&=a,l!==0&&(s=Zl(l)))}else a=n&~o,a!==0?s=Zl(a):l!==0&&(s=Zl(l));if(s===0)return 0;if(t!==0&&t!==s&&!(t&o)&&(o=s&-s,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Ns(t),o=1<<n,s|=e[n],t&=~o;return s}function g1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function x1(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-Ns(l),i=1<<a,c=o[a];c===-1?(!(i&n)||i&s)&&(o[a]=g1(i,t)):c<=t&&(e.expiredLanes|=i),l&=~i}}function Nd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hx(){var e=ei;return ei<<=1,!(ei&4194240)&&(ei=64),e}function vu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Oa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ns(t),e[t]=n}function v1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Ns(n),l=1<<o;t[o]=0,s[o]=-1,e[o]=-1,n&=~l}}function Xf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ns(n),o=1<<s;o&t|e[s]&t&&(e[s]|=t),n&=~o}}var nt=0;function Wx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qx,Jf,Gx,Kx,Yx,Cd=!1,ni=[],Ir=null,Ar=null,Or=null,ma=new Map,ha=new Map,Cr=[],y1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Um(e,t){switch(e){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Or=null;break;case"pointerover":case"pointerout":ma.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ha.delete(t.pointerId)}}function Ul(e,t,n,s,o,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:l,targetContainers:[o]},t!==null&&(t=za(t),t!==null&&Jf(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function w1(e,t,n,s,o){switch(t){case"focusin":return Ir=Ul(Ir,e,t,n,s,o),!0;case"dragenter":return Ar=Ul(Ar,e,t,n,s,o),!0;case"mouseover":return Or=Ul(Or,e,t,n,s,o),!0;case"pointerover":var l=o.pointerId;return ma.set(l,Ul(ma.get(l)||null,e,t,n,s,o)),!0;case"gotpointercapture":return l=o.pointerId,ha.set(l,Ul(ha.get(l)||null,e,t,n,s,o)),!0}return!1}function Qx(e){var t=ho(e.target);if(t!==null){var n=Ao(t);if(n!==null){if(t=n.tag,t===13){if(t=zx(n),t!==null){e.blockedOn=t,Yx(e.priority,function(){Gx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ai(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ed(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);bd=s,n.target.dispatchEvent(s),bd=null}else return t=za(n),t!==null&&Jf(t),e.blockedOn=n,!1;t.shift()}return!0}function Vm(e,t,n){Ai(e)&&n.delete(t)}function j1(){Cd=!1,Ir!==null&&Ai(Ir)&&(Ir=null),Ar!==null&&Ai(Ar)&&(Ar=null),Or!==null&&Ai(Or)&&(Or=null),ma.forEach(Vm),ha.forEach(Vm)}function Vl(e,t){e.blockedOn===t&&(e.blockedOn=null,Cd||(Cd=!0,Jn.unstable_scheduleCallback(Jn.unstable_NormalPriority,j1)))}function ga(e){function t(o){return Vl(o,e)}if(0<ni.length){Vl(ni[0],e);for(var n=1;n<ni.length;n++){var s=ni[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Ir!==null&&Vl(Ir,e),Ar!==null&&Vl(Ar,e),Or!==null&&Vl(Or,e),ma.forEach(t),ha.forEach(t),n=0;n<Cr.length;n++)s=Cr[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Cr.length&&(n=Cr[0],n.blockedOn===null);)Qx(n),n.blockedOn===null&&Cr.shift()}var ul=gr.ReactCurrentBatchConfig,sc=!0;function b1(e,t,n,s){var o=nt,l=ul.transition;ul.transition=null;try{nt=1,Zf(e,t,n,s)}finally{nt=o,ul.transition=l}}function _1(e,t,n,s){var o=nt,l=ul.transition;ul.transition=null;try{nt=4,Zf(e,t,n,s)}finally{nt=o,ul.transition=l}}function Zf(e,t,n,s){if(sc){var o=Ed(e,t,n,s);if(o===null)Eu(e,t,s,rc,n),Um(e,s);else if(w1(o,e,t,n,s))s.stopPropagation();else if(Um(e,s),t&4&&-1<y1.indexOf(e)){for(;o!==null;){var l=za(o);if(l!==null&&qx(l),l=Ed(e,t,n,s),l===null&&Eu(e,t,s,rc,n),l===o)break;o=l}o!==null&&s.stopPropagation()}else Eu(e,t,s,null,n)}}var rc=null;function Ed(e,t,n,s){if(rc=null,e=Yf(s),e=ho(e),e!==null)if(t=Ao(e),t===null)e=null;else if(n=t.tag,n===13){if(e=zx(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return rc=e,null}function Xx(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(u1()){case Qf:return 1;case Ux:return 4;case tc:case d1:return 16;case Vx:return 536870912;default:return 16}default:return 16}}var Pr=null,ep=null,Oi=null;function Jx(){if(Oi)return Oi;var e,t=ep,n=t.length,s,o="value"in Pr?Pr.value:Pr.textContent,l=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===o[l-s];s++);return Oi=o.slice(e,1<s?1-s:void 0)}function Li(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 si(){return!0}function Hm(){return!1}function es(e){function t(n,s,o,l,a){this._reactName=n,this._targetInst=o,this.type=s,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(n=e[i],this[i]=n?n(l):l[i]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?si:Hm,this.isPropagationStopped=Hm,this}return bt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=si)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tp=es(Ml),La=bt({},Ml,{view:0,detail:0}),S1=es(La),yu,wu,Hl,Ac=bt({},La,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:np,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!==Hl&&(Hl&&e.type==="mousemove"?(yu=e.screenX-Hl.screenX,wu=e.screenY-Hl.screenY):wu=yu=0,Hl=e),yu)},movementY:function(e){return"movementY"in e?e.movementY:wu}}),Wm=es(Ac),k1=bt({},Ac,{dataTransfer:0}),N1=es(k1),C1=bt({},La,{relatedTarget:0}),ju=es(C1),E1=bt({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),R1=es(E1),P1=bt({},Ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),T1=es(P1),M1=bt({},Ml,{data:0}),qm=es(M1),$1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I1={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"},A1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=A1[e])?!!t[e]:!1}function np(){return O1}var L1=bt({},La,{key:function(e){if(e.key){var t=$1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?I1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:np,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z1=es(L1),D1=bt({},Ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gm=es(D1),F1=bt({},La,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:np}),B1=es(F1),U1=bt({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),V1=es(U1),H1=bt({},Ac,{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}),W1=es(H1),q1=[9,13,27,32],sp=cr&&"CompositionEvent"in window,ra=null;cr&&"documentMode"in document&&(ra=document.documentMode);var G1=cr&&"TextEvent"in window&&!ra,Zx=cr&&(!sp||ra&&8<ra&&11>=ra),Km=" ",Ym=!1;function ev(e,t){switch(e){case"keyup":return q1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qo=!1;function K1(e,t){switch(e){case"compositionend":return tv(t);case"keypress":return t.which!==32?null:(Ym=!0,Km);case"textInput":return e=t.data,e===Km&&Ym?null:e;default:return null}}function Y1(e,t){if(Qo)return e==="compositionend"||!sp&&ev(e,t)?(e=Jx(),Oi=ep=Pr=null,Qo=!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 Zx&&t.locale!=="ko"?null:t.data;default:return null}}var Q1={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 Qm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Q1[e.type]:t==="textarea"}function nv(e,t,n,s){$x(s),t=oc(t,"onChange"),0<t.length&&(n=new tp("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var oa=null,xa=null;function X1(e){pv(e,0)}function Oc(e){var t=Zo(e);if(Nx(t))return e}function J1(e,t){if(e==="change")return t}var sv=!1;if(cr){var bu;if(cr){var _u="oninput"in document;if(!_u){var Xm=document.createElement("div");Xm.setAttribute("oninput","return;"),_u=typeof Xm.oninput=="function"}bu=_u}else bu=!1;sv=bu&&(!document.documentMode||9<document.documentMode)}function Jm(){oa&&(oa.detachEvent("onpropertychange",rv),xa=oa=null)}function rv(e){if(e.propertyName==="value"&&Oc(xa)){var t=[];nv(t,xa,e,Yf(e)),Lx(X1,t)}}function Z1(e,t,n){e==="focusin"?(Jm(),oa=t,xa=n,oa.attachEvent("onpropertychange",rv)):e==="focusout"&&Jm()}function eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Oc(xa)}function tb(e,t){if(e==="click")return Oc(t)}function nb(e,t){if(e==="input"||e==="change")return Oc(t)}function sb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Es=typeof Object.is=="function"?Object.is:sb;function va(e,t){if(Es(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var o=n[s];if(!ud.call(t,o)||!Es(e[o],t[o]))return!1}return!0}function Zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eh(e,t){var n=Zm(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zm(n)}}function ov(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ov(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lv(){for(var e=window,t=Ji();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ji(e.document)}return t}function rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rb(e){var t=lv(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ov(n.ownerDocument.documentElement,n)){if(s!==null&&rp(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,l=Math.min(s.start,o);s=s.end===void 0?l:Math.min(s.end,o),!e.extend&&l>s&&(o=s,s=l,l=o),o=eh(n,l);var a=eh(n,s);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>s?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ob=cr&&"documentMode"in document&&11>=document.documentMode,Xo=null,Rd=null,la=null,Pd=!1;function th(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pd||Xo==null||Xo!==Ji(s)||(s=Xo,"selectionStart"in s&&rp(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),la&&va(la,s)||(la=s,s=oc(Rd,"onSelect"),0<s.length&&(t=new tp("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Xo)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Jo={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionend:ri("Transition","TransitionEnd")},Su={},av={};cr&&(av=document.createElement("div").style,"AnimationEvent"in window||(delete Jo.animationend.animation,delete Jo.animationiteration.animation,delete Jo.animationstart.animation),"TransitionEvent"in window||delete Jo.transitionend.transition);function Lc(e){if(Su[e])return Su[e];if(!Jo[e])return e;var t=Jo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in av)return Su[e]=t[n];return e}var iv=Lc("animationend"),cv=Lc("animationiteration"),uv=Lc("animationstart"),dv=Lc("transitionend"),fv=new Map,nh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xr(e,t){fv.set(e,t),Io(t,[e])}for(var ku=0;ku<nh.length;ku++){var Nu=nh[ku],lb=Nu.toLowerCase(),ab=Nu[0].toUpperCase()+Nu.slice(1);Xr(lb,"on"+ab)}Xr(iv,"onAnimationEnd");Xr(cv,"onAnimationIteration");Xr(uv,"onAnimationStart");Xr("dblclick","onDoubleClick");Xr("focusin","onFocus");Xr("focusout","onBlur");Xr(dv,"onTransitionEnd");xl("onMouseEnter",["mouseout","mouseover"]);xl("onMouseLeave",["mouseout","mouseover"]);xl("onPointerEnter",["pointerout","pointerover"]);xl("onPointerLeave",["pointerout","pointerover"]);Io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Io("onBeforeInput",["compositionend","keypress","textInput","paste"]);Io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),ib=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function sh(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,l1(s,t,void 0,e),e.currentTarget=null}function pv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],o=s.event;s=s.listeners;e:{var l=void 0;if(t)for(var a=s.length-1;0<=a;a--){var i=s[a],c=i.instance,d=i.currentTarget;if(i=i.listener,c!==l&&o.isPropagationStopped())break e;sh(o,i,d),l=c}else for(a=0;a<s.length;a++){if(i=s[a],c=i.instance,d=i.currentTarget,i=i.listener,c!==l&&o.isPropagationStopped())break e;sh(o,i,d),l=c}}}if(ec)throw e=kd,ec=!1,kd=null,e}function mt(e,t){var n=t[Ad];n===void 0&&(n=t[Ad]=new Set);var s=e+"__bubble";n.has(s)||(mv(t,e,2,!1),n.add(s))}function Cu(e,t,n){var s=0;t&&(s|=4),mv(n,e,s,t)}var oi="_reactListening"+Math.random().toString(36).slice(2);function ya(e){if(!e[oi]){e[oi]=!0,jx.forEach(function(n){n!=="selectionchange"&&(ib.has(n)||Cu(n,!1,e),Cu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oi]||(t[oi]=!0,Cu("selectionchange",!1,t))}}function mv(e,t,n,s){switch(Xx(t)){case 1:var o=b1;break;case 4:o=_1;break;default:o=Zf}n=o.bind(null,t,n,e),o=void 0,!Sd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Eu(e,t,n,s,o){var l=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var i=s.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;i!==null;){if(a=ho(i),a===null)return;if(c=a.tag,c===5||c===6){s=l=a;continue e}i=i.parentNode}}s=s.return}Lx(function(){var d=l,f=Yf(n),m=[];e:{var p=fv.get(e);if(p!==void 0){var h=tp,g=e;switch(e){case"keypress":if(Li(n)===0)break e;case"keydown":case"keyup":h=z1;break;case"focusin":g="focus",h=ju;break;case"focusout":g="blur",h=ju;break;case"beforeblur":case"afterblur":h=ju;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Wm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=N1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=B1;break;case iv:case cv:case uv:h=R1;break;case dv:h=V1;break;case"scroll":h=S1;break;case"wheel":h=W1;break;case"copy":case"cut":case"paste":h=T1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Gm}var w=(t&4)!==0,j=!w&&e==="scroll",v=w?p!==null?p+"Capture":null:p;w=[];for(var x=d,y;x!==null;){y=x;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,v!==null&&(b=pa(x,v),b!=null&&w.push(wa(x,b,y)))),j)break;x=x.return}0<w.length&&(p=new h(p,g,null,n,f),m.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==bd&&(g=n.relatedTarget||n.fromElement)&&(ho(g)||g[ur]))break e;if((h||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=d,g=g?ho(g):null,g!==null&&(j=Ao(g),g!==j||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=d),h!==g)){if(w=Wm,b="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(w=Gm,b="onPointerLeave",v="onPointerEnter",x="pointer"),j=h==null?p:Zo(h),y=g==null?p:Zo(g),p=new w(b,x+"leave",h,n,f),p.target=j,p.relatedTarget=y,b=null,ho(f)===d&&(w=new w(v,x+"enter",g,n,f),w.target=y,w.relatedTarget=j,b=w),j=b,h&&g)t:{for(w=h,v=g,x=0,y=w;y;y=Uo(y))x++;for(y=0,b=v;b;b=Uo(b))y++;for(;0<x-y;)w=Uo(w),x--;for(;0<y-x;)v=Uo(v),y--;for(;x--;){if(w===v||v!==null&&w===v.alternate)break t;w=Uo(w),v=Uo(v)}w=null}else w=null;h!==null&&rh(m,p,h,w,!1),g!==null&&j!==null&&rh(m,j,g,w,!0)}}e:{if(p=d?Zo(d):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=J1;else if(Qm(p))if(sv)S=nb;else{S=eb;var N=Z1}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=tb);if(S&&(S=S(e,d))){nv(m,S,n,f);break e}N&&N(e,p,d),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&xd(p,"number",p.value)}switch(N=d?Zo(d):window,e){case"focusin":(Qm(N)||N.contentEditable==="true")&&(Xo=N,Rd=d,la=null);break;case"focusout":la=Rd=Xo=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,th(m,n,f);break;case"selectionchange":if(ob)break;case"keydown":case"keyup":th(m,n,f)}var k;if(sp)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Qo?ev(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Zx&&n.locale!=="ko"&&(Qo||C!=="onCompositionStart"?C==="onCompositionEnd"&&Qo&&(k=Jx()):(Pr=f,ep="value"in Pr?Pr.value:Pr.textContent,Qo=!0)),N=oc(d,C),0<N.length&&(C=new qm(C,e,null,n,f),m.push({event:C,listeners:N}),k?C.data=k:(k=tv(n),k!==null&&(C.data=k)))),(k=G1?K1(e,n):Y1(e,n))&&(d=oc(d,"onBeforeInput"),0<d.length&&(f=new qm("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:d}),f.data=k))}pv(m,t)})}function wa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function oc(e,t){for(var n=t+"Capture",s=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=pa(e,n),l!=null&&s.unshift(wa(e,l,o)),l=pa(e,t),l!=null&&s.push(wa(e,l,o))),e=e.return}return s}function Uo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rh(e,t,n,s,o){for(var l=t._reactName,a=[];n!==null&&n!==s;){var i=n,c=i.alternate,d=i.stateNode;if(c!==null&&c===s)break;i.tag===5&&d!==null&&(i=d,o?(c=pa(n,l),c!=null&&a.unshift(wa(n,c,i))):o||(c=pa(n,l),c!=null&&a.push(wa(n,c,i)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var cb=/\r\n?/g,ub=/\u0000|\uFFFD/g;function oh(e){return(typeof e=="string"?e:""+e).replace(cb,`
38
- `).replace(ub,"")}function li(e,t,n){if(t=oh(t),oh(e)!==t&&n)throw Error(se(425))}function lc(){}var Td=null,Md=null;function $d(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Id=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,lh=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof lh<"u"?function(e){return lh.resolve(null).then(e).catch(pb)}:Id;function pb(e){setTimeout(function(){throw e})}function Ru(e,t){var n=t,s=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(s===0){e.removeChild(o),ga(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=o}while(n);ga(t)}function Lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ah(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $l=Math.random().toString(36).slice(2),Bs="__reactFiber$"+$l,ja="__reactProps$"+$l,ur="__reactContainer$"+$l,Ad="__reactEvents$"+$l,mb="__reactListeners$"+$l,hb="__reactHandles$"+$l;function ho(e){var t=e[Bs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ur]||n[Bs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ah(e);e!==null;){if(n=e[Bs])return n;e=ah(e)}return t}e=n,n=e.parentNode}return null}function za(e){return e=e[Bs]||e[ur],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function zc(e){return e[ja]||null}var Od=[],el=-1;function Jr(e){return{current:e}}function ht(e){0>el||(e.current=Od[el],Od[el]=null,el--)}function ut(e,t){el++,Od[el]=e.current,e.current=t}var Kr={},wn=Jr(Kr),On=Jr(!1),bo=Kr;function vl(e,t){var n=e.type.contextTypes;if(!n)return Kr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ln(e){return e=e.childContextTypes,e!=null}function ac(){ht(On),ht(wn)}function ih(e,t,n){if(wn.current!==Kr)throw Error(se(168));ut(wn,t),ut(On,n)}function hv(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var o in s)if(!(o in t))throw Error(se(108,Zj(e)||"Unknown",o));return bt({},n,s)}function ic(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kr,bo=wn.current,ut(wn,e),ut(On,On.current),!0}function ch(e,t,n){var s=e.stateNode;if(!s)throw Error(se(169));n?(e=hv(e,t,bo),s.__reactInternalMemoizedMergedChildContext=e,ht(On),ht(wn),ut(wn,e)):ht(On),ut(On,n)}var er=null,Dc=!1,Pu=!1;function gv(e){er===null?er=[e]:er.push(e)}function gb(e){Dc=!0,gv(e)}function Zr(){if(!Pu&&er!==null){Pu=!0;var e=0,t=nt;try{var n=er;for(nt=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}er=null,Dc=!1}catch(o){throw er!==null&&(er=er.slice(e+1)),Bx(Qf,Zr),o}finally{nt=t,Pu=!1}}return null}var tl=[],nl=0,cc=null,uc=0,os=[],ls=0,_o=null,tr=1,nr="";function po(e,t){tl[nl++]=uc,tl[nl++]=cc,cc=e,uc=t}function xv(e,t,n){os[ls++]=tr,os[ls++]=nr,os[ls++]=_o,_o=e;var s=tr;e=nr;var o=32-Ns(s)-1;s&=~(1<<o),n+=1;var l=32-Ns(t)+o;if(30<l){var a=o-o%5;l=(s&(1<<a)-1).toString(32),s>>=a,o-=a,tr=1<<32-Ns(t)+o|n<<o|s,nr=l+e}else tr=1<<l|n<<o|s,nr=e}function op(e){e.return!==null&&(po(e,1),xv(e,1,0))}function lp(e){for(;e===cc;)cc=tl[--nl],tl[nl]=null,uc=tl[--nl],tl[nl]=null;for(;e===_o;)_o=os[--ls],os[ls]=null,nr=os[--ls],os[ls]=null,tr=os[--ls],os[ls]=null}var Qn=null,Kn=null,xt=!1,ks=null;function vv(e,t){var n=is(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qn=e,Kn=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=_o!==null?{id:tr,overflow:nr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=is(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qn=e,Kn=null,!0):!1;default:return!1}}function Ld(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zd(e){if(xt){var t=Kn;if(t){var n=t;if(!uh(e,t)){if(Ld(e))throw Error(se(418));t=Lr(n.nextSibling);var s=Qn;t&&uh(e,t)?vv(s,n):(e.flags=e.flags&-4097|2,xt=!1,Qn=e)}}else{if(Ld(e))throw Error(se(418));e.flags=e.flags&-4097|2,xt=!1,Qn=e}}}function dh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function ai(e){if(e!==Qn)return!1;if(!xt)return dh(e),xt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$d(e.type,e.memoizedProps)),t&&(t=Kn)){if(Ld(e))throw yv(),Error(se(418));for(;t;)vv(e,t),t=Lr(t.nextSibling)}if(dh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=Lr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Qn?Lr(e.stateNode.nextSibling):null;return!0}function yv(){for(var e=Kn;e;)e=Lr(e.nextSibling)}function yl(){Kn=Qn=null,xt=!1}function ap(e){ks===null?ks=[e]:ks.push(e)}var xb=gr.ReactCurrentBatchConfig;function Wl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(se(309));var s=n.stateNode}if(!s)throw Error(se(147,e));var o=s,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var i=o.refs;a===null?delete i[l]:i[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(se(284));if(!n._owner)throw Error(se(290,e))}return e}function ii(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fh(e){var t=e._init;return t(e._payload)}function wv(e){function t(v,x){if(e){var y=v.deletions;y===null?(v.deletions=[x],v.flags|=16):y.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function s(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=Br(v,x),v.index=0,v.sibling=null,v}function l(v,x,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<x?(v.flags|=2,x):y):(v.flags|=2,x)):(v.flags|=1048576,x)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function i(v,x,y,b){return x===null||x.tag!==6?(x=Lu(y,v.mode,b),x.return=v,x):(x=o(x,y),x.return=v,x)}function c(v,x,y,b){var S=y.type;return S===Yo?f(v,x,y.props.children,b,y.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===kr&&fh(S)===x.type)?(b=o(x,y.props),b.ref=Wl(v,x,y),b.return=v,b):(b=Hi(y.type,y.key,y.props,null,v.mode,b),b.ref=Wl(v,x,y),b.return=v,b)}function d(v,x,y,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation?(x=zu(y,v.mode,b),x.return=v,x):(x=o(x,y.children||[]),x.return=v,x)}function f(v,x,y,b,S){return x===null||x.tag!==7?(x=yo(y,v.mode,b,S),x.return=v,x):(x=o(x,y),x.return=v,x)}function m(v,x,y){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Lu(""+x,v.mode,y),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Xa:return y=Hi(x.type,x.key,x.props,null,v.mode,y),y.ref=Wl(v,null,x),y.return=v,y;case Ko:return x=zu(x,v.mode,y),x.return=v,x;case kr:var b=x._init;return m(v,b(x._payload),y)}if(Jl(x)||Fl(x))return x=yo(x,v.mode,y,null),x.return=v,x;ii(v,x)}return null}function p(v,x,y,b){var S=x!==null?x.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:i(v,x,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xa:return y.key===S?c(v,x,y,b):null;case Ko:return y.key===S?d(v,x,y,b):null;case kr:return S=y._init,p(v,x,S(y._payload),b)}if(Jl(y)||Fl(y))return S!==null?null:f(v,x,y,b,null);ii(v,y)}return null}function h(v,x,y,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(y)||null,i(x,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Xa:return v=v.get(b.key===null?y:b.key)||null,c(x,v,b,S);case Ko:return v=v.get(b.key===null?y:b.key)||null,d(x,v,b,S);case kr:var N=b._init;return h(v,x,y,N(b._payload),S)}if(Jl(b)||Fl(b))return v=v.get(y)||null,f(x,v,b,S,null);ii(x,b)}return null}function g(v,x,y,b){for(var S=null,N=null,k=x,C=x=0,O=null;k!==null&&C<y.length;C++){k.index>C?(O=k,k=null):O=k.sibling;var P=p(v,k,y[C],b);if(P===null){k===null&&(k=O);break}e&&k&&P.alternate===null&&t(v,k),x=l(P,x,C),N===null?S=P:N.sibling=P,N=P,k=O}if(C===y.length)return n(v,k),xt&&po(v,C),S;if(k===null){for(;C<y.length;C++)k=m(v,y[C],b),k!==null&&(x=l(k,x,C),N===null?S=k:N.sibling=k,N=k);return xt&&po(v,C),S}for(k=s(v,k);C<y.length;C++)O=h(k,v,C,y[C],b),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?C:O.key),x=l(O,x,C),N===null?S=O:N.sibling=O,N=O);return e&&k.forEach(function(D){return t(v,D)}),xt&&po(v,C),S}function w(v,x,y,b){var S=Fl(y);if(typeof S!="function")throw Error(se(150));if(y=S.call(y),y==null)throw Error(se(151));for(var N=S=null,k=x,C=x=0,O=null,P=y.next();k!==null&&!P.done;C++,P=y.next()){k.index>C?(O=k,k=null):O=k.sibling;var D=p(v,k,P.value,b);if(D===null){k===null&&(k=O);break}e&&k&&D.alternate===null&&t(v,k),x=l(D,x,C),N===null?S=D:N.sibling=D,N=D,k=O}if(P.done)return n(v,k),xt&&po(v,C),S;if(k===null){for(;!P.done;C++,P=y.next())P=m(v,P.value,b),P!==null&&(x=l(P,x,C),N===null?S=P:N.sibling=P,N=P);return xt&&po(v,C),S}for(k=s(v,k);!P.done;C++,P=y.next())P=h(k,v,C,P.value,b),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?C:P.key),x=l(P,x,C),N===null?S=P:N.sibling=P,N=P);return e&&k.forEach(function(W){return t(v,W)}),xt&&po(v,C),S}function j(v,x,y,b){if(typeof y=="object"&&y!==null&&y.type===Yo&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Xa:e:{for(var S=y.key,N=x;N!==null;){if(N.key===S){if(S=y.type,S===Yo){if(N.tag===7){n(v,N.sibling),x=o(N,y.props.children),x.return=v,v=x;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===kr&&fh(S)===N.type){n(v,N.sibling),x=o(N,y.props),x.ref=Wl(v,N,y),x.return=v,v=x;break e}n(v,N);break}else t(v,N);N=N.sibling}y.type===Yo?(x=yo(y.props.children,v.mode,b,y.key),x.return=v,v=x):(b=Hi(y.type,y.key,y.props,null,v.mode,b),b.ref=Wl(v,x,y),b.return=v,v=b)}return a(v);case Ko:e:{for(N=y.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(v,x.sibling),x=o(x,y.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=zu(y,v.mode,b),x.return=v,v=x}return a(v);case kr:return N=y._init,j(v,x,N(y._payload),b)}if(Jl(y))return g(v,x,y,b);if(Fl(y))return w(v,x,y,b);ii(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,y),x.return=v,v=x):(n(v,x),x=Lu(y,v.mode,b),x.return=v,v=x),a(v)):n(v,x)}return j}var wl=wv(!0),jv=wv(!1),dc=Jr(null),fc=null,sl=null,ip=null;function cp(){ip=sl=fc=null}function up(e){var t=dc.current;ht(dc),e._currentValue=t}function Dd(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function dl(e,t){fc=e,ip=sl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(An=!0),e.firstContext=null)}function fs(e){var t=e._currentValue;if(ip!==e)if(e={context:e,memoizedValue:t,next:null},sl===null){if(fc===null)throw Error(se(308));sl=e,fc.dependencies={lanes:0,firstContext:e}}else sl=sl.next=e;return t}var go=null;function dp(e){go===null?go=[e]:go.push(e)}function bv(e,t,n,s){var o=t.interleaved;return o===null?(n.next=n,dp(t)):(n.next=o.next,o.next=n),t.interleaved=n,dr(e,s)}function dr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Nr=!1;function fp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _v(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function or(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Xe&2){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,dr(e,n)}return o=s.interleaved,o===null?(t.next=t,dp(s)):(t.next=o.next,o.next=t),s.interleaved=t,dr(e,n)}function zi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Xf(e,n)}}function ph(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?o=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:l,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function pc(e,t,n,s){var o=e.updateQueue;Nr=!1;var l=o.firstBaseUpdate,a=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var c=i,d=c.next;c.next=null,a===null?l=d:a.next=d,a=c;var f=e.alternate;f!==null&&(f=f.updateQueue,i=f.lastBaseUpdate,i!==a&&(i===null?f.firstBaseUpdate=d:i.next=d,f.lastBaseUpdate=c))}if(l!==null){var m=o.baseState;a=0,f=d=c=null,i=l;do{var p=i.lane,h=i.eventTime;if((s&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var g=e,w=i;switch(p=t,h=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){m=g.call(h,m,p);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,p=typeof g=="function"?g.call(h,m,p):g,p==null)break e;m=bt({},m,p);break e;case 2:Nr=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[i]:p.push(i))}else h={eventTime:h,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},f===null?(d=f=h,c=m):f=f.next=h,a|=p;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;p=i,i=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(f===null&&(c=m),o.baseState=c,o.firstBaseUpdate=d,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);ko|=a,e.lanes=a,e.memoizedState=m}}function mh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],o=s.callback;if(o!==null){if(s.callback=null,s=n,typeof o!="function")throw Error(se(191,o));o.call(s)}}}var Da={},Ws=Jr(Da),ba=Jr(Da),_a=Jr(Da);function xo(e){if(e===Da)throw Error(se(174));return e}function pp(e,t){switch(ut(_a,t),ut(ba,e),ut(Ws,Da),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yd(t,e)}ht(Ws),ut(Ws,t)}function jl(){ht(Ws),ht(ba),ht(_a)}function Sv(e){xo(_a.current);var t=xo(Ws.current),n=yd(t,e.type);t!==n&&(ut(ba,e),ut(Ws,n))}function mp(e){ba.current===e&&(ht(Ws),ht(ba))}var wt=Jr(0);function mc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Tu=[];function hp(){for(var e=0;e<Tu.length;e++)Tu[e]._workInProgressVersionPrimary=null;Tu.length=0}var Di=gr.ReactCurrentDispatcher,Mu=gr.ReactCurrentBatchConfig,So=0,jt=null,Ht=null,nn=null,hc=!1,aa=!1,Sa=0,vb=0;function gn(){throw Error(se(321))}function gp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Es(e[n],t[n]))return!1;return!0}function xp(e,t,n,s,o,l){if(So=l,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Di.current=e===null||e.memoizedState===null?bb:_b,e=n(s,o),aa){l=0;do{if(aa=!1,Sa=0,25<=l)throw Error(se(301));l+=1,nn=Ht=null,t.updateQueue=null,Di.current=Sb,e=n(s,o)}while(aa)}if(Di.current=gc,t=Ht!==null&&Ht.next!==null,So=0,nn=Ht=jt=null,hc=!1,t)throw Error(se(300));return e}function vp(){var e=Sa!==0;return Sa=0,e}function Ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?jt.memoizedState=nn=e:nn=nn.next=e,nn}function ps(){if(Ht===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Ht.next;var t=nn===null?jt.memoizedState:nn.next;if(t!==null)nn=t,Ht=e;else{if(e===null)throw Error(se(310));Ht=e,e={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},nn===null?jt.memoizedState=nn=e:nn=nn.next=e}return nn}function ka(e,t){return typeof t=="function"?t(e):t}function $u(e){var t=ps(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var s=Ht,o=s.baseQueue,l=n.pending;if(l!==null){if(o!==null){var a=o.next;o.next=l.next,l.next=a}s.baseQueue=o=l,n.pending=null}if(o!==null){l=o.next,s=s.baseState;var i=a=null,c=null,d=l;do{var f=d.lane;if((So&f)===f)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var m={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(i=c=m,a=s):c=c.next=m,jt.lanes|=f,ko|=f}d=d.next}while(d!==null&&d!==l);c===null?a=s:c.next=i,Es(s,t.memoizedState)||(An=!0),t.memoizedState=s,t.baseState=a,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){o=e;do l=o.lane,jt.lanes|=l,ko|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Iu(e){var t=ps(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var s=n.dispatch,o=n.pending,l=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do l=e(l,a.action),a=a.next;while(a!==o);Es(l,t.memoizedState)||(An=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,s]}function kv(){}function Nv(e,t){var n=jt,s=ps(),o=t(),l=!Es(s.memoizedState,o);if(l&&(s.memoizedState=o,An=!0),s=s.queue,yp(Rv.bind(null,n,s,e),[e]),s.getSnapshot!==t||l||nn!==null&&nn.memoizedState.tag&1){if(n.flags|=2048,Na(9,Ev.bind(null,n,s,o,t),void 0,null),ln===null)throw Error(se(349));So&30||Cv(n,t,o)}return o}function Cv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ev(e,t,n,s){t.value=n,t.getSnapshot=s,Pv(t)&&Tv(e)}function Rv(e,t,n){return n(function(){Pv(t)&&Tv(e)})}function Pv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Es(e,n)}catch{return!0}}function Tv(e){var t=dr(e,1);t!==null&&Cs(t,e,1,-1)}function hh(e){var t=Ds();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:e},t.queue=e,e=e.dispatch=jb.bind(null,jt,e),[t.memoizedState,e]}function Na(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function Mv(){return ps().memoizedState}function Fi(e,t,n,s){var o=Ds();jt.flags|=e,o.memoizedState=Na(1|t,n,void 0,s===void 0?null:s)}function Fc(e,t,n,s){var o=ps();s=s===void 0?null:s;var l=void 0;if(Ht!==null){var a=Ht.memoizedState;if(l=a.destroy,s!==null&&gp(s,a.deps)){o.memoizedState=Na(t,n,l,s);return}}jt.flags|=e,o.memoizedState=Na(1|t,n,l,s)}function gh(e,t){return Fi(8390656,8,e,t)}function yp(e,t){return Fc(2048,8,e,t)}function $v(e,t){return Fc(4,2,e,t)}function Iv(e,t){return Fc(4,4,e,t)}function Av(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ov(e,t,n){return n=n!=null?n.concat([e]):null,Fc(4,4,Av.bind(null,t,e),n)}function wp(){}function Lv(e,t){var n=ps();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&gp(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function zv(e,t){var n=ps();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&gp(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Dv(e,t,n){return So&21?(Es(n,t)||(n=Hx(),jt.lanes|=n,ko|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,An=!0),e.memoizedState=n)}function yb(e,t){var n=nt;nt=n!==0&&4>n?n:4,e(!0);var s=Mu.transition;Mu.transition={};try{e(!1),t()}finally{nt=n,Mu.transition=s}}function Fv(){return ps().memoizedState}function wb(e,t,n){var s=Fr(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Bv(e))Uv(t,n);else if(n=bv(e,t,n,s),n!==null){var o=Nn();Cs(n,e,s,o),Vv(n,t,s)}}function jb(e,t,n){var s=Fr(e),o={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bv(e))Uv(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,i=l(a,n);if(o.hasEagerState=!0,o.eagerState=i,Es(i,a)){var c=t.interleaved;c===null?(o.next=o,dp(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=bv(e,t,o,s),n!==null&&(o=Nn(),Cs(n,e,s,o),Vv(n,t,s))}}function Bv(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function Uv(e,t){aa=hc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vv(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Xf(e,n)}}var gc={readContext:fs,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},bb={readContext:fs,useCallback:function(e,t){return Ds().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:gh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Fi(4194308,4,Av.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fi(4,2,e,t)},useMemo:function(e,t){var n=Ds();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Ds();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=wb.bind(null,jt,e),[s.memoizedState,e]},useRef:function(e){var t=Ds();return e={current:e},t.memoizedState=e},useState:hh,useDebugValue:wp,useDeferredValue:function(e){return Ds().memoizedState=e},useTransition:function(){var e=hh(!1),t=e[0];return e=yb.bind(null,e[1]),Ds().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=jt,o=Ds();if(xt){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),ln===null)throw Error(se(349));So&30||Cv(s,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,gh(Rv.bind(null,s,l,e),[e]),s.flags|=2048,Na(9,Ev.bind(null,s,l,n,t),void 0,null),n},useId:function(){var e=Ds(),t=ln.identifierPrefix;if(xt){var n=nr,s=tr;n=(s&~(1<<32-Ns(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_b={readContext:fs,useCallback:Lv,useContext:fs,useEffect:yp,useImperativeHandle:Ov,useInsertionEffect:$v,useLayoutEffect:Iv,useMemo:zv,useReducer:$u,useRef:Mv,useState:function(){return $u(ka)},useDebugValue:wp,useDeferredValue:function(e){var t=ps();return Dv(t,Ht.memoizedState,e)},useTransition:function(){var e=$u(ka)[0],t=ps().memoizedState;return[e,t]},useMutableSource:kv,useSyncExternalStore:Nv,useId:Fv,unstable_isNewReconciler:!1},Sb={readContext:fs,useCallback:Lv,useContext:fs,useEffect:yp,useImperativeHandle:Ov,useInsertionEffect:$v,useLayoutEffect:Iv,useMemo:zv,useReducer:Iu,useRef:Mv,useState:function(){return Iu(ka)},useDebugValue:wp,useDeferredValue:function(e){var t=ps();return Ht===null?t.memoizedState=e:Dv(t,Ht.memoizedState,e)},useTransition:function(){var e=Iu(ka)[0],t=ps().memoizedState;return[e,t]},useMutableSource:kv,useSyncExternalStore:Nv,useId:Fv,unstable_isNewReconciler:!1};function _s(e,t){if(e&&e.defaultProps){t=bt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Fd(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:bt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bc={isMounted:function(e){return(e=e._reactInternals)?Ao(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Nn(),o=Fr(e),l=or(s,o);l.payload=t,n!=null&&(l.callback=n),t=zr(e,l,o),t!==null&&(Cs(t,e,o,s),zi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Nn(),o=Fr(e),l=or(s,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=zr(e,l,o),t!==null&&(Cs(t,e,o,s),zi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nn(),s=Fr(e),o=or(n,s);o.tag=2,t!=null&&(o.callback=t),t=zr(e,o,s),t!==null&&(Cs(t,e,s,n),zi(t,e,s))}};function xh(e,t,n,s,o,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,l,a):t.prototype&&t.prototype.isPureReactComponent?!va(n,s)||!va(o,l):!0}function Hv(e,t,n){var s=!1,o=Kr,l=t.contextType;return typeof l=="object"&&l!==null?l=fs(l):(o=Ln(t)?bo:wn.current,s=t.contextTypes,l=(s=s!=null)?vl(e,o):Kr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bc,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function vh(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Bc.enqueueReplaceState(t,t.state,null)}function Bd(e,t,n,s){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},fp(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=fs(l):(l=Ln(t)?bo:wn.current,o.context=vl(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Fd(e,t,l,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Bc.enqueueReplaceState(o,o.state,null),pc(e,n,o,s),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function bl(e,t){try{var n="",s=t;do n+=Jj(s),s=s.return;while(s);var o=n}catch(l){o=`
39
- Error generating stack: `+l.message+`
40
- `+l.stack}return{value:e,source:t,stack:o,digest:null}}function Au(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ud(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kb=typeof WeakMap=="function"?WeakMap:Map;function Wv(e,t,n){n=or(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){vc||(vc=!0,Jd=s),Ud(e,t)},n}function qv(e,t,n){n=or(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var o=t.value;n.payload=function(){return s(o)},n.callback=function(){Ud(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Ud(e,t),typeof s!="function"&&(Dr===null?Dr=new Set([this]):Dr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function yh(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new kb;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(n)||(o.add(n),e=Db.bind(null,e,t,n),t.then(e,e))}function wh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jh(e,t,n,s,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=or(-1,1),t.tag=2,zr(n,t,1))),n.lanes|=1),e)}var Nb=gr.ReactCurrentOwner,An=!1;function bn(e,t,n,s){t.child=e===null?jv(t,null,n,s):wl(t,e.child,n,s)}function bh(e,t,n,s,o){n=n.render;var l=t.ref;return dl(t,o),s=xp(e,t,n,s,l,o),n=vp(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fr(e,t,o)):(xt&&n&&op(t),t.flags|=1,bn(e,t,s,o),t.child)}function _h(e,t,n,s,o){if(e===null){var l=n.type;return typeof l=="function"&&!Ep(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Gv(e,t,l,s,o)):(e=Hi(n.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&o)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:va,n(a,s)&&e.ref===t.ref)return fr(e,t,o)}return t.flags|=1,e=Br(l,s),e.ref=t.ref,e.return=t,t.child=e}function Gv(e,t,n,s,o){if(e!==null){var l=e.memoizedProps;if(va(l,s)&&e.ref===t.ref)if(An=!1,t.pendingProps=s=l,(e.lanes&o)!==0)e.flags&131072&&(An=!0);else return t.lanes=e.lanes,fr(e,t,o)}return Vd(e,t,n,s,o)}function Kv(e,t,n){var s=t.pendingProps,o=s.children,l=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ol,qn),qn|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(ol,qn),qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=l!==null?l.baseLanes:n,ut(ol,qn),qn|=s}else l!==null?(s=l.baseLanes|n,t.memoizedState=null):s=n,ut(ol,qn),qn|=s;return bn(e,t,o,n),t.child}function Yv(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vd(e,t,n,s,o){var l=Ln(n)?bo:wn.current;return l=vl(t,l),dl(t,o),n=xp(e,t,n,s,l,o),s=vp(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fr(e,t,o)):(xt&&s&&op(t),t.flags|=1,bn(e,t,n,o),t.child)}function Sh(e,t,n,s,o){if(Ln(n)){var l=!0;ic(t)}else l=!1;if(dl(t,o),t.stateNode===null)Bi(e,t),Hv(t,n,s),Bd(t,n,s,o),s=!0;else if(e===null){var a=t.stateNode,i=t.memoizedProps;a.props=i;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=fs(d):(d=Ln(n)?bo:wn.current,d=vl(t,d));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";m||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==s||c!==d)&&vh(t,a,s,d),Nr=!1;var p=t.memoizedState;a.state=p,pc(t,s,a,o),c=t.memoizedState,i!==s||p!==c||On.current||Nr?(typeof f=="function"&&(Fd(t,n,f,s),c=t.memoizedState),(i=Nr||xh(t,n,i,s,p,c,d))?(m||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),a.props=s,a.state=c,a.context=d,s=i):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,_v(e,t),i=t.memoizedProps,d=t.type===t.elementType?i:_s(t.type,i),a.props=d,m=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=fs(c):(c=Ln(n)?bo:wn.current,c=vl(t,c));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==m||p!==c)&&vh(t,a,s,c),Nr=!1,p=t.memoizedState,a.state=p,pc(t,s,a,o);var g=t.memoizedState;i!==m||p!==g||On.current||Nr?(typeof h=="function"&&(Fd(t,n,h,s),g=t.memoizedState),(d=Nr||xh(t,n,d,s,p,g,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=g),a.props=s,a.state=g,a.context=c,s=d):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return Hd(e,t,n,s,l,o)}function Hd(e,t,n,s,o,l){Yv(e,t);var a=(t.flags&128)!==0;if(!s&&!a)return o&&ch(t,n,!1),fr(e,t,l);s=t.stateNode,Nb.current=t;var i=a&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&a?(t.child=wl(t,e.child,null,l),t.child=wl(t,null,i,l)):bn(e,t,i,l),t.memoizedState=s.state,o&&ch(t,n,!0),t.child}function Qv(e){var t=e.stateNode;t.pendingContext?ih(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ih(e,t.context,!1),pp(e,t.containerInfo)}function kh(e,t,n,s,o){return yl(),ap(o),t.flags|=256,bn(e,t,n,s),t.child}var Wd={dehydrated:null,treeContext:null,retryLane:0};function qd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xv(e,t,n){var s=t.pendingProps,o=wt.current,l=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ut(wt,o&1),e===null)return zd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=s.children,e=s.fallback,l?(s=t.mode,l=t.child,a={mode:"hidden",children:a},!(s&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=Hc(a,s,0,null),e=yo(e,s,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=qd(n),t.memoizedState=Wd,e):jp(t,a));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return Cb(e,t,a,s,i,o,n);if(l){l=s.fallback,a=t.mode,o=e.child,i=o.sibling;var c={mode:"hidden",children:s.children};return!(a&1)&&t.child!==o?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Br(o,c),s.subtreeFlags=o.subtreeFlags&14680064),i!==null?l=Br(i,l):(l=yo(l,a,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,s=l,l=t.child,a=e.child.memoizedState,a=a===null?qd(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=Wd,s}return l=e.child,e=l.sibling,s=Br(l,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function jp(e,t){return t=Hc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ci(e,t,n,s){return s!==null&&ap(s),wl(t,e.child,null,n),e=jp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cb(e,t,n,s,o,l,a){if(n)return t.flags&256?(t.flags&=-257,s=Au(Error(se(422))),ci(e,t,a,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=s.fallback,o=t.mode,s=Hc({mode:"visible",children:s.children},o,0,null),l=yo(l,o,a,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,t.mode&1&&wl(t,e.child,null,a),t.child.memoizedState=qd(a),t.memoizedState=Wd,l);if(!(t.mode&1))return ci(e,t,a,null);if(o.data==="$!"){if(s=o.nextSibling&&o.nextSibling.dataset,s)var i=s.dgst;return s=i,l=Error(se(419)),s=Au(l,s,void 0),ci(e,t,a,s)}if(i=(a&e.childLanes)!==0,An||i){if(s=ln,s!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(s.suspendedLanes|a)?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,dr(e,o),Cs(s,e,o,-1))}return Cp(),s=Au(Error(se(421))),ci(e,t,a,s)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Fb.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,Kn=Lr(o.nextSibling),Qn=t,xt=!0,ks=null,e!==null&&(os[ls++]=tr,os[ls++]=nr,os[ls++]=_o,tr=e.id,nr=e.overflow,_o=t),t=jp(t,s.children),t.flags|=4096,t)}function Nh(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Dd(e.return,t,n)}function Ou(e,t,n,s,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=n,l.tailMode=o)}function Jv(e,t,n){var s=t.pendingProps,o=s.revealOrder,l=s.tail;if(bn(e,t,s.children,n),s=wt.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nh(e,n,t);else if(e.tag===19)Nh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(ut(wt,s),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&mc(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ou(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&mc(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ou(t,!0,n,null,l);break;case"together":Ou(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ko|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=Br(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Br(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Eb(e,t,n){switch(t.tag){case 3:Qv(t),yl();break;case 5:Sv(t);break;case 1:Ln(t.type)&&ic(t);break;case 4:pp(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,o=t.memoizedProps.value;ut(dc,s._currentValue),s._currentValue=o;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(ut(wt,wt.current&1),t.flags|=128,null):n&t.child.childLanes?Xv(e,t,n):(ut(wt,wt.current&1),e=fr(e,t,n),e!==null?e.sibling:null);ut(wt,wt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Jv(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ut(wt,wt.current),s)break;return null;case 22:case 23:return t.lanes=0,Kv(e,t,n)}return fr(e,t,n)}var Zv,Gd,ey,ty;Zv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Gd=function(){};ey=function(e,t,n,s){var o=e.memoizedProps;if(o!==s){e=t.stateNode,xo(Ws.current);var l=null;switch(n){case"input":o=hd(e,o),s=hd(e,s),l=[];break;case"select":o=bt({},o,{value:void 0}),s=bt({},s,{value:void 0}),l=[];break;case"textarea":o=vd(e,o),s=vd(e,s),l=[];break;default:typeof o.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=lc)}wd(n,s);var a;n=null;for(d in o)if(!s.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var i=o[d];for(a in i)i.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(da.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in s){var c=s[d];if(i=o!=null?o[d]:void 0,s.hasOwnProperty(d)&&c!==i&&(c!=null||i!=null))if(d==="style")if(i){for(a in i)!i.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&i[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(l||(l=[]),l.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,i=i?i.__html:void 0,c!=null&&i!==c&&(l=l||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(da.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&mt("scroll",e),l||i===c||(l=[])):(l=l||[]).push(d,c))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};ty=function(e,t,n,s){n!==s&&(t.flags|=4)};function ql(e,t){if(!xt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function xn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags&14680064,s|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Rb(e,t,n){var s=t.pendingProps;switch(lp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Ln(t.type)&&ac(),xn(t),null;case 3:return s=t.stateNode,jl(),ht(On),ht(wn),hp(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ai(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ks!==null&&(tf(ks),ks=null))),Gd(e,t),xn(t),null;case 5:mp(t);var o=xo(_a.current);if(n=t.type,e!==null&&t.stateNode!=null)ey(e,t,n,s,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(se(166));return xn(t),null}if(e=xo(Ws.current),ai(t)){s=t.stateNode,n=t.type;var l=t.memoizedProps;switch(s[Bs]=t,s[ja]=l,e=(t.mode&1)!==0,n){case"dialog":mt("cancel",s),mt("close",s);break;case"iframe":case"object":case"embed":mt("load",s);break;case"video":case"audio":for(o=0;o<ea.length;o++)mt(ea[o],s);break;case"source":mt("error",s);break;case"img":case"image":case"link":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"input":Am(s,l),mt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!l.multiple},mt("invalid",s);break;case"textarea":Lm(s,l),mt("invalid",s)}wd(n,l),o=null;for(var a in l)if(l.hasOwnProperty(a)){var i=l[a];a==="children"?typeof i=="string"?s.textContent!==i&&(l.suppressHydrationWarning!==!0&&li(s.textContent,i,e),o=["children",i]):typeof i=="number"&&s.textContent!==""+i&&(l.suppressHydrationWarning!==!0&&li(s.textContent,i,e),o=["children",""+i]):da.hasOwnProperty(a)&&i!=null&&a==="onScroll"&&mt("scroll",s)}switch(n){case"input":Ja(s),Om(s,l,!0);break;case"textarea":Ja(s),zm(s);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(s.onclick=lc)}s=o,t.updateQueue=s,s!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Rx(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=a.createElement(n,{is:s.is}):(e=a.createElement(n),n==="select"&&(a=e,s.multiple?a.multiple=!0:s.size&&(a.size=s.size))):e=a.createElementNS(e,n),e[Bs]=t,e[ja]=s,Zv(e,t,!1,!1),t.stateNode=e;e:{switch(a=jd(n,s),n){case"dialog":mt("cancel",e),mt("close",e),o=s;break;case"iframe":case"object":case"embed":mt("load",e),o=s;break;case"video":case"audio":for(o=0;o<ea.length;o++)mt(ea[o],e);o=s;break;case"source":mt("error",e),o=s;break;case"img":case"image":case"link":mt("error",e),mt("load",e),o=s;break;case"details":mt("toggle",e),o=s;break;case"input":Am(e,s),o=hd(e,s),mt("invalid",e);break;case"option":o=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},o=bt({},s,{value:void 0}),mt("invalid",e);break;case"textarea":Lm(e,s),o=vd(e,s),mt("invalid",e);break;default:o=s}wd(n,o),i=o;for(l in i)if(i.hasOwnProperty(l)){var c=i[l];l==="style"?Mx(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Px(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&fa(e,c):typeof c=="number"&&fa(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(da.hasOwnProperty(l)?c!=null&&l==="onScroll"&&mt("scroll",e):c!=null&&Wf(e,l,c,a))}switch(n){case"input":Ja(e),Om(e,s,!1);break;case"textarea":Ja(e),zm(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Gr(s.value));break;case"select":e.multiple=!!s.multiple,l=s.value,l!=null?al(e,!!s.multiple,l,!1):s.defaultValue!=null&&al(e,!!s.multiple,s.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=lc)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)ty(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(se(166));if(n=xo(_a.current),xo(Ws.current),ai(t)){if(s=t.stateNode,n=t.memoizedProps,s[Bs]=t,(l=s.nodeValue!==n)&&(e=Qn,e!==null))switch(e.tag){case 3:li(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&li(s.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Bs]=t,t.stateNode=s}return xn(t),null;case 13:if(ht(wt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&Kn!==null&&t.mode&1&&!(t.flags&128))yv(),yl(),t.flags|=98560,l=!1;else if(l=ai(t),s!==null&&s.dehydrated!==null){if(e===null){if(!l)throw Error(se(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(se(317));l[Bs]=t}else yl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xn(t),l=!1}else ks!==null&&(tf(ks),ks=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||wt.current&1?Wt===0&&(Wt=3):Cp())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return jl(),Gd(e,t),e===null&&ya(t.stateNode.containerInfo),xn(t),null;case 10:return up(t.type._context),xn(t),null;case 17:return Ln(t.type)&&ac(),xn(t),null;case 19:if(ht(wt),l=t.memoizedState,l===null)return xn(t),null;if(s=(t.flags&128)!==0,a=l.rendering,a===null)if(s)ql(l,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=mc(e),a!==null){for(t.flags|=128,ql(l,!1),s=a.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)l=n,e=s,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ut(wt,wt.current&1|2),t.child}e=e.sibling}l.tail!==null&&At()>_l&&(t.flags|=128,s=!0,ql(l,!1),t.lanes=4194304)}else{if(!s)if(e=mc(a),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ql(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!xt)return xn(t),null}else 2*At()-l.renderingStartTime>_l&&n!==1073741824&&(t.flags|=128,s=!0,ql(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=At(),t.sibling=null,n=wt.current,ut(wt,s?n&1|2:n&1),t):(xn(t),null);case 22:case 23:return Np(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?qn&1073741824&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function Pb(e,t){switch(lp(t),t.tag){case 1:return Ln(t.type)&&ac(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jl(),ht(On),ht(wn),hp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mp(t),null;case 13:if(ht(wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(wt),null;case 4:return jl(),null;case 10:return up(t.type._context),null;case 22:case 23:return Np(),null;case 24:return null;default:return null}}var ui=!1,yn=!1,Tb=typeof WeakSet=="function"?WeakSet:Set,ye=null;function rl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Nt(e,t,s)}else n.current=null}function Kd(e,t,n){try{n()}catch(s){Nt(e,t,s)}}var Ch=!1;function Mb(e,t){if(Td=sc,e=lv(),rp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,l=s.focusNode;s=s.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,i=-1,c=-1,d=0,f=0,m=e,p=null;t:for(;;){for(var h;m!==n||o!==0&&m.nodeType!==3||(i=a+o),m!==l||s!==0&&m.nodeType!==3||(c=a+s),m.nodeType===3&&(a+=m.nodeValue.length),(h=m.firstChild)!==null;)p=m,m=h;for(;;){if(m===e)break t;if(p===n&&++d===o&&(i=a),p===l&&++f===s&&(c=a),(h=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=h}n=i===-1||c===-1?null:{start:i,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Md={focusedElem:e,selectionRange:n},sc=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,j=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?w:_s(t.type,w),j);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(b){Nt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=Ch,Ch=!1,g}function ia(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&Kd(t,n,l)}o=o.next}while(o!==s)}}function Uc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Yd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ny(e){var t=e.alternate;t!==null&&(e.alternate=null,ny(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bs],delete t[ja],delete t[Ad],delete t[mb],delete t[hb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sy(e){return e.tag===5||e.tag===3||e.tag===4}function Eh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sy(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qd(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lc));else if(s!==4&&(e=e.child,e!==null))for(Qd(e,t,n),e=e.sibling;e!==null;)Qd(e,t,n),e=e.sibling}function Xd(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Xd(e,t,n),e=e.sibling;e!==null;)Xd(e,t,n),e=e.sibling}var cn=null,Ss=!1;function jr(e,t,n){for(n=n.child;n!==null;)ry(e,t,n),n=n.sibling}function ry(e,t,n){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(Ic,n)}catch{}switch(n.tag){case 5:yn||rl(n,t);case 6:var s=cn,o=Ss;cn=null,jr(e,t,n),cn=s,Ss=o,cn!==null&&(Ss?(e=cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cn.removeChild(n.stateNode));break;case 18:cn!==null&&(Ss?(e=cn,n=n.stateNode,e.nodeType===8?Ru(e.parentNode,n):e.nodeType===1&&Ru(e,n),ga(e)):Ru(cn,n.stateNode));break;case 4:s=cn,o=Ss,cn=n.stateNode.containerInfo,Ss=!0,jr(e,t,n),cn=s,Ss=o;break;case 0:case 11:case 14:case 15:if(!yn&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){o=s=s.next;do{var l=o,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&Kd(n,t,a),o=o.next}while(o!==s)}jr(e,t,n);break;case 1:if(!yn&&(rl(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(i){Nt(n,t,i)}jr(e,t,n);break;case 21:jr(e,t,n);break;case 22:n.mode&1?(yn=(s=yn)||n.memoizedState!==null,jr(e,t,n),yn=s):jr(e,t,n);break;default:jr(e,t,n)}}function Rh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tb),t.forEach(function(s){var o=Bb.bind(null,e,s);n.has(s)||(n.add(s),s.then(o,o))})}}function js(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];try{var l=e,a=t,i=a;e:for(;i!==null;){switch(i.tag){case 5:cn=i.stateNode,Ss=!1;break e;case 3:cn=i.stateNode.containerInfo,Ss=!0;break e;case 4:cn=i.stateNode.containerInfo,Ss=!0;break e}i=i.return}if(cn===null)throw Error(se(160));ry(l,a,o),cn=null,Ss=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Nt(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)oy(t,e),t=t.sibling}function oy(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(js(t,e),$s(e),s&4){try{ia(3,e,e.return),Uc(3,e)}catch(w){Nt(e,e.return,w)}try{ia(5,e,e.return)}catch(w){Nt(e,e.return,w)}}break;case 1:js(t,e),$s(e),s&512&&n!==null&&rl(n,n.return);break;case 5:if(js(t,e),$s(e),s&512&&n!==null&&rl(n,n.return),e.flags&32){var o=e.stateNode;try{fa(o,"")}catch(w){Nt(e,e.return,w)}}if(s&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,i=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{i==="input"&&l.type==="radio"&&l.name!=null&&Cx(o,l),jd(i,a);var d=jd(i,l);for(a=0;a<c.length;a+=2){var f=c[a],m=c[a+1];f==="style"?Mx(o,m):f==="dangerouslySetInnerHTML"?Px(o,m):f==="children"?fa(o,m):Wf(o,f,m,d)}switch(i){case"input":gd(o,l);break;case"textarea":Ex(o,l);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var h=l.value;h!=null?al(o,!!l.multiple,h,!1):p!==!!l.multiple&&(l.defaultValue!=null?al(o,!!l.multiple,l.defaultValue,!0):al(o,!!l.multiple,l.multiple?[]:"",!1))}o[ja]=l}catch(w){Nt(e,e.return,w)}}break;case 6:if(js(t,e),$s(e),s&4){if(e.stateNode===null)throw Error(se(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(w){Nt(e,e.return,w)}}break;case 3:if(js(t,e),$s(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ga(t.containerInfo)}catch(w){Nt(e,e.return,w)}break;case 4:js(t,e),$s(e);break;case 13:js(t,e),$s(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Sp=At())),s&4&&Rh(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(d=yn)||f,js(t,e),yn=d):js(t,e),$s(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&e.mode&1)for(ye=e,f=e.child;f!==null;){for(m=ye=f;ye!==null;){switch(p=ye,h=p.child,p.tag){case 0:case 11:case 14:case 15:ia(4,p,p.return);break;case 1:rl(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){s=p,n=p.return;try{t=s,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(w){Nt(s,n,w)}}break;case 5:rl(p,p.return);break;case 22:if(p.memoizedState!==null){Th(m);continue}}h!==null?(h.return=p,ye=h):Th(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{o=m.stateNode,d?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(i=m.stateNode,c=m.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,i.style.display=Tx("display",a))}catch(w){Nt(e,e.return,w)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(w){Nt(e,e.return,w)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:js(t,e),$s(e),s&4&&Rh(e);break;case 21:break;default:js(t,e),$s(e)}}function $s(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(sy(n)){var s=n;break e}n=n.return}throw Error(se(160))}switch(s.tag){case 5:var o=s.stateNode;s.flags&32&&(fa(o,""),s.flags&=-33);var l=Eh(e);Xd(e,l,o);break;case 3:case 4:var a=s.stateNode.containerInfo,i=Eh(e);Qd(e,i,a);break;default:throw Error(se(161))}}catch(c){Nt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $b(e,t,n){ye=e,ly(e)}function ly(e,t,n){for(var s=(e.mode&1)!==0;ye!==null;){var o=ye,l=o.child;if(o.tag===22&&s){var a=o.memoizedState!==null||ui;if(!a){var i=o.alternate,c=i!==null&&i.memoizedState!==null||yn;i=ui;var d=yn;if(ui=a,(yn=c)&&!d)for(ye=o;ye!==null;)a=ye,c=a.child,a.tag===22&&a.memoizedState!==null?Mh(o):c!==null?(c.return=a,ye=c):Mh(o);for(;l!==null;)ye=l,ly(l),l=l.sibling;ye=o,ui=i,yn=d}Ph(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,ye=l):Ph(e)}}function Ph(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||Uc(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!yn)if(n===null)s.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_s(t.type,n.memoizedProps);s.componentDidUpdate(o,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&mh(t,l,s);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mh(t,a,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&ga(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}yn||t.flags&512&&Yd(t)}catch(p){Nt(t,t.return,p)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Th(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Mh(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Uc(4,t)}catch(c){Nt(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var o=t.return;try{s.componentDidMount()}catch(c){Nt(t,o,c)}}var l=t.return;try{Yd(t)}catch(c){Nt(t,l,c)}break;case 5:var a=t.return;try{Yd(t)}catch(c){Nt(t,a,c)}}}catch(c){Nt(t,t.return,c)}if(t===e){ye=null;break}var i=t.sibling;if(i!==null){i.return=t.return,ye=i;break}ye=t.return}}var Ib=Math.ceil,xc=gr.ReactCurrentDispatcher,bp=gr.ReactCurrentOwner,us=gr.ReactCurrentBatchConfig,Xe=0,ln=null,Ft=null,un=0,qn=0,ol=Jr(0),Wt=0,Ca=null,ko=0,Vc=0,_p=0,ca=null,In=null,Sp=0,_l=1/0,Js=null,vc=!1,Jd=null,Dr=null,di=!1,Tr=null,yc=0,ua=0,Zd=null,Ui=-1,Vi=0;function Nn(){return Xe&6?At():Ui!==-1?Ui:Ui=At()}function Fr(e){return e.mode&1?Xe&2&&un!==0?un&-un:xb.transition!==null?(Vi===0&&(Vi=Hx()),Vi):(e=nt,e!==0||(e=window.event,e=e===void 0?16:Xx(e.type)),e):1}function Cs(e,t,n,s){if(50<ua)throw ua=0,Zd=null,Error(se(185));Oa(e,n,s),(!(Xe&2)||e!==ln)&&(e===ln&&(!(Xe&2)&&(Vc|=n),Wt===4&&Er(e,un)),zn(e,s),n===1&&Xe===0&&!(t.mode&1)&&(_l=At()+500,Dc&&Zr()))}function zn(e,t){var n=e.callbackNode;x1(e,t);var s=nc(e,e===ln?un:0);if(s===0)n!==null&&Bm(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Bm(n),t===1)e.tag===0?gb($h.bind(null,e)):gv($h.bind(null,e)),fb(function(){!(Xe&6)&&Zr()}),n=null;else{switch(Wx(s)){case 1:n=Qf;break;case 4:n=Ux;break;case 16:n=tc;break;case 536870912:n=Vx;break;default:n=tc}n=my(n,ay.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ay(e,t){if(Ui=-1,Vi=0,Xe&6)throw Error(se(327));var n=e.callbackNode;if(fl()&&e.callbackNode!==n)return null;var s=nc(e,e===ln?un:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=wc(e,s);else{t=s;var o=Xe;Xe|=2;var l=cy();(ln!==e||un!==t)&&(Js=null,_l=At()+500,vo(e,t));do try{Lb();break}catch(i){iy(e,i)}while(!0);cp(),xc.current=l,Xe=o,Ft!==null?t=0:(ln=null,un=0,t=Wt)}if(t!==0){if(t===2&&(o=Nd(e),o!==0&&(s=o,t=ef(e,o))),t===1)throw n=Ca,vo(e,0),Er(e,s),zn(e,At()),n;if(t===6)Er(e,s);else{if(o=e.current.alternate,!(s&30)&&!Ab(o)&&(t=wc(e,s),t===2&&(l=Nd(e),l!==0&&(s=l,t=ef(e,l))),t===1))throw n=Ca,vo(e,0),Er(e,s),zn(e,At()),n;switch(e.finishedWork=o,e.finishedLanes=s,t){case 0:case 1:throw Error(se(345));case 2:mo(e,In,Js);break;case 3:if(Er(e,s),(s&130023424)===s&&(t=Sp+500-At(),10<t)){if(nc(e,0)!==0)break;if(o=e.suspendedLanes,(o&s)!==s){Nn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Id(mo.bind(null,e,In,Js),t);break}mo(e,In,Js);break;case 4:if(Er(e,s),(s&4194240)===s)break;for(t=e.eventTimes,o=-1;0<s;){var a=31-Ns(s);l=1<<a,a=t[a],a>o&&(o=a),s&=~l}if(s=o,s=At()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Ib(s/1960))-s,10<s){e.timeoutHandle=Id(mo.bind(null,e,In,Js),s);break}mo(e,In,Js);break;case 5:mo(e,In,Js);break;default:throw Error(se(329))}}}return zn(e,At()),e.callbackNode===n?ay.bind(null,e):null}function ef(e,t){var n=ca;return e.current.memoizedState.isDehydrated&&(vo(e,t).flags|=256),e=wc(e,t),e!==2&&(t=In,In=n,t!==null&&tf(t)),e}function tf(e){In===null?In=e:In.push.apply(In,e)}function Ab(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var o=n[s],l=o.getSnapshot;o=o.value;try{if(!Es(l(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t){for(t&=~_p,t&=~Vc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ns(t),s=1<<n;e[n]=-1,t&=~s}}function $h(e){if(Xe&6)throw Error(se(327));fl();var t=nc(e,0);if(!(t&1))return zn(e,At()),null;var n=wc(e,t);if(e.tag!==0&&n===2){var s=Nd(e);s!==0&&(t=s,n=ef(e,s))}if(n===1)throw n=Ca,vo(e,0),Er(e,t),zn(e,At()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mo(e,In,Js),zn(e,At()),null}function kp(e,t){var n=Xe;Xe|=1;try{return e(t)}finally{Xe=n,Xe===0&&(_l=At()+500,Dc&&Zr())}}function No(e){Tr!==null&&Tr.tag===0&&!(Xe&6)&&fl();var t=Xe;Xe|=1;var n=us.transition,s=nt;try{if(us.transition=null,nt=1,e)return e()}finally{nt=s,us.transition=n,Xe=t,!(Xe&6)&&Zr()}}function Np(){qn=ol.current,ht(ol)}function vo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,db(n)),Ft!==null)for(n=Ft.return;n!==null;){var s=n;switch(lp(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&ac();break;case 3:jl(),ht(On),ht(wn),hp();break;case 5:mp(s);break;case 4:jl();break;case 13:ht(wt);break;case 19:ht(wt);break;case 10:up(s.type._context);break;case 22:case 23:Np()}n=n.return}if(ln=e,Ft=e=Br(e.current,null),un=qn=t,Wt=0,Ca=null,_p=Vc=ko=0,In=ca=null,go!==null){for(t=0;t<go.length;t++)if(n=go[t],s=n.interleaved,s!==null){n.interleaved=null;var o=s.next,l=n.pending;if(l!==null){var a=l.next;l.next=o,s.next=a}n.pending=s}go=null}return e}function iy(e,t){do{var n=Ft;try{if(cp(),Di.current=gc,hc){for(var s=jt.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}hc=!1}if(So=0,nn=Ht=jt=null,aa=!1,Sa=0,bp.current=null,n===null||n.return===null){Wt=1,Ca=t,Ft=null;break}e:{var l=e,a=n.return,i=n,c=t;if(t=un,i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,f=i,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=wh(a);if(h!==null){h.flags&=-257,jh(h,a,i,l,t),h.mode&1&&yh(l,d,t),t=h,c=d;var g=t.updateQueue;if(g===null){var w=new Set;w.add(c),t.updateQueue=w}else g.add(c);break e}else{if(!(t&1)){yh(l,d,t),Cp();break e}c=Error(se(426))}}else if(xt&&i.mode&1){var j=wh(a);if(j!==null){!(j.flags&65536)&&(j.flags|=256),jh(j,a,i,l,t),ap(bl(c,i));break e}}l=c=bl(c,i),Wt!==4&&(Wt=2),ca===null?ca=[l]:ca.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=Wv(l,c,t);ph(l,v);break e;case 1:i=c;var x=l.type,y=l.stateNode;if(!(l.flags&128)&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Dr===null||!Dr.has(y)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=qv(l,i,t);ph(l,b);break e}}l=l.return}while(l!==null)}dy(n)}catch(S){t=S,Ft===n&&n!==null&&(Ft=n=n.return);continue}break}while(!0)}function cy(){var e=xc.current;return xc.current=gc,e===null?gc:e}function Cp(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),ln===null||!(ko&268435455)&&!(Vc&268435455)||Er(ln,un)}function wc(e,t){var n=Xe;Xe|=2;var s=cy();(ln!==e||un!==t)&&(Js=null,vo(e,t));do try{Ob();break}catch(o){iy(e,o)}while(!0);if(cp(),Xe=n,xc.current=s,Ft!==null)throw Error(se(261));return ln=null,un=0,Wt}function Ob(){for(;Ft!==null;)uy(Ft)}function Lb(){for(;Ft!==null&&!i1();)uy(Ft)}function uy(e){var t=py(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?dy(e):Ft=t,bp.current=null}function dy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Pb(n,t),n!==null){n.flags&=32767,Ft=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,Ft=null;return}}else if(n=Rb(n,t,qn),n!==null){Ft=n;return}if(t=t.sibling,t!==null){Ft=t;return}Ft=t=e}while(t!==null);Wt===0&&(Wt=5)}function mo(e,t,n){var s=nt,o=us.transition;try{us.transition=null,nt=1,zb(e,t,n,s)}finally{us.transition=o,nt=s}return null}function zb(e,t,n,s){do fl();while(Tr!==null);if(Xe&6)throw Error(se(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(v1(e,l),e===ln&&(Ft=ln=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||di||(di=!0,my(tc,function(){return fl(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=us.transition,us.transition=null;var a=nt;nt=1;var i=Xe;Xe|=4,bp.current=null,Mb(e,n),oy(n,e),rb(Md),sc=!!Td,Md=Td=null,e.current=n,$b(n),c1(),Xe=i,nt=a,us.transition=l}else e.current=n;if(di&&(di=!1,Tr=e,yc=o),l=e.pendingLanes,l===0&&(Dr=null),f1(n.stateNode),zn(e,At()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],s(o.value,{componentStack:o.stack,digest:o.digest});if(vc)throw vc=!1,e=Jd,Jd=null,e;return yc&1&&e.tag!==0&&fl(),l=e.pendingLanes,l&1?e===Zd?ua++:(ua=0,Zd=e):ua=0,Zr(),null}function fl(){if(Tr!==null){var e=Wx(yc),t=us.transition,n=nt;try{if(us.transition=null,nt=16>e?16:e,Tr===null)var s=!1;else{if(e=Tr,Tr=null,yc=0,Xe&6)throw Error(se(331));var o=Xe;for(Xe|=4,ye=e.current;ye!==null;){var l=ye,a=l.child;if(ye.flags&16){var i=l.deletions;if(i!==null){for(var c=0;c<i.length;c++){var d=i[c];for(ye=d;ye!==null;){var f=ye;switch(f.tag){case 0:case 11:case 15:ia(8,f,l)}var m=f.child;if(m!==null)m.return=f,ye=m;else for(;ye!==null;){f=ye;var p=f.sibling,h=f.return;if(ny(f),f===d){ye=null;break}if(p!==null){p.return=h,ye=p;break}ye=h}}}var g=l.alternate;if(g!==null){var w=g.child;if(w!==null){g.child=null;do{var j=w.sibling;w.sibling=null,w=j}while(w!==null)}}ye=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,ye=a;else e:for(;ye!==null;){if(l=ye,l.flags&2048)switch(l.tag){case 0:case 11:case 15:ia(9,l,l.return)}var v=l.sibling;if(v!==null){v.return=l.return,ye=v;break e}ye=l.return}}var x=e.current;for(ye=x;ye!==null;){a=ye;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,ye=y;else e:for(a=x;ye!==null;){if(i=ye,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:Uc(9,i)}}catch(S){Nt(i,i.return,S)}if(i===a){ye=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,ye=b;break e}ye=i.return}}if(Xe=o,Zr(),Hs&&typeof Hs.onPostCommitFiberRoot=="function")try{Hs.onPostCommitFiberRoot(Ic,e)}catch{}s=!0}return s}finally{nt=n,us.transition=t}}return!1}function Ih(e,t,n){t=bl(n,t),t=Wv(e,t,1),e=zr(e,t,1),t=Nn(),e!==null&&(Oa(e,1,t),zn(e,t))}function Nt(e,t,n){if(e.tag===3)Ih(e,e,n);else for(;t!==null;){if(t.tag===3){Ih(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Dr===null||!Dr.has(s))){e=bl(n,e),e=qv(t,e,1),t=zr(t,e,1),e=Nn(),t!==null&&(Oa(t,1,e),zn(t,e));break}}t=t.return}}function Db(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Nn(),e.pingedLanes|=e.suspendedLanes&n,ln===e&&(un&n)===n&&(Wt===4||Wt===3&&(un&130023424)===un&&500>At()-Sp?vo(e,0):_p|=n),zn(e,t)}function fy(e,t){t===0&&(e.mode&1?(t=ti,ti<<=1,!(ti&130023424)&&(ti=4194304)):t=1);var n=Nn();e=dr(e,t),e!==null&&(Oa(e,t,n),zn(e,n))}function Fb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fy(e,n)}function Bb(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(se(314))}s!==null&&s.delete(t),fy(e,n)}var py;py=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||On.current)An=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return An=!1,Eb(e,t,n);An=!!(e.flags&131072)}else An=!1,xt&&t.flags&1048576&&xv(t,uc,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Bi(e,t),e=t.pendingProps;var o=vl(t,wn.current);dl(t,n),o=xp(null,t,s,e,o,n);var l=vp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ln(s)?(l=!0,ic(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fp(t),o.updater=Bc,t.stateNode=o,o._reactInternals=t,Bd(t,s,e,n),t=Hd(null,t,s,!0,l,n)):(t.tag=0,xt&&l&&op(t),bn(null,t,o,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Bi(e,t),e=t.pendingProps,o=s._init,s=o(s._payload),t.type=s,o=t.tag=Vb(s),e=_s(s,e),o){case 0:t=Vd(null,t,s,e,n);break e;case 1:t=Sh(null,t,s,e,n);break e;case 11:t=bh(null,t,s,e,n);break e;case 14:t=_h(null,t,s,_s(s.type,e),n);break e}throw Error(se(306,s,""))}return t;case 0:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Vd(e,t,s,o,n);case 1:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Sh(e,t,s,o,n);case 3:e:{if(Qv(t),e===null)throw Error(se(387));s=t.pendingProps,l=t.memoizedState,o=l.element,_v(e,t),pc(t,s,null,n);var a=t.memoizedState;if(s=a.element,l.isDehydrated)if(l={element:s,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=bl(Error(se(423)),t),t=kh(e,t,s,n,o);break e}else if(s!==o){o=bl(Error(se(424)),t),t=kh(e,t,s,n,o);break e}else for(Kn=Lr(t.stateNode.containerInfo.firstChild),Qn=t,xt=!0,ks=null,n=jv(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yl(),s===o){t=fr(e,t,n);break e}bn(e,t,s,n)}t=t.child}return t;case 5:return Sv(t),e===null&&zd(t),s=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,a=o.children,$d(s,o)?a=null:l!==null&&$d(s,l)&&(t.flags|=32),Yv(e,t),bn(e,t,a,n),t.child;case 6:return e===null&&zd(t),null;case 13:return Xv(e,t,n);case 4:return pp(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=wl(t,null,s,n):bn(e,t,s,n),t.child;case 11:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),bh(e,t,s,o,n);case 7:return bn(e,t,t.pendingProps,n),t.child;case 8:return bn(e,t,t.pendingProps.children,n),t.child;case 12:return bn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,o=t.pendingProps,l=t.memoizedProps,a=o.value,ut(dc,s._currentValue),s._currentValue=a,l!==null)if(Es(l.value,a)){if(l.children===o.children&&!On.current){t=fr(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var i=l.dependencies;if(i!==null){a=l.child;for(var c=i.firstContext;c!==null;){if(c.context===s){if(l.tag===1){c=or(-1,n&-n),c.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Dd(l.return,n,t),i.lanes|=n;break}c=c.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(se(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),Dd(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}bn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps.children,dl(t,n),o=fs(o),s=s(o),t.flags|=1,bn(e,t,s,n),t.child;case 14:return s=t.type,o=_s(s,t.pendingProps),o=_s(s.type,o),_h(e,t,s,o,n);case 15:return Gv(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Bi(e,t),t.tag=1,Ln(s)?(e=!0,ic(t)):e=!1,dl(t,n),Hv(t,s,o),Bd(t,s,o,n),Hd(null,t,s,!0,e,n);case 19:return Jv(e,t,n);case 22:return Kv(e,t,n)}throw Error(se(156,t.tag))};function my(e,t){return Bx(e,t)}function Ub(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function is(e,t,n,s){return new Ub(e,t,n,s)}function Ep(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vb(e){if(typeof e=="function")return Ep(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gf)return 11;if(e===Kf)return 14}return 2}function Br(e,t){var n=e.alternate;return n===null?(n=is(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hi(e,t,n,s,o,l){var a=2;if(s=e,typeof e=="function")Ep(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Yo:return yo(n.children,o,l,t);case qf:a=8,o|=8;break;case dd:return e=is(12,n,t,o|2),e.elementType=dd,e.lanes=l,e;case fd:return e=is(13,n,t,o),e.elementType=fd,e.lanes=l,e;case pd:return e=is(19,n,t,o),e.elementType=pd,e.lanes=l,e;case Sx:return Hc(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bx:a=10;break e;case _x:a=9;break e;case Gf:a=11;break e;case Kf:a=14;break e;case kr:a=16,s=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=is(a,n,t,o),t.elementType=e,t.type=s,t.lanes=l,t}function yo(e,t,n,s){return e=is(7,e,s,t),e.lanes=n,e}function Hc(e,t,n,s){return e=is(22,e,s,t),e.elementType=Sx,e.lanes=n,e.stateNode={isHidden:!1},e}function Lu(e,t,n){return e=is(6,e,null,t),e.lanes=n,e}function zu(e,t,n){return t=is(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hb(e,t,n,s,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vu(0),this.expirationTimes=vu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vu(0),this.identifierPrefix=s,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Rp(e,t,n,s,o,l,a,i,c){return e=new Hb(e,t,n,i,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=is(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fp(l),e}function Wb(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ko,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function hy(e){if(!e)return Kr;e=e._reactInternals;e:{if(Ao(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ln(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(Ln(n))return hv(e,n,t)}return t}function gy(e,t,n,s,o,l,a,i,c){return e=Rp(n,s,!0,e,o,l,a,i,c),e.context=hy(null),n=e.current,s=Nn(),o=Fr(n),l=or(s,o),l.callback=t??null,zr(n,l,o),e.current.lanes=o,Oa(e,o,s),zn(e,s),e}function Wc(e,t,n,s){var o=t.current,l=Nn(),a=Fr(o);return n=hy(n),t.context===null?t.context=n:t.pendingContext=n,t=or(l,a),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=zr(o,t,a),e!==null&&(Cs(e,o,a,l),zi(e,o,a)),a}function jc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ah(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Pp(e,t){Ah(e,t),(e=e.alternate)&&Ah(e,t)}function qb(){return null}var xy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Tp(e){this._internalRoot=e}qc.prototype.render=Tp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Wc(e,t,null,null)};qc.prototype.unmount=Tp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;No(function(){Wc(null,e,null,null)}),t[ur]=null}};function qc(e){this._internalRoot=e}qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cr.length&&t!==0&&t<Cr[n].priority;n++);Cr.splice(n,0,e),n===0&&Qx(e)}};function Mp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Oh(){}function Gb(e,t,n,s,o){if(o){if(typeof s=="function"){var l=s;s=function(){var d=jc(a);l.call(d)}}var a=gy(t,s,e,0,null,!1,!1,"",Oh);return e._reactRootContainer=a,e[ur]=a.current,ya(e.nodeType===8?e.parentNode:e),No(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof s=="function"){var i=s;s=function(){var d=jc(c);i.call(d)}}var c=Rp(e,0,!1,null,null,!1,!1,"",Oh);return e._reactRootContainer=c,e[ur]=c.current,ya(e.nodeType===8?e.parentNode:e),No(function(){Wc(t,c,n,s)}),c}function Kc(e,t,n,s,o){var l=n._reactRootContainer;if(l){var a=l;if(typeof o=="function"){var i=o;o=function(){var c=jc(a);i.call(c)}}Wc(t,a,e,o)}else a=Gb(n,t,e,o,s);return jc(a)}qx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zl(t.pendingLanes);n!==0&&(Xf(t,n|1),zn(t,At()),!(Xe&6)&&(_l=At()+500,Zr()))}break;case 13:No(function(){var s=dr(e,1);if(s!==null){var o=Nn();Cs(s,e,1,o)}}),Pp(e,1)}};Jf=function(e){if(e.tag===13){var t=dr(e,134217728);if(t!==null){var n=Nn();Cs(t,e,134217728,n)}Pp(e,134217728)}};Gx=function(e){if(e.tag===13){var t=Fr(e),n=dr(e,t);if(n!==null){var s=Nn();Cs(n,e,t,s)}Pp(e,t)}};Kx=function(){return nt};Yx=function(e,t){var n=nt;try{return nt=e,t()}finally{nt=n}};_d=function(e,t,n){switch(t){case"input":if(gd(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var o=zc(s);if(!o)throw Error(se(90));Nx(s),gd(s,o)}}}break;case"textarea":Ex(e,n);break;case"select":t=n.value,t!=null&&al(e,!!n.multiple,t,!1)}};Ax=kp;Ox=No;var Kb={usingClientEntryPoint:!1,Events:[za,Zo,zc,$x,Ix,kp]},Gl={findFiberByHostInstance:ho,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Yb={bundleType:Gl.bundleType,version:Gl.version,rendererPackageName:Gl.rendererPackageName,rendererConfig:Gl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:gr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dx(e),e===null?null:e.stateNode},findFiberByHostInstance:Gl.findFiberByHostInstance||qb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fi.isDisabled&&fi.supportsFiber)try{Ic=fi.inject(Yb),Hs=fi}catch{}}Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kb;Zn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mp(t))throw Error(se(200));return Wb(e,t,null,n)};Zn.createRoot=function(e,t){if(!Mp(e))throw Error(se(299));var n=!1,s="",o=xy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Rp(e,1,!1,null,null,n,!1,s,o),e[ur]=t.current,ya(e.nodeType===8?e.parentNode:e),new Tp(t)};Zn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=Dx(t),e=e===null?null:e.stateNode,e};Zn.flushSync=function(e){return No(e)};Zn.hydrate=function(e,t,n){if(!Gc(t))throw Error(se(200));return Kc(null,e,t,!0,n)};Zn.hydrateRoot=function(e,t,n){if(!Mp(e))throw Error(se(405));var s=n!=null&&n.hydratedSources||null,o=!1,l="",a=xy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=gy(t,null,e,1,n??null,o,!1,l,a),e[ur]=t.current,ya(e),s)for(e=0;e<s.length;e++)n=s[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new qc(t)};Zn.render=function(e,t,n){if(!Gc(t))throw Error(se(200));return Kc(null,e,t,!1,n)};Zn.unmountComponentAtNode=function(e){if(!Gc(e))throw Error(se(40));return e._reactRootContainer?(No(function(){Kc(null,null,e,!1,function(){e._reactRootContainer=null,e[ur]=null})}),!0):!1};Zn.unstable_batchedUpdates=kp;Zn.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Gc(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return Kc(e,t,n,!1,s)};Zn.version="18.3.1-next-f1338f8080-20240426";function vy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vy)}catch(e){console.error(e)}}vy(),vx.exports=Zn;var Oo=vx.exports,yy,Lh=Oo;yy=Lh.createRoot,Lh.hydrateRoot;/**
41
- * @remix-run/router v1.23.4
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function Ea(){return Ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ea.apply(null,arguments)}var Mr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Mr||(Mr={}));const zh="popstate";function Qb(e){e===void 0&&(e={});function t(s,o){let{pathname:l,search:a,hash:i}=s.location;return nf("",{pathname:l,search:a,hash:i},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){return typeof o=="string"?o:jy(o)}return Jb(t,n,null,e)}function Bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xb(){return Math.random().toString(36).substr(2,8)}function Dh(e,t){return{usr:e.state,key:e.key,idx:t}}function nf(e,t,n,s){return n===void 0&&(n=null),Ea({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Il(t):t,{state:n,key:t&&t.key||s||Xb()})}function jy(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Il(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Jb(e,t,n,s){s===void 0&&(s={});let{window:o=document.defaultView,v5Compat:l=!1}=s,a=o.history,i=Mr.Pop,c=null,d=f();d==null&&(d=0,a.replaceState(Ea({},a.state,{idx:d}),""));function f(){return(a.state||{idx:null}).idx}function m(){i=Mr.Pop;let j=f(),v=j==null?null:j-d;d=j,c&&c({action:i,location:w.location,delta:v})}function p(j,v){i=Mr.Push;let x=nf(w.location,j,v);d=f()+1;let y=Dh(x,d),b=w.createHref(x);try{a.pushState(y,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(b)}l&&c&&c({action:i,location:w.location,delta:1})}function h(j,v){i=Mr.Replace;let x=nf(w.location,j,v);d=f();let y=Dh(x,d),b=w.createHref(x);a.replaceState(y,"",b),l&&c&&c({action:i,location:w.location,delta:0})}function g(j){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof j=="string"?j:jy(j);return x=x.replace(/ $/,"%20"),Bt(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let w={get action(){return i},get location(){return e(o,a)},listen(j){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(zh,m),c=j,()=>{o.removeEventListener(zh,m),c=null}},createHref(j){return t(o,j)},createURL:g,encodeLocation(j){let v=g(j);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(j){return a.go(j)}};return w}var Fh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Fh||(Fh={}));function Zb(e,t,n){return n===void 0&&(n="/"),e_(e,t,n)}function e_(e,t,n,s){let o=typeof t=="string"?Il(t):t,l=Sy(o.pathname||"/",n);if(l==null)return null;let a=by(e);t_(a);let i=null,c=p_(l);for(let d=0;i==null&&d<a.length;++d)i=u_(a[d],c);return i}function by(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let o=(l,a,i)=>{let c={relativePath:i===void 0?l.path||"":i,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};c.relativePath.startsWith("/")&&(Bt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let d=wo([s,c.relativePath]),f=n.concat(c);l.children&&l.children.length>0&&(Bt(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),by(l.children,t,f,d)),!(l.path==null&&!l.index)&&t.push({path:d,score:i_(d,l.index),routesMeta:f})};return e.forEach((l,a)=>{var i;if(l.path===""||!((i=l.path)!=null&&i.includes("?")))o(l,a);else for(let c of _y(l.path))o(l,a,c)}),t}function _y(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let a=_y(s.join("/")),i=[];return i.push(...a.map(c=>c===""?l:[l,c].join("/"))),o&&i.push(...a),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function t_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:c_(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const n_=/^:[\w-]+$/,s_=3,r_=2,o_=1,l_=10,a_=-2,Bh=e=>e==="*";function i_(e,t){let n=e.split("/"),s=n.length;return n.some(Bh)&&(s+=a_),t&&(s+=r_),n.filter(o=>!Bh(o)).reduce((o,l)=>o+(n_.test(l)?s_:l===""?o_:l_),s)}function c_(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function u_(e,t,n){let{routesMeta:s}=e,o={},l="/",a=[];for(let i=0;i<s.length;++i){let c=s[i],d=i===s.length-1,f=l==="/"?t:t.slice(l.length)||"/",m=d_({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),p=c.route;if(!m)return null;Object.assign(o,m.params),a.push({params:o,pathname:wo([l,m.pathname]),pathnameBase:g_(wo([l,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(l=wo([l,m.pathnameBase]))}return a}function d_(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=f_(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],a=l.replace(/(.)\/+$/,"$1"),i=o.slice(1);return{params:s.reduce((d,f,m)=>{let{paramName:p,isOptional:h}=f;if(p==="*"){let w=i[m]||"";a=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const g=i[m];return h&&!g?d[p]=void 0:d[p]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function f_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),wy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,i,c)=>(s.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function p_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Sy(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function m_(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?Il(e):e,l;return n?(n=Cy(n),n.startsWith("/")?l=Uh(n.substring(1),"/"):l=Uh(n,t)):l=t,{pathname:l,search:x_(s),hash:v_(o)}}function Uh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Du(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function h_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ky(e,t){let n=h_(e);return t?n.map((s,o)=>o===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Ny(e,t,n,s){s===void 0&&(s=!1);let o;typeof e=="string"?o=Il(e):(o=Ea({},e),Bt(!o.pathname||!o.pathname.includes("?"),Du("?","pathname","search",o)),Bt(!o.pathname||!o.pathname.includes("#"),Du("#","pathname","hash",o)),Bt(!o.search||!o.search.includes("#"),Du("#","search","hash",o)));let l=e===""||o.pathname==="",a=l?"/":o.pathname,i;if(a==null)i=n;else{let m=t.length-1;if(!s&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),m-=1;o.pathname=p.join("/")}i=m>=0?t[m]:"/"}let c=m_(o,i),d=a&&a!=="/"&&a.endsWith("/"),f=(l||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const Cy=e=>e.replace(/\/\/+/g,"/"),wo=e=>Cy(e.join("/")),g_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),x_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,v_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function y_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ey=["post","put","patch","delete"];new Set(Ey);const w_=["get",...Ey];new Set(w_);/**
50
- * React Router v6.30.6
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function Ra(){return Ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ra.apply(null,arguments)}const $p=u.createContext(null),j_=u.createContext(null),Fa=u.createContext(null),Yc=u.createContext(null),eo=u.createContext({outlet:null,matches:[],isDataRoute:!1}),Ry=u.createContext(null);function Ba(){return u.useContext(Yc)!=null}function Ua(){return Ba()||Bt(!1),u.useContext(Yc).location}function Py(e){u.useContext(Fa).static||u.useLayoutEffect(e)}function Al(){let{isDataRoute:e}=u.useContext(eo);return e?A_():b_()}function b_(){Ba()||Bt(!1);let e=u.useContext($p),{basename:t,future:n,navigator:s}=u.useContext(Fa),{matches:o}=u.useContext(eo),{pathname:l}=Ua(),a=JSON.stringify(ky(o,n.v7_relativeSplatPath)),i=u.useRef(!1);return Py(()=>{i.current=!0}),u.useCallback(function(d,f){if(f===void 0&&(f={}),!i.current)return;if(typeof d=="number"){s.go(d);return}let m=Ny(d,JSON.parse(a),l,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:wo([t,m.pathname])),(f.replace?s.replace:s.push)(m,f.state,f)},[t,s,a,l,e])}function __(){let{matches:e}=u.useContext(eo),t=e[e.length-1];return t?t.params:{}}function S_(e,t){return k_(e,t)}function k_(e,t,n,s){Ba()||Bt(!1);let{navigator:o}=u.useContext(Fa),{matches:l}=u.useContext(eo),a=l[l.length-1],i=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Ua(),f;if(t){var m;let j=typeof t=="string"?Il(t):t;c==="/"||(m=j.pathname)!=null&&m.startsWith(c)||Bt(!1),f=j}else f=d;let p=f.pathname||"/",h=p;if(c!=="/"){let j=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(j.length).join("/")}let g=Zb(e,{pathname:h}),w=P_(g&&g.map(j=>Object.assign({},j,{params:Object.assign({},i,j.params),pathname:wo([c,o.encodeLocation?o.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:wo([c,o.encodeLocation?o.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),l,n,s);return t&&w?u.createElement(Yc.Provider,{value:{location:Ra({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Mr.Pop}},w):w}function N_(){let e=I_(),t=y_(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:o},n):null,null)}const C_=u.createElement(N_,null);class E_ extends u.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?u.createElement(eo.Provider,{value:this.props.routeContext},u.createElement(Ry.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function R_(e){let{routeContext:t,match:n,children:s}=e,o=u.useContext($p);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(eo.Provider,{value:t},s)}function P_(e,t,n,s){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=s)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=(o=n)==null?void 0:o.errors;if(i!=null){let f=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);f>=0||Bt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,d=-1;if(n&&s&&s.v7_partialHydration)for(let f=0;f<a.length;f++){let m=a[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=f),m.route.id){let{loaderData:p,errors:h}=n,g=m.route.loader&&p[m.route.id]===void 0&&(!h||h[m.route.id]===void 0);if(m.route.lazy||g){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((f,m,p)=>{let h,g=!1,w=null,j=null;n&&(h=i&&m.route.id?i[m.route.id]:void 0,w=m.route.errorElement||C_,c&&(d<0&&p===0?(O_("route-fallback"),g=!0,j=null):d===p&&(g=!0,j=m.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,p+1)),x=()=>{let y;return h?y=w:g?y=j:m.route.Component?y=u.createElement(m.route.Component,null):m.route.element?y=m.route.element:y=f,u.createElement(R_,{match:m,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:y})};return n&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?u.createElement(E_,{location:n.location,revalidation:n.revalidation,component:w,error:h,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var Ty=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ty||{}),My=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(My||{});function T_(e){let t=u.useContext($p);return t||Bt(!1),t}function M_(e){let t=u.useContext(j_);return t||Bt(!1),t}function $_(e){let t=u.useContext(eo);return t||Bt(!1),t}function $y(e){let t=$_(),n=t.matches[t.matches.length-1];return n.route.id||Bt(!1),n.route.id}function I_(){var e;let t=u.useContext(Ry),n=M_(),s=$y();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function A_(){let{router:e}=T_(Ty.UseNavigateStable),t=$y(My.UseNavigateStable),n=u.useRef(!1);return Py(()=>{n.current=!0}),u.useCallback(function(o,l){l===void 0&&(l={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ra({fromRouteId:t},l)))},[e,t])}const Vh={};function O_(e,t,n){Vh[e]||(Vh[e]=!0)}function L_(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Sl(e){let{to:t,replace:n,state:s,relative:o}=e;Ba()||Bt(!1);let{future:l,static:a}=u.useContext(Fa),{matches:i}=u.useContext(eo),{pathname:c}=Ua(),d=Al(),f=Ny(t,ky(i,l.v7_relativeSplatPath),c,o==="path"),m=JSON.stringify(f);return u.useEffect(()=>d(JSON.parse(m),{replace:n,state:s,relative:o}),[d,m,o,n,s]),null}function Ls(e){Bt(!1)}function z_(e){let{basename:t="/",children:n=null,location:s,navigationType:o=Mr.Pop,navigator:l,static:a=!1,future:i}=e;Ba()&&Bt(!1);let c=t.replace(/^\/*/,"/"),d=u.useMemo(()=>({basename:c,navigator:l,static:a,future:Ra({v7_relativeSplatPath:!1},i)}),[c,i,l,a]);typeof s=="string"&&(s=Il(s));let{pathname:f="/",search:m="",hash:p="",state:h=null,key:g="default"}=s,w=u.useMemo(()=>{let j=Sy(f,c);return j==null?null:{location:{pathname:j,search:m,hash:p,state:h,key:g},navigationType:o}},[c,f,m,p,h,g,o]);return w==null?null:u.createElement(Fa.Provider,{value:d},u.createElement(Yc.Provider,{children:n,value:w}))}function D_(e){let{children:t,location:n}=e;return S_(sf(t),n)}new Promise(()=>{});function sf(e,t){t===void 0&&(t=[]);let n=[];return u.Children.forEach(e,(s,o)=>{if(!u.isValidElement(s))return;let l=[...t,o];if(s.type===u.Fragment){n.push.apply(n,sf(s.props.children,l));return}s.type!==Ls&&Bt(!1),!s.props.index||!s.props.children||Bt(!1);let a={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(a.children=sf(s.props.children,l)),n.push(a)}),n}/**
59
- * React Router DOM v6.30.6
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function rf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(o=>[n,o]):[[n,s]])},[]))}function F_(e,t){let n=rf(e);return t&&t.forEach((s,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}const B_="6";try{window.__reactRouterVersion=B_}catch{}const U_="startTransition",Hh=$o[U_];function V_(e){let{basename:t,children:n,future:s,window:o}=e,l=u.useRef();l.current==null&&(l.current=Qb({window:o,v5Compat:!0}));let a=l.current,[i,c]=u.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},f=u.useCallback(m=>{d&&Hh?Hh(()=>c(m)):c(m)},[c,d]);return u.useLayoutEffect(()=>a.listen(f),[a,f]),u.useEffect(()=>L_(s),[s]),u.createElement(z_,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:a,future:s})}var Wh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Wh||(Wh={}));var qh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qh||(qh={}));function H_(e){let t=u.useRef(rf(e)),n=u.useRef(!1),s=Ua(),o=u.useMemo(()=>F_(s.search,n.current?null:t.current),[s.search]),l=Al(),a=u.useCallback((i,c)=>{const d=rf(typeof i=="function"?i(o):i);n.current=!0,l("?"+d,c)},[l,o]);return[o,a]}const W_={},Gh=e=>{let t;const n=new Set,s=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(g=>g(t,h))}},o=()=>t,c={setState:s,getState:o,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(W_?"plugin":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,o,c);return c},q_=e=>e?Gh(e):Gh;var Iy={exports:{}},Ay={},Oy={exports:{}},Ly={};/**
68
- * @license React
69
- * use-sync-external-store-shim.production.js
70
- *
71
- * Copyright (c) Meta Platforms, Inc. and affiliates.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */var kl=u;function G_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var K_=typeof Object.is=="function"?Object.is:G_,Y_=kl.useState,Q_=kl.useEffect,X_=kl.useLayoutEffect,J_=kl.useDebugValue;function Z_(e,t){var n=t(),s=Y_({inst:{value:n,getSnapshot:t}}),o=s[0].inst,l=s[1];return X_(function(){o.value=n,o.getSnapshot=t,Fu(o)&&l({inst:o})},[e,n,t]),Q_(function(){return Fu(o)&&l({inst:o}),e(function(){Fu(o)&&l({inst:o})})},[e]),J_(n),n}function Fu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!K_(e,n)}catch{return!0}}function eS(e,t){return t()}var tS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?eS:Z_;Ly.useSyncExternalStore=kl.useSyncExternalStore!==void 0?kl.useSyncExternalStore:tS;Oy.exports=Ly;var nS=Oy.exports;/**
76
- * @license React
77
- * use-sync-external-store-shim/with-selector.production.js
78
- *
79
- * Copyright (c) Meta Platforms, Inc. and affiliates.
80
- *
81
- * This source code is licensed under the MIT license found in the
82
- * LICENSE file in the root directory of this source tree.
83
- */var Qc=u,sS=nS;function rS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oS=typeof Object.is=="function"?Object.is:rS,lS=sS.useSyncExternalStore,aS=Qc.useRef,iS=Qc.useEffect,cS=Qc.useMemo,uS=Qc.useDebugValue;Ay.useSyncExternalStoreWithSelector=function(e,t,n,s,o){var l=aS(null);if(l.current===null){var a={hasValue:!1,value:null};l.current=a}else a=l.current;l=cS(function(){function c(h){if(!d){if(d=!0,f=h,h=s(h),o!==void 0&&a.hasValue){var g=a.value;if(o(g,h))return m=g}return m=h}if(g=m,oS(f,h))return g;var w=s(h);return o!==void 0&&o(g,w)?(f=h,g):(f=h,m=w)}var d=!1,f,m,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,s,o]);var i=lS(e,l[0],l[1]);return iS(function(){a.hasValue=!0,a.value=i},[i]),uS(i),i};Iy.exports=Ay;var dS=Iy.exports;const fS=ox(dS),zy={},{useDebugValue:pS}=gx,{useSyncExternalStoreWithSelector:mS}=fS;let Kh=!1;const hS=e=>e;function gS(e,t=hS,n){(zy?"plugin":void 0)!=="production"&&n&&!Kh&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Kh=!0);const s=mS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return pS(s),s}const Yh=e=>{(zy?"plugin":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?q_(e):e,n=(s,o)=>gS(t,s,o);return Object.assign(n,t),n},Ip=e=>e?Yh(e):Yh,cs="/touchstone/".replace(/\/+$/,"");async function pi(e,t,n){const s={method:e,credentials:"same-origin",headers:{}};n!==void 0&&(s.headers["Content-Type"]="application/json",s.body=JSON.stringify(n));const o=await fetch(cs+t,s);if(o.status===401)throw window.location.pathname!==cs+"/login"&&!window.__ts_redirecting&&(window.__ts_redirecting=!0,window.location.href=cs+"/login"),new Error("unauthorized");let l=null;const a=await o.text();if(a)try{l=JSON.parse(a)}catch{l=a}if(!o.ok){const i=l&&(l.error||l.message)||`HTTP ${o.status}`;throw new Error(i)}return l}const ee={get:e=>pi("GET",e),post:(e,t)=>pi("POST",e,t),patch:(e,t)=>pi("PATCH",e,t),del:(e,t)=>pi("DELETE",e,t)},pl={me:()=>ee.get("/api/auth/me"),login:(e,t)=>ee.post("/api/auth/login",{username:e,password:t}),register:(e,t)=>ee.post("/api/auth/register",{username:e,password:t}),logout:()=>ee.post("/api/auth/logout"),changePassword:(e,t)=>ee.post("/api/auth/change_password",{old_password:e,new_password:t})},Fs={feishuGet:()=>ee.get("/api/me/feishu"),feishuBindcode:()=>ee.post("/api/me/feishu-bindcode"),feishuUnbind:()=>ee.del("/api/me/feishu"),feishuCfgGet:()=>ee.get("/api/me/feishu-cfg"),feishuCfgSet:e=>ee.patch("/api/me/feishu-cfg",e),feishuOutbox:()=>ee.get("/api/me/feishu/outbox"),feishuSlashGet:()=>ee.get("/api/me/feishu/slash-commands"),feishuSlashSet:e=>ee.post("/api/me/feishu/slash-commands",{action:e})},Pt={list:()=>ee.get("/api/projects"),get:e=>ee.get(`/api/projects/${e}`),create:e=>ee.post("/api/projects",e),update:(e,t)=>ee.patch(`/api/projects/${e}`,t),remove:(e,t)=>ee.del(`/api/projects/${e}`,t),archive:e=>ee.post(`/api/projects/${e}/archive`),unarchive:e=>ee.post(`/api/projects/${e}/unarchive`),fsBrowse:e=>ee.get(`/api/fs/browse?path=${encodeURIComponent(e||"")}`),fsMkdir:(e,t)=>ee.post("/api/fs/mkdir",{path:e,name:t}),dupCheck:e=>{const t=new URLSearchParams(e).toString();return ee.get(`/api/projects/dup_check?${t}`)},agents:()=>ee.get("/api/agents/scan"),agentModels:e=>ee.get(`/api/agents/models?agent_path=${encodeURIComponent(e||"")}`),agentSkills:(e,t)=>ee.get(`/api/agents/skills?agent_path=${encodeURIComponent(e||"")}&project_dir=${encodeURIComponent(t||"")}`),feishuHookGet:e=>ee.get(`/api/projects/${e}/feishu-hook`),feishuHookSet:(e,t)=>ee.patch(`/api/projects/${e}/feishu-hook`,t),filePreview:(e,t)=>ee.get(`/api/projects/${e}/file?path=${encodeURIComponent(t)}`),fileRawUrl:(e,t)=>`${cs}/api/projects/${e}/file?path=${encodeURIComponent(t)}&raw=1`},ll={get:e=>ee.get(`/api/prefs?project_id=${e||0}`),set:(e,t,n)=>ee.post("/api/prefs",{project_id:e||0,key:t,value:n})},Be={list:e=>ee.get(`/api/projects/${e}/tasks`),create:(e,t)=>ee.post(`/api/projects/${e}/tasks`,t),get:e=>ee.get(`/api/tasks/${e}`),update:(e,t)=>ee.patch(`/api/tasks/${e}`,t),stop:e=>ee.post(`/api/tasks/${e}/stop`),restart:e=>ee.post(`/api/tasks/${e}/restart`),continue:(e,t)=>ee.post(`/api/tasks/${e}/continue`,t),remove:e=>ee.del(`/api/tasks/${e}`),rounds:e=>ee.get(`/api/tasks/${e}/rounds`),dialogue:e=>ee.get(`/api/tasks/${e}/dialogue`),log:(e,t,n=300)=>ee.get(`/api/tasks/${e}/log?round=${t}&tail=${n}`),loadCase:e=>ee.get(`/api/tasks/${e}/load/case`),loadCaseMeta:e=>ee.get(`/api/tasks/${e}/load/case?meta=1`),loadRuns:e=>ee.get(`/api/tasks/${e}/load/runs`),loadRerun:e=>ee.post(`/api/tasks/${e}/load/rerun`),loadDiagnose:e=>ee.post(`/api/tasks/${e}/load/diagnose`),loadMetrics:(e,t=0,n=2e4,s="")=>ee.get(`/api/tasks/${e}/load/metrics?after=${t}&limit=${n}`+(s?`&run=${encodeURIComponent(s)}`:"")),loadReport:(e,t="")=>ee.get(`/api/tasks/${e}/load_report${t?`?run=${encodeURIComponent(t)}`:""}`),loadStream:(e,t="")=>new EventSource(`${cs}/api/tasks/${e}/load/stream${t?`?run=${encodeURIComponent(t)}`:""}`),loadCustomHtmlUrl:e=>`${cs}/api/tasks/${e}/load/custom_html`,sessionMessages:(e,t="main",n=0)=>ee.get(`/api/tasks/${e}/session/messages?agent=${encodeURIComponent(t)}&after=${n}`),sessionStream:(e,t="main")=>new EventSource(`${cs}/api/tasks/${e}/session/stream?agent=${encodeURIComponent(t)}`),sessionChat:(e,t,n=!1)=>ee.post(`/api/tasks/${e}/session/chat`,{message:t,inject:n}),sessionChatInject:(e,t)=>ee.post(`/api/tasks/${e}/session/chat/inject`,{msg_id:t}),sessionRewind:(e,t)=>ee.post(`/api/tasks/${e}/session/rewind`,{mid:t}),answerInteraction:(e,t)=>ee.post(`/api/tasks/${e}/session/interaction/answer`,t),sessionChatStop:e=>ee.post(`/api/tasks/${e}/session/chat/stop`),sessionProfile:(e,t)=>ee.post(`/api/tasks/${e}/session/profile`,t),sessionMediaUrl:(e,t,n)=>`${cs}/api/tasks/${e}/session/media/${encodeURIComponent(n)}?agent=${encodeURIComponent(t)}`},of={list:e=>ee.get(`/api/projects/${e}/bugs`),get:(e,t)=>ee.get(`/api/projects/${e}/bugs/${encodeURIComponent(t)}`),reject:(e,t,n)=>ee.post(`/api/projects/${e}/bugs/${encodeURIComponent(t)}/reject`,{reason:n})},$r={users:()=>ee.get("/api/admin/users"),createUser:e=>ee.post("/api/admin/users",e),updateUser:(e,t)=>ee.patch(`/api/admin/users/${e}`,t),deleteUser:e=>ee.del(`/api/admin/users/${e}`),ragGet:()=>ee.get("/api/admin/rag"),ragSet:e=>ee.patch("/api/admin/rag",e),ragTest:e=>ee.post("/api/admin/rag/test",e)},Bu={list:(e,t)=>{const n=e==="project"?"project":"user";return ee.get(`/api/builtin-assets?target=${n}`+(n==="project"&&t?`&project_id=${t}`:""))},install:(e,t,n)=>ee.post(`/api/builtin-assets/${e}/install`,{target:t,project_id:n??null}),uninstall:(e,t,n)=>ee.post(`/api/builtin-assets/${e}/uninstall`,{target:t,project_id:n??null})},Qh={state:e=>ee.get(`/api/state?project=${e}`),stream:e=>new EventSource(`${cs}/api/stream?project=${e}`)},Me={get:e=>ee.get(`/api/projects/${e}/board`),createCard:(e,t)=>ee.post(`/api/projects/${e}/board/cards`,t),updateCard:(e,t,n)=>ee.patch(`/api/projects/${e}/board/cards/${t}`,n),removeCard:(e,t)=>ee.del(`/api/projects/${e}/board/cards/${t}`),moveCard:(e,t,n,s,o=null)=>ee.post(`/api/projects/${e}/board/cards/${t}/move`,{column:n,block_text:s,before_id:o}),startCard:(e,t,n,s,o)=>ee.post(`/api/projects/${e}/board/cards/${t}/start`,{opinion:n,force:!!s,worktree:!!o}),worktreePreview:(e,t)=>ee.get(`/api/projects/${e}/board/cards/${t}/worktree`),removeWorktree:(e,t)=>ee.del(`/api/projects/${e}/board/cards/${t}/worktree`),stopCard:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/stop`),markViewed:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/viewed`),addComment:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/comments`,{text:n}),sendComment:(e,t,n,s=!1,o=!1)=>ee.post(`/api/projects/${e}/board/cards/${t}/comments/${n}/send`,{inject:s,raw:o}),removeComment:(e,t,n)=>ee.del(`/api/projects/${e}/board/cards/${t}/comments/${n}`),listSessions:e=>ee.get(`/api/projects/${e}/board/sessions`),compact:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/compact`,n?{sid:n}:{}),forkCompact:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/fork-compact`,n?{sid:n}:{}),forkSession:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/fork`,n?{sid:n}:{}),answerInteraction:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/interaction/answer`,n),deliverAnswer:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/answer/deliver`),injectSessionMsg:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/inject`,{msg_id:n}),rewindSession:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/rewind`,{mid:n}),updateSettings:(e,t)=>ee.patch(`/api/projects/${e}/board/settings`,t),jiraTest:(e,t)=>ee.post(`/api/projects/${e}/board/jira/test`,t),jiraImport:e=>ee.post(`/api/projects/${e}/board/jira/import`),sessionMessages:(e,t,n=0,s="main")=>ee.get(`/api/projects/${e}/board/session/messages?sid=${encodeURIComponent(t)}&after=${n}&agent=${encodeURIComponent(s)}`),sessionMediaUrl:(e,t,n,s)=>`${cs}/api/projects/${e}/board/session/media/${encodeURIComponent(s)}?sid=${encodeURIComponent(t)}&agent=${encodeURIComponent(n)}`,reorderCard:(e,t,n)=>ee.post(`/api/projects/${e}/board/reorder`,{card_id:t,before_id:n}),trashList:e=>ee.get(`/api/projects/${e}/board/trash`),restoreCard:(e,t)=>ee.post(`/api/projects/${e}/board/trash/${t}/restore`),purgeCard:(e,t)=>ee.del(`/api/projects/${e}/board/trash/${t}`),emptyTrash:e=>ee.post(`/api/projects/${e}/board/trash/empty`),setSessionProfile:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/profile`,n),uploadMedia:(e,t)=>ee.post(`/api/projects/${e}/board/media`,t),stream:e=>new EventSource(`${cs}/api/projects/${e}/board/stream`),sessionStream:(e,t)=>new EventSource(`${cs}/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/stream`)},Xn=Ip((e,t)=>({username:"",isAdmin:!1,mustChangePassword:!1,loaded:!1,load:async()=>{try{const n=await pl.me();e({username:n.username,isAdmin:!!n.is_admin,mustChangePassword:!!n.must_change_password,loaded:!0})}catch{e({username:"",mustChangePassword:!1,loaded:!0})}},login:async(n,s)=>{await pl.login(n,s),await t().load()},logout:async()=>{try{await pl.logout()}catch{}e({username:"",isAdmin:!1,mustChangePassword:!1})}}));function Xc({size:e=22}){return r.jsxs("svg",{className:"ts-logo",width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"tsLogoG",x1:"0",y1:"1",x2:"1",y2:"0",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--logo-1)"}}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--logo-2)"}})]})}),r.jsx("path",{fill:"url(#tsLogoG)",fillRule:"evenodd",d:`M8.6 3H15.4A5.6 5.6 0 0 1 21 8.6V15.4A5.6 5.6 0 0 1 15.4 21H8.6A5.6 5.6 0 0 1 3 15.4V8.6A5.6 5.6 0 0 1 8.6 3Z
84
- M7.6 6.6H16.4V9.8H13.6V17.8H10.4V9.8H7.6Z`})]})}var xS=Object.defineProperty,Ap=(e,t)=>xS(e,"name",{value:t,configurable:!0});function lf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ap(lf,"setRef");function Dy(...e){return t=>{let n=!1;const s=e.map(o=>{const l=lf(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():lf(e[o],null)}}}}Ap(Dy,"composeRefs");function vt(...e){return u.useCallback(Dy(...e),e)}Ap(vt,"useComposedRefs");var vS=Object.defineProperty,Ps=(e,t)=>vS(e,"name",{value:t,configurable:!0});function pr(e){const t=u.forwardRef((n,s)=>{let{children:o,...l}=n,a=null,i=!1;const c=[];af(o)&&typeof mi=="function"&&(o=mi(o._payload)),u.Children.forEach(o,p=>{var h;if(Vy(p)){i=!0;const g=p;let w="child"in g.props?g.props.child:g.props.children;af(w)&&typeof mi=="function"&&(w=mi(w._payload)),a=jS(g,w),c.push((h=a==null?void 0:a.props)==null?void 0:h.children)}else c.push(p)}),a?a=u.cloneElement(a,void 0,c):!i&&u.Children.count(o)===1&&u.isValidElement(o)&&(a=o);const d=a?Uy(a):void 0,f=vt(s,d);if(!a){if(o||o===0)throw new Error(i?SS(e):_S(e));return o}const m=By(l,a.props??{});return a.type!==u.Fragment&&(m.ref=s?f:d),u.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}Ps(pr,"createSlot");var yS=pr("Slot"),Fy=Symbol.for("radix.slottable");function wS(e){const t=Ps(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Fy,t}Ps(wS,"createSlottable");var jS=Ps((e,t)=>{if("child"in e.props){const n=e.props.child;return u.isValidElement(n)?u.cloneElement(n,void 0,e.props.children(n.props.children)):null}return u.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function By(e,t){const n={...t};for(const s in t){const o=e[s],l=t[s];/^on[A-Z]/.test(s)?o&&l?n[s]=(...i)=>{const c=l(...i);return o(...i),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...l}:s==="className"&&(n[s]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}Ps(By,"mergeProps");function Uy(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ps(Uy,"getElementRef");function Vy(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fy}Ps(Vy,"isSlottable");var bS=Symbol.for("react.lazy");function af(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bS&&"_payload"in e&&Hy(e._payload)}Ps(af,"isLazyComponent");function Hy(e){return typeof e=="object"&&e!==null&&"then"in e}Ps(Hy,"isPromiseLike");var _S=Ps(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),SS=Ps(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),mi=$o[" use ".trim().toString()];function Wy(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Wy(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function qy(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Wy(e))&&(s&&(s+=" "),s+=t);return s}const Xh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jh=qy,Gy=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return Jh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,a=Object.keys(o).map(d=>{const f=n==null?void 0:n[d],m=l==null?void 0:l[d];if(f===null)return null;const p=Xh(f)||Xh(m);return o[d][p]}),i=n&&Object.entries(n).reduce((d,f)=>{let[m,p]=f;return p===void 0||(d[m]=p),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,f)=>{let{class:m,className:p,...h}=f;return Object.entries(h).every(g=>{let[w,j]=g;return Array.isArray(j)?j.includes({...l,...i}[w]):{...l,...i}[w]===j})?[...d,m,p]:d},[]);return Jh(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},kS=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},NS=(e,t)=>({classGroupId:e,validator:t}),Ky=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bc="-",Zh=[],CS="arbitrary..",ES=e=>{const t=PS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return RS(a);const i=a.split(bc),c=i[0]===""&&i.length>1?1:0;return Yy(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=s[a],d=n[a];return c?d?kS(d,c):c:d||Zh}return n[a]||Zh}}},Yy=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const d=Yy(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(bc):e.slice(t).join(bc),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},RS=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?CS+s:void 0})(),PS=e=>{const{theme:t,classGroups:n}=e;return TS(n,t)},TS=(e,t)=>{const n=Ky();for(const s in e){const o=e[s];Op(o,n,s,t)}return n},Op=(e,t,n,s)=>{const o=e.length;for(let l=0;l<o;l++){const a=e[l];MS(a,t,n,s)}},MS=(e,t,n,s)=>{if(typeof e=="string"){$S(e,t,n);return}if(typeof e=="function"){IS(e,t,n,s);return}AS(e,t,n,s)},$S=(e,t,n)=>{const s=e===""?t:Qy(t,e);s.classGroupId=n},IS=(e,t,n,s)=>{if(OS(e)){Op(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(NS(n,e))},AS=(e,t,n,s)=>{const o=Object.entries(e),l=o.length;for(let a=0;a<l;a++){const[i,c]=o[a];Op(c,Qy(t,i),n,s)}},Qy=(e,t)=>{let n=e;const s=t.split(bc),o=s.length;for(let l=0;l<o;l++){const a=s[l];let i=n.nextPart.get(a);i||(i=Ky(),n.nextPart.set(a,i)),n=i}return n},OS=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,LS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(l,a)=>{n[l]=a,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=s[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},cf="!",eg=":",zS=[],tg=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),DS=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const l=[];let a=0,i=0,c=0,d;const f=o.length;for(let w=0;w<f;w++){const j=o[w];if(a===0&&i===0){if(j===eg){l.push(o.slice(c,w)),c=w+1;continue}if(j==="/"){d=w;continue}}j==="["?a++:j==="]"?a--:j==="("?i++:j===")"&&i--}const m=l.length===0?o:o.slice(c);let p=m,h=!1;m.endsWith(cf)?(p=m.slice(0,-1),h=!0):m.startsWith(cf)&&(p=m.slice(1),h=!0);const g=d&&d>c?d-c:void 0;return tg(l,h,p,g)};if(t){const o=t+eg,l=s;s=a=>a.startsWith(o)?l(a.slice(o.length)):tg(zS,!1,a,void 0,!0)}if(n){const o=s;s=l=>n({className:l,parseClassName:o})}return s},FS=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],i=a[0]==="[",c=t.has(a);i||c?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(a)):o.push(a)}return o.length>0&&(o.sort(),s.push(...o)),s}},BS=e=>({cache:LS(e.cacheSize),parseClassName:DS(e),sortModifiers:FS(e),postfixLookupClassGroupIds:US(e),...ES(e)}),US=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let s=0;s<n.length;s++)t[n[s]]=!0;return t},VS=/\s+/,HS=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:a}=t,i=[],c=e.trim().split(VS);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:p,modifiers:h,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:j}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let v=!!j,x;if(v){const k=w.substring(0,j);x=s(k);const C=x&&a[x]?s(w):void 0;C&&C!==x&&(x=C,v=!1)}else x=s(w);if(!x){if(!v){d=m+(d.length>0?" "+d:d);continue}if(x=s(w),!x){d=m+(d.length>0?" "+d:d);continue}v=!1}const y=h.length===0?"":h.length===1?h[0]:l(h).join(":"),b=g?y+cf:y,S=b+x;if(i.indexOf(S)>-1)continue;i.push(S);const N=o(x,v);for(let k=0;k<N.length;++k){const C=N[k];i.push(b+C)}d=m+(d.length>0?" "+d:d)}return d},WS=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=Xy(n))&&(o&&(o+=" "),o+=s);return o},Xy=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Xy(e[s]))&&(n&&(n+=" "),n+=t);return n},qS=(e,...t)=>{let n,s,o,l;const a=c=>{const d=t.reduce((f,m)=>m(f),e());return n=BS(d),s=n.cache.get,o=n.cache.set,l=i,i(c)},i=c=>{const d=s(c);if(d)return d;const f=HS(c,n);return o(c,f),f};return l=a,(...c)=>l(WS(...c))},GS=[],Vt=e=>{const t=n=>n[e]||GS;return t.isThemeGetter=!0,t},Jy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,YS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,XS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,br=e=>KS.test(e),Ue=e=>!!e&&!Number.isNaN(Number(e)),Is=e=>!!e&&Number.isInteger(Number(e)),Uu=e=>e.endsWith("%")&&Ue(e.slice(0,-1)),Xs=e=>YS.test(e),e0=()=>!0,ek=e=>QS.test(e)&&!XS.test(e),Lp=()=>!1,tk=e=>JS.test(e),nk=e=>ZS.test(e),sk=e=>!xe(e)&&!ve(e),rk=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ok=e=>to(e,s0,Lp),xe=e=>Jy.test(e),io=e=>to(e,r0,ek),ng=e=>to(e,pk,Ue),lk=e=>to(e,l0,e0),ak=e=>to(e,o0,Lp),sg=e=>to(e,t0,Lp),ik=e=>to(e,n0,nk),hi=e=>to(e,a0,tk),ve=e=>Zy.test(e),Kl=e=>Lo(e,r0),ck=e=>Lo(e,o0),rg=e=>Lo(e,t0),uk=e=>Lo(e,s0),dk=e=>Lo(e,n0),gi=e=>Lo(e,a0,!0),fk=e=>Lo(e,l0,!0),to=(e,t,n)=>{const s=Jy.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Lo=(e,t,n=!1)=>{const s=Zy.exec(e);return s?s[1]?t(s[1]):n:!1},t0=e=>e==="position"||e==="percentage",n0=e=>e==="image"||e==="url",s0=e=>e==="length"||e==="size"||e==="bg-size",r0=e=>e==="length",pk=e=>e==="number",o0=e=>e==="family-name",l0=e=>e==="number"||e==="weight",a0=e=>e==="shadow",mk=()=>{const e=Vt("color"),t=Vt("font"),n=Vt("text"),s=Vt("font-weight"),o=Vt("tracking"),l=Vt("leading"),a=Vt("breakpoint"),i=Vt("container"),c=Vt("spacing"),d=Vt("radius"),f=Vt("shadow"),m=Vt("inset-shadow"),p=Vt("text-shadow"),h=Vt("drop-shadow"),g=Vt("blur"),w=Vt("perspective"),j=Vt("aspect"),v=Vt("ease"),x=Vt("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),ve,xe],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[ve,xe,c],O=()=>[br,"full","auto",...C()],P=()=>[Is,"none","subgrid",ve,xe],D=()=>["auto",{span:["full",Is,ve,xe]},Is,ve,xe],W=()=>[Is,"auto",ve,xe],G=()=>["auto","min","max","fr",ve,xe],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...C()],V=()=>[br,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],L=()=>[br,"screen","full","dvw","lvw","svw","min","max","fit",...C()],Y=()=>[br,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],z=()=>[e,ve,xe],we=()=>[...b(),rg,sg,{position:[ve,xe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Re=()=>["auto","cover","contain",uk,ok,{size:[ve,xe]}],Pe=()=>[Uu,Kl,io],ke=()=>["","none","full",d,ve,xe],Z=()=>["",Ue,Kl,io],ge=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[Ue,Uu,rg,sg],_e=()=>["","none",g,ve,xe],pe=()=>["none",Ue,ve,xe],E=()=>["none",Ue,ve,xe],B=()=>[Ue,ve,xe],A=()=>[br,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xs],breakpoint:[Xs],color:[e0],container:[Xs],"drop-shadow":[Xs],ease:["in","out","in-out"],font:[sk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xs],shadow:[Xs],spacing:["px",Ue],text:[Xs],"text-shadow":[Xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",br,xe,ve,j]}],container:["container"],"container-type":[{"@container":["","normal","size",ve,xe]}],"container-named":[rk],columns:[{columns:[Ue,xe,ve,i]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Is,"auto",ve,xe]}],basis:[{basis:[br,"full","auto",i,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ue,br,"auto","initial","none",xe]}],grow:[{grow:["",Ue,ve,xe]}],shrink:[{shrink:["",Ue,ve,xe]}],order:[{order:[Is,"first","last","none",ve,xe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[i,"screen",...V()]}],"min-w":[{"min-w":[i,"screen","none",...V()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Kl,io]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,fk,lk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Uu,xe]}],"font-family":[{font:[ck,ak,t]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ve,xe]}],"line-clamp":[{"line-clamp":[Ue,"none",ve,ng]}],leading:[{leading:[l,...C()]}],"list-image":[{"list-image":["none",ve,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ue,"from-font","auto",ve,io]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ue,"auto",ve,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Is,ve,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:we()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:Re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Is,ve,xe],radial:["",ve,xe],conic:[Is,ve,xe]},dk,ik]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:Pe()}],"gradient-via-pos":[{via:Pe()}],"gradient-to-pos":[{to:Pe()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ke()}],"rounded-s":[{"rounded-s":ke()}],"rounded-e":[{"rounded-e":ke()}],"rounded-t":[{"rounded-t":ke()}],"rounded-r":[{"rounded-r":ke()}],"rounded-b":[{"rounded-b":ke()}],"rounded-l":[{"rounded-l":ke()}],"rounded-ss":[{"rounded-ss":ke()}],"rounded-se":[{"rounded-se":ke()}],"rounded-ee":[{"rounded-ee":ke()}],"rounded-es":[{"rounded-es":ke()}],"rounded-tl":[{"rounded-tl":ke()}],"rounded-tr":[{"rounded-tr":ke()}],"rounded-br":[{"rounded-br":ke()}],"rounded-bl":[{"rounded-bl":ke()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-bs":[{"border-bs":Z()}],"border-w-be":[{"border-be":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ue,ve,xe]}],"outline-w":[{outline:["",Ue,Kl,io]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,gi,hi]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",m,gi,hi]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ue,io]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",p,gi,hi]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ue,ve,xe]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[ve,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:we()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:Re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,xe]}],filter:[{filter:["","none",ve,xe]}],blur:[{blur:_e()}],brightness:[{brightness:[Ue,ve,xe]}],contrast:[{contrast:[Ue,ve,xe]}],"drop-shadow":[{"drop-shadow":["","none",h,gi,hi]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ue,ve,xe]}],"hue-rotate":[{"hue-rotate":[Ue,ve,xe]}],invert:[{invert:["",Ue,ve,xe]}],saturate:[{saturate:[Ue,ve,xe]}],sepia:[{sepia:["",Ue,ve,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,xe]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Ue,ve,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Ue,ve,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ue,ve,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ue,ve,xe]}],"backdrop-invert":[{"backdrop-invert":["",Ue,ve,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Ue,ve,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Ue,ve,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ue,ve,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ue,"initial",ve,xe]}],ease:[{ease:["linear","initial",v,ve,xe]}],delay:[{delay:[Ue,ve,xe]}],animate:[{animate:["none",x,ve,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ve,xe]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:E()}],"scale-x":[{"scale-x":E()}],"scale-y":[{"scale-y":E()}],"scale-z":[{"scale-z":E()}],"scale-3d":["scale-3d"],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[ve,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:A()}],"translate-x":[{"translate-x":A()}],"translate-y":[{"translate-y":A()}],"translate-z":[{"translate-z":A()}],"translate-none":["translate-none"],zoom:[{zoom:[Is,ve,xe]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ve,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ve,xe]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ue,Kl,io,ng]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hk=qS(mk);function Ve(...e){return hk(qy(e))}const gk=Gy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function F({className:e,variant:t,size:n,asChild:s=!1,...o}){const l=s?yS:"button";return r.jsx(l,{"data-slot":"button",className:Ve(gk({variant:t,size:n,className:e})),...o})}function Ie({className:e,type:t,...n}){return r.jsx("input",{type:t,"data-slot":"input",className:Ve("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",e),...n})}var xk=Object.defineProperty,vk=(e,t)=>xk(e,"name",{value:t,configurable:!0}),yk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ot=yk.reduce((e,t)=>{const n=pr(`Primitive.${t}`),s=u.forwardRef((o,l)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...i,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function i0(e,t){e&&Oo.flushSync(()=>e.dispatchEvent(t))}vk(i0,"dispatchDiscreteCustomEvent");var wk=Object.defineProperty,jk=(e,t)=>wk(e,"name",{value:t,configurable:!0}),bk=u.forwardRef(jk(function(t,n){return r.jsx(ot.label,{...t,ref:n,onMouseDown:s=>{var l;s.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})},"Label")),_k=bk;const Ze=u.forwardRef(({className:e,...t},n)=>r.jsx(_k,{ref:n,"data-slot":"label",className:Ve("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t}));Ze.displayName="Label";function Dn({className:e,...t}){return r.jsx("div",{"data-slot":"card",className:Ve("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ms({className:e,...t}){return r.jsx("div",{"data-slot":"card-header",className:Ve("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function hs({className:e,...t}){return r.jsx("div",{"data-slot":"card-title",className:Ve("leading-none font-semibold",e),...t})}function c0({className:e,...t}){return r.jsx("div",{"data-slot":"card-description",className:Ve("text-muted-foreground text-sm",e),...t})}function Fn({className:e,...t}){return r.jsx("div",{"data-slot":"card-content",className:Ve("px-6",e),...t})}function u0({className:e,...t}){return r.jsx("div",{"data-slot":"card-footer",className:Ve("flex items-center px-6",e),...t})}/**
85
- * @license lucide-react v1.35.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */const d0=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
90
- * @license lucide-react v1.35.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const Sk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
95
- * @license lucide-react v1.35.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const kk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
100
- * @license lucide-react v1.35.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const og=e=>{const t=kk(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
105
- * @license lucide-react v1.35.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */var Vu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
110
- * @license lucide-react v1.35.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const Nk=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ck=u.createContext({}),Ek=()=>u.useContext(Ck),Rk=u.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:o="",children:l,iconNode:a,...i},c)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:m=!1,color:p="currentColor",className:h=""}=Ek()??{},g=s??m?Number(n??f)*24/Number(t??d):n??f;return u.createElement("svg",{ref:c,...Vu,width:t??d??Vu.width,height:t??d??Vu.height,stroke:e??p,strokeWidth:g,className:d0("lucide",h,o),...!l&&!Nk(i)&&{"aria-hidden":"true"},...i},[...a.map(([w,j])=>u.createElement(w,j)),...Array.isArray(l)?l:[l]])});/**
115
- * @license lucide-react v1.35.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const Ee=(e,t)=>{const n=u.forwardRef(({className:s,...o},l)=>u.createElement(Rk,{ref:l,iconNode:t,className:d0(`lucide-${Sk(og(e))}`,`lucide-${e}`,s),...o}));return n.displayName=og(e),n};/**
120
- * @license lucide-react v1.35.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const Pk=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],Hu=Ee("archive-restore",Pk);/**
125
- * @license lucide-react v1.35.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const Tk=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Wu=Ee("archive",Tk);/**
130
- * @license lucide-react v1.35.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const Mk=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],$k=Ee("arrow-down-to-line",Mk);/**
135
- * @license lucide-react v1.35.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const Ik=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zp=Ee("arrow-left",Ik);/**
140
- * @license lucide-react v1.35.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const Ak=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ok=Ee("arrow-right",Ak);/**
145
- * @license lucide-react v1.35.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const Lk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zk=Ee("arrow-up",Lk);/**
150
- * @license lucide-react v1.35.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const Dk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Fk=Ee("ban",Dk);/**
155
- * @license lucide-react v1.35.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const Bk=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Uk=Ee("bell",Bk);/**
160
- * @license lucide-react v1.35.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const Vk=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],f0=Ee("boxes",Vk);/**
165
- * @license lucide-react v1.35.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const Hk=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],p0=Ee("brain",Hk);/**
170
- * @license lucide-react v1.35.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const Wk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nl=Ee("check",Wk);/**
175
- * @license lucide-react v1.35.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const qk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Cl=Ee("chevron-down",qk);/**
180
- * @license lucide-react v1.35.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const Gk=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_c=Ee("chevron-up",Gk);/**
185
- * @license lucide-react v1.35.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const Kk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Yk=Ee("circle-x",Kk);/**
190
- * @license lucide-react v1.35.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const Qk=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Xk=Ee("command",Qk);/**
195
- * @license lucide-react v1.35.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const Jk=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Zk=Ee("copy-plus",Jk);/**
200
- * @license lucide-react v1.35.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const eN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Dp=Ee("copy",eN);/**
205
- * @license lucide-react v1.35.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const tN=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nN=Ee("download",tN);/**
210
- * @license lucide-react v1.35.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const sN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Fp=Ee("external-link",sN);/**
215
- * @license lucide-react v1.35.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const rN=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],lg=Ee("eye-off",rN);/**
220
- * @license lucide-react v1.35.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const oN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lN=Ee("file-exclamation-point",oN);/**
225
- * @license lucide-react v1.35.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const aN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],m0=Ee("file-text",aN);/**
230
- * @license lucide-react v1.35.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const iN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ag=Ee("folder-open",iN);/**
235
- * @license lucide-react v1.35.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const cN=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],uN=Ee("folder-plus",cN);/**
240
- * @license lucide-react v1.35.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const dN=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],fN=Ee("git-fork",dN);/**
245
- * @license lucide-react v1.35.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const pN=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Bp=Ee("key-round",pN);/**
250
- * @license lucide-react v1.35.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const mN=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],h0=Ee("link-2",mN);/**
255
- * @license lucide-react v1.35.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const hN=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],gN=Ee("list",hN);/**
260
- * @license lucide-react v1.35.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const xN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],g0=Ee("loader-circle",xN);/**
265
- * @license lucide-react v1.35.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const vN=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Up=Ee("log-out",vN);/**
270
- * @license lucide-react v1.35.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const yN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],wN=Ee("maximize-2",yN);/**
275
- * @license lucide-react v1.35.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const jN=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],bN=Ee("menu",jN);/**
280
- * @license lucide-react v1.35.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const _N=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],SN=Ee("message-square",_N);/**
285
- * @license lucide-react v1.35.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const kN=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],NN=Ee("messages-square",kN);/**
290
- * @license lucide-react v1.35.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const CN=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],x0=Ee("palette",CN);/**
295
- * @license lucide-react v1.35.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const EN=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Vp=Ee("pencil",EN);/**
300
- * @license lucide-react v1.35.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const RN=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],uf=Ee("play",RN);/**
305
- * @license lucide-react v1.35.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const PN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],TN=Ee("plug-zap",PN);/**
310
- * @license lucide-react v1.35.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const MN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Va=Ee("plus",MN);/**
315
- * @license lucide-react v1.35.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const $N=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Pa=Ee("refresh-cw",$N);/**
320
- * @license lucide-react v1.35.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const IN=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],df=Ee("rotate-ccw",IN);/**
325
- * @license lucide-react v1.35.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const AN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],ON=Ee("save",AN);/**
330
- * @license lucide-react v1.35.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const LN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ff=Ee("send",LN);/**
335
- * @license lucide-react v1.35.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const zN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],v0=Ee("settings",zN);/**
340
- * @license lucide-react v1.35.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const DN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]],FN=Ee("shield-user",DN);/**
345
- * @license lucide-react v1.35.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const BN=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],UN=Ee("shrink",BN);/**
350
- * @license lucide-react v1.35.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const VN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Hp=Ee("square",VN);/**
355
- * @license lucide-react v1.35.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const HN=[["path",{d:"M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"1ystz2"}],["path",{d:"M3 4v16",key:"1ph11n"}]],WN=Ee("step-forward",HN);/**
360
- * @license lucide-react v1.35.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const qN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],qs=Ee("trash-2",qN);/**
365
- * @license lucide-react v1.35.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const GN=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],y0=Ee("triangle-alert",GN);/**
370
- * @license lucide-react v1.35.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const KN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Sc=Ee("undo-2",KN);/**
375
- * @license lucide-react v1.35.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const YN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],QN=Ee("users",YN);/**
380
- * @license lucide-react v1.35.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const XN=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],JN=Ee("webhook",XN);/**
385
- * @license lucide-react v1.35.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const ZN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],w0=Ee("wrench",ZN);/**
390
- * @license lucide-react v1.35.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const eC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Co=Ee("x",eC);/**
395
- * @license lucide-react v1.35.0 - ISC
396
- *
397
- * This source code is licensed under the ISC license.
398
- * See the LICENSE file in the root directory of this source tree.
399
- */const tC=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],ig=Ee("zap",tC);function nC(){const e=Al(),t=Xn(),[n,s]=u.useState("login"),[o,l]=u.useState(""),[a,i]=u.useState(""),[c,d]=u.useState(""),[f,m]=u.useState(""),[p,h]=u.useState(""),[g,w]=u.useState(""),[j,v]=u.useState(!1);function x(){s(n==="login"?"reg":"login"),w("")}async function y(){if(j)return;w("");const b=n==="reg";if(b&&f!==p){w("两次输入的密码不一致");return}v(!0);try{b?(await pl.register(c,f),await t.load()):await t.login(o,a),e("/app")}catch(S){w(S.message||(b?"注册失败":"登录失败"))}finally{v(!1)}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(Dn,{className:"w-[360px] shadow-xl",children:[r.jsxs(ms,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(Xc,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsx(hs,{className:"font-serif text-lg",children:n==="login"?"Touchstone":"注册用户"}),r.jsx(c0,{className:"mt-1",children:"Free-style testing · Execution & monitoring"})]})]}),r.jsxs(Fn,{className:"flex flex-col gap-4",children:[n==="login"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"login-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{id:"login-username",value:o,onChange:b=>l(b.target.value.trim()),autoComplete:"username",placeholder:"请输入用户名",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"login-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{id:"login-password",value:a,onChange:b=>i(b.target.value),type:"password",autoComplete:"current-password",placeholder:"请输入密码",onKeyUp:b=>{b.key==="Enter"&&y()}})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"reg-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{id:"reg-username",value:c,onChange:b=>d(b.target.value.trim()),autoComplete:"username",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"reg-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{id:"reg-password",value:f,onChange:b=>m(b.target.value),type:"password",autoComplete:"new-password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"reg-password2",className:"text-xs text-muted-foreground",children:"确认密码"}),r.jsx(Ie,{id:"reg-password2",value:p,onChange:b=>h(b.target.value),type:"password",autoComplete:"new-password",onKeyUp:b=>{b.key==="Enter"&&y()}})]})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:g}),r.jsxs(F,{size:"lg",className:"w-full",disabled:j,onClick:y,children:[j&&r.jsx(g0,{className:"size-4 animate-spin"}),n==="login"?"登 录":"注 册"]})]}),r.jsxs(u0,{className:"flex-col items-center gap-3 pt-0",children:[r.jsx("button",{type:"button",className:"text-sm text-primary underline-offset-4 hover:underline",onClick:x,children:n==="login"?"没有账号?注册新用户":"已有账号?返回登录"}),n==="login"&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入账号密码登录;登录后可在右上角修改密码"})]})]})})}const $n=Ip((e,t)=>({projects:[],currentProject:null,tasks:[],bugs:[],loading:{projects:!1,tasks:!1,bugs:!1},loadProjects:async()=>{e(n=>({loading:{...n.loading,projects:!0}}));try{e({projects:await Pt.list()})}finally{e(n=>({loading:{...n.loading,projects:!1}}))}},selectProject:async n=>{const s=t().projects.find(o=>o.id===n)||null;e({currentProject:s}),s&&await Promise.all([t().loadTasks(),t().loadBugs()])},refreshProject:async()=>{const n=t().currentProject;if(!n)return;const s=await Pt.get(n.id);e(o=>({currentProject:s,projects:o.projects.map(l=>l.id===s.id?s:l)}))},loadTasks:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,tasks:!0}}));try{e({tasks:await Be.list(n.id)})}finally{e(s=>({loading:{...s.loading,tasks:!1}}))}}},loadBugs:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,bugs:!0}}));try{e({bugs:await of.list(n.id)})}finally{e(s=>({loading:{...s.loading,bugs:!1}}))}}},createProject:async n=>{const s=await Pt.create(n);return await t().loadProjects(),s},updateProject:async(n,s)=>{await Pt.update(n,s),await t().refreshProject(),await t().loadProjects()},deleteProject:async(n,s)=>{var o;await Pt.remove(n,s),((o=t().currentProject)==null?void 0:o.id)===n&&e({currentProject:null}),await t().loadProjects()},archiveProject:async(n,s)=>{var o;await Pt[s?"archive":"unarchive"](n),await t().loadProjects(),((o=t().currentProject)==null?void 0:o.id)===n&&await t().refreshProject()}}));let co=null,cg=null;function T(e,t=2500){co||(co=document.createElement("div"),co.className="ts-toast",document.body.appendChild(co)),co.textContent=e,co.classList.add("show"),clearTimeout(cg),cg=setTimeout(()=>co.classList.remove("show"),t)}const Wi=400,qi=240,Mn=8,sC={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",nw:"nwse-resize",se:"nwse-resize",sw:"nesw-resize"};function rC(e,t){if(!e)return null;try{const n=JSON.parse(localStorage.getItem(e));if(n&&+n.w>=Wi&&(!t||+n.h>=qi))return t?{w:+n.w,h:+n.h}:{w:+n.w}}catch{}return null}function sr(e,t=!0){const[n,s]=u.useState(()=>rC(e,t)),o=u.useRef(null),l=u.useRef(null),a=u.useCallback(h=>{const g=o.current;if(!g)return;const w=h.clientX-g.sx,j=h.clientY-g.sy;let v=g.left,x=g.top,y=g.w,b=g.h;if(g.dir==="mv"){const k=window.innerWidth,C=window.innerHeight;v=Math.max(Mn,Math.min(g.left+w,k-Mn-y)),x=Math.max(Mn,Math.min(g.top+j,C-Mn-b)),s({left:v,top:x,w:y,h:b});return}g.dir.includes("e")&&(y=g.w+w),g.dir.includes("s")&&(b=g.h+j),g.dir.includes("w")&&(y=g.w-w,v=g.left+w),g.dir.includes("n")&&(b=g.h-j,x=g.top+j);const S=window.innerWidth,N=window.innerHeight;y<Wi&&(g.dir.includes("w")&&(v-=Wi-y),y=Wi),b<qi&&(g.dir.includes("n")&&(x-=qi-b),b=qi),v<Mn&&(g.dir.includes("w")&&(y-=Mn-v),v=Mn),x<Mn&&(g.dir.includes("n")&&(b-=Mn-x),x=Mn),v+y>S-Mn&&(y=S-Mn-v),x+b>N-Mn&&(b=N-Mn-x),s({left:v,top:x,w:y,h:b})},[]),i=u.useCallback(()=>{l.current&&(window.removeEventListener("mousemove",l.current),window.removeEventListener("mouseup",i),l.current=null),document.body.style.cursor="",e&&s(h=>{if(h)try{localStorage.setItem(e,JSON.stringify(t?{w:h.w,h:h.h}:{w:h.w}))}catch{}return h})},[e,t]),c=u.useCallback((h,g)=>{const w=h.currentTarget.closest(".modal");if(!w)return;w.style.animation="none",w.style.transition="none";const j=w.getBoundingClientRect();o.current={dir:g,sx:h.clientX,sy:h.clientY,left:j.left,top:j.top,w:j.width,h:j.height},s({left:j.left,top:j.top,w:j.width,h:j.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor=sC[g]||"default"},[a,i]),d=u.useCallback(h=>{if(h.button!==0)return;const g=h.currentTarget.closest(".modal");if(!g)return;g.style.animation="none",g.style.transition="none";const w=g.getBoundingClientRect();o.current={dir:"mv",sx:h.clientX,sy:h.clientY,left:w.left,top:w.top,w:w.width,h:w.height},s({left:w.left,top:w.top,w:w.width,h:w.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor="move",h.preventDefault()},[a,i]),f=u.useCallback(()=>{if(e)try{localStorage.removeItem(e)}catch{}s(null)},[e]),m=!!n,p=n?n.left!=null?{left:n.left+"px",top:n.top+"px",width:n.w+"px",height:n.h+"px",transform:"none"}:n.h?{left:`calc(50% - ${n.w/2}px)`,top:`calc(50% - ${n.h/2}px)`,width:n.w+"px",height:n.h+"px"}:{left:`calc(50% - ${n.w/2}px)`,width:n.w+"px"}:{};return{rzOn:m,rzStyle:p,rzStart:c,rzDragStart:d,rzReset:f}}const oC=/[^\s\u0000\u0001<>",。、;:!?()〔〕【】「」『』《》〈〉…—~·“”‘’]+/g,lC=/^[([{`'*“「『【(〔〈《]+/,aC=/(?::\d+(?::\d+)?|[)\]}`'*.,;:!?。,、;:!?…’”」』)】〕〉》])+$/,iC=/[()[\]{}*?=,!#$%^|`]/,cC=/^[^/\\\s]*\.[A-Za-z][A-Za-z0-9]{0,9}$/,uC=new Set(["md","markdown","txt","rst","json","jsonl","ndjson","yaml","yml","toml","ini","cfg","conf","env","log","csv","tsv","xml","html","htm","css","scss","less","js","jsx","mjs","cjs","ts","tsx","vue","svelte","py","sh","bash","zsh","bat","cmd","ps1","sql","go","rs","java","kt","rb","php","c","h","cc","cpp","hpp","cs","swift","lua","pl","r","jl","lock","patch","diff","ipynb","pdf","zip","tar","gz","tgz","7z","png","jpg","jpeg","gif","webp","svg","ico","bmp","mp4","mov","mp3","xlsx","xls","docx","doc","pptx","ppt","db","sqlite","wasm","map"]);function dC(e){return e.slice(e.lastIndexOf(".")+1).toLowerCase()}function fC(e,t){if(!e||e.indexOf("://")>=0||iC.test(e))return!1;const n=e.split(/[/\\]/).pop();return cC.test(n)?/[/\\]/.test(e)||/^[A-Za-z]:/.test(e)?!0:t&&uC.has(dC(n)):!1}function pC(e){return`<a class="md-path" data-path="${e}" title="点击预览:${e}">${e}</a>`}function ug(e,t){const n=!!(t&&t.bare);return String(e??"").replace(oC,s=>{const o=(s.match(lC)||[""])[0],l=s.slice(o.length),a=(l.match(aC)||[""])[0],i=l.slice(0,l.length-a.length);return fC(i,n)?o+pC(i)+a:s})}const xi=e=>String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function dg(e){const t=String(e||"").trim();return/^(\/|https?:\/\/|mailto:|tel:|data:image\/)/i.test(t)?t:""}function _r(e,t){const n=!!(t&&t.pathLinks);let s=xi(e);const o=[],l=[];return s=s.replace(/`([^`]+)`/g,(a,i)=>(o.push(i),"\0"+(o.length-1)+"\0")),n&&(s=s.replace(/!?\[[^\]]*\]\([^)\s]+(?:\s+"[^"]*")?\)/g,a=>(l.push(a),""+(l.length-1)+""))),s=s.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),n&&(s=ug(s)),l.length&&(s=s.replace(/\u0001(\d+)\u0001/g,(a,i)=>l[+i])),s=s.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=dg(c);return d?`<img class="md-img" src="${d}" alt="${xi(i)}" loading="lazy">`:xi(a)}),s=s.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=dg(c);return d?`<a href="${d}" target="_blank" rel="noreferrer">${i}</a>`:xi(a)}),s=s.replace(/\u0000(\d+)\u0000/g,(a,i)=>"<code>"+(n?ug(o[+i],{bare:!0}):o[+i])+"</code>"),s}const fg=e=>String(e).trim().replace(/^\||\|$/g,"").split("|").map(t=>t.trim());function Eo(e,t){const n=t||{},s=String(e||"").split(`
400
- `);let o="",l=0;for(;l<s.length;){const a=s[l];if(/^```/.test(a)){const c=[];for(l++;l<s.length&&!/^```/.test(s[l]);)c.push(s[l]),l++;l++,o+="<pre><code>"+c.map(d=>_r(d)).join(`
401
- `)+"</code></pre>";continue}if(/^\|/.test(a)&&l+1<s.length&&/^\|[\s:|-]+\|$/.test(s[l+1])){const c=fg(a);l+=2;const d=[];for(;l<s.length&&/^\|/.test(s[l]);)d.push(fg(s[l])),l++;o+="<table><thead><tr>"+c.map(f=>"<th>"+_r(f,n)+"</th>").join("")+"</tr></thead><tbody>"+d.map(f=>"<tr>"+f.map(m=>"<td>"+_r(m,n)+"</td>").join("")+"</tr>").join("")+"</tbody></table>";continue}const i=a.match(/^(#{1,4})\s+(.*)$/);if(i){o+="<h"+i[1].length+">"+_r(i[2],n)+"</h"+i[1].length+">",l++;continue}if(/^\s*(?:---|\*\*\*)\s*$/.test(a)){o+="<hr>",l++;continue}if(/^\s*[-*]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*[-*]\s+/.test(s[l]);)c.push(_r(s[l].replace(/^\s*[-*]\s+/,""),n)),l++;o+="<ul>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ul>";continue}if(/^\s*\d{1,2}[.)]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*\d{1,2}[.)]\s+/.test(s[l]);)c.push(_r(s[l].replace(/^\s*\d{1,2}[.)]\s+/,""),n)),l++;o+="<ol>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ol>";continue}if(/^\s*>\s?/.test(a)){const c=[];for(;l<s.length&&/^\s*>\s?/.test(s[l]);)c.push(s[l].replace(/^\s*>\s?/,"")),l++;o+="<blockquote>"+c.map(d=>"<p>"+_r(d,n)+"</p>").join("")+"</blockquote>";continue}if(a.trim()===""){l++;continue}o+="<p>"+_r(a,n)+"</p>",l++}return o}function rs(e){return e||"—"}const lr={queued:"排队中",running:"运行中",done:"已完成",stopped:"已停止",failed:"失败",interrupted:"中断"};function rr({start:e,reset:t}){const n=["n","s","e","w","ne","nw","se","sw"];return r.jsx(r.Fragment,{children:n.map(s=>r.jsx("i",{className:"rz rz-"+s,onMouseDown:o=>e(o,s),onDoubleClick:t,title:"拖动调整大小,双击复位"},s))})}const pf={idle:"",queued_serial:"排队中",answer_pending:"已作答·待送达",interaction_pending:"等待作答",server_queued:"服务端排队中",foreign_busy:"等外部会话",starting:"启动中",running:"会话运行中"},j0={running:"run",starting:"run",interaction_pending:"queued",queued_serial:"queued",answer_pending:"queued",server_queued:"server",foreign_busy:"foreign"},mC={run:"bug-status run",queued:"bug-status retest",server:"bug-status retest",foreign:"bug-status retest"},hC={run:"sess-qstate run",queued:"sess-qstate queued",server:"sess-qstate server",foreign:"sess-qstate foreign"};function b0(e,t="board"){const n=j0[e];return n?(t==="sess"?hC:mC)[n]:t==="sess"?"sess-qstate":"bug-status pending"}function gC(e,t={}){const{found:n=!0,board:s=!1,canQueue:o=!1,chatRunning:l=!1,projectBusy:a=!1}=t;if(!n)return"会话不可用";if(e==="foreign_busy")return s?"外部会话运行中:Enter 排队,空闲后自动投递":"外部会话运行中:Enter 排队,空闲后自动发送";if(e==="interaction_pending")return s?"agent 等待你作答:回答上方提问,或 Enter 排队继续对话":"agent 等待你作答:回答上方提问";const i=!!j0[e]||a;return i&&o?s?"会话运行中:Enter 排队,排队行「立即注入」可插入当前轮":"任务运行中:Enter 排队,排队行「立即注入」可插入当前轮":i?s?"项目忙:Enter 排队,空闲后自动投递":"项目忙:Enter 排队,空闲后自动发送":l?"对话进行中:Enter 排队,等当前轮结束发送":"向该会话继续发消息…(Enter 发送,Shift+Enter 换行)"}const xC=/([!]?\[[^\]]*\]\()([^)\s]+)(\))/g,_0="m\\d{13}_[0-9a-f]{10}\\.[A-Za-z0-9]{1,10}",vC=new RegExp("^\\/.*\\/board_media\\/("+_0+")$"),yC=new RegExp("^\\/api\\/projects\\/\\d+\\/board\\/media\\/("+_0+")$"),S0="/touchstone/".replace(/\/+$/,"");function Wp(e,t=S0){const n=typeof e=="string"?e:"";return yC.test(n)?t+n:n}function mf(e,t,n=S0){return!e||!t?e||"":String(e).replace(xC,(s,o,l,a)=>{const i=vC.exec(l);if(i)return o+n+"/api/projects/"+t+"/board/media/"+i[1]+a;const c=Wp(l,n);return c===l?s:o+c+a})}const pg=4;async function qp(e){try{if(!(e.type||"").startsWith("image/"))return!1;const t=new Uint8Array(await e.slice(0,24).arrayBuffer());if(t.length<24||[137,80,78,71,13,10,26,10].some((l,a)=>t[a]!==l))return!1;const s=t[16]<<24|t[17]<<16|t[18]<<8|t[19],o=t[20]<<24|t[21]<<16|t[22]<<8|t[23];return s<=pg&&o<=pg}catch{return!1}}var wC=Object.defineProperty,jC=(e,t)=>wC(e,"name",{value:t,configurable:!0});function hf(e,[t,n]){return Math.min(n,Math.max(t,e))}jC(hf,"clamp");var bC=Object.defineProperty,Ol=(e,t)=>bC(e,"name",{value:t,configurable:!0}),k0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ke(e,t,{checkForDefaultPrevented:n=!0}={}){return Ol(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Ol(Ke,"composeEventHandlers");function _C(e){var t;if(!k0)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Ol(_C,"getOwnerWindow");function gf(e){if(!k0)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Ol(gf,"getOwnerDocument");function N0(e,t=!1){const{activeElement:n}=gf(e);if(!(n!=null&&n.nodeName))return null;if(C0(n)&&n.contentDocument)return N0(n.contentDocument.body,t);if(t){const s=n.getAttribute("aria-activedescendant");if(s){const o=gf(n).getElementById(s);if(o)return o}}return n}Ol(N0,"getActiveElement");function C0(e){return e.tagName==="IFRAME"}Ol(C0,"isFrame");var SC=Object.defineProperty,as=(e,t)=>SC(e,"name",{value:t,configurable:!0});function kC(e,t){const n=u.createContext(t);n.displayName=e+"Context";const s=as(l=>{const{children:a,...i}=l,c=u.useMemo(()=>i,Object.values(i));return r.jsx(n.Provider,{value:c,children:a})},"Provider");s.displayName=e+"Provider";function o(l,a={}){const{optional:i=!1}=a,c=u.useContext(n);if(c)return c;if(t!==void 0)return t;if(!i)throw new Error(`\`${l}\` must be used within \`${e}\``)}return as(o,"useContext"),[s,o]}as(kC,"createContext");function no(e,t=[]){let n=[];function s(l,a){const i=u.createContext(a);i.displayName=l+"Context";const c=n.length;n=[...n,a];const d=as(m=>{var v;const{scope:p,children:h,...g}=m,w=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useMemo(()=>g,Object.values(g));return r.jsx(w.Provider,{value:j,children:h})},"Provider");d.displayName=l+"Provider";function f(m,p,h={}){var v;const{optional:g=!1}=h,w=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useContext(w);if(j)return j;if(a!==void 0)return a;if(!g)throw new Error(`\`${m}\` must be used within \`${l}\``)}return as(f,"useContext"),[d,f]}as(s,"createContext");const o=as(()=>{const l=n.map(a=>u.createContext(a));return as(function(i){const c=(i==null?void 0:i[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])},"useScope")},"createScope");return o.scopeName=e,[s,E0(o,...t)]}as(no,"createContextScope");function E0(...e){const t=e[0];if(e.length===1)return t;const n=as(()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return as(function(l){const a=s.reduce((i,{useScope:c,scopeName:d})=>{const m=c(l)[`__scope${d}`];return{...i,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}as(E0,"composeContextScopes");var NC=Object.defineProperty,rn=(e,t)=>NC(e,"name",{value:t,configurable:!0});function Gp(e){const t=e+"CollectionProvider",[n,s]=no(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=rn(w=>{const{scope:j,children:v}=w,x=u.useRef(null),y=u.useRef(new Map).current;return r.jsx(o,{scope:j,itemMap:y,collectionRef:x,children:v})},"CollectionProvider");a.displayName=t;const i=e+"CollectionSlot",c=pr(i),d=u.forwardRef((w,j)=>{const{scope:v,children:x}=w,y=l(i,v),b=vt(j,y.collectionRef);return r.jsx(c,{ref:b,children:x})});d.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=pr(f),h=u.forwardRef((w,j)=>{const{scope:v,children:x,...y}=w,b=u.useRef(null),S=vt(j,b),N=l(f,v);return u.useEffect(()=>(N.itemMap.set(b,{ref:b,...y}),()=>void N.itemMap.delete(b))),r.jsx(p,{[m]:"",ref:S,children:x})});h.displayName=f;function g(w){const j=l(e+"CollectionConsumer",w);return u.useCallback(()=>{const x=j.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${m}]`));return Array.from(j.itemMap.values()).sort((N,k)=>y.indexOf(N.ref.current)-y.indexOf(k.ref.current))},[j.collectionRef,j.itemMap])}return rn(g,"useCollection"),[{Provider:a,Slot:d,ItemSlot:h},g,s]}rn(Gp,"createCollection");var mg=new WeakMap,zt,Gn,qu=(Gn=class extends Map{constructor(n){super(n);Em(this,zt);fu(this,zt,[...super.keys()]),mg.set(this,!0)}set(n,s){return mg.get(this)&&(this.has(n)?hn(this,zt)[hn(this,zt).indexOf(n)]=n:hn(this,zt).push(n)),super.set(n,s),this}insert(n,s,o){const l=this.has(s),a=hn(this,zt).length,i=Kp(n);let c=i>=0?i:a+i;const d=c<0||c>=a?-1:c;if(d===this.size||l&&d===this.size-1||d===-1)return this.set(s,o),this;const f=this.size+(l?0:1);i<0&&c++;const m=[...hn(this,zt)];let p,h=!1;for(let g=c;g<f;g++)if(c===g){let w=m[g];m[g]===s&&(w=m[g+1]),l&&this.delete(s),p=this.get(w),this.set(s,o)}else{!h&&m[g-1]===s&&(h=!0);const w=m[h?g:g-1],j=p;p=this.get(w),this.delete(w),this.set(w,j)}return this}with(n,s,o){const l=new Gn(this);return l.insert(n,s,o),l}before(n){const s=hn(this,zt).indexOf(n)-1;if(!(s<0))return this.entryAt(s)}setBefore(n,s,o){const l=hn(this,zt).indexOf(n);return l===-1?this:this.insert(l,s,o)}after(n){let s=hn(this,zt).indexOf(n);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(n,s,o){const l=hn(this,zt).indexOf(n);return l===-1?this:this.insert(l+1,s,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return fu(this,zt,[]),super.clear()}delete(n){const s=super.delete(n);return s&&hn(this,zt).splice(hn(this,zt).indexOf(n),1),s}deleteAt(n){const s=this.keyAt(n);return s!==void 0?this.delete(s):!1}at(n){const s=Gi(hn(this,zt),n);if(s!==void 0)return this.get(s)}entryAt(n){const s=Gi(hn(this,zt),n);if(s!==void 0)return[s,this.get(s)]}indexOf(n){return hn(this,zt).indexOf(n)}keyAt(n){return Gi(hn(this,zt),n)}from(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return l;o++}}findIndex(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return o;o++}return-1}filter(n,s){const o=[];let l=0;for(const a of this)Reflect.apply(n,s,[a,l,this])&&o.push(a),l++;return new Gn(o)}map(n,s){const o=[];let l=0;for(const a of this)o.push([a[0],Reflect.apply(n,s,[a,l,this])]),l++;return new Gn(o)}reduce(...n){const[s,o]=n;let l=0,a=o??this.at(0);for(const i of this)l===0&&n.length===1?a=i:a=Reflect.apply(s,this,[a,i,l,this]),l++;return a}reduceRight(...n){const[s,o]=n;let l=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const i=this.at(a);a===this.size-1&&n.length===1?l=i:l=Reflect.apply(s,this,[l,i,a,this])}return l}toSorted(n){const s=[...this.entries()].sort(n);return new Gn(s)}toReversed(){const n=new Gn;for(let s=this.size-1;s>=0;s--){const o=this.keyAt(s),l=this.get(o);n.set(o,l)}return n}toSpliced(...n){const s=[...this.entries()];return s.splice(...n),new Gn(s)}slice(n,s){const o=new Gn;let l=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),s!==void 0&&s>0&&(l=s-1);for(let a=n;a<=l;a++){const i=this.keyAt(a),c=this.get(i);o.set(i,c)}return o}every(n,s){let o=0;for(const l of this){if(!Reflect.apply(n,s,[l,o,this]))return!1;o++}return!0}some(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return!0;o++}return!1}},zt=new WeakMap,rn(Gn,"OrderedDict"),Gn);function Gi(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=R0(e,t);return n===-1?void 0:e[n]}rn(Gi,"at");function R0(e,t){const n=e.length,s=Kp(t),o=s>=0?s:n+s;return o<0||o>=n?-1:o}rn(R0,"toSafeIndex");function Kp(e){return e!==e||e===0?0:Math.trunc(e)}rn(Kp,"toSafeInteger");function CC(e){const t=e+"CollectionProvider",[n,s]=no(t),[o,l]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qu,setItemMap:rn(()=>{},"setItemMap")}),a=rn(({state:y,...b})=>y?r.jsx(c,{...b,state:y}):r.jsx(i,{...b}),"CollectionProvider");a.displayName=t;const i=rn(y=>{const b=j();return r.jsx(c,{...y,state:b})},"CollectionInit");i.displayName=t+"Init";const c=rn(y=>{const{scope:b,children:S,state:N}=y,k=u.useRef(null),[C,O]=u.useState(null),P=vt(k,O),[D,W]=N;return u.useEffect(()=>{if(!C)return;const G=M0(()=>{});return G.observe(C,{childList:!0,subtree:!0}),()=>{G.disconnect()}},[C]),r.jsx(o,{scope:b,itemMap:D,setItemMap:W,collectionRef:P,collectionRefObject:k,collectionElement:C,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const d=e+"CollectionSlot",f=pr(d),m=u.forwardRef((y,b)=>{const{scope:S,children:N}=y,k=l(d,S),C=vt(b,k.collectionRef);return r.jsx(f,{ref:C,children:N})});m.displayName=d;const p=e+"CollectionItemSlot",h="data-radix-collection-item",g=pr(p),w=u.forwardRef((y,b)=>{const{scope:S,children:N,...k}=y,C=u.useRef(null),[O,P]=u.useState(null),D=vt(b,C,P),W=l(p,S),{setItemMap:G}=W,$=u.useRef(k);P0($.current,k)||($.current=k);const K=$.current;return u.useEffect(()=>{const te=K;return G(V=>O?V.has(O)?V.set(O,{...te,element:O}).toSorted(xf):(V.set(O,{...te,element:O}),V.toSorted(xf)):V),()=>{G(V=>!O||!V.has(O)?V:(V.delete(O),new qu(V)))}},[O,K,G]),r.jsx(g,{[h]:"",ref:D,children:N})});w.displayName=p;function j(){return u.useState(new qu)}rn(j,"useInitCollection");function v(y){const{itemMap:b}=l(e+"CollectionConsumer",y);return b}return rn(v,"useCollection"),[{Provider:a,Slot:m,ItemSlot:w},{createCollectionScope:s,useCollection:v,useInitCollection:j}]}rn(CC,"createCollection");function P0(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}rn(P0,"shallowEqual");function T0(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}rn(T0,"isElementPreceding");function xf(e,t){return!e[1].element||!t[1].element?0:T0(e[1].element,t[1].element)?-1:1}rn(xf,"sortByDocumentPosition");function M0(e){return new MutationObserver(n=>{for(const s of n)if(s.type==="childList"){e();return}})}rn(M0,"getChildListObserver");var EC=Object.defineProperty,RC=(e,t)=>EC(e,"name",{value:t,configurable:!0}),PC=u.createContext(void 0);function Jc(e){const t=u.useContext(PC);return e||t||"ltr"}RC(Jc,"useDirection");var TC=Object.defineProperty,MC=(e,t)=>TC(e,"name",{value:t,configurable:!0});function Rs(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}MC(Rs,"useCallbackRef");var $C=Object.defineProperty,sn=(e,t)=>$C(e,"name",{value:t,configurable:!0}),vf="dismissableLayer.update",IC="dismissableLayer.pointerDownOutside",AC="dismissableLayer.focusOutside",hg,$0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),I0=u.forwardRef(sn(function(t,n){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:d,...f}=t,m=u.useContext($0),[p,h]=u.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=u.useState({}),j=vt(n,h),v=Array.from(m.layers),[x]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),y=x?v.indexOf(x):-1,b=p?v.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,N=b>=y,k=u.useRef(!1),C=O0(W=>{a==null||a(W),c==null||c(W),W.defaultPrevented||d==null||d()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(W=>{if(!(W instanceof Node))return!1;const G=[...m.branches].some($=>$.contains(W));return N&&!G},[m.branches,N])}),O=L0(W=>{if(o&&k.current)return;const G=W.target;[...m.branches].some(K=>K.contains(G))||(i==null||i(W),c==null||c(W),W.defaultPrevented||d==null||d())},g),P=p?b===v.length-1:!1,D=Rs(W=>{W.key==="Escape"&&(l==null||l(W),!W.defaultPrevented&&d&&(W.preventDefault(),d()))});return u.useEffect(()=>{if(P)return g.addEventListener("keydown",D,{capture:!0}),()=>g.removeEventListener("keydown",D,{capture:!0})},[g,P,D]),u.useEffect(()=>{if(p)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(hg=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),yf(),()=>{s&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=hg))}},[p,g,s,m]),u.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),yf())},[p,m]),u.useEffect(()=>{const W=sn(()=>w({}),"handleUpdate");return document.addEventListener(vf,W),()=>document.removeEventListener(vf,W)},[]),r.jsx(ot.div,{...f,ref:j,style:{pointerEvents:S?N?"auto":"none":void 0,...t.style},onFocusCapture:Ke(t.onFocusCapture,O.onFocusCapture),onBlurCapture:Ke(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ke(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function A0(){const e=u.useContext($0),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}sn(A0,"useDismissableLayerSurface");var OC=sn(()=>!0,"IS_TRUE");function O0(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:a=OC}=t,i=Rs(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),m=u.useRef(()=>{});return u.useEffect(()=>{function p(){d.current=!1,o.current=!1,f.current.clear()}sn(p,"resetOutsideInteraction");function h(){return Array.from(f.current.values()).some(Boolean)}sn(h,"isOutsideInteractionIntercepted");function g(y){if(!d.current)return;const b=y.target;b instanceof Node&&[...l].some(N=>N.contains(b))||f.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{d.current&&m.current()},0)}sn(g,"handleInteractionCapture");function w(y){d.current&&f.current.set(y.type,!1)}sn(w,"handleInteractionBubble");const j=sn(y=>{if(y.target&&!c.current){let b=function(){n.removeEventListener("click",m.current);const N=h();p(),N||Yp(IC,i,S,{discrete:!0})};if(sn(b,"handleAndDispatchPointerDownOutsideEvent"),!a(y.target)){n.removeEventListener("click",m.current),p(),c.current=!1;return}const S={originalEvent:y};d.current=!0,o.current=s&&y.button===0,f.current.clear(),!s||y.button!==0?b():(n.removeEventListener("click",m.current),m.current=b,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),p();c.current=!1},"handlePointerDown"),v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of v)n.addEventListener(y,g,!0),n.addEventListener(y,w);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",j),n.removeEventListener("click",m.current);for(const y of v)n.removeEventListener(y,g,!0),n.removeEventListener(y,w)}},[n,i,s,o,l,a]),{onPointerDownCapture:sn(()=>c.current=!0,"onPointerDownCapture")}}sn(O0,"usePointerDownOutside");function L0(e,t=globalThis==null?void 0:globalThis.document){const n=Rs(e),s=u.useRef(!1);return u.useEffect(()=>{const o=sn(l=>{l.target&&!s.current&&Yp(AC,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:sn(()=>s.current=!0,"onFocusCapture"),onBlurCapture:sn(()=>s.current=!1,"onBlurCapture")}}sn(L0,"useFocusOutside");function yf(){const e=new CustomEvent(vf);document.dispatchEvent(e)}sn(yf,"dispatchUpdate");function Yp(e,t,n,{discrete:s}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),s?i0(o,l):o.dispatchEvent(l)}sn(Yp,"handleAndDispatchCustomEvent");var LC=Object.defineProperty,Qp=(e,t)=>LC(e,"name",{value:t,configurable:!0}),vi=0,As=null;function zC(e){return Zc(),e.children}Qp(zC,"FocusGuards");function Zc(){u.useEffect(()=>{As||(As={start:wf(),end:wf()});const{start:e,end:t}=As;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),vi++,()=>{vi===1&&(As==null||As.start.remove(),As==null||As.end.remove(),As=null),vi=Math.max(0,vi-1)}},[])}Qp(Zc,"useFocusGuards");function wf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}Qp(wf,"createFocusGuard");var DC=Object.defineProperty,Sn=(e,t)=>DC(e,"name",{value:t,configurable:!0}),Gu="focusScope.autoFocusOnMount",Ku="focusScope.autoFocusOnUnmount",gg={bubbles:!1,cancelable:!0},z0=u.forwardRef(Sn(function(t,n){const{loop:s=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:a,...i}=t,[c,d]=u.useState(null),f=Rs(l),m=Rs(a),p=u.useRef(null),h=vt(n,d),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let j=function(b){if(g.paused||!c)return;const S=b.target;c.contains(S)?p.current=S:Zs(p.current,{select:!0})},v=function(b){if(g.paused||!c)return;const S=b.relatedTarget;S!==null&&(c.contains(S)||Zs(p.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&Zs(c)};Sn(j,"handleFocusIn"),Sn(v,"handleFocusOut"),Sn(x,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",v);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",v),y.disconnect()}}},[o,c,g.paused]),u.useEffect(()=>{if(c){xg.add(g);const j=document.activeElement;if(!c.contains(j)){const x=new CustomEvent(Gu,gg);c.addEventListener(Gu,f),c.dispatchEvent(x),x.defaultPrevented||(D0(H0(Xp(c)),{select:!0}),document.activeElement===j&&Zs(c))}return()=>{c.removeEventListener(Gu,f),setTimeout(()=>{const x=new CustomEvent(Ku,gg);c.addEventListener(Ku,m),c.dispatchEvent(x),x.defaultPrevented||Zs(j??document.body,{select:!0}),c.removeEventListener(Ku,m),xg.remove(g)},0)}}},[c,f,m,g]);const w=u.useCallback(j=>{if(!s&&!o||g.paused)return;const v=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,x=document.activeElement;if(v&&x){const y=j.currentTarget,[b,S]=F0(y);b&&S?!j.shiftKey&&x===S?(j.preventDefault(),s&&Zs(b,{select:!0})):j.shiftKey&&x===b&&(j.preventDefault(),s&&Zs(S,{select:!0})):x===y&&j.preventDefault()}},[s,o,g.paused]);return r.jsx(ot.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})},"FocusScope"));function D0(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Zs(s,{select:t}),document.activeElement!==n)return}Sn(D0,"focusFirst");function F0(e){const t=Xp(e),n=jf(t,e),s=jf(t.reverse(),e);return[n,s]}Sn(F0,"getTabbableEdges");function Xp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Sn(s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Sn(Xp,"getTabbableCandidates");function jf(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(n?!s.checkVisibility({checkVisibilityCSS:!0}):B0(s,{upTo:t})))return s}Sn(jf,"findVisible");function B0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Sn(B0,"isHidden");function U0(e){return e instanceof HTMLInputElement&&"select"in e}Sn(U0,"isSelectableInput");function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&U0(e)&&t&&e.select()}}Sn(Zs,"focus");var xg=V0();function V0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=bf(e,t),e.unshift(t)},remove(t){var n;e=bf(e,t),(n=e[0])==null||n.resume()}}}Sn(V0,"createFocusScopesStack");function bf(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}Sn(bf,"arrayRemove");function H0(e){return e.filter(t=>t.tagName!=="A")}Sn(H0,"removeLinks");var Ot=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},FC=Object.defineProperty,BC=(e,t)=>FC(e,"name",{value:t,configurable:!0}),UC=$o[" useId ".trim().toString()]||(()=>{}),VC=0;function Ur(e){const[t,n]=u.useState(UC());return Ot(()=>{e||n(s=>s??String(VC++))},[e]),e||(t?`radix-${t}`:"")}BC(Ur,"useId");const HC=["top","right","bottom","left"],Yr=Math.min,ar=Math.max,kc=Math.round,yi=Math.floor,ir=e=>({x:e,y:e}),WC={left:"right",right:"left",bottom:"top",top:"bottom"};function W0(e,t,n){return ar(e,Yr(t,n))}function mr(e,t){return typeof e=="function"?e(t):e}function Qr(e){return e.split("-")[0]}function Ll(e){return e.split("-")[1]}function Jp(e){return e==="x"?"y":"x"}function Zp(e){return e==="y"?"height":"width"}function Vs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function em(e){return Jp(Vs(e))}function qC(e,t,n){n===void 0&&(n=!1);const s=Ll(e),o=em(e),l=Zp(o);let a=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Nc(a)),[a,Nc(a)]}function GC(e){const t=Nc(e);return[_f(e),t,_f(t)]}function _f(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vg=["left","right"],yg=["right","left"],KC=["top","bottom"],YC=["bottom","top"];function QC(e,t,n){switch(e){case"top":case"bottom":return n?t?yg:vg:t?vg:yg;case"left":case"right":return t?KC:YC;default:return[]}}function XC(e,t,n,s){const o=Ll(e);let l=QC(Qr(e),n==="start",s);return o&&(l=l.map(a=>a+"-"+o),t&&(l=l.concat(l.map(_f)))),l}function Nc(e){const t=Qr(e);return WC[t]+e.slice(t.length)}function JC(e){var t,n,s,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(o=e.left)!=null?o:0}}function q0(e){return typeof e!="number"?JC(e):{top:e,right:e,bottom:e,left:e}}function Cc(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function wg(e,t,n){let{reference:s,floating:o}=e;const l=Vs(t),a=em(t),i=Zp(a),c=Qr(t),d=l==="y",f=s.x+s.width/2-o.width/2,m=s.y+s.height/2-o.height/2,p=s[i]/2-o[i]/2;let h;switch(c){case"top":h={x:f,y:s.y-o.height};break;case"bottom":h={x:f,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:m};break;case"left":h={x:s.x-o.width,y:m};break;default:h={x:s.x,y:s.y}}const g=Ll(t);return g&&(h[a]+=p*(g==="end"?1:-1)*(n&&d?-1:1)),h}async function ZC(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:l,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=mr(t,e),g=q0(h),j=i[p?m==="floating"?"reference":"floating":m],v=Cc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),x=m==="floating"?{x:s,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),b=await(l.isElement==null?void 0:l.isElement(y))&&await(l.getScale==null?void 0:l.getScale(y))||{x:1,y:1},S=Cc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:y,strategy:c}):x);return{top:(v.top-S.top+g.top)/b.y,bottom:(S.bottom-v.bottom+g.bottom)/b.y,left:(v.left-S.left+g.left)/b.x,right:(S.right-v.right+g.right)/b.x}}const e2=50,t2=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:ZC},c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:m}=wg(d,s,c),p=s,h=0;const g={};for(let w=0;w<l.length;w++){const j=l[w];if(!j)continue;const{name:v,fn:x}=j,{x:y,y:b,data:S,reset:N}=await x({x:f,y:m,initialPlacement:s,placement:p,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=y??f,m=b??m,g[v]={...g[v],...S},N&&h<e2&&(h++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:f,y:m}=wg(d,p,c)),w=-1)}return{x:f,y:m,placement:p,strategy:o,middlewareData:g}},n2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:l,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=mr(e,t)||{};if(d==null)return{};const m=q0(f),p={x:n,y:s},h=em(o),g=Zp(h),w=await a.getDimensions(d),j=h==="y",v=j?"top":"left",x=j?"bottom":"right",y=j?"clientHeight":"clientWidth",b=l.reference[g]+l.reference[h]-p[h]-l.floating[g],S=p[h]-l.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let k=N?N[y]:0;(!k||!await(a.isElement==null?void 0:a.isElement(N)))&&(k=i.floating[y]||l.floating[g]);const C=b/2-S/2,O=k/2-w[g]/2-1,P=Yr(m[v],O),D=Yr(m[x],O),W=k-w[g]-D,G=k/2-w[g]/2+C,$=W0(P,G,W),K=!c.arrow&&Ll(o)!=null&&G!==$&&l.reference[g]/2-(G<P?P:D)-w[g]/2<0,te=K?G<P?G-P:G-W:0;return{[h]:p[h]+te,data:{[h]:$,centerOffset:G-$-te,...K&&{alignmentOffset:te}},reset:K}}}),s2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:l,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...j}=mr(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const v=Qr(o),x=Vs(i),y=Qr(i)===i,b=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(y||!w?[Nc(i)]:GC(i)),N=g!=="none";!p&&N&&S.push(...XC(i,w,g,b));const k=[i,...S],C=await c.detectOverflow(t,j),O=[];let P=((s=l.flip)==null?void 0:s.overflows)||[];if(f&&O.push(C[v]),m){const $=qC(o,a,b);O.push(C[$[0]],C[$[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every($=>$<=0)){var D,W;const $=(((D=l.flip)==null?void 0:D.index)||0)+1,K=k[$];if(K&&(!(m==="alignment"?x!==Vs(K):!1)||P.every(L=>Vs(L.placement)===x?L.overflows[0]>0:!0)))return{data:{index:$,overflows:P},reset:{placement:K}};let te=(W=P.filter(V=>V.overflows[0]<=0).sort((V,L)=>V.overflows[1]-L.overflows[1])[0])==null?void 0:W.placement;if(!te)switch(h){case"bestFit":{var G;const V=(G=P.filter(L=>{if(N){const Y=Vs(L.placement);return Y===x||Y==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Y=>Y>0).reduce((Y,z)=>Y+z,0)]).sort((L,Y)=>L[1]-Y[1])[0])==null?void 0:G[0];V&&(te=V);break}case"initialPlacement":te=i;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function jg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bg(e){return HC.some(t=>e[t]>=0)}const r2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:o="referenceHidden",...l}=mr(e,t);switch(o){case"referenceHidden":{const a=await s.detectOverflow(t,{...l,elementContext:"reference"}),i=jg(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bg(i)}}}case"escaped":{const a=await s.detectOverflow(t,{...l,altBoundary:!0}),i=jg(a,n.floating);return{data:{escapedOffsets:i,escaped:bg(i)}}}default:return{}}}}},G0=new Set(["left","top"]);async function o2(e,t){const{placement:n,platform:s,elements:o}=e,l=await(s.isRTL==null?void 0:s.isRTL(o.floating)),a=Qr(n),i=Ll(n),c=Vs(n)==="y",d=G0.has(a)?-1:1,f=l&&c?-1:1,m=mr(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof g=="number"&&(h=i==="end"?g*-1:g),c?{x:h*f,y:p*d}:{x:p*d,y:h*f}}const l2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:l,placement:a,middlewareData:i}=t,c=await o2(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(s=i.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:l+c.y,data:{...c,placement:a}}}}},a2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o,platform:l}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...d}=mr(e,t),f={x:n,y:s},m=await l.detectOverflow(t,d),p=Vs(o),h=Jp(p);let g=f[h],w=f[p];const j=(x,y)=>W0(y+m[x==="y"?"top":"left"],y,y-m[x==="y"?"bottom":"right"]);a&&(g=j(h,g)),i&&(w=j(p,w));const v=c.fn({...t,[h]:g,[p]:w});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:a,[p]:i}}}}}},i2=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,s;const{x:o,y:l,placement:a,rects:i,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=mr(e,t),p={x:o,y:l},h=Vs(a),g=Jp(h);let w=p[g],j=p[h];const v=mr(d,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(s=v.crossAxis)!=null?s:0};if(f){const S=g==="y"?"height":"width",N=i.reference[g]-i.floating[S]+x.mainAxis,k=i.reference[g]+i.reference[S]-x.mainAxis;w<N?w=N:w>k&&(w=k)}if(m){var y,b;const S=g==="y"?"width":"height",N=G0.has(Qr(a)),k=i.reference[h]-i.floating[S]+(N&&((y=c.offset)==null?void 0:y[h])||0)+(N?0:x.crossAxis),C=i.reference[h]+i.reference[S]+(N?0:((b=c.offset)==null?void 0:b[h])||0)-(N?x.crossAxis:0);j<k?j=k:j>C&&(j=C)}return{[g]:w,[h]:j}}}},c2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:s,platform:o,elements:l}=t,{apply:a=()=>{},...i}=mr(e,t),c=await o.detectOverflow(t,i),d=Qr(n),f=Ll(n),m=Vs(n)==="y",{width:p,height:h}=s.floating;let g,w;d==="top"||d==="bottom"?(g=d,w=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=d,g=f==="end"?"top":"bottom");const j=h-c.top-c.bottom,v=p-c.left-c.right,x=Yr(h-c[g],j),y=Yr(p-c[w],v),b=t.middlewareData.shift,S=!b;let N=x,k=y;b!=null&&b.enabled.x&&(k=v),b!=null&&b.enabled.y&&(N=j),S&&!f&&(m?k=p-2*ar(c.left,c.right):N=h-2*ar(c.top,c.bottom)),await a({...t,availableWidth:k,availableHeight:N});const C=await o.getDimensions(l.floating);return p!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function eu(){return typeof window<"u"}function zl(e){return K0(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xr(e){var t;return(t=(K0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function K0(e){return eu()?e instanceof Node||e instanceof Bn(e).Node:!1}function Gs(e){return eu()?e instanceof Element||e instanceof Bn(e).Element:!1}function so(e){return eu()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function _g(e){return!eu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}function tu(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&o!=="inline"&&o!=="contents"}function u2(e){return/^(table|td|th)$/.test(zl(e))}function nu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const d2=/transform|translate|scale|rotate|perspective|filter/,f2=/paint|layout|strict|content/,uo=e=>!!e&&e!=="none";let Yu;function tm(e){const t=Gs(e)?Ks(e):e;return uo(t.transform)||uo(t.translate)||uo(t.scale)||uo(t.rotate)||uo(t.perspective)||!nm()&&(uo(t.backdropFilter)||uo(t.filter))||d2.test(t.willChange||"")||f2.test(t.contain||"")}function p2(e){let t=Ro(e);for(;so(t)&&!Ta(t);){if(tm(t))return t;if(nu(t))return null;t=Ro(t)}return null}function nm(){return Yu==null&&(Yu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yu}function Ta(e){return/^(html|body|#document)$/.test(zl(e))}function Ks(e){return Bn(e).getComputedStyle(e)}function su(e){return Gs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ro(e){if(zl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_g(e)&&e.host||xr(e);return _g(t)?t.host:t}function Y0(e){const t=Ro(e);return Ta(t)?(e.ownerDocument||e).body:so(t)&&tu(t)?t:Y0(t)}function Ma(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Y0(e),l=o===((s=e.ownerDocument)==null?void 0:s.body),a=Bn(o);if(l){const i=Sf(a);return t.concat(a,a.visualViewport||[],tu(o)?o:[],i&&n?Ma(i):[])}else return t.concat(o,Ma(o,[],n))}function Sf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q0(e){const t=Ks(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=so(e),l=o?e.offsetWidth:n,a=o?e.offsetHeight:s,i=kc(n)!==l||kc(s)!==a;return i&&(n=l,s=a),{width:n,height:s,$:i}}function sm(e){return Gs(e)?e:e.contextElement}function ml(e){const t=sm(e);if(!so(t))return ir(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:l}=Q0(t);let a=(l?kc(n.width):n.width)/s,i=(l?kc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const m2=ir(0);function X0(e){const t=Bn(e);return!nm()||!t.visualViewport?m2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function h2(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bn(e)}function Po(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=sm(e);let a=ir(1);t&&(s?Gs(s)&&(a=ml(s)):a=ml(e));const i=h2(l,n,s)?X0(l):ir(0);let c=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,f=o.width/a.x,m=o.height/a.y;if(l&&s){const p=Bn(l),h=Gs(s)?Bn(s):s;let g=p,w=Sf(g);for(;w&&h!==g;){const j=ml(w),v=w.getBoundingClientRect(),x=Ks(w),y=v.left+(w.clientLeft+parseFloat(x.paddingLeft))*j.x,b=v.top+(w.clientTop+parseFloat(x.paddingTop))*j.y;c*=j.x,d*=j.y,f*=j.x,m*=j.y,c+=y,d+=b,g=Bn(w),w=Sf(g)}}return Cc({width:f,height:m,x:c,y:d})}function ru(e,t){const n=su(e).scrollLeft;return t?t.left+n:Po(xr(e)).left+n}function J0(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-ru(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function g2(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const l=o==="fixed",a=xr(s),i=t?nu(t.floating):!1;if(s===a||i&&l)return n;let c={scrollLeft:0,scrollTop:0},d=ir(1);const f=ir(0),m=so(s);if((m||!l)&&((zl(s)!=="body"||tu(a))&&(c=su(s)),m)){const h=Po(s);d=ml(s),f.x=h.x+s.clientLeft,f.y=h.y+s.clientTop}const p=a&&!m&&!l?J0(a,c):ir(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+p.x,y:n.y*d.y-c.scrollTop*d.y+f.y+p.y}}function x2(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function v2(e){const t=su(e),n=e.ownerDocument.body,s=ar(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=ar(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-t.scrollLeft+ru(e);const a=-t.scrollTop;return Ks(n).direction==="rtl"&&(l+=ar(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:a}}const y2=25;function w2(e,t,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",o=Bn(e),l=xr(e),a=o.visualViewport;let i=l.clientWidth,c=l.clientHeight,d=0,f=0;if(a){const p=!nm()||t==="fixed";s?p||(d=-a.offsetLeft,f=-a.offsetTop):(i=a.width,c=a.height,p&&(d=a.offsetLeft,f=a.offsetTop))}if(ru(l)<=0){const p=l.ownerDocument,h=p.body,g=getComputedStyle(h),w=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(l.clientWidth-h.clientWidth-w),v=getComputedStyle(l).scrollbarGutter==="stable both-edges"?j/2:j;v<=y2&&(i-=v)}return{width:i,height:c,x:d,y:f}}function j2(e,t){const n=Po(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,l=ml(e),a=e.clientWidth*l.x,i=e.clientHeight*l.y,c=o*l.x,d=s*l.y;return{width:a,height:i,x:c,y:d}}function Sg(e,t,n){let s;if(t==="viewport"||t==="layoutViewport")s=w2(e,n,t);else if(t==="document")s=v2(xr(e));else if(Gs(t))s=j2(t,n);else{const o=X0(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cc(s)}function b2(e,t){const n=t.get(e);if(n)return n;let s=Ma(e,[],!1).filter(i=>Gs(i)&&zl(i)!=="body"),o=null;const l=Ks(e).position==="fixed";let a=l?Ro(e):e;for(;Gs(a)&&!Ta(a);){const i=Ks(a),c=tm(a),d=o?o.position:l?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&i.position==="static")?s=s.filter(m=>m!==a):o=i,a=Ro(a)}return t.set(e,s),s}function _2(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const a=[...n==="clippingAncestors"?nu(t)?[]:b2(t,this._c):[].concat(n),s],i=Sg(t,a[0],o);let c=i.top,d=i.right,f=i.bottom,m=i.left;for(let p=1;p<a.length;p++){const h=Sg(t,a[p],o);c=ar(h.top,c),d=Yr(h.right,d),f=Yr(h.bottom,f),m=ar(h.left,m)}return{width:d-m,height:f-c,x:m,y:c}}function S2(e){const{width:t,height:n}=Q0(e);return{width:t,height:n}}function k2(e,t,n){const s=so(t),o=xr(t),l=n==="fixed",a=Po(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const c=ir(0);if((s||!l)&&((zl(t)!=="body"||tu(o))&&(i=su(t)),s)){const p=Po(t,!0,l,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}!s&&o&&(c.x=ru(o));const d=o&&!s&&!l?J0(o,i):ir(0),f=a.left+i.scrollLeft-c.x-d.x,m=a.top+i.scrollTop-c.y-d.y;return{x:f,y:m,width:a.width,height:a.height}}function Qu(e){return Ks(e).position==="static"}function kg(e,t){if(!so(e)||Ks(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xr(e)===n&&(n=n.ownerDocument.body),n}function Z0(e,t){const n=Bn(e);if(nu(e))return n;if(!so(e)){let o=Ro(e);for(;o&&!Ta(o);){if(Gs(o)&&!Qu(o))return o;o=Ro(o)}return n}let s=kg(e,t);for(;s&&u2(s)&&Qu(s);)s=kg(s,t);return s&&Ta(s)&&Qu(s)&&!tm(s)?n:s||p2(e)||n}const N2=async function(e){const t=this.getOffsetParent||Z0,n=this.getDimensions,s=await n(e.floating);return{reference:k2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function C2(e){return Ks(e).direction==="rtl"}const E2={convertOffsetParentRelativeRectToViewportRelativeRect:g2,getDocumentElement:xr,getClippingRect:_2,getOffsetParent:Z0,getElementRects:N2,getClientRects:x2,getDimensions:S2,getScale:ml,isElement:Gs,isRTL:C2};function ew(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function R2(e,t,n){let s=null,o;const l=xr(e);function a(){var f;clearTimeout(o),(f=s)==null||f.disconnect(),s=null}function i(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),a();const p=e.getBoundingClientRect(),{left:h,top:g,width:w,height:j}=p;if(f||t(),!w||!j)return;const v=yi(g),x=yi(l.clientWidth-(h+w)),y=yi(l.clientHeight-(g+j)),b=yi(h),N={rootMargin:-v+"px "+-x+"px "+-y+"px "+-b+"px",threshold:ar(0,Yr(1,m))||1};let k=!0;function C(O){const P=O[0].intersectionRatio;if(!ew(p,e.getBoundingClientRect()))return i();if(P!==m){if(!k)return i();P?i(!1,P):o=setTimeout(()=>{i(!1,1e-7)},1e3)}k=!1}try{s=new IntersectionObserver(C,{...N,root:l.ownerDocument})}catch{s=new IntersectionObserver(C,N)}s.observe(e)}const c=Bn(e),d=()=>i(n);return c.addEventListener("resize",d),i(!0),()=>{c.removeEventListener("resize",d),a()}}function P2(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=sm(e),f=o||l?[...d?Ma(d):[],...t?Ma(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),l&&v.addEventListener("resize",n)});const m=d&&i?R2(d,n,l):null;let p=-1,h=null;a&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),d&&!c&&h.observe(d),t&&h.observe(t));let g,w=c?Po(e):null;c&&j();function j(){const v=Po(e);w&&!ew(w,v)&&n(),w=v,g=requestAnimationFrame(j)}return n(),()=>{var v;f.forEach(x=>{o&&x.removeEventListener("scroll",n),l&&x.removeEventListener("resize",n)}),m==null||m(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const T2=l2,M2=a2,$2=s2,I2=c2,A2=r2,Ng=n2,O2=i2,L2=(e,t,n)=>{const s=new Map,o=n??{},l={...E2,...o.platform,_c:s};return t2(e,t,{...o,platform:l})};var z2=typeof document<"u",D2=function(){},Ki=z2?u.useLayoutEffect:D2;function Ec(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Ec(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const l=o[s];if(!(l==="_owner"&&e.$$typeof)&&!Ec(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function tw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cg(e,t){const n=tw(e);return Math.round(t*n)/n}function Xu(e){const t=u.useRef(e);return Ki(()=>{t.current=e}),t}function F2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:l,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(s);Ec(p,s)||h(s);const[g,w]=u.useState(null),[j,v]=u.useState(null),x=u.useCallback(L=>{L!==N.current&&(N.current=L,w(L))},[]),y=u.useCallback(L=>{L!==k.current&&(k.current=L,v(L))},[]),b=l||g,S=a||j,N=u.useRef(null),k=u.useRef(null),C=u.useRef(f),O=c!=null,P=Xu(c),D=Xu(o),W=Xu(d),G=u.useCallback(()=>{if(!N.current||!k.current)return;const L={placement:t,strategy:n,middleware:p};D.current&&(L.platform=D.current),L2(N.current,k.current,L).then(Y=>{const z={...Y,isPositioned:W.current!==!1};$.current&&!Ec(C.current,z)&&(C.current=z,Oo.flushSync(()=>{m(z)}))})},[p,t,n,D,W]);Ki(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[d]);const $=u.useRef(!1);Ki(()=>($.current=!0,()=>{$.current=!1}),[]),Ki(()=>{if(b&&(N.current=b),S&&(k.current=S),b&&S){if(P.current)return P.current(b,S,G);G()}},[b,S,G,P,O]);const K=u.useMemo(()=>({reference:N,floating:k,setReference:x,setFloating:y}),[x,y]),te=u.useMemo(()=>({reference:b,floating:S}),[b,S]),V=u.useMemo(()=>{const L={position:n,left:0,top:0};if(!te.floating)return L;const Y=Cg(te.floating,f.x),z=Cg(te.floating,f.y);return i?{...L,transform:"translate("+Y+"px, "+z+"px)",...tw(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:z}},[n,i,te.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:G,refs:K,elements:te,floatingStyles:V}),[f,G,K,te,V])}const B2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Ng({element:s.current,padding:o}).fn(n):{}:s?Ng({element:s,padding:o}).fn(n):{}}}},U2=(e,t)=>{const n=T2(e);return{name:n.name,fn:n.fn,options:[e,t]}},V2=(e,t)=>{const n=M2(e);return{name:n.name,fn:n.fn,options:[e,t]}},H2=(e,t)=>({fn:O2(e).fn,options:[e,t]}),W2=(e,t)=>{const n=$2(e);return{name:n.name,fn:n.fn,options:[e,t]}},q2=(e,t)=>{const n=I2(e);return{name:n.name,fn:n.fn,options:[e,t]}},G2=(e,t)=>{const n=A2(e);return{name:n.name,fn:n.fn,options:[e,t]}},K2=(e,t)=>{const n=B2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Y2=Object.defineProperty,Q2=(e,t)=>Y2(e,"name",{value:t,configurable:!0});function nw(e){const[t,n]=u.useState(void 0);return Ot(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,i;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}Q2(nw,"useSize");var X2=Object.defineProperty,Vr=(e,t)=>X2(e,"name",{value:t,configurable:!0}),sw="Popper",[rw,ow]=no(sw),[J2,lw]=rw(sw),Z2=Vr(e=>{const{__scopePopper:t,children:n}=e,[s,o]=u.useState(null),[l,a]=u.useState(void 0);return r.jsx(J2,{scope:t,anchor:s,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})},"Popper"),eE="PopperAnchor",tE=u.forwardRef(Vr(function(t,n){const{__scopePopper:s,virtualRef:o,...l}=t,a=lw(eE,s),i=u.useRef(null),c=a.onAnchorChange,d=u.useCallback(w=>{i.current=w,w&&c(w)},[c]),f=vt(n,d),m=u.useRef(null);u.useEffect(()=>{if(!o)return;const w=m.current;m.current=o.current,w!==m.current&&c(m.current)});const p=a.placementState&&ou(a.placementState),h=p==null?void 0:p[0],g=p==null?void 0:p[1];return o?null:r.jsx(ot.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...l,ref:f})},"PopperAnchor")),aw="PopperContent",[nE,i$]=rw(aw),sE=u.forwardRef(Vr(function(t,n){var ce,_e,pe,E,B,A,ie;const{__scopePopper:s,side:o="bottom",sideOffset:l=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:w,...j}=t,v=lw(aw,s),[x,y]=u.useState(null),b=vt(n,y),[S,N]=u.useState(null),k=nw(S),C=(k==null?void 0:k.width)??0,O=(k==null?void 0:k.height)??0,P=o+(a!=="center"?"-"+a:""),D=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},W=Array.isArray(f)?f:[f],G=W.length>0,$={padding:D,boundary:W.filter(iw),altBoundary:G},{refs:K,floatingStyles:te,placement:V,isPositioned:L,middlewareData:Y}=F2({strategy:"fixed",placement:P,whileElementsMounted:Vr((...oe)=>P2(...oe,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[U2({mainAxis:l+O,alignmentAxis:i}),d&&V2({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?H2():void 0,...$}),d&&W2({...$}),q2({...$,apply:Vr(({elements:oe,rects:Oe,availableWidth:Ye,availableHeight:dt})=>{const{width:st,height:Lt}=Oe.reference,gt=oe.floating.style;gt.setProperty("--radix-popper-available-width",`${Ye}px`),gt.setProperty("--radix-popper-available-height",`${dt}px`),gt.setProperty("--radix-popper-anchor-width",`${st}px`),gt.setProperty("--radix-popper-anchor-height",`${Lt}px`)},"apply")}),S&&K2({element:S,padding:c}),rE({arrowWidth:C,arrowHeight:O}),h&&G2({strategy:"referenceHidden",...$,boundary:G?$.boundary:void 0})]}),z=v.setPlacementState;Ot(()=>(z(V),()=>{z(void 0)}),[V,z]);const[we,X]=ou(V),Re=Rs(w);Ot(()=>{L&&(Re==null||Re())},[L,Re]);const Pe=(ce=Y.arrow)==null?void 0:ce.x,ke=(_e=Y.arrow)==null?void 0:_e.y,Z=((pe=Y.arrow)==null?void 0:pe.centerOffset)!==0,[ge,ae]=u.useState();return Ot(()=>{x&&ae(window.getComputedStyle(x).zIndex)},[x]),r.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:L?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(E=Y.transformOrigin)==null?void 0:E.x,(B=Y.transformOrigin)==null?void 0:B.y].join(" "),...((A=Y.hide)==null?void 0:A.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(nE,{scope:s,placedSide:we,placedAlign:X,onArrowChange:N,arrowX:Pe,arrowY:ke,shouldHideArrow:Z,children:r.jsx(ot.div,{"data-side":we,"data-align":X,...j,ref:b,style:{...j.style,animation:L?(ie=j.style)==null?void 0:ie.animation:"none"}})})})},"PopperContent"));function iw(e){return e!==null}Vr(iw,"isNotNull");var rE=Vr(e=>({name:"transformOrigin",options:e,fn(t){var j,v,x;const{placement:n,rects:s,middlewareData:o}=t,a=((j=o.arrow)==null?void 0:j.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=ou(n),m={start:"0%",center:"50%",end:"100%"}[f],p=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let g="",w="";return d==="bottom"?(g=a?m:`${p}px`,w=`${-c}px`):d==="top"?(g=a?m:`${p}px`,w=`${s.floating.height+c}px`):d==="right"?(g=`${-c}px`,w=a?m:`${h}px`):d==="left"&&(g=`${s.floating.width+c}px`,w=a?m:`${h}px`),{data:{x:g,y:w}}}}),"transformOrigin");function ou(e){const[t,n="center"]=e.split("-");return[t,n]}Vr(ou,"getSideAndAlignFromPlacement");var oE=Z2,lE=tE,aE=sE,iE=Object.defineProperty,cE=(e,t)=>iE(e,"name",{value:t,configurable:!0}),cw=u.forwardRef(cE(function(t,n){var c;const{container:s,...o}=t,[l,a]=u.useState(!1);Ot(()=>a(!0),[]);const i=s||l&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Oo.createPortal(r.jsx(ot.div,{...o,ref:n}),i):null},"Portal")),uE=Object.defineProperty,hr=(e,t)=>uE(e,"name",{value:t,configurable:!0});function uw(e,t){return u.useReducer((n,s)=>t[n][s]??n,e)}hr(uw,"useStateMachine");var Ha=hr(e=>{const{present:t,children:n}=e,s=dw(t),o=typeof n=="function"?n({present:s.isPresent}):u.Children.only(n),l=fw(s.ref,pw(o));return typeof n=="function"||s.isPresent?u.cloneElement(o,{ref:l}):null},"Presence");function dw(e){const[t,n]=u.useState(),s=u.useRef(null),o=u.useRef(e),l=u.useRef("none"),a=u.useRef(void 0),i=e?"mounted":"unmounted",[c,d]=uw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{c==="mounted"?(l.current=a.current??Go(s.current),a.current=void 0):l.current="none"},[c]),Ot(()=>{const f=s.current,m=o.current;if(m!==e){const h=l.current,g=Go(f);e?(a.current=g,d("MOUNT")):g==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(m&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Ot(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=hr(g=>{const j=Go(s.current).includes(CSS.escape(g.animationName));if(g.target===t&&j&&(d("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},"handleAnimationEnd"),h=hr(g=>{g.target===t&&(l.current=Go(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u.useCallback(f=>{if(f){const m=getComputedStyle(f);s.current=m,a.current=Go(m)}else s.current=null;n(f)},[])}}hr(dw,"usePresence");function kf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}hr(kf,"setRef");function fw(...e){const t=u.useRef(e);return t.current=e,u.useCallback(n=>{const s=t.current;let o=!1;const l=s.map(a=>{const i=kf(a,n);return!o&&typeof i=="function"&&(o=!0),i});if(o)return()=>{for(let a=0;a<l.length;a++){const i=l[a];typeof i=="function"?i():kf(s[a],null)}}},[])}hr(fw,"useStableComposedRefs");function Go(e){return(e==null?void 0:e.animationName)||"none"}hr(Go,"getAnimationName");function pw(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}hr(pw,"getElementRef");var dE=Object.defineProperty,fE=(e,t)=>dE(e,"name",{value:t,configurable:!0}),Eg=$o[" useEffectEvent ".trim().toString()],Rg=$o[" useInsertionEffect ".trim().toString()];function mw(e){if(typeof Eg=="function")return Eg(e);const t=u.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Rg=="function"?Rg(()=>{t.current=e}):Ot(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}fE(mw,"useEffectEvent");var pE=Object.defineProperty,Wa=(e,t)=>pE(e,"name",{value:t,configurable:!0}),mE=$o[" useInsertionEffect ".trim().toString()]||Ot;function El({prop:e,defaultProp:t,onChange:n=Wa(()=>{},"onChange"),caller:s}){const[o,l,a]=hw({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o,d=u.useCallback(f=>{var m;if(i){const p=gw(f)?f(e):f;p!==e&&((m=a.current)==null||m.call(a,p))}else l(f)},[i,e,l,a]);return[c,d]}Wa(El,"useControllableState");function hw({defaultProp:e,onChange:t}){const[n,s]=u.useState(e),o=u.useRef(n),l=u.useRef(t);return mE(()=>{l.current=t},[t]),u.useEffect(()=>{var a;o.current!==n&&((a=l.current)==null||a.call(l,n),o.current=n)},[n,o]),[n,s,l]}Wa(hw,"useUncontrolledState");function gw(e){return typeof e=="function"}Wa(gw,"isFunction");var Pg=Symbol("RADIX:SYNC_STATE");function hE(e,t,n,s){const{prop:o,defaultProp:l,onChange:a,caller:i}=t,c=o!==void 0,d=mw(a),f=[{...n,state:l}];s&&f.push(s);const[m,p]=u.useReducer((j,v)=>{if(v.type===Pg)return{...j,state:v.state};const x=e(j,v);return c&&!Object.is(x.state,j.state)&&d(x.state),x},...f),h=m.state,g=u.useRef(h);u.useEffect(()=>{g.current!==h&&(g.current=h,c||d(h))},[h,g,c]);const w=u.useMemo(()=>o!==void 0?{...m,state:o}:m,[m,o]);return u.useEffect(()=>{c&&!Object.is(o,m.state)&&p({type:Pg,state:o})},[o,m.state,c]),[w,p]}Wa(hE,"useControllableStateReducer");var gE=Object.defineProperty,xE=(e,t)=>gE(e,"name",{value:t,configurable:!0});function xw(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}xE(xw,"usePrevious");var vE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),yE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vo=new WeakMap,wi=new WeakMap,ji={},Ju=0,vw=function(e){return e&&(e.host||vw(e.parentNode))},wE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=vw(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jE=function(e,t,n,s){var o=wE(t,Array.isArray(e)?e:[e]);ji[n]||(ji[n]=new WeakMap);var l=ji[n],a=[],i=new Set,c=new Set(o),d=function(m){!m||i.has(m)||(i.add(m),d(m.parentNode))};o.forEach(d);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(s),g=h!==null&&h!=="false",w=(Vo.get(p)||0)+1,j=(l.get(p)||0)+1;Vo.set(p,w),l.set(p,j),a.push(p),w===1&&g&&wi.set(p,!0),j===1&&p.setAttribute(n,"true"),g||p.setAttribute(s,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),Ju++,function(){a.forEach(function(m){var p=Vo.get(m)-1,h=l.get(m)-1;Vo.set(m,p),l.set(m,h),p||(wi.has(m)||m.removeAttribute(s),wi.delete(m)),h||m.removeAttribute(n)}),Ju--,Ju||(Vo=new WeakMap,Vo=new WeakMap,wi=new WeakMap,ji={})}},yw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=yE(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),jE(s,o,n,"aria-hidden")):function(){return null}},Us=function(){return Us=Object.assign||function(t){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Us.apply(this,arguments)};function ww(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(n[s[o]]=e[s[o]]);return n}function bE(e,t,n){if(n||arguments.length===2)for(var s=0,o=t.length,l;s<o;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var Yi="right-scroll-bar-position",Qi="width-before-scroll-bar",_E="with-scroll-bars-hidden",SE="--removed-body-scroll-bar-size";function Zu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function kE(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=t,n.facade}var NE=typeof window<"u"?u.useLayoutEffect:u.useEffect,Tg=new WeakMap;function CE(e,t){var n=kE(null,function(s){return e.forEach(function(o){return Zu(o,s)})});return NE(function(){var s=Tg.get(n);if(s){var o=new Set(s),l=new Set(e),a=n.current;o.forEach(function(i){l.has(i)||Zu(i,null)}),l.forEach(function(i){o.has(i)||Zu(i,a)})}Tg.set(n,e)},[e]),n}function EE(e){return e}function RE(e,t){t===void 0&&(t=EE);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var a=t(l,s);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(l){for(s=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(i){return l(i)},filter:function(){return n}}},assignMedium:function(l){s=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(l),a=n}var c=function(){var f=a;a=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return o}function PE(e){e===void 0&&(e={});var t=RE(null);return t.options=Us({async:!0,ssr:!1},e),t}var jw=function(e){var t=e.sideCar,n=ww(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return u.createElement(s,Us({},n))};jw.isSideCarExport=!0;function TE(e,t){return e.useMedium(t),jw}var bw=PE(),ed=function(){},lu=u.forwardRef(function(e,t){var n=u.useRef(null),s=u.useState({onScrollCapture:ed,onWheelCapture:ed,onTouchMoveCapture:ed}),o=s[0],l=s[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,w=e.inert,j=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,y=e.gapMode,b=ww(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,N=CE([n,t]),k=Us(Us({},b),o);return u.createElement(u.Fragment,null,f&&u.createElement(S,{sideCar:bw,removeScrollBar:d,shards:m,noRelative:h,noIsolation:g,inert:w,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:y}),a?u.cloneElement(u.Children.only(i),Us(Us({},k),{ref:N})):u.createElement(x,Us({},k,{className:c,ref:N}),i))});lu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lu.classNames={fullWidth:Qi,zeroRight:Yi};var ME=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $E(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ME();return t&&e.setAttribute("nonce",t),e}function IE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var OE=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$E())&&(IE(t,n),AE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LE=function(){var e=OE();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_w=function(){var e=LE(),t=function(n){var s=n.styles,o=n.dynamic;return e(s,o),null};return t},zE={left:0,top:0,right:0,gap:0},td=function(e){return parseInt(e||"",10)||0},DE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[td(n),td(s),td(o)]},FE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zE;var t=DE(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},BE=_w(),hl="data-scroll-locked",UE=function(e,t,n,s){var o=e.left,l=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
402
- .`.concat(_E,` {
403
- overflow: hidden `).concat(s,`;
404
- padding-right: `).concat(i,"px ").concat(s,`;
405
- }
406
- body[`).concat(hl,`] {
407
- overflow: hidden `).concat(s,`;
408
- overscroll-behavior: contain;
409
- `).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
410
- padding-left: `.concat(o,`px;
411
- padding-top: `).concat(l,`px;
412
- padding-right: `).concat(a,`px;
413
- margin-left:0;
414
- margin-top:0;
415
- margin-right: `).concat(i,"px ").concat(s,`;
416
- `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(s,";")].filter(Boolean).join(""),`
417
- }
418
-
419
- .`).concat(Yi,` {
420
- right: `).concat(i,"px ").concat(s,`;
421
- }
422
-
423
- .`).concat(Qi,` {
424
- margin-right: `).concat(i,"px ").concat(s,`;
425
- }
426
-
427
- .`).concat(Yi," .").concat(Yi,` {
428
- right: 0 `).concat(s,`;
429
- }
430
-
431
- .`).concat(Qi," .").concat(Qi,` {
432
- margin-right: 0 `).concat(s,`;
433
- }
434
-
435
- body[`).concat(hl,`] {
436
- `).concat(SE,": ").concat(i,`px;
437
- }
438
- `)},Mg=function(){var e=parseInt(document.body.getAttribute(hl)||"0",10);return isFinite(e)?e:0},VE=function(){u.useEffect(function(){return document.body.setAttribute(hl,(Mg()+1).toString()),function(){var e=Mg()-1;e<=0?document.body.removeAttribute(hl):document.body.setAttribute(hl,e.toString())}},[])},HE=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;VE();var l=u.useMemo(function(){return FE(o)},[o]);return u.createElement(BE,{styles:UE(l,!t,o,n?"":"!important")})},Nf=!1;if(typeof window<"u")try{var bi=Object.defineProperty({},"passive",{get:function(){return Nf=!0,!0}});window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{Nf=!1}var Ho=Nf?{passive:!1}:!1,WE=function(e){return e.tagName==="TEXTAREA"},Sw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!WE(e)&&n[t]==="visible")},qE=function(e){return Sw(e,"overflowY")},GE=function(e){return Sw(e,"overflowX")},$g=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=kw(e,s);if(o){var l=Nw(e,s),a=l[1],i=l[2];if(a>i)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},KE=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},YE=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},kw=function(e,t){return e==="v"?qE(t):GE(t)},Nw=function(e,t){return e==="v"?KE(t):YE(t)},QE=function(e,t){return e==="h"&&t==="rtl"?-1:1},XE=function(e,t,n,s,o){var l=QE(e,window.getComputedStyle(t).direction),a=l*s,i=n.target,c=t.contains(i),d=!1,f=a>0,m=0,p=0;do{if(!i)break;var h=Nw(e,i),g=h[0],w=h[1],j=h[2],v=w-j-l*g;(g||v)&&kw(e,i)&&(m+=v,p+=g);var x=i.parentNode;i=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(d=!0),d},_i=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ig=function(e){return[e.deltaX,e.deltaY]},Ag=function(e){return e&&"current"in e?e.current:e},JE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZE=function(e){return`
439
- .block-interactivity-`.concat(e,` {pointer-events: none;}
440
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
441
- `)},eR=0,Wo=[];function tR(e){var t=u.useRef([]),n=u.useRef([0,0]),s=u.useRef(),o=u.useState(eR++)[0],l=u.useState(_w)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=bE([e.lockRef.current],(e.shards||[]).map(Ag),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var v=_i(w),x=n.current,y="deltaX"in w?w.deltaX:x[0]-v[0],b="deltaY"in w?w.deltaY:x[1]-v[1],S,N=w.target,k=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in w&&k==="h"&&N.type==="range")return!1;var C=window.getSelection(),O=C&&C.anchorNode,P=O?O===N||O.contains(N):!1;if(P)return!1;var D=$g(k,N);if(!D)return!0;if(D?S=k:(S=k==="v"?"h":"v",D=$g(k,N)),!D)return!1;if(!s.current&&"changedTouches"in w&&(y||b)&&(s.current=S),!S)return!0;var W=s.current||S;return XE(W,j,w,W==="h"?y:b)},[]),c=u.useCallback(function(w){var j=w;if(!(!Wo.length||Wo[Wo.length-1]!==l)){var v="deltaY"in j?Ig(j):_i(j),x=t.current.filter(function(S){return S.name===j.type&&(S.target===j.target||j.target===S.shadowParent)&&JE(S.delta,v)})[0];if(x&&x.should){j.cancelable&&j.preventDefault();return}if(!x){var y=(a.current.shards||[]).map(Ag).filter(Boolean).filter(function(S){return S.contains(j.target)}),b=y.length>0?i(j,y[0]):!a.current.noIsolation;b&&j.cancelable&&j.preventDefault()}}},[]),d=u.useCallback(function(w,j,v,x){var y={name:w,delta:j,target:v,should:x,shadowParent:nR(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),f=u.useCallback(function(w){n.current=_i(w),s.current=void 0},[]),m=u.useCallback(function(w){d(w.type,Ig(w),w.target,i(w,e.lockRef.current))},[]),p=u.useCallback(function(w){d(w.type,_i(w),w.target,i(w,e.lockRef.current))},[]);u.useEffect(function(){return Wo.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Ho),document.addEventListener("touchmove",c,Ho),document.addEventListener("touchstart",f,Ho),function(){Wo=Wo.filter(function(w){return w!==l}),document.removeEventListener("wheel",c,Ho),document.removeEventListener("touchmove",c,Ho),document.removeEventListener("touchstart",f,Ho)}},[]);var h=e.removeScrollBar,g=e.inert;return u.createElement(u.Fragment,null,g?u.createElement(l,{styles:ZE(o)}):null,h?u.createElement(HE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sR=TE(bw,tR);var rm=u.forwardRef(function(e,t){return u.createElement(lu,Us({},e,{ref:t,sideCar:sR}))});rm.classNames=lu.classNames;var rR=Object.defineProperty,Ge=(e,t)=>rR(e,"name",{value:t,configurable:!0}),oR=[" ","Enter","ArrowUp","ArrowDown"],lR=[" ","Enter"],Rl="Select",[au,iu,aR]=Gp(Rl),[zo,c$]=no(Rl,[aR,ow]),om=ow(),[iR,ro]=zo(Rl),[cR,uR]=zo(Rl);function Cw(e){const{__scopeSelect:t,children:n,open:s,defaultOpen:o,onOpenChange:l,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:m,disabled:p,required:h,form:g,internal_do_not_use_render:w}=e,j=om(t),[v,x]=u.useState(null),[y,b]=u.useState(null),[S,N]=u.useState(!1),k=Jc(d),[C,O]=El({prop:s,defaultProp:o??!1,onChange:l,caller:Rl}),[P,D]=El({prop:a,defaultProp:i,onChange:c,caller:Rl}),W=u.useRef(null),G=u.useRef(P);u.useEffect(()=>{const X=g?v==null?void 0:v.ownerDocument.getElementById(g):v==null?void 0:v.form;if(X instanceof HTMLFormElement){const Re=Ge(()=>D(G.current),"reset");return X.addEventListener("reset",Re),()=>X.removeEventListener("reset",Re)}},[g,v,D]);const $=v?!!g||!!v.closest("form"):!0,[K,te]=u.useState(new Set),V=Ur(),L=Array.from(K).map(X=>X.props.value).join(";"),Y=u.useCallback(X=>{te(Re=>new Set(Re).add(X))},[]),z=u.useCallback(X=>{te(Re=>{const Pe=new Set(Re);return Pe.delete(X),Pe})},[]),we={required:h,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:V,value:P,onValueChange:D,open:C,onOpenChange:O,dir:k,triggerPointerDownPosRef:W,disabled:p,name:f,autoComplete:m,form:g,nativeOptions:K,nativeSelectKey:L,isFormControl:$};return r.jsx(oE,{...j,children:r.jsx(iR,{scope:t,...we,children:r.jsx(au.Provider,{scope:t,children:r.jsx(cR,{scope:t,onNativeOptionAdd:Y,onNativeOptionRemove:z,children:Tw(w)?w(we):n})})})})}Ge(Cw,"SelectProvider");var dR=Ge(e=>{const{__scopeSelect:t,children:n,...s}=e;return r.jsx(Cw,{__scopeSelect:t,...s,internal_do_not_use_render:({isFormControl:o})=>r.jsxs(r.Fragment,{children:[n,o?r.jsx(BR,{__scopeSelect:t}):null]})})},"Select"),fR="SelectTrigger",pR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,disabled:o=!1,...l}=t,a=om(s),i=ro(fR,s),c=i.disabled||o,d=vt(n,i.onTriggerChange),f=iu(s),m=u.useRef("touch"),[p,h,g]=am(j=>{const v=f().filter(b=>!b.disabled),x=v.find(b=>b.value===i.value),y=im(v,j,x);y!==void 0&&i.onValueChange(y.value)}),w=Ge(j=>{c||(i.onOpenChange(!0),g()),j&&(i.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return r.jsx(lE,{asChild:!0,...a,children:r.jsx(ot.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qa(i.value)?"":void 0,...l,ref:d,onClick:Ke(l.onClick,j=>{j.currentTarget.focus(),m.current!=="mouse"&&w(j)}),onPointerDown:Ke(l.onPointerDown,j=>{m.current=j.pointerType;const v=j.target;v.hasPointerCapture(j.pointerId)&&v.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(w(j),j.preventDefault())}),onKeyDown:Ke(l.onKeyDown,j=>{const v=p.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&h(j.key),!(v&&j.key===" ")&&oR.includes(j.key)&&(w(),j.preventDefault())})})})},"SelectTrigger")),mR="SelectValue",hR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,className:o,style:l,children:a,placeholder:i="",...c}=t,d=ro(mR,s),{onValueNodeHasChildrenChange:f}=d,m=a!==void 0,p=vt(n,d.onValueNodeChange);Ot(()=>{f(m)},[f,m]);const h=qa(d.value);return r.jsx(ot.span,{...c,asChild:h?!1:c.asChild,ref:p,style:{pointerEvents:"none"},children:r.jsx(u.Fragment,{children:h?i:a},h?"placeholder":"value")})},"SelectValue")),gR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,children:o,...l}=t;return r.jsx(ot.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})},"SelectIcon")),xR="SelectPortal",[vR,yR]=zo(xR,{forceMount:void 0}),wR=Ge(e=>{const{__scopeSelect:t,forceMount:n,...s}=e;return r.jsx(vR,{scope:e.__scopeSelect,forceMount:n,children:r.jsx(cw,{asChild:!0,...s})})},"SelectPortal"),To="SelectContent",jR=u.forwardRef(Ge(function(t,n){const s=yR(To,t.__scopeSelect),{forceMount:o=s.forceMount,...l}=t,a=ro(To,t.__scopeSelect),[i,c]=u.useState();return Ot(()=>{c(new DocumentFragment)},[]),r.jsx(Ha,{present:o||a.open,children:({present:d})=>d?r.jsx(SR,{...l,ref:n}):r.jsx(bR,{...l,fragment:i})})},"SelectContent")),bR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,children:o,fragment:l}=t;return l?Oo.createPortal(r.jsx(Ew,{scope:s,children:r.jsx(au.Slot,{scope:s,children:r.jsx("div",{ref:n,children:o})})}),l):null},"SelectContentFragment")),bs=10,[Ew,Do]=zo(To),_R=pr("SelectContent.RemoveScroll"),SR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s}=t,{position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:w,hideWhenDetached:j,avoidCollisions:v,...x}=t,y=ro(To,s),[b,S]=u.useState(null),[N,k]=u.useState(null),C=vt(n,S),[O,P]=u.useState(null),[D,W]=u.useState(null),G=iu(s),[$,K]=u.useState(!1),te=u.useRef(!1);u.useEffect(()=>{if(b)return yw(b)},[b]),Zc();const V=u.useCallback(ae=>{const[ce,..._e]=G().map(B=>B.ref.current),[pe]=_e.slice(-1),E=document.activeElement;for(const B of ae)if(B===E||(B==null||B.scrollIntoView({block:"nearest"}),B===ce&&N&&(N.scrollTop=0),B===pe&&N&&(N.scrollTop=N.scrollHeight),B==null||B.focus(),document.activeElement!==E))return},[G,N]),L=u.useCallback(()=>V([O,b]),[V,O,b]);u.useEffect(()=>{$&&L()},[$,L]);const{onOpenChange:Y,triggerPointerDownPosRef:z}=y;u.useEffect(()=>{if(b){let ae={x:0,y:0};const ce=Ge(pe=>{var E,B;ae={x:Math.abs(Math.round(pe.pageX)-(((E=z.current)==null?void 0:E.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((B=z.current)==null?void 0:B.y)??0))}},"handlePointerMove"),_e=Ge(pe=>{ae.x<=10&&ae.y<=10?pe.preventDefault():pe.composedPath().includes(b)||Y(!1),document.removeEventListener("pointermove",ce),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",_e,{capture:!0})}}},[b,Y,z]),u.useEffect(()=>{const ae=Ge(()=>Y(!1),"close");return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[Y]);const[we,X]=am(ae=>{const ce=G().filter(E=>!E.disabled),_e=ce.find(E=>E.ref.current===document.activeElement),pe=im(ce,ae,_e);pe&&setTimeout(()=>{var E;return(E=pe.ref.current)==null?void 0:E.focus()})}),Re=u.useCallback((ae,ce,_e)=>{const pe=!te.current&&!_e;(y.value!==void 0&&y.value===ce||pe)&&(P(ae),pe&&(te.current=!0))},[y.value]),Pe=u.useCallback(()=>b==null?void 0:b.focus(),[b]),ke=u.useCallback((ae,ce,_e)=>{const pe=!te.current&&!_e;(y.value!==void 0&&y.value===ce||pe)&&W(ae)},[y.value]),Z=o==="popper"?Og:kR,ge=Z===Og?{side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:w,hideWhenDetached:j,avoidCollisions:v}:{};return r.jsx(Ew,{scope:s,content:b,viewport:N,onViewportChange:k,itemRefCallback:Re,selectedItem:O,onItemLeave:Pe,itemTextRefCallback:ke,focusSelectedItem:L,selectedItemText:D,position:o,isPositioned:$,searchRef:we,children:r.jsx(rm,{as:_R,allowPinchZoom:!0,children:r.jsx(z0,{asChild:!0,trapped:y.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ke(l,ae=>{var ce;(ce=y.trigger)==null||ce.focus({preventScroll:!0}),ae.preventDefault()}),children:r.jsx(I0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:r.jsx(Z,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:ae=>ae.preventDefault(),...x,...ge,onPlaced:()=>K(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ke(x.onKeyDown,ae=>{const ce=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ce&&ae.key.length===1&&X(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let pe=G().filter(E=>!E.disabled).map(E=>E.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const E=ae.target,B=pe.indexOf(E);pe=pe.slice(B+1)}setTimeout(()=>V(pe)),ae.preventDefault()}})})})})})})},"SelectContentImpl")),kR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,onPlaced:o,...l}=t,a=ro(To,s),i=Do(To,s),[c,d]=u.useState(null),[f,m]=u.useState(null),p=vt(n,m),h=iu(s),g=u.useRef(!1),w=u.useRef(!0),{viewport:j,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=i,b=u.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&f&&j&&v&&x){const C=a.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),P=a.valueNode.getBoundingClientRect(),D=x.getBoundingClientRect();if(a.dir!=="rtl"){const E=D.left-O.left,B=P.left-E,A=C.left-B,ie=C.width+A,oe=Math.max(ie,O.width),Oe=window.innerWidth-bs,Ye=hf(B,[bs,Math.max(bs,Oe-oe)]);c.style.minWidth=ie+"px",c.style.left=Ye+"px"}else{const E=O.right-D.right,B=window.innerWidth-P.right-E,A=window.innerWidth-C.right-B,ie=C.width+A,oe=Math.max(ie,O.width),Oe=window.innerWidth-bs,Ye=hf(B,[bs,Math.max(bs,Oe-oe)]);c.style.minWidth=ie+"px",c.style.right=Ye+"px"}const W=h(),G=window.innerHeight-bs*2,$=j.scrollHeight,K=window.getComputedStyle(f),te=parseInt(K.borderTopWidth,10),V=parseInt(K.paddingTop,10),L=parseInt(K.borderBottomWidth,10),Y=parseInt(K.paddingBottom,10),z=te+V+$+Y+L,we=Math.min(v.offsetHeight*5,z),X=window.getComputedStyle(j),Re=parseInt(X.paddingTop,10),Pe=parseInt(X.paddingBottom,10),ke=C.top+C.height/2-bs,Z=G-ke,ge=v.offsetHeight/2,ae=v.offsetTop+ge,ce=te+V+ae,_e=z-ce;if(ce<=ke){const E=W.length>0&&v===W[W.length-1].ref.current;c.style.bottom="0px";const B=f.clientHeight-j.offsetTop-j.offsetHeight,A=Math.max(Z,ge+(E?Pe:0)+B+L),ie=ce+A;c.style.height=ie+"px"}else{const E=W.length>0&&v===W[0].ref.current;c.style.top="0px";const A=Math.max(ke,te+j.offsetTop+(E?Re:0)+ge)+_e;c.style.height=A+"px",j.scrollTop=ce-ke+j.offsetTop}c.style.margin=`${bs}px 0`,c.style.minHeight=we+"px",c.style.maxHeight=G+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,c,f,j,v,x,a.dir,o]);Ot(()=>b(),[b]);const[S,N]=u.useState();Ot(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const k=u.useCallback(C=>{C&&w.current===!0&&(b(),y==null||y(),w.current=!1)},[b,y]);return r.jsx(NR,{scope:s,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:r.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:r.jsx(ot.div,{...l,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Og=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,align:o="start",collisionPadding:l=bs,...a}=t,i=om(s);return r.jsx(aE,{...i,...a,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[NR,lm]=zo(To,{}),Lg="SelectViewport",CR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,nonce:o,...l}=t,a=Do(Lg,s),i=lm(Lg,s),c=vt(n,a.onViewportChange),d=u.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),r.jsx(au.Slot,{scope:s,children:r.jsx(ot.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ke(l.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&p){const g=Math.abs(d.current-m.scrollTop);if(g>0){const w=window.innerHeight-bs*2,j=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),x=Math.max(j,v);if(x<w){const y=x+g,b=Math.min(w,y),S=y-b;p.style.height=b+"px",p.style.bottom==="0px"&&(m.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})},"SelectViewport")),ER="SelectGroup",[u$,RR]=zo(ER),PR="SelectLabel",TR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,...o}=t,l=RR(PR,s);return r.jsx(ot.div,{id:l.id,...o,ref:n})},"SelectLabel")),Cf="SelectItem",[MR,Rw]=zo(Cf),$R=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,value:o,disabled:l=!1,textValue:a,...i}=t,c=ro(Cf,s),d=Do(Cf,s),f=c.value===o,[m,p]=u.useState(a??""),[h,g]=u.useState(!1),w=Rs(b=>{var S;return(S=d.itemRefCallback)==null?void 0:S.call(d,b,o,l)}),j=vt(n,w),v=Ur(),x=u.useRef("touch"),y=Ge(()=>{l||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return r.jsx(MR,{scope:s,value:o,disabled:l,textId:v,isSelected:f,onItemTextChange:u.useCallback(b=>{p(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:r.jsx(au.ItemSlot,{scope:s,value:o,disabled:l,textValue:m,children:r.jsx(ot.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":f&&h,"data-state":f?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...i,ref:j,onFocus:Ke(i.onFocus,()=>g(!0)),onBlur:Ke(i.onBlur,()=>g(!1)),onClick:Ke(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:Ke(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:Ke(i.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:Ke(i.onPointerMove,b=>{var S;x.current=b.pointerType,l?(S=d.onItemLeave)==null||S.call(d):x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(i.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=d.onItemLeave)==null||S.call(d))}),onKeyDown:Ke(i.onKeyDown,b=>{var N;l||b.target!==b.currentTarget||((N=d.searchRef)==null?void 0:N.current)!==""&&b.key===" "||(lR.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})},"SelectItem")),Si="SelectItemText",IR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,className:o,style:l,...a}=t,i=ro(Si,s),c=Do(Si,s),d=Rw(Si,s),f=uR(Si,s),[m,p]=u.useState(null),h=Rs(y=>{var b;return(b=c.itemTextRefCallback)==null?void 0:b.call(c,y,d.value,d.disabled)}),g=vt(n,p,d.onItemTextChange,h),w=m==null?void 0:m.textContent,j=u.useMemo(()=>r.jsx("option",{value:d.value,disabled:d.disabled,children:w},d.value),[d.disabled,d.value,w]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=f;return Ot(()=>(v(j),()=>x(j)),[v,x,j]),r.jsxs(r.Fragment,{children:[r.jsx(ot.span,{id:d.textId,...a,ref:g}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!qa(i.value)?Oo.createPortal(a.children,i.valueNode):null]})},"SelectItemText")),AR="SelectItemIndicator",OR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,...o}=t;return Rw(AR,s).isSelected?r.jsx(ot.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),zg="SelectScrollUpButton",LR=u.forwardRef(Ge(function(t,n){const s=Do(zg,t.__scopeSelect),o=lm(zg,t.__scopeSelect),[l,a]=u.useState(!1),i=vt(n,o.onScrollButtonChange);return Ot(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollTop>0;a(f)};Ge(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(Pw,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),Dg="SelectScrollDownButton",zR=u.forwardRef(Ge(function(t,n){const s=Do(Dg,t.__scopeSelect),o=lm(Dg,t.__scopeSelect),[l,a]=u.useState(!1),i=vt(n,o.onScrollButtonChange);return Ot(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;a(m)};Ge(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(Pw,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),Pw=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,onAutoScroll:o,...l}=t,a=Do("SelectScrollButton",s),i=u.useRef(null),c=iu(s),d=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>d(),[d]),Ot(()=>{var m;const f=c().find(p=>p.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[c]),r.jsx(ot.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Ke(l.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:Ke(l.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:Ke(l.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),DR=u.forwardRef(Ge(function(t,n){const{__scopeSelect:s,...o}=t;return r.jsx(ot.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),FR="SelectBubbleInput",BR=u.forwardRef(Ge(function({__scopeSelect:t,...n},s){const o=ro(FR,t),{value:l,onValueChange:a,required:i,disabled:c,name:d,autoComplete:f,form:m}=o,{nativeOptions:p,nativeSelectKey:h}=o,g=u.useRef(null),w=vt(s,g),j=l??"",v=xw(j),x=Array.from(p).some(y=>(y.props.value??"")==="");return u.useEffect(()=>{const y=g.current;if(!y)return;const b=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(b,"value").set;if(v!==j&&N){const k=new Event("change",{bubbles:!0});N.call(y,j),y.dispatchEvent(k)}},[v,j]),r.jsxs(ot.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:d,autoComplete:f,disabled:c,form:m,onChange:y=>a(y.target.value),...n,style:{...vE,...n.style},ref:w,defaultValue:j,children:[qa(l)&&!x?r.jsx("option",{value:""}):null,Array.from(p)]},h)},"SelectBubbleInput"));function Tw(e){return typeof e=="function"}Ge(Tw,"isFunction");function qa(e){return e===""||e===void 0}Ge(qa,"shouldShowPlaceholder");function am(e){const t=Rs(e),n=u.useRef(""),s=u.useRef(0),o=u.useCallback(a=>{const i=n.current+a;t(i),Ge(function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))},"updateSearch")(i)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,l]}Ge(am,"useTypeaheadSearch");function im(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=Mw(e,Math.max(l,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}Ge(im,"findNextItem");function Mw(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Ge(Mw,"wrapArray");const It=dR,Ct=u.forwardRef((e,t)=>r.jsx(hR,{ref:t,"data-slot":"select-value",...e}));Ct.displayName="SelectValue";const Et=u.forwardRef(({className:e,size:t="default",children:n,...s},o)=>r.jsxs(pR,{ref:o,"data-slot":"select-trigger","data-size":t,className:Ve("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:truncate [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[n,r.jsx(gR,{asChild:!0,children:r.jsx(Cl,{className:"size-4 opacity-50"})})]}));Et.displayName="SelectTrigger";const Rt=u.forwardRef(({className:e,children:t,position:n="popper",...s},o)=>r.jsx(wR,{children:r.jsxs(jR,{ref:o,"data-slot":"select-content",className:Ve("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx($w,{}),r.jsx(CR,{className:Ve("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),r.jsx(Iw,{})]})}));Rt.displayName="SelectContent";const UR=u.forwardRef(({className:e,...t},n)=>r.jsx(TR,{ref:n,"data-slot":"select-label",className:Ve("text-muted-foreground px-2 py-1.5 text-xs",e),...t}));UR.displayName="SelectLabel";const Ae=u.forwardRef(({className:e,children:t,...n},s)=>r.jsxs($R,{ref:s,"data-slot":"select-item",className:Ve("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(OR,{children:r.jsx(Nl,{className:"size-4"})})}),r.jsx(IR,{children:t})]}));Ae.displayName="SelectItem";const VR=u.forwardRef(({className:e,...t},n)=>r.jsx(DR,{ref:n,"data-slot":"select-separator",className:Ve("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t}));VR.displayName="SelectSeparator";const $w=u.forwardRef(({className:e,...t},n)=>r.jsx(LR,{ref:n,"data-slot":"select-scroll-up-button",className:Ve("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(_c,{className:"size-4"})}));$w.displayName="SelectScrollUpButton";const Iw=u.forwardRef(({className:e,...t},n)=>r.jsx(zR,{ref:n,"data-slot":"select-scroll-down-button",className:Ve("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Cl,{className:"size-4"})}));Iw.displayName="SelectScrollDownButton";function Aw({open:e,query:t,items:n,onSelect:s,onClose:o,onDisabled:l}){const[a,i]=u.useState(0),c=u.useRef(null),d=(n||[]).filter(p=>p.dis||!t||(p.key||"").toLowerCase().includes(t.toLowerCase())),f=d.filter(p=>!p.dis);u.useEffect(()=>{const p=d.findIndex(h=>!h.dis);i(p>=0?p:0)},[t,e]),u.useEffect(()=>{c.current&&c.current.scrollIntoView({block:"nearest"})},[a,d]);function m(p,h){var g;if(!f.length)return p;for(let w=1;w<=d.length;w++){const j=(p+h*w+d.length)%d.length;if(!((g=d[j])!=null&&g.dis))return j}return p}return u.useEffect(()=>{if(!e)return;function p(h){if(!h.isComposing){if(h.key==="Escape"){h.preventDefault(),h.stopPropagation(),o();return}if(f.length){if(h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),i(g=>m(g,1));else if(h.key==="ArrowUp")h.preventDefault(),h.stopPropagation(),i(g=>m(g,-1));else if(h.key==="Enter"){h.preventDefault(),h.stopPropagation();const g=d[a];if(!g)return;g.dis?l==null||l(g):s(g)}}}}return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[e,d,f,a,s,o,l]),e?r.jsx("div",{className:"sess-slashmenu",children:d.length===0?r.jsx("div",{className:"sess-slash-empty",children:"无匹配项"}):d.map((p,h)=>r.jsxs("button",{type:"button",ref:h===a?c:void 0,className:"sess-slash-item"+(h===a?" on":"")+(p.dis?" dis":""),onMouseEnter:()=>i(h),onClick:()=>{p.dis?l==null||l(p):s(p)},children:[r.jsx("span",{className:"sess-slash-key",children:p.key||p.label}),r.jsx("span",{className:"sess-slash-desc",children:p.desc}),p.type==="cmd"&&r.jsx("span",{className:"sess-slash-tag",children:"命令"}),p.type==="skill"&&r.jsx("span",{className:"sess-slash-tag",children:"skill"})]},p.key))}):null}const Rc=[{value:"manual",label:"逐条确认",desc:"每个工具操作都需要你手动确认"},{value:"yolo",label:"自动通过",desc:"自动批准工具操作,但遇到关键问题仍会询问"},{value:"auto",label:"完全自主",desc:"完全自主运行,智能体自己做决定,不再询问"}];function ki(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function HR({value:e,onChange:t,atts:n,onRemoveAtt:s,uploading:o,inputLocked:l,caps:a,meta:i,onSend:c,onStop:d,chatRunning:f,taskRunning:m,queuedN:p,board:h,sending:g,permMode:w,modelSel:j,modelOpts:v,onSetModel:x,onSetPermission:y,effortSel:b,effortOpts:S,onSetEffort:N,queueRows:k,injecting:C,onInject:O,answerPending:P,deliveringAnswer:D,onDeliverAnswer:W,slashOpen:G,slashQuery:$,slashItems:K,onSlashSelect:te,onSlashClose:V,onSlashDisabled:L,onPasteFiles:Y,onDropFiles:z,onUploadFiles:we,taRef:X}){const Re=u.useRef(null),Pe=h&&!!(a!=null&&a.profile),ke=h&&!!(a!=null&&a.permission),Z=!!(a!=null&&a.profile)&&!!((S==null?void 0:S.options)||[]).length,ge=Rc.find(le=>le.value===w)||null,ae=ge?ge.label:"权限",ce=b||(i==null?void 0:i.sessionEffort)||"",_e=((S==null?void 0:S.options)||[]).find(le=>le.value===ce)||null,pe=S!=null&&S.defaultEffort?((S.options||[]).find(le=>le.value===S.defaultEffort)||{}).label||S.defaultEffort:"",E=(_e==null?void 0:_e.label)||(pe?`默认(${pe})`:"默认"),B=j||(i==null?void 0:i.sessionModel)||(v==null?void 0:v.default)||"默认模型",A=B==="默认模型"?"__default__":B,ie=i==null?void 0:i.ctx,oe=ie&&+ie.max>0?Math.min(100,Math.max(0,Math.round(+ie.used/+ie.max*100))):0,Oe=2*Math.PI*7,Ye=(n||[]).filter(le=>e.includes(le.md)),dt=(i==null?void 0:i.queue_state)||"",st=!!(i!=null&&i.project_busy),gt=!!dt&&dt!=="idle"||st||f||(p||0)>0,fn=gC(dt,{found:!!(i!=null&&i.found),board:!!h,canQueue:!!a.queue,chatRunning:f,projectBusy:st}),jn=(p||0)>0||f&&(h||!(a.queue&&m));return r.jsxs("div",{className:"sess-composer",children:[P&&r.jsx("div",{className:"sess-queue",children:r.jsxs("div",{className:"sess-queue-row",title:"答案已提交,等项目空闲送达",children:[r.jsx("span",{className:"sess-queue-tag on",children:"待送达"}),r.jsx("span",{className:"sess-queue-text",children:"已作答,等待送达(项目忙,空闲后自动送达)"}),r.jsxs(F,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:D,title:"立即送达:不等项目空闲,立即把答案交给等待中的会话",onClick:W,children:[r.jsx(ig,{className:"h-3 w-3"})," 立即送达"]})]})}),k.length>0&&r.jsx("div",{className:"sess-queue",children:k.map(le=>{const J=a.steer&&le.msgId&&le.state!=="running";return r.jsxs("div",{className:"sess-queue-row",title:le.text,children:[r.jsx("span",{className:"sess-queue-tag"+(le.state==="server"?" on":""),children:le.state==="server"?"服务端排队":le.state==="running"?"发送中":"排队中"}),r.jsxs("span",{className:"sess-queue-text",children:[le.text.slice(0,60),le.text.length>60?"…":""]}),J&&r.jsxs(F,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:C===le.key,title:"立即注入:不等队列,直接投递到会话当前上下文",onClick:()=>O(le),children:[r.jsx(ig,{className:"h-3 w-3"})," 立即注入"]})]},le.key)})}),Ye.length>0&&r.jsx("div",{className:"sess-attachrow",children:Ye.map((le,J)=>r.jsxs("span",{className:"sess-chip",title:le.name,children:[(le.mime||"").startsWith("image/")&&le.url?r.jsx("img",{src:le.url,alt:le.name}):r.jsx(m0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:le.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>s(le.md),children:r.jsx(Co,{className:"h-3 w-3"})})]},le.md+J))}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(Aw,{open:G,query:$,items:K,onSelect:te,onClose:V,onDisabled:L}),r.jsx("textarea",{ref:X,className:"sess-ta",rows:1,value:e,onChange:le=>t(le.target.value),onKeyDown:le=>{le.key==="Enter"&&!le.shiftKey&&!le.nativeEvent.isComposing&&(le.preventDefault(),c())},onPaste:Y,onDrop:z,placeholder:fn,disabled:l})]}),r.jsxs("div",{className:"sess-bottombar",children:[r.jsx("input",{ref:Re,type:"file",multiple:!0,className:"hidden",onChange:le=>{we(le.target.files),le.target.value=""}}),r.jsx(F,{variant:"ghost",size:"icon",className:"sess-attach",title:"添加附件(粘贴/拖入亦可)",disabled:o||l,onClick:()=>{var le;return(le=Re.current)==null?void 0:le.click()},children:r.jsx(Va,{className:"h-4 w-4"})}),ke?r.jsxs(It,{value:w||void 0,onValueChange:y,disabled:!w,children:[r.jsx(Et,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:ge?`权限:${ge.label}(${ge.desc})`:"权限模式读取中…",children:r.jsx(Ct,{className:"sess-ctl-value",placeholder:"权限",children:ae})}),r.jsx(Rt,{children:Rc.map(le=>r.jsx(Ae,{value:le.value,title:le.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:le.label}),r.jsx("span",{className:"sess-perm-desc",children:le.desc})]})},le.value))})]}):r.jsx("span",{className:"sess-chip",title:"权限模式(会话级)",children:ae}),Pe?r.jsxs(It,{value:A,onValueChange:x,children:[r.jsx(Et,{size:"sm",className:"h-8 max-w-[180px] px-2 text-xs gap-1",title:"切换会话模型(即时生效)",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[A==="__default__"&&r.jsx(Ae,{value:"__default__",disabled:!0,children:"默认模型"}),A!=="__default__"&&!((v==null?void 0:v.models)||[]).some(le=>le.name===A)&&r.jsx(Ae,{value:A,children:A}),((v==null?void 0:v.models)||[]).map(le=>r.jsx(Ae,{value:le.name,children:le.display_name||le.name},le.name))]})]}):r.jsx("span",{className:"sess-chip",title:"当前会话模型",children:(i==null?void 0:i.sessionModel)||"默认模型"}),Z?r.jsxs(It,{value:ce||"__default__",onValueChange:N,children:[r.jsx(Et,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:"切换会话思考等级(即时生效)",children:r.jsx(Ct,{className:"sess-ctl-value",placeholder:"思考等级",children:E})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__default__",disabled:!0,children:pe?`默认(${pe})`:"默认"}),ce&&!_e&&r.jsx(Ae,{value:ce,children:ce}),((S==null?void 0:S.options)||[]).map(le=>r.jsx(Ae,{value:le.value,title:le.title,children:le.label},le.value))]})]}):r.jsx("span",{className:"sess-chip",title:"思考等级(会话级)",children:E}),r.jsxs("svg",{className:"sess-ring",viewBox:"0 0 18 18",width:"18",height:"18",title:ie?`上下文 ${ki(ie.used)} / ${ki(ie.max)}(${oe}%)`:"暂无上下文用量数据",children:[r.jsx("title",{children:ie?`上下文 ${ki(ie.used)} / ${ki(ie.max)}(${oe}%)`:"暂无上下文用量数据"}),r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--border)",strokeWidth:"2"}),oe>0&&r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--run)",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${oe/100*Oe} ${Oe}`,transform:"rotate(-90 9 9)"}),r.jsx("text",{x:"9",y:"9",dominantBaseline:"central",textAnchor:"middle",children:oe})]}),r.jsx("span",{style:{flex:1}}),jn&&r.jsxs(F,{variant:"outline",size:"sm",onClick:d,children:[r.jsx(Hp,{})," ",(p||0)>0&&!f?"取消排队":"停止"]}),r.jsxs(F,{size:"sm",onClick:c,disabled:!e.trim()||g||l,children:[r.jsx(ff,{})," ",gt?"排队":"发送"]})]})]})}const nd=["off","minimal","low","medium","high","xhigh","max"];function Ef(e){return e||""}function WR(e,t){const n=(t||"").trim();return n&&(e.find(s=>s.name===n)||e.find(s=>s.name.endsWith("/"+n)))||null}function Fg(e){return(e&&e.efforts||[]).map(t=>t.id).filter(Boolean)}function Ow(e,t){const n=e&&e.models||[],s=WR(n,t);let o=Fg(s);if(!o.length){const i=[];for(const c of n)for(const d of Fg(c))i.includes(d)||i.push(d);o=i}const l=o.length>0;return l||(o=nd.slice()),{options:nd.filter(i=>o.includes(i)).concat(o.filter(i=>!nd.includes(i))).map(i=>({value:i,label:Ef(i),title:`思考等级 ${i}`})),defaultEffort:s&&s.default_effort||"",fromCatalog:l}}function qR(e,t=""){return e?Ef(e):t?`默认(${Ef(t)})`:"默认"}var GR=Object.defineProperty,gs=(e,t)=>GR(e,"name",{value:t,configurable:!0}),cm="Dialog",[Lw,d$]=no(cm),[KR,Ys]=Lw(cm),YR=gs(e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:o,onOpenChange:l,modal:a=!0}=e,i=u.useRef(null),c=u.useRef(null),[d,f]=El({prop:s,defaultProp:o??!1,onChange:l,caller:cm}),[m,p]=u.useState(0),[h,g]=u.useState(0);return r.jsx(KR,{scope:t,triggerRef:i,contentRef:c,contentId:Ur(),titleId:Ur(),descriptionId:Ur(),titlePresent:m>0,descriptionPresent:h>0,setTitleCount:p,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(w=>!w),[f]),modal:a,children:n})},"Dialog"),zw="DialogPortal",[QR,Dw]=Lw(zw,{forceMount:void 0}),XR=gs(e=>{const{__scopeDialog:t,forceMount:n,children:s,container:o}=e,l=Ys(zw,t);return r.jsx(QR,{scope:t,forceMount:n,children:u.Children.map(s,a=>r.jsx(Ha,{present:n||l.open,children:r.jsx(cw,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Rf="DialogOverlay",JR=u.forwardRef(gs(function(t,n){const s=Dw(Rf,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Ys(Rf,t.__scopeDialog);return a.modal?r.jsx(Ha,{present:o||a.open,children:r.jsx(eP,{...l,ref:n})}):null},"DialogOverlay")),ZR=pr("DialogOverlay.RemoveScroll"),eP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Ys(Rf,s),a=A0(),i=vt(n,a);return r.jsx(rm,{as:ZR,allowPinchZoom:!0,shards:[l.contentRef],children:r.jsx(ot.div,{"data-state":um(l.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),$a="DialogContent",tP=u.forwardRef(gs(function(t,n){const s=Dw($a,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Ys($a,t.__scopeDialog);return r.jsx(Ha,{present:o||a.open,children:a.modal?r.jsx(nP,{...l,ref:n}):r.jsx(sP,{...l,ref:n})})},"DialogContent")),nP=u.forwardRef(gs(function(t,n){const s=Ys($a,t.__scopeDialog),o=u.useRef(null),l=vt(n,s.contentRef,o);return u.useEffect(()=>{const a=o.current;if(a)return yw(a)},[]),r.jsx(Fw,{...t,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:Ke(t.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=s.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ke(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Ke(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),sP=u.forwardRef(gs(function(t,n){const s=Ys($a,t.__scopeDialog),o=u.useRef(!1),l=u.useRef(!1);return r.jsx(Fw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=t.onCloseAutoFocus)==null||i.call(t,a),a.defaultPrevented||(o.current||(c=s.triggerRef.current)==null||c.focus(),a.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:a=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const i=a.target;((f=s.triggerRef.current)==null?void 0:f.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&l.current&&a.preventDefault()}})},"DialogContentNonModal")),Fw=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,...i}=t,c=Ys($a,s);return Zc(),r.jsx(r.Fragment,{children:r.jsx(z0,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:a,children:r.jsx(I0,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":um(c.open),...i,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),rP="DialogTitle",oP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Ys(rP,s),{setTitleCount:a}=l;return Ot(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ot.h2,{id:l.titleId,...o,ref:n})},"DialogTitle")),lP="DialogDescription",aP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Ys(lP,s),{setDescriptionCount:a}=l;return Ot(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ot.p,{id:l.descriptionId,...o,ref:n})},"DialogDescription")),iP="DialogClose",cP=u.forwardRef(gs(function(t,n){const{__scopeDialog:s,...o}=t,l=Ys(iP,s);return r.jsx(ot.button,{type:"button",...o,ref:n,onClick:Ke(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function um(e){return e?"open":"closed"}gs(um,"getState");const on=YR,uP=XR,Bw=u.forwardRef(({className:e,...t},n)=>r.jsx(JR,{ref:n,"data-slot":"dialog-overlay",className:Ve("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));Bw.displayName="DialogOverlay";const qt=u.forwardRef(({className:e,children:t,showCloseButton:n=!0,...s},o)=>r.jsxs(uP,{"data-slot":"dialog-portal",children:[r.jsx(Bw,{}),r.jsxs(tP,{ref:o,"data-slot":"dialog-content",className:Ve("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[t,n&&r.jsxs(cP,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(Co,{}),r.jsx("span",{className:"sr-only",children:"关闭"})]})]})]}));qt.displayName="DialogContent";const Gt=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-header",className:Ve("flex flex-col gap-2 text-center sm:text-left",e),...t}));Gt.displayName="DialogHeader";const kn=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-footer",className:Ve("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t}));kn.displayName="DialogFooter";const Kt=u.forwardRef(({className:e,...t},n)=>r.jsx(oP,{ref:n,"data-slot":"dialog-title",className:Ve("text-lg leading-none font-semibold",e),...t}));Kt.displayName="DialogTitle";const dP=u.forwardRef(({className:e,...t},n)=>r.jsx(aP,{ref:n,"data-slot":"dialog-description",className:Ve("text-muted-foreground text-sm",e),...t}));dP.displayName="DialogDescription";const fP=/\.(md|markdown)$/i;function Bg(e){const t=+e||0;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/1024/1024).toFixed(1)+" MB"}function pP(e){const t=new Date((+e||0)*1e3);return isNaN(t.getTime())?"":t.toLocaleString()}function mP({pid:e,path:t,onClose:n}){const[s,o]=u.useState([t]),l=s[s.length-1],[a,i]=u.useState({loading:!0});u.useEffect(()=>{let p=!0;return i({loading:!0}),Pt.filePreview(e,l).then(h=>{p&&i({data:h})}).catch(h=>{p&&i({error:h.message||"读取失败"})}),()=>{p=!1}},[e,l]);const c=u.useCallback(p=>{const h=p.target&&p.target.closest?p.target.closest("a.md-path"):null,g=h&&h.getAttribute("data-path");g&&(p.preventDefault(),o(w=>w[w.length-1]===g?w:[...w,g]))},[]),d=a.data,f=Pt.fileRawUrl(e,l),m=u.useCallback(()=>{var h;const p=d&&d.path||l;(h=navigator.clipboard)==null||h.writeText(p).then(()=>T("已复制路径"),()=>T("复制失败,请手动选择"))},[d,l]);return r.jsx(on,{open:!0,onOpenChange:p=>{p||n()},children:r.jsxs(qt,{className:"modal fv-modal w-[66vw] h-[78vh] sm:max-w-none flex flex-col gap-2 p-4 overflow-hidden",showCloseButton:!1,children:[r.jsxs(Gt,{className:"text-left fv-head",children:[r.jsxs("div",{className:"fv-titlebar",children:[s.length>1&&r.jsx("button",{type:"button",className:"fv-act",title:"返回上一个文件",onClick:()=>o(p=>p.slice(0,-1)),children:r.jsx(zp,{className:"fv-act-i"})}),r.jsx(Kt,{className:"fv-title",title:d&&d.path||l,children:d&&d.rel||l}),r.jsx("button",{type:"button",className:"fv-act",title:"复制完整路径",onClick:m,children:r.jsx(Dp,{className:"fv-act-i"})}),r.jsx("a",{className:"fv-act",href:f,target:"_blank",rel:"noreferrer",title:"在新标签页打开原文(文本按纯文本展示;二进制下载)",children:r.jsx(Fp,{className:"fv-act-i"})}),r.jsx("button",{type:"button",className:"fv-act",title:"关闭(Esc)",onClick:n,children:r.jsx(Co,{className:"fv-act-i"})})]}),d&&r.jsxs("div",{className:"fv-meta",children:[Bg(d.size)," · ",pP(d.mtime),d.root==="work"?" · 工作目录":" · 项目目录",d.truncated?" · 仅显示前 256KB":""]})]}),r.jsx("div",{className:"fv-body",children:a.loading?r.jsx("div",{className:"fv-hint",children:"读取中…"}):a.error?r.jsxs("div",{className:"fv-hint err",children:[r.jsx(y0,{className:"fv-hint-i"}),r.jsx("span",{children:a.error})]}):d.binary?r.jsxs("div",{className:"fv-hint",children:[r.jsx(lN,{className:"fv-hint-i"}),r.jsxs("span",{children:["二进制文件(",Bg(d.size),"),无法预览。",r.jsx("a",{className:"md-path",href:f,target:"_blank",rel:"noreferrer",children:"下载"})]})]}):fP.test(l)?r.jsx("div",{className:"md-body",onClick:c,dangerouslySetInnerHTML:{__html:Eo(d.text,{pathLinks:!0})}}):r.jsx("pre",{className:"fv-pre",children:d.text})})]})})}function Uw(e,t){const s=e.slice(0,t).match(/(?:^|\s)(\/[^\s]*)$/);return s?{start:t-s[1].length,text:s[1]}:null}const hP="touchstone:host-probe",gP="touchstone:host-caps",xP="touchstone:open-session";let Ia=null,Ug=!1;const Pf=new Set;function vP(){return Ia}function yP(e){return Pf.add(e),()=>{Pf.delete(e)}}function wP(e){Ia=e;for(const t of[...Pf])try{t(Ia)}catch{}}function Vw(){return typeof window<"u"&&!!window.parent&&window.parent!==window}function Hw(e){if(!Ia||!Ia.openSession||!e||!Vw())return!1;try{return window.parent.postMessage({type:xP,sid:String(e)},window.location.origin),!0}catch{return!1}}function jP(){if(!(Ug||typeof window>"u")&&(Ug=!0,window.addEventListener("message",e=>{if(e.origin!==window.location.origin)return;const t=e.data||{};t.type===gP&&wP(t.caps||{})}),!!Vw()))try{window.parent.postMessage({type:hP},window.location.origin)}catch{}}function Ww(){return u.useSyncExternalStore(yP,vP,()=>null)}function gl(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function Tf(e){const t=+e||0;return t<1e3?"":t<6e4?(t/1e3).toFixed(1)+"s":Math.floor(t/6e4)+"分"+Math.round(t%6e4/1e3)+"s"}function bP(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e||""}}const _P={family:"该智能体暂不支持会话查看",no_session:"会话尚未生成(任务首轮执行后才有会话)",missing:"未找到会话文件(可能已被清理)"},SP=10,Vg=56,Hg=10,Yl=60,kP=240,NP=60;function sd(e,t){let n=0,s=e.length-2;if(s<0||t<=0)return 0;for(;n<s;){const o=n+s+1>>1;e[o]<=t?n=o:s=o-1}return n}const CP=u.memo(function({e:t,taskId:n,agent:s,pid:o,boardPid:l,boardSid:a,flash:i,rwState:c,copied:d,onCopy:f,onRewind:m,onOpenPath:p}){const h=u.useCallback(w=>{const j=w.target&&w.target.closest?w.target.closest("a.md-path"):null,v=j&&j.getAttribute("data-path");!v||!p||(w.preventDefault(),p(v))},[p]),g=(()=>{if(t.kind==="user"){const w=mf(t.text,o),j=!!(t.text||"").trim();return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sess-msg user",children:r.jsxs("div",{className:"bubble",children:[w&&r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Eo(w)}}),(t.images||[]).map((v,x)=>{const y=v.media?n?Be.sessionMediaUrl(n,s,v.media):l&&a?Me.sessionMediaUrl(l,a,s,v.media):"":"";return y?r.jsx("a",{href:y,target:"_blank",rel:"noreferrer",children:r.jsx("img",{className:"sess-img",src:y,alt:"图片",onError:b=>{b.currentTarget.closest("a").replaceWith("[图片]")}})},x):r.jsx("span",{className:"sess-img-ph",children:"[图片]"},x)})]})}),(c||j)&&r.jsxs("div",{className:"sess-actrow",children:[c&&r.jsx("button",{type:"button",className:"sess-act rw"+(c==="on"?"":" off"),disabled:c!=="on",title:c==="busy"?"会话运行中或有排队消息,稍后再试":c==="running"?"回退中…":"回退到该提问之前(撤销该提问及其后对话,不回退文件改动)",onClick:()=>m(t),children:r.jsx(Sc,{className:"sess-act-i"})}),j&&r.jsx("button",{type:"button",className:"sess-act cp",title:d?"已复制":"复制该提问",onClick:()=>f(t),children:d?r.jsx(Nl,{className:"sess-act-i"}):r.jsx(Dp,{className:"sess-act-i"})})]})]})}if(t.kind==="assistant")return r.jsx("div",{className:"sess-msg assistant",children:r.jsx("div",{className:"md-body",onClick:h,dangerouslySetInnerHTML:{__html:Eo(t.text,{pathLinks:!0})}})});if(t.kind==="think")return t.text?r.jsxs("details",{className:"sess-msg think",children:[r.jsx("summary",{children:"思考过程"}),r.jsx("div",{className:"think-text",children:t.text})]}):null;if(t.kind==="tool_call")return r.jsxs("details",{className:"sess-msg tool",children:[r.jsxs("summary",{children:[r.jsx(w0,{className:"inline h-3 w-3"})," ",t.name||"工具调用"]}),r.jsx("pre",{children:bP(t.args)})]});if(t.kind==="tool_result")return r.jsxs("details",{className:"sess-msg tool result"+(t.is_error?" err":""),children:[r.jsxs("summary",{children:[t.is_error?"错误":"结果",t.name?` · ${t.name}`:"","(",String(t.text||"").trim().length," 字符",t.truncated?" · 已截断":"",")"]}),r.jsx("pre",{children:String(t.text||"").trim()})]});if(t.kind==="usage"){const w=[];return t.input&&w.push("↑"+gl(t.input)),t.output&&w.push("↓"+gl(t.output)),t.cache_read&&w.push("缓存 "+gl(t.cache_read)),t.duration_ms&&Tf(t.duration_ms)&&w.push(Tf(t.duration_ms)),w.length?r.jsx("div",{className:"sess-usage",children:w.join(" · ")}):null}if(t.kind==="divider")return r.jsx("div",{className:"sess-divider",children:t.text});if(t.kind==="error"){const w=[t.text,t.code?`[${t.code}]`:"",t.retryable?"可重试":""].filter(Boolean).join(" · ");return r.jsx("div",{className:"sess-msg error",children:r.jsxs("div",{className:"sess-errbox",children:[r.jsx(y0,{className:"sess-errbox-i"}),r.jsxs("div",{children:[r.jsx("div",{className:"sess-errbox-t",children:"模型请求失败,本轮对话已中断"}),w&&r.jsx("div",{className:"sess-errbox-d",children:w})]})]})})}return null})();return g?r.jsx("div",{className:"sess-entry"+(i?" flash":""),"data-seq":t.seq,children:g}):null}),EP=u.memo(function({entries:t,metaNull:n,found:s,reason:o,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flashSeq:f,chatRunning:m,exitCode:p,boxRef:h,atBottomRef:g,onScroll:w,jumpSeq:j,onJumpHandled:v,rwEnabled:x,rwBusy:y,rewindingMid:b,copiedSeq:S,onCopy:N,onRewind:k,onSwitchSession:C,onOpenPath:O}){const P=t.length,D=u.useRef(new Map),W=u.useRef(new Set),G=u.useRef(null),[$,K]=u.useState(0),[te,V]=u.useState(null),L=u.useRef(!0),Y=u.useRef(0),z=u.useRef(null),we=u.useRef(null),X=u.useMemo(()=>{const Z=new Float64Array(P+1),ge=D.current;let ae=0;for(const _e of ge.values())ae+=_e;const ce=ge.size?ae/ge.size:Vg;for(let _e=0;_e<P;_e++)Z[_e+1]=Z[_e]+(ge.get(t[_e].seq)||ce);return Z},[t,P,$]),[Re,Pe]=te??[Math.max(0,P-Yl),P],ke=u.useCallback(()=>{const Z=h.current;Z&&(w(),L.current=Z.scrollHeight-Z.scrollTop-Z.clientHeight<NP,!Y.current&&(Y.current=requestAnimationFrame(()=>{Y.current=0;const ge=h.current;ge&&V(ae=>{const[ce,_e]=ae??[Math.max(0,P-Yl),P];if(L.current)return _e===P?ae:[Math.max(0,P-Yl),P];const pe=Math.max(0,sd(X,ge.scrollTop)-Hg),E=Math.min(P,sd(X,ge.scrollTop+ge.clientHeight)+1+Hg);return pe===ce&&E===_e?ae:[pe,Math.max(pe+1,E)]})})))},[h,w,P,X]);return u.useEffect(()=>()=>cancelAnimationFrame(Y.current),[]),u.useLayoutEffect(()=>{if(!P){D.current.size&&(D.current=new Map),we.current=null,V(null);return}V(Z=>{const[ge,ae]=Z??[Math.max(0,P-Yl),P];return g.current?[P-ge>kP?Math.max(0,P-Yl):Math.min(ge,P-1),P]:[Math.min(ge,P-1),Math.min(ae,P)]})},[P,g]),u.useEffect(()=>{if(j==null)return;const Z=t.findIndex(ge=>ge.seq===j);if(Z<0){v(j);return}L.current=!1,z.current=j,V([Math.max(0,Z-5),Math.min(P,Z+25)])},[j,t,P,v]),u.useEffect(()=>{if(typeof ResizeObserver>"u")return;const Z=new ResizeObserver(()=>K(ge=>ge+1));return G.current=Z,h.current&&Z.observe(h.current),()=>{Z.disconnect(),G.current=null,W.current=new Set}},[h]),u.useLayoutEffect(()=>{const Z=h.current;if(!Z)return;const ge=D.current;let ae=!1,ce=0;const _e=sd(X,Z.scrollTop),pe=Z.querySelectorAll(".sess-entry[data-seq]");for(let oe=0;oe<pe.length;oe++){const Oe=pe[oe],Ye=+Oe.dataset.seq,dt=Oe.offsetHeight+SP,st=ge.get(Ye);st!==dt&&(ge.set(Ye,dt),ae=!0,Re+oe<_e&&(ce+=dt-(st??Vg)))}ce&&!L.current&&(Z.scrollTop+=ce);const E=we.current,B=!E||Z.scrollHeight!==E.sh||Z.clientHeight<E.ch;we.current={sh:Z.scrollHeight,ch:Z.clientHeight},L.current&&g.current&&B&&(Z.scrollTop=Z.scrollHeight);const A=G.current;if(A){const oe=new Set;for(let Oe=0;Oe<pe.length;Oe++){const Ye=pe[Oe];oe.add(Ye),W.current.has(Ye)||(A.observe(Ye),W.current.add(Ye))}for(const Oe of W.current)oe.has(Oe)||(A.unobserve(Oe),W.current.delete(Oe))}const ie=z.current;if(ie!=null){const oe=Z.querySelector(`[data-seq="${ie}"]`);oe&&(oe.scrollIntoView({block:"start"}),z.current=null,v(ie))}ae&&K(oe=>oe+1)}),r.jsxs("div",{className:"sess-body scroll",ref:h,onScroll:ke,children:[n?r.jsx("div",{className:"sess-empty",children:"加载中…"}):s?P?r.jsxs(r.Fragment,{children:[Re>0&&r.jsx("div",{className:"sess-pad",style:{height:X[Re]}}),t.slice(Re,Pe).map(Z=>{const ge=!x||!Z.mid?"":b===Z.mid?"running":y?"busy":"on";return r.jsx(CP,{e:Z,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flash:f===Z.seq,rwState:ge,copied:S===Z.seq,onCopy:N,onRewind:k,onOpenPath:O},Z.seq)}),Pe<P&&r.jsx("div",{className:"sess-pad",style:{height:X[P]-X[Pe]}})]}):r.jsx("div",{className:"sess-empty",children:"会话暂无内容"}):r.jsx("div",{className:"sess-empty",children:_P[o]||"会话不可用"}),m&&r.jsxs("div",{className:"sess-running",children:[r.jsx("span",{className:"sess-pulse"}),"工作中…"]}),!m&&p!=null&&p!==0&&r.jsxs("div",{className:"sess-chaterr",children:[r.jsx(Yk,{className:"inline h-3 w-3"})," 对话进程异常结束(exit=",p,")"]})]})}),RP=u.memo(function({withQBar:t,qbarOpen:n,questions:s,flashSeq:o,onJump:l}){return!t||!n?null:r.jsxs("aside",{className:"sess-qbar",children:[r.jsxs("div",{className:"sess-qbar-t",children:["提问索引 ",r.jsx("span",{className:"sess-qbar-n",children:s.length})]}),r.jsxs("div",{className:"sess-qbar-list",children:[s.length===0&&r.jsx("div",{className:"sess-qbar-empty",children:"暂无提问"}),s.map((a,i)=>r.jsxs("button",{type:"button",className:"sess-qitem"+(o===a.seq?" on":""),onClick:()=>l(a.seq),title:a.text,children:[r.jsx("span",{className:"sess-qitem-i",children:i+1}),r.jsxs("span",{className:"sess-qitem-t",children:[a.text.replace(/\s+/g," ").slice(0,60),a.text.length>60?"…":""]})]},a.seq))]})]})}),PP=u.memo(function({data:t,answer:n}){const[s,o]=u.useState({}),[l,a]=u.useState(!1),[i,c]=u.useState(0),[d,f]=u.useState(!1),m=t==null?void 0:t.qid,p=t==null?void 0:t.approval_id;if(u.useEffect(()=>{o({}),c(0),f(!1)},[m,p]),!(t!=null&&t.pending))return null;const h=t.questions&&t.questions.length?t.questions:[{id:t.wire||"q_0",question:t.question,header:t.header,body:t.body,options:t.options||[],multi_select:t.multi_select,allow_other:t.allow_other,other_label:t.other_label,other_description:t.other_description}],g=h.length>1,w=$=>s[$]||{sel:[],other:"",useOther:!1},j=($,K)=>o(te=>({...te,[$]:{...te[$]||{sel:[],other:"",useOther:!1},...K}}));async function v($){a(!0);try{await n($)}finally{a(!1)}}function x($,K){const te=w($.id);$.multi_select?j($.id,{sel:te.sel.includes(K)?te.sel.filter(V=>V!==K):[...te.sel,K]}):j($.id,{sel:[K],useOther:!1})}function y($){j($.id,$.multi_select?{useOther:!0}:{useOther:!0,sel:[]})}function b($,K){j($.id,$.multi_select?{other:K,useOther:!0}:{other:K,useOther:!0,sel:[]})}function S($){const K=w($.id),te=(K.other||"").trim();return $.multi_select?K.sel.length&&te?{wire:$.id,kind:"multi_with_other",option_ids:K.sel,text:te}:K.sel.length?{wire:$.id,kind:"multi",option_ids:K.sel}:te?{wire:$.id,kind:"other",text:te}:null:K.sel.length?{wire:$.id,kind:"single",option_id:K.sel[0]}:te?{wire:$.id,kind:"other",text:te}:null}const N=h.map(S),k=!l&&N.every(Boolean);function C(){if(k)return v({qid:m,answers:N})}const O=N.filter(Boolean).length,P=Math.min(Math.max(i,0),h.length-1),D=h[P],W=w(D.id),G=D.options||[];return t.kind==="approval"?d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx(_c,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Cl,{className:"h-3.5 w-3.5"})})]}),t.input&&r.jsx("pre",{className:"sess-interaction-pre",children:t.input}),r.jsxs("div",{className:"sess-interaction-opts",children:[r.jsx(F,{size:"sm",disabled:l,onClick:()=>v({approval_id:p,decision:"approved"}),children:"批准"}),r.jsx(F,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"approved",scope:"session"}),children:"本会话内批准"}),r.jsx(F,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"rejected"}),children:"拒绝"})]})]}):d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🤔 agent 等待你的回答",g?` · 已答 ${O}/${h.length}`:""]}),r.jsx(_c,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🤔 ",g?`问题 ${P+1}/${h.length}`:"agent 等待你的回答",D.header?`(${D.header})`:"",":",D.question||"(详情见会话记录)"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Cl,{className:"h-3.5 w-3.5"})})]}),D.body&&r.jsx("div",{className:"sess-interaction-body",children:D.body}),t.answerable&&r.jsxs("div",{className:"sess-interaction-list",children:[G.map(($,K)=>r.jsxs("label",{className:"sess-iopt"+(W.sel.includes($.id)?" on":""),children:[r.jsx("input",{type:D.multi_select?"checkbox":"radio",checked:W.sel.includes($.id),disabled:l,onChange:()=>x(D,$.id)}),r.jsx("span",{className:"sess-iopt-key",children:K+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:$.label}),$.description&&r.jsx("span",{className:"sess-iopt-desc",children:$.description})]})]},$.id)),D.allow_other&&r.jsxs("label",{className:"sess-iopt"+(W.useOther?" on":""),children:[r.jsx("input",{type:D.multi_select?"checkbox":"radio",checked:W.useOther,disabled:l,onChange:()=>y(D)}),r.jsx("span",{className:"sess-iopt-key",children:G.length+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:D.other_label||"其他…"}),D.other_description&&r.jsx("span",{className:"sess-iopt-desc",children:D.other_description}),r.jsx("input",{className:"sess-iopt-input",type:"text",value:W.other,placeholder:D.other_label||"其他…",disabled:l,onFocus:()=>y(D),onChange:$=>b(D,$.target.value)})]})]})]}),(t.answerable||g)&&r.jsxs("div",{className:"sess-interaction-foot",children:[g?r.jsxs("div",{className:"sess-inav",children:[r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:P===0,onClick:()=>c(P-1),children:"‹ 上一题"}),h.map(($,K)=>r.jsx("button",{type:"button",className:"sess-inav-dot"+(K===P?" on":"")+(N[K]?" done":""),title:`第 ${K+1} 题${N[K]?"(已答)":"(未答)"}`,onClick:()=>c(K),children:K+1},$.id)),r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:P===h.length-1,onClick:()=>c(P+1),children:"下一题 ›"})]}):r.jsx("span",{className:"sess-interaction-hint",children:D.multi_select?"可多选,选好后点「提交」":"选择后点「提交」"}),t.answerable&&r.jsx(F,{size:"sm",disabled:!k,title:!l&&!k?"还有题目未作答":void 0,onClick:C,children:"提交"})]})]})});function Mf({task:e,board:t,withQBar:n=!0,onUnitState:s,onCardColumn:o,onPassed:l}){var ze,qe,De,en,kt,yr;const a=e==null?void 0:e.id,i=t==null?void 0:t.sid,c=t==null?void 0:t.projectId,d=t==null?void 0:t.cid,[f,m]=u.useState(null),[p,h]=u.useState([]),[g,w]=u.useState({running:!1}),[j,v]=u.useState("main"),[x,y]=u.useState(!1),[b,S]=u.useState(""),[N,k]=u.useState(!1),[C,O]=u.useState(""),[P,D]=u.useState(""),[W,G]=u.useState(!1),[$,K]=u.useState(!1),[te,V]=u.useState(null),[L,Y]=u.useState(""),z=u.useRef(null),[we,X]=u.useState(!1),[Re,Pe]=u.useState([]),[ke,Z]=u.useState([]),[ge,ae]=u.useState(null),[ce,_e]=u.useState(null),[pe,E]=u.useState({models:[],default:""}),[B,A]=u.useState(null),ie=$n(M=>M.projects),[oe,Oe]=u.useState(-1),[Ye,dt]=u.useState(!1),[st,Lt]=u.useState([]),[gt,fn]=u.useState(!0),[jn,le]=u.useState(null),[J,We]=u.useState(null),Yt=u.useRef(null),Un=u.useRef(null),Tt=u.useRef(!0),tt=u.useRef(-1),Mt=u.useRef(""),Rn=u.useRef(""),Pn=u.useRef(null),ts=u.useRef(null),R=u.useRef(null),U=u.useRef(null),ne=u.useRef([1,0]),ue=!!t&&!!(f!=null&&f.running),de=["running","queued"].includes(e==null?void 0:e.status)||ue,me=!!(g!=null&&g.running),Te=(f==null?void 0:f.capabilities)||{},Fe=Ww(),Qe=i||(f==null?void 0:f.session_id)||"",Je=!(f!=null&&f.found),_t=(g==null?void 0:g.queued)||0,xs=((ze=f==null?void 0:f.unit_state)==null?void 0:ze.state)||"",an=(f==null?void 0:f.queue_state)||"",et=((qe=f==null?void 0:f.unit_state)==null?void 0:qe.pos)||0,Qt=((De=f==null?void 0:f.unit_state)==null?void 0:De.total)||0,Xt=u.useMemo(()=>an?{kind:an,pos:et,total:Qt}:null,[an,et,Qt]);u.useEffect(()=>{s&&s(Xt)},[Xt,s]);const Jt=t&&(f==null?void 0:f.card_column)||"";u.useEffect(()=>{o&&o(Jt)},[Jt,o]);const ft=!!(t&&(f==null?void 0:f.queue_state)==="answer_pending"),$t=!!Te.rewind,Vn=de||me||xs==="running"||_t>0||(((en=f==null?void 0:f.queue)==null?void 0:en.length)||0)>0||N;u.useEffect(()=>()=>clearTimeout(z.current),[]);const pn=t?t.projectId:e==null?void 0:e.project_id,rt=ie.find(M=>M.id===pn);u.useEffect(()=>{if(!(rt!=null&&rt.agent_path)||!pn)return;let M=!1;return Lt(Q=>Q.filter(he=>he.type!=="skill")),Pt.agentSkills(rt.agent_path,rt.project_dir||rt.work_dir||"").then(Q=>{if(M)return;const he=Array.isArray(Q)?Q:(Q==null?void 0:Q.skills)||[];Lt(fe=>[...fe.filter(Ne=>Ne.type!=="skill"),...he.map(Ne=>({key:Ne.name||Ne.id,label:Ne.name||Ne.id,desc:(Ne.description||Ne.summary||"").slice(0,40),type:"skill"}))])}).catch(()=>{}),()=>{M=!0}},[rt==null?void 0:rt.agent_path,pn]);const mn=[{key:"/stop",desc:"停止当前对话",type:"cmd",on:()=>!!Te.chat,run:ys},{key:"/compact",desc:"压缩会话历史",type:"cmd",on:()=>!!t&&!!Te.compact,run:async()=>{await Me.compact(c,d,i)}},{key:"/new",desc:"创建新会话",type:"cmd",dis:!0},{key:"/clear",desc:"清空并新建会话",type:"cmd",dis:!0},{key:"/plan",desc:"切换计划模式 开/关",type:"cmd",dis:!0},{key:"/swarm",desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行",type:"cmd",dis:!0},{key:"/goal",desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel",type:"cmd",dis:!0},{key:"/btw",desc:"侧边聊天:/btw <问题> 向 fork 的侧边聊天提问",type:"cmd",dis:!0},{key:"/undo",desc:"撤销上一条消息",type:"cmd",dis:!0}],Ts=mn.filter(M=>M.dis||M.on()),Zt=u.useMemo(()=>Uw(b,oe>=0?oe:b.length),[b,oe]),vs=Zt!=null&&!Ye,I=Zt?Zt.text.slice(1):"";u.useEffect(()=>{if(!a||t)return;let M=!1;m(null),h([]),w({running:!1}),Z([]),y(!1),tt.current=-1,Mt.current="";function Q(Ne){Ne.addEventListener("meta",$e=>{if(M)return;const it=JSON.parse($e.data);if(it.session_id&&Mt.current&&it.session_id!==Mt.current&&(tt.current=-1,h([])),it.session_id&&(Mt.current=it.session_id),it.found&&it.total<tt.current+1){fe();return}m(it)}),Ne.addEventListener("entries",$e=>{if(M)return;const it=JSON.parse($e.data);if(it.total<tt.current+1){fe();return}const yt=(it.entries||[]).filter(tn=>tn.seq>tt.current);yt.length&&(tt.current=yt[yt.length-1].seq,h(tn=>[...tn,...yt]),Z(tn=>tn.filter(wr=>!yt.some(Ms=>Ms.kind==="user"&&(Ms.text||"").includes(wr.text.slice(0,50))))))}),Ne.addEventListener("chat",$e=>{M||w(JSON.parse($e.data))}),Ne.onopen=()=>{M||y(!0)},Ne.onerror=()=>{M||y(!1)}}function he(){const Ne=Be.sessionStream(a,j);Pn.current=Ne,Q(Ne)}function fe(){tt.current=-1,h([]),Pn.current&&(Pn.current.close(),Pn.current=null),he()}return he(),()=>{M=!0,Pn.current&&(Pn.current.close(),Pn.current=null)}},[a,j]),u.useEffect(()=>{if(!i)return;let M=!1;m(null),h([]),w({running:!1}),Z([]),y(!1),tt.current=-1;let Q=null,he=setInterval(Ne,2e3);const fe=()=>{R.current||(R.current=setTimeout(()=>{R.current=null,Ne()},150))};ts.current=$e=>{if(!(!$e||Q)){clearInterval(he),he=setInterval(Ne,6e4);try{Q=Me.sessionStream(c,i),Q.addEventListener("hello",fe),Q.addEventListener("refresh",fe)}catch{Q=null}}};async function Ne(){try{const $e=await Me.sessionMessages(c,i,tt.current+1,j);if(M)return;if($e.found&&$e.total<tt.current+1){tt.current=-1,h([]);return}const it=($e.entries||[]).filter(yt=>yt.seq>tt.current);it.length&&(tt.current=it[it.length-1].seq,h(yt=>[...yt,...it]),Z(yt=>yt.filter(tn=>!it.some(wr=>wr.kind==="user"&&(wr.text||"").includes(tn.text.slice(0,50)))))),m(yt=>({found:$e.found,reason:$e.reason,agents:$e.agents,agent:$e.agent,total:$e.total,totals:$e.totals,session_id:i,capabilities:$e.capabilities,running:$e.running,interaction:$e.interaction,family:$e.family,ctx:$e.ctx,permission:$e.permission,sessionModel:$e.sessionModel,sessionEffort:$e.sessionEffort,unit_state:$e.unit_state,queue_state:$e.queue_state,project_busy:$e.project_busy,card_column:$e.card_column,answer_pending:$e.answer_pending,queue:$e.queue==null?yt==null?void 0:yt.queue:$e.queue})),w($e.chat||{running:!1}),y(!0)}catch{M||y(!1)}}return Ne(),()=>{M=!0,ts.current=null,clearInterval(he),R.current&&(clearTimeout(R.current),R.current=null);try{Q==null||Q.close()}catch{}}},[i,c,j]),u.useEffect(()=>{var M,Q;(Q=ts.current)==null||Q.call(ts,!!((M=f==null?void 0:f.capabilities)!=null&&M.events))},[(kt=f==null?void 0:f.capabilities)==null?void 0:kt.events,i]),u.useEffect(()=>{Rn.current=i},[i]);const H=u.useRef(new Set);u.useEffect(()=>{const M=((g==null?void 0:g.msgs)||[]).filter(Q=>Q.state==="error");if(M.length)for(const Q of M)H.current.has(Q.id)||(H.current.add(Q.id),T(`消息发送失败:${Q.error||"未知原因"}`),Q.id&&Z(he=>he.filter(fe=>fe.id!==Q.id)))},[g]),u.useEffect(()=>{if(ae(null),_e(null),A(null),!i)return;let M=!1;return rt!=null&&rt.agent_path?Pt.agentModels(rt.agent_path).then(Q=>{M||E(Q||{models:[],default:""})}).catch(()=>{M||E({models:[],default:""})}):E({models:[],default:""}),()=>{M=!0}},[i,rt==null?void 0:rt.agent_path]),u.useEffect(()=>{(f==null?void 0:f.permission)!=null&&ae(f.permission),f!=null&&f.sessionModel&&_e(f.sessionModel),f!=null&&f.sessionEffort&&A(f.sessionEffort)},[f==null?void 0:f.permission,f==null?void 0:f.sessionModel,f==null?void 0:f.sessionEffort]);const je=u.useMemo(()=>Ow(pe,ce||(f==null?void 0:f.sessionModel)||(pe==null?void 0:pe.default)||""),[pe,ce,f==null?void 0:f.sessionModel]),be=u.useCallback(()=>{const M=Un.current;Tt.current=M?M.scrollHeight-M.scrollTop-M.clientHeight<60:!0},[]),Le=u.useMemo(()=>{const M=[],Q=[],he=fe=>Q.some(Ne=>Ne&&fe&&Ne.slice(0,40)===fe.slice(0,40));for(const fe of(f==null?void 0:f.queue)||[])fe!=null&&fe.text&&(M.push({key:"k"+fe.id,text:fe.text,msgId:"",state:"server"}),Q.push(fe.text));for(const fe of(g==null?void 0:g.msgs)||[])fe.state==="error"||!fe.text||he(fe.text)||(M.push({key:"m"+fe.id,text:fe.text,msgId:fe.id,state:fe.state}),Q.push(fe.text));for(const fe of ke)!fe.text||he(fe.text)||(M.push({key:"p"+(fe.id||fe.ts),text:fe.text,msgId:fe.id||"",state:"pending"}),Q.push(fe.text));return M},[f==null?void 0:f.queue,g,ke]),Ce=u.useMemo(()=>p.filter(M=>M.kind==="user"&&(M.text||"").trim()).map(M=>({seq:M.seq,text:M.text.trim()})),[p]),St=u.useCallback(M=>We(M),[]),pt=u.useCallback(M=>{We(null),le(M),clearTimeout(Yt.current),Yt.current=setTimeout(()=>le(null),1600)},[]);function lt(){const M=U.current;if(!M)return;const Q=M.value.split(`
442
- `).length,he=M.value.length,[fe,Ne]=ne.current;Q===fe&&Math.abs(he-Ne)<40||(ne.current=[Q,he],M.style.height="auto",M.style.height=Math.min(M.scrollHeight,320)+"px")}async function q(M){const Q=Array.from(M||[]);if(!Q.length||we)return;const he=t?t.projectId:e==null?void 0:e.project_id;if(he)for(const fe of Q){if(fe.size>10*1024*1024){T(`附件过大(>10MB):${fe.name}`);continue}if(await qp(fe)){T(`已跳过占位图(极小尺寸):${fe.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}X(!0);try{const Ne=await new Promise((tn,wr)=>{const Ms=new FileReader;Ms.onload=()=>tn(String(Ms.result||"").split(",")[1]||""),Ms.onerror=()=>wr(new Error("文件读取失败")),Ms.readAsDataURL(fe)}),$e=await Me.uploadMedia(he,{name:fe.name,mime:fe.type||"application/octet-stream",data:Ne}),it=(fe.type||"").startsWith("image/")?`![${fe.name}](${$e.abs||$e.url})`:`[${fe.name}](${$e.abs||$e.url})`;Pe(tn=>[...tn,{md:it,url:Wp($e.url),abs:$e.abs,name:fe.name,mime:fe.type}]);const yt=U.current;if(yt&&document.activeElement===yt&&yt.selectionStart!=null){const tn=yt.selectionStart,wr=yt.selectionEnd;S(Ms=>Ms.slice(0,tn)+it+Ms.slice(wr)),requestAnimationFrame(()=>{yt.selectionStart=yt.selectionEnd=tn+it.length,Oe(tn+it.length)})}else S(tn=>(tn?tn+`
443
- `:"")+it+`
444
- `),Oe(-1);lt(),T(`已添加附件:${fe.name}`)}catch(Ne){T(Ne.message||"附件上传失败")}finally{X(!1)}}}function at(M){var fe;const he=Array.from(((fe=M.clipboardData)==null?void 0:fe.items)||[]).filter(Ne=>Ne.kind==="file").map(Ne=>Ne.getAsFile()).filter(Boolean);he.length&&(M.preventDefault(),q(he))}function Hn(M){var he;const Q=Array.from(((he=M.dataTransfer)==null?void 0:he.files)||[]);Q.length&&(M.preventDefault(),q(Q))}async function ns(){const M=b.trim();if(!(!M||N||Je)){if(/^\/[\w-]+$/.test(M)){const Q=mn.find(he=>he.key===M);if(Q){if(Q.dis||!(Q.on&&Q.on())){T(`当前环境不支持 ${M}`);return}S(""),Oe(0),requestAnimationFrame(lt);try{if(await Q.run()===!1)return;T(`已执行 ${M}`)}catch(he){T(he.message||`指令执行失败:${M}`)}return}}k(!0);try{if(t){const Q=await Me.addComment(c,d,M),he=await Me.sendComment(c,d,Q.id,!1,!0);he!=null&&he.queued&&Z(fe=>[...fe,{text:M,ts:Date.now(),id:he.msg_id||""}])}else{const Q=await Be.sessionChat(a,M);Q!=null&&Q.queued&&Z(he=>[...he,{text:M,ts:Date.now(),id:Q.msg_id||""}])}S(""),Tt.current=!0,requestAnimationFrame(lt)}catch(Q){T(Q.message)}finally{k(!1)}}}async function ys(){try{if(t){const M=await Me.stopCard(c,d);if(M&&M.stopped===!1)return T("该会话未在运行或无法停止"),!1}else await Be.sessionChatStop(a);return Z([]),!0}catch(M){return T(M.message),!1}}async function oo(M){if(!M||M===ge)return;const Q=i;try{if(await Me.setSessionProfile(c,Q,{permission_mode:M}),Q!==Rn.current)return;ae(M),T(`权限已切换:${(Rc.find(he=>he.value===M)||{}).label||M}`)}catch(he){Q===Rn.current&&T(he.message)}}async function lo(M){const Q=i;try{if(await Me.setSessionProfile(c,Q,{model:M}),Q!==Rn.current)return;_e(M),T(`模型已切换:${M}`)}catch(he){Q===Rn.current&&T(he.message)}}async function ao(M){if(!M||M==="__default__"||M===B)return;const Q=i;try{if(t?await Me.setSessionProfile(c,Q,{reasoning_effort:M}):await Be.sessionProfile(a,{reasoning_effort:M}),Q&&Q!==Rn.current)return;A(M),T(`思考等级已切换:${qR(M)}`)}catch(he){(!Q||Q===Rn.current)&&T(he.message)}}async function Ut(M){try{const Q=t?await Me.answerInteraction(c,d,M):await Be.answerInteraction(a,M);T(Q&&Q.queued?"已提交答案:项目忙,等待空闲后自动送达":"已回答")}catch(Q){T(Q.message)}}async function Tn(M){if(M!=null&&M.msgId){D(M.key);try{t?await Me.injectSessionMsg(c,i,M.msgId):await Be.sessionChatInject(a,M.msgId),T("已注入当前上下文"),Z(Q=>Q.filter(he=>he.id!==M.msgId))}catch(Q){T(Q.message)}finally{D("")}}}async function Bo(){K(!0);try{await Me.deliverAnswer(c,d),T("已送达答案")}catch(M){T(M.message)}finally{K(!1)}}async function ss(){G(!0);try{await Me.moveCard(c,d,"done"),T("已通过,卡片移入「已完成」"),l&&l()}catch(M){T(M.message)}finally{G(!1)}}const Qs=u.useCallback(M=>O(M||""),[]);function Wn(M){var fe;const Q=(M==null?void 0:M.text)||"";if(!Q.trim())return;const he=(fe=navigator.clipboard)==null?void 0:fe.writeText(Q);he&&he.catch&&he.catch(()=>T("复制失败:浏览器未授予剪贴板权限")),V(M.seq),clearTimeout(z.current),z.current=setTimeout(()=>V(null),1400)}async function ws(M){const Q=(M==null?void 0:M.mid)||"";if(!Q||L)return;const he=p.filter(Ne=>Ne.kind==="user"&&Ne.seq>=M.seq).length,fe=(M.text||"").trim().replace(/\s+/g," ").slice(0,60);if(window.confirm(`回退到该提问之前?
445
-
446
- 将撤销该提问及其后共 ${he} 轮对话:
447
- ${fe}${fe.length>=60?"…":""}
448
-
449
- 只回退对话上下文,不回退文件改动;此操作不可撤销。`)){Y(Q);try{const Ne=t?await Me.rewindSession(c,i,Q):await Be.sessionRewind(a,Q);Ne!=null&&Ne.new_session_id&&!Ne.rebound?(T(`已回退 ${he} 轮对话:历史已复制为新会话,正在切换`),onSwitchSession==null||onSwitchSession(Ne.new_session_id)):T(`已回退 ${he} 轮对话,原提问已回填输入框`),S(M.text||""),h($e=>$e.filter(it=>it.seq<M.seq)),tt.current=M.seq-1,lt()}catch(Ne){T(`回退失败:${(Ne==null?void 0:Ne.message)||"未知原因"}`)}finally{Y("")}}}function vr(M){S(Q=>Q.replace(M,""))}u.useEffect(()=>{const M=U.current;if(!M)return;const Q=()=>Oe(M.selectionStart??0),he=()=>{Oe(M.selectionStart??0),dt(!1)};return M.addEventListener("keyup",Q),M.addEventListener("click",he),()=>{M.removeEventListener("keyup",Q),M.removeEventListener("click",he)}},[Te.chat]);function Ga(M){var Q;S(M),Oe(((Q=U.current)==null?void 0:Q.selectionStart)??M.length),dt(!1),lt()}function Ka(M){if(!Zt)return;const Q=M.type==="skill"?`使用 skill「${M.label}」`:M.key;dt(!0),S(fe=>fe.slice(0,Zt.start)+Q+fe.slice(Zt.start+Zt.text.length));const he=Zt.start+Q.length;Oe(he),requestAnimationFrame(()=>{const fe=U.current;fe&&(fe.selectionStart=fe.selectionEnd=he)}),lt()}function Ya(M){T(`当前环境不支持 ${M.key}`)}const _=(f==null?void 0:f.agents)||[],re=f==null?void 0:f.totals,Se=re&&(f!=null&&f.found)?[`共 ${f.total} 条`,re.input?`↑${gl(re.input)}`:"",re.output?`↓${gl(re.output)}`:"",re.cache_read?`缓存 ${gl(re.cache_read)}`:"",Tf(re.duration_ms)].filter(Boolean).join(" · "):"";return r.jsxs("div",{className:"sess-view",children:[r.jsxs("div",{className:"sess-wrap",children:[r.jsx(RP,{withQBar:n,qbarOpen:gt,questions:Ce,flashSeq:jn,onJump:St}),r.jsxs("div",{className:"sess-main",children:[r.jsxs("div",{className:"sess-sub",children:[n&&r.jsx("button",{type:"button",className:"sess-qbar-toggle",title:gt?"收起提问索引":"展开提问索引",onClick:()=>fn(M=>!M),children:r.jsx(gN,{className:"h-3.5 w-3.5"})}),r.jsx("span",{className:"sess-conn"+(x?" on":""),title:x?"SSE 已连接(实时更新)":"连接中断,自动重连中…"}),(f==null?void 0:f.session_id)&&r.jsx("span",{className:"sess-chip mono",title:f.session_id,children:f.session_id.replace(/^session_/,"").slice(0,8)}),(f==null?void 0:f.model)&&r.jsx("span",{className:"sess-chip",children:f.model}),_.length>1&&r.jsx("span",{className:"sess-agents",children:_.map(M=>r.jsxs("button",{type:"button",className:"sess-agent"+(((f==null?void 0:f.agent)||j)===M.id?" on":""),onClick:()=>v(M.id),children:[M.id,M.type==="sub"?" (子)":""]},M.id))}),r.jsx("span",{style:{flex:1}}),!!(Fe!=null&&Fe.openSession)&&r.jsx(F,{size:"sm",variant:"ghost",className:"sess-open-dsh",title:Qe?"在 dsh 界面打开当前会话":"尚无会话",disabled:!Qe,onClick:()=>Hw(Qe),children:r.jsx(Fp,{className:"h-3.5 w-3.5"})}),t&&["doing","review"].includes(t.column)&&r.jsxs(F,{size:"sm",variant:"outline",className:"sess-pass",disabled:W,title:"通过:卡片移入「已完成」",onClick:ss,children:[r.jsx(Nl,{className:"h-3.5 w-3.5"})," 通过"]}),Se&&r.jsx("span",{className:"sess-totals",title:"输入 / 输出 / 缓存读取 / 总耗时",children:Se})]}),r.jsx(EP,{entries:p,metaNull:!f,found:!!(f!=null&&f.found),reason:f==null?void 0:f.reason,taskId:a,agent:(f==null?void 0:f.agent)||j,pid:t?c:pn,boardPid:t?c:"",boardSid:t?i:"",flashSeq:jn,chatRunning:me,exitCode:g==null?void 0:g.exit_code,boxRef:Un,atBottomRef:Tt,onScroll:be,jumpSeq:J,onJumpHandled:pt,rwEnabled:$t,rwBusy:Vn,rewindingMid:L,copiedSeq:te,onCopy:Wn,onRewind:ws,onOpenPath:Qs}),((yr=f==null?void 0:f.interaction)==null?void 0:yr.pending)&&r.jsx(PP,{data:f.interaction,answer:Ut}),Te.chat&&r.jsx(HR,{value:b,onChange:Ga,atts:Re,onRemoveAtt:vr,uploading:we,inputLocked:Je,caps:Te,meta:f,onSend:ns,onStop:ys,chatRunning:me,taskRunning:de,queuedN:_t,board:t,sending:N,permMode:ge,modelSel:ce,modelOpts:pe,onSetModel:lo,onSetPermission:oo,effortSel:B,effortOpts:je,onSetEffort:ao,queueRows:Le,injecting:P,onInject:Tn,answerPending:ft,deliveringAnswer:$,onDeliverAnswer:Bo,slashOpen:vs,slashQuery:I,slashItems:[...Ts,...st],onSlashSelect:Ka,onSlashClose:()=>dt(!0),onSlashDisabled:Ya,onPasteFiles:at,onDropFiles:Hn,onUploadFiles:q,taRef:U})]})]}),C&&(t?c:pn)&&r.jsx(mP,{pid:t?c:pn,path:C,onClose:()=>O("")})]})}const TP={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function MP({column:e}){const t=TP[e];return t?r.jsx("span",{className:"sess-colstate",title:"卡片当前所在列(看板队列)",children:t}):null}const $P={running:"该会话所属任务/卡片正在运行",starting:"卡片已交平台启动,等待会话证实运行(启动中)",answer_pending:"答案已被平台收下,等项目空闲送达",interaction_pending:"agent 向用户提问挂起,等待作答",server_queued:"消息已在 agent 服务端队列排队",foreign_busy:"项目被外部同步会话占用,等其结束后按队列补位"};function IP({state:e}){if(!e||!e.kind)return null;const t=e.kind,n=e.pos||0,s=e.total||0;if(t==="idle")return r.jsxs("span",{className:"sess-qstate",title:"不在统一队列中(既未排队也无运行中的单元)",children:[r.jsx("span",{className:"dot"}),"空闲"]});const o=(t==="queued_serial"||t==="answer_pending")&&n>0,l=pf[t]||t,a=o?`统一队列排队中:本项目前面还有 ${Math.max(0,n-1)} 个单元(本项目排队 ${s} 个)`:$P[t]||"";return r.jsxs("span",{className:b0(t,"sess"),title:a,children:[r.jsx("span",{className:"dot"}),l,o?` · 第 ${n} 位`:""]})}function Pc({task:e,board:t,onClose:n,onSwitchSession:s}){const o=!!e||!!t,{rzOn:l,rzStyle:a,rzStart:i,rzDragStart:c,rzReset:d}=sr("ts.sessW"),[f,m]=u.useState(null),[p,h]=u.useState("");return u.useEffect(()=>{o||(m(null),h(""))},[o]),r.jsx(on,{open:o,onOpenChange:g=>{g||n()},children:r.jsxs(qt,{className:"modal modal-rz sess-modal w-[75vw] h-[90vh] sm:max-w-[94vw] grid-rows-[auto_minmax(0,1fr)]"+(l?" rz-drag":""),style:{...a,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:i,reset:d}),r.jsx(Gt,{className:"text-left",children:r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsxs(Kt,{className:"cursor-move select-none text-sm",onMouseDown:c,children:["会话 · ",(e==null?void 0:e.name)||(t==null?void 0:t.title)||(t==null?void 0:t.sid)]}),r.jsx(MP,{column:p}),r.jsx(IP,{state:f})]})}),e&&r.jsx(Mf,{task:e,onUnitState:m}),t&&r.jsx(Mf,{board:t,onUnitState:m,onCardColumn:h,onPassed:n,onSwitchSession:s})]})})}const ds=u.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{ref:n,"data-slot":"textarea",className:Ve("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t}));ds.displayName="Textarea";function dm({className:e,...t}){return r.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:r.jsx("table",{"data-slot":"table",className:Ve("w-full caption-bottom text-sm",e),...t})})}function fm({className:e,...t}){return r.jsx("thead",{"data-slot":"table-header",className:Ve("[&_tr]:border-b",e),...t})}function pm({className:e,...t}){return r.jsx("tbody",{"data-slot":"table-body",className:Ve("[&_tr:last-child]:border-0",e),...t})}function jo({className:e,...t}){return r.jsx("tr",{"data-slot":"table-row",className:Ve("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function _n({className:e,...t}){return r.jsx("th",{"data-slot":"table-head",className:Ve("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function vn({className:e,...t}){return r.jsx("td",{"data-slot":"table-cell",className:Ve("p-2 align-middle whitespace-nowrap",e),...t})}const AP={rounds:"达到轮数后自动停止(每轮由 agent 执行一次内置测试流程)",bugs:"案例库新增 bug_report 数达到后自动停止",deadline:"到达截止时间后结束本轮并停止(日历点选日期与时间)",duration:"运行达到设定时长后停止(每轮结束后检查;一轮进行中不打断)"},Wg=["stopped","failed","interrupted"],qg={name:"",task_type:"normal",brief:"",end_stage:"report",auto_fix:!1,retest:"不复测",stop_type:"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min",extra:"",date_from:"",date_to:""};function OP(e){return e.stop_type==="deadline"?e.deadline_date?{value:e.deadline_date+"T"+(e.deadline_time||"23:59")}:{err:"请选择截止日期"}:e.stop_type==="duration"?!e.dur_value||e.dur_value<=0?{err:"请填写时长"}:{value:String(Math.round(e.dur_value*{min:60,hour:3600,day:86400}[e.dur_unit]))}:e.stop_value?{value:String(e.stop_value)}:{err:"请填写停止条件"}}function LP(e){const t={stop_type:e.stop_type||"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min"};if(t.stop_type==="deadline"){const[n,s]=String(e.stop_value||"").split("T");t.deadline_date=n||"",t.deadline_time=s||"23:59"}else if(t.stop_type==="duration"){const n=+e.stop_value||0;n%86400===0&&n?(t.dur_value=n/86400,t.dur_unit="day"):n%3600===0&&n?(t.dur_value=n/3600,t.dur_unit="hour"):(t.dur_value=Math.max(1,Math.round(n/60)),t.dur_unit="min")}return t}const Gg={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},$f=[{v:"gen_case",label:"测试用例生成"},{v:"execute",label:"测试"},{v:"report",label:"生成报告"},{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],Ni={normal:$f,regression:$f.filter(e=>e.v!=="gen_case")},rd=e=>($f.find(t=>t.v===e)||{}).label||"",zP={rounds:"执行轮数",bugs:"累计新 bug",deadline:"截止时间",duration:"持续时长"},DP={queued:0,running:1,done:2,stopped:3,failed:4,interrupted:5},FP=[{k:"name",label:"任务"},{k:"status",label:"状态"},{k:"round",label:"轮次",cls:"num"},{k:"bugs",label:"新bug",cls:"num"},{k:"created",label:"创建"},{k:"ended",label:"结束"}];function BP(e){const t=e.stop_value||"";return e.stop_type==="rounds"?`执行 ${t} 轮`:e.stop_type==="bugs"?`累计新 bug ≥ ${t}`:e.stop_type==="deadline"?`截止 ${String(t).replace("T"," ")}`:e.stop_type==="duration"?`持续 ${UP(t)}`:e.stop_type}function UP(e){const t=+e;return!t||t<=0?String(e||""):t%86400===0?t/86400+" 天":t%3600===0?t/3600+" 小时":t%60===0?t/60+" 分钟":t+" 秒"}function VP({onCreated:e}={}){const t=$n(),n=t.currentProject,[s,o]=u.useState(qg),[l,a]=u.useState(!1),[i,c]=u.useState(null),[d,f]=u.useState(!1),[m,p]=u.useState(""),[h,g]=u.useState(null),[w,j]=u.useState(1),[v,x]=u.useState(null),[y,b]=u.useState(null),[S,N]=u.useState([]),[k,C]=u.useState(null),O=t.tasks.find(E=>E.id===k)||null,{rzOn:P,rzStyle:D,rzStart:W,rzDragStart:G,rzReset:$}=sr(),[K,te]=u.useState(""),V=t.tasks.filter(E=>E.project_id===(n==null?void 0:n.id)),L=u.useMemo(()=>{const E=K.trim().toLowerCase();return E?V.filter(B=>(B.name||"").toLowerCase().includes(E)||(B.session_title||"").toLowerCase().includes(E)||(B.session_id||"").toLowerCase().includes(E)):V},[V,K]),Y=u.useMemo(()=>{if(!h)return L;const E=B=>{switch(h){case"status":return DP[B.status]??99;case"round":return B.current_round??0;case"bugs":return B.new_bugs??0;case"created":return B.created_at||"";case"ended":return B.ended_at||"";default:return B.name||""}};return[...V].sort((B,A)=>{const ie=E(B),oe=E(A);return ie===oe?0:ie===""||ie==null?1:oe===""||oe==null?-1:ie<oe?-w:w})},[L,h,w]);function z(E){h!==E?(g(E),j(1)):w===1?j(-1):(g(null),j(1))}async function we(){try{await t.updateProject(n.id,{guide_text:m}),f(!1),T("项目提示词已保存")}catch(E){T(E.message)}}async function X(){if(!i&&s.task_type==="regression"&&!s.extra.trim()){T("请填写重跑指令");return}if(!i&&s.task_type==="retest_bug"&&!s.date_from&&!s.date_to){T("复测任务需填写提交日期范围");return}if(s.date_from&&s.date_to&&s.date_from>s.date_to){T("日期范围不正确:起始晚于结束");return}const E=!i&&s.task_type==="stress"?{value:"1"}:OP(s);if(E.err){T(E.err);return}const B={name:s.name,task_type:s.task_type,brief:s.brief.trim(),end_stage:s.end_stage||void 0,auto_fix:s.auto_fix,retest:s.retest,stop_type:s.stop_type,stop_value:E.value,extra:s.extra.trim(),date_from:s.date_from||void 0,date_to:s.date_to||void 0};try{i?(await Be.continue(i.id,B),T("已入队,接着原会话续跑")):(await Be.create(n.id,B),T("任务已入队"),s.task_type==="stress"&&(e==null||e("stress"))),o({...s,name:"",brief:"",extra:""}),a(!1),c(null),await t.loadTasks()}catch(A){T(A.message)}}async function Re(E){if(window.confirm(`确认删除任务「${E.name}」?
450
- 轮次记录一并删除(日志文件保留在磁盘),该操作不可恢复。`))try{await Be.remove(E.id),T("任务已删除"),v===E.id&&pe(),k===E.id&&C(null),await t.loadTasks()}catch(B){T(B.message)}}async function Pe(E,B){try{await Be[B](E),T(B==="stop"?"已请求停止":"已清空轮次重启入队(从第一轮重跑)"),await t.loadTasks(),v===E&&await Z(E)}catch(A){T(A.message)}}async function ke(E){if(v===E){pe();return}try{const B=await Be.get(E);b(B),x(E),await ge(E)}catch(B){T(B.message)}}async function Z(E){try{b(await Be.get(E)),await ge(E)}catch(B){T(B.message)}}async function ge(E){N(await Be.rounds(E))}function ae(E,B){window.open(`/log?task=${E}&round=${B}`,"_blank")}function ce(){o({...qg}),c(null),a(!0)}function _e(E){const B=LP(E);o({name:E.name,task_type:E.task_type||"normal",brief:"",end_stage:E.end_stage||"",auto_fix:!!E.auto_fix,retest:E.retest||"不复测",stop_type:B.stop_type,stop_value:B.stop_value,deadline_date:B.deadline_date,deadline_time:B.deadline_time,dur_value:B.dur_value,dur_unit:B.dur_unit,extra:E.extra||""}),c(E),a(!0)}function pe(){x(null),b(null),N([])}return r.jsxs("div",{className:"tasks-tab scroll",children:[n&&r.jsxs("div",{className:"card",children:[r.jsx("h3",{children:"项目信息"}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"项目目录"}),r.jsx("span",{className:"v",children:n.project_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"智能体"}),r.jsx("span",{className:"v",children:(n.agent_path||"").startsWith("dsh-plugin:")?`dsh(插件·进程内) ${n.agent_path.slice(11)}`:n.agent_path||"(未设置)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:n.model||"(智能体默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"工作目录"}),r.jsx("span",{className:"v",children:n.work_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"环境标签"}),r.jsx("span",{className:"v",children:n.env_label||"(未设置)"})]}),r.jsxs("div",{className:"guide-block",children:[r.jsxs("div",{className:"guide-head",children:[r.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"项目附加提示词"}),r.jsx("span",{className:"hint",children:"编辑后保存;内容会加入每个任务的提示词"}),r.jsx("span",{className:"spacer"}),d?r.jsxs(r.Fragment,{children:[r.jsxs(F,{size:"sm",onClick:we,children:[r.jsx(ON,{})," 保存"]}),r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>f(!1),children:[r.jsx(Co,{})," 取消"]})]}):r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>{p(n.guide_text||""),f(!0)},children:[r.jsx(Vp,{})," 编辑"]})]}),d?r.jsx(ds,{value:m,onChange:E=>p(E.target.value),rows:4,placeholder:"填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息…"}):r.jsx("div",{className:"guide-read"+(n.guide_text?"":" empty"),children:n.guide_text||"未填写项目附加提示词。点击「编辑」填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息;内容会加入每个任务的提示词。"})]})]}),n&&r.jsxs("div",{className:"card",children:[r.jsxs("h3",{className:"card-title-row",children:["任务列表",r.jsx("span",{className:"spacer"}),r.jsx(Ie,{className:"h-8 w-[240px]",placeholder:"搜索任务名称 / session id",value:K,onChange:E=>te(E.target.value)}),r.jsxs(F,{size:"sm",className:"ml-2",onClick:ce,children:[r.jsx(Va,{})," 新建任务"]})]}),V.length?L.length?r.jsxs("div",{className:"tl",children:[r.jsxs("div",{className:"tl-head tl-grid",children:[FP.map(E=>r.jsxs("span",{className:"th-sort"+(E.cls?" "+E.cls:"")+(h===E.k?" on":""),onClick:()=>z(E.k),title:"点击排序:升序 → 降序 → 还原",children:[E.label,h===E.k&&(w===1?r.jsx(_c,{className:"inline h-3 w-3"}):r.jsx(Cl,{className:"inline h-3 w-3"}))]},E.k)),r.jsx("span",{className:"tl-ops",children:"操作"})]}),Y.map(E=>r.jsxs("div",{children:[r.jsxs("div",{className:"tl-row tl-grid"+(v===E.id?" open":""),onClick:()=>ke(E.id),title:v===E.id?"收起详情":"点击查看详情",children:[r.jsxs("div",{className:"tl-name",children:[E.name,E.task_type!=="normal"&&r.jsx("span",{className:"badge st-running",style:{verticalAlign:-2},children:Gg[E.task_type]||E.task_type}),E.task_type==="fix"&&(E.auto_commit||E.auto_deploy||E.auto_retest)&&r.jsxs("span",{className:"badge st-stopped",style:{verticalAlign:-2},children:[E.auto_commit?"自动提交":"",E.auto_commit&&E.auto_deploy?"/":"",E.auto_deploy?"自动部署":"",E.auto_deploy&&E.auto_retest?"/":"",E.auto_retest?"自动复测":""]}),E.error&&r.jsx("div",{className:"tl-err",children:E.error})]}),r.jsx("div",{children:r.jsxs("span",{className:"badge st-"+E.status,children:[r.jsx("span",{className:"dot"}),lr[E.status]||E.status]})}),r.jsx("div",{className:"mono num",children:E.current_round}),r.jsx("div",{className:"mono num",children:E.new_bugs}),r.jsx("div",{className:"mono",children:rs(E.created_at)}),r.jsx("div",{className:"mono",children:rs(E.ended_at)}),r.jsxs("div",{className:"tl-ops",children:[r.jsx(F,{variant:"outline",size:"sm",className:"px-2",title:"会话(查看原始对话内容,可直接在会话中继续对话)",onClick:B=>{B.stopPropagation(),C(E.id)},children:r.jsx(NN,{})}),(E.status==="running"||E.status==="queued")&&r.jsxs(F,{variant:"outline",size:"sm",onClick:B=>{B.stopPropagation(),Pe(E.id,"stop")},children:[r.jsx(Hp,{})," 停止"]}),E.task_type!=="stress"&&["stopped","failed","interrupted","done"].includes(E.status)&&r.jsxs(F,{variant:"outline",size:"sm",title:"继续:修改参数后接着当前会话续跑(不新建会话、不清空轮次)",onClick:B=>{B.stopPropagation(),_e(E)},children:[r.jsx(WN,{})," 继续"]}),(Wg.includes(E.status)||E.task_type==="stress"&&E.status==="done")&&r.jsxs(F,{variant:"outline",size:"sm",onClick:B=>{B.stopPropagation(),Pe(E.id,"restart")},children:[r.jsx(df,{})," 重启"]}),E.status!=="running"&&r.jsx(F,{variant:"outline",size:"sm",className:"px-2",title:"删除任务(轮次记录一并删除,不可恢复)",onClick:B=>{B.stopPropagation(),Re(E)},children:r.jsx(qs,{})})]})]}),v===E.id&&y&&r.jsxs("div",{className:"tl-detail",children:[r.jsxs("div",{className:"tl-detail-head",children:[r.jsx("b",{children:"任务详情"}),r.jsxs("span",{className:"dim",children:["「",y.name,"」"]}),r.jsx("span",{className:"spacer"}),r.jsxs(F,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:()=>Z(E.id),children:[r.jsx(Pa,{})," 刷新"]}),r.jsxs(F,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:pe,children:[r.jsx(Co,{})," 收起"]})]}),r.jsxs("div",{className:"detail-grid",children:[r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"状态"}),r.jsx("span",{className:"v",children:r.jsxs("span",{className:"badge st-"+y.status,children:[r.jsx("span",{className:"dot"}),lr[y.status]||y.status]})})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"任务类型"}),r.jsx("span",{className:"v",children:Gg[y.task_type]||y.task_type})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"阶段范围"}),r.jsx("span",{className:"v",children:y.start_stage?`${rd(y.start_stage)} → ${rd(y.end_stage)||y.end_stage}`:"(按类型默认)"})]}),y.task_type==="pipeline"&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"前段任务"}),r.jsxs("span",{className:"v",children:["#",(()=>{try{return JSON.parse(y.payload||"{}").parent_task_id||"?"}catch{return"?"}})()]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"停止条件"}),r.jsxs("span",{className:"v",children:[zP[y.stop_type]||y.stop_type," · ",BP(y)]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动修复"}),r.jsx("span",{className:"v",children:y.auto_fix?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"复测"}),r.jsx("span",{className:"v",children:y.retest||"不复测"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:y.model||"(默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"权限"}),r.jsx("span",{className:"v",children:y.permission||"(CLI 默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动提交"}),r.jsx("span",{className:"v",children:y.auto_commit?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动部署"}),r.jsx("span",{className:"v",children:y.auto_deploy?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动复测"}),r.jsx("span",{className:"v",children:y.auto_retest?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话 ID"}),r.jsx("span",{className:"v",children:y.session_id||"(首轮后生成)"})]}),y.session_title&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话标题"}),r.jsx("span",{className:"v",children:y.session_title})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"创建时间"}),r.jsx("span",{className:"v",children:rs(y.created_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"开始时间"}),r.jsx("span",{className:"v",children:rs(y.started_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"结束时间"}),r.jsx("span",{className:"v",children:rs(y.ended_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"当前轮次"}),r.jsx("span",{className:"v",children:y.current_round})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增案例"}),r.jsxs("span",{className:"v",style:{color:"var(--pass)"},children:["+",y.new_cases??0]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增 bug"}),r.jsx("span",{className:"v",children:y.new_bugs})]})]}),y.error&&r.jsxs("div",{className:"detail-err",children:["错误:",y.error]}),y.extra&&r.jsxs("div",{className:"kv",style:{marginTop:8},children:[r.jsx("span",{className:"k",children:"其他要求"}),r.jsx("span",{className:"v",style:{fontFamily:"inherit",color:"var(--muted)",whiteSpace:"pre-wrap"},children:y.extra})]}),(Wg.includes(y.status)||y.task_type==="stress"&&y.status==="done")&&r.jsx("div",{className:"form-row",style:{marginTop:8},children:r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>Pe(y.id,"restart"),children:[r.jsx(df,{})," 重启任务(清空轮次,从第一轮重跑)"]})}),r.jsxs(dm,{className:"mt-2.5 text-xs",children:[r.jsx(fm,{children:r.jsxs(jo,{className:"hover:bg-transparent",children:[r.jsx(_n,{className:"px-2",children:"轮次"}),r.jsx(_n,{className:"px-2",children:"状态"}),r.jsx(_n,{className:"px-2",children:"退出码"}),r.jsx(_n,{className:"px-2",children:"开始"}),r.jsx(_n,{className:"px-2",children:"结束"}),r.jsx(_n,{className:"px-2",children:"日志"})]})}),r.jsxs(pm,{children:[S.map(B=>r.jsxs(jo,{className:"cursor-pointer",title:"新标签页查看日志",onClick:()=>ae(y.id,B.round_no),children:[r.jsx(vn,{className:"px-2",children:B.round_no}),r.jsx(vn,{className:"px-2",children:B.status}),r.jsx(vn,{className:"px-2 font-mono",children:B.exit_code==null?"—":B.exit_code}),r.jsx(vn,{className:"px-2 font-mono text-xs",children:rs(B.started_at)}),r.jsx(vn,{className:"px-2 font-mono text-xs",children:rs(B.ended_at)}),r.jsx(vn,{className:"px-2 text-primary",children:"查看日志"})]},B.round_no)),!S.length&&r.jsx(jo,{children:r.jsx(vn,{colSpan:6,className:"px-2 text-muted-foreground",children:"尚未执行轮次"})})]})]})]})]},E.id))]}):r.jsxs("div",{className:"hint",children:["没有匹配「",K.trim(),"」的任务"]}):r.jsx("div",{className:"hint",children:"暂无任务,点击右上角「新建任务」创建"})]}),n&&r.jsx(on,{open:l,onOpenChange:E=>{a(E),E||c(null)},children:r.jsxs(qt,{className:"modal modal-rz"+(P?" rz-drag":""),style:{...D,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:W,reset:$}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:G,children:i?`继续任务「${i.name}」`:"新建任务"})}),i&&r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"接着当前会话继续执行(不新建会话、历史轮次保留);停止条件中的轮数/bug 数指「再跑/再增」的数量"}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务名称"}),r.jsx(Ie,{value:s.name,onChange:E=>o({...s,name:E.target.value.trim()}),placeholder:"留空自动命名"})]}),!i&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务类型"}),r.jsxs(It,{value:s.task_type,onValueChange:E=>o(B=>{const A={...B,task_type:E},ie=Ni[E];return ie&&!ie.some(oe=>oe.v===A.end_stage)&&(A.end_stage="report"),A}),children:[r.jsx(Et,{size:"sm",className:"min-w-[120px]",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"normal",children:"探索"}),r.jsx(Ae,{value:"regression",children:"回归"}),r.jsx(Ae,{value:"retest_bug",children:"复测(按提交范围)"}),r.jsx(Ae,{value:"stress",children:"压力测试"})]})]})]}),!i&&(s.task_type==="retest_bug"||s.task_type==="normal")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"提交日期范围"}),r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.date_from,onChange:E=>o({...s,date_from:E.target.value})}),r.jsx("span",{className:"hint",children:"至"}),r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.date_to,onChange:E=>o({...s,date_to:E.target.value})}),r.jsx("span",{className:"hint",children:s.task_type==="retest_bug"?"LLM 分析范围内提交影响的用例并执行复测(必填)":"本轮优先设计/执行与该范围提交相关的用例(选填)"})]}),!i&&Ni[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(It,{value:s.end_stage,onValueChange:E=>o({...s,end_stage:E}),children:[r.jsx(Et,{size:"sm",className:"min-w-[120px]",children:r.jsx(Ct,{})}),r.jsx(Rt,{children:Ni[s.task_type].map(E=>r.jsx(Ae,{value:E.v,children:E.label},E.v))})]}),r.jsx("span",{className:"hint",children:"任务执行到该阶段为止;终点在「生成报告」之后会自动追加一个后段任务"})]}),i&&Ni[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsx("span",{className:"hint",children:rd(s.end_stage)||"(按类型默认)"})]}),s.task_type==="stress"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"压测任务固定两步:第 1 轮 agent 生成压测场景 → 平台自动发压并出报告;生命周期:测试 → 生成报告。不支持「继续」,重启=重跑。"}),r.jsxs("div",{className:"form-col",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:"压测说明(目标服务地址、关注接口、并发/时长期望)"}),r.jsx(ds,{value:s.brief,onChange:E=>o({...s,brief:E.target.value}),rows:4,placeholder:"例如:目标 http://127.0.0.1:8080,压 /api/order 下单与 /api/order/123 查询,按 10→50→100 并发各 1 分钟"})]})]}),!i&&(s.task_type==="normal"||s.task_type==="regression")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试任务行为:测试中发现的 bug 由 agent 自动修复代码",children:"自动修复 bug"}),r.jsx("input",{type:"checkbox",checked:s.auto_fix,onChange:E=>o({...s,auto_fix:E.target.checked})}),r.jsx("label",{style:{marginLeft:14},children:"复测"}),r.jsxs(It,{value:s.retest,onValueChange:E=>o({...s,retest:E}),children:[r.jsx(Et,{size:"sm",className:"min-w-[130px]",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"不复测",children:"不复测"}),r.jsx(Ae,{value:"全部失败用例",children:"全部失败用例"}),r.jsx(Ae,{value:"指定范围复测",children:"指定范围复测"})]})]})]}),s.task_type!=="stress"&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"停止条件"}),r.jsxs(It,{value:s.stop_type,onValueChange:E=>o({...s,stop_type:E}),children:[r.jsx(Et,{size:"sm",className:"min-w-[120px]",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"rounds",children:"执行轮数"}),r.jsx(Ae,{value:"bugs",children:"累计新 bug 数"}),r.jsx(Ae,{value:"deadline",children:"截止时间"}),r.jsx(Ae,{value:"duration",children:"持续时长"})]})]}),(s.stop_type==="rounds"||s.stop_type==="bugs")&&r.jsx(Ie,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.stop_value,onChange:E=>o({...s,stop_value:E.target.value===""?"":+E.target.value})}),s.stop_type==="deadline"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.deadline_date,onChange:E=>o({...s,deadline_date:E.target.value})}),r.jsx(Ie,{type:"time",className:"h-8 w-[110px]",value:s.deadline_time,onChange:E=>o({...s,deadline_time:E.target.value})})]}),s.stop_type==="duration"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.dur_value,onChange:E=>o({...s,dur_value:E.target.value===""?"":+E.target.value})}),r.jsxs(It,{value:s.dur_unit,onValueChange:E=>o({...s,dur_unit:E}),children:[r.jsx(Et,{size:"sm",className:"min-w-[70px]",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"min",children:"分钟"}),r.jsx(Ae,{value:"hour",children:"小时"}),r.jsx(Ae,{value:"day",children:"天"})]})]})]}),r.jsx("span",{className:"hint",children:AP[s.stop_type]||""})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:!i&&s.task_type==="regression"?"重跑指令(必填:描述要重跑的范围,如模块 / 用例 ID / 变更说明)":"其他要求(选填,原样传给 agent)"}),r.jsx(ds,{value:s.extra,onChange:E=>o({...s,extra:E.target.value}),rows:3,placeholder:!i&&s.task_type==="regression"?"例如:重跑登录模块全部用例;或:本次变更涉及订单接口,重跑 ORD-003、ORD-004":"自由填写,例如:本轮优先测试订单模块;只读代码,不要提出修复方案;执行前先阅读 src/X 目录……"})]})]}),r.jsxs(kn,{className:"flex-none",children:[r.jsx(F,{variant:"outline",onClick:()=>{a(!1),c(null)},children:"取消"}),r.jsx(F,{onClick:X,children:i?"继续执行":"开始任务"})]})]})}),O&&r.jsx(Pc,{task:O,onClose:()=>C(null)})]})}let Sr=null,Ci=null,Ei=null;function Ri(e,t){if(e==null||t==null||e===t)return t;try{return JSON.stringify(t)===JSON.stringify(e)?e:t}catch{return t}}function Kg(e,t){const n=zs.getState();t({project:e.project||n.project,live:Ri(n.live,e.live),library:Ri(n.library,e.library),bugs:Ri(n.bugs,e.bugs||[]),rounds:Ri(n.rounds,e.rounds||[]),updatedAt:e.generated_at||""})}const zs=Ip((e,t)=>({connected:!1,project:null,live:null,library:null,bugs:[],rounds:[],updatedAt:"",connect:async n=>{Sr&&Ei===n||(t().disconnect(),Ei=n,Sr=Qh.stream(n),Sr.onopen=()=>e({connected:!0}),Sr.onerror=()=>e({connected:!1}),Sr.onmessage=s=>{try{const o=JSON.parse(s.data);if(o.error)return;Kg(o,e)}catch{}},Ci=setInterval(()=>t().fetchSnapshot(),3e4),await t().fetchSnapshot())},fetchSnapshot:async()=>{try{const n=await Qh.state(Ei);n&&!n.error&&Kg(n,e)}catch{}},disconnect:()=>{Sr&&(Sr.close(),Sr=null),Ci&&(clearInterval(Ci),Ci=null),Ei=null,e({connected:!1})}}));function If(e){return/已拒绝/.test(e)?"reject":/复测通过/.test(e)?"pass":/已修复/.test(e)?"fix":/已分析/.test(e)||/修复方案/.test(e)?"run":/待分析/.test(e)||/复测未通过/.test(e)?"retest":"pending"}const Yg=[["retest","R","复测"],["angle","1","角度"],["scan","2","盘点"],["generate","3","生成"],["review","4","判重"],["execute","5","执行"],["cluster","6","聚类"],["analyze","7","分析"],["fix","7b","修复"],["wrapup","8","收尾"]],HP={通过:"pass",失败:"fail",需要复测:"retest",跳过:"skip",未执行:"pending"},WP={round_start:["轮次","ev-round"],phase:["阶段","ev-phase"],proposal:["提案",""],reject:["拒绝","ev-reject"],case_start:["开始",""],case_pass:["通过","ev-pass"],case_fail:["失败","ev-fail"],case_skip:["跳过",""],bug_new:["新Bug","ev-bug"],bug_append:["补证据","ev-bug"],analyze_done:["分析","ev-fix"],fix_done:["修复","ev-fix"],note:["备注",""]},qP={all:null,fail:e=>e.type==="case_fail"||e.type==="bug_new",case:e=>e.type.startsWith("case_"),phase:e=>e.type==="phase"||e.type==="round_start",bug:e=>e.type==="bug_new"||e.type==="bug_append"||e.type==="analyze_done"||e.type==="fix_done"},GP={all:"全部",fail:"失败",case:"用例",phase:"阶段",bug:"Bug"},KP=["all","fail","case","phase","bug"],ta=["status","module","trend","bug","funnel"],YP={status:{title:"案例库状态"},module:{title:"模块通过率"},trend:{title:"轮次趋势"},bug:{title:"Bug 统计"},funnel:{title:"产出漏斗"}},Qg=[["pending","待处理","var(--dim)"],["run","已出方案","var(--run)"],["retest","待分析/复测未过","var(--retest)"],["fix","已修复","var(--fix)"],["pass","复测通过","var(--pass)"],["reject","已拒绝","var(--dim)"]],qw="ts.chartSlots";function QP(){try{const e=JSON.parse(localStorage.getItem(qw)||"null");if(Array.isArray(e)&&e.length===3&&e.every(t=>ta.includes(t))&&new Set(e).size===3)return e}catch{}return["status","module","trend"]}const fo={tree:"ts.treeW",side:"ts.sideW",chartsH:"ts.chartsH",c1:"ts.c1w",c2:"ts.c2w"},Os={tree:"tree",side:"side",chartsH:"chartsH",c1:"c1",c2:"c2"},ct=e=>String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),od=e=>HP[e]||"pending",XP=e=>{const t=new Date(String(e).replace(" ","T"));return isNaN(t)?null:t},JP=e=>{const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60);return(n?n+"h":"")+(s?s+"m":"")+t%60+"s"},Pi=(e,t,n)=>Math.max(t,Math.min(n,e));function ZP({project:e}){var ts;const t=e==null?void 0:e.id,n=zs(R=>R.connected),s=zs(R=>R.live),o=zs(R=>R.library),l=zs(R=>R.bugs),a=zs(R=>R.rounds),i=zs(R=>R.updatedAt),c=u.useRef(null),d=u.useRef(null),f=u.useRef(null),m=u.useRef(null),p=u.useRef(null),[h,g]=u.useState(null),[w,j]=u.useState("all"),[v,x]=u.useState(!0),[y,b]=u.useState(QP);function S(R,U){b(ne=>{const ue=new Set(ne.filter((Te,Fe)=>Fe!==R));let de=ne[R];do de=ta[(ta.indexOf(de)+U+ta.length)%ta.length];while(ue.has(de));const me=[...ne];return me[R]=de,localStorage.setItem(qw,JSON.stringify(me)),me})}const[N,k]=u.useState(()=>new Set),[C,O]=u.useState(""),P=u.useRef({}),D=u.useRef(null),W=u.useRef(null),G=u.useRef(0),$=u.useRef(""),K=u.useRef("all"),te=u.useRef(!1),V=!!(s&&s.phase&&s.phase!=="done"&&s.phase!=="idle"),L=Yg.findIndex(R=>R[0]===(s==null?void 0:s.phase)),Y=(s==null?void 0:s.phase)==="done",z=s?s.phase==="done"?{cls:"done",text:"本轮运行已结束"}:{cls:"running",text:s.phase_label||s.phase||"运行中"}:{cls:"idle",text:"空闲(未在运行)"},we=(()=>{const R=s==null?void 0:s.stop_condition;return R!=null&&R.label?"停止条件: "+R.label+(R.new_bugs!=null?" · 新Bug "+R.new_bugs:"")+(R.target_bugs!=null?"/"+R.target_bugs:""):""})(),X=n?"":"down";function Re(R){let U=R.cases.length;for(const ne of R.children)U+=Re(ne);return U}const Pe=(ts=s==null?void 0:s.current_case)==null?void 0:ts.id,ke=u.useMemo(()=>{const R=o;if(!R)return{__html:""};function U(ue){let de="";for(const me of ue.cases){P.current[me.id]=me;const Te=Pe===me.id,Fe=od(me.status);de+=`<div class="case${h===me.id?" selected":""}${Te?" running":""}" data-id="${me.id}" title="${ct(me.point||me.name)}"><span class="dot ${Te?"":Fe}"></span><span class="cid">${me.id}</span><span class="cname">${ct(me.name)}</span></div>`}for(const me of ue.children){const Te=N.has(me.path)?"":" open";de+=`<details data-path="${ct(me.path)}"${Te}><summary><span class="arrow">▶</span><span>${ct(me.name)}</span><span class="fcount">${Re(me)}</span>${me.desc?`<span class="fdesc">${ct(me.desc)}</span>`:""}</summary><div class="folder-body">${U(me)}</div></details>`}return de}return{__html:R.tree.children.length||R.tree.cases.length?U(R.tree):'<div class="empty">案例库为空——运行测试任务生成用例后在此展示。</div>'}},[o,N,h,Pe]);function Z(R){const U=[];for(const ne of R.children)U.push(ne.path),U.push(...Z(ne));return U}function ge(){k(new Set)}function ae(){const R=o;R&&k(new Set(Z(R.tree)))}function ce(R){const U=R.target.closest(".case");if(!U)return;const ne=U.dataset.id;g(ue=>{const de=ue===ne?null:ne;return de?localStorage.setItem("ts_monitor_pick",JSON.stringify({proj:t,id:de})):localStorage.removeItem("ts_monitor_pick"),de})}u.useEffect(()=>{const R=d.current;if(!R)return;const U=ne=>{const ue=ne.target;ue.tagName==="DETAILS"&&ue.dataset.path&&k(de=>{const me=new Set(de);return ue.open?me.delete(ue.dataset.path):me.add(ue.dataset.path),me})};return R.addEventListener("toggle",U),()=>R.removeEventListener("toggle",U)},[]);function _e(R){return!R.request&&!R.response?"":'<details class="payload"><summary>请求 / 返回</summary>'+(R.request?`<div class="plabel">请求</div><pre>${ct(R.request)}</pre>`:"")+(R.response?`<div class="plabel">返回</div><pre>${ct(R.response)}</pre>`:"")+"</details>"}function pe(R){const U=WP[R.type]||["事件",""];return`<div class="ev ${U[1]}"><span class="ts">${ct(R.ts||"")}</span><span class="badge">${U[0]}</span>`+(R.case_id?`<span class="cid">${R.case_id}</span>`:"")+`<span class="msg">${ct(R.message||"")}</span>${_e(R)}</div>`}function E(){return'<div id="feed-empty">'+(s?"(当前筛选下暂无事件)":"当前没有运行中的测试。<br>在会话中开启实时监控后,运行期间的事件会实时出现在这里。")+"</div>"}function B(){const R=(s==null?void 0:s.events)||[],U=qP[w],ne=U?R.filter(U):R,ue=ne.length?JSON.stringify(ne[0]):"",de=f.current;de&&(w!==K.current||ue!==$.current||ne.length<G.current?(K.current=w,$.current=ue,de.innerHTML=ne.length?ne.map(pe).join(""):E(),G.current=ne.length):ne.length>G.current&&(G.current===0&&(de.innerHTML=""),de.insertAdjacentHTML("beforeend",ne.slice(G.current).map(pe).join("")),G.current=ne.length),v&&(de.scrollTop=de.scrollHeight))}u.useEffect(()=>{B(),Rn()},[w,o,s,a]);function A(R){const U={pass:0,fail:0,retest:0,pending:0,total:0};return function ne(ue){for(const de of ue.cases){let me=od(de.status);me==="skip"&&(me="pending"),U[me]=(U[me]||0)+1,U.total++}for(const de of ue.children)ne(de)}(R),U}const ie=u.useMemo(()=>{const R=o==null?void 0:o.stats;if(!R)return{sub:"",body:""};const U=R.total,ne=U?Math.round(R.passed/U*100):0,ue=[["通过",R.passed,"var(--pass)"],["失败",R.failed,"var(--fail)"],["需复测",R.retest,"var(--retest)"],["未执行",R.pending+R.skipped,"var(--dim)"]];let de=0;const me=ue.filter(Te=>Te[1]>0).map(Te=>{const Fe=U?Te[1]/U*100:0,Qe=Math.max(0,Fe-1.5),Je=`<circle cx="21" cy="21" r="15.915" fill="none" stroke="${Te[2]}" stroke-width="6" pathLength="100" stroke-linecap="round" stroke-dasharray="${Qe} ${100-Qe}" stroke-dashoffset="${25-de}"/>`;return de+=Fe,Je}).join("");return{sub:`通过率 <b class="hl-pass">${ne}%</b>`,body:'<div class="cbody">'+(U?`<svg viewBox="0 0 42 42" class="donut">${me}<text x="21" y="19.5" class="dnum" text-anchor="middle">${U}</text><text x="21" y="26" class="dsub" text-anchor="middle">用例</text></svg><div class="dlegend">${ue.map(Te=>`<div class="li"><span class="sw" style="background:${Te[2]}"></span>${Te[0]}<span class="lm">${Te[1]}</span><span class="pct">${U?Math.round(Te[1]/U*100):0}%</span></div>`).join("")}</div>`:'<div class="empty">案例库为空</div>')+"</div>"}},[o]),oe=u.useMemo(()=>{const R=o;if(!R)return{sub:"",body:""};let U=R.tree;for(;U.children.length===1&&!U.cases.length&&U.children[0].children.length;)U=U.children[0];const ne=U.children.map(ue=>({name:ue.name,a:A(ue)})).filter(ue=>ue.a.total>0);return U.cases.length&&ne.push({name:"(根目录)",a:A({cases:U.cases,children:[]})}),ne.sort((ue,de)=>de.a.total-ue.a.total),{sub:`${ne.length} 个分类`,body:'<div class="cbody">'+(ne.length?`<div class="mbars">${ne.map(ue=>{const de=ue.a.total,me=de?Math.round(ue.a.pass/de*100):0,Te=(Fe,Qe)=>ue.a[Fe]?`<div class="seg ${Qe}" style="width:${ue.a[Fe]/de*100}%"></div>`:"";return`<div class="mbar-row"><span class="mbar-label" title="${ct(ue.name)}">${ct(ue.name)}</span><div class="mbar-track"><div class="mbar-inner">${Te("pass","pass")}${Te("fail","fail")}${Te("retest","retest")}${Te("pending","pending")}</div></div><span class="mbar-num" title="通过/总数"><b class="hl-pass">${ue.a.pass}</b><em>/${de}</em><i class="pctn">${me}%</i></span></div>`}).join("")}</div>`:'<div class="empty">案例库为空</div>')+'</div><div class="mlegend"><span><span class="sw" style="background:var(--pass)"></span>通过</span><span><span class="sw" style="background:var(--fail)"></span>失败</span><span><span class="sw" style="background:var(--retest)"></span>需复测</span><span><span class="sw" style="background:var(--dim)"></span>未执行</span></div>'}},[o]),Oe=u.useMemo(()=>{const R=a||[];if(!R.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无轮次记录</div></div>'};const U=340,ne=126,ue=30,de=20,me=22,Te=Math.max(1,...R.map(et=>et.passed+et.failed)),Fe=(U-me)/R.length,Qe=Math.min(34,Fe*.52),Je=ne-de,_t=ne-ue-de;let xs="";for(let et=0;et<=2;et++){const Qt=Je-_t*(et/2);xs+=`<line x1="${me}" y1="${Qt}" x2="${U-2}" y2="${Qt}" class="t-grid"/>`,xs+=`<text x="${me-5}" y="${Qt+2.5}" class="t-ytick" text-anchor="end">${Math.round(Te*et/2)}</text>`}let an="";return R.forEach((et,Qt)=>{const Xt=Math.round(me+Qt*Fe+(Fe-Qe)/2),Jt=Math.round(me+Qt*Fe+Fe/2),ft=Math.round(et.passed/Te*_t),$t=Math.round(et.failed/Te*_t);ft&&(an+=`<rect x="${Xt}" y="${Je-ft}" width="${Qe}" height="${ft}" fill="url(#grad-pass)" rx="2"><title>第 ${et.round} 轮 通过 ${et.passed}</title></rect>`),$t&&(an+=`<rect x="${Xt}" y="${Je-ft-$t}" width="${Qe}" height="${$t}" fill="url(#grad-fail)" rx="2"><title>第 ${et.round} 轮 失败 ${et.failed}</title></rect>`);const Vn=et.passed+et.failed,pn=Je-ft-$t;et.new_bugs>0&&(an+=`<text x="${Jt}" y="${pn-16}" class="t-bug" text-anchor="middle">+${et.new_bugs}bug</text>`),Vn>0&&(an+=`<text x="${Jt}" y="${pn-6}" class="t-val" text-anchor="middle">${Vn}</text>`),an+=`<text x="${Jt}" y="${ne-5}" class="t-lab" text-anchor="middle">R${et.round}</text>`}),{sub:"绿通过 / 红失败 · 黄字=新建Bug",body:`<div class="cbody"><svg viewBox="0 0 ${U} ${ne}" class="trend" preserveAspectRatio="xMidYMid meet"><defs><linearGradient id="grad-pass" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-pass-1)"/><stop offset="1" stop-color="var(--grad-pass-2)"/></linearGradient><linearGradient id="grad-fail" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-fail-1)"/><stop offset="1" stop-color="var(--grad-fail-2)"/></linearGradient></defs><line x1="${me}" y1="${Je}" x2="${U-2}" y2="${Je}" class="t-axis"/>${xs}${an}</svg></div>`}},[a]),Ye=u.useMemo(()=>{const R=l||[];if(!R.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无 bug 报告</div></div>'};const U={};for(const de of R){const me=If(de.status);U[me]=(U[me]||0)+1}const ne=Math.max(1,...Qg.map(de=>U[de[0]]||0)),ue=Qg.filter(de=>U[de[0]]>0).map(([de,me,Te])=>`<div class="mbar-row"><span class="mbar-label" title="${me}">${me}</span><div class="mbar-track"><div class="bbar" style="width:${U[de]/ne*100}%;background:${Te}"></div></div><span class="mbar-num"><b>${U[de]}</b><i class="pctn">${Math.round(U[de]/R.length*100)}%</i></span></div>`).join("");return{sub:`共 <b>${R.length}</b> 个`,body:`<div class="cbody"><div class="mbars">${ue}</div></div>`}},[l]),dt=u.useMemo(()=>{var Te;const R=s==null?void 0:s.stats;if(!R||R.proposed==null&&R.accepted==null&&R.executed==null)return{sub:"",body:'<div class="cbody"><div class="empty">暂无运行统计</div></div>'};const U=[["提案",R.proposed],["入库",R.accepted],["执行",R.executed],["通过",R.passed]],ne=Math.max(1,...U.map(Fe=>Fe[1]||0));let ue=null;const de=U.map(([Fe,Qe])=>{const Je=ue!=null&&ue>0&&Qe!=null?Math.round(Qe/ue*100)+"%":"—";return ue=Qe,`<div class="frow"><span class="fl">${Fe}</span><div class="ftrack"><div class="fbar" style="width:${Qe?Math.round(Qe/ne*100):0}%"></div></div><span class="fr">${Qe??"—"} · ${Je}</span></div>`}).join("");let me="";if((Te=s==null?void 0:s.options)!=null&&Te.auto_fix&&R.fixed!=null){const Fe=Math.max(1,R.failed||0);me=`<div class="frow fixbar"><span class="fl">已修复</span><div class="ftrack"><div class="fbar" style="width:${Math.round((R.fixed||0)/Fe*100)}%"></div></div><span class="fr">${R.fixed} / ${R.failed??0}</span></div>`}return{sub:R.rejected>0?`拒绝 <b>${R.rejected}</b>`:"",body:`<div class="cbody"><div class="funnel">${de}${me}</div></div>`}},[s]),st={status:ie,module:oe,trend:Oe,bug:Ye,funnel:dt},Lt=u.useMemo(()=>{const R=o==null?void 0:o.stats;return R?{__html:`<span class="chip"><span class="dot pass"></span><b>${R.passed}</b></span><span class="chip"><span class="dot fail"></span><b>${R.failed}</b></span><span class="chip"><span class="dot retest"></span><b>${R.retest}</b></span><span class="chip"><span class="dot pending"></span><b>${R.pending+R.skipped}</b></span><span class="chip">共 <b>${R.total}</b></span>`}:null},[o]);function gt(R){const U=(s==null?void 0:s.events)||[];for(let ne=U.length-1;ne>=0;ne--){const ue=U[ne];if(ue.case_id===R&&(ue.request||ue.response))return ue}return null}const fn=u.useMemo(()=>{var Je,_t;const R=s,U=h||((Je=R==null?void 0:R.current_case)==null?void 0:Je.id),ne=U?P.current[U]:null,ue=!!(R&&((_t=R.current_case)==null?void 0:_t.id)===U&&R.phase!=="done"),de=U?gt(U):null;if(!U)return{__html:'<h3>用例详情</h3><div class="empty">点击左侧用例查看详情;运行中默认显示当前用例。</div>'};const me=ne||R&&R.current_case,Te=ue?"执行中":ne?ne.status:"",Fe=ne&&ne.bug_report&&ne.bug_report!=="无"?ne.bug_report:"";let Qe="<h3>用例详情"+(h?"":"(当前执行)")+`</h3><div class="kv"><span class="k">ID</span><span class="v mono">${ct(U)}</span></div><div class="kv"><span class="k">名称</span><span class="v">${ct(ne?ne.name:me&&me.name||"")}</span></div>`+(ne&&ne.point?`<div class="kv"><span class="k">测试点</span><span class="v">${ct(ne.point)}</span></div>`:"")+`<div class="kv"><span class="k">状态</span><span class="v"><span class="badge-st ${ue?"run":od(Te)}">${ct(Te||"—")}</span></span></div>`+(ne&&ne.fail_reason?`<div class="kv"><span class="k">失败原因</span><span class="v">${ct(ne.fail_reason)}</span></div>`:"")+(ne&&ne.summary?`<div class="kv"><span class="k">结果摘要</span><span class="v">${ct(ne.summary)}</span></div>`:"")+(ne&&ne.last_run?`<div class="kv"><span class="k">最近执行</span><span class="v mono">${ct(ne.last_run)}</span></div>`:"")+(Fe?`<div class="kv"><span class="k">bug_report</span><span class="v mono">${ct(Fe)}</span></div>`:"");return de&&(Qe+=`<div class="plabel">请求</div><pre>${ct(de.request||"(无记录)")}</pre><div class="plabel">返回</div><pre>${ct(de.response||"(无记录)")}</pre>`),{__html:Qe}},[h,s]),jn=u.useMemo(()=>{var U;const R=s==null?void 0:s.stats;return{__html:R?`本轮: 提案 <b>${R.proposed??"—"}</b> · 入库 <b>${R.accepted??"—"}</b> · 拒绝 <b>${R.rejected??"—"}</b> · 已执行 <b>${R.executed??"—"}</b> · 通过 <b style="color:var(--pass)">${R.passed??0}</b> · 失败 <b style="color:var(--fail)">${R.failed??0}</b> · 跳过 <b>${R.skipped??0}</b> · 新建Bug <b style="color:var(--fail)">${R.new_bug_reports??0}</b>`+(R.fixed!=null&&((U=s==null?void 0:s.options)!=null&&U.auto_fix)?` · 已修复 <b style="color:var(--fix)">${R.fixed}</b>`:""):"案例库统计见左侧。"}},[s]),le=u.useMemo(()=>{var ne;const R=(ne=s==null?void 0:s.priorities)==null?void 0:ne.levels;return!Array.isArray(R)||!R.length?null:{__html:'<div class="prio-title">测试进度(按功能分级)</div>'+R.map(ue=>{const de=Array.isArray(ue.domains)?ue.domains:[],me=de.length,Te=de.filter(Je=>Je.status==="已覆盖").length,Fe=me?Math.round(Te/me*100):0,Qe=de.map(Je=>`<span class="pchip${Je.status==="已覆盖"?" ok":""}" title="${ct(Je.name)}:${ct(Je.status||"未覆盖")}">${ct(Je.name)}</span>`).join("");return`<div class="prio-row"><span class="prio-level">${ct(ue.level||"")}</span><span class="prio-label">${ct(ue.label||"")}</span><span class="prio-track"><span class="prio-in" style="width:${Fe}%"></span></span><span class="prio-num">${Te}<em>/${me}</em></span><span class="prio-chips">${Qe}</span></div>`}).join("")}},[s]),J={tree:300,side:370,chartsH:176,chartRatio:[1,1.15,1.35]},We=.22;function Yt(){const R=getComputedStyle(m.current),U=parseFloat(R.getPropertyValue("--c1-fr"))||J.chartRatio[0],ne=parseFloat(R.getPropertyValue("--c2-fr"))||J.chartRatio[1],ue=parseFloat(R.getPropertyValue("--c3-fr"))||J.chartRatio[2],de=U+ne+ue;return[U/de,ne/de,ue/de]}function Un(R){const U=m.current;U.style.setProperty("--c1-fr",R[0]+"fr"),U.style.setProperty("--c2-fr",R[1]+"fr"),U.style.setProperty("--c3-fr",R[2]+"fr")}function Tt(R,U){if(R.button!==0||R.detail>1)return;const ne=c.current.querySelector(".m-main"),ue=m.current;if(!ne||!ue)return;const de=()=>U==="tree"?parseInt(getComputedStyle(ne).getPropertyValue("--tree-w"),10)||J.tree:U==="side"?parseInt(getComputedStyle(ne).getPropertyValue("--side-w"),10)||J.side:U==="chartsH"?ue.getBoundingClientRect().height||J.chartsH:0,me=Xt=>{U==="tree"?ne.style.setProperty("--tree-w",Pi(Xt,180,600)+"px"):U==="side"?ne.style.setProperty("--side-w",Pi(Xt,260,720)+"px"):U==="chartsH"&&(ue.style.height=Pi(Xt,150,520)+"px")},Te=de(),Fe=U==="chartsH"?R.clientY:R.clientX,Qe=U==="side",Je=U==="chartsH",_t=U==="c1"||U==="c2",xs=_t?Yt():null,an=R.currentTarget;an.classList.add("drag"),document.body.classList.add(Je?"resizing-y":"resizing-x");const et=Xt=>{let Jt=(Je?Xt.clientY:Xt.clientX)-Fe;if(Qe&&(Jt=-Jt),_t){const ft=[...xs],$t=U==="c1"?0:1,Vn=[0,1,2].filter(vs=>vs!==$t),pn=ue.getBoundingClientRect().width,rt=Jt/Math.max(1,pn);let mn=ft[$t]+rt;mn=Pi(mn,We,1-2*We);const Ts=1-mn,Zt=1-ft[$t];Zt>1e-4&&(ft[$t]=mn,ft[Vn[0]]=ft[Vn[0]]/Zt*Ts,ft[Vn[1]]=ft[Vn[1]]/Zt*Ts),Un(ft)}else me(Te+Jt)},Qt=()=>{an.classList.remove("drag"),document.body.classList.remove("resizing-x","resizing-y"),document.removeEventListener("mousemove",et),document.removeEventListener("mouseup",Qt),_t?localStorage.setItem(fo.c1,JSON.stringify(Yt())):localStorage.setItem(fo[U],String(Math.round(de())))};document.addEventListener("mousemove",et),document.addEventListener("mouseup",Qt)}function tt(R){const U=c.current.querySelector(".m-main"),ne=m.current;R==="tree"?U.style.removeProperty("--tree-w"):R==="side"?U.style.removeProperty("--side-w"):R==="chartsH"?ne.style.height="":(ne.style.removeProperty("--c1-fr"),ne.style.removeProperty("--c2-fr"),ne.style.removeProperty("--c3-fr")),localStorage.removeItem(fo[R])}function Mt(){const R=c.current.querySelector(".m-main"),U=m.current;if(!(!R||!U))try{const ne=+localStorage.getItem(fo.tree);ne>0&&R.style.setProperty("--tree-w",ne+"px");const ue=+localStorage.getItem(fo.side);ue>0&&R.style.setProperty("--side-w",ue+"px");const de=+localStorage.getItem(fo.chartsH);de>0&&(U.style.height=de+"px");const me=JSON.parse(localStorage.getItem(fo.c1)||"null");Array.isArray(me)&&me.length===3&&Un(me)}catch{}}function Rn(){if(!te.current)try{const R=JSON.parse(localStorage.getItem("ts_monitor_pick")||"null");R&&R.proj===t&&P.current[R.id]&&(g(R.id),te.current=!0)}catch{}}function Pn(){const R=zs.getState().live;W.current=(R==null?void 0:R.live_mtime)!=null?Date.now()/1e3-R.live_mtime:null,D.current&&p.current&&(p.current.textContent="已运行 "+JP(Date.now()-D.current.getTime()));const U=R&&R.phase&&R.phase!=="done"&&R.phase!=="idle";W.current!=null&&U&&W.current>30?O("状态文件 "+Math.round(W.current)+"s 未更新"):O("")}return u.useEffect(()=>{Mt();const R=setInterval(Pn,1e3);return()=>clearInterval(R)},[]),u.useEffect(()=>{t&&zs.getState().connect(t)},[t]),u.useEffect(()=>()=>{zs.getState().disconnect()},[]),u.useEffect(()=>{D.current==null&&(s!=null&&s.run_started_at)&&(D.current=XP(s.run_started_at))},[s]),r.jsxs("div",{className:"monitor-tab",ref:c,children:[r.jsxs("header",{className:"m-head",children:[r.jsxs("div",{className:"logo",children:[r.jsx("span",{className:"pulse"+(V?" on":"")}),"Free-Style 测试监控",r.jsxs("span",{style:{color:"var(--dim)"},children:[" · ",e==null?void 0:e.name]})]}),r.jsx("span",{className:"pill "+z.cls,children:z.text}),(s==null?void 0:s.round)!=null&&r.jsx("span",{className:"pill mono",children:"第 "+s.round+" 轮"}),D.current&&r.jsx("span",{className:"pill mono",ref:p}),we&&r.jsx("span",{className:"pill",children:we}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"自动修复: "+(s.options.auto_fix?"开":"关")}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"复测: "+(s.options.retest||"不复测")}),r.jsx("div",{className:"spacer"}),C&&r.jsx("span",{className:"pill warn",children:C}),r.jsx("span",{className:X,title:"与监控服务器的连接状态"})]}),r.jsx("nav",{className:"phases",children:Yg.map((R,U)=>r.jsxs("span",{className:"step"+(Y||U<L?" done":"")+(!Y&&U===L?" active":""),children:[r.jsx("span",{className:"no",children:R[1]}),R[2]]},R[0]))}),r.jsxs("div",{className:"m-main",children:[r.jsxs("aside",{className:"tree-panel",children:[r.jsxs("div",{className:"panel-head",children:["案例库 ",r.jsx("span",{className:"lib-stats",dangerouslySetInnerHTML:Lt||void 0}),r.jsx("div",{className:"spacer"}),r.jsxs("div",{className:"tree-tools",children:[r.jsx("span",{className:"tbtn",onClick:ge,children:"全部展开"}),r.jsx("span",{className:"tbtn",onClick:ae,children:"全部折叠"})]})]}),r.jsx("div",{className:"panel-body",ref:d,onClick:ce,dangerouslySetInnerHTML:ke})]}),r.jsx("div",{className:"vsplit",onMouseDown:R=>Tt(R,Os.tree),onDoubleClick:()=>tt(Os.tree)}),r.jsxs("section",{className:"feed-panel",children:[r.jsx("div",{className:"charts",ref:m,children:y.map((R,U)=>{const ne=st[R];return r.jsxs(u.Fragment,{children:[U>0&&r.jsx("div",{className:"vsplit",onMouseDown:ue=>Tt(ue,U===1?Os.c1:Os.c2),onDoubleClick:()=>tt(U===1?Os.c1:Os.c2)}),r.jsxs("div",{className:"chart",children:[r.jsxs("h4",{children:[r.jsx("span",{className:"t",children:YP[R].title}),r.jsx("span",{className:"sub",dangerouslySetInnerHTML:{__html:ne.sub||""}}),r.jsxs("span",{className:"bswitch",children:[r.jsx("span",{className:"swbtn",title:"上一张图",onClick:()=>S(U,-1),children:"‹"}),r.jsx("span",{className:"swbtn",title:"下一张图",onClick:()=>S(U,1),children:"›"})]})]}),r.jsx("div",{className:"cwrap",dangerouslySetInnerHTML:{__html:ne.body}})]})]},R)})}),r.jsx("div",{className:"hsplit",onMouseDown:R=>Tt(R,Os.chartsH),onDoubleClick:()=>tt(Os.chartsH)}),r.jsxs("div",{className:"panel-head",children:["实时事件流",r.jsx("div",{className:"feed-tools",children:KP.map(R=>r.jsx("span",{className:"chip fchip"+(w===R?" on":""),"data-f":R,onClick:()=>j(R),children:GP[R]},R))}),r.jsx("div",{className:"spacer"}),r.jsxs("label",{className:"chip fchip on",style:{cursor:"pointer"},children:[r.jsx("input",{type:"checkbox",checked:v,onChange:R=>x(R.target.checked),style:{verticalAlign:-1}})," 自动滚动"]})]}),r.jsx("div",{className:"feed",ref:f})]}),r.jsx("div",{className:"vsplit",onMouseDown:R=>Tt(R,Os.side),onDoubleClick:()=>tt(Os.side)}),r.jsx("aside",{className:"side-panel",dangerouslySetInnerHTML:fn})]}),le&&r.jsx("section",{className:"prio-bar",dangerouslySetInnerHTML:le}),r.jsxs("footer",{className:"statusbar",children:[r.jsx("span",{dangerouslySetInnerHTML:jn}),r.jsx("div",{className:"spacer"}),r.jsx("span",{children:"数据更新于 "+(i||"—")})]})]})}const eT=e=>/复测通过|已拒绝/.test(e||"");function tT(e){return e==="running"?"run":e==="done"?"pass":e==="failed"?"retest":"pending"}function nT(e){return e==="通过"?"pass":e==="失败"?"retest":e==="需要复测"?"run":"pending"}const sT=(e,t,n)=>Math.max(t,Math.min(n,e));function rT({project:e}){const t=e==null?void 0:e.id,n=$n(),s=n.bugs,o=u.useRef(null),[l,a]=u.useState(null),i=u.useRef(null),[c,d]=u.useState(null),[f,m]=u.useState("report"),p=u.useRef("report"),[h,g]=u.useState(null),[w,j]=u.useState(null),[v,x]=u.useState(null),[y,b]=u.useState({auto_commit:!1}),[S,N]=u.useState(!1),[k,C]=u.useState(""),[O,P]=u.useState("fix"),[D,W]=u.useState(!1),[G,$]=u.useState(""),[K,te]=u.useState(!1),[V,L]=u.useState("retest_only"),Y=[{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],z=[{v:"retest_only",label:"仅复测(现状行为,不部署)"},{v:"deploy_retest",label:"重新部署 → 复测"},{v:"deploy_only",label:"仅重新部署(不复测)"}],we=u.useRef({auto_commit:!1}),X=u.useRef(null),Re=u.useRef(!1),Pe=u.useMemo(()=>c?{__html:Eo(c.content)}:null,[c]),ke=(w==null?void 0:w.status)==="running",Z=(w==null?void 0:w.status)==="queued",ge=(v==null?void 0:v.status)==="running",ae=(v==null?void 0:v.status)==="queued",ce=v?`任务「${v==null?void 0:v.name}」 ${lr[v==null?void 0:v.status]||(v==null?void 0:v.status)} · 轮次 ${v==null?void 0:v.current_round} · 会话 ${(v==null?void 0:v.session_id)||"(首轮后生成)"}`+((v==null?void 0:v.task_type)==="fix"?` · ${v!=null&&v.auto_commit?"自动提交":"不提交"}/${v!=null&&v.auto_deploy?"自动部署":"不部署"}/${v!=null&&v.auto_retest?"自动复测":"不复测"}`:""):"尚无修复/修例任务";function _e(){!l||!t||localStorage.setItem("ts_cur_bug",JSON.stringify({proj:t,dir:l,stab:p.current}))}async function pe(J){a(J),i.current=J,m("report"),p.current="report",g(null),X.current=null,j(null),x(null),b({auto_commit:!1}),we.current={auto_commit:!1},await E(J)}async function E(J=l){if(!(!J||!t))try{const We=await of.get(t,J);d(We),await A(),_e()}catch(We){T(We.message)}}function B(J){m(J),p.current=J,_e()}async function A(){const J=i.current;if(!(!J||!t))try{const Yt=(await Be.list(t)).filter(Mt=>(Mt.task_type==="fix"||Mt.task_type==="reject")&&(()=>{try{return JSON.parse(Mt.payload||"{}").bug_dir===J}catch{return!1}})()),Un=Yt[0]||null,Tt=Yt.find(Mt=>Mt.task_type==="fix")||null;x(Un);const tt=Tt?Tt.id:null;j(Tt),g(tt),X.current=tt,Tt&&b(Mt=>({auto_commit:we.current.auto_commit?Mt.auto_commit:!!Tt.auto_commit}))}catch{}}u.useEffect(()=>{if(f!=="fix")return;const J=setInterval(()=>{A().catch(()=>{})},2e3);return()=>clearInterval(J)},[f,l,t]),u.useEffect(()=>{const J=setInterval(()=>{l&&E().catch(()=>{})},5e3);return()=>clearInterval(J)},[l,t]);function ie(){if(!l){T("请先选择 bug 报告");return}L("retest_only"),te(!0)}async function oe(){try{await Be.create(t,{task_type:"retest_bug",bug_dir:l,retest_scope:V}),T("复测任务已入队,可在「任务」标签页查看"),te(!1),await n.loadTasks(),await A()}catch(J){T(J.message)}}function Oe(){if(!l){T("请先选择 bug 报告");return}C((w==null?void 0:w.extra)||""),P((w==null?void 0:w.end_stage)||"fix"),N(!0)}async function Ye(){const J=k.trim();try{if(!h)await Be.create(t,{task_type:"fix",bug_dir:l,end_stage:O,auto_commit:y.auto_commit,extra:J}),T("修复任务已入队");else{if(ke||Z){T("任务运行中,请先停止再修复");return}await Be.update(h,{extra:J,auto_commit:y.auto_commit,start_stage:"analyze",end_stage:O}),await Be.restart(h),T("修复任务已重启入队")}N(!1),C(""),await n.loadTasks(),await A(),B("fix")}catch(We){T(We.message)}}async function dt(){const J=G.trim();if(!J){T("请填写拒绝理由");return}try{await of.reject(t,l,J),T("已标记拒绝,修例任务已入队"),W(!1),$(""),await n.loadTasks(),await E(),B("fix")}catch(We){T(We.message)}}async function st(J,We){if(b(Yt=>({...Yt,[J]:We})),we.current={...we.current,[J]:!0},!!X.current)try{await Be.update(X.current,{[J]:We}),we.current={...we.current,[J]:!1},T("已保存,下次向 agent 发送指令时生效"),await A()}catch(Yt){T(Yt.message)}}async function Lt(){if(v)try{await Be.stop(v.id),T("已请求停止"),setTimeout(()=>A().catch(()=>{}),800)}catch(J){T(J.message)}}async function gt(){if(!v){T("尚无修复/修例任务");return}if(ge||ae){T("任务运行中,请先停止再重启");return}try{await Be.restart(v.id),T("任务已重启入队"),await A()}catch(J){T(J.message)}}function fn(J){if(J.button!==0||J.detail>1)return;const We=o.current,Yt=parseInt(getComputedStyle(We).getPropertyValue("--bugw"),10)||400,Un=J.clientX;J.currentTarget.classList.add("drag"),document.body.classList.add("resizing-x");const Tt=Mt=>We.style.setProperty("--bugw",sT(Yt+(Mt.clientX-Un),260,760)+"px"),tt=()=>{J.currentTarget.classList.remove("drag"),document.body.classList.remove("resizing-x"),document.removeEventListener("mousemove",Tt),document.removeEventListener("mouseup",tt),localStorage.setItem("ts.bugw",getComputedStyle(We).getPropertyValue("--bugw"))};document.addEventListener("mousemove",Tt),document.addEventListener("mouseup",tt)}function jn(){o.current.style.removeProperty("--bugw"),localStorage.removeItem("ts.bugw")}u.useEffect(()=>{try{const J=+localStorage.getItem("ts.bugw");J>0&&o.current.style.setProperty("--bugw",J+"px")}catch{}},[]),u.useEffect(()=>{if(Re.current||!t||!s.length)return;if(i.current){Re.current=!0;return}let J=null;try{J=JSON.parse(localStorage.getItem("ts_cur_bug")||"null")}catch{}J&&J.proj===t&&s.some(We=>We.dir===J.dir)&&(Re.current=!0,pe(J.dir).then(()=>{const We=J.stab==="fix"?"fix":"report";m(We),p.current=We}))},[t,s]);const le=r.jsxs("div",{className:"fix-opts",children:[r.jsxs("label",{style:{display:"flex",gap:5,alignItems:"center",cursor:"pointer",color:"var(--text)"},children:[r.jsx("input",{type:"checkbox",checked:y.auto_commit,onChange:J=>st("auto_commit",J.target.checked)}),"自动提交(修复完成后 git commit,不 push)"]}),r.jsx("span",{className:"hint",children:"部署/复测是否执行由「修复」弹窗中的任务终点决定(终点≥重新部署即部署、终点=复测即任务内复测)"})]});return r.jsxs("div",{className:"bugs-tab",children:[e&&r.jsxs("div",{className:"bugwrap",ref:o,children:[r.jsxs("div",{className:"bug-left",children:[r.jsxs("div",{className:"bug-head",children:["Bug 报告 ",r.jsx("span",{className:"dim",children:s.length?"共 "+s.length:""})]}),r.jsxs("div",{className:"bug-list scroll",children:[!s.length&&r.jsx("div",{className:"hint",style:{padding:12},children:"暂无 bug 报告"}),s.map(J=>r.jsxs("div",{className:"bugitem"+(l===J.dir?" sel":"")+(eT(J.status)?" history":""),title:/已拒绝/.test(J.status||"")?"已被拒绝的报告":/复测通过/.test(J.status||"")?"复测通过的历史报告":void 0,onClick:()=>pe(J.dir),children:[r.jsx("div",{className:"bt",children:J.title}),r.jsxs("div",{className:"bmeta",children:[r.jsx("span",{className:"bug-status "+If(J.status),children:J.status||"—"}),J.last_task&&r.jsxs("span",{className:"bug-status "+tT(J.last_task.status),children:[J.last_task.name," · ",lr[J.last_task.status]||J.last_task.status]}),r.jsxs("span",{children:[J.cases.length," 用例"]})]})]},J.dir))]})]}),r.jsx("div",{className:"vsplit bug-split",onMouseDown:fn,onDoubleClick:jn}),r.jsx("div",{className:"bug-right",children:c?r.jsxs("div",{className:"bug-content scroll"+(f==="fix"?" fix-mode":""),children:[r.jsxs("div",{className:"head",children:[r.jsx("h3",{children:c.title}),r.jsx("span",{className:"bug-status "+If(c.status),children:c.status||"—"})]}),r.jsxs("div",{className:"mut",children:["bug_report/",c.dir,c.last_task&&r.jsxs(r.Fragment,{children:[" · 最近任务「",c.last_task.name,"」:",lr[c.last_task.status]||c.last_task.status]}),"· ",r.jsxs(F,{variant:"ghost",size:"sm",className:"inline-flex h-5 px-1.5 text-[calc(11px*var(--fs))]",onClick:()=>E(),children:[r.jsx(Pa,{})," 刷新"]})]}),r.jsxs("div",{className:"sub-tabs",children:[r.jsx("span",{className:"sub-tab"+(f==="report"?" on":""),onClick:()=>B("report"),children:"报告"}),r.jsx("span",{className:"sub-tab"+(f==="fix"?" on":""),onClick:()=>B("fix"),children:"对话"})]}),f==="report"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"ops",children:[!/已拒绝/.test(c.status||"")&&r.jsxs(F,{variant:"outline",size:"sm",onClick:ie,children:[r.jsx(uf,{})," 复测"]}),!["复测通过","已修复"].some(J=>(c.status||"").includes(J))&&r.jsxs(F,{size:"sm",onClick:Oe,children:[r.jsx(w0,{})," 修复"]}),!/已拒绝/.test(c.status||"")&&r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>{$(""),W(!0)},children:[r.jsx(Fk,{})," 拒绝"]}),r.jsx("span",{className:"hint",children:"复测/修复/拒绝都会创建任务(固定一轮)执行; 复测后若关联用例全部通过,bug 状态自动改为「已修复」; 拒绝会标记「已拒绝」并按理由修正关联用例; 修复/修例过程在「对话」标签页实时查看"})]}),le,r.jsxs("div",{className:"sec-title",children:["关联用例(",c.cases.length,")"]}),c.cases.length?r.jsxs(dm,{className:"text-xs",children:[r.jsx(fm,{children:r.jsxs(jo,{className:"hover:bg-transparent",children:[r.jsx(_n,{className:"px-2",children:"ID"}),r.jsx(_n,{className:"px-2",children:"名称"}),r.jsx(_n,{className:"px-2",children:"状态"}),r.jsx(_n,{className:"px-2",children:"最近执行"})]})}),r.jsx(pm,{children:c.cases.map(J=>r.jsxs(jo,{children:[r.jsx(vn,{className:"px-2 font-mono text-xs",children:J.id}),r.jsx(vn,{className:"px-2",children:J.name}),r.jsx(vn,{className:"px-2",children:r.jsx("span",{className:"bug-status "+nT(J.status),children:J.status||"—"})}),r.jsx(vn,{className:"px-2 font-mono text-xs",children:rs(J.last_run)})]},J.id))})]}):r.jsx("div",{className:"hint",children:"未解析到关联用例"}),r.jsx("div",{className:"sec-title",children:"完整内容(bug_report.md)"}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:Pe})]}):r.jsxs("div",{className:"fix-panel",children:[r.jsxs("div",{className:"fix-controls",children:[v&&(ge||ae)&&r.jsxs(F,{size:"sm",variant:"outline",onClick:Lt,children:[r.jsx(Hp,{})," 停止"]}),v&&["stopped","failed","done","interrupted"].includes(v==null?void 0:v.status)&&r.jsxs(F,{size:"sm",variant:"outline",onClick:gt,children:[r.jsx(df,{})," 重启任务"]}),r.jsx("span",{className:"hint fix-status",children:ce})]}),v?r.jsx(Mf,{task:v,withQBar:!1}):r.jsx("div",{className:"sess-empty",style:{flex:1},children:"尚无修复/修例会话。在「报告」标签页点击「修复」或「拒绝」创建任务后,对话会在这里实时展示。"})]})]}):r.jsx("div",{className:"bug-empty",children:"← 选择左侧 bug 报告查看详情;修复 / 复测会创建任务并放入「任务」标签页执行"})})]}),r.jsx(on,{open:S,onOpenChange:N,children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{className:"text-left",children:r.jsxs(Kt,{className:"text-sm",children:["修复「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"修改意见(可选)"}),r.jsx(ds,{rows:4,value:k,onChange:J=>C(J.target.value),placeholder:"例如:只修第 3 节指出的空指针判断,不要动缓存层;留空则按报告推荐方案修复"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(It,{value:O,onValueChange:P,children:[r.jsx(Et,{size:"sm",className:"min-w-[160px]",children:r.jsx(Ct,{})}),r.jsx(Rt,{children:Y.map(J=>r.jsx(Ae,{value:J.v,children:J.label},J.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"起点=报告分析;终点≥重新部署时自动部署、终点=复测时任务内复测(复测通过自动标记已修复)"})]}),r.jsx(kn,{className:"flex-none",children:r.jsx(F,{onClick:Ye,children:h?"重启修复":"开始修复"})})]})}),r.jsx(on,{open:D,onOpenChange:W,children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{className:"text-left",children:r.jsxs(Kt,{className:"text-sm",children:["拒绝「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"拒绝理由(必填)"}),r.jsx(ds,{rows:4,value:G,onChange:J=>$(J.target.value),placeholder:"例如:误报——MCP 超时是环境抖动,不是协议实现问题"}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"确认后报告标记为「已拒绝」并调暗沉底;平台将创建修例任务:按理由修正关联用例, 并把教训记入案例库 PITFALLS.md,后续生成用例时避开同类误报"})]}),r.jsx(kn,{className:"flex-none",children:r.jsx(F,{variant:"destructive",onClick:dt,children:"确认拒绝"})})]})}),r.jsx(on,{open:K,onOpenChange:te,children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{className:"text-left",children:r.jsxs(Kt,{className:"text-sm",children:["复测「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务范围"}),r.jsxs(It,{value:V,onValueChange:L,children:[r.jsx(Et,{size:"sm",className:"min-w-[220px]",children:r.jsx(Ct,{})}),r.jsx(Rt,{children:z.map(J=>r.jsx(Ae,{value:J.v,children:J.label},J.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"仅复测且关联用例全部已固化 verify.py 时走平台脚本复测;范围含重新部署时由 agent 先按项目部署说明部署再复测"})]}),r.jsx(kn,{className:"flex-none",children:r.jsx(F,{onClick:oe,children:"开始复测"})})]})})]})}function Tc({options:e=[],value:t,onChange:n,placeholder:s="搜索…",emptyHint:o="无匹配项",className:l,inputClassName:a}){const[i,c]=u.useState(!1),[d,f]=u.useState(""),[m,p]=u.useState(0),h=u.useRef(null),g=u.useRef(null),w=e.find(S=>S.value===t)||null,j=d.trim().toLowerCase(),v=j?e.filter(S=>((S.search||"")+" "+S.label).toLowerCase().includes(j)):e;u.useEffect(()=>{if(!i)return;const S=N=>{var k;(k=h.current)!=null&&k.contains(N.target)||c(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[i]),u.useEffect(()=>{p(0)},[d,i]);function x(){var S;if(i){c(!1);return}f(""),c(!0),(S=g.current)==null||S.focus()}function y(S){n(S.value),c(!1),f("")}function b(S){if(!i&&(S.key==="ArrowDown"||S.key==="Enter")&&S.preventDefault(),!i){S.key==="ArrowDown"&&x();return}if(S.key==="Escape"){c(!1),f("");return}if(S.key==="ArrowDown"){S.preventDefault(),p(N=>Math.min(N+1,v.length-1));return}if(S.key==="ArrowUp"){S.preventDefault(),p(N=>Math.max(N-1,0));return}if(S.key==="Enter"){S.preventDefault(),v[m]&&y(v[m]);return}}return r.jsxs("div",{ref:h,className:Ve("relative",l),children:[r.jsx(Ie,{ref:g,className:Ve("pr-8",a),value:i?d:w?w.label:"",placeholder:s,onChange:S=>{c(!0),f(S.target.value)},onFocus:()=>{i||c(!0)},onKeyDown:b,title:w?w.label:void 0}),r.jsx("button",{type:"button",tabIndex:-1,className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded hover:bg-accent",onClick:()=>x(),children:r.jsx(Cl,{className:Ve("size-4 opacity-50 transition-transform",i&&"rotate-180")})}),i&&r.jsxs("div",{className:`absolute left-0 right-0 top-full z-50 mt-1 max-h-56 overflow-y-auto
451
- rounded-md border bg-popover text-popover-foreground p-1 shadow-md`,children:[v.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:o}),v.map((S,N)=>r.jsx("div",{className:Ve("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm select-none",S.value===t&&"bg-accent text-accent-foreground",S.value!==t&&(N===m?"bg-accent/60 text-accent-foreground":"hover:bg-accent")),onMouseEnter:()=>p(N),onClick:()=>y(S),children:r.jsx("span",{className:"flex-1 truncate",children:S.label})},S.value))]})]})}const oT=10*1024*1024;function lT({project:e,card:t,comments:n,onClose:s,reload:o}){const l=e.id,[a,i]=u.useState(!1),[c,d]=u.useState(t.title+`
452
- `+(t.description||"")),[f,m]=u.useState(""),[p,h]=u.useState(""),[g,w]=u.useState(""),[j,v]=u.useState(!1),[x,y]=u.useState(!1),[b,S]=u.useState(null),[N,k]=u.useState(!1),[C,O]=u.useState(!1),P=u.useRef(null),{rzOn:D,rzStyle:W,rzStart:G,rzDragStart:$,rzReset:K}=sr("ts.boardW",!1);u.useEffect(()=>{a||d(t.title+`
453
- `+(t.description||""))},[t.title,t.description,a]),u.useEffect(()=>{i(!1),m(""),h(""),w(""),S(null)},[t.id]);const te=u.useMemo(()=>({__html:Eo(mf(t.description||"*(无描述)*",l))}),[t.description,l]),[V,L]=u.useState([]),[Y,z]=u.useState(null),[we,X]=u.useState({}),[Re,Pe]=u.useState([]);u.useEffect(()=>{Me.get(l).then(A=>{L(A.cards||[]),z(A.capabilities||null),X(A.session_titles||{})}).catch(()=>{}),Me.listSessions(l).then(A=>Pe(A.sessions||[])).catch(()=>{})},[l,t.id,t.updated_at]);async function ke(A){try{await Me.updateCard(l,t.id,A),await o()}catch(ie){T(ie.message)}}async function Z(){const A=c.indexOf(`
454
- `),ie=(A<0?c:c.slice(0,A)).trim()||"未命名",oe=A<0?"":c.slice(A+1);await ke({title:ie.slice(0,200),description:oe}),i(!1)}async function ge(A){m(A),await ke({scheduled_at:A?new Date(A).getTime():0})}async function ae(A){const ie=g.trim();if(ie)try{const oe=await Me.addComment(l,t.id,ie);w(""),A&&await Me.sendComment(l,t.id,oe.id),await o()}catch(oe){T(oe.message),await o()}}async function ce(A){const ie=Array.from(A||[]);if(!(!ie.length||N))for(const oe of ie){if(oe.size>oT){T(`附件过大(>10MB):${oe.name}`);continue}if(await qp(oe)){T(`已跳过占位图(极小尺寸):${oe.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}k(!0);try{const Oe=await new Promise((le,J)=>{const We=new FileReader;We.onload=()=>le(String(We.result||"").split(",")[1]||""),We.onerror=()=>J(new Error("文件读取失败")),We.readAsDataURL(oe)}),Ye=await Me.uploadMedia(l,{name:oe.name,mime:oe.type||"application/octet-stream",data:Oe}),dt=(oe.type||"").startsWith("image/")?`![${oe.name}](${Ye.url})`:`[${oe.name}](${Ye.url})`,st=P.current,Lt=!!st&&document.activeElement===st,gt=Lt?st.selectionStart??st.value.length:-1,fn=Lt?(st.value||"").indexOf(`
455
- `):-1,jn=Lt&&fn>=0&&gt>fn;d(le=>jn?le.slice(0,gt)+dt+le.slice(st.selectionEnd??gt):(le?le+`
456
- `:"")+dt+`
457
- `),T(jn||!Lt?`已粘贴附件:${oe.name}`:`标题不支持图片,已附加到描述区:${oe.name}`)}catch(Oe){T(Oe.message||"附件上传失败")}finally{k(!1)}}}function _e(A){var Oe;const oe=Array.from(((Oe=A.clipboardData)==null?void 0:Oe.items)||[]).filter(Ye=>Ye.kind==="file").map(Ye=>Ye.getAsFile()).filter(Boolean);oe.length&&(A.preventDefault(),ce(oe))}function pe(A){var oe;const ie=Array.from(((oe=A.dataTransfer)==null?void 0:oe.files)||[]);ie.length&&(A.preventDefault(),ce(ie))}async function E(){if(!(C||!window.confirm(`确认清理该独立 worktree?
458
-
459
- ${t.worktree}
460
-
461
- 仅在工作树无未提交改动且会话未运行时才能清理(分支保留,不自动删除)。`))){O(!0);try{await Me.removeWorktree(l,t.id),T("已清理 worktree"),await o()}catch(ie){T(ie.message)}finally{O(!1)}}}const B=Y?!Y.chat:!0;return r.jsx(on,{open:!0,onOpenChange:A=>{A||s()},children:r.jsxs(qt,{className:"modal modal-rz board-detail-modal w-[52vw] h-auto max-h-[90vh] sm:max-w-[94vw] overflow-y-auto"+(D?" rz-drag":""),style:{...W,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:G,reset:K}),r.jsx(Gt,{className:"text-left",children:r.jsxs(Kt,{className:"cursor-move select-none text-sm break-words",onMouseDown:$,children:["#",t.id," ",t.title||"未命名"]})}),r.jsxs("div",{className:"board-detail",children:[r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["📝 标题 / 描述",!a&&r.jsx(F,{size:"sm",variant:"ghost",onClick:()=>i(!0),children:"✏ 编辑"})]}),a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",children:"第一行为标题,其余为描述;支持粘贴/拖入图片与文件(存为附件,10MB 内);Ctrl+Enter 保存"}),r.jsx(ds,{ref:P,rows:10,value:c,onChange:A=>d(A.target.value),onPaste:_e,onDrop:pe,onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&(A.preventDefault(),N||Z())},placeholder:"第一行为标题(空则显示「未命名」),其余为描述…"}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(F,{size:"sm",onClick:Z,disabled:N,children:N?"附件上传中…":"保存"}),r.jsx(F,{size:"sm",variant:"outline",onClick:()=>{i(!1),d(t.title+`
462
- `+(t.description||""))},children:"取消"})]})]}):r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:te})]}),t.column==="todo"&&r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"⏰ 定时开工"}),r.jsx(Ie,{type:"datetime-local",value:f||(t.scheduled_at?aT(t.scheduled_at):""),onChange:A=>ge(A.target.value)}),r.jsx("div",{className:"hint",children:"到点自动进入「正在开发」(受串行门禁约束)"})]}),t.worktree&&r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["🌿 独立 worktree",r.jsx(F,{size:"sm",variant:"ghost",disabled:C,title:"删除该独立工作树目录(会话运行中或工作树有未提交改动时会被后端拒绝)",onClick:E,children:C?"清理中…":"清理 worktree"})]}),r.jsxs("div",{className:"hint break-all",title:t.worktree,children:[r.jsx("span",{className:"font-mono",children:t.worktree}),"(分支 ts/card-",t.id,")"]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💬 相关会话"}),(t.sessions||[]).map(A=>r.jsxs("div",{className:"flex items-center gap-1 py-0.5 text-xs cursor-pointer hover:bg-accent/40 rounded px-1 -mx-1",title:`点击查看会话 ${A}`,onClick:()=>S(A),children:[r.jsx("span",{className:"flex-1 min-w-0 truncate",children:we[A]||r.jsx("span",{className:"font-mono",children:A})}),we[A]&&r.jsx("span",{className:"font-mono text-muted-foreground",children:A.slice(0,8)}),A===t.session_id&&r.jsx("span",{className:"bug-status pass",children:"主"}),r.jsx(F,{size:"sm",variant:"ghost",title:"复制 id",onClick:ie=>{var oe;ie.stopPropagation(),(oe=navigator.clipboard)==null||oe.writeText(A),T("已复制")},children:r.jsx(Dp,{})}),A!==t.session_id&&r.jsx(F,{size:"sm",variant:"ghost",title:"设为主会话",onClick:ie=>{ie.stopPropagation(),ke({session_id:A})},children:"设主"}),r.jsx(F,{size:"sm",variant:"ghost",title:"解绑",onClick:ie=>{ie.stopPropagation(),ke({unbind_session:A})},children:"✂"}),(Y==null?void 0:Y.compact)&&r.jsx(F,{size:"sm",variant:"ghost",title:"compact 压缩会话上下文",onClick:async ie=>{ie.stopPropagation();try{await Me.compact(l,t.id,A),T("compact 已触发")}catch(oe){T(oe.message)}},children:r.jsx(UN,{})}),(Y==null?void 0:Y.fork)&&r.jsx(F,{size:"sm",variant:"ghost",disabled:j,title:"压缩并新建:压缩会话内容并新建会话(新会话只含压缩摘要、无历史轮次,原会话保留)",onClick:async ie=>{if(ie.stopPropagation(),!j){v(!0);try{const oe=await Me.forkCompact(l,t.id,A);T("已新建会话并注入压缩内容"),await ke({bind_session:oe.new_sid})}catch(oe){T(oe.message)}finally{v(!1)}}},children:j?"压缩中…":r.jsx(Zk,{})}),(Y==null?void 0:Y.fork)&&r.jsx(F,{size:"sm",variant:"ghost",disabled:x,title:"fork 会话:完整复制为新会话(历史/上下文全量保留)并加入卡片会话列表(不改变主会话,需要时点「设主」)",onClick:async ie=>{if(ie.stopPropagation(),!x){y(!0);try{const oe=await Me.forkSession(l,t.id,A);T("已 fork 新会话并加入卡片会话列表"),await ke({bind_session:oe.new_sid})}catch(oe){T(oe.message)}finally{y(!1)}}},children:x?"fork 中…":r.jsx(fN,{})}),r.jsx(F,{size:"sm",variant:"ghost",title:"查看会话",onClick:ie=>{ie.stopPropagation(),S(A)},children:"🔍"})]},A)),r.jsxs("div",{className:"mt-1 flex gap-1",children:[r.jsx(Tc,{className:"flex-1",placeholder:"搜索或选择已有会话…",emptyHint:"工作区暂无会话",options:Re.map(A=>({value:A.sid,label:`${A.title||A.sid.slice(0,12)}(${new Date(A.mtime*1e3).toLocaleString()})`+(A.bound?" [已绑定]":"")+(A.archived?" [已归档]":""),search:A.sid})),value:p,onChange:h}),r.jsx(F,{size:"sm",variant:"outline",disabled:!p.trim(),onClick:async()=>{await ke({bind_session:p.trim()}),h("")},children:"绑定"})]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🔗 父任务依赖"}),r.jsx(Tc,{placeholder:"选择父任务卡片…",emptyHint:"没有匹配的卡片",options:[{value:"",label:"(无依赖)"}].concat(V.filter(A=>A.id!==t.id).map(A=>({value:String(A.id),label:`#${A.id} ${A.title||"未命名"}(${A.column})`,search:A.title||""}))),value:t.parent_card_id?String(t.parent_card_id):"",onChange:A=>ke({parent_card_id:A?+A:null})}),V.filter(A=>A.id!==t.id).length===0&&r.jsx("div",{className:"hint",children:"暂无其他卡片可作为父任务"})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💭 评论"}),(n||[]).map(A=>r.jsxs("div",{className:"py-1 text-xs",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-muted-foreground",children:A.created_at}),A.sent&&r.jsx("span",{className:"bug-status pass",children:"✓ 已投递"}),r.jsx("span",{className:"flex-1"}),!A.sent&&!B&&r.jsx(F,{size:"sm",variant:"ghost",title:"投递到主会话",onClick:async()=>{try{await Me.sendComment(l,t.id,A.id),await o()}catch(ie){T(ie.message)}},children:r.jsx(ff,{})}),r.jsx(F,{size:"sm",variant:"ghost",title:"删除",onClick:async()=>{try{await Me.removeComment(l,t.id,A.id),await o()}catch(ie){T(ie.message)}},children:r.jsx(qs,{})})]}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Eo(mf(A.text,l))}})]},A.id)),r.jsx(ds,{rows:3,placeholder:B?"评论(dsh 不支持投递,仅保存)":"评论(Ctrl+Enter 保存)",value:g,onChange:A=>w(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&ae(!1)}}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(F,{size:"sm",variant:"outline",onClick:()=>ae(!1),children:"保存"}),!B&&r.jsxs(F,{size:"sm",onClick:()=>ae(!0),disabled:!t.session_id,title:t.session_id?"":"尚无会话,请先开始开发",children:[r.jsx(ff,{})," 保存并投递"]})]})]})]}),r.jsx(Pc,{board:b?{projectId:l,sid:b,cid:t.id,column:t.column,title:t.title}:null,onSwitchSession:S,onClose:()=>S(null)})]})})}function aT(e){const t=new Date(e),n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}const iT={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function cT({project:e,onClose:t,onChanged:n}){const s=e==null?void 0:e.id,[o,l]=u.useState([]),[a,i]=u.useState(!1);async function c(){try{const p=await Me.trashList(s);l(p.cards||[])}catch(p){T(p.message)}}u.useEffect(()=>{c()},[s]);async function d(p){try{await Me.restoreCard(s,p.id),T(`已还原「${p.title||"未命名"}」`),await c(),n==null||n()}catch(h){T(h.message)}}async function f(p){if(window.confirm(`彻底删除「${p.title||"未命名"}」?评论一并删除,不可恢复。`))try{await Me.purgeCard(s,p.id),await c(),n==null||n()}catch(h){T(h.message)}}async function m(){if(!a&&window.confirm(`清空回收站共 ${o.length} 张卡片?全部彻底删除,不可恢复。`)){i(!0);try{await Me.emptyTrash(s),l([]),T("回收站已清空"),n==null||n()}catch(p){T(p.message)}finally{i(!1)}}}return r.jsx(on,{open:!0,onOpenChange:p=>!p&&t(),children:r.jsxs(qt,{className:"modal board-trash-modal w-[52vw] max-h-[85vh] overflow-y-auto sm:max-w-[94vw]",children:[r.jsx(Gt,{className:"text-left",children:r.jsxs(Kt,{className:"text-sm",children:["回收站(",o.length,")"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:"删除的卡片仅移入回收站,可还原;这里的彻底删除不可恢复"}),r.jsxs(F,{size:"sm",variant:"outline",disabled:!o.length||a,onClick:m,children:[r.jsx(qs,{})," 清空回收站"]})]}),o.length===0?r.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:"回收站是空的"}):r.jsx("div",{className:"flex flex-col gap-2",children:o.map(p=>{var h;return r.jsxs("div",{className:"flex items-start gap-2 rounded border border-border px-3 py-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm break-words",children:p.title||"未命名"}),r.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:[r.jsx("span",{className:"bug-status pending",children:iT[p.column]||p.column}),p.jira_key&&r.jsx("span",{className:"bug-status pending",children:p.jira_key}),r.jsxs("span",{children:["删除于 ",((h=p.trashed_at)==null?void 0:h.replace("T"," "))||""]})]})]}),r.jsxs(F,{size:"sm",variant:"outline",title:"还原(回原列原位置)",onClick:()=>d(p),children:[r.jsx(Sc,{})," 还原"]}),r.jsx(F,{size:"sm",variant:"ghost",title:"彻底删除(不可恢复)",onClick:()=>f(p),children:r.jsx(qs,{})})]},p.id)})}),r.jsx(kn,{children:r.jsx(F,{variant:"outline",onClick:t,children:"关闭"})})]})})}const ld=4,Ti=8;function uT({trigger:e,items:t=[],align:n="end"}){const[s,o]=u.useState(!1),[l,a]=u.useState(null),i=u.useRef(null),c=u.useRef(null);function d(f=!1){var m,p;o(!1),a(null),f&&((p=(m=i.current)==null?void 0:m.querySelector("button"))==null||p.focus())}return u.useEffect(()=>{if(!s)return;const f=h=>{var g,w;(g=c.current)!=null&&g.contains(h.target)||(w=i.current)!=null&&w.contains(h.target)||d()},m=h=>{h.key==="Escape"&&d(!0)},p=()=>d();return document.addEventListener("mousedown",f),document.addEventListener("keydown",m),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",m),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]),u.useLayoutEffect(()=>{var w,j,v,x;if(!s)return;const f=(w=i.current)==null?void 0:w.getBoundingClientRect();if(!f)return;const m=((j=c.current)==null?void 0:j.offsetWidth)||0,p=((v=c.current)==null?void 0:v.offsetHeight)||0;let h=n==="start"?f.left:f.right-m;h=Math.max(Ti,Math.min(h,window.innerWidth-m-Ti));let g=f.bottom+ld;p&&g+p>window.innerHeight-Ti&&f.top-ld-p>=Ti&&(g=f.top-ld-p),a({left:h,top:g}),(x=c.current)==null||x.focus()},[s,n]),r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:i,className:"inline-flex",onClick:()=>s?d():o(!0),children:e}),s&&Oo.createPortal(r.jsxs("div",{ref:c,role:"menu",tabIndex:-1,style:{position:"fixed",left:l?l.left:-9999,top:l?l.top:-9999,visibility:l?"visible":"hidden"},className:"z-50 min-w-[176px] rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none",children:[t.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"无可选项"}),t.map(f=>r.jsx("div",{title:f.disabled?f.title:void 0,children:r.jsxs("button",{type:"button",role:"menuitem",disabled:!!f.disabled,"aria-disabled":f.disabled||void 0,title:f.disabled?void 0:f.title,className:Ve("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm select-none",f.disabled?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent hover:text-accent-foreground"),onClick:()=>{var m;f.disabled||(d(),(m=f.onSelect)==null||m.call(f))},children:[f.icon&&r.jsx("span",{className:"shrink-0",children:f.icon}),r.jsx("span",{className:"flex-1 truncate",children:f.label})]})},f.key))]}),document.body)]})}const dT=6,fT=10*1024*1024,pT={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},mT=new Set(["doing","review","done"]),hT={running:"run",queued:"pending",done:"pass"},gT=[["all","全部"],["dev","仅开发"],["test","仅测试"]],xT=[{key:"todo",label:"待开发"},{key:"doing",label:"正在开发"},{key:"blocked",label:"阻塞"},{key:"review",label:"待审核"},{key:"done",label:"已完成"}],Xg=[["manual","手动"],["created_desc","创建新→旧"],["updated_desc","更新新→旧"],["title","标题"]],vT=e=>e==="done"?[["entered_desc","进入新→旧"],...Xg]:Xg,yT={serial:"串行",parallel:"并行"},Jg=e=>e.queue_state==="running"||e.queue_state==="starting",Zg=e=>!e.answer_pending&&(!!e.running||e.queue_state==="starting"),Mi=e=>e.block_kind==="queue"&&!e.answer_pending;function wT({project:e}){var Ts,Zt,vs;const t=e==null?void 0:e.id,n=Ww(),[s,o]=u.useState(null),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),[m,p]=u.useState({}),[h,g]=u.useState(null),[w,j]=u.useState(null),[v,x]=u.useState(""),[y,b]=u.useState(null),[S,N]=u.useState({}),[k,C]=u.useState(null),O=u.useRef({}),[P,D]=u.useState(!1),[W,G]=u.useState(!1),[$,K]=u.useState(null),[te,V]=u.useState(null),[L,Y]=u.useState(""),z=u.useRef(null),[we,X]=u.useState(null),Re=u.useRef(null),Pe=u.useRef(!1),ke=u.useRef([]),Z=u.useRef(null),ge=u.useRef(null),ae=u.useRef(null),ce=u.useRef(null),_e=u.useRef(null),pe=u.useRef(null),E=u.useRef(null);async function B(){var I;if(t&&!((I=Re.current)!=null&&I.on))try{ge.current=oe(),o(await Me.get(t))}catch(H){T(H.message)}}u.useEffect(()=>{o(null),a(null),K(null),f(""),g(null),C(null),N({}),O.current={},B(),ll.get(t).then(be=>{var Le;return p(((Le=be.prefs)==null?void 0:Le.board_filters)||{})}).catch(()=>{});let I=null;const H=()=>{ae.current||(ae.current=setTimeout(()=>{ae.current=null,B()},300))};try{I=Me.stream(t),I.addEventListener("hello",H),I.addEventListener("refresh",H)}catch{}const je=setInterval(B,6e4);return()=>{clearInterval(je),ae.current&&(clearTimeout(ae.current),ae.current=null);try{I==null||I.close()}catch{}}},[t]);function A(I,H){p(je=>{const be={...je,[I]:H};return ll.set(t,"board_filters",be).catch(()=>{}),be})}const ie=u.useMemo(()=>(s==null?void 0:s.cards)||[],[s]);ke.current=ie,Z.current=s;function oe(){const I=new Map;return document.querySelectorAll(".board-card[data-card-id]").forEach(H=>{I.set(H.dataset.cardId,H.getBoundingClientRect())}),I}u.useLayoutEffect(()=>{const I=ge.current;if(ge.current=null,!!I)for(const[H,je]of I){const be=document.querySelector(`[data-card-id="${H}"]`);if(!be)continue;const Le=be.getBoundingClientRect(),Ce=je.left-Le.left,St=je.top-Le.top;!Ce&&!St||(be.style.transition="none",be.style.transform=`translate(${Ce}px, ${St}px)`,be.getBoundingClientRect(),be.style.transition="transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",be.style.transform="")}});const Oe=ie.find(I=>I.id===l)||null,Ye=I=>((s==null?void 0:s.comments)||[]).filter(H=>H.card_id===I);function dt(I,H,je,be){const Le=I.find(at=>at.id===H);if(!Le)return I;const Ce=I.filter(at=>at.id!==H),St=Ce.filter(at=>at.column===je),pt=St[Math.min(Math.max(be,0),St.length)],lt={...Le,column:je};if(!pt)return[...Ce,lt];const q=Ce.findIndex(at=>at.id===pt.id);return[...Ce.slice(0,q),lt,...Ce.slice(q)]}function st(I,H,je=1/0){o(be=>be&&{...be,cards:dt(be.cards,I.id,H,je)})}async function Lt(I,H,je,be=null){try{if((await Me.moveCard(t,I.id,H,je,be)).blocked==="parent-not-done"){await B(),b({cardId:I.id,action:"move",column:H});return}await B()}catch(Le){T(Le.message),await B()}}async function gt(I,H){try{await Me.reorderCard(t,I,H),await B()}catch(je){T(je.message),await B()}}async function fn(I,H,je){ge.current=oe(),st(I,H),await Lt(I,H,je)}async function jn(I,H){try{await Me.updateSettings(t,{sort:{[I]:H}}),await B()}catch(je){T(je.message)}}async function le(I,H,je,be){var Le;try{const Ce=await Me.startCard(t,I.id,H,je,be);if(Ce.blocked==="parent-not-done"){b({cardId:I.id,action:"start",worktree:!!be});return}be?T("已在独立 worktree 中开始"):((Le=Ce.card)==null?void 0:Le.column)==="blocked"&&T("已加入统一队列排队"),await B()}catch(Ce){T(Ce.message)}}async function J(I){let H;try{H=await Me.worktreePreview(t,I)}catch{H={supported:!1,reason:"无法获取 worktree 预览(后端未重启或接口不可用)"}}return O.current={...O.current,[I]:H},N(O.current),H}function We(I){if(I.session_id)return"该卡片已有主会话,不能切换到独立 worktree";const H=S[I.id];return H&&H.supported===!1?H.reason||"当前项目不支持独立 worktree":""}async function Yt(I){C({card:I,preview:O.current[I.id]||null});const H=await J(I.id);H&&C(je=>je&&je.card.id===I.id?{...je,preview:H}:je)}async function Un(I){try{await Me.deliverAnswer(t,I.id),T("已送达答案"),await B()}catch(H){T(H.message)}}async function Tt(I){try{await Me.stopCard(t,I.id),await B()}catch(H){T(H.message)}}async function tt(I){try{await Me.removeCard(t,I.id),a(null),T("已移入回收站(可从回收站还原)"),await B()}catch(H){T(H.message)}}const Mt=u.useRef(le);Mt.current=le;function Rn(I){z.current=I.id,V(I.id),Y(I.title)}function Pn(){z.current=null,V(null)}async function ts(I){if(z.current!==I.id)return;const H=L.trim();if(z.current=null,V(null),!(!H||H===I.title))try{await Me.updateCard(t,I.id,{title:H}),await B()}catch(je){T(je.message)}}const R=u.useRef(et);R.current=et;const U=u.useRef(Qt);U.current=Qt;const ne=u.useRef(Xt);ne.current=Xt;const ue=u.useRef(ft);ue.current=ft;const de=u.useRef(Lt);de.current=Lt;const me=u.useRef(gt);me.current=gt;const Te=u.useRef(_t);Te.current=_t;const Fe=u.useRef(null),Qe=u.useCallback((I,H)=>{I.button===0&&(I.target.closest("button, a, input, textarea, select")||(Re.current={id:H.id,sx:I.clientX,sy:I.clientY,on:!1},Pe.current=!1,window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",$t)))},[]);function Je(I,H,je){var pt,lt;const be=(lt=(pt=document.elementFromPoint(I,H))==null?void 0:pt.closest)==null?void 0:lt.call(pt,".board-col");if(!be)return null;const Le=be.dataset.col,Ce=[...be.querySelectorAll(".board-card")].filter(q=>q.dataset.cardId!==String(je));let St=Ce.length;for(let q=0;q<Ce.length;q++){const at=Ce[q].getBoundingClientRect();if(H<at.top+at.height/2){St=q;break}}return{col:Le,index:St,domIds:Ce.map(q=>q.dataset.cardId)}}function _t(I){var H,je,be;return((be=(je=(H=Z.current)==null?void 0:H.settings)==null?void 0:je.sort)==null?void 0:be[I])||(I==="done"?"entered_desc":"manual")}function xs(I,H){const je=_t(H);if(je==="manual")return I;const be=[...I];return je==="created_desc"?be.sort((Le,Ce)=>(Ce.created_at||"").localeCompare(Le.created_at||"")):je==="updated_desc"?be.sort((Le,Ce)=>(Ce.updated_at||"").localeCompare(Le.updated_at||"")):je==="title"?be.sort((Le,Ce)=>(Le.title||"").localeCompare(Ce.title||"","zh")):je==="entered_desc"&&be.sort((Le,Ce)=>(Ce.done_at||"").localeCompare(Le.done_at||"")),be}function an(I){const H=d.trim().toLowerCase();return H?(I.title||"").toLowerCase().includes(H)||(I.description||"").toLowerCase().includes(H)||(I.jira_key||"").toLowerCase().includes(H):!0}function et(I,H){var St;const je=ke.current.find(pt=>pt.id===I);E.current=(je==null?void 0:je.column)||null,ce.current=((St=Z.current)==null?void 0:St.cards)||null,_e.current=null;const be=document.querySelector(`[data-card-id="${I}"]`);if(!be)return;const Le=be.getBoundingClientRect(),Ce=be.cloneNode(!0);Ce.className=Ce.className.replace(" drag-gap","")+" board-ghost",Object.assign(Ce.style,{position:"fixed",left:Le.left+"px",top:Le.top+"px",width:Le.width+"px",margin:"0",zIndex:999,pointerEvents:"none",opacity:"0.95",transform:"scale(1.04) rotate(1.5deg)",boxShadow:"0 16px 32px rgba(0,0,0,.28)",transition:"none"}),document.body.appendChild(Ce),pe.current={el:Ce,dx:H.clientX-Le.left,dy:H.clientY-Le.top},Fe.current=pt=>{pt.key==="Escape"&&(Pe.current=!0,Re.current=null,ue.current(I,-1,-1))},window.addEventListener("keydown",Fe.current)}function Qt(I){const H=pe.current;H&&(H.el.style.left=I.clientX-H.dx+"px",H.el.style.top=I.clientY-H.dy+"px")}function Xt(I,H){const je=_e.current;if(je&&je.col===H.col&&je.index===H.index)return;const be=H.col===I.column;be&&H.col!=="doing"&&_t(H.col)!=="manual"||(_e.current=H,c(H.col),ge.current=oe(),st(I,H.col,!be&&_t(H.col)!=="manual"?1/0:H.index))}const Jt=u.useRef(I=>{const H=Re.current;if(!H)return;if(!H.on){if(Math.hypot(I.clientX-H.sx,I.clientY-H.sy)<dT)return;H.on=!0,R.current(H.id,I),X(H.id)}U.current(I);const je=ke.current.find(Le=>Le.id===H.id);if(!je)return;const be=Je(I.clientX,I.clientY,H.id);be&&ne.current(je,be)}).current;function ft(I,H,je){var Hn,ns,ys,oo,lo,ao;const be=pe.current;pe.current=null;const Le=be?be.el.getBoundingClientRect():null;be==null||be.el.remove();const Ce=Je(H,je,I),St=oe();Le&&St.set(String(I),Le),ge.current=St;const pt=ce.current;ce.current=null,_e.current=null,X(null),c(null);const lt=(((Hn=Z.current)==null?void 0:Hn.cards)||[]).find(Ut=>Ut.id===I);if(!lt){B();return}const q=E.current;if(E.current=null,!Ce){pt&&o(Ut=>Ut&&{...Ut,cards:pt});return}if(Ce.col==="doing"&&q!=="doing"){pt&&o(Ut=>Ut&&{...Ut,cards:pt}),Mt.current(lt);return}if(Ce.col===q){if(Ce.col==="doing"){const Tn=new Map((((ns=Z.current)==null?void 0:ns.cards)||[]).map(ws=>[String(ws.id),ws])),Bo=(Ce.domIds||[]).map(ws=>Tn.get(ws)).filter(Boolean),ss=Bo[Ce.index]??null,Qs=ss?Zg(ss)?"prefix":Mi(ss)?"waiting":"none":"waiting";let Wn=null;if(Mi(lt)&&Qs==="prefix"?Wn="force":Zg(lt)&&Qs==="waiting"&&Bo.slice(0,Ce.index).filter(Mi).length>0?Wn="stop":Mi(lt)&&Qs==="waiting"&&(Wn="reorder"),Wn==="force"&&!window.confirm("强制运行:立即启动该卡片(落哪算哪)?")&&(Wn=null),Wn==="stop"&&!window.confirm("停止当前任务?停止后卡片进入待审核。")&&(Wn=null),!Wn){pt&&o(ws=>ws&&{...ws,cards:pt});return}de.current(lt,"doing",void 0,(ss==null?void 0:ss.id)??null);return}if(Te.current(Ce.col)!=="manual")return;const Ut=(((ys=Z.current)==null?void 0:ys.cards)||[]).filter(Tn=>Tn.column===Ce.col&&Tn.id!==I);me.current(I,((oo=Ut[Ce.index])==null?void 0:oo.id)??null);return}let at=null;Te.current(Ce.col)==="manual"&&(at=((ao=(((lo=Z.current)==null?void 0:lo.cards)||[]).filter(Tn=>Tn.column===Ce.col&&Tn.id!==I)[Ce.index])==null?void 0:ao.id)??null),de.current(lt,Ce.col,void 0,at)}const $t=u.useRef(I=>{const H=Re.current;Re.current=null,window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",$t),Fe.current&&(window.removeEventListener("keydown",Fe.current),Fe.current=null),!(!H||!H.on)&&(Pe.current=!0,ue.current(H.id,I.clientX,I.clientY))}).current;function Vn(I){if(Pe.current){Pe.current=!1;return}pn(I)}function pn(I){a(I.id),I.unread&&(o(H=>H&&{...H,cards:H.cards.map(je=>je.id===I.id?{...je,unread:!1}:je)}),Me.markViewed(t,I.id).catch(()=>{}))}if(!t)return null;const rt=!!(e!=null&&e.archived),mn=!(e!=null&&e.agent_path);return r.jsxs("div",{className:"board-tab",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-1.5",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"开发看板"}),r.jsx("span",{className:"bug-status pending",children:yT[(Ts=s==null?void 0:s.settings)==null?void 0:Ts.mode]||"串行"}),r.jsx("span",{className:"flex-1"}),r.jsx(Ie,{className:"board-search",placeholder:"搜索卡片(标题/描述/Jira)",value:d,onChange:I=>f(I.target.value)}),r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>D(!0),children:[r.jsx(v0,{})," 设置"]}),r.jsxs(F,{size:"sm",variant:"outline",title:"回收站(删除的卡片可还原)",onClick:()=>G(!0),children:[r.jsx(qs,{})," 回收站"]})]}),r.jsx("div",{className:"board-cols",children:xT.map(I=>{const H=m[I.key]||"all",je=mT.has(I.key)&&H!=="dev"?((s==null?void 0:s.active_tasks)||[]).filter(q=>(q.column||"doing")===I.key):[],be=H!=="test"?ie.filter(q=>q.column===I.key&&an(q)):[],Le=I.key==="doing"?be:xs(be,I.key),Ce=I.key==="doing"?Le.filter(Jg):[],St=I.key==="doing"?Le.filter(q=>!Jg(q)):[],pt=I.key==="doing"?[...Ce,...St]:Le,lt=Ce.length>0&&St.length>0?Ce.length:-1;return r.jsxs("div",{"data-col":I.key,className:"board-col"+(i===I.key?" dragover":""),children:[r.jsxs("div",{className:"board-col-head",children:[I.label,r.jsx("span",{className:"board-col-count",children:Le.length}),r.jsx("select",{className:"board-col-sort",title:"列表过滤:开发任务=卡片,测试任务=平台测试任务",value:H,onChange:q=>A(I.key,q.target.value),children:gT.map(([q,at])=>r.jsx("option",{value:q,children:at},q))}),I.key!=="doing"&&r.jsx("select",{className:"board-col-sort",title:"列内排序方案",value:_t(I.key),onChange:q=>jn(I.key,q.target.value),children:vT(I.key).map(([q,at])=>r.jsx("option",{value:q,children:at},q))})]}),r.jsxs("div",{className:"board-col-body",children:[je.map(q=>r.jsxs("div",{className:"board-task"+(q.session_id?" has-session":""),title:q.session_id?"测试任务 · 点击查看会话":"测试任务(尚无会话)",onClick:()=>{q.session_id&&g(q)},children:[r.jsx("div",{className:"board-card-title",style:{cursor:"default"},onClick:at=>at.stopPropagation(),children:q.name}),r.jsxs("div",{className:"board-card-badges",children:[r.jsxs("span",{className:"board-card-id",title:"测试任务 id",children:["任务 #",q.id]}),r.jsxs("span",{className:"bug-status "+(hT[q.status]||"retest"),children:["测试·",lr[q.status]||q.status]}),r.jsx("span",{className:"bug-status pending",children:pT[q.task_type]||q.task_type}),q.current_round>0&&r.jsxs("span",{className:"bug-status pending",children:["轮 ",q.current_round]})]}),q.error&&r.jsx("div",{className:"board-card-err",children:q.error})]},"task-"+q.id)),pt.map((q,at)=>r.jsxs(u.Fragment,{children:[at===lt&&r.jsx("div",{className:"board-runzone",children:r.jsx("span",{children:"等待区 · 按队列顺序"})}),r.jsxs("div",{"data-card-id":q.id,className:`board-card col-${q.column}`+(we===q.id?" drag-gap":""),onPointerDown:Hn=>Qe(Hn,q),onClick:()=>Vn(q),children:[r.jsx(bT,{card:q,editing:te===q.id,editTitle:L,onStartEdit:Rn,onSaveTitle:ts,onEditChange:Y,onCancelEdit:Pn}),r.jsxs("div",{className:"board-card-badges",children:[q.unread&&r.jsx("span",{className:"board-card-new",title:"状态有更新,打开卡片后标记消失",children:"有更新"}),r.jsxs("span",{className:"board-card-id",title:"卡片 id",children:["#",q.id]}),!!pf[q.queue_state]&&r.jsx("span",{className:b0(q.queue_state),children:pf[q.queue_state]}),q.worktree?r.jsx("span",{className:"bug-status pending",title:q.worktree,children:"🌿 worktree"}):null,q.scheduled_at?r.jsxs("span",{className:"bug-status pending",children:["⏰ ",new Date(q.scheduled_at).toLocaleString()]}):null,q.parent_card_id?r.jsxs("span",{className:"bug-status pending",children:["🔗 依赖 #",q.parent_card_id]}):null,q.block_kind==="interaction"&&r.jsxs("span",{className:"bug-status interaction",title:"agent 等待用户回答,回复后自动恢复",children:["🤔 ",q.block_text||"等待回答"]}),q.block_kind==="manual"&&r.jsx("span",{className:"bug-status retest",children:q.block_text||"手动阻塞"}),q.origin==="sync"&&r.jsx("span",{className:"bug-status pending",children:"同步"}),q.jira_key&&r.jsx("span",{className:"bug-status pending",children:q.jira_key})]}),q.last_error&&r.jsx("div",{className:"board-card-err",children:q.last_error}),r.jsxs("div",{className:"board-card-ops",onClick:Hn=>{Hn.target.closest("button")&&Hn.stopPropagation()},children:[q.column==="todo"&&r.jsxs("div",{className:"board-split",children:[r.jsxs(F,{size:"sm",variant:"outline",disabled:rt||mn,title:rt?"项目已归档":mn?"未配置智能体":"",onClick:()=>le(q),children:[r.jsx(uf,{})," 开始"]}),r.jsx(uT,{align:"end",trigger:r.jsx(F,{size:"sm",variant:"outline",disabled:rt||mn,title:rt?"项目已归档":mn?"未配置智能体":"更多开始方式",onClick:()=>J(q.id),children:"▾"}),items:[{key:"queue",label:"开始(入队排队)",onSelect:()=>le(q)},{key:"worktree",label:"🌿 在新 worktree 中开始",disabled:!!We(q),title:We(q)||void 0,onSelect:()=>Yt(q)}]})]}),q.column==="doing"&&!q.running&&q.block_kind!=="queue"&&r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>fn(q,"review"),children:[r.jsx(Ok,{})," 待审核"]}),q.column==="blocked"&&r.jsxs(F,{size:"sm",variant:"outline",disabled:rt||mn,onClick:()=>le(q),children:[r.jsx(uf,{})," 重试"]}),q.answer_pending&&r.jsx(F,{size:"sm",variant:"ghost",title:"不等项目空闲,立即把答案送达等待中的会话",onClick:()=>Un(q),children:"⚡ 送达"}),q.block_kind==="queue"&&!q.answer_pending&&r.jsx(F,{size:"sm",variant:"ghost",title:"跳过队列立即开始(用户自担风险)",disabled:rt||mn,onClick:async()=>{window.confirm("强制开始将跳过队列立即执行,可能与在跑任务冲突,继续?")&&await le(q,void 0,!0)},children:"⚡ 强制"}),q.block_kind==="queue"&&r.jsx(F,{size:"sm",variant:"ghost",title:"取消排队并移入待审核",onClick:()=>Tt(q),children:"停止"}),q.column==="review"&&r.jsxs(r.Fragment,{children:[r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>fn(q,"done"),children:[r.jsx(Nl,{})," 通过"]}),r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>{j(q),x("")},children:[r.jsx(Sc,{})," 打回"]})]}),q.column==="done"&&r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>fn(q,"todo"),children:[r.jsx(Sc,{})," 重开"]}),r.jsx(F,{size:"sm",variant:"ghost",title:"打开卡片详情",onClick:()=>pn(q),children:r.jsx(wN,{})}),r.jsx(F,{size:"sm",variant:"ghost",title:"删除卡片",onClick:()=>tt(q),children:r.jsx(qs,{})}),r.jsx(F,{size:"sm",variant:"ghost",title:q.session_id?"进入主会话":"尚无会话",disabled:!q.session_id,onClick:()=>K({sid:q.session_id,cid:q.id,column:q.column,title:q.title||"未命名"}),children:r.jsx(SN,{})}),!!(n!=null&&n.openSession)&&r.jsx(F,{size:"sm",variant:"ghost",title:q.session_id?"在 dsh 界面打开该卡片主会话":"尚无会话",disabled:!q.session_id,onClick:()=>Hw(q.session_id),children:r.jsx(Fp,{})})]})]})]},q.id))]}),I.key==="todo"&&r.jsx(_T,{disabled:rt,project:e,onAdd:async(q,at,Hn)=>{let ns=null;try{ns=await Me.createCard(t,{title:q,description:at})}catch(ys){T(ys.message);return}if(Hn&&(ns!=null&&ns.id))try{await Me.startCard(t,ns.id),T("已进入开发队列排队")}catch(ys){T(ys.message)}await B()}})]},I.key)})}),Oe&&r.jsx(lT,{project:e,card:Oe,comments:Ye(Oe.id),onClose:()=>a(null),reload:B}),$&&r.jsx(Pc,{board:{projectId:t,...$},onClose:()=>K(null),onSwitchSession:I=>K(H=>H&&{...H,sid:I})}),h&&r.jsx(Pc,{task:h,onClose:()=>g(null)}),r.jsx(on,{open:!!w,onOpenChange:I=>!I&&j(null),children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{children:r.jsxs(Kt,{children:["打回「",w==null?void 0:w.title,"」"]})}),r.jsx(ds,{rows:4,placeholder:"修改意见(将随会话续发改进)",value:v,onChange:I=>x(I.target.value)}),r.jsx(kn,{children:r.jsx(F,{onClick:async()=>{const I=w;j(null),await le(I,v)},children:"确认打回"})})]})}),r.jsx(on,{open:!!y,onOpenChange:I=>!I&&b(null),children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{children:r.jsx(Kt,{children:"父任务尚未完成"})}),r.jsx("p",{className:"hint",children:"该卡片有未完成的父任务依赖。建议先完成父任务,或在详情面板解除依赖后再开始。"}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>b(null),children:"取消"}),(y==null?void 0:y.action)==="start"&&r.jsx(F,{onClick:async()=>{const I=y;b(null),await le(ie.find(H=>H.id===I.cardId),void 0,!0,I.worktree)},children:"强制开始(自担风险)"})]})]})}),r.jsx(on,{open:!!k,onOpenChange:I=>!I&&C(null),children:r.jsxs(qt,{className:"modal",children:[r.jsx(Gt,{children:r.jsx(Kt,{children:"在新 worktree 中开始"})}),r.jsx("p",{className:"hint",children:"将为该卡片新建独立 git worktree,会话在独立工作树中执行,主仓库不受影响。"}),((Zt=k==null?void 0:k.preview)==null?void 0:Zt.path)&&r.jsxs("p",{className:"hint break-all",children:["路径:",r.jsx("span",{className:"font-mono",children:k.preview.path})]}),((vs=k==null?void 0:k.preview)==null?void 0:vs.branch)&&r.jsxs("p",{className:"hint",children:["分支:",r.jsx("span",{className:"font-mono",children:k.preview.branch})]}),r.jsx("p",{className:"hint font-semibold",children:"该卡将立即执行,不与项目队列互斥,可能与项目内其他任务并发。"}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>C(null),children:"取消"}),r.jsx(F,{onClick:async()=>{const I=k;C(null),await le(I.card,void 0,!1,!0)},children:"开始"})]})]})}),r.jsx(ST,{open:P,onClose:()=>D(!1),projectId:t,settings:s==null?void 0:s.settings,reload:B}),W&&r.jsx(cT,{project:e,onClose:()=>G(!1),onChanged:()=>B()})]})}const jT=240;function bT({card:e,editing:t,editTitle:n,onStartEdit:s,onSaveTitle:o,onEditChange:l,onCancelEdit:a}){const i=u.useRef(null),c=u.useRef(null),[d,f]=u.useState(5);u.useLayoutEffect(()=>{const p=i.current;if(!p)return;const h=()=>{const g=parseFloat(getComputedStyle(p).lineHeight)||19.5;f(Math.max(0,6-Math.round(p.getBoundingClientRect().height/g)))};if(h(),typeof ResizeObserver<"u"){const g=new ResizeObserver(h);return g.observe(p),()=>g.disconnect()}},[e.title,t]);const m=u.useCallback(()=>{const p=c.current;if(!p)return;p.style.height="auto";const h=p.scrollHeight+(p.offsetHeight-p.clientHeight);p.style.height=Math.min(h,jT)+"px"},[]);return u.useLayoutEffect(()=>{t&&m()},[t,m]),t?r.jsxs(r.Fragment,{children:[r.jsx(ds,{ref:c,rows:1,value:n,autoFocus:!0,className:"board-card-title-input min-h-0 resize-none px-1 py-0 text-[calc(13px*var(--fs))] font-semibold leading-[1.5] break-all",onClick:p=>p.stopPropagation(),onChange:p=>{l(p.target.value),m()},onKeyDown:p=>{p.key==="Enter"&&!p.nativeEvent.isComposing?(p.preventDefault(),o(e)):p.key==="Escape"&&a()},onBlur:()=>o(e)}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:i,className:"board-card-title",title:"单击编辑标题",onClick:p=>{p.stopPropagation(),s(e)},children:e.title||r.jsx("span",{className:"board-card-title-empty",children:"未命名"})}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]})}function _T({disabled:e,onAdd:t,project:n}){const[s,o]=u.useState(""),[l,a]=u.useState([]),[i,c]=u.useState(!1),d=u.useRef(null),[f,m]=u.useState(-1),[p,h]=u.useState(!1),[g,w]=u.useState([]);u.useEffect(()=>{if(!(n!=null&&n.agent_path)){w([]);return}let P=!1;return Pt.agentSkills(n.agent_path,n.project_dir||n.work_dir||"").then(D=>{if(P)return;const W=Array.isArray(D)?D:(D==null?void 0:D.skills)||[];w(W.map(G=>({key:G.name||G.id,label:G.name||G.id,desc:(G.description||G.summary||"").slice(0,40),type:"skill"})))}).catch(()=>{}),()=>{P=!0}},[n==null?void 0:n.id,n==null?void 0:n.agent_path,n==null?void 0:n.project_dir,n==null?void 0:n.work_dir]);function j(){const P=d.current;P&&(P.style.height="auto",P.style.height=Math.min(P.scrollHeight,120)+"px")}async function v(P){const D=Array.from(P||[]);if(!D.length||i)return;const W=n==null?void 0:n.id;if(W)for(const G of D){if(G.size>fT){T(`附件过大(>10MB):${G.name}`);continue}if(await qp(G)){T(`已跳过占位图(极小尺寸):${G.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}c(!0);try{const $=await new Promise((V,L)=>{const Y=new FileReader;Y.onload=()=>V(String(Y.result||"").split(",")[1]||""),Y.onerror=()=>L(new Error("文件读取失败")),Y.readAsDataURL(G)}),K=await Me.uploadMedia(W,{name:G.name,mime:G.type||"application/octet-stream",data:$}),te=(G.type||"").startsWith("image/")?`![${G.name}](${K.abs||K.url})`:`[${G.name}](${K.abs||K.url})`;a(V=>[...V,{md:te,url:Wp(K.url),name:G.name,mime:G.type}]),T(`已添加附件:${G.name}`)}catch($){T($.message||"附件上传失败")}finally{c(!1)}}}function x(P){var W;const D=Array.from(((W=P.clipboardData)==null?void 0:W.items)||[]).filter(G=>G.kind==="file").map(G=>G.getAsFile()).filter(Boolean);D.length&&(P.preventDefault(),v(D))}function y(P){var W;const D=Array.from(((W=P.dataTransfer)==null?void 0:W.files)||[]);D.length&&(P.preventDefault(),v(D))}function b(P){a(D=>D.filter(W=>W.md!==P))}u.useEffect(()=>{const P=d.current;if(!P)return;const D=()=>m(P.selectionStart??0),W=()=>{m(P.selectionStart??0),h(!1)};return P.addEventListener("keyup",D),P.addEventListener("click",W),()=>{P.removeEventListener("keyup",D),P.removeEventListener("click",W)}},[]);const S=u.useMemo(()=>Uw(s,f>=0?f:s.length),[s,f]),N=S!=null&&!p,k=S?S.text.slice(1):"";function C(P){if(!S)return;const D=`使用 skill「${P.label}」`;h(!0),o(G=>G.slice(0,S.start)+D+G.slice(S.start+S.text.length));const W=S.start+D.length;m(W),requestAnimationFrame(()=>{const G=d.current;G&&(G.selectionStart=G.selectionEnd=W),j()})}async function O(P=!1){if(i)return;const D=s.indexOf(`
463
- `),W=(D<0?s:s.slice(0,D)).trim(),G=(D<0?"":s.slice(D+1)).trim(),$=l.map(te=>te.md).join(`
464
-
465
- `),K=[G,$].filter(Boolean).join(`
466
-
467
- `);o(""),a([]),requestAnimationFrame(j),await t(W,K,P)}return r.jsxs("div",{className:"board-add",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[(l.length>0||i)&&r.jsxs("div",{className:"sess-attachrow",children:[i&&r.jsx("span",{className:"sess-chip",children:"附件上传中…"}),l.map((P,D)=>r.jsxs("span",{className:"sess-chip",title:P.name,children:[(P.mime||"").startsWith("image/")&&P.url?r.jsx("img",{src:P.url,alt:P.name}):r.jsx(m0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:P.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>b(P.md),children:r.jsx(Co,{className:"h-3 w-3"})})]},P.md+D))]}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(Aw,{open:N,query:k,items:g,onSelect:C,onClose:()=>h(!0)}),r.jsx(ds,{ref:d,rows:1,style:{minHeight:36},className:"resize-none",placeholder:"添加任务…(Enter 落待开发 / Ctrl+Enter 直接排队;可粘贴图片,可留空)",value:s,disabled:e,onChange:P=>{o(P.target.value),m(P.target.selectionStart??P.target.value.length),h(!1),j()},onPaste:x,onDrop:y,onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&!P.nativeEvent.isComposing&&(P.preventDefault(),O(P.ctrlKey))}})]})]}),r.jsx(F,{size:"sm",variant:"outline",disabled:e||i,onClick:()=>O(),children:r.jsx(Va,{})})]})}function ST({open:e,onClose:t,projectId:n,settings:s,reload:o}){const[l,a]=u.useState("serial"),[i,c]=u.useState({url:"",user:"",token:""}),[d,f]=u.useState(!1),[m,p]=u.useState(!1),h=u.useRef(!1);u.useEffect(()=>{e&&!h.current&&s&&(h.current=!0,a(s.mode||"serial"),c(s.jira||{url:"",user:"",token:""})),e||(h.current=!1)},[e]);async function g(x){a(x);try{await Me.updateSettings(n,{mode:x}),await o()}catch(y){T(y.message)}}async function w(){try{await Me.updateSettings(n,{jira:i}),T("Jira 配置已保存"),await o()}catch(x){T(x.message)}}async function j(){f(!0);try{const x=await Me.jiraTest(n,i);T(x.ok?`连接成功:${x.name}`:`连接失败:${x.error}`)}catch(x){T(x.message)}finally{f(!1)}}async function v(){p(!0);try{const x=await Me.jiraImport(n);T(`导入完成:新增 ${x.added},跳过 ${x.skipped}`),await o()}catch(x){T(x.message)}finally{p(!1)}}return r.jsx(on,{open:e,onOpenChange:x=>!x&&t(),children:r.jsxs(qt,{className:"modal w-[560px] sm:max-w-[92vw]",children:[r.jsx(Gt,{children:r.jsx(Kt,{children:"看板设置"})}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"ℹ 并行模式"}),[["serial","串行:同时只跑一个任务"],["parallel","并行:最多 5 个并行(队列窗口)"]].map(([x,y])=>r.jsxs("label",{className:"flex items-center gap-2 py-1 text-sm",children:[r.jsx("input",{type:"radio",name:"board-mode",checked:l===x,onChange:()=>g(x)}),y]},x))]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🐛 Jira"}),r.jsxs("div",{className:"form-col gap-2",children:[r.jsx(Ie,{placeholder:"Jira 地址(如 https://xx.atlassian.net)",value:i.url,onChange:x=>c({...i,url:x.target.value})}),r.jsx(Ie,{placeholder:"用户名(邮箱)",value:i.user,onChange:x=>c({...i,user:x.target.value})}),r.jsx(Ie,{placeholder:"API token",type:"password",value:i.token,onChange:x=>c({...i,token:x.target.value})})]}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[r.jsx(F,{size:"sm",variant:"outline",onClick:w,children:"保存配置"}),r.jsx(F,{size:"sm",variant:"outline",disabled:d,onClick:j,children:"测试连接"}),r.jsx(F,{size:"sm",disabled:m,onClick:v,children:"导入我的待办"})]}),r.jsx("div",{className:"hint mt-1",children:"导入 = 拉取「指派给我且未解决」的前 50 条建卡(按 key 去重);凭据存服务端"})]})]})})}const kT=/^(\d{1,2}(?:\.\d{1,2})*)[.)、]?\s+/,NT=/^([^::]{1,24})[::]\s*(.*)$/;function Gw(e){return e.ownerDocument.createTreeWalker(e,4).nextNode()}function CT(e){const t=e.querySelector("h1");if(!t)return{title:"",meta:[]};const n=t.textContent.trim();t.remove();const s=e.firstElementChild;if(!s||s.tagName!=="UL")return{title:n,meta:[]};const o=[];for(const a of[...s.children]){const i=Gw(a);if(!i)return{title:n,meta:[]};const c=i.data.match(NT);if(!c)return{title:n,meta:[]};o.push([i,c])}if(o.length<2)return{title:n,meta:[]};const l=o.map(([a,i])=>(a.data=i[2],{k:i[1].trim(),v:a.parentElement.innerHTML}));return s.remove(),{title:n,meta:l}}function Kw(e,t){const n=t||{},s=String(e||""),o=Eo(s);if(typeof DOMParser>"u")return{html:o,title:"",meta:[],outline:[]};const l=new DOMParser().parseFromString("<body>"+o+"</body>","text/html"),a=l.body;for(const f of[...a.querySelectorAll("table")]){const m=l.createElement("div");m.className="md-table-wrap",f.replaceWith(m),m.appendChild(f)}let i="",c=[];if(n.extractHeader){const f=CT(a);i=f.title,c=f.meta}const d=[];return a.querySelectorAll("h1, h2, h3, h4").forEach((f,m)=>{const p="md-h-"+m;f.id=p;let h="";const g=Gw(f);if(g){const j=g.data.match(kT);j&&(h=j[1],g.data=g.data.slice(j[0].length))}const w=f.textContent.trim();if(h){const j=l.createElement("span");j.className="md-sec-no",j.textContent=h,f.insertBefore(j,f.firstChild)}d.push({id:p,level:Number(f.tagName.slice(1)),no:h,text:w})}),{html:a.innerHTML,title:i,meta:c,outline:d}}const ET={script:"自定义脚本(run.py)",scenario:"声明式场景(scenario.json)",legacy_scenario:"存量场景(旧布局 load/scenario_<id>.json)"};function ad({title:e,note:t,children:n}){return r.jsxs("details",{className:"lp-fold",children:[r.jsxs("summary",{children:[r.jsx("span",{className:"lp-fold-t",children:e}),t&&r.jsx("span",{className:"lp-fold-n",children:t})]}),r.jsx("div",{className:"lp-fold-body",children:n})]})}function RT({task:e}){var g,w;const[t,n]=u.useState(null),[s,o]=u.useState(""),[l,a]=u.useState(""),i=u.useRef(null);u.useEffect(()=>{if(!(e!=null&&e.id))return;let j=!1;return o(""),Be.loadCase(e.id).then(v=>{j||n(v)}).catch(v=>{j||o(v.message)}),()=>{j=!0}},[e==null?void 0:e.id,e==null?void 0:e.status]);const c=u.useMemo(()=>Kw((t==null?void 0:t.plan_md)||"",{extractHeader:!0}),[t==null?void 0:t.plan_md]);u.useEffect(()=>{const j=i.current,v=c.outline;if(!j||!v.length){a("");return}const x=v.map(C=>j.querySelector("#"+C.id)).filter(Boolean);if(!x.length){a("");return}let y=j.parentElement;for(;y&&y!==document.body&&!(/(auto|scroll)/.test(getComputedStyle(y).overflowY)&&y.scrollHeight>y.clientHeight+20);)y=y.parentElement;let b=0;const S=()=>{b=0;const C=(y?y.getBoundingClientRect().top:0)+120;let O=x[0];for(const P of x)if(P.getBoundingClientRect().top<=C)O=P;else break;a(O.id)},N=()=>{b||(b=requestAnimationFrame(S))};S();const k=y||window;return k.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N),()=>{b&&cancelAnimationFrame(b),k.removeEventListener("scroll",N),window.removeEventListener("resize",N)}},[c]);function d(j){var y,b,S;const v=(y=i.current)==null?void 0:y.querySelector("#"+j);if(!v)return;const x=(S=(b=window.matchMedia)==null?void 0:b.call(window,"(prefers-reduced-motion: reduce)"))==null?void 0:S.matches;v.scrollIntoView({block:"start",behavior:x?"auto":"smooth"}),a(j)}if(s)return r.jsxs("div",{className:"hint",children:["方案读取失败:",s]});if(!t)return r.jsx("div",{className:"hint",children:"正在读取方案包…"});const f=t.charts?JSON.stringify(t.charts,null,2):"",m=(c.outline||[]).filter(j=>j.level>=2&&j.level<=3),p=c.title||(e==null?void 0:e.name)||`任务 #${e==null?void 0:e.id}`,h=t.plan_found&&(t.plan_md||"").length>400&&!c.outline.length&&!/<(ul|ol|table)[ >]/.test(c.html);return r.jsxs("div",{className:"lp-plan",children:[h&&r.jsx("div",{className:"hint lp-warn",children:"这份方案正文没有 markdown 结构(无标题 / 列表 / 表格)——页面只渲染 Markdown, 纯文本方案会挤成一整段;建议让 agent 按《方案文档模板》重写 plan.md。"}),r.jsxs("div",{className:"lp-doc"+(m.length>=3?" has-rail":""),children:[m.length>=3&&r.jsxs("nav",{className:"lp-doc-rail","aria-label":"方案目录",children:[r.jsx("div",{className:"lp-doc-rail-t",children:"目录"}),r.jsx("ol",{children:m.map(j=>r.jsx("li",{className:j.level>2?"sub":"",children:r.jsxs("a",{href:"#"+j.id,className:l===j.id?"on":"",onClick:v=>{v.preventDefault(),d(j.id)},children:[r.jsx("span",{className:"no",children:j.no||"·"}),r.jsx("span",{className:"t",children:j.text})]})},j.id))})]}),r.jsxs("article",{className:"lp-doc-main",children:[r.jsxs("header",{className:"lp-doc-head",children:[r.jsxs("div",{className:"lp-doc-eyebrow",children:[r.jsxs("span",{className:"lp-doc-kind",children:["压测方案 · #",e==null?void 0:e.id]}),r.jsxs("span",{className:"lp-doc-chips",children:[r.jsx("span",{className:"lp-chip"+(t.found?" on":" off"),children:t.found?ET[t.driver]||t.driver:"未找到执行载体"}),r.jsx("span",{className:"lp-chip",children:(w=(g=t.charts)==null?void 0:g.panels)!=null&&w.length?`面板 ${t.charts.panels.length} 个`:"默认面板"}),t.has_html&&r.jsx("span",{className:"lp-chip",children:"自定义视图 ✓"})]})]}),r.jsx("h1",{className:"lp-doc-title",children:p}),c.meta.length>0&&r.jsx("dl",{className:"lp-doc-meta",children:c.meta.map((j,v)=>r.jsxs("div",{className:"lp-doc-meta-row",children:[r.jsx("dt",{children:j.k}),r.jsx("dd",{dangerouslySetInnerHTML:{__html:j.v}})]},v))})]}),t.plan_found?r.jsx("div",{className:"lp-doc-body md-body",ref:i,dangerouslySetInnerHTML:{__html:c.html}}):r.jsx("div",{className:"lp-doc-body",ref:i,children:r.jsxs("div",{className:"lp-empty-state",children:[r.jsx("div",{className:"lp-empty-t",children:"本任务未生成方案文档"}),r.jsxs("p",{children:[r.jsx("code",{children:"plan.md"})," 由压测第 1 轮的 agent 产出,用来回答「压谁、压多狠、 看什么、怎么算通过」。它缺失不影响发压执行,但发压前就没有可复核的书面方案—— 可在方案包目录 ",r.jsxs("code",{children:["load/task_",e==null?void 0:e.id,"/"]})," 下补一份 Markdown 方案。"]})]})})]})]}),!t.found&&r.jsxs("div",{className:"hint lp-warn",children:["本任务的方案包缺失(需在 <案例库根>/load/task_",e==null?void 0:e.id,"/ 下生成 run.py 或 scenario.json);发压轮会因此失败。"]}),t.charts_error&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,面板已回退默认:",t.charts_error]}),r.jsxs("div",{className:"lp-doc-appendix",children:[t.script_text&&r.jsx(ad,{title:"执行载体源码",note:t.script_name,children:r.jsx("pre",{className:"lp-code",children:t.script_text})}),f&&r.jsx(ad,{title:"图表声明",note:"charts.json",children:r.jsx("pre",{className:"lp-code",children:f})}),r.jsx(ad,{title:"指标口径速查",note:"写脚本 / 声明图表时对照",children:r.jsxs("ul",{className:"lp-tips",children:[r.jsxs("li",{children:[r.jsx("code",{children:"gauge"}),":瞬时值(rps / lat.p50·p90·p95·p99 / err.rate / conc)"]}),r.jsxs("li",{children:[r.jsx("code",{children:"counter"}),":单调递增累计值(req.total / 业务计数),面板按窗口增量或速率画"]}),r.jsxs("li",{children:[r.jsx("code",{children:"labels"}),":维度字典(如 ",r.jsx("code",{children:'{"status":"已成交"}'}),"), 同一 metric 靠它区分序列;",r.jsx("code",{children:"groupBy"})," 指定的就是这里的键"]}),r.jsxs("li",{children:[r.jsx("code",{children:"summary"}),":收尾 KPI 行,供单值卡与报告使用"]})]})})]})]})}const PT={running:"进行中",done:"成功",failed:"失败",stopped:"已停止",interrupted:"被中断",unknown:"历史(未登记)"};function TT(e,t){const n=((e==null?void 0:e.started_at)||"").slice(5,16)||((e==null?void 0:e.run_key)||"").replace("_"," ");return`${e!=null&&e.registered?`运行 #${t+1}`:"历史报告"} · ${n} · ${PT[e==null?void 0:e.status]||(e==null?void 0:e.status)||"未知"}`}const MT=1200;function $T(e,t){const n=Object.keys(t||{}).sort();return e+"|"+n.map(s=>`${s}=${t[s]}`).join(",")}function ex(e=MT){const t=new Map;return{add(n){if(!n||typeof n.metric!="string")return!1;const s=Number(n.value);if(!Number.isFinite(s))return!1;const o=Number(n.ts),l=$T(n.metric,n.labels);let a=t.get(l);return a||(a={key:l,metric:n.metric,labels:n.labels||{},type:n.type==="counter"?"counter":"gauge",points:[]},t.set(l,a)),a.points.push([Number.isFinite(o)?o:Date.now()/1e3,s]),a.points.length>e&&a.points.shift(),!0},list(){return[...t.values()]},size(){return t.size},clear(){t.clear()}}}function IT(e,t){if(!t)return!0;const n=e||{};return Object.entries(t).every(([s,o])=>String(n[s])===String(o))}function mm(e,t,n){const s=e.list().filter(l=>l.metric===t);if(!s.length)return null;if(n)return s.find(l=>IT(l.labels,n))||null;const o=s.find(l=>!Object.keys(l.labels).length);return o||s.sort((l,a)=>l.key.localeCompare(a.key))[0]}function AT(e,t){return e.list().filter(n=>n.metric===t&&Object.keys(n.labels).length)}function cu(e,t={}){const n=Number(t.scale)||1,s=e.points;if(e.type!=="counter")return s.map(([l,a])=>[l,a*n]);const o=[];for(let l=1;l<s.length;l+=1){const a=s[l][0]-s[l-1][0];if(a<=0)continue;const i=s[l][1]-s[l-1][1];o.push([s[l][0],(t.rate?i/a:i)*n])}return o}function hm(e,t,n="last"){if(!e.length||t<=0)return e.slice();const s=new Map;return e.forEach(([o,l])=>{const a=Math.floor(o/t)*t,i=s.get(a);i?(i.sum+=l,i.n+=1,i.last=l):s.set(a,{t:a,sum:l,n:1,last:l})}),[...s.entries()].sort((o,l)=>o[0]-l[0]).map(([o,l])=>n==="avg"?[o,l.sum/l.n]:n==="sum"?[o,l.sum]:[o,l.last])}function OT(e,t=600){if(e.length<=t)return e;const n=e.length/t,s=[];for(let l=0;l<t;l+=1)s.push(e[Math.floor(l*n)]);const o=e[e.length-1];return s[s.length-1]!==o&&s.push(o),s}function Yw(e,t,n){const s=[];return e.list().filter(o=>o.metric===t).forEach(o=>{var a;if(!o.points.length)return;const l=n?(a=o.labels)==null?void 0:a[n]:Object.values(o.labels||{})[0]??"全部";s.push({label:String(l??"全部"),value:o.points[o.points.length-1][1],labels:o.labels||{}})}),s.sort((o,l)=>l.value-o.value)}function LT(e,t="last",n=1){if(!e||!e.points.length)return null;const s=e.points.map(([,l])=>l);let o;return t==="avg"?o=s.reduce((l,a)=>l+a,0)/s.length:t==="max"?o=Math.max(...s):t==="min"?o=Math.min(...s):t==="sum"?o=s.reduce((l,a)=>l+a,0):o=s[s.length-1],o*(Number(n)||1)}function Mo(e,t){if(e==null||!Number.isFinite(e))return"—";if(t!=null&&t!=="")return Number(e).toFixed(Number(t));const n=Math.abs(e);return n>=1e3?Math.round(e).toLocaleString("en-US"):n>=10?e.toFixed(1):n>=1?e.toFixed(2):n===0?"0":e.toFixed(3)}function gm(e){let t=1/0,n=-1/0;return e.forEach(s=>s.forEach(([o])=>{o<t&&(t=o),o>n&&(n=o)})),n>t?n-t:0}function xm(e,t=600){return!e||e<=0?1:Math.max(1,Math.ceil(e/t))}const Yn=["var(--run)","var(--retest)","var(--fail)","var(--pass)","var(--fix)","#8ab4f8","#c58af9","#f6bf72"],Hr=640,Wr=150,Dt={l:48,r:10,t:10,b:18},Af=600,zT=40;function qr({text:e="暂无数据(本轮尚未产生该指标)"}){return r.jsx("div",{className:"lp-empty hint",children:e})}function Qw(e,t,n,s){const o=t-e,l=s-n;return{x:a=>Dt.l+(o>0?(a-e)/o:.5)*(Hr-Dt.l-Dt.r),y:a=>Wr-Dt.b-(l>0?(a-n)/l:.5)*(Wr-Dt.t-Dt.b)}}function vm({scale:e,vmin:t,vmax:n}){const s=[t,(t+n)/2,n];return r.jsx("g",{children:s.map((o,l)=>r.jsxs("g",{children:[r.jsx("line",{x1:Dt.l,x2:Hr-Dt.r,y1:e.y(o),y2:e.y(o),stroke:"var(--border)",strokeWidth:"0.5",strokeDasharray:"3 3"}),r.jsx("text",{x:Dt.l-4,y:e.y(o)+3,textAnchor:"end",style:{fontSize:9,fill:"var(--dim)"},children:Mo(o)})]},l))})}function DT({panel:e,store:t}){const n=(e.series||[]).map((m,p)=>{const h=mm(t,m.metric,m.match),g=h?cu(h,{scale:m.scale,rate:h.type==="counter"}):[],w=xm(gm([g]),Af);return{label:m.label||m.metric,color:Yn[p%Yn.length],points:OT(hm(g,w,h&&h.type==="gauge"?"last":"sum"),Af),suffix:h&&h.type==="counter"?"/s":""}}),s=n.flatMap(m=>m.points);if(!s.length)return r.jsx(qr,{});const o=s.map(m=>m[0]),l=s.map(m=>m[1]),[a,i]=[Math.min(...o),Math.max(...o)],c=Math.max(...l,0),d=Math.min(...l,0),f=Qw(a,i,d,c);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Hr} ${Wr}`,className:"lp-svg",children:[r.jsx(vm,{scale:f,vmin:d,vmax:c}),n.map(m=>r.jsx("polyline",{fill:"none",strokeWidth:"1.6",stroke:m.color,points:m.points.map(([p,h])=>`${f.x(p)},${f.y(h)}`).join(" ")},m.label))]}),r.jsx("div",{className:"lp-legend",children:n.map(m=>r.jsxs("span",{children:[r.jsx("i",{style:{background:m.color}}),m.label,m.suffix]},m.label))})]})}function FT({panel:e,store:t}){if(e.by==="label"||!e.by&&e.groupBy){const m=Yw(t,e.metric,e.groupBy);if(!m.length)return r.jsx(qr,{});const p=Math.max(...m.map(h=>h.value),1);return r.jsx("div",{className:"lp-bars",children:m.map((h,g)=>r.jsxs("div",{className:"lp-bar-row",children:[r.jsx("span",{className:"lb",title:h.label,children:h.label}),r.jsx("span",{className:"lt",children:r.jsx("i",{style:{width:`${h.value/p*100}%`,background:Yn[g%Yn.length]}})}),r.jsx("span",{className:"lv",children:Mo(h.value,e.precision)})]},h.label))})}const n=mm(t,e.metric);if(!n)return r.jsx(qr,{});const s=n.type==="counter",o=cu(n,{scale:e.scale,rate:s}),l=xm(gm([o]),Af/4),a=hm(o,l,s?"sum":"avg");if(!a.length)return r.jsx(qr,{});const i=a.map(m=>m[0]),c=a.map(m=>m[1]),d=Qw(Math.min(...i),Math.max(...i),0,Math.max(...c,1)),f=Math.max(1,(Hr-Dt.l-Dt.r)/a.length*.7);return r.jsxs("svg",{viewBox:`0 0 ${Hr} ${Wr}`,className:"lp-svg",children:[r.jsx(vm,{scale:d,vmin:0,vmax:Math.max(...c,1)}),a.map(([m,p])=>r.jsx("rect",{x:d.x(m)-f/2,y:d.y(p),width:f,height:Wr-Dt.b-d.y(p),fill:Yn[0],opacity:"0.85"},m))]})}function BT({panel:e,store:t}){const s=AT(t,e.metric).map(g=>{var w;return{label:String(((w=g.labels)==null?void 0:w[e.groupBy])??Object.values(g.labels)[0]??"?"),type:g.type,points:cu(g,{rate:!1})}}).filter(g=>g.points.length);if(!s.length)return r.jsx(qr,{});const o=gm(s.map(g=>g.points)),l=Math.max(xm(o,zT),1),a=new Map;s.forEach(g=>{hm(g.points,l,g.type==="counter"?"sum":"avg").forEach(([w,j])=>{a.has(w)||a.set(w,{}),a.get(w)[g.label]=j})});const i=[...a.keys()].sort((g,w)=>g-w),c=i.map(g=>Object.values(a.get(g)).reduce((w,j)=>w+j,0)),d=Math.max(...c,1),f=s.map(g=>g.label),m=Math.max(1,(Hr-Dt.l-Dt.r)/i.length*.7),p=g=>Dt.l+(g-i[0])/Math.max(i[i.length-1]-i[0],1)*(Hr-Dt.l-Dt.r),h=g=>Wr-Dt.b-g/d*(Wr-Dt.t-Dt.b);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Hr} ${Wr}`,className:"lp-svg",children:[r.jsx(vm,{scale:{x:p,y:h},vmin:0,vmax:d}),i.map(g=>{let w=0;return r.jsx("g",{children:f.map((j,v)=>{const x=a.get(g)[j]||0,y=h(w);w+=x;const b=h(w);return x>0?r.jsx("rect",{x:p(g)-m/2,y:b,width:m,height:y-b,fill:Yn[v%Yn.length],opacity:"0.9"},j):null})},g)})]}),r.jsx("div",{className:"lp-legend",children:f.map((g,w)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Yn[w%Yn.length]}}),g]},g))})]})}function UT({panel:e,store:t}){const n=Yw(t,e.metric,e.groupBy),s=n.reduce((i,c)=>i+Math.max(c.value,0),0);if(!n.length||s<=0)return r.jsx(qr,{});const o=52,l=2*Math.PI*o;let a=0;return r.jsxs("div",{className:"lp-donut",children:[r.jsxs("svg",{viewBox:"0 0 140 140",className:"lp-donut-svg",children:[r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:"var(--border)",strokeWidth:"18"}),n.map((i,c)=>{const d=Math.max(i.value,0)/s,f=`${d*l} ${l}`,m=-a*l;return a+=d,r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:Yn[c%Yn.length],strokeWidth:"18",strokeDasharray:f,strokeDashoffset:m,transform:"rotate(-90 70 70)"},i.label)}),r.jsx("text",{x:"70",y:"74",textAnchor:"middle",style:{fontSize:15,fill:"var(--foreground)"},children:Mo(s)})]}),r.jsx("div",{className:"lp-legend col",children:n.map((i,c)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Yn[c%Yn.length]}}),i.label," ",r.jsx("b",{children:Mo(i.value)}),r.jsxs("em",{children:[(i.value/s*100).toFixed(1),"%"]})]},i.label))})]})}function VT({panel:e,store:t}){const n=(e.stats||[]).map(s=>{const o=mm(t,s.metric,s.match);return{...s,value:LT(o,s.agg,s.scale)}});return r.jsx("div",{className:"lp-stats",children:n.map(s=>r.jsxs("div",{className:"lp-stat",children:[r.jsx("div",{className:"k",children:s.label||s.metric}),r.jsxs("div",{className:"v",children:[Mo(s.value,s.precision),s.unit?r.jsx("span",{className:"u",children:s.unit}):null]})]},s.metric+(s.label||"")))})}function HT({panel:e,store:t}){const n=t.list().filter(a=>a.metric===e.metric);if(!n.length)return r.jsx(qr,{});const s=e.groupBy||null,o=n.map(a=>{var m;const i=a.points.length?a.points[a.points.length-1][1]:null,c=cu(a,{rate:a.type==="counter"}),d=c.length?c[c.length-1][1]:null,f=s?(m=a.labels)==null?void 0:m[s]:Object.values(a.labels||{}).join(" / ")||"全部";return{dim:String(f??"全部"),labels:a.labels||{},last:i,rate:d,type:a.type}}),l=o.some(a=>a.type==="counter");return r.jsx("div",{className:"lp-table-wrap",children:r.jsxs("table",{className:"lp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:s||"维度"}),r.jsx("th",{style:{textAlign:"right"},children:"最新值"}),l&&r.jsx("th",{style:{textAlign:"right"},children:"速率 /s"})]})}),r.jsx("tbody",{children:o.map(a=>r.jsxs("tr",{children:[r.jsx("td",{title:JSON.stringify(a.labels),children:a.dim}),r.jsx("td",{style:{textAlign:"right"},children:Mo(a.last)}),l&&r.jsx("td",{style:{textAlign:"right"},children:Mo(a.rate)})]},a.dim+JSON.stringify(a.labels)))})]})})}function WT({panel:e,store:t}){const n={panel:e,store:t};return e.type==="line"?r.jsx(DT,{...n}):e.type==="bar"?r.jsx(FT,{...n}):e.type==="stacked_bar"?r.jsx(BT,{...n}):e.type==="donut"?r.jsx(UT,{...n}):e.type==="stat"?r.jsx(VT,{...n}):e.type==="table"?r.jsx(HT,{...n}):r.jsx(qr,{text:`未支持的面板类型:${e.type}`})}const qT=2e3,GT=40;function KT({task:e,store:t}){const n=u.useRef(null),s=e==null?void 0:e.id;function o(){const l=n.current&&n.current.contentWindow;if(!l)return;const a=t.list().slice(0,GT).map(i=>({metric:i.metric,labels:i.labels,type:i.type,points:i.points.slice(-300)}));l.postMessage({type:"ts.metrics",task:s,series:a},"*")}return u.useEffect(()=>{if(!s)return;const l=setInterval(o,qT);return()=>clearInterval(l)},[s,t]),s?r.jsxs("section",{className:"lp-panel full lp-hatch",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"自定义视图(panel.html)"}),r.jsx("span",{className:"hint",children:"沙箱 iframe:读不到站点数据,只能消费 postMessage 推入的指标"})]}),r.jsx("iframe",{ref:n,sandbox:"allow-scripts",title:"自定义压测视图",className:"lp-hatch-frame",src:Be.loadCustomHtmlUrl(s),onLoad:o})]}):null}const YT=1e3,QT=2e4,XT=20;function Xw({task:e,run:t="",live:n}){const[s,o]=u.useState(null),[l,a]=u.useState(""),[i,c]=u.useState(!1),[d,f]=u.useState(!0),[m,p]=u.useState(""),[,h]=u.useState(0),g=u.useRef(ex()),w=e==null?void 0:e.id,j=n===void 0?(e==null?void 0:e.status)==="running"&&!t:!!n;u.useEffect(()=>{if(!w)return;let x=!1;return f(!0),p(""),Be.loadCase(w).then(y=>{x||(o(y.charts||null),a(y.charts_error||""),c(!!y.has_html),f(!1))}).catch(y=>{x||(p(y.message),f(!1))}),()=>{x=!0}},[w,j]),u.useEffect(()=>{if(!w||!s)return;g.current=ex(),h(b=>b+1);let x=!1;const y=()=>{x||h(b=>b+1)};if(j){const b=Be.loadStream(w,t),S=setInterval(y,YT);return b.onmessage=N=>{try{const k=JSON.parse(N.data);if(k.done){b.close(),clearInterval(S),y();return}g.current.add(k)}catch{}},()=>{x=!0,b.close(),clearInterval(S)}}return(async()=>{let b=0;for(let S=0;S<XT;S+=1){const N=await Be.loadMetrics(w,b,QT,t);if(x)return;const k=N.samples||[];if(k.forEach(C=>g.current.add(C)),!k.length||N.next<=b)break;b=N.next}y()})().catch(b=>{x||p(b.message)}),()=>{x=!0}},[w,j,s,t]);const v=(s==null?void 0:s.panels)||[];return r.jsxs("div",{className:"lp-dash",children:[l&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,已回退默认面板:",l]}),m&&r.jsxs("div",{className:"hint lp-warn",children:["指标加载失败:",m]}),d&&!v.length?r.jsx("div",{className:"hint",children:"正在读取方案包…"}):r.jsx("div",{className:"lp-grid",children:v.map(x=>r.jsxs("section",{className:"lp-panel "+(x.width==="full"?"full":"half"),children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:x.title}),x.hint&&r.jsx("span",{className:"hint",children:x.hint})]}),r.jsx(WT,{panel:x,store:g.current})]},x.id))}),i&&r.jsx(KT,{task:e,store:g.current})]})}const JT=5e3,ZT=2e3;function eM(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/STRESS_DONE|ROUND_DONE|LOAD 总请求/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}function tM({task:e}){const[t,n]=u.useState([]),[s,o]=u.useState(""),[l,a]=u.useState(0),[i,c]=u.useState(""),[d,f]=u.useState(null),m=u.useRef(null),p=u.useRef(!0),h=e==null?void 0:e.id,g=(e==null?void 0:e.status)==="running",w=e==null?void 0:e.ended_at;u.useEffect(()=>{if(!h)return;let k=!1;return Be.loadRuns(h).then(C=>{if(k)return;const O=C.runs||[];n(O),o(P=>O.some(D=>D.run_key===P)?P:O.length?O[0].run_key:"")}).catch(()=>{k||n([])}),()=>{k=!0}},[h,g,w,l]);const j=t.findIndex(k=>k.run_key===s),v=j>=0?t[j]:t[0]||null,x=(v==null?void 0:v.run_key)||"",y=(v==null?void 0:v.status)==="running",b=(v==null?void 0:v.round_no)||0;u.useEffect(()=>{if(!h||!b){c("");return}let k=!1;const C=async()=>{const P=m.current;p.current=P?P.scrollHeight-P.scrollTop-P.clientHeight<60:!0;try{const D=await Be.log(h,b,JT);k||c(W=>W===D.log?W:D.log)}catch{k||c("")}};C();const O=setInterval(C,ZT);return()=>{k=!0,clearInterval(O)}},[h,b,l]),u.useEffect(()=>{const k=m.current;k&&p.current&&(k.scrollTop=k.scrollHeight)},[i]),u.useEffect(()=>{if(!h||y){f(null);return}let k=!1;return Be.loadReport(h,x).then(C=>{k||f(C)}).catch(()=>{k||f(null)}),()=>{k=!0}},[h,x,y,w,l]);const S=u.useMemo(()=>i?i.split(`
468
- `):[],[i]),N=u.useMemo(()=>d!=null&&d.found?Kw(d.md).html:"",[d]);return r.jsxs("div",{className:"lp-log",children:[r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行"}),r.jsx("span",{className:"hint",children:"每次发压是一次运行(报告 / 曲线 / 日志都按运行切分)"}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"lp-chip",title:"刷新运行列表",onClick:()=>a(k=>k+1),children:"↻ 刷新"}),t.length>0&&r.jsxs(It,{value:x,onValueChange:o,children:[r.jsx(Et,{size:"sm",className:"h-7 min-w-[220px] text-xs",children:r.jsx(Ct,{})}),r.jsx(Rt,{children:t.map((k,C)=>r.jsx(Ae,{value:k.run_key,children:TT(k,C)},k.run_key))})]})]})]}),!t.length&&r.jsx("div",{className:"hint",children:g?"发压中…(运行列表稍后自动刷新)":"暂无运行记录(发压结束后生成报告与曲线)"}),v&&!v.has_metrics&&r.jsx("div",{className:"hint lp-warn",children:"该运行为存量报告(无曲线数据);可查看下方报告。"})]}),(!v||v.has_metrics)&&r.jsx(Xw,{task:e,run:x,live:y}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行日志"}),v&&r.jsx("span",{className:"hint",children:v.registered?`第 ${v.round_no} 轮(发压)`:"存量运行无独立日志"})]}),r.jsx("div",{className:"log lp-logbox",ref:m,children:S.length?S.map((k,C)=>r.jsx("div",{className:"log-line "+eM(k),children:k||" "},C)):r.jsx("div",{className:"hint",children:b?"该运行暂无日志":"该运行没有独立日志文件"})})]}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"压测报告"}),(d==null?void 0:d.found)&&r.jsxs("span",{className:"hint",children:[d.file,d.run_key?`(运行键 ${d.run_key})`:""]}),(d==null?void 0:d.found)&&r.jsx("button",{type:"button",className:"lp-chip ml-auto",title:"复制报告文件名",onClick:()=>{var k;(k=navigator.clipboard)==null||k.writeText(d.file||""),T("已复制报告文件名")},children:"复制文件名"})]}),d!=null&&d.found?r.jsx("div",{className:"lp-report",children:r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:N}})}):r.jsx("div",{className:"hint",children:y?"发压中,结束后生成报告":v?"该运行暂无报告":"暂无压测报告(发压结束或被停止后生成)"})]})]})}var nM=Object.defineProperty,ym=(e,t)=>nM(e,"name",{value:t,configurable:!0}),id=!1;function Jw(){const[e,t]=u.useState(id);return u.useEffect(()=>{id||(id=!0,t(!0))},[]),e}ym(Jw,"useIsHydrated");var Zw=$o[" useSyncExternalStore ".trim().toString()];function ej(){return()=>{}}ym(ej,"subscribe");function tj(){return Zw(ej,()=>!0,()=>!1)}ym(tj,"useIsHydratedModern");var sM=typeof Zw=="function"?tj:Jw,rM=Object.defineProperty,Fo=(e,t)=>rM(e,"name",{value:t,configurable:!0}),cd="rovingFocusGroup.onEntryFocus",oM={bubbles:!1,cancelable:!0},uu="RovingFocusGroup",[Of,nj,lM]=Gp(uu),[aM,sj]=no(uu,[lM]),[iM,cM]=aM(uu),uM=u.forwardRef(Fo(function(t,n){return r.jsx(Of.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(Of.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(dM,{...t,ref:n})})})},"RovingFocusGroup")),dM=u.forwardRef(Fo(function(t,n){const{__scopeRovingFocusGroup:s,orientation:o,loop:l=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=t,h=u.useRef(null),g=vt(n,h),w=Jc(a),[j,v]=El({prop:i,defaultProp:c??null,onChange:d,caller:uu}),[x,y]=u.useState(!1),b=Rs(f),S=nj(s),N=u.useRef(!1),[k,C]=u.useState(0);return u.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(cd,b),()=>O.removeEventListener(cd,b)},[b]),r.jsx(iM,{scope:s,orientation:o,dir:w,loop:l,currentTabStopId:j,onItemFocus:u.useCallback(O=>v(O),[v]),onItemShiftTab:u.useCallback(()=>y(!0),[]),onFocusableItemAdd:u.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:u.useCallback(()=>C(O=>O-1),[]),children:r.jsx(ot.div,{tabIndex:x||k===0?-1:0,"data-orientation":o,...p,ref:g,style:{outline:"none",...t.style},onMouseDown:Ke(t.onMouseDown,()=>{N.current=!0}),onFocus:Ke(t.onFocus,O=>{const P=!N.current;if(O.target===O.currentTarget&&P&&!x){const D=new CustomEvent(cd,oM);if(O.currentTarget.dispatchEvent(D),!D.defaultPrevented){const W=S().filter(V=>V.focusable),G=W.find(V=>V.active),$=W.find(V=>V.id===j),te=[G,$,...W].filter(Boolean).map(V=>V.ref.current);wm(te,m)}}N.current=!1}),onBlur:Ke(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),fM="RovingFocusGroupItem",pM=u.forwardRef(Fo(function(t,n){const{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:a,children:i,...c}=t,d=Ur(),f=a||d,m=cM(fM,s),p=m.currentTabStopId===f,h=nj(s),{onFocusableItemAdd:g,onFocusableItemRemove:w,currentTabStopId:j}=m,v=sM();return Ot(()=>{if(!(!v||!o))return g(),()=>w()},[v,o,g,w]),u.useEffect(()=>{if(!(v||!o))return g(),()=>w()},[v,o,g,w]),r.jsx(Of.ItemSlot,{scope:s,id:f,focusable:o,active:l,children:r.jsx(ot.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:n,onMouseDown:Ke(t.onMouseDown,x=>{o?m.onItemFocus(f):x.preventDefault()}),onFocus:Ke(t.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ke(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){m.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=oj(x,m.orientation,m.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=h().filter(N=>N.focusable).map(N=>N.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const N=S.indexOf(x.currentTarget);S=m.loop?lj(S,N+1):S.slice(N+1)}setTimeout(()=>wm(S))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:j!=null}):i})})},"RovingFocusGroupItem")),mM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Fo(rj,"getDirectionAwareKey");function oj(e,t,n){const s=rj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return mM[s]}Fo(oj,"getFocusIntent");function wm(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}Fo(wm,"focusFirst");function lj(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Fo(lj,"wrapArray");var hM=uM,gM=pM,xM=Object.defineProperty,Dl=(e,t)=>xM(e,"name",{value:t,configurable:!0}),jm="Tabs",[vM,f$]=no(jm,[sj]),aj=sj(),[yM,bm]=vM(jm),wM=u.forwardRef(Dl(function(t,n){const{__scopeTabs:s,value:o,onValueChange:l,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=t,m=Jc(c),[p,h]=El({prop:o,onChange:l,defaultProp:a??"",caller:jm});return r.jsx(yM,{scope:s,baseId:Ur(),value:p,onValueChange:h,orientation:i,dir:m,activationMode:d,children:r.jsx(ot.div,{dir:m,"data-orientation":i,...f,ref:n})})},"Tabs")),jM="TabsList",bM=u.forwardRef(Dl(function(t,n){const{__scopeTabs:s,loop:o=!0,...l}=t,a=bm(jM,s),i=aj(s);return r.jsx(hM,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:r.jsx(ot.div,{role:"tablist","aria-orientation":a.orientation,...l,ref:n})})},"TabsList")),_M="TabsTrigger",SM=u.forwardRef(Dl(function(t,n){const{__scopeTabs:s,value:o,disabled:l=!1,...a}=t,i=bm(_M,s),c=aj(s),d=_m(i.baseId,o),f=Sm(i.baseId,o),m=o===i.value;return r.jsx(gM,{asChild:!0,...c,focusable:!l,active:m,children:r.jsx(ot.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...a,ref:n,onMouseDown:Ke(t.onMouseDown,p=>{!l&&p.button===0&&p.ctrlKey===!1?i.onValueChange(o):p.preventDefault()}),onKeyDown:Ke(t.onKeyDown,p=>{l||p.target!==p.currentTarget||[" ","Enter"].includes(p.key)&&i.onValueChange(o)}),onFocus:Ke(t.onFocus,()=>{const p=i.activationMode!=="manual";!m&&!l&&p&&i.onValueChange(o)})})})},"TabsTrigger")),kM="TabsContent",NM=u.forwardRef(Dl(function(t,n){const{__scopeTabs:s,value:o,forceMount:l,children:a,...i}=t,c=bm(kM,s),d=_m(c.baseId,o),f=Sm(c.baseId,o),m=o===c.value,p=u.useRef(m);return u.useEffect(()=>{const h=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(h)},[]),r.jsx(Ha,{present:l||m,children:({present:h})=>r.jsx(ot.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!h,id:f,tabIndex:0,...i,ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0},children:h&&a})})},"TabsContent"));function _m(e,t){return`${e}-trigger-${t}`}Dl(_m,"makeTriggerId");function Sm(e,t){return`${e}-content-${t}`}Dl(Sm,"makeContentId");var CM=wM,EM=bM,RM=SM,PM=NM;const ij=CM,km=u.forwardRef(({className:e,...t},n)=>r.jsx(EM,{ref:n,"data-slot":"tabs-list",className:Ve("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t}));km.displayName="TabsList";const Mc=u.forwardRef(({className:e,...t},n)=>r.jsx(RM,{ref:n,"data-slot":"tabs-trigger",className:Ve("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t}));Mc.displayName="TabsTrigger";const Rr=u.forwardRef(({className:e,...t},n)=>r.jsx(PM,{ref:n,"data-slot":"tabs-content",className:Ve("flex-1 outline-none",e),...t}));Rr.displayName="TabsContent";const TM=["done","failed","stopped","interrupted"];function MM(){const e=$n(),t=e.currentProject,n=u.useMemo(()=>e.tasks.filter(N=>N.project_id===(t==null?void 0:t.id)&&N.task_type==="stress").sort((N,k)=>(k.created_at||"").localeCompare(N.created_at||"")),[e.tasks,t==null?void 0:t.id]),[s,o]=u.useState(null),[l,a]=u.useState("plan"),[i,c]=u.useState({}),d=u.useRef({}),[f,m]=u.useState([]),[p,h]=u.useState(""),g=n.find(N=>N.id===s)||null,w=g==null?void 0:g.status,j=TM.includes(w),v=w==="running"||w==="queued",x=f.filter(N=>N.registered).length;u.useEffect(()=>{if(!s){m([]);return}let N=!1;return Be.loadRuns(s).then(k=>{N||m(k.runs||[])}).catch(()=>{N||m([])}),()=>{N=!0}},[s,w,p]);async function y(N){if(g){h(N);try{N==="rerun"?await Be.loadRerun(g.id):N==="stop"?await Be.stop(g.id):N==="diagnose"?await Be.loadDiagnose(g.id):N==="restart"&&await Be.restart(g.id),T({rerun:"已入队复压(同一方案再压一次),等待执行",stop:"已请求停止",diagnose:"已把运行现场发给 agent(项目忙时排队)",restart:"已清空运行记录并重启(从第 1 轮重跑)"}[N])}catch(k){T(k.message)}finally{h("")}}}function b(){window.confirm(`用现有方案包再压一次「${g.name}」?
469
- (跳过 agent 出方案,直接发压并生成新一份报告/曲线)`)&&y("rerun")}function S(){window.confirm(`重启「${g.name}」将清空全部运行记录,从第 1 轮重跑(agent 重新出方案)。
470
- 历史报告文件仍留在 load/report/ 目录。继续?`)&&y("restart")}return u.useEffect(()=>{if(!n.length){o(null);return}n.some(N=>N.id===s)||o(n[0].id)},[n,s]),u.useEffect(()=>{const N=n.filter(k=>{const C=`${k.id}:${k.status}`;return!d.current[C]});N.length&&(N.forEach(k=>{d.current[`${k.id}:${k.status}`]=!0}),Promise.all(N.map(k=>Be.loadCaseMeta(k.id).then(C=>[k.id,C]).catch(()=>[k.id,null]))).then(k=>{c(C=>{const O={...C};return k.forEach(([P,D])=>{D&&(O[P]=D)}),O})}))},[n]),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("aside",{className:"flex w-[300px] flex-none flex-col border-r border-border",children:[r.jsxs("div",{className:"flex-none px-3 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:["压测任务(",n.length,")"]}),r.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2",children:[n.map(N=>{const k=i[N.id];return r.jsxs("button",{type:"button",className:"load-item"+(s===N.id?" on":""),onClick:()=>o(N.id),children:[r.jsx("div",{className:"truncate text-[calc(13px*var(--fs))] font-semibold",title:N.name,children:N.name}),r.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[calc(11px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{className:"badge st-"+N.status,children:[r.jsx("span",{className:"dot"}),lr[N.status]||N.status]}),r.jsxs("span",{children:["轮 ",N.current_round]}),r.jsx("span",{className:"ml-auto",children:rs(N.created_at)})]}),k&&r.jsxs("div",{className:"lp-marks",children:[k.plan_found&&r.jsx("span",{className:"lp-chip sm",children:"方案 ✓"}),k.driver==="script"&&r.jsx("span",{className:"lp-chip sm",children:"脚本"}),k.driver==="scenario"&&r.jsx("span",{className:"lp-chip sm",children:"场景"}),k.driver==="legacy_scenario"&&r.jsx("span",{className:"lp-chip sm",children:"存量场景"}),!k.found&&r.jsx("span",{className:"lp-chip sm off",children:"无方案"}),k.has_html&&r.jsx("span",{className:"lp-chip sm",children:"自定义视图"})]}),N.error&&r.jsx("div",{className:"mt-1 truncate text-[calc(11px*var(--fs))]",style:{color:"var(--fail)"},title:N.error,children:N.error})]},N.id)}),!n.length&&r.jsx("div",{className:"p-2 text-xs leading-relaxed text-muted-foreground",children:"暂无压测任务。在「测试任务」页新建类型为「压力测试」的任务(填写压测说明)后,会自动显示在这里。"})]})]}),r.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:g?r.jsxs(ij,{value:l,onValueChange:a,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-3",children:[r.jsx("h3",{className:"m-0 font-serif text-[calc(15px*var(--fs))] font-semibold",children:g.name}),r.jsxs("span",{className:"badge st-"+g.status,children:[r.jsx("span",{className:"dot"}),lr[g.status]||g.status]}),r.jsxs("span",{className:"lp-chip sm",children:["已跑 ",x," 次"]}),r.jsxs(km,{className:"ml-2 h-8",children:[r.jsx(Mc,{value:"plan",className:"px-3",children:"压测方案"}),r.jsx(Mc,{value:"log",className:"px-3",children:"压测日志"})]}),r.jsxs("span",{className:"ml-auto font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:["创建 ",rs(g.created_at),g.started_at?` · 开始 ${rs(g.started_at)}`:"",g.ended_at?` · 结束 ${rs(g.ended_at)}`:""]})]}),r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-2",children:[r.jsx(F,{size:"sm",variant:"outline",disabled:!j||!!p,title:"跳过 agent,用现有方案包再压一次(生成新一份报告与曲线)",onClick:b,children:"复压"}),v&&r.jsx(F,{size:"sm",variant:"outline",disabled:!!p,title:"停止当前运行(先落 stop 文件,宽限 10s 后杀进程树)",onClick:()=>y("stop"),children:"停止"}),r.jsx(F,{size:"sm",variant:"outline",disabled:!g.session_id||v||!!p,title:g.session_id?"把最近一次运行的现场(退出码/指标摘要/日志尾)发给该任务的 agent 会话":"会话尚未生成(首轮执行后才有)",onClick:()=>y("diagnose"),children:"诊断"}),r.jsx(F,{size:"sm",variant:"outline",disabled:!j||!!p,title:"清空运行记录,从第 1 轮重跑(agent 重新出方案)——与「复压」不同",onClick:S,children:"重启(换方案)"}),p&&r.jsx("span",{className:"hint",children:"处理中…"}),!j&&v&&r.jsx("span",{className:"hint",children:"运行中:结束后可复压 / 诊断 / 重启"})]}),g.error&&r.jsxs("div",{className:"px-4 pt-1 text-xs",style:{color:"var(--fail)"},children:["错误:",g.error]}),r.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[r.jsx(Rr,{value:"plan",children:r.jsx(RT,{task:g})}),r.jsx(Rr,{value:"log",children:r.jsx(tM,{task:g})})]})]}):r.jsx("div",{className:"mt-16 text-center text-sm text-muted-foreground",children:"← 从左侧选择一个压测任务查看方案与指标"})})]})}const $M={project_dir:"项目目录",work_dir:"工作目录"},cj=[{key:"board",label:"开发看板"},{key:"tasks",label:"测试任务"},{key:"stress",label:"压测面板"},{key:"monitor",label:"监控面板"},{key:"bugs",label:"Bug 报告"}],Xi=cj.map(e=>e.key),tx=Object.fromEntries(cj.map(e=>[e.key,e.label]));function qo(e){const t=(Array.isArray(e==null?void 0:e.order)?e.order:[]).filter(s=>Xi.includes(s));for(const s of Xi)t.includes(s)||t.push(s);const n=(Array.isArray(e==null?void 0:e.hidden)?e.hidden:[]).filter(s=>Xi.includes(s));return{order:t,hidden:n}}function nx(e){const t=(e||"").split(/[\\/]+/).filter(Boolean);for(let n=t.length-1;n>=0;n--)if(!/^[A-Za-z]:$/.test(t[n]))return t[n];return""}const Lf="ts.sidebarW",uj=180,dj=480,fj=230;function IM(){const e=parseInt(localStorage.getItem(Lf),10);return Number.isFinite(e)?Math.min(dj,Math.max(uj,e)):fj}function sx(){var Ga,Ka,Ya;const e=Al(),t=Xn(),n=$n(),[s,o]=u.useState(localStorage.getItem("ts_cur_tab")||"board"),[l,a]=u.useState(null),[i,c]=u.useState(!1),[d,f]=u.useState(null),m=u.useRef(null);m.current=l;const p=u.useRef(!1),h=u.useRef(null),[g,w]=u.useState(!1),[j,v]=u.useState(null),[x,y]=u.useState([]),[b,S]=u.useState(!1),[N,k]=u.useState([]),[C,O]=u.useState(null),[P,D]=u.useState(!1),[W,G]=u.useState(!1),[$,K]=u.useState({name:"",project_dir:"",agent_path:"",work_dir:"",env_label:"",guide_text:"",model:"",reasoning_effort:"",permission_mode:"",skill_understand:"",skill_deploy:"",skill_commit:"",skill_test:"",skill_cases:""}),[te,V]=u.useState({models:[],default:""}),[L,Y]=u.useState([]),[z,we]=u.useState(!1),[X,Re]=u.useState(null),[Pe,ke]=u.useState(!1),[Z,ge]=u.useState("project_dir"),[ae,ce]=u.useState(!1),[_e,pe]=u.useState(""),[E,B]=u.useState(!1),[A,ie]=u.useState(null),[oe,Oe]=u.useState(""),{rzOn:Ye,rzStyle:dt,rzStart:st,rzDragStart:Lt,rzReset:gt}=sr(),{rzOn:fn,rzStyle:jn,rzDragStart:le}=sr(),{rzOn:J,rzStyle:We,rzDragStart:Yt,rzReset:Un}=sr(),{rzOn:Tt,rzStyle:tt,rzDragStart:Mt,rzReset:Rn}=sr(),Pn=u.useRef(null),[ts,R]=u.useState([]),U=u.useRef([]);U.current=ts;const[ne,ue]=u.useState(null),de=u.useRef(!1),me=u.useRef(null),[Te,Fe]=u.useState(IM),Qe=u.useRef(Te);Qe.current=Te;function Je(_){const re=U.current;if(!re.length)return _;const Se=new Map(re.map((ze,qe)=>[ze,qe]));return[..._].sort((ze,qe)=>(Se.has(ze.id)?Se.get(ze.id):1/0)-(Se.has(qe.id)?Se.get(qe.id):1/0))}function _t(_){const re=$n.getState().projects.map(kt=>kt.id),Se=U.current.filter(kt=>re.includes(kt)),ze=[...Se,...re.filter(kt=>!Se.includes(kt))],qe=new Set(_),De=[];let en=0;for(const kt of ze)De.push(qe.has(kt)?_[en++]:kt);return U.current=De,R(De),De}function xs(_,re){if(_.button!==0||_.target.closest("button"))return;const Se={id:re,sx:_.clientX,sy:_.clientY,on:!1};me.current=Se;const ze=De=>{var Q,he,fe,Ne;if(!me.current)return;if(!Se.on){if(Math.hypot(De.clientX-Se.sx,De.clientY-Se.sy)<6)return;Se.on=!0,de.current=!0,ue(Se.id),document.body.classList.add("projlist-dragging")}const en=+((Ne=(fe=(he=(Q=document.elementFromPoint(De.clientX,De.clientY))==null?void 0:Q.closest)==null?void 0:he.call(Q,"[data-proj-id]"))==null?void 0:fe.dataset)==null?void 0:Ne.projId);if(!en||en===Se.id)return;const kt=Je($n.getState().projects).filter($e=>!!$e.archived===P).map($e=>$e.id),yr=kt.indexOf(Se.id),M=kt.indexOf(en);yr<0||M<0||(kt.splice(M,0,...kt.splice(yr,1)),_t(kt))},qe=()=>{window.removeEventListener("pointermove",ze),window.removeEventListener("pointerup",qe),document.body.classList.remove("projlist-dragging"),me.current=null,ue(null),Se.on&&ll.set(0,"proj_order",{order:U.current}).catch(()=>{})};window.addEventListener("pointermove",ze),window.addEventListener("pointerup",qe)}u.useEffect(()=>{let _=!1;return ll.get(0).then(re=>{var ze,qe;if(_)return;const Se=(Array.isArray((qe=(ze=re.prefs)==null?void 0:ze.proj_order)==null?void 0:qe.order)?re.prefs.proj_order.order:[]).map(Number).filter(Number.isFinite);Se.length&&R(Se)}).catch(()=>{}),()=>{_=!0}},[]);function an(_){if(_.button!==0)return;_.preventDefault();const re=_.clientX,Se=Qe.current;document.body.classList.add("resizing-x");const ze=De=>Fe(Math.min(dj,Math.max(uj,Se+De.clientX-re))),qe=()=>{window.removeEventListener("mousemove",ze),window.removeEventListener("mouseup",qe),document.body.classList.remove("resizing-x");try{localStorage.setItem(Lf,String(Qe.current))}catch{}};window.addEventListener("mousemove",ze),window.addEventListener("mouseup",qe)}function et(){Fe(fj);try{localStorage.removeItem(Lf)}catch{}}function Qt(_){if(p.current){p.current=!1;return}o(_),localStorage.setItem("ts_cur_tab",_)}function Xt(_){return _.order.filter(re=>!_.hidden.includes(re))}function Jt(_){var Se;a(_);const re=(Se=n.currentProject)==null?void 0:Se.id;re&&ll.set(re,"tabs",_).catch(()=>{})}u.useEffect(()=>{var Se;const _=(Se=n.currentProject)==null?void 0:Se.id;if(!_)return;let re=!1;return ll.get(_).then(ze=>{var qe;re||a(qo((qe=ze.prefs)==null?void 0:qe.tabs))}).catch(()=>{}),c(!1),()=>{re=!0}},[(Ga=n.currentProject)==null?void 0:Ga.id]);const ft=l||qo(null),$t=Xt(ft);u.useEffect(()=>{$t.length&&!$t.includes(s)&&(o($t[0]),localStorage.setItem("ts_cur_tab",$t[0]))},[l]);function Vn(_,re){if(_.button!==0)return;const Se={key:re,sx:_.clientX,on:!1};h.current=Se;const ze=De=>{var kt,yr,M,Q;if(!h.current)return;if(!Se.on){if(Math.hypot(De.clientX-Se.sx,De.clientY)<6)return;Se.on=!0,p.current=!0,f(Se.key),document.body.classList.add("tabbar-dragging")}const en=(Q=(M=(yr=(kt=document.elementFromPoint(De.clientX,De.clientY))==null?void 0:kt.closest)==null?void 0:yr.call(kt,"[data-tab-key]"))==null?void 0:M.dataset)==null?void 0:Q.tabKey;!en||en===Se.key||a(he=>{const fe=qo(he),Ne=[...fe.order],$e=Ne.indexOf(Se.key),it=Ne.indexOf(en);return $e<0||it<0?he:(Ne.splice(it,0,...Ne.splice($e,1)),{...fe,order:Ne})})},qe=()=>{if(window.removeEventListener("pointermove",ze),window.removeEventListener("pointerup",qe),document.body.classList.remove("tabbar-dragging"),h.current=null,f(null),Se.on){const De=qo(m.current);Jt(De)}};window.addEventListener("pointermove",ze),window.addEventListener("pointerup",qe)}function pn(_){const re=qo(l),Se={...re,hidden:[...re.hidden,_]};Jt(Se);const ze=Xt(Se);(s===_||!ze.includes(s))&&ze.length&&(o(ze[0]),localStorage.setItem("ts_cur_tab",ze[0]))}function rt(_){const re=qo(l);Jt({...re,hidden:re.hidden.filter(Se=>Se!==_)}),o(_),localStorage.setItem("ts_cur_tab",_)}function mn(_){n.selectProject(_),localStorage.setItem("ts_cur_project",_)}async function Ts(){try{y(await Pt.agents())}catch{y([])}}async function Zt(_){try{const re=await Pt.agentModels(_);V(re);const Se=new Set((re.models||[]).map(ze=>ze.name));Se.size&&K(ze=>ze.model&&!Se.has(ze.model)?{...ze,model:""}:ze)}catch{V({models:[],default:""})}}async function vs(_,re){try{const ze=(await Pt.agentSkills(_,re)).skills||[];if(Y(ze),ze.length){const qe=new Set(ze.map(De=>De.name));K(De=>({...De,skill_understand:qe.has(De.skill_understand)?De.skill_understand:"",skill_deploy:qe.has(De.skill_deploy)?De.skill_deploy:"",skill_commit:qe.has(De.skill_commit)?De.skill_commit:"",skill_test:qe.has(De.skill_test)?De.skill_test:"",skill_cases:qe.has(De.skill_cases)?De.skill_cases:""}))}}catch{Y([])}}function I(_){v(_?_.id:null),K({name:(_==null?void 0:_.name)||"",project_dir:(_==null?void 0:_.project_dir)||"",agent_path:(_==null?void 0:_.agent_path)||"",work_dir:(_==null?void 0:_.work_dir)||"",env_label:(_==null?void 0:_.env_label)||"",guide_text:(_==null?void 0:_.guide_text)||"",model:(_==null?void 0:_.model)||"",reasoning_effort:(_==null?void 0:_.reasoning_effort)||"",permission_mode:(_==null?void 0:_.permission_mode)||"",skill_understand:(_==null?void 0:_.skill_understand)||"",skill_deploy:(_==null?void 0:_.skill_deploy)||"",skill_commit:(_==null?void 0:_.skill_commit)||"",skill_test:(_==null?void 0:_.skill_test)||"",skill_cases:(_==null?void 0:_.skill_cases)||""}),gt(),w(!0),Ts(),Zt((_==null?void 0:_.agent_path)||""),vs((_==null?void 0:_.agent_path)||"",(_==null?void 0:_.project_dir)||"")}async function H(){const _={...$};if(_.name||(_.name=nx(_.project_dir)),!_.name){T("请填写项目名称");return}try{const re=await Pt.dupCheck({project_dir:_.project_dir||"",work_dir:_.work_dir||"",exclude:j});if(re.length){k(re),O(_),S(!0);return}await be(_)}catch(re){T(re.message)}}async function je(){if(S(!1),C){const _=C;O(null),await be(_)}}async function be(_){try{const re=$n.getState();if(j)await re.updateProject(j,_);else{const Se=await re.createProject(_);await $n.getState().selectProject(Se.id)}w(!1),T(j?"已保存":"项目已创建")}catch(re){T(re.message)}}async function Le(_,re){try{await $n.getState().archiveProject(_.id,re),T(re?"项目已归档":"项目已恢复")}catch(Se){T(Se.message)}}function Ce(_){const re={...$,project_dir:_};$.name.trim()||(re.name=nx(_)),K(re)}function St(_){ge(_),we(!0),ce(!1),pe(""),pt($[_])}async function pt(_){ke(!0);try{Re(await Pt.fsBrowse(_))}catch(re){T(re.message)}finally{ke(!1)}}function lt(_){ce(!1),pe(""),pt(_)}async function q(){const _=_e.trim();if(_){B(!0);try{const re=await Pt.fsMkdir((X==null?void 0:X.path)||"",_);T(`已新建文件夹:${(re==null?void 0:re.name)||_}`),lt((re==null?void 0:re.path)||(X==null?void 0:X.path)||"")}catch(re){T(re.message)}finally{B(!1)}}}function at(){X!=null&&X.path&&(Z==="project_dir"&&Ce(X.path),Z==="project_dir"?vs($.agent_path,X.path):K({...$,[Z]:X.path}),we(!1))}function Hn(_){ie(_),Oe(""),Rn()}async function ns(){if(A)try{await $n.getState().deleteProject(A.id,{confirm_name:oe}),T("项目已删除;案例文件与 bug 报告文件已保留,请自行手动清理"),ie(null)}catch(_){T(_.message)}}async function ys(){await t.logout(),e("/login")}u.useEffect(()=>(n.loadProjects(),Pn.current=setInterval(()=>{const _=$n.getState();_.loadProjects().catch(()=>{}),_.currentProject&&(_.loadTasks().catch(()=>{}),_.loadBugs().catch(()=>{}))},5e3),()=>clearInterval(Pn.current)),[]);const oo=$n(_=>_.projects),lo=u.useRef(!1);u.useEffect(()=>{if(lo.current||!oo.length)return;lo.current=!0;const _=$n.getState(),re=+localStorage.getItem("ts_cur_project")||0,Se=_.projects.find(De=>!De.archived)||_.projects[0],ze=_.projects.find(De=>De.id===re)?re:Se.id;_.selectProject(ze);const qe=localStorage.getItem("ts_cur_tab");Xi.includes(qe)&&o(qe)},[oo]);const ao=Je(n.projects).filter(_=>!!_.archived===P),Ut=te.models||[],Tn=!!$.model&&Ut.some(_=>_.name===$.model),Bo=Ut.length?te.default?"__default__":Ut[0].name:"__default__",ss=Tn?$.model:Bo,Qs=Ut.find(_=>_.name===te.default),Wn=Qs?Qs.display_name||Qs.name:te.default||"智能体默认",ws=Tn?$.model:ss==="__default__"?te.default:ss,vr=Ow(te,ws);return r.jsxs("div",{className:"flex h-svh",children:[r.jsxs("aside",{style:{width:Te+"px"},className:"flex flex-none flex-col border-r border-border bg-card",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-3 font-serif font-semibold",children:[r.jsx(Xc,{size:22}),r.jsx("span",{children:"Touchstone"})]}),r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:[r.jsx("span",{children:P?"已归档项目":"项目列表"}),r.jsx("button",{type:"button",title:P?"返回项目列表":"查看已归档项目",className:"rounded p-0.5 hover:text-foreground",onClick:()=>D(_=>!_),children:P?r.jsx(Hu,{size:13}):r.jsx(Wu,{size:13})})]}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto p-2",children:[ao.map(_=>{var re,Se,ze,qe,De;return r.jsxs("div",{"data-proj-id":_.id,className:"proj-item cursor-pointer select-none rounded-lg border px-2.5 py-2 transition-colors "+(((re=n.currentProject)==null?void 0:re.id)===_.id?"border-primary/60 bg-accent":"border-transparent hover:bg-accent/60")+(_.archived?" opacity-60":"")+(ne===_.id?" proj-dragging":""),onPointerDown:en=>xs(en,_.id),onClick:()=>{if(de.current){de.current=!1;return}mn(_.id)},children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"flex-1 truncate text-sm font-semibold "+(((Se=n.currentProject)==null?void 0:Se.id)===_.id?"text-[var(--tab-active)]":""),children:_.name}),r.jsx("button",{type:"button",title:_.archived?"恢复项目":"归档项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-foreground",onClick:en=>{en.stopPropagation(),Le(_,!_.archived)},children:_.archived?r.jsx(Hu,{size:13}):r.jsx(Wu,{size:13})}),_.archived&&r.jsx("button",{type:"button",title:"删除项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-[var(--fail, #dc2626)]",onClick:en=>{en.stopPropagation(),Hn(_)},children:r.jsx(qs,{size:13})})]}),r.jsx("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:_.project_dir}),r.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 font-mono text-[calc(10px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{children:["正在开发 ",r.jsx("b",{className:"font-semibold text-[var(--run)]",children:((ze=_.board_counts)==null?void 0:ze.doing)??0})]}),r.jsxs("span",{children:["阻塞 ",r.jsx("b",{className:"font-semibold text-[var(--fail)]",children:((qe=_.board_counts)==null?void 0:qe.blocked)??0})]}),r.jsxs("span",{children:["待审核 ",r.jsx("b",{className:"font-semibold text-[var(--retest)]",children:((De=_.board_counts)==null?void 0:De.review)??0})]})]})]},_.id)}),!ao.length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:P?"暂无已归档项目":"暂无项目"})]}),r.jsxs("div",{className:"flex items-center gap-1 border-t border-border px-2.5 py-2",children:[r.jsx("span",{className:"mr-auto truncate text-xs text-muted-foreground",children:t.username}),r.jsxs(F,{variant:"ghost",size:"sm",title:"站点设置",onClick:()=>e("/settings"),children:[r.jsx(v0,{})," 设置"]}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(F,{variant:"ghost",size:"sm",onClick:()=>G(_=>!_),children:[r.jsx(bN,{})," 菜单"]}),W&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>G(!1)}),r.jsxs("div",{className:"sets-menu",children:[t.isAdmin&&r.jsxs("button",{type:"button",onClick:()=>{G(!1),e("/admin")},children:[r.jsx(FN,{})," 管理"]}),r.jsxs("button",{type:"button",className:"danger",onClick:ys,children:[r.jsx(Up,{})," 登出"]})]})]})]})]})]}),r.jsx("div",{className:"vsplit side-split",title:"拖动调整侧栏宽度,双击复位",onMouseDown:an,onDoubleClick:et}),r.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-4 py-2",children:[r.jsx("h2",{className:"m-0 truncate font-serif text-[calc(15px*var(--fs))] font-semibold",children:((Ka=n.currentProject)==null?void 0:Ka.name)||"— 未选择项目"}),((Ya=n.currentProject)==null?void 0:Ya.archived)&&r.jsx("span",{className:"flex-none rounded-full border border-border px-2 py-0.5 text-[calc(10px*var(--fs))] text-muted-foreground",children:"已归档"}),r.jsx("div",{className:"flex-1"}),r.jsxs(F,{size:"sm",onClick:()=>I(),children:[r.jsx(Va,{})," 添加项目"]}),n.currentProject&&r.jsxs(F,{size:"sm",variant:"outline",onClick:()=>I(n.currentProject),children:[r.jsx(Vp,{})," 编辑项目"]}),n.currentProject&&r.jsxs(F,{size:"sm",variant:"outline",title:"归档后从项目列表默认隐藏,可在侧栏「已归档项目」视图中恢复",onClick:()=>Le(n.currentProject,!n.currentProject.archived),children:[n.currentProject.archived?r.jsx(Hu,{}):r.jsx(Wu,{}),n.currentProject.archived?"恢复项目":"归档项目"]})]}),r.jsx("hr",{className:"aurora-line"}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.currentProject?r.jsxs(ij,{value:s,onValueChange:Qt,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center border-b border-border pr-2",children:[r.jsxs(km,{className:"w-fit justify-start rounded-none border-none bg-transparent px-2 py-0",children:[$t.map(_=>r.jsxs(Mc,{value:_,"data-tab-key":_,className:"tabbar-trigger pr-5 data-[state=active]:text-[var(--tab-active)]"+(d===_?" tabbar-dragging":""),onPointerDown:re=>Vn(re,_),children:[tx[_],r.jsx("span",{className:"tabbar-hide",title:"隐藏此标签页(可点右侧按钮恢复)",onClick:re=>{re.stopPropagation(),pn(_)},onPointerDown:re=>re.stopPropagation(),children:r.jsx(Co,{className:"size-2.5"})})]},_)),!$t.length&&r.jsx("span",{className:"px-3 py-2 text-xs text-muted-foreground",children:"标签页已全部隐藏"})]}),r.jsx("div",{className:"ml-auto"}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(F,{variant:"ghost",size:"sm",title:"显示/恢复隐藏的标签页",onClick:()=>c(_=>!_),children:[r.jsx(lg,{}),ft.hidden.length?`隐藏 ${ft.hidden.length}`:"标签页"]}),i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>c(!1)}),r.jsxs("div",{className:"sets-menu drop-down",children:[!ft.hidden.length&&r.jsxs("div",{className:"px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:["没有隐藏的标签页。",r.jsx("br",{}),"把鼠标悬停到标签上点 × 即可隐藏。"]}),ft.hidden.map(_=>r.jsxs("button",{type:"button",onClick:()=>rt(_),children:[r.jsx(lg,{})," ",tx[_]]},_))]})]})]})]}),r.jsx(Rr,{value:"board",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(wT,{project:n.currentProject})}),r.jsx(Rr,{value:"tasks",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(VP,{onCreated:_=>{_==="stress"&&Qt("stress")}})}),r.jsx(Rr,{value:"stress",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(MM,{})}),r.jsx(Rr,{value:"monitor",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(ZP,{project:n.currentProject})}),r.jsx(Rr,{value:"bugs",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(rT,{project:n.currentProject})})]}):r.jsx("div",{className:"mt-20 text-center text-sm text-muted-foreground",children:'← 选择一个项目,或点击"添加项目"创建'})})]}),r.jsx(on,{open:g,onOpenChange:w,children:r.jsxs(qt,{className:"modal modal-rz"+(Ye?" rz-drag":""),style:{...dt,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:st,reset:gt}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:Lt,children:j?"编辑项目":"添加项目"})}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目名称"}),r.jsx(Ie,{value:$.name,onChange:_=>K({...$,name:_.target.value.trim()}),placeholder:"如 my-project"})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目目录"}),r.jsx(Ie,{value:$.project_dir,onChange:_=>Ce(_.target.value.trim()),onBlur:()=>vs($.agent_path,$.project_dir),placeholder:"/path/to/your/project"}),r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>St("project_dir"),title:"浏览服务端目录并选择",children:[r.jsx(ag,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"智能体"}),r.jsxs(It,{value:$.agent_path||"__manual__",onValueChange:_=>{const re=_==="__manual__"||_==="__missing__"?"":_;K({...$,agent_path:re}),Zt(re),vs(re,$.project_dir)},children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"手动填写路径"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__manual__",children:"手动填写路径"}),x.map(_=>r.jsx(Ae,{value:_.found?_.path:"__missing__",children:_.found?`${_.name} · ${_.version||_.path}`:`${_.name} 未找到`},_.path||_.name)),(()=>{const _=($.agent_path||"").trim();return!_||x.some(re=>re.found&&re.path===_)?null:r.jsx(Ae,{value:_,children:_.startsWith("dsh-plugin:")?`dsh(插件·进程内) ${_.slice(11)}`:`${_}(当前绑定)`})})()]})]}),r.jsxs(F,{variant:"outline",size:"sm",onClick:Ts,title:"重新扫描本机 CLI",children:[r.jsx(Pa,{})," 扫描"]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"智能体只有「dsh(插件·进程内)」一个入口:无需额外参数,模型取自宿主 ~/.dsh/settings.yaml(也可在此显式指定);kimi/opencode/claude/hermes 旧族与 dsh CLI(裸 dsh 可执行)均已退场,存量旧绑定起跑会报「该智能体族已下线」,请改绑本入口"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"当前智能体已配置的模型;保存后新创建的任务(含修复/复测)默认使用该模型,已建任务不受影响",children:"模型"}),Ut.length?r.jsxs(It,{value:ss,onValueChange:_=>K({...$,model:_==="__default__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1"+(Tn?"":" text-muted-foreground"),title:Tn?"":"尚未显式选择:暗色显示的是当前智能体的默认模型(留空即用默认)",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__default__",children:te.default?`默认(${Wn})`:"默认(智能体默认)"}),Ut.map(_=>r.jsx(Ae,{value:_.name,children:_.display_name||_.name},_.name))]})]}):r.jsx(Ie,{className:"max-w-[240px]",placeholder:te.default?`默认(${Wn})`:"默认(智能体默认)",value:$.model,onChange:_=>K({...$,model:_.target.value.trim()})})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"留空用智能体默认模型;设置后从下一条任务开始生效"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内会话的默认思考等级(dsh reasoningEffort);留空用智能体默认档",children:"思考等级"}),r.jsxs(It,{value:$.reasoning_effort||"__default__",onValueChange:_=>K({...$,reasoning_effort:_==="__default__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1"+($.reasoning_effort?"":" text-muted-foreground"),title:$.reasoning_effort?"":"尚未显式选择:暗色显示的是智能体默认档(留空即用默认)",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__default__",children:vr.defaultEffort?`默认(${(vr.options.find(_=>_.value===vr.defaultEffort)||{}).label||vr.defaultEffort})`:"默认(智能体默认)"}),$.reasoning_effort&&!vr.options.some(_=>_.value===$.reasoning_effort)&&r.jsx(Ae,{value:$.reasoning_effort,children:$.reasoning_effort}),vr.options.map(_=>r.jsx(Ae,{value:_.value,title:_.title,children:_.label},_.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"思考等级:列表来自当前模型的可用档位;留空用智能体默认;设置后新起的会话(含任务与看板卡)按此档运行"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内看板卡片会话的默认权限档;留空用宿主默认(完全访问)",children:"权限"}),r.jsxs(It,{value:$.permission_mode||"__default__",onValueChange:_=>K({...$,permission_mode:_==="__default__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1"+($.permission_mode?"":" text-muted-foreground"),title:$.permission_mode?"":"尚未显式选择:暗色显示的是宿主默认档(留空即用默认)",children:r.jsx(Ct,{})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__default__",children:"默认(宿主默认)"}),Rc.map(_=>r.jsx(Ae,{value:_.value,title:_.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:_.label}),r.jsx("span",{className:"sess-perm-desc",children:_.desc})]})},_.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"权限:项目内新起的看板卡片会话按此档运行(逐条确认=平台接管审批代答);任务会话暂不支持权限档"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"理解/分析项目时优先使用的 skill,注入每类任务首轮提示词",children:"理解项目"}),r.jsxs(It,{value:$.skill_understand||"__none__",onValueChange:_=>K({...$,skill_understand:_==="__none__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"不指定"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`u-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动部署=开时使用的 skill",children:"部署项目"}),r.jsxs(It,{value:$.skill_deploy||"__none__",onValueChange:_=>K({...$,skill_deploy:_==="__none__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"不指定"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`d-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动提交=开时使用的 skill",children:"提交项目"}),r.jsxs(It,{value:$.skill_commit||"__none__",onValueChange:_=>K({...$,skill_commit:_==="__none__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"不指定"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`c-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试本项目时优先使用的 skill,注入每类任务首轮提示词",children:"测试项目"}),r.jsxs(It,{value:$.skill_test||"__none__",onValueChange:_=>K({...$,skill_test:_==="__none__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"不指定"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`t-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"生成用例时遵循的命名/结构/登记规范 skill,注入每类任务首轮提示词",children:"用例规范"}),r.jsxs(It,{value:$.skill_cases||"__none__",onValueChange:_=>K({...$,skill_cases:_==="__none__"?"":_}),children:[r.jsx(Et,{className:"min-w-[200px] flex-1",children:r.jsx(Ct,{placeholder:"不指定"})}),r.jsxs(Rt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`cs-${_.name}`))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"选项来自当前智能体可用的 skill(dsh 无 skill 机制恒为空);理解/测试项目/用例规范项注入每类任务首轮,部署/提交项仅注入修复任务的对应条款(自动提交/部署=开时)"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"工作目录"}),r.jsx(Ie,{value:$.work_dir,onChange:_=>K({...$,work_dir:_.target.value.trim()}),placeholder:"默认 <项目目录>/.touchstone;其下自动生成案例库 free_style 与 bug 报告 bug_report"}),r.jsxs(F,{variant:"outline",size:"sm",onClick:()=>St("work_dir"),title:"浏览服务端目录并选择",children:[r.jsx(ag,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"环境标签"}),r.jsx(Ie,{value:$.env_label,onChange:_=>K({...$,env_label:_.target.value.trim()}),placeholder:"如 test4 / sitA1,测试、修复、部署针对的环境"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"项目附加提示词"}),r.jsx(ds,{value:$.guide_text,onChange:_=>K({...$,guide_text:_.target.value}),rows:3,className:"min-h-0",placeholder:"填写如何理解项目 / 如何写 git commit message / 如何部署项目 等信息;内容会加入每个任务的提示词"})]})]}),r.jsxs(kn,{className:"flex-none",children:[r.jsx(F,{variant:"outline",onClick:()=>w(!1),children:"取消"}),r.jsx(F,{onClick:H,children:"保存"})]})]})}),r.jsx(on,{open:b,onOpenChange:S,children:r.jsxs(qt,{className:"modal modal-rz"+(fn?" rz-drag":""),style:{...jn,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:st,reset:gt}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:le,children:"目录重复提醒"})}),N.map((_,re)=>r.jsxs("div",{className:"dup-item",children:[r.jsx("b",{children:$M[_.field]||_.field})," ",_.value,r.jsxs("span",{className:"dup-owner",children:["被「",_.username," / ",_.project_name,"」使用"]})]},re)),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"6px 0 0"},children:"重复的目录可能与其他项目的案例库/报告互相干扰,确认仍要保存?"}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>S(!1),children:"返回修改"}),r.jsx(F,{onClick:je,children:"仍然保存"})]})]})}),r.jsx(on,{open:z,onOpenChange:we,children:r.jsxs(qt,{className:"modal modal-rz modal-dir"+(J?" rz-drag":""),style:{...We,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:st,reset:Un}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:Yt,children:"选择目录"})}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:(X==null?void 0:X.path)||"",children:(X==null?void 0:X.path)||"(选择根目录)"}),r.jsxs(F,{variant:"outline",size:"sm",disabled:Pe||!(X!=null&&X.parent),onClick:()=>lt(X.parent),children:[r.jsx(zk,{})," 上级"]}),r.jsxs(F,{variant:"outline",size:"sm",disabled:Pe,onClick:()=>lt((X==null?void 0:X.path)||""),children:[r.jsx(Pa,{})," 刷新"]}),r.jsxs(F,{variant:"outline",size:"sm",disabled:Pe||!(X!=null&&X.path),onClick:()=>{ce(!ae),pe("")},title:X!=null&&X.path?`在 ${X.path} 下新建文件夹`:"请先进入一个目录",children:[r.jsx(uN,{})," 新建文件夹"]})]}),ae&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{autoFocus:!0,value:_e,disabled:E,onChange:_=>pe(_.target.value),onKeyDown:_=>{_.key==="Enter"&&q()},placeholder:"新文件夹名称(在当前目录下创建)"}),r.jsx(F,{size:"sm",disabled:E||!_e.trim(),onClick:q,children:E?"创建中…":"创建"}),r.jsx(F,{variant:"outline",size:"sm",disabled:E,onClick:()=>{ce(!1),pe("")},children:"取消"})]}),r.jsxs("div",{className:"modal-scroll max-h-[50vh] min-h-[120px] overflow-y-auto rounded-md border border-border p-1",children:[Pe&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"加载中…"}),!Pe&&!((X==null?void 0:X.dirs)||[]).length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"无子目录"}),!Pe&&((X==null?void 0:X.dirs)||[]).map(_=>r.jsx("button",{type:"button",className:"block w-full truncate rounded px-2 py-1 text-left font-mono text-sm hover:bg-accent",title:_.path,onClick:()=>lt(_.path),children:_.name},_.path))]}),r.jsxs(kn,{className:"flex-none",children:[r.jsx(F,{variant:"outline",onClick:()=>we(!1),children:"取消"}),r.jsx(F,{disabled:Pe||!(X!=null&&X.path),onClick:at,children:"选择此目录"})]})]})}),r.jsx(on,{open:!!A,onOpenChange:_=>{_||ie(null)},children:r.jsxs(qt,{className:"modal modal-rz"+(Tt?" rz-drag":""),style:{...tt,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:st,reset:Rn}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:Mt,children:"删除项目"})}),A&&r.jsxs("div",{className:"space-y-1 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"项目名称:"}),r.jsx("b",{children:A.name})]}),r.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:A.project_dir}),r.jsxs("div",{className:"truncate font-mono text-xs text-muted-foreground",children:["工作目录:",A.work_dir]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"输入项目名称确认"}),r.jsx(Ie,{value:oe,onChange:_=>Oe(_.target.value),placeholder:(A==null?void 0:A.name)||""})]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"将删除项目及其全部任务与轮次记录,不可恢复。磁盘上的案例文件与 bug 报告文件不会删除,请自行手动清理。"}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>ie(null),children:"取消"}),r.jsx(F,{variant:"destructive",disabled:!A||oe!==A.name,onClick:ns,children:"确定删除"})]})]})})]})}const AM=Gy("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Pl({className:e,variant:t,...n}){return r.jsx("span",{"data-slot":"badge",className:Ve(AM({variant:t}),e),...n})}function OM(){const e=Al(),t=Xn(),[n,s]=u.useState([]),[o,l]=u.useState(!1),[a,i]=u.useState({username:"",password:"",password2:""}),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState({id:null,username:"",password:""}),[g,w]=u.useState(""),{rzOn:j,rzStyle:v,rzStart:x,rzDragStart:y,rzReset:b}=sr(),{rzOn:S,rzStyle:N,rzStart:k,rzDragStart:C,rzReset:O}=sr();async function P(){try{s(await $r.users())}catch(V){T(V.message)}}u.useEffect(()=>{if(!t.isAdmin){e("/app");return}P()},[]);function D(){i({username:"",password:"",password2:""}),d(""),O(),l(!0)}async function W(){if(d(""),a.password!==a.password2){d("两次输入的密码不一致");return}try{await $r.createUser({username:a.username,password:a.password}),l(!1),T("新增成功"),await P()}catch(V){d(V.message)}}function G(V){h({id:V.id,username:V.username,password:""}),w(""),m(!0)}async function $(){w("");try{const V={username:p.username};p.password&&(V.password=p.password),await $r.updateUser(p.id,V),m(!1),await P()}catch(V){w(V.message)}}async function K(V){if(window.confirm(`确认删除用户「${V.username}」?该操作不可恢复`))try{await $r.deleteUser(V.id),await P()}catch(L){T(L.message)}}async function te(){await t.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"后台管理 · 用户"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:t.username}),r.jsxs(F,{variant:"ghost",size:"sm",onClick:te,children:[r.jsx(Up,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("div",{className:"sets-page-nav"}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(F,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(zp,{})," 返回项目"]})})]}),r.jsx("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:r.jsxs(Dn,{className:"gap-0 py-0",children:[r.jsx(ms,{className:"border-b border-border/60 px-5 py-4",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(QN,{className:"size-4 text-primary"})," 用户列表",r.jsxs("span",{className:"font-normal text-muted-foreground",children:[n.length," 人"]}),r.jsxs(F,{variant:"outline",size:"sm",className:"ml-auto",onClick:D,children:[r.jsx(Va,{})," 新增用户"]})]})}),r.jsx(Fn,{className:"px-3 pb-3",children:n.length?r.jsxs(dm,{children:[r.jsx(fm,{children:r.jsxs(jo,{className:"hover:bg-transparent",children:[r.jsx(_n,{className:"px-3",children:"ID"}),r.jsx(_n,{className:"px-3",children:"用户名"}),r.jsx(_n,{className:"px-3",children:"创建时间"}),r.jsx(_n,{className:"px-3",children:"角色"}),r.jsx(_n,{className:"px-3 text-right",children:"操作"})]})}),r.jsx(pm,{children:n.map(V=>r.jsxs(jo,{children:[r.jsx(vn,{className:"px-3 text-muted-foreground",children:V.id}),r.jsx(vn,{className:"px-3 font-medium",children:V.username}),r.jsx(vn,{className:"px-3 font-mono text-xs text-muted-foreground",children:V.created_at}),r.jsx(vn,{className:"px-3",children:V.is_admin?r.jsx(Pl,{variant:"outline",className:"border-[var(--admin-badge)] text-[var(--admin-badge)]",children:"管理员"}):r.jsx(Pl,{variant:"secondary",children:"普通用户"})}),r.jsx(vn,{className:"px-3",children:r.jsxs("div",{className:"flex justify-end gap-1.5",children:[r.jsxs(F,{variant:"ghost",size:"sm",onClick:()=>G(V),children:[r.jsx(Vp,{})," 编辑"]}),!V.is_admin&&r.jsxs(F,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>K(V),children:[r.jsx(qs,{})," 删除"]})]})})]},V.id))})]}):r.jsx("div",{className:"px-2 py-6 text-sm text-muted-foreground",children:"暂无用户"})})]})})]}),r.jsx(on,{open:o,onOpenChange:l,children:r.jsxs(qt,{className:"modal modal-rz"+(S?" rz-drag":""),style:{...N,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:k,reset:O}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:C,children:"新增用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{value:a.username,onChange:V=>{i({...a,username:V.target.value.trim()}),d("")},placeholder:"2-32 位字母数字或 _ . -"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{value:a.password,onChange:V=>i({...a,password:V.target.value}),type:"password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"确认"}),r.jsx(Ie,{value:a.password2,onChange:V=>i({...a,password2:V.target.value}),type:"password",placeholder:"至少 6 位"})]})]}),c&&r.jsx("div",{className:"text-sm text-destructive",children:c})]}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>l(!1),children:"取消"}),r.jsx(F,{onClick:W,children:"新增用户"})]})]})}),r.jsx(on,{open:f,onOpenChange:m,children:r.jsxs(qt,{className:"modal modal-rz"+(j?" rz-drag":""),style:{...v,marginTop:0},showCloseButton:!1,children:[r.jsx(rr,{start:x,reset:b}),r.jsx(Gt,{className:"text-left",children:r.jsx(Kt,{className:"cursor-move select-none text-sm",onMouseDown:y,children:"编辑用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{value:p.username,onChange:V=>{h({...p,username:V.target.value.trim()}),w("")}})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"重置密码"}),r.jsx(Ie,{value:p.password,onChange:V=>h({...p,password:V.target.value}),type:"password",placeholder:"留空则不修改"})]}),g&&r.jsx("div",{className:"text-sm text-destructive",children:g})]}),r.jsxs(kn,{children:[r.jsx(F,{variant:"outline",onClick:()=>m(!1),children:"取消"}),r.jsx(F,{onClick:$,children:"保存"})]})]})})]})}const pj="ts_skin",mj=[{id:"starlight",label:"星夜金",preview:["#141E36","#E8B86D"]},{id:"classic",label:"经典蓝",preview:["#151b23","#58a6ff"]}];function hj(){const e=localStorage.getItem(pj);return mj.some(t=>t.id===e)?e:"starlight"}function gj(e){document.documentElement.dataset.skin=e,localStorage.setItem(pj,e)}function LM(){gj(hj())}const xj="ts_fs",vj=[{value:.9,label:"小"},{value:1,label:"标准"},{value:1.15,label:"大"},{value:1.3,label:"特大"}];function yj(){const e=parseFloat(localStorage.getItem(xj));return vj.some(t=>t.value===e)?e:1}function wj(e){document.documentElement.style.setProperty("--fs",String(e));try{localStorage.setItem(xj,String(e))}catch{}}function zM(){wj(yj())}function DM(){const[e,t]=u.useState(null),[n,s]=u.useState({api_base:"",model:"",api_key:"",timeout_s:"",batch_size:""}),[o,l]=u.useState(null),[a,i]=u.useState(!1);async function c(){try{const h=await $r.ragGet();t(h),s({api_base:h.api_base||"",model:h.model||"",api_key:"",timeout_s:h.timeout_s!=null?String(h.timeout_s):"",batch_size:h.batch_size!=null?String(h.batch_size):""})}catch(h){T(h.message)}}u.useEffect(()=>{c()},[]);function d(){const h={api_base:n.api_base.trim(),model:n.model.trim()};return n.api_key&&(h.api_key=n.api_key),n.timeout_s.trim()&&(h.timeout_s=n.timeout_s.trim()),n.batch_size.trim()&&(h.batch_size=n.batch_size.trim()),h}async function f(){i(!0);try{await $r.ragSet(d()),T("RAG 配置已保存,立即生效"),await c()}catch(h){T(h.message)}finally{i(!1)}}async function m(){l(null),i(!0);try{l(await $r.ragTest(d()))}catch(h){T(h.message)}finally{i(!1)}}async function p(){if(window.confirm("确认停用 RAG 语义检索?将删除配置文件,检索回到纯词面模式"))try{await $r.ragSet({clear:!0}),T("已停用 RAG"),l(null),await c()}catch(h){T(h.message)}}return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(p0,{className:"size-4 text-primary"})," 案例库语义检索(RAG)",e&&(e.configured?r.jsx(Pl,{children:"已启用"}):r.jsx(Pl,{variant:"secondary",children:"未启用"}))]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"走 OpenAI 兼容 /v1/embeddings 接口做嵌入,与内置 BM25 混合检索案例库; 未配置或调用失败时自动回落纯词面检索,不影响任务运行。保存后立即生效(无需重启); 更换模型后下次索引刷新自动全量重建。"}),r.jsxs("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",title:(e==null?void 0:e.config_path)||"",children:["配置文件:",(e==null?void 0:e.config_path)||"…"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"API 地址(api_base,含 /v1,不含 /embeddings)"}),r.jsx(Ie,{value:n.api_base,onChange:h=>s({...n,api_base:h.target.value.trim()}),placeholder:"https://api.openai.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"嵌入模型(model,非对话模型)"}),r.jsx(Ie,{value:n.model,onChange:h=>s({...n,model:h.target.value.trim()}),placeholder:"text-embedding-3-small"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"API Key(仅存服务端配置文件,不回显明文)"}),r.jsx(Ie,{type:"password",value:n.api_key,onChange:h=>s({...n,api_key:h.target.value}),placeholder:e!=null&&e.has_api_key?`已设置(${e.api_key_masked},留空保持不变)`:"sk-…"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"请求超时(秒)"}),r.jsx(Ie,{value:n.timeout_s,onChange:h=>s({...n,timeout_s:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.timeout_s)??30}`})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"嵌入批量大小"}),r.jsx(Ie,{value:n.batch_size,onChange:h=>s({...n,batch_size:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.batch_size)??16}`})]})]}),o&&(o.ok?r.jsxs("div",{className:"text-sm text-[var(--ok-text)]",children:["连接成功:嵌入向量维度 ",o.dim]}):r.jsxs("div",{className:"text-sm text-destructive",children:["连接失败:",o.error]})),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(F,{variant:"outline",disabled:a,onClick:f,children:"保存配置"}),r.jsxs(F,{variant:"ghost",disabled:a,onClick:m,children:[r.jsx(TN,{})," 测试连接"]}),(e==null?void 0:e.configured)&&r.jsxs(F,{variant:"ghost",className:"text-destructive hover:text-destructive",disabled:a,onClick:p,children:[r.jsx(qs,{})," 停用"]})]})]})]})}const FM=[["blocked_interaction","交互等待"],["task_failed","任务失败"],["card_review","卡片待审核"]];function BM(){var S,N;const[e,t]=u.useState(null),[n,s]=u.useState({webhook_url:"",secret:"",app_secret:""}),[o,l]=u.useState(!1),[a,i]=u.useState(null),[c,d]=u.useState([]),[f,m]=u.useState(!1);u.useEffect(()=>{p(),j()},[]);async function p(){try{t(await Fs.feishuCfgGet())}catch(k){T(k.message)}}async function h(){l(!0);try{const k={enabled:!!(e!=null&&e.enabled),base_url:((e==null?void 0:e.base_url)||"").trim(),app_id:((e==null?void 0:e.app_id)||"").trim()};n.webhook_url.trim()&&(k.default_webhook=n.webhook_url.trim()),n.secret&&(k.default_secret=n.secret),n.app_secret&&(k.app_secret=n.app_secret);const C=await Fs.feishuCfgSet(k);s({webhook_url:"",secret:"",app_secret:""}),T(C!=null&&C.inbound_started?"飞书配置已保存,入站消息长连接已启动":"飞书配置已保存(应用凭据变更需重启站点生效)"),await p()}catch(k){T(k.message)}finally{l(!1)}}async function g(){try{await Fs.feishuCfgSet({default_webhook:"",default_secret:""}),T("已清除默认 Webhook 与签名密钥"),await p()}catch(k){T(k.message)}}async function w(){const k=!f;if(m(k),k)try{d(await Fs.feishuOutbox())}catch(C){T(C.message)}}async function j(){try{i(await Fs.feishuGet())}catch(k){T(k.message)}}async function v(){try{const k=await Fs.feishuBindcode();i(C=>({...C,code:k.code}))}catch(k){T(k.message)}}async function x(){try{const k=await Fs.feishuGet();i(k),T(k.bound?"飞书账号已绑定":"尚未检测到绑定:确认已在飞书私聊机器人发送「绑定 <码>」,且本应用凭据已配置")}catch(k){T(k.message)}}async function y(){try{await Fs.feishuUnbind(),T("已解绑飞书账号"),j()}catch(k){T(k.message)}}const b=!(e!=null&&e.app_id&&(e!=null&&e.has_app_secret));return r.jsxs(r.Fragment,{children:[r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(Uk,{className:"size-4 text-primary"})," 飞书机器人配置"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!(e!=null&&e.enabled),onChange:k=>t({...e,enabled:k.target.checked})}),"启用飞书推送(总开关,控制本用户默认 webhook 回落)"]}),r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个用户配置自己的飞书机器人:入站长连接按用户各自拉起,推送未绑定项目时 回落项目所有者的默认 webhook。凭据(App Secret/签名密钥)仅存服务端,不回显。"}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"应用 App ID(入站指令用)"}),r.jsx(Ie,{value:(e==null?void 0:e.app_id)||"",onChange:k=>t({...e,app_id:k.target.value.trim()}),placeholder:"cli_xxxx"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"App Secret"}),r.jsx(Ie,{type:"password",value:n.app_secret,onChange:k=>s({...n,app_secret:k.target.value}),placeholder:e!=null&&e.has_app_secret?"已设置(留空保持不变)":"凭证与基础信息页复制"})]})]}),r.jsxs("div",{className:"text-xs",title:"凭据齐全且连接线程已启动时,机器人才能接收飞书消息;连接失败细节看 server.log",children:["入站长连接:",(S=e==null?void 0:e.inbound)!=null&&S.thread?r.jsx("span",{className:"text-primary",children:"运行中"}):(N=e==null?void 0:e.inbound)!=null&&N.configured?"已配置,待启动(重启站点生效)":"未配置(填写并保存后自动连接)"]}),r.jsx("div",{className:"hint",children:"入站指令需:应用开通「机器人」能力 + 权限 im:message / im:message.p2p_msg:readonly / im:resource + 事件订阅选「长连接」并添加 im.message.receive_v1 + 应用发布生效;Secret 保存后不回显(留空=保持现有值),首次配置保存后自动建立长连接,变更凭据需重启站点。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"默认推送 Webhook(未绑定项目的回落目标)"}),r.jsx(Ie,{value:n.webhook_url,onChange:k=>s({...n,webhook_url:k.target.value}),placeholder:e!=null&&e.default_webhook?`已配置:${e.default_webhook}(留空保持不变)`:"https://open.feishu.cn/open-apis/bot/v2/hook/…"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ie,{type:"password",value:n.secret,onChange:k=>s({...n,secret:k.target.value}),placeholder:e!=null&&e.has_default_secret?"已设置(留空保持不变)":"可空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"站点访问地址(通知里附「详情」链接,可空)"}),r.jsx(Ie,{value:(e==null?void 0:e.base_url)||"",onChange:k=>t({...e,base_url:k.target.value}),placeholder:"http://192.0.2.10:4601"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(F,{variant:"outline",disabled:o,onClick:h,children:"保存配置"}),r.jsx(F,{variant:"ghost",onClick:g,children:"清除默认 Webhook/密钥"}),r.jsx(F,{variant:"ghost",onClick:w,children:f?"收起投递记录":"投递记录"})]}),f&&r.jsx("div",{className:"max-h-60 overflow-y-auto rounded border border-border/60 text-xs",children:c.length?c.map(k=>r.jsxs("div",{className:"border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Pl,{variant:k.status==="sent"?"secondary":k.status==="pending"?"outline":"destructive",children:k.status}),r.jsxs("span",{className:"text-muted-foreground",children:["重试×",k.retries]}),r.jsx("span",{className:"truncate font-mono",children:k.target}),r.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k.created_at})]}),k.last_error&&r.jsx("div",{className:"truncate text-destructive",title:k.last_error,children:k.last_error})]},k.id)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无投递记录"})})]})]}),r.jsx(UM,{}),r.jsx(VM,{}),r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(h0,{className:"size-4 text-primary"})," 飞书账号绑定"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[a?a.bound?r.jsxs("div",{className:"space-y-1.5 text-sm",children:[r.jsxs("div",{children:["已绑定飞书账号 ",r.jsx("span",{className:"font-mono text-xs",children:a.open_id})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["默认项目:",a.default_project||"未设置(指令未指名项目时机器人会列出可选项目)"]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"在飞书私聊机器人发「帮助」可查看支持的指令。"})]}):r.jsxs("div",{className:"space-y-2 text-sm",children:[b&&r.jsx("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-xs",children:"注意:上方机器人应用凭据(App ID / App Secret)尚未配置,此刻飞书消息无法送达平台,绑定不会生效。 请先填写并保存,再生成绑定码。"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"绑定后可在飞书私聊机器人执行看板指令(开始卡片 / 审核通过 / 驳回 / 作答提问等)。"}),a.code?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-center",children:[r.jsx("div",{className:"font-mono text-2xl font-bold tracking-[0.3em]",children:a.code}),r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"10 分钟内有效;重新生成会作废旧码"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["打开飞书 → 私聊你配置的机器人 → 发送「绑定 ",a.code,"」→ 回来点「刷新状态」确认。"]})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"尚未绑定,点击下方「生成绑定码」开始。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}),r.jsx("div",{className:"flex gap-2",children:a!=null&&a.bound?r.jsx(F,{variant:"destructive",onClick:y,children:"解绑"}):a!=null&&a.code?r.jsxs(r.Fragment,{children:[r.jsx(F,{variant:"outline",onClick:v,children:"重新生成"}),r.jsxs(F,{variant:"outline",onClick:x,children:[r.jsx(Pa,{})," 刷新状态"]})]}):a&&r.jsx(F,{onClick:v,disabled:b,title:b?"先配置应用凭据,否则机器人收不到消息":void 0,children:"生成绑定码"})})]})]})]})}function UM(){const[e,t]=u.useState([]),[n,s]=u.useState(null),[o,l]=u.useState(null),[a,i]=u.useState({webhook_url:"",webhook_secret:""}),[c,d]=u.useState(!1);u.useEffect(()=>{let p=!0;return Pt.list().then(h=>{if(!p)return;t(h);const g=h.find(w=>!w.archived)||h[0];g&&s(g.id)}).catch(h=>T(h.message)),()=>{p=!1}},[]),u.useEffect(()=>{if(i({webhook_url:"",webhook_secret:""}),!n){l(null);return}let p=!0;return Pt.feishuHookGet(n).then(h=>{p&&l(h)}).catch(()=>{p&&l(null)}),()=>{p=!1}},[n]);async function f(){if(!(!n||!o)){d(!0);try{const p={enabled:!!o.enabled,events:o.events};a.webhook_url.trim()&&(p.webhook_url=a.webhook_url.trim()),a.webhook_secret&&(p.webhook_secret=a.webhook_secret),await Pt.feishuHookSet(n,p),i({webhook_url:"",webhook_secret:""}),T("项目飞书推送配置已保存"),Pt.feishuHookGet(n).then(l).catch(()=>{})}catch(p){T(p.message)}finally{d(!1)}}}const m=e.map(p=>({value:p.id,label:p.name+(p.archived?"(已归档)":""),search:p.project_dir||""}));return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(JN,{className:"size-4 text-primary"})," 项目推送绑定"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个项目可单独绑定推送群(阻塞事件通知到该群);未绑定或未启用时回落上方的默认推送 Webhook。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"项目"}),r.jsx(Tc,{options:m,value:n,onChange:s,placeholder:e.length?"选择项目…":"暂无项目",emptyHint:"无匹配项目"})]}),e.length?o?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!o.enabled,onChange:p=>l({...o,enabled:p.target.checked})}),"启用推送"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"群机器人 Webhook"}),r.jsx(Ie,{value:a.webhook_url,onChange:p=>i({...a,webhook_url:p.target.value}),placeholder:o.webhook_url?`已绑定:${o.webhook_url}(留空保持)`:"飞书群自定义机器人 Webhook URL"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ie,{type:"password",value:a.webhook_secret,onChange:p=>i({...a,webhook_secret:p.target.value}),placeholder:o.has_webhook_secret?"已设置(留空保持不变)":"可空"})]}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm",children:FM.map(([p,h])=>r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",checked:o.events.includes(p),onChange:g=>l({...o,events:g.target.checked?[...o.events,p]:o.events.filter(w=>w!==p)})}),h]},p))}),r.jsx("div",{className:"hint",children:"交互等待 / 任务失败默认推送;卡片待审核默认关。Webhook 与签名密钥留空保存时不下发(保持现有值)。"}),r.jsx("div",{children:r.jsx(F,{variant:"outline",disabled:c,onClick:f,children:"保存项目推送"})})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}):null]})]})}function VM(){var p,h,g,w,j,v;const[e,t]=u.useState(null),[n,s]=u.useState(!1),[o,l]=u.useState(null);async function a(){try{t(await Fs.feishuSlashGet())}catch(x){T(x.message)}}u.useEffect(()=>{a()},[]);async function i(x){s(!0);try{const y=await Fs.feishuSlashSet(x);l({action:x,...y}),x==="notify"?y.ok?T("权限引导卡片已发到你的飞书私聊,点卡片上的按钮即可重试注册"):T(y.error||"卡片发送失败"):y.ok?T(x==="sync"?`同步完成:新增 ${y.created.length}、更新 ${y.updated.length}、已最新 ${y.kept.length}`:`已清除 ${y.deleted.length} 条 TS 指令`):T(y.card_sent?"需要先开通权限:已把引导卡片发到你的飞书私聊":y.error||"操作失败,请看卡片上的提示"),await a()}catch(y){T(y.message)}finally{s(!1)}}const c=(e==null?void 0:e.remote)||[],d=(e==null?void 0:e.desired)||[],f=new Set(c.map(x=>x.command)),m=d.filter(x=>{const y=c.find(b=>b.command===x.command);return!y||y.description!==x.description||y.icon!==x.icon});return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(Xk,{className:"size-4 text-primary"})," 快捷指令(输入框打「/」)"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"把平台指令注册成飞书斜杠指令:机器人私聊里输入「/」即可从指令面板选 /status、/cards、 /approve 等(选中后以「/名称 [参数]」发给机器人,用法与中文指令一致)。 同步只增改本平台的指令,不影响你应用里的其他指令。"}),e?r.jsxs(r.Fragment,{children:[e.error&&r.jsx("div",{className:"text-xs text-destructive",children:e.error}),e.need_scope&&r.jsx("div",{className:"text-xs text-primary",children:"缺「应用指令」权限:点「发飞书权限卡片」→ 你的飞书私聊会收到一张引导卡片, 在上面点「我已开通,重试注册」即由后端重试(无需回站点手动重试)。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(F,{variant:"outline",disabled:n,onClick:()=>i("sync"),children:"注册 / 同步到飞书"}),r.jsx(F,{variant:"ghost",disabled:n,onClick:()=>i("notify"),children:"发飞书权限卡片"}),r.jsx(F,{variant:"ghost",disabled:n,onClick:a,children:"刷新状态"}),r.jsx(F,{variant:"ghost",disabled:n||!f.size,onClick:()=>{window.confirm("删除飞书侧本平台的斜杠指令?(你应用里的其他指令不受影响)")&&i("clear")},children:"清除 TS 指令"})]}),r.jsxs("div",{className:"text-xs",children:["已注册 ",f.size," / ",d.length," 条",m.length?`,待同步 ${m.length} 条`:",均已与平台一致",(p=e.extra)!=null&&p.length?`;另有 ${e.extra.length} 条非 TS 指令(不会改动)`:""]}),r.jsx("div",{className:"max-h-52 overflow-y-auto rounded border border-border/60 text-xs",children:d.length?d.map(x=>r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsx(Pl,{variant:f.has(x.command)?"secondary":"outline",children:f.has(x.command)?"已注册":"未注册"}),r.jsxs("span",{className:"shrink-0 font-mono",children:["/",x.command]}),r.jsx("span",{className:"truncate text-muted-foreground",title:x.description,children:x.description})]},x.command)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无可注册指令"})}),o&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.action==="sync"?`上次同步:新增 ${((h=o.created)==null?void 0:h.length)||0}、更新 ${((g=o.updated)==null?void 0:g.length)||0}、已最新 ${((w=o.kept)==null?void 0:w.length)||0}`:o.action==="notify"?"权限引导卡片已发送(去飞书私聊查看)":`上次清除:删除 ${((j=o.deleted)==null?void 0:j.length)||0} 条`,o.card_sent?r.jsx("div",{className:"text-primary",children:"已把权限引导卡片发到你的飞书私聊,点卡片上的「我已开通,重试注册」即自动重试"}):null,o.card_error?r.jsx("div",{className:"text-destructive",children:o.card_error}):null,(v=o.failed)!=null&&v.length?r.jsx("div",{className:"text-destructive",title:o.failed.join(`
471
- `),children:o.failed[0]}):null]}),r.jsx("div",{className:"hint",children:"权限:应用需开通 application:app_slash_command:read / write 并**创建版本发布**才可用; 缺权限时可点「发飞书权限卡片」,在飞书卡片上确认后自动重试。 注册结果约 5 分钟同步到客户端(客户端另有约 3 分钟缓存,重启飞书客户端可加速); PC 飞书需 7.70+、移动端 7.71+。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"})]})]})}const zf={absent:{label:"未安装",cls:"none",action:"安装"},installed:{label:"已安装",cls:"ok",action:"重新安装"},outdated:{label:"可更新",cls:"warn",action:"更新"},partial:{label:"需修复",cls:"bad",action:"修复"}},HM={marked:"平台注册(可整块卸载)",canonical:"手工注册(文本规范,平台可代管)",foreign:"自定义写法(平台只报告、不改动)","":"未注册"};function WM(){const e=Xn(),[t,n]=u.useState("user"),[s,o]=u.useState([]),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),m=u.useRef(0);u.useEffect(()=>{let g=!0;return Pt.list().then(w=>{if(!g)return;o(w);const j=w.find(v=>!v.archived)||w[0];j&&a(j.id)}).catch(w=>T(w.message)),()=>{g=!1}},[]);async function p(){const g=++m.current;try{const w=await Bu.list(t,l);g===m.current&&c(w)}catch(w){g===m.current&&T(w.message)}}u.useEffect(()=>{c(null),!(t==="project"&&!l)&&p()},[t,l]);async function h(g,w){f(`${g.id}:${w}`);try{const j=w==="install"?await Bu.install(g.id,t,l):await Bu.uninstall(g.id,t,l);w==="uninstall"?T(`已卸载「${g.name}」`):j.state==="installed"?T(j.restart_required?`已安装「${g.name}」,需重启 dsh 生效`:g.type==="dsh_plugin"?`已安装「${g.name}」,注册行已写入(热生效)`:`已安装「${g.name}」,对之后新起的 agent 会话生效`):T(`「${g.name}」安装后状态:${(zf[j.state]||{}).label||j.state}`),await p()}catch(j){T(j.message)}finally{f("")}}return r.jsxs(r.Fragment,{children:[r.jsxs(Dn,{className:"max-w-2xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(f0,{className:"size-4 text-primary"})," 内置资产"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:["安装平台内置资产(清单 = 仓库 ",r.jsx("span",{className:"font-mono",children:"extensions/*/asset.json"}),"), 两类:",r.jsx("span",{className:"font-mono",children:"skill"}),"(技能文件)与",r.jsx("span",{className:"font-mono",children:"dsh_plugin"}),"(dsh 原生插件:拷进 dsh profile 的 node_modules 并写入 ",r.jsx("span",{className:"font-mono",children:"cordis.patch.yml"})," 注册行,仅用户级)。 用户级写服务进程 HOME(如 ",r.jsx("span",{className:"font-mono",children:"~/.dsh/skills"}),"、",r.jsx("span",{className:"font-mono",children:"~/.dsh/profiles"}),"),影响本机所有项目、仅管理员可操作; 项目级写所选项目目录(如 ",r.jsx("span",{className:"font-mono",children:"<项目>/.dsh/skills"}),"),仅项目所有者可操作。 安装 = 收敛到清单期望状态(已装的会按内容更新)。"]}),r.jsxs("div",{className:"ext-seg",children:[r.jsx("button",{type:"button",className:t==="user"?"active":"",onClick:()=>n("user"),children:"用户级(本机)"}),r.jsx("button",{type:"button",className:t==="project"?"active":"",onClick:()=>n("project"),children:"项目级(所选项目)"})]}),t==="project"&&(s.length>0?r.jsx("div",{style:{maxWidth:320},children:r.jsx(Tc,{options:s.map(g=>({value:g.id,label:g.name+(g.archived?"(已归档)":""),search:g.project_dir})),value:l,onChange:a,placeholder:"选择项目"})}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"还没有项目:先在项目页创建项目,再回来装项目级资产。"})),t==="user"&&!e.isAdmin&&r.jsx("div",{className:"text-xs text-destructive",children:"用户级安装会写入本机 agent 配置、影响所有项目,仅管理员可操作——此处对你只读。"})]})]}),i&&i.assets.map(g=>r.jsx(qM,{a:g,target:t,canInstall:i.can_install,busy:d,onAct:h},g.id)),i&&i.assets.length===0&&r.jsx(Dn,{className:"max-w-2xl py-4",children:r.jsx(Fn,{className:"px-5 text-xs text-muted-foreground",children:"该目标下暂无可安装的内置资产。"})}),!i&&r.jsx(Dn,{className:"max-w-2xl py-4",children:r.jsx(Fn,{className:"px-5 text-xs text-muted-foreground",children:t==="project"&&!l?"请先选择项目。":"加载中…"})})]})}function qM({a:e,target:t,canInstall:n,busy:s,onAct:o}){const l=zf[e.state]||zf.absent,a=!e.supported||!n,i=s===`${e.id}:install`,c=s===`${e.id}:uninstall`;function d(){const f=e.type==="dsh_plugin"?"会删除插件包文件与平台写的注册行(用户自定义写法的注册行一律不动,遇到会拒绝并说明)。":"会删除平台安装进技能目录的文件(用户手工放的同名文件不动)。";window.confirm(`确认卸载「${e.name}」?
472
- ${f}`)&&o(e,"uninstall")}return r.jsxs(Dn,{className:"max-w-2xl gap-3 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.name,r.jsx("span",{className:"ext-kind",children:e.type_label||e.type}),e.family_label&&e.family_label!==(e.type_label||e.type)&&r.jsx("span",{className:"ext-kind",children:e.family_label}),r.jsx("span",{className:"ext-state "+l.cls,children:l.label})]})}),r.jsxs(Fn,{className:"space-y-2 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:e.description}),e.files.map(f=>r.jsxs("div",{className:"ext-path",children:[f.path,f.exists?f.same?"":"(内容与仓库不一致)":"(尚未安装)"]},f.to)),e.plugin&&r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"ext-path",children:[e.plugin.patch_path," —— 注册行:",HM[e.plugin.patch_mode]||e.plugin.patch_mode,e.plugin.disabled?"(已被 dsh 面板停用,安装会重新启用)":""]}),r.jsxs("div",{children:["插件包 ",r.jsx("span",{className:"font-mono",children:e.plugin.package})," · profile"," ",r.jsx("span",{className:"font-mono",children:e.plugin.profile}),e.plugin.restart_required?" · 该 profile 未开 patchReload,装完需重启 dsh 生效":" · 改注册行即热生效"]}),!e.plugin.requires_ok&&r.jsxs("div",{className:"text-destructive",children:["依赖解析不到:",(e.plugin.requires||[]).filter(f=>!f.ok).map(f=>f.spec).join("、"),"——dsh 自带包需在 profile 的 node_modules 里有对应链接(同目录软链),否则插件加载即报模块缺失。"]})]}),!e.supported&&r.jsx("div",{className:"text-xs text-destructive",children:e.reason}),e.state==="outdated"&&r.jsx("div",{className:"text-xs text-destructive",children:"已装文件与仓库版本不一致(可能被本地改过):更新会用仓库版本覆盖,需要保留本地改动请先另存。"}),e.supported&&!n&&r.jsx("div",{className:"text-xs text-destructive",children:t==="user"?"用户级安装仅管理员可操作,此处只读。":"你没有该项目的操作权限。"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[r.jsxs(F,{size:"sm",disabled:a||!!s,onClick:()=>o(e,"install"),children:[r.jsx(nN,{})," ",i?"处理中…":l.action]}),r.jsxs(F,{size:"sm",variant:"ghost",disabled:a||!!s||e.state==="absent",onClick:d,title:e.state==="absent"?"尚未安装":void 0,children:[r.jsx(qs,{})," ",c?"卸载中…":"卸载"]})]})]})]})}const GM=[{key:"appearance",label:"外观主题",icon:x0,admin:!1},{key:"password",label:"修改密码",icon:Bp,admin:!1},{key:"feishu",label:"飞书设置",icon:h0,admin:!1},{key:"assets",label:"内置资产",icon:f0,admin:!1},{key:"rag",label:"RAG 检索配置",icon:p0,admin:!0}];function rx(){const e=Al(),t=__(),n=Xn(),s=GM.filter(a=>!a.admin||n.isAdmin),o=s.find(a=>a.key===t.section)||s[0];u.useEffect(()=>{t.section!==o.key&&e(`/settings/${o.key}`,{replace:!0})},[t.section,o.key]);async function l(){await n.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"设置"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:n.username}),r.jsxs(F,{variant:"ghost",size:"sm",onClick:l,children:[r.jsx(Up,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("nav",{className:"sets-page-nav",children:s.map(a=>r.jsxs("button",{type:"button",className:a.key===o.key?"active":"",onClick:()=>e(`/settings/${a.key}`),children:[r.jsx(a.icon,{})," ",a.label]},a.key))}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(F,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(zp,{})," 返回项目"]})})]}),r.jsxs("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[o.key==="appearance"&&r.jsx(KM,{}),o.key==="password"&&r.jsx(YM,{}),o.key==="feishu"&&r.jsx(BM,{}),o.key==="assets"&&r.jsx(WM,{}),o.key==="rag"&&r.jsx(DM,{})]})]})]})}function KM(){const[e,t]=u.useState(hj()),[n,s]=u.useState(yj());return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(x0,{className:"size-4 text-primary"})," 外观主题"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"选择界面配色与字体大小,点选即生效,记录在本浏览器(localStorage),不影响其他用户。"}),r.jsx("div",{className:"grid grid-cols-2 gap-3",children:mj.map(o=>r.jsxs("button",{type:"button",className:"skin-pick"+(e===o.id?" active":""),onClick:()=>{gj(o.id),t(o.id)},children:[r.jsx("span",{className:"sw",children:o.preview.map(l=>r.jsx("i",{style:{background:l}},l))}),r.jsx("span",{children:o.label}),e===o.id&&r.jsx(Nl,{className:"ml-auto size-3.5 text-[var(--star)]"})]},o.id))}),r.jsx("div",{className:"grid grid-cols-4 gap-3",children:vj.map(o=>r.jsxs("button",{type:"button",className:"fs-pick"+(n===o.value?" active":""),onClick:()=>{wj(o.value),s(o.value)},children:[r.jsx("span",{className:"sample",style:{fontSize:`calc(13px * ${o.value})`},children:"字A"}),r.jsx("span",{children:o.label}),n===o.value&&r.jsx(Nl,{className:"ml-auto size-3.5 text-[var(--star)]"})]},o.value))})]})]})}function YM(){const[e,t]=u.useState({old:"",new:""}),[n,s]=u.useState(!1);async function o(){s(!0);try{await pl.changePassword(e.old,e.new),T("密码已修改"),t({old:"",new:""})}catch(l){T(l.message)}finally{s(!1)}}return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(ms,{className:"px-5 pb-0",children:r.jsxs(hs,{className:"flex items-center gap-2 text-sm",children:[r.jsx(Bp,{className:"size-4 text-primary"})," 修改密码"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"原密码"}),r.jsx(Ie,{type:"password",value:e.old,onChange:l=>t({...e,old:l.target.value})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ie,{type:"password",value:e.new,onChange:l=>t({...e,new:l.target.value})})]}),r.jsx(F,{variant:"outline",disabled:n,onClick:o,children:"保存"})]})]})}function QM(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":e.startsWith("### COMPACT")?"lp-compact":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/ROUND_DONE|FIX_DONE|RETEST_SUMMARY|STRESS_DONE/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}const XM=5e3;function JM(){const[e,t]=H_(),n=+(e.get("task")||0),s=+(e.get("round")||0),[o,l]=u.useState(null),[a,i]=u.useState([]),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState(""),g=u.useRef(null),w=u.useRef(!0),j=u.useMemo(()=>c?c.split(`
473
- `):[],[c]);u.useEffect(()=>{if(!n){h("缺少 task 参数");return}let x=!1;return(async()=>{try{const[y,b]=await Promise.all([Be.get(n),Be.rounds(n)]);if(x)return;l(y),i(b),b.length&&!b.some(S=>S.round_no===s)&&t({task:String(n),round:String(b[b.length-1].round_no)},{replace:!0})}catch(y){x||h(y.message)}})(),()=>{x=!0}},[n,s]),u.useEffect(()=>(document.title=o?`日志 · ${o.name}`:"任务日志",()=>{document.title="Touchstone"}),[o]),u.useEffect(()=>{if(!n||!s)return;let x=null,y=!1;const b=async()=>{const S=g.current;w.current=S?S.scrollHeight-S.scrollTop-S.clientHeight<60:!0;try{const N=await Be.log(n,s,XM);if(y)return;m(!1),d(k=>k===N.log?k:N.log)}catch{y||(m(!0),d(""))}};return b(),x=setInterval(b,2e3),()=>{y=!0,clearInterval(x)}},[n,s]),u.useEffect(()=>{const x=g.current;x&&w.current&&(x.scrollTop=x.scrollHeight)},[c]);function v(){w.current=!0;const x=g.current;x&&(x.scrollTop=x.scrollHeight)}return r.jsxs("div",{className:"log-page",children:[r.jsxs("div",{className:"log-page-head",children:[r.jsx(Xc,{size:20}),r.jsx("span",{className:"t",children:"任务日志"}),o&&r.jsxs("span",{className:"dim",children:["「",o.name,"」"]}),o&&r.jsxs("span",{className:"badge st-"+o.status,children:[r.jsx("span",{className:"dot"}),lr[o.status]||o.status]}),r.jsx("span",{className:"spacer"}),a.length>0&&r.jsxs(It,{value:String(s),onValueChange:x=>t({task:String(n),round:x}),children:[r.jsx(Et,{size:"sm",className:"h-7 min-w-[90px] text-xs",children:r.jsx(Ct,{})}),r.jsx(Rt,{children:a.map(x=>r.jsxs(Ae,{value:String(x.round_no),children:["第 ",x.round_no," 轮"]},x.round_no))})]}),r.jsxs("span",{className:"hint",children:[j.length," 行 · 2s 自动刷新 · 在底部时自动跟随"]}),r.jsxs(F,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",title:"回到底部并恢复自动跟随",onClick:v,children:[r.jsx($k,{})," 底部"]})]}),(o==null?void 0:o.task_type)==="stress"&&r.jsx(Xw,{task:o}),r.jsx("div",{className:"log-page-body",children:p?r.jsxs("div",{className:"hint",style:{margin:"auto"},children:["加载失败:",p]}):f?r.jsx("div",{className:"hint",style:{margin:"auto"},children:"该轮暂无日志"}):r.jsx("div",{className:"log",ref:g,children:j.map((x,y)=>r.jsx("div",{className:"log-line "+QM(x),children:x||" "},y))})})]})}function jj(){const e=Xn(),[t,n]=u.useState(""),[s,o]=u.useState(""),[l,a]=u.useState(""),[i,c]=u.useState(""),[d,f]=u.useState(!1);async function m(){if(!d){if(c(""),s.length<6){c("新密码至少 6 位");return}if(s!==l){c("两次输入的新密码不一致");return}f(!0);try{await pl.changePassword(t,s),await e.load(),T("密码已修改")}catch(p){c(p.message||"修改失败")}finally{f(!1)}}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(Dn,{className:"w-[380px] shadow-xl",children:[r.jsxs(ms,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(Xc,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsxs(hs,{className:"flex items-center justify-center gap-2 font-serif text-lg",children:[r.jsx(Bp,{className:"size-4 text-primary"})," 首次登录须修改密码"]}),r.jsxs(c0,{className:"mt-1",children:["账号 ",e.username," 仍在使用一次性初始口令"]})]})]}),r.jsxs(Fn,{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"force-old-pw",className:"text-xs text-muted-foreground",children:"当前口令(启动横幅里的一次性口令)"}),r.jsx(Ie,{id:"force-old-pw",value:t,type:"password",onChange:p=>n(p.target.value),autoComplete:"current-password",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"force-new-pw",className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ie,{id:"force-new-pw",value:s,type:"password",onChange:p=>o(p.target.value),autoComplete:"new-password"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Ze,{htmlFor:"force-new-pw2",className:"text-xs text-muted-foreground",children:"确认新密码"}),r.jsx(Ie,{id:"force-new-pw2",value:l,type:"password",onChange:p=>a(p.target.value),autoComplete:"new-password",onKeyUp:p=>{p.key==="Enter"&&m()}})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:i}),r.jsxs(F,{size:"lg",className:"w-full",disabled:d,onClick:m,children:[d&&r.jsx(g0,{className:"size-4 animate-spin"}),"修改并进入"]})]}),r.jsx(u0,{className:"flex-col items-center pt-0",children:r.jsx("button",{type:"button",className:"text-sm text-primary underline-offset-4 hover:underline",onClick:()=>e.logout(),children:"退出登录"})})]})})}const bj="ts.last_route",ZM=["","app","monitor","admin","settings"];function du(){return"/touchstone/".replace(/\/+$/,"")}function _j(e){const t=du();return t&&e.startsWith(t+"/")?e.slice(t.length):t&&e===t?"/":e}function e$(e,t){const n=du();return(n?[n+"/",n+"/app"]:["/","/app"]).includes(e)&&!t}function t$(e,t=""){try{if(!e)return;const n=_j(e);if(n==="/login"||n==="/log")return;localStorage.setItem(bj,du()+n+(t||""))}catch{}}function n$(){try{const e=localStorage.getItem(bj)||"";if(!e.startsWith("/"))return"";const t=du();if(t&&!(e===t||e.startsWith(t+"/")))return"";const[n,s=""]=e.split("?"),o=_j(n).split("/")[1]||"";return ZM.includes(o)?e:""}catch{return""}}function s$(){const e=n$();if(!e)return"";const{pathname:t,search:n}=window.location;return t+n===e||!e$(t,n)?"":(window.history.replaceState(null,"",e),e)}function Ql({children:e}){const t=Xn(s=>s.username),n=Xn(s=>s.mustChangePassword);return t?n?r.jsx(jj,{}):e:r.jsx(Sl,{to:"/login",replace:!0})}function r$({children:e}){const t=Xn(o=>o.username),n=Xn(o=>o.isAdmin),s=Xn(o=>o.mustChangePassword);return t?s?r.jsx(jj,{}):n?e:r.jsx(Sl,{to:"/app",replace:!0}):r.jsx(Sl,{to:"/login",replace:!0})}function o$({children:e}){return Xn(n=>n.username)?r.jsx(Sl,{to:"/app",replace:!0}):e}function l$(){const e=Ua();return u.useEffect(()=>{t$(e.pathname,e.search)},[e.pathname,e.search]),r.jsxs(D_,{children:[r.jsx(Ls,{path:"/login",element:r.jsx(o$,{children:r.jsx(nC,{})})}),r.jsx(Ls,{path:"/",element:r.jsx(Sl,{to:"/app",replace:!0})}),r.jsx(Ls,{path:"/app",element:r.jsx(Ql,{children:r.jsx(sx,{})})}),r.jsx(Ls,{path:"/monitor",element:r.jsx(Ql,{children:r.jsx(sx,{})})}),r.jsx(Ls,{path:"/admin",element:r.jsx(r$,{children:r.jsx(OM,{})})}),r.jsx(Ls,{path:"/settings",element:r.jsx(Ql,{children:r.jsx(rx,{})})}),r.jsx(Ls,{path:"/settings/:section",element:r.jsx(Ql,{children:r.jsx(rx,{})})}),r.jsx(Ls,{path:"/log",element:r.jsx(Ql,{children:r.jsx(JM,{})})}),r.jsx(Ls,{path:"*",element:r.jsx(Sl,{to:"/app",replace:!0})})]})}LM();zM();jP();Xn.getState().load().finally(()=>{s$(),yy(document.getElementById("app")).render(r.jsx(V_,{basename:"/touchstone/".replace(/\/+$/,"")||"/",children:r.jsx(l$,{})}))});