diff --git a/agent/cmd/mc-agent/uidist/index.html b/agent/cmd/mc-agent/uidist/index.html index 65e8342a..58c6fb93 100644 --- a/agent/cmd/mc-agent/uidist/index.html +++ b/agent/cmd/mc-agent/uidist/index.html @@ -53,13 +53,13 @@ `+l[u].replace(" at new "," at ");return e.displayName&&g.includes("")&&(g=g.replace("",e.displayName)),g}while(1<=u&&0<=m);break}}}finally{ae=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function me(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function ge(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ee:return"Fragment";case de:return"Portal";case mt:return"Profiler";case Ge:return"StrictMode";case et:return"Suspense";case ut:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jt:return(e.displayName||"Context")+".Consumer";case be:return(e._context.displayName||"Context")+".Provider";case Be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ue:return t=e.displayName||null,t!==null?t:ge(e.type)||"Memo";case Ke:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}function xe(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 ge(t);case 8:return t===Ge?"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 ye(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tt(e){var t=Se(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){r=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(u){r=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Te(e){e._valueTracker||(e._valueTracker=tt(e))}function $n(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Se(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ae(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 er(e,t){var n=t.checked;return U({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ye(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $t(e,t){t=t.checked,t!=null&&q(e,"checked",t,!1)}function On(e,t){$t(e,t);var n=ye(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dn(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dn(e,t.type,ye(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function It(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Dn(e,t,n){(t!=="number"||Ae(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ht=Array.isArray;function zt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=un.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt={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},tr=["Webkit","ms","Moz","O"];Object.keys(Qt).forEach(function(e){tr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qt[t]=Qt[e]})});function Fn(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qt.hasOwnProperty(e)&&Qt[e]?(""+t).trim():t+"px"}function Tr(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Fn(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var cn=U({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 fn(e,t){if(t){if(cn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function bn(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 gt=null;function qe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,dn=null,pn=null;function Cn(e){if(e=Gl(e)){if(typeof Bn!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Fi(t),Bn(e.stateNode,e.type,t))}}function nr(e){dn?pn?pn.push(e):pn=[e]:dn=e}function _n(){if(dn){var e=dn,t=pn;if(pn=dn=null,Cn(e),t)for(e=0;e>>=0,e===0?32:31-(lr(e)/_r|0)|0}var Gr=64,Yr=4194304;function ir(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 Rr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,u=n&268435455;if(u!==0){var m=u&~l;m!==0?r=ir(m):(o&=u,o!==0&&(r=ir(o)))}else u=n&~l,u!==0?r=ir(u):o!==0&&(r=ir(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function An(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Nl(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 r=e.eventTimes;for(e=e.expirationTimes;0=Ml),ru=" ",lu=!1;function iu(e,t){switch(e){case"keyup":return Hd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zr=!1;function Qd(e,t){switch(e){case"compositionend":return ou(t);case"keypress":return t.which!==32?null:(lu=!0,ru);case"textInput":return e=t.data,e===ru&&lu?null:e;default:return null}}function Gd(e,t){if(Zr)return e==="compositionend"||!Yo&&iu(e,t)?(e=Za(),Ri=Uo=sr=null,Zr=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pu(n)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gu(){for(var e=window,t=Ae();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ae(e.document)}return t}function Xo(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 tp(e){var t=gu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mu(n.ownerDocument.documentElement,n)){if(r!==null&&Xo(n)){if(t=r.start,e=r.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 l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=hu(n,o);var u=hu(n,r);l&&u&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.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=document.documentMode,Jr=null,Zo=null,Ul=null,Jo=!1;function yu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jo||Jr==null||Jr!==Ae(r)||(r=Jr,"selectionStart"in r&&Xo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ul&&Bl(Ul,r)||(Ul=r,r=Oi(Zo,"onSelect"),0rl||(e.current=cs[rl],cs[rl]=null,rl--)}function ze(e,t){rl++,cs[rl]=e.current,e.current=t}var fr={},wt=cr(fr),Mt=cr(!1),Nr=fr;function ll(e,t){var n=e.type.contextTypes;if(!n)return fr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ft(e){return e=e.childContextTypes,e!=null}function bi(){De(Mt),De(wt)}function zu(e,t,n){if(wt.current!==fr)throw Error(s(168));ze(wt,t),ze(Mt,n)}function Pu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(s(108,xe(e)||"Unknown",l));return U({},n,r)}function Bi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fr,Nr=wt.current,ze(wt,e),ze(Mt,Mt.current),!0}function ju(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=Pu(e,t,Nr),r.__reactInternalMemoizedMergedChildContext=e,De(Mt),De(wt),ze(wt,e)):De(Mt),ze(Mt,n)}var Hn=null,Ui=!1,fs=!1;function Ou(e){Hn===null?Hn=[e]:Hn.push(e)}function pp(e){Ui=!0,Ou(e)}function dr(){if(!fs&&Hn!==null){fs=!0;var e=0,t=d;try{var n=Hn;for(d=1;e>=u,l-=u,Vn=1<<32-vt(t)+l|n<se?(ot=ne,ne=null):ot=ne.sibling;var ke=z(S,ne,E[se],D);if(ke===null){ne===null&&(ne=ot);break}e&&ne&&ke.alternate===null&&t(S,ne),x=o(ke,x,se),te===null?X=ke:te.sibling=ke,te=ke,ne=ot}if(se===E.length)return n(S,ne),Fe&&Ir(S,se),X;if(ne===null){for(;sese?(ot=ne,ne=null):ot=ne.sibling;var kr=z(S,ne,ke.value,D);if(kr===null){ne===null&&(ne=ot);break}e&&ne&&kr.alternate===null&&t(S,ne),x=o(kr,x,se),te===null?X=kr:te.sibling=kr,te=kr,ne=ot}if(ke.done)return n(S,ne),Fe&&Ir(S,se),X;if(ne===null){for(;!ke.done;se++,ke=E.next())ke=j(S,ke.value,D),ke!==null&&(x=o(ke,x,se),te===null?X=ke:te.sibling=ke,te=ke);return Fe&&Ir(S,se),X}for(ne=r(S,ne);!ke.done;se++,ke=E.next())ke=B(ne,S,se,ke.value,D),ke!==null&&(e&&ke.alternate!==null&&ne.delete(ke.key===null?se:ke.key),x=o(ke,x,se),te===null?X=ke:te.sibling=ke,te=ke);return e&&ne.forEach(function(Yp){return t(S,Yp)}),Fe&&Ir(S,se),X}function Ye(S,x,E,D){if(typeof E=="object"&&E!==null&&E.type===Ee&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case he:e:{for(var X=E.key,te=x;te!==null;){if(te.key===X){if(X=E.type,X===Ee){if(te.tag===7){n(S,te.sibling),x=l(te,E.props.children),x.return=S,S=x;break e}}else if(te.elementType===X||typeof X=="object"&&X!==null&&X.$$typeof===Ke&&Uu(X)===te.type){n(S,te.sibling),x=l(te,E.props),x.ref=Yl(S,te,E),x.return=S,S=x;break e}n(S,te);break}else t(S,te);te=te.sibling}E.type===Ee?(x=br(E.props.children,S.mode,D,E.key),x.return=S,S=x):(D=go(E.type,E.key,E.props,null,S.mode,D),D.ref=Yl(S,x,E),D.return=S,S=D)}return u(S);case de:e:{for(te=E.key;x!==null;){if(x.key===te)if(x.tag===4&&x.stateNode.containerInfo===E.containerInfo&&x.stateNode.implementation===E.implementation){n(S,x.sibling),x=l(x,E.children||[]),x.return=S,S=x;break e}else{n(S,x);break}else t(S,x);x=x.sibling}x=aa(E,S.mode,D),x.return=S,S=x}return u(S);case Ke:return te=E._init,Ye(S,x,te(E._payload),D)}if(Ht(E))return G(S,x,E,D);if($(E))return K(S,x,E,D);Qi(S,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,x!==null&&x.tag===6?(n(S,x.sibling),x=l(x,E),x.return=S,S=x):(n(S,x),x=sa(E,S.mode,D),x.return=S,S=x),u(S)):n(S,x)}return Ye}var al=Wu(!0),Hu=Wu(!1),Gi=cr(null),Yi=null,ul=null,ys=null;function vs(){ys=ul=Yi=null}function xs(e){var t=Gi.current;De(Gi),e._currentValue=t}function ws(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function cl(e,t){Yi=e,ys=ul=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(bt=!0),e.firstContext=null)}function ln(e){var t=e._currentValue;if(ys!==e)if(e={context:e,memoizedValue:t,next:null},ul===null){if(Yi===null)throw Error(s(308));ul=e,Yi.dependencies={lanes:0,firstContext:e}}else ul=ul.next=e;return t}var zr=null;function ks(e){zr===null?zr=[e]:zr.push(e)}function Vu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ks(t)):(n.next=l.next,l.next=n),t.interleaved=n,Gn(e,r)}function Gn(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 pr=!1;function Ss(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qu(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 Yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(we&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Gn(e,n)}return l=r.interleaved,l===null?(t.next=t,ks(r)):(t.next=l.next,l.next=t),r.interleaved=t,Gn(e,n)}function Ki(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,O(e,n)}}function Gu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var u={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=u:o=o.next=u,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qi(e,t,n,r){var l=e.updateQueue;pr=!1;var o=l.firstBaseUpdate,u=l.lastBaseUpdate,m=l.shared.pending;if(m!==null){l.shared.pending=null;var g=m,_=g.next;g.next=null,u===null?o=_:u.next=_,u=g;var P=e.alternate;P!==null&&(P=P.updateQueue,m=P.lastBaseUpdate,m!==u&&(m===null?P.firstBaseUpdate=_:m.next=_,P.lastBaseUpdate=g))}if(o!==null){var j=l.baseState;u=0,P=_=g=null,m=o;do{var z=m.lane,B=m.eventTime;if((r&z)===z){P!==null&&(P=P.next={eventTime:B,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var G=e,K=m;switch(z=t,B=n,K.tag){case 1:if(G=K.payload,typeof G=="function"){j=G.call(B,j,z);break e}j=G;break e;case 3:G.flags=G.flags&-65537|128;case 0:if(G=K.payload,z=typeof G=="function"?G.call(B,j,z):G,z==null)break e;j=U({},j,z);break e;case 2:pr=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,z=l.effects,z===null?l.effects=[m]:z.push(m))}else B={eventTime:B,lane:z,tag:m.tag,payload:m.payload,callback:m.callback,next:null},P===null?(_=P=B,g=j):P=P.next=B,u|=z;if(m=m.next,m===null){if(m=l.shared.pending,m===null)break;z=m,m=z.next,z.next=null,l.lastBaseUpdate=z,l.shared.pending=null}}while(!0);if(P===null&&(g=j),l.baseState=g,l.firstBaseUpdate=_,l.lastBaseUpdate=P,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Or|=u,e.lanes=u,e.memoizedState=j}}function Yu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Rs.transition;Rs.transition={};try{e(!1),t()}finally{d=n,Rs.transition=r}}function dc(){return on().memoizedState}function yp(e,t,n){var r=vr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e))hc(t,n);else if(n=Vu(e,t,n,r),n!==null){var l=At();kn(n,e,r,l),mc(n,t,r)}}function vp(e,t,n){var r=vr(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))hc(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,m=o(u,n);if(l.hasEagerState=!0,l.eagerState=m,gn(m,u)){var g=t.interleaved;g===null?(l.next=l,ks(t)):(l.next=g.next,g.next=l),t.interleaved=l;return}}catch{}finally{}n=Vu(e,t,l,r),n!==null&&(l=At(),kn(n,e,r,l),mc(n,t,r))}}function pc(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function hc(e,t){Zl=Ji=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,O(e,n)}}var to={readContext:ln,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},xp={readContext:ln,useCallback:function(e,t){return In().memoizedState=[e,t===void 0?null:t],e},useContext:ln,useEffect:lc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$i(4194308,4,sc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $i(4194308,4,e,t)},useInsertionEffect:function(e,t){return $i(4,2,e,t)},useMemo:function(e,t){var n=In();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=In();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yp.bind(null,Ve,e),[r.memoizedState,e]},useRef:function(e){var t=In();return e={current:e},t.memoizedState=e},useState:nc,useDebugValue:js,useDeferredValue:function(e){return In().memoizedState=e},useTransition:function(){var e=nc(!1),t=e[0];return e=gp.bind(null,e[1]),In().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ve,l=In();if(Fe){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),it===null)throw Error(s(349));(jr&30)!==0||Zu(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,lc($u.bind(null,r,o,e),[e]),r.flags|=2048,ei(9,Ju.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=In(),t=it.identifierPrefix;if(Fe){var n=Qn,r=Vn;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),n==="select"&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Nn]=t,e[Ql]=r,Oc(e,t,!1,!1),t.stateNode=e;e:{switch(u=bn(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),l=r;break;case"iframe":case"object":case"embed":Oe("load",e),l=r;break;case"video":case"audio":for(l=0;lml&&(t.flags|=128,r=!0,ti(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xi(u),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ti(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!Fe)return St(t),null}else 2*Ce()-o.renderingStartTime>ml&&n!==1073741824&&(t.flags|=128,r=!0,ti(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(n=o.last,n!==null?n.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=He.current,ze(He,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return la(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Xt&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Rp(e,t){switch(ps(t),t.tag){case 1:return Ft(t.type)&&bi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fl(),De(Mt),De(wt),_s(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ts(t),null;case 13:if(De(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(He),null;case 4:return fl(),null;case 10:return xs(t.type._context),null;case 22:case 23:return la(),null;case 24:return null;default:return null}}var io=!1,Et=!1,Ap=typeof WeakSet=="function"?WeakSet:Set,V=null;function pl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function Gs(e,t,n){try{n()}catch(r){Qe(e,t,r)}}var Fc=!1;function Np(e,t){if(ls=Ci,e=gu(),Xo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,m=-1,g=-1,_=0,P=0,j=e,z=null;t:for(;;){for(var B;j!==n||l!==0&&j.nodeType!==3||(m=u+l),j!==o||r!==0&&j.nodeType!==3||(g=u+r),j.nodeType===3&&(u+=j.nodeValue.length),(B=j.firstChild)!==null;)z=j,j=B;for(;;){if(j===e)break t;if(z===n&&++_===l&&(m=u),z===o&&++P===r&&(g=u),(B=j.nextSibling)!==null)break;j=z,z=j.parentNode}j=B}n=m===-1||g===-1?null:{start:m,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(is={focusedElem:e,selectionRange:n},Ci=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var G=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(G!==null){var K=G.memoizedProps,Ye=G.memoizedState,S=t.stateNode,x=S.getSnapshotBeforeUpdate(t.elementType===t.type?K:vn(t.type,K),Ye);S.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(D){Qe(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return G=Fc,Fc=!1,G}function ni(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Gs(t,n,o)}l=l.next}while(l!==r)}}function oo(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ys(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 bc(e){var t=e.alternate;t!==null&&(e.alternate=null,bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[Ql],delete t[us],delete t[fp],delete t[dp])),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 Bc(e){return e.tag===5||e.tag===3||e.tag===4}function Uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(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 Ks(e,t,n){var r=e.tag;if(r===5||r===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=Mi));else if(r!==4&&(e=e.child,e!==null))for(Ks(e,t,n),e=e.sibling;e!==null;)Ks(e,t,n),e=e.sibling}function qs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qs(e,t,n),e=e.sibling;e!==null;)qs(e,t,n),e=e.sibling}var ft=null,xn=!1;function mr(e,t,n){for(n=n.child;n!==null;)Wc(e,t,n),n=n.sibling}function Wc(e,t,n){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(Cr,n)}catch{}switch(n.tag){case 5:Et||pl(n,t);case 6:var r=ft,l=xn;ft=null,mr(e,t,n),ft=r,xn=l,ft!==null&&(xn?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(xn?(e=ft,n=n.stateNode,e.nodeType===8?as(e.parentNode,n):e.nodeType===1&&as(e,n),jl(e)):as(ft,n.stateNode));break;case 4:r=ft,l=xn,ft=n.stateNode.containerInfo,xn=!0,mr(e,t,n),ft=r,xn=l;break;case 0:case 11:case 14:case 15:if(!Et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,u=o.destroy;o=o.tag,u!==void 0&&((o&2)!==0||(o&4)!==0)&&Gs(n,t,u),l=l.next}while(l!==r)}mr(e,t,n);break;case 1:if(!Et&&(pl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(m){Qe(n,t,m)}mr(e,t,n);break;case 21:mr(e,t,n);break;case 22:n.mode&1?(Et=(r=Et)||n.memoizedState!==null,mr(e,t,n),Et=r):mr(e,t,n);break;default:mr(e,t,n)}}function Hc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ap),t.forEach(function(r){var l=Fp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function wn(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=u),r&=~o}if(r=l,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ip(r/1960))-r,10e?16:e,yr===null)var r=!1;else{if(e=yr,yr=null,fo=0,(we&6)!==0)throw Error(s(331));var l=we;for(we|=4,V=e.current;V!==null;){var o=V,u=o.child;if((V.flags&16)!==0){var m=o.deletions;if(m!==null){for(var g=0;gCe()-Js?Mr(e,0):Zs|=n),Ut(e,t)}function nf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Yr,Yr<<=1,(Yr&130023424)===0&&(Yr=4194304)));var n=At();e=Gn(e,t),e!==null&&(An(e,t,n),Ut(e,n))}function Mp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nf(e,n)}function Fp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),nf(e,n)}var rf;rf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)bt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return bt=!1,Cp(e,t,n);bt=(e.flags&131072)!==0}else bt=!1,Fe&&(t.flags&1048576)!==0&&Du(t,Hi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lo(e,t),e=t.pendingProps;var l=ll(t,wt.current);cl(t,n),l=Ns(null,t,r,e,l,n);var o=Ls();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(o=!0,Bi(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ss(t),l.updater=no,t.stateNode=l,l._reactInternals=t,Ds(t,r,e,n),t=Bs(null,t,r,!0,o,n)):(t.tag=0,Fe&&o&&ds(t),Rt(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lo(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Bp(r),e=vn(r,e),l){case 0:t=bs(null,t,r,e,n);break e;case 1:t=Nc(null,t,r,e,n);break e;case 11:t=Tc(null,t,r,e,n);break e;case 14:t=Cc(null,t,r,vn(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),bs(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),Nc(e,t,r,l,n);case 3:e:{if(Lc(t),e===null)throw Error(s(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Qu(e,t),qi(t,r,null,n);var u=t.memoizedState;if(r=u.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=dl(Error(s(423)),t),t=Ic(e,t,r,n,l);break e}else if(r!==l){l=dl(Error(s(424)),t),t=Ic(e,t,r,n,l);break e}else for(qt=ur(t.stateNode.containerInfo.firstChild),Kt=t,Fe=!0,yn=null,n=Hu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(sl(),r===l){t=Kn(e,t,n);break e}Rt(e,t,r,n)}t=t.child}return t;case 5:return Ku(t),e===null&&ms(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,u=l.children,os(r,l)?u=null:o!==null&&os(r,o)&&(t.flags|=32),Ac(e,t),Rt(e,t,u,n),t.child;case 6:return e===null&&ms(t),null;case 13:return zc(e,t,n);case 4:return Es(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=al(t,null,r,n):Rt(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),Tc(e,t,r,l,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,u=l.value,ze(Gi,r._currentValue),r._currentValue=u,o!==null)if(gn(o.value,u)){if(o.children===l.children&&!Mt.current){t=Kn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var m=o.dependencies;if(m!==null){u=o.child;for(var g=m.firstContext;g!==null;){if(g.context===r){if(o.tag===1){g=Yn(-1,n&-n),g.tag=2;var _=o.updateQueue;if(_!==null){_=_.shared;var P=_.pending;P===null?g.next=g:(g.next=P.next,P.next=g),_.pending=g}}o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),ws(o.return,n,t),m.lanes|=n;break}g=g.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(s(341));u.lanes|=n,m=u.alternate,m!==null&&(m.lanes|=n),ws(u,n,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}Rt(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,cl(t,n),l=ln(l),r=r(l),t.flags|=1,Rt(e,t,r,n),t.child;case 14:return r=t.type,l=vn(r,t.pendingProps),l=vn(r.type,l),Cc(e,t,r,l,n);case 15:return _c(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),lo(e,t),t.tag=1,Ft(r)?(e=!0,Bi(t)):e=!1,cl(t,n),yc(t,r,l),Ds(t,r,l,n),Bs(null,t,r,!0,e,n);case 19:return jc(e,t,n);case 22:return Rc(e,t,n)}throw Error(s(156,t.tag))};function lf(e,t){return xi(e,t)}function bp(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,t,n,r){return new bp(e,t,n,r)}function oa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bp(e){if(typeof e=="function")return oa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Be)return 11;if(e===Ue)return 14}return 2}function wr(e,t){var n=e.alternate;return n===null?(n=an(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 go(e,t,n,r,l,o){var u=2;if(r=e,typeof e=="function")oa(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Ee:return br(n.children,l,o,t);case Ge:u=8,l|=8;break;case mt:return e=an(12,n,t,l|2),e.elementType=mt,e.lanes=o,e;case et:return e=an(13,n,t,l),e.elementType=et,e.lanes=o,e;case ut:return e=an(19,n,t,l),e.elementType=ut,e.lanes=o,e;case Ne:return yo(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case be:u=10;break e;case Jt:u=9;break e;case Be:u=11;break e;case Ue:u=14;break e;case Ke:u=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=an(u,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function br(e,t,n,r){return e=an(7,e,r,t),e.lanes=n,e}function yo(e,t,n,r){return e=an(22,e,r,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function sa(e,t,n){return e=an(6,e,null,t),e.lanes=n,e}function aa(e,t,n){return t=an(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Up(e,t,n,r,l){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=Kr(0),this.expirationTimes=Kr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kr(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ua(e,t,n,r,l,o,u,m,g){return e=new Up(e,t,n,m,g),t===1?(t=1,o===!0&&(t|=8)):t=0,o=an(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ss(o),e}function Wp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ma.exports=th(),ma.exports}var xf;function rh(){if(xf)return To;xf=1;var a=nh();return To.createRoot=a.createRoot,To.hydrateRoot=a.hydrateRoot,To}var lh=rh();const Zf=location.hash.slice(1)||window.prompt("访问令牌(serve 启动时打印)")||"";function Da(a){return new TextDecoder().decode(Uint8Array.from(atob(a),i=>i.charCodeAt(0)))}function mi(a){let i="";for(const s of new TextEncoder().encode(a))i+=String.fromCharCode(s);return btoa(i)}function ai(a){if(!a.data)return null;try{return JSON.parse(Da(a.data))}catch{return null}}async function Ma(a,i={}){const s=await fetch(a,{...i,headers:{Authorization:"Bearer "+Zf,"Content-Type":"application/json",...i.headers||{}}});if(!s.ok){let c="HTTP "+s.status;try{const f=await s.json();f!=null&&f.error&&(c=f.error)}catch{}throw new Error(c)}return s.json()}const ih=()=>Ma("/api/sessions"),oh=()=>Ma("/api/models"),sh=(a,i,s=!1)=>Ma("/api/sessions",{method:"POST",body:JSON.stringify({workdir:a,model:i,create_dir:s})});async function ah(){var i;const a=window.__TAURI__;if(!((i=a==null?void 0:a.core)!=null&&i.invoke))return null;try{const s=await a.core.invoke("plugin:dialog|open",{options:{directory:!0,multiple:!1,title:"选择工作区目录"}});return typeof s=="string"?s:null}catch{return null}}function Aa(){var a,i;return!!((i=(a=window.__TAURI__)==null?void 0:a.core)!=null&&i.invoke)}async function uh(){var i;const a=window.__TAURI__;return(i=a==null?void 0:a.core)!=null&&i.invoke?await a.core.invoke("get_config"):null}async function ch(a){var s;const i=window.__TAURI__;if(!((s=i==null?void 0:i.core)!=null&&s.invoke))throw new Error("浏览器模式下配置只读,请在桌面应用中修改");await i.core.invoke("save_config",{config:a})}function fh(a,i){var h;const s=window.__TAURI__,c=(h=s==null?void 0:s.event)==null?void 0:h.listen;if(!c)return()=>{};const f=c(a,i);return()=>{f.then(w=>w()).catch(()=>{})}}const dh=15e3,ph=2e3;function Jf(a,i){let s=null,c=!1,f=[],h=!1,w=null;const v=new Map;function R(){h=!1;const M=f;f=[],M.length&&i.onFrames(M),f.length&&k()}function k(){h||(h=!0,requestAnimationFrame(R))}function A(){if(c)return;i.onStatus("连接中…",!1);const M=new WebSocket(`ws://${location.host}/ws?session=${a}&token=${Zf}`);s=M,M.onopen=()=>i.onStatus("已连接",!0),M.onclose=()=>{s!==M||c||(i.onStatus("⚠ 连接断开,2 秒后自动重连…",!1),w=setTimeout(A,ph))},M.onmessage=N=>{let re;try{re=JSON.parse(N.data)}catch{return}if(re.type==="call-response"&&re.kind){const Y=v.get(re.kind);if(Y){v.delete(re.kind),clearTimeout(Y.timer),Y.resolve(re.data?JSON.parse(Da(re.data)):{});return}}f.push(re),k()}}return A(),{send(M,N){return!s||s.readyState!==WebSocket.OPEN?(i.onStatus("⚠ 连接已断开,操作未发送;重连后请重试",!1),!1):(s.send(JSON.stringify({type:M,data:mi(JSON.stringify(N)),timestamp:Date.now()})),!0)},call(M,N={}){return new Promise((re,Y)=>{if(!s||s.readyState!==WebSocket.OPEN){Y(new Error("未连接"));return}const J=setTimeout(()=>{v.delete(M),Y(new Error("call 超时"))},dh);v.set(M,{resolve:re,timer:J}),s.send(JSON.stringify({type:"call",kind:M,data:mi(JSON.stringify(N)),timestamp:Date.now()}))})},close(){c=!0,w&&clearTimeout(w);for(const[,M]of v)clearTimeout(M.timer);v.clear(),s&&(s.onclose=null,s.close())}}}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function wf(a,i){(i==null||i>a.length)&&(i=a.length);for(var s=0,c=Array(i);s2?c-2:0),h=2;h1?s-1:0),f=1;f"u"?null:$e(BigInt.prototype.toString),_f=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),at=$e(Object.prototype.hasOwnProperty),ci=$e(Object.prototype.toString),st=$e(RegExp.prototype.test),Br=Rh(TypeError);function $e(a){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var s=arguments.length,c=new Array(s>1?s-1:0),f=1;f2&&arguments[2]!==void 0?arguments[2]:hi;if(kf&&kf(a,null),!Er(i))return a;let c=i.length;for(;c--;){let f=i[c];if(typeof f=="string"){const h=s(f);h!==f&&(xh(i)||(i[c]=h),f=h)}a[f]=!0}return a}function Ah(a){for(let i=0;i/g),Oh=ht(/\${[\w\W]*/g),Dh=ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mh=ht(/^aria-[\-\w]+$/),If=ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fh=ht(/^(?:\w+script|data):/i),bh=ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bh=ht(/^html$/i),Uh=ht(/^[a-z][.\w]*(-[.\w]+)+$/i),zf=ht(/<[/\w!]/g),Pf=ht(/<[/\w]/g),Wh=ht(/<\/no(script|embed|frames)/i),Hh=ht(/\/>/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vh=function(){return typeof window>"u"?null:window},Qh=function(i,s){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";s&&s.hasAttribute(f)&&(c=s.getAttribute(f));const h="dompurify"+(c?"#"+c:"");try{return i.createPolicy(h,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},jf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sr=function(i,s,c,f){return at(i,s)&&Er(i[s])?ve(f.base?Nt(f.base):{},i[s],f.transform):c};function td(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vh();const i=O=>td(O);if(i.version="3.4.12",i.removed=[],!a||!a.document||a.document.nodeType!==Zt.document||!a.Element)return i.isSupported=!1,i;let s=a.document;const c=s,f=c.currentScript;a.DocumentFragment;const h=a.HTMLTemplateElement,w=a.Node,v=a.Element,R=a.NodeFilter,k=a.NamedNodeMap;k===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const A=a.DOMParser,M=a.trustedTypes,N=v.prototype,re=Pn(N,"cloneNode"),Y=Pn(N,"remove"),J=Pn(N,"nextSibling"),oe=Pn(N,"childNodes"),Q=Pn(N,"parentNode"),W=Pn(N,"shadowRoot"),q=Pn(N,"attributes"),le=w&&w.prototype?Pn(w.prototype,"nodeType"):null,he=w&&w.prototype?Pn(w.prototype,"nodeName"):null;if(typeof h=="function"){const O=s.createElement("template");O.content&&O.content.ownerDocument&&(s=O.content.ownerDocument)}let de,Ee="",Ge,mt=!1,be=0;const Jt=function(){if(be>0)throw Br('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Be=function(d){Jt(),be++;try{return de.createHTML(d)}finally{be--}},et=function(d){Jt(),be++;try{return de.createScriptURL(d)}finally{be--}},ut=function(){return mt||(Ge=Qh(M,f),mt=!0),Ge},Ue=s,Ke=Ue.implementation,Ne=Ue.createNodeIterator,F=Ue.createDocumentFragment,$=Ue.getElementsByTagName,U=c.importNode;let y=jf();i.isSupported=typeof $f=="function"&&typeof Q=="function"&&Ke&&Ke.createHTMLDocument!==void 0;const L=Ph,ae=jh,ue=Oh,me=Dh,ge=Mh,xe=Fh,ye=bh,Se=Uh;let tt=If,Te=null;const $n=ve({},[...Rf,...xa,...wa,...ka,...Af]);let Ae=null;const er=ve({},[...Nf,...Sa,...Lf,...Co]);let fe=Object.seal(kl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,On=null;const It=Object.seal(kl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Dn=!0,Ht=!0,zt=!1,Pt=!0,ct=!1,Ct=!0,Vt=!1,En=!1,Mn=null,un=null,Tn=!1,jt=!1,Qt=!1,tr=!1,Fn=!0,Tr=!1;const cn="user-content-";let fn=!0,bn=!1,gt={},qe=null;const Bn=ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let dn=null;const pn=ve({},["audio","video","img","source","image","track"]);let Cn=null;const nr=ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_n="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Gt=yt,C=!1,b=null;const ce=ve({},[_n,Rn,yt],va),Le=pt(["mi","mo","mn","ms","mtext"]);let Ot=ve({},Le);const hn=pt(["annotation-xml"]);let en=ve({},hn);const Vr=ve({},["title","style","font","a","script"]);let Un=null;const Po=["application/xhtml+xml","text/html"],jo="text/html";let Pe=null,Dt=null;const vi=s.createElement("form"),Sl=function(d){return d instanceof RegExp||d instanceof Function},El=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===d)return;(!d||typeof d!="object")&&(d={}),d=Nt(d),Un=Po.indexOf(d.PARSER_MEDIA_TYPE)===-1?jo:d.PARSER_MEDIA_TYPE,Pe=Un==="application/xhtml+xml"?va:hi,Te=Sr(d,"ALLOWED_TAGS",$n,{transform:Pe}),Ae=Sr(d,"ALLOWED_ATTR",er,{transform:Pe}),b=Sr(d,"ALLOWED_NAMESPACES",ce,{transform:va}),Cn=Sr(d,"ADD_URI_SAFE_ATTR",nr,{transform:Pe,base:nr}),dn=Sr(d,"ADD_DATA_URI_TAGS",pn,{transform:Pe,base:pn}),qe=Sr(d,"FORBID_CONTENTS",Bn,{transform:Pe}),$t=Sr(d,"FORBID_TAGS",Nt({}),{transform:Pe}),On=Sr(d,"FORBID_ATTR",Nt({}),{transform:Pe}),gt=at(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?Nt(d.USE_PROFILES):d.USE_PROFILES:!1,Dn=d.ALLOW_ARIA_ATTR!==!1,Ht=d.ALLOW_DATA_ATTR!==!1,zt=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ct=d.SAFE_FOR_TEMPLATES||!1,Ct=d.SAFE_FOR_XML!==!1,Vt=d.WHOLE_DOCUMENT||!1,jt=d.RETURN_DOM||!1,Qt=d.RETURN_DOM_FRAGMENT||!1,tr=d.RETURN_TRUSTED_TYPE||!1,Tn=d.FORCE_BODY||!1,Fn=d.SANITIZE_DOM!==!1,Tr=d.SANITIZE_NAMED_PROPS||!1,fn=d.KEEP_CONTENT!==!1,bn=d.IN_PLACE||!1,tt=Lh(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:If,Gt=typeof d.NAMESPACE=="string"?d.NAMESPACE:yt,Ot=at(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nt(d.MATHML_TEXT_INTEGRATION_POINTS):ve({},Le),en=at(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?Nt(d.HTML_INTEGRATION_POINTS):ve({},hn);const T=at(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?Nt(d.CUSTOM_ELEMENT_HANDLING):kl(null);if(fe=kl(null),at(T,"tagNameCheck")&&Sl(T.tagNameCheck)&&(fe.tagNameCheck=T.tagNameCheck),at(T,"attributeNameCheck")&&Sl(T.attributeNameCheck)&&(fe.attributeNameCheck=T.attributeNameCheck),at(T,"allowCustomizedBuiltInElements")&&typeof T.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=T.allowCustomizedBuiltInElements),ht(fe),ct&&(Ht=!1),Qt&&(jt=!0),gt&&(Te=ve({},Af),Ae=kl(null),gt.html===!0&&(ve(Te,Rf),ve(Ae,Nf)),gt.svg===!0&&(ve(Te,xa),ve(Ae,Sa),ve(Ae,Co)),gt.svgFilters===!0&&(ve(Te,wa),ve(Ae,Sa),ve(Ae,Co)),gt.mathMl===!0&&(ve(Te,ka),ve(Ae,Lf),ve(Ae,Co))),It.tagCheck=null,It.attributeCheck=null,at(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?It.tagCheck=d.ADD_TAGS:Er(d.ADD_TAGS)&&(Te===$n&&(Te=Nt(Te)),ve(Te,d.ADD_TAGS,Pe))),at(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?It.attributeCheck=d.ADD_ATTR:Er(d.ADD_ATTR)&&(Ae===er&&(Ae=Nt(Ae)),ve(Ae,d.ADD_ATTR,Pe))),at(d,"ADD_URI_SAFE_ATTR")&&Er(d.ADD_URI_SAFE_ATTR)&&ve(Cn,d.ADD_URI_SAFE_ATTR,Pe),at(d,"FORBID_CONTENTS")&&Er(d.FORBID_CONTENTS)&&(qe===Bn&&(qe=Nt(qe)),ve(qe,d.FORBID_CONTENTS,Pe)),at(d,"ADD_FORBID_CONTENTS")&&Er(d.ADD_FORBID_CONTENTS)&&(qe===Bn&&(qe=Nt(qe)),ve(qe,d.ADD_FORBID_CONTENTS,Pe)),fn&&(Te["#text"]=!0),Vt&&ve(Te,["html","head","body"]),Te.table&&(ve(Te,["tbody"]),delete $t.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const I=de;de=d.TRUSTED_TYPES_POLICY;try{Ee=Be("")}catch(H){throw de=I,H}}else d.TRUSTED_TYPES_POLICY===null?(de=void 0,Ee=""):(de===void 0&&(de=ut()),de&&typeof Ee=="string"&&(Ee=Be("")));pt&&pt(d),Dt=d},Tl=ve({},[...xa,...wa,...Ih]),Cl=ve({},[...ka,...zh]),xi=function(d,T,I){return T.namespaceURI===yt?d==="svg":T.namespaceURI===_n?d==="svg"&&(I==="annotation-xml"||Ot[I]):!!Tl[d]},wi=function(d,T,I){return T.namespaceURI===yt?d==="math":T.namespaceURI===Rn?d==="math"&&en[I]:!!Cl[d]},Oo=function(d,T,I){return T.namespaceURI===Rn&&!en[I]||T.namespaceURI===_n&&!Ot[I]?!1:!Cl[d]&&(Vr[d]||!Tl[d])},Do=function(d){let T=Q(d);(!T||!T.tagName)&&(T={namespaceURI:Gt,tagName:"template"});const I=hi(d.tagName),H=hi(T.tagName);return b[d.namespaceURI]?d.namespaceURI===Rn?xi(I,T,H):d.namespaceURI===_n?wi(I,T,H):d.namespaceURI===yt?Oo(I,T,H):!!(Un==="application/xhtml+xml"&&b[d.namespaceURI]):!1},Ce=function(d){vl(i.removed,{element:d});try{Q(d).removeChild(d)}catch{if(Y(d),!Q(d))throw Br("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qr=function(d){rr(d);const T=oe(d);if(T){const H=[];yl(T,ee=>{vl(H,ee)}),yl(H,ee=>{try{Y(ee)}catch{}})}const I=q(d);if(I)for(let H=I.length-1;H>=0;--H){const ee=I[H],ie=ee&&ee.name;if(typeof ie=="string")try{d.removeAttribute(ie)}catch{}}},mn=function(d,T){try{vl(i.removed,{attribute:T.getAttributeNode(d),from:T})}catch{vl(i.removed,{attribute:null,from:T})}if(T.removeAttribute(d),d==="is")if(jt||Qt)try{Ce(T)}catch{}else try{T.setAttribute(d,"")}catch{}},ki=function(d){const T=q(d);if(T)for(let I=T.length-1;I>=0;--I){const H=T[I],ee=H&&H.name;if(!(typeof ee!="string"||Ae[Pe(ee)]))try{d.removeAttribute(ee)}catch{}}},rr=function(d){const T=[d];for(;T.length>0;){const I=T.pop();(le?le(I):I.nodeType)===Zt.element&&ki(I);const ee=oe(I);if(ee)for(let ie=ee.length-1;ie>=0;--ie)T.push(ee[ie])}},Mo=function(d){if(!Ct)return;const T=[d];for(;T.length>0;){const I=T.pop(),H=le?le(I):I.nodeType;if(H===Zt.processingInstruction||H===Zt.comment&&st(Pf,I.data)){try{Y(I)}catch{}continue}if(H===Zt.element){const ie=I,je=Pe(he?he(I):I.nodeName);try{ie.hasAttribute&&ie.hasAttribute("patchsrc")&&ie.removeAttribute("patchsrc"),ie.hasAttribute&&ie.hasAttribute("for")&&je!=="label"&&je!=="output"&&ie.removeAttribute("for")}catch{}}const ee=oe(I);if(ee)for(let ie=ee.length-1;ie>=0;--ie)T.push(ee[ie])}},_l=function(d){let T=null,I=null;if(Tn)d=""+d;else{const ie=Ef(d,/^[\r\n\t ]+/);I=ie&&ie[0]}Un==="application/xhtml+xml"&&Gt===yt&&(d=''+d+"");const H=de?Be(d):d;if(Gt===yt)try{T=new A().parseFromString(H,Un)}catch{}if(!T||!T.documentElement){T=Ke.createDocument(Gt,"template",null);try{T.documentElement.innerHTML=C?Ee:H}catch{}}const ee=T.body||T.documentElement;return d&&I&&ee.insertBefore(s.createTextNode(I),ee.childNodes[0]||null),Gt===yt?$.call(T,Vt?"html":"body")[0]:Vt?T.documentElement:ee},Cr=function(d){return Ne.call(d.ownerDocument||d,d,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},_t=function(d){return d=ui(d,L," "),d=ui(d,ae," "),d=ui(d,ue," "),d},Rl=function(d){var T;d.normalize();const I=Ne.call(d.ownerDocument||d,d,R.SHOW_TEXT|R.SHOW_COMMENT|R.SHOW_CDATA_SECTION|R.SHOW_PROCESSING_INSTRUCTION,null);let H=I.nextNode();for(;H;)H.data=_t(H.data),H=I.nextNode();const ee=(T=d.querySelectorAll)===null||T===void 0?void 0:T.call(d,"template");ee&&yl(ee,ie=>{lr(ie.content)&&Rl(ie.content)})},vt=function(d){const T=he?he(d):null;return typeof T!="string"||Pe(T)!=="form"?!1:typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||d.attributes!==q(d)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function"||d.nodeType!==le(d)||d.childNodes!==oe(d)},lr=function(d){if(!le||typeof d!="object"||d===null)return!1;try{return le(d)===Zt.documentFragment}catch{return!1}},_r=function(d){if(!le||typeof d!="object"||d===null)return!1;try{return typeof le(d)=="number"}catch{return!1}};function tn(O,d,T){O.length!==0&&yl(O,I=>{I.call(i,d,T,Dt)})}const Gr=function(d,T){return!!(Ct&&d.hasChildNodes()&&!_r(d.firstElementChild)&&st(zf,d.textContent)&&st(zf,d.innerHTML)||Ct&&d.namespaceURI===yt&&T==="style"&&_r(d.firstElementChild)||d.nodeType===Zt.processingInstruction||Ct&&d.nodeType===Zt.comment&&st(Pf,d.data))},Yr=function(d,T){if(!$t[T]&&Si(T)&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,T)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(T)))return!1;if(fn&&!qe[T]){const I=Q(d),H=oe(d);if(H&&I){const ee=H.length;for(let ie=ee-1;ie>=0;--ie){const je=bn?H[ie]:re(H[ie],!0);I.insertBefore(je,J(d))}}}return Ce(d),!0},ir=function(d,T){if(tn(y.beforeSanitizeElements,d,null),d!==T&&Q(d)===null)return!0;if(vt(d))return Ce(d),!0;const I=Pe(he?he(d):d.nodeName);if(tn(y.uponSanitizeElement,d,{tagName:I,allowedTags:Te}),d!==T&&Q(d)===null)return!0;if(Gr(d,I))return Ce(d),!0;if($t[I]||!(It.tagCheck instanceof Function&&It.tagCheck(I))&&!Te[I]){const ee=Yr(d,I);return ee===!1&&tn(y.afterSanitizeElements,d,null),ee}if((le?le(d):d.nodeType)===Zt.element&&!Do(d)||(I==="noscript"||I==="noembed"||I==="noframes")&&st(Wh,d.innerHTML))return Ce(d),!0;if(ct&&d.nodeType===Zt.text){const ee=_t(d.textContent);d.textContent!==ee&&(vl(i.removed,{element:d.cloneNode()}),d.textContent=ee)}return tn(y.afterSanitizeElements,d,null),!1},Rr=function(d,T,I){if(On[T]||Ct&&T==="patchsrc"||Ct&&T==="for"&&d!=="label"&&d!=="output"||Fn&&(T==="id"||T==="name")&&(I in s||I in vi))return!1;const H=Ae[T]||It.attributeCheck instanceof Function&&It.attributeCheck(T,d);if(!(Ht&&st(me,T))){if(!(Dn&&st(ge,T))){if(H){if(!Cn[T]){if(!st(tt,ui(I,ye,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&d!=="script"&&Tf(I,"data:")===0&&dn[d])){if(!(zt&&!st(xe,ui(I,ye,"")))){if(I)return!1}}}}}else if(!(Si(d)&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,d)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(d))&&(fe.attributeNameCheck instanceof RegExp&&st(fe.attributeNameCheck,T)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(T,d))||T==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,I)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(I))))return!1}}return!0},Fo=ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Si=function(d){return!Fo[hi(d)]&&st(Se,d)},Al=function(d,T,I,H){if(de&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!I)switch(M.getAttributeType(d,T)){case"TrustedHTML":return Be(H);case"TrustedScriptURL":return et(H)}return H},Ei=function(d,T,I,H){try{I?d.setAttributeNS(I,T,H):d.setAttribute(T,H),vt(d)?Ce(d):Sf(i.removed)}catch{mn(T,d)}},Kr=function(d){tn(y.beforeSanitizeAttributes,d,null);const T=d.attributes;if(!T||vt(d))return;const I={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let H=T.length;const ee=Pe(d.nodeName);for(;H--;){const ie=T[H],je=ie.name,Xe=ie.namespaceURI,xt=ie.value,We=Pe(je),Ze=xt;let Me=je==="value"?Ze:Th(Ze);if(I.attrName=We,I.attrValue=Me,I.keepAttr=!0,I.forceKeepAttr=void 0,tn(y.uponSanitizeAttribute,d,I),Me=I.attrValue,Tr&&(We==="id"||We==="name")&&Tf(Me,cn)!==0&&(mn(je,d),Me=cn+Me),Ct&&st(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){mn(je,d);continue}if(We==="attributename"&&Ef(Me,"href")){mn(je,d);continue}if(!I.forceKeepAttr){if(!I.keepAttr){mn(je,d);continue}if(!Pt&&st(Hh,Me)){mn(je,d);continue}if(ct&&(Me=_t(Me)),!Rr(ee,We,Me)){mn(je,d);continue}Me=Al(ee,We,Xe,Me),Me!==Ze&&Ei(d,je,Xe,Me)}}tn(y.afterSanitizeAttributes,d,null)},An=function(d){let T=null;const I=Cr(d);for(tn(y.beforeSanitizeShadowDOM,d,null);T=I.nextNode();)if(tn(y.uponSanitizeShadowNode,T,null),ir(T,d),Kr(T),lr(T.content)&&An(T.content),(le?le(T):T.nodeType)===Zt.element){const ee=W(T);lr(ee)&&(Nl(ee),An(ee))}tn(y.afterSanitizeShadowDOM,d,null)},Nl=function(d){const T=[{node:d,shadow:null}];for(;T.length>0;){const I=T.pop();if(I.shadow){An(I.shadow);continue}const H=I.node,ie=(le?le(H):H.nodeType)===Zt.element,je=oe(H);if(je)for(let Xe=je.length-1;Xe>=0;--Xe)T.push({node:je[Xe],shadow:null});if(ie){const Xe=he?he(H):null;if(typeof Xe=="string"&&Pe(Xe)==="template"){const xt=H.content;lr(xt)&&T.push({node:xt,shadow:null})}}if(ie){const Xe=W(H);lr(Xe)&&T.push({node:null,shadow:Xe},{node:Xe,shadow:null})}}};return i.sanitize=function(O){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,I=null,H=null,ee=null;if(C=!O,C&&(O="\x3C!-->"),typeof O!="string"&&!_r(O)&&(O=Nh(O),typeof O!="string"))throw Br("dirty is not a string, aborting");if(!i.isSupported)return O;En?(Te=Mn,Ae=un):El(d),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(Te=Nt(Te)),y.uponSanitizeAttribute.length>0&&(Ae=Nt(Ae)),i.removed=[];const ie=bn&&typeof O!="string"&&_r(O);if(ie){Mo(O);const We=he?he(O):O.nodeName;if(typeof We=="string"){const Ze=Pe(We);if(!Te[Ze]||$t[Ze])throw Qr(O),Br("root node is forbidden and cannot be sanitized in-place")}if(vt(O))throw Qr(O),Br("root node is clobbered and cannot be sanitized in-place");try{Nl(O)}catch(Ze){throw Qr(O),Ze}}else if(_r(O))T=_l("\x3C!---->"),I=T.ownerDocument.importNode(O,!0),I.nodeType===Zt.element&&I.nodeName==="BODY"||I.nodeName==="HTML"?T=I:T.appendChild(I),Nl(I);else{if(!jt&&!ct&&!Vt&&O.indexOf("<")===-1)return de&&tr?Be(O):O;if(T=_l(O),!T)return jt?null:tr?Ee:""}T&&Tn&&Ce(T.firstChild);const je=ie?O:T,Xe=Cr(je);try{for(;H=Xe.nextNode();)ir(H,je),Kr(H),lr(H.content)&&An(H.content)}catch(We){throw ie&&(Qr(O),yl(i.removed,Ze=>{Ze.element&&rr(Ze.element)})),We}if(ie)return yl(i.removed,We=>{We.element&&rr(We.element)}),ct&&Rl(O),O;if(jt){if(ct&&Rl(T),Qt)for(ee=F.call(T.ownerDocument);T.firstChild;)ee.appendChild(T.firstChild);else ee=T;return(Ae.shadowroot||Ae.shadowrootmode)&&(ee=U.call(c,ee,!0)),ee}let xt=Vt?T.outerHTML:T.innerHTML;return Vt&&Te["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&st(Bh,T.ownerDocument.doctype.name)&&(xt=" -`+xt),ct&&(xt=_t(xt)),de&&tr?Be(xt):xt},i.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(O),En=!0,Mn=Te,un=Ae},i.clearConfig=function(){Dt=null,En=!1,Mn=null,un=null,de=Ge,Ee=""},i.isValidAttribute=function(O,d,T){Dt||El({});const I=Pe(O),H=Pe(d);return Rr(I,H,T)},i.addHook=function(O,d){typeof d=="function"&&at(y,O)&&vl(y[O],d)},i.removeHook=function(O,d){if(at(y,O)){if(d!==void 0){const T=Sh(y[O],d);return T===-1?void 0:Eh(y[O],T,1)[0]}return Sf(y[O])}},i.removeHooks=function(O){at(y,O)&&(y[O]=[])},i.removeAllHooks=function(){y=jf()},i}var Gh=td();function Fa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hr=Fa();function nd(a){Hr=a}var gi={exec:()=>null};function Re(a,i=""){let s=typeof a=="string"?a:a.source;const c={replace:(f,h)=>{let w=typeof h=="string"?h:h.source;return w=w.replace(Lt.caret,"$1"),s=s.replace(f,w),c},getRegex:()=>new RegExp(s,i)};return c}var Lt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}#`),htmlBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}<(?:[a-z].*>|!--)`,"i")},Yh=/^(?:[ \t]*(?:\n|$))+/,Kh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ba=/(?:[*+-]|\d{1,9}[.)])/,rd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ld=Re(rd).replace(/bull/g,ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zh=Re(rd).replace(/bull/g,ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ba=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jh=/^[^\n]+/,Ua=/(?!\s*\])(?:\\.|[^\[\]\\])+/,$h=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ua).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),em=Re(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ba).getRegex(),Io="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wa=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,tm=Re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wa).replace("tag",Io).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),id=Re(Ba).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex(),nm=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",id).getRegex(),Ha={blockquote:nm,code:Kh,def:$h,fences:qh,heading:Xh,hr:yi,html:tm,lheading:ld,list:em,newline:Yh,paragraph:id,table:gi,text:Jh},Of=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex(),rm={...Ha,lheading:Zh,table:Of,paragraph:Re(Ba).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Of).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex()},lm={...Ha,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wa).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(Ba).replace("hr",yi).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ld).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},im=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,om=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,od=/^( {2,}|\\)\n(?!\s*$)/,sm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,ud=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dm=Re(ud,"u").replace(/punct/g,zo).getRegex(),pm=Re(ud,"u").replace(/punct/g,ad).getRegex(),cd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",hm=Re(cd,"gu").replace(/notPunctSpace/g,sd).replace(/punctSpace/g,Va).replace(/punct/g,zo).getRegex(),mm=Re(cd,"gu").replace(/notPunctSpace/g,cm).replace(/punctSpace/g,um).replace(/punct/g,ad).getRegex(),gm=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sd).replace(/punctSpace/g,Va).replace(/punct/g,zo).getRegex(),ym=Re(/\\(punct)/,"gu").replace(/punct/g,zo).getRegex(),vm=Re(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xm=Re(Wa).replace("(?:-->|$)","-->").getRegex(),wm=Re("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",xm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ao=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,km=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ao).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fd=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Ao).replace("ref",Ua).getRegex(),dd=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ua).getRegex(),Sm=Re("reflink|nolink(?!\\()","g").replace("reflink",fd).replace("nolink",dd).getRegex(),Qa={_backpedal:gi,anyPunctuation:ym,autolink:vm,blockSkip:fm,br:od,code:om,del:gi,emStrongLDelim:dm,emStrongRDelimAst:hm,emStrongRDelimUnd:gm,escape:im,link:km,nolink:dd,punctuation:am,reflink:fd,reflinkSearch:Sm,tag:wm,text:sm,url:gi},Em={...Qa,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Ao).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ao).getRegex()},Ia={...Qa,emStrongRDelimAst:mm,emStrongLDelim:pm,url:Re(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Df=a=>Cm[a];function jn(a,i){if(i){if(Lt.escapeTest.test(a))return a.replace(Lt.escapeReplace,Df)}else if(Lt.escapeTestNoEncode.test(a))return a.replace(Lt.escapeReplaceNoEncode,Df);return a}function Mf(a){try{a=encodeURI(a).replace(Lt.percentDecode,"%")}catch{return null}return a}function Ff(a,i){var h;const s=a.replace(Lt.findPipe,(w,v,R)=>{let k=!1,A=v;for(;--A>=0&&R[A]==="\\";)k=!k;return k?"|":" |"}),c=s.split(Lt.splitPipe);let f=0;if(c[0].trim()||c.shift(),c.length>0&&!((h=c.at(-1))!=null&&h.trim())&&c.pop(),i)if(c.length>i)c.splice(i);else for(;c.length0?-2:-1}function bf(a,i,s,c,f){const h=i.href,w=i.title||null,v=a[1].replace(f.other.outputLinkReplace,"$1");c.state.inLink=!0;const R={type:a[0].charAt(0)==="!"?"image":"link",raw:s,href:h,title:w,text:v,tokens:c.inlineTokens(v)};return c.state.inLink=!1,R}function Rm(a,i,s){const c=a.match(s.other.indentCodeCompensation);if(c===null)return i;const f=c[1];return i.split(` +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function Ms(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Sp=typeof WeakMap=="function"?WeakMap:Map;function xc(e,t,n){n=Yn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){uo||(uo=!0,$s=r),Fs(e,t)},n}function wc(e,t,n){n=Yn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Fs(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Fs(e,t),typeof r!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),n}function kc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sp;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Dp.bind(null,e,t,n),t.then(e,e))}function Sc(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 Ec(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Yn(-1,1),t.tag=2,hr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Ep=le.ReactCurrentOwner,bt=!1;function Rt(e,t,n,r){t.child=e===null?Hu(t,null,n,r):al(t,e.child,n,r)}function Tc(e,t,n,r,l){n=n.render;var o=t.ref;return cl(t,l),r=Ns(e,t,n,r,o,l),n=Ls(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Kn(e,t,l)):(Fe&&n&&ds(t),t.flags|=1,Rt(e,t,r,l),t.child)}function Cc(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!oa(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,_c(e,t,o,r,l)):(e=go(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&l)===0){var u=o.memoizedProps;if(n=n.compare,n=n!==null?n:Bl,n(u,r)&&e.ref===t.ref)return Kn(e,t,l)}return t.flags|=1,e=wr(o,r),e.ref=t.ref,e.return=t,t.child=e}function _c(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(Bl(o,r)&&e.ref===t.ref)if(bt=!1,t.pendingProps=r=o,(e.lanes&l)!==0)(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,Kn(e,t,l)}return bs(e,t,n,r,l)}function Rc(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(hl,Xt),Xt|=n;else{if((n&1073741824)===0)return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(hl,Xt),Xt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ze(hl,Xt),Xt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ze(hl,Xt),Xt|=r;return Rt(e,t,l,n),t.child}function Ac(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function bs(e,t,n,r,l){var o=Ft(n)?Nr:wt.current;return o=ll(t,o),cl(t,l),n=Ns(e,t,n,r,o,l),r=Ls(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Kn(e,t,l)):(Fe&&r&&ds(t),t.flags|=1,Rt(e,t,n,l),t.child)}function Nc(e,t,n,r,l){if(Ft(n)){var o=!0;Bi(t)}else o=!1;if(cl(t,l),t.stateNode===null)lo(e,t),yc(t,n,r),Ds(t,n,r,l),r=!0;else if(e===null){var u=t.stateNode,m=t.memoizedProps;u.props=m;var g=u.context,_=n.contextType;typeof _=="object"&&_!==null?_=ln(_):(_=Ft(n)?Nr:wt.current,_=ll(t,_));var P=n.getDerivedStateFromProps,j=typeof P=="function"||typeof u.getSnapshotBeforeUpdate=="function";j||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==r||g!==_)&&vc(t,u,r,_),pr=!1;var z=t.memoizedState;u.state=z,qi(t,r,u,l),g=t.memoizedState,m!==r||z!==g||Mt.current||pr?(typeof P=="function"&&(Os(t,n,P,r),g=t.memoizedState),(m=pr||gc(t,n,m,r,z,g,_))?(j||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=g),u.props=r,u.state=g,u.context=_,r=m):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,Qu(e,t),m=t.memoizedProps,_=t.type===t.elementType?m:vn(t.type,m),u.props=_,j=t.pendingProps,z=u.context,g=n.contextType,typeof g=="object"&&g!==null?g=ln(g):(g=Ft(n)?Nr:wt.current,g=ll(t,g));var B=n.getDerivedStateFromProps;(P=typeof B=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m!==j||z!==g)&&vc(t,u,r,g),pr=!1,z=t.memoizedState,u.state=z,qi(t,r,u,l);var G=t.memoizedState;m!==j||z!==G||Mt.current||pr?(typeof B=="function"&&(Os(t,n,B,r),G=t.memoizedState),(_=pr||gc(t,n,_,r,z,G,g)||!1)?(P||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,G,g),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,G,g)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=G),u.props=r,u.state=G,u.context=g,r=_):(typeof u.componentDidUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),r=!1)}return Bs(e,t,n,r,o,l)}function Bs(e,t,n,r,l,o){Ac(e,t);var u=(t.flags&128)!==0;if(!r&&!u)return l&&ju(t,n,!1),Kn(e,t,o);r=t.stateNode,Ep.current=t;var m=u&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&u?(t.child=al(t,e.child,null,o),t.child=al(t,null,m,o)):Rt(e,t,m,o),t.memoizedState=r.state,l&&ju(t,n,!0),t.child}function Lc(e){var t=e.stateNode;t.pendingContext?zu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zu(e,t.context,!1),Es(e,t.containerInfo)}function Ic(e,t,n,r,l){return sl(),gs(l),t.flags|=256,Rt(e,t,n,r),t.child}var Us={dehydrated:null,treeContext:null,retryLane:0};function Ws(e){return{baseLanes:e,cachePool:null,transitions:null}}function zc(e,t,n){var r=t.pendingProps,l=He.current,o=!1,u=(t.flags&128)!==0,m;if((m=u)||(m=e!==null&&e.memoizedState===null?!1:(l&2)!==0),m?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),ze(He,l&1),e===null)return ms(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(u=r.children,e=r.fallback,o?(r=t.mode,o=t.child,u={mode:"hidden",children:u},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=u):o=yo(u,r,0,null),e=br(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ws(n),t.memoizedState=Us,e):Hs(t,u));if(l=e.memoizedState,l!==null&&(m=l.dehydrated,m!==null))return Tp(e,t,u,r,m,l,n);if(o){o=r.fallback,u=t.mode,l=e.child,m=l.sibling;var g={mode:"hidden",children:r.children};return(u&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=g,t.deletions=null):(r=wr(l,g),r.subtreeFlags=l.subtreeFlags&14680064),m!==null?o=wr(m,o):(o=br(o,u,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,u=e.child.memoizedState,u=u===null?Ws(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},o.memoizedState=u,o.childLanes=e.childLanes&~n,t.memoizedState=Us,r}return o=e.child,e=o.sibling,r=wr(o,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Hs(e,t){return t=yo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ro(e,t,n,r){return r!==null&&gs(r),al(t,e.child,null,n),e=Hs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tp(e,t,n,r,l,o,u){if(n)return t.flags&256?(t.flags&=-257,r=Ms(Error(s(422))),ro(e,t,u,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=yo({mode:"visible",children:r.children},l,0,null),o=br(o,l,u,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,(t.mode&1)!==0&&al(t,e.child,null,u),t.child.memoizedState=Ws(u),t.memoizedState=Us,o);if((t.mode&1)===0)return ro(e,t,u,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var m=r.dgst;return r=m,o=Error(s(419)),r=Ms(o,r,void 0),ro(e,t,u,r)}if(m=(u&e.childLanes)!==0,bt||m){if(r=it,r!==null){switch(u&-u){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|u))!==0?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,Gn(e,l),kn(r,e,l,-1))}return ia(),r=Ms(Error(s(421))),ro(e,t,u,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Mp.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,qt=ur(l.nextSibling),Kt=t,Fe=!0,yn=null,e!==null&&(nn[rn++]=Vn,nn[rn++]=Qn,nn[rn++]=Lr,Vn=e.id,Qn=e.overflow,Lr=t),t=Hs(t,r.children),t.flags|=4096,t)}function Pc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ws(e.return,t,n)}function Vs(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function jc(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(Rt(e,t,r.children,n),r=He.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pc(e,n,t);else if(e.tag===19)Pc(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}r&=1}if(ze(He,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Xi(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Vs(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Xi(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Vs(t,!0,n,null,o);break;case"together":Vs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Or|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=wr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cp(e,t,n){switch(t.tag){case 3:Lc(t),sl();break;case 5:Ku(t);break;case 1:Ft(t.type)&&Bi(t);break;case 4:Es(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;ze(Gi,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze(He,He.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?zc(e,t,n):(ze(He,He.current&1),e=Kn(e,t,n),e!==null?e.sibling:null);ze(He,He.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return jc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ze(He,He.current),r)break;return null;case 22:case 23:return t.lanes=0,Rc(e,t,n)}return Kn(e,t,n)}var Oc,Qs,Dc,Mc;Oc=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}},Qs=function(){},Dc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Pr(Ln.current);var o=null;switch(n){case"input":l=er(e,l),r=er(e,r),o=[];break;case"select":l=U({},l,{value:void 0}),r=U({},r,{value:void 0}),o=[];break;case"textarea":l=Pt(e,l),r=Pt(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Mi)}fn(n,r);var u;n=null;for(_ in l)if(!r.hasOwnProperty(_)&&l.hasOwnProperty(_)&&l[_]!=null)if(_==="style"){var m=l[_];for(u in m)m.hasOwnProperty(u)&&(n||(n={}),n[u]="")}else _!=="dangerouslySetInnerHTML"&&_!=="children"&&_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(f.hasOwnProperty(_)?o||(o=[]):(o=o||[]).push(_,null));for(_ in r){var g=r[_];if(m=l!=null?l[_]:void 0,r.hasOwnProperty(_)&&g!==m&&(g!=null||m!=null))if(_==="style")if(m){for(u in m)!m.hasOwnProperty(u)||g&&g.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in g)g.hasOwnProperty(u)&&m[u]!==g[u]&&(n||(n={}),n[u]=g[u])}else n||(o||(o=[]),o.push(_,n)),n=g;else _==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,m=m?m.__html:void 0,g!=null&&m!==g&&(o=o||[]).push(_,g)):_==="children"?typeof g!="string"&&typeof g!="number"||(o=o||[]).push(_,""+g):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&(f.hasOwnProperty(_)?(g!=null&&_==="onScroll"&&Oe("scroll",e),o||m===g||(o=[])):(o=o||[]).push(_,g))}n&&(o=o||[]).push("style",n);var _=o;(t.updateQueue=_)&&(t.flags|=4)}},Mc=function(e,t,n,r){n!==r&&(t.flags|=4)};function ti(e,t){if(!Fe)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _p(e,t,n){var r=t.pendingProps;switch(ps(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return Ft(t.type)&&bi(),St(t),null;case 3:return r=t.stateNode,fl(),De(Mt),De(wt),_s(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yn!==null&&(na(yn),yn=null))),Qs(e,t),St(t),null;case 5:Ts(t);var l=Pr(Xl.current);if(n=t.type,e!==null&&t.stateNode!=null)Dc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(s(166));return St(t),null}if(e=Pr(Ln.current),Vi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Nn]=t,r[Ql]=o,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),n==="select"&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Nn]=t,e[Ql]=r,Oc(e,t,!1,!1),t.stateNode=e;e:{switch(u=bn(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),l=r;break;case"iframe":case"object":case"embed":Oe("load",e),l=r;break;case"video":case"audio":for(l=0;lml&&(t.flags|=128,r=!0,ti(o,!1),t.lanes=4194304)}else{if(!r)if(e=Xi(u),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ti(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!Fe)return St(t),null}else 2*Ce()-o.renderingStartTime>ml&&n!==1073741824&&(t.flags|=128,r=!0,ti(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(n=o.last,n!==null?n.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=He.current,ze(He,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return la(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Xt&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Rp(e,t){switch(ps(t),t.tag){case 1:return Ft(t.type)&&bi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fl(),De(Mt),De(wt),_s(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ts(t),null;case 13:if(De(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(He),null;case 4:return fl(),null;case 10:return xs(t.type._context),null;case 22:case 23:return la(),null;case 24:return null;default:return null}}var io=!1,Et=!1,Ap=typeof WeakSet=="function"?WeakSet:Set,V=null;function pl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Qe(e,t,r)}else n.current=null}function Gs(e,t,n){try{n()}catch(r){Qe(e,t,r)}}var Fc=!1;function Np(e,t){if(ls=Ci,e=gu(),Xo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var u=0,m=-1,g=-1,_=0,P=0,j=e,z=null;t:for(;;){for(var B;j!==n||l!==0&&j.nodeType!==3||(m=u+l),j!==o||r!==0&&j.nodeType!==3||(g=u+r),j.nodeType===3&&(u+=j.nodeValue.length),(B=j.firstChild)!==null;)z=j,j=B;for(;;){if(j===e)break t;if(z===n&&++_===l&&(m=u),z===o&&++P===r&&(g=u),(B=j.nextSibling)!==null)break;j=z,z=j.parentNode}j=B}n=m===-1||g===-1?null:{start:m,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(is={focusedElem:e,selectionRange:n},Ci=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var G=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(G!==null){var K=G.memoizedProps,Ye=G.memoizedState,S=t.stateNode,x=S.getSnapshotBeforeUpdate(t.elementType===t.type?K:vn(t.type,K),Ye);S.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(D){Qe(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return G=Fc,Fc=!1,G}function ni(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Gs(t,n,o)}l=l.next}while(l!==r)}}function oo(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ys(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 bc(e){var t=e.alternate;t!==null&&(e.alternate=null,bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[Ql],delete t[us],delete t[fp],delete t[dp])),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 Bc(e){return e.tag===5||e.tag===3||e.tag===4}function Uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(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 Ks(e,t,n){var r=e.tag;if(r===5||r===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=Mi));else if(r!==4&&(e=e.child,e!==null))for(Ks(e,t,n),e=e.sibling;e!==null;)Ks(e,t,n),e=e.sibling}function qs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qs(e,t,n),e=e.sibling;e!==null;)qs(e,t,n),e=e.sibling}var ft=null,xn=!1;function mr(e,t,n){for(n=n.child;n!==null;)Wc(e,t,n),n=n.sibling}function Wc(e,t,n){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(Cr,n)}catch{}switch(n.tag){case 5:Et||pl(n,t);case 6:var r=ft,l=xn;ft=null,mr(e,t,n),ft=r,xn=l,ft!==null&&(xn?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(xn?(e=ft,n=n.stateNode,e.nodeType===8?as(e.parentNode,n):e.nodeType===1&&as(e,n),jl(e)):as(ft,n.stateNode));break;case 4:r=ft,l=xn,ft=n.stateNode.containerInfo,xn=!0,mr(e,t,n),ft=r,xn=l;break;case 0:case 11:case 14:case 15:if(!Et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,u=o.destroy;o=o.tag,u!==void 0&&((o&2)!==0||(o&4)!==0)&&Gs(n,t,u),l=l.next}while(l!==r)}mr(e,t,n);break;case 1:if(!Et&&(pl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(m){Qe(n,t,m)}mr(e,t,n);break;case 21:mr(e,t,n);break;case 22:n.mode&1?(Et=(r=Et)||n.memoizedState!==null,mr(e,t,n),Et=r):mr(e,t,n);break;default:mr(e,t,n)}}function Hc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ap),t.forEach(function(r){var l=Fp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function wn(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=u),r&=~o}if(r=l,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ip(r/1960))-r,10e?16:e,yr===null)var r=!1;else{if(e=yr,yr=null,fo=0,(we&6)!==0)throw Error(s(331));var l=we;for(we|=4,V=e.current;V!==null;){var o=V,u=o.child;if((V.flags&16)!==0){var m=o.deletions;if(m!==null){for(var g=0;gCe()-Js?Mr(e,0):Zs|=n),Ut(e,t)}function nf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Yr,Yr<<=1,(Yr&130023424)===0&&(Yr=4194304)));var n=At();e=Gn(e,t),e!==null&&(An(e,t,n),Ut(e,n))}function Mp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nf(e,n)}function Fp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),nf(e,n)}var rf;rf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)bt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return bt=!1,Cp(e,t,n);bt=(e.flags&131072)!==0}else bt=!1,Fe&&(t.flags&1048576)!==0&&Du(t,Hi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lo(e,t),e=t.pendingProps;var l=ll(t,wt.current);cl(t,n),l=Ns(null,t,r,e,l,n);var o=Ls();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(o=!0,Bi(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ss(t),l.updater=no,t.stateNode=l,l._reactInternals=t,Ds(t,r,e,n),t=Bs(null,t,r,!0,o,n)):(t.tag=0,Fe&&o&&ds(t),Rt(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lo(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Bp(r),e=vn(r,e),l){case 0:t=bs(null,t,r,e,n);break e;case 1:t=Nc(null,t,r,e,n);break e;case 11:t=Tc(null,t,r,e,n);break e;case 14:t=Cc(null,t,r,vn(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),bs(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),Nc(e,t,r,l,n);case 3:e:{if(Lc(t),e===null)throw Error(s(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Qu(e,t),qi(t,r,null,n);var u=t.memoizedState;if(r=u.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=dl(Error(s(423)),t),t=Ic(e,t,r,n,l);break e}else if(r!==l){l=dl(Error(s(424)),t),t=Ic(e,t,r,n,l);break e}else for(qt=ur(t.stateNode.containerInfo.firstChild),Kt=t,Fe=!0,yn=null,n=Hu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(sl(),r===l){t=Kn(e,t,n);break e}Rt(e,t,r,n)}t=t.child}return t;case 5:return Ku(t),e===null&&ms(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,u=l.children,os(r,l)?u=null:o!==null&&os(r,o)&&(t.flags|=32),Ac(e,t),Rt(e,t,u,n),t.child;case 6:return e===null&&ms(t),null;case 13:return zc(e,t,n);case 4:return Es(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=al(t,null,r,n):Rt(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),Tc(e,t,r,l,n);case 7:return Rt(e,t,t.pendingProps,n),t.child;case 8:return Rt(e,t,t.pendingProps.children,n),t.child;case 12:return Rt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,u=l.value,ze(Gi,r._currentValue),r._currentValue=u,o!==null)if(gn(o.value,u)){if(o.children===l.children&&!Mt.current){t=Kn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var m=o.dependencies;if(m!==null){u=o.child;for(var g=m.firstContext;g!==null;){if(g.context===r){if(o.tag===1){g=Yn(-1,n&-n),g.tag=2;var _=o.updateQueue;if(_!==null){_=_.shared;var P=_.pending;P===null?g.next=g:(g.next=P.next,P.next=g),_.pending=g}}o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),ws(o.return,n,t),m.lanes|=n;break}g=g.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(s(341));u.lanes|=n,m=u.alternate,m!==null&&(m.lanes|=n),ws(u,n,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}Rt(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,cl(t,n),l=ln(l),r=r(l),t.flags|=1,Rt(e,t,r,n),t.child;case 14:return r=t.type,l=vn(r,t.pendingProps),l=vn(r.type,l),Cc(e,t,r,l,n);case 15:return _c(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:vn(r,l),lo(e,t),t.tag=1,Ft(r)?(e=!0,Bi(t)):e=!1,cl(t,n),yc(t,r,l),Ds(t,r,l,n),Bs(null,t,r,!0,e,n);case 19:return jc(e,t,n);case 22:return Rc(e,t,n)}throw Error(s(156,t.tag))};function lf(e,t){return xi(e,t)}function bp(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,t,n,r){return new bp(e,t,n,r)}function oa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bp(e){if(typeof e=="function")return oa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Be)return 11;if(e===Ue)return 14}return 2}function wr(e,t){var n=e.alternate;return n===null?(n=an(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 go(e,t,n,r,l,o){var u=2;if(r=e,typeof e=="function")oa(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Ee:return br(n.children,l,o,t);case Ge:u=8,l|=8;break;case mt:return e=an(12,n,t,l|2),e.elementType=mt,e.lanes=o,e;case et:return e=an(13,n,t,l),e.elementType=et,e.lanes=o,e;case ut:return e=an(19,n,t,l),e.elementType=ut,e.lanes=o,e;case Ne:return yo(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case be:u=10;break e;case Jt:u=9;break e;case Be:u=11;break e;case Ue:u=14;break e;case Ke:u=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=an(u,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function br(e,t,n,r){return e=an(7,e,r,t),e.lanes=n,e}function yo(e,t,n,r){return e=an(22,e,r,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function sa(e,t,n){return e=an(6,e,null,t),e.lanes=n,e}function aa(e,t,n){return t=an(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Up(e,t,n,r,l){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=Kr(0),this.expirationTimes=Kr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kr(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ua(e,t,n,r,l,o,u,m,g){return e=new Up(e,t,n,m,g),t===1?(t=1,o===!0&&(t|=8)):t=0,o=an(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ss(o),e}function Wp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ma.exports=th(),ma.exports}var xf;function rh(){if(xf)return To;xf=1;var a=nh();return To.createRoot=a.createRoot,To.hydrateRoot=a.hydrateRoot,To}var lh=rh();const Zf=location.hash.slice(1)||window.prompt("访问令牌(serve 启动时打印)")||"";function Da(a){return new TextDecoder().decode(Uint8Array.from(atob(a),i=>i.charCodeAt(0)))}function mi(a){let i="";for(const s of new TextEncoder().encode(a))i+=String.fromCharCode(s);return btoa(i)}function ai(a){if(!a.data)return null;try{return JSON.parse(Da(a.data))}catch{return null}}async function Ma(a,i={}){const s=await fetch(a,{...i,headers:{Authorization:"Bearer "+Zf,"Content-Type":"application/json",...i.headers||{}}});if(!s.ok){let c="HTTP "+s.status;try{const f=await s.json();f!=null&&f.error&&(c=f.error)}catch{}throw new Error(c)}return s.json()}const ih=()=>Ma("/api/sessions"),oh=()=>Ma("/api/models"),sh=(a,i,s=!1)=>Ma("/api/sessions",{method:"POST",body:JSON.stringify({workdir:a,model:i,create_dir:s})});async function ah(){var i;const a=window.__TAURI__;if(!((i=a==null?void 0:a.core)!=null&&i.invoke))return null;try{const s=await a.core.invoke("plugin:dialog|open",{options:{directory:!0,multiple:!1,title:"选择工作区目录"}});return typeof s=="string"?s:null}catch{return null}}function Aa(){var a,i;return!!((i=(a=window.__TAURI__)==null?void 0:a.core)!=null&&i.invoke)}async function uh(){var i;const a=window.__TAURI__;return(i=a==null?void 0:a.core)!=null&&i.invoke?await a.core.invoke("get_config"):null}async function ch(a){var s;const i=window.__TAURI__;if(!((s=i==null?void 0:i.core)!=null&&s.invoke))throw new Error("浏览器模式下配置只读,请在桌面应用中修改");await i.core.invoke("save_config",{config:a})}function fh(a){var s;const i=window.__TAURI__;(s=i==null?void 0:i.core)!=null&&s.invoke?i.core.invoke("plugin:opener|open_url",{url:a}).catch(()=>{}):window.open(a,"_blank","noopener,noreferrer")}function dh(a,i){var h;const s=window.__TAURI__,c=(h=s==null?void 0:s.event)==null?void 0:h.listen;if(!c)return()=>{};const f=c(a,i);return()=>{f.then(w=>w()).catch(()=>{})}}const ph=15e3,hh=2e3;function Jf(a,i){let s=null,c=!1,f=[],h=!1,w=null;const v=new Map;function R(){h=!1;const M=f;f=[],M.length&&i.onFrames(M),f.length&&k()}function k(){h||(h=!0,requestAnimationFrame(R))}function A(){if(c)return;i.onStatus("连接中…",!1);const M=new WebSocket(`ws://${location.host}/ws?session=${a}&token=${Zf}`);s=M,M.onopen=()=>i.onStatus("已连接",!0),M.onclose=()=>{s!==M||c||(i.onStatus("⚠ 连接断开,2 秒后自动重连…",!1),w=setTimeout(A,hh))},M.onmessage=N=>{let re;try{re=JSON.parse(N.data)}catch{return}if(re.type==="call-response"&&re.kind){const Y=v.get(re.kind);if(Y){v.delete(re.kind),clearTimeout(Y.timer),Y.resolve(re.data?JSON.parse(Da(re.data)):{});return}}f.push(re),k()}}return A(),{send(M,N){return!s||s.readyState!==WebSocket.OPEN?(i.onStatus("⚠ 连接已断开,操作未发送;重连后请重试",!1),!1):(s.send(JSON.stringify({type:M,data:mi(JSON.stringify(N)),timestamp:Date.now()})),!0)},call(M,N={}){return new Promise((re,Y)=>{if(!s||s.readyState!==WebSocket.OPEN){Y(new Error("未连接"));return}const J=setTimeout(()=>{v.delete(M),Y(new Error("call 超时"))},ph);v.set(M,{resolve:re,timer:J}),s.send(JSON.stringify({type:"call",kind:M,data:mi(JSON.stringify(N)),timestamp:Date.now()}))})},close(){c=!0,w&&clearTimeout(w);for(const[,M]of v)clearTimeout(M.timer);v.clear(),s&&(s.onclose=null,s.close())}}}/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function wf(a,i){(i==null||i>a.length)&&(i=a.length);for(var s=0,c=Array(i);s2?c-2:0),h=2;h1?s-1:0),f=1;f"u"?null:$e(BigInt.prototype.toString),_f=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),at=$e(Object.prototype.hasOwnProperty),ci=$e(Object.prototype.toString),st=$e(RegExp.prototype.test),Br=Ah(TypeError);function $e(a){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var s=arguments.length,c=new Array(s>1?s-1:0),f=1;f2&&arguments[2]!==void 0?arguments[2]:hi;if(kf&&kf(a,null),!Er(i))return a;let c=i.length;for(;c--;){let f=i[c];if(typeof f=="string"){const h=s(f);h!==f&&(wh(i)||(i[c]=h),f=h)}a[f]=!0}return a}function Nh(a){for(let i=0;i/g),Dh=ht(/\${[\w\W]*/g),Mh=ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),Fh=ht(/^aria-[\-\w]+$/),If=ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bh=ht(/^(?:\w+script|data):/i),Bh=ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Uh=ht(/^html$/i),Wh=ht(/^[a-z][.\w]*(-[.\w]+)+$/i),zf=ht(/<[/\w!]/g),Pf=ht(/<[/\w]/g),Hh=ht(/<\/no(script|embed|frames)/i),Vh=ht(/\/>/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qh=function(){return typeof window>"u"?null:window},Gh=function(i,s){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";s&&s.hasAttribute(f)&&(c=s.getAttribute(f));const h="dompurify"+(c?"#"+c:"");try{return i.createPolicy(h,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},jf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sr=function(i,s,c,f){return at(i,s)&&Er(i[s])?ve(f.base?Nt(f.base):{},i[s],f.transform):c};function td(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qh();const i=O=>td(O);if(i.version="3.4.12",i.removed=[],!a||!a.document||a.document.nodeType!==Zt.document||!a.Element)return i.isSupported=!1,i;let s=a.document;const c=s,f=c.currentScript;a.DocumentFragment;const h=a.HTMLTemplateElement,w=a.Node,v=a.Element,R=a.NodeFilter,k=a.NamedNodeMap;k===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const A=a.DOMParser,M=a.trustedTypes,N=v.prototype,re=Pn(N,"cloneNode"),Y=Pn(N,"remove"),J=Pn(N,"nextSibling"),oe=Pn(N,"childNodes"),Q=Pn(N,"parentNode"),W=Pn(N,"shadowRoot"),q=Pn(N,"attributes"),le=w&&w.prototype?Pn(w.prototype,"nodeType"):null,he=w&&w.prototype?Pn(w.prototype,"nodeName"):null;if(typeof h=="function"){const O=s.createElement("template");O.content&&O.content.ownerDocument&&(s=O.content.ownerDocument)}let de,Ee="",Ge,mt=!1,be=0;const Jt=function(){if(be>0)throw Br('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Be=function(d){Jt(),be++;try{return de.createHTML(d)}finally{be--}},et=function(d){Jt(),be++;try{return de.createScriptURL(d)}finally{be--}},ut=function(){return mt||(Ge=Gh(M,f),mt=!0),Ge},Ue=s,Ke=Ue.implementation,Ne=Ue.createNodeIterator,F=Ue.createDocumentFragment,$=Ue.getElementsByTagName,U=c.importNode;let y=jf();i.isSupported=typeof $f=="function"&&typeof Q=="function"&&Ke&&Ke.createHTMLDocument!==void 0;const L=jh,ae=Oh,ue=Dh,me=Mh,ge=Fh,xe=bh,ye=Bh,Se=Wh;let tt=If,Te=null;const $n=ve({},[...Rf,...xa,...wa,...ka,...Af]);let Ae=null;const er=ve({},[...Nf,...Sa,...Lf,...Co]);let fe=Object.seal(kl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$t=null,On=null;const It=Object.seal(kl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Dn=!0,Ht=!0,zt=!1,Pt=!0,ct=!1,Ct=!0,Vt=!1,En=!1,Mn=null,un=null,Tn=!1,jt=!1,Qt=!1,tr=!1,Fn=!0,Tr=!1;const cn="user-content-";let fn=!0,bn=!1,gt={},qe=null;const Bn=ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let dn=null;const pn=ve({},["audio","video","img","source","image","track"]);let Cn=null;const nr=ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_n="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Gt=yt,C=!1,b=null;const ce=ve({},[_n,Rn,yt],va),Le=pt(["mi","mo","mn","ms","mtext"]);let Ot=ve({},Le);const hn=pt(["annotation-xml"]);let en=ve({},hn);const Vr=ve({},["title","style","font","a","script"]);let Un=null;const Po=["application/xhtml+xml","text/html"],jo="text/html";let Pe=null,Dt=null;const vi=s.createElement("form"),Sl=function(d){return d instanceof RegExp||d instanceof Function},El=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===d)return;(!d||typeof d!="object")&&(d={}),d=Nt(d),Un=Po.indexOf(d.PARSER_MEDIA_TYPE)===-1?jo:d.PARSER_MEDIA_TYPE,Pe=Un==="application/xhtml+xml"?va:hi,Te=Sr(d,"ALLOWED_TAGS",$n,{transform:Pe}),Ae=Sr(d,"ALLOWED_ATTR",er,{transform:Pe}),b=Sr(d,"ALLOWED_NAMESPACES",ce,{transform:va}),Cn=Sr(d,"ADD_URI_SAFE_ATTR",nr,{transform:Pe,base:nr}),dn=Sr(d,"ADD_DATA_URI_TAGS",pn,{transform:Pe,base:pn}),qe=Sr(d,"FORBID_CONTENTS",Bn,{transform:Pe}),$t=Sr(d,"FORBID_TAGS",Nt({}),{transform:Pe}),On=Sr(d,"FORBID_ATTR",Nt({}),{transform:Pe}),gt=at(d,"USE_PROFILES")?d.USE_PROFILES&&typeof d.USE_PROFILES=="object"?Nt(d.USE_PROFILES):d.USE_PROFILES:!1,Dn=d.ALLOW_ARIA_ATTR!==!1,Ht=d.ALLOW_DATA_ATTR!==!1,zt=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ct=d.SAFE_FOR_TEMPLATES||!1,Ct=d.SAFE_FOR_XML!==!1,Vt=d.WHOLE_DOCUMENT||!1,jt=d.RETURN_DOM||!1,Qt=d.RETURN_DOM_FRAGMENT||!1,tr=d.RETURN_TRUSTED_TYPE||!1,Tn=d.FORCE_BODY||!1,Fn=d.SANITIZE_DOM!==!1,Tr=d.SANITIZE_NAMED_PROPS||!1,fn=d.KEEP_CONTENT!==!1,bn=d.IN_PLACE||!1,tt=Ih(d.ALLOWED_URI_REGEXP)?d.ALLOWED_URI_REGEXP:If,Gt=typeof d.NAMESPACE=="string"?d.NAMESPACE:yt,Ot=at(d,"MATHML_TEXT_INTEGRATION_POINTS")&&d.MATHML_TEXT_INTEGRATION_POINTS&&typeof d.MATHML_TEXT_INTEGRATION_POINTS=="object"?Nt(d.MATHML_TEXT_INTEGRATION_POINTS):ve({},Le),en=at(d,"HTML_INTEGRATION_POINTS")&&d.HTML_INTEGRATION_POINTS&&typeof d.HTML_INTEGRATION_POINTS=="object"?Nt(d.HTML_INTEGRATION_POINTS):ve({},hn);const T=at(d,"CUSTOM_ELEMENT_HANDLING")&&d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING=="object"?Nt(d.CUSTOM_ELEMENT_HANDLING):kl(null);if(fe=kl(null),at(T,"tagNameCheck")&&Sl(T.tagNameCheck)&&(fe.tagNameCheck=T.tagNameCheck),at(T,"attributeNameCheck")&&Sl(T.attributeNameCheck)&&(fe.attributeNameCheck=T.attributeNameCheck),at(T,"allowCustomizedBuiltInElements")&&typeof T.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=T.allowCustomizedBuiltInElements),ht(fe),ct&&(Ht=!1),Qt&&(jt=!0),gt&&(Te=ve({},Af),Ae=kl(null),gt.html===!0&&(ve(Te,Rf),ve(Ae,Nf)),gt.svg===!0&&(ve(Te,xa),ve(Ae,Sa),ve(Ae,Co)),gt.svgFilters===!0&&(ve(Te,wa),ve(Ae,Sa),ve(Ae,Co)),gt.mathMl===!0&&(ve(Te,ka),ve(Ae,Lf),ve(Ae,Co))),It.tagCheck=null,It.attributeCheck=null,at(d,"ADD_TAGS")&&(typeof d.ADD_TAGS=="function"?It.tagCheck=d.ADD_TAGS:Er(d.ADD_TAGS)&&(Te===$n&&(Te=Nt(Te)),ve(Te,d.ADD_TAGS,Pe))),at(d,"ADD_ATTR")&&(typeof d.ADD_ATTR=="function"?It.attributeCheck=d.ADD_ATTR:Er(d.ADD_ATTR)&&(Ae===er&&(Ae=Nt(Ae)),ve(Ae,d.ADD_ATTR,Pe))),at(d,"ADD_URI_SAFE_ATTR")&&Er(d.ADD_URI_SAFE_ATTR)&&ve(Cn,d.ADD_URI_SAFE_ATTR,Pe),at(d,"FORBID_CONTENTS")&&Er(d.FORBID_CONTENTS)&&(qe===Bn&&(qe=Nt(qe)),ve(qe,d.FORBID_CONTENTS,Pe)),at(d,"ADD_FORBID_CONTENTS")&&Er(d.ADD_FORBID_CONTENTS)&&(qe===Bn&&(qe=Nt(qe)),ve(qe,d.ADD_FORBID_CONTENTS,Pe)),fn&&(Te["#text"]=!0),Vt&&ve(Te,["html","head","body"]),Te.table&&(ve(Te,["tbody"]),delete $t.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const I=de;de=d.TRUSTED_TYPES_POLICY;try{Ee=Be("")}catch(H){throw de=I,H}}else d.TRUSTED_TYPES_POLICY===null?(de=void 0,Ee=""):(de===void 0&&(de=ut()),de&&typeof Ee=="string"&&(Ee=Be("")));pt&&pt(d),Dt=d},Tl=ve({},[...xa,...wa,...zh]),Cl=ve({},[...ka,...Ph]),xi=function(d,T,I){return T.namespaceURI===yt?d==="svg":T.namespaceURI===_n?d==="svg"&&(I==="annotation-xml"||Ot[I]):!!Tl[d]},wi=function(d,T,I){return T.namespaceURI===yt?d==="math":T.namespaceURI===Rn?d==="math"&&en[I]:!!Cl[d]},Oo=function(d,T,I){return T.namespaceURI===Rn&&!en[I]||T.namespaceURI===_n&&!Ot[I]?!1:!Cl[d]&&(Vr[d]||!Tl[d])},Do=function(d){let T=Q(d);(!T||!T.tagName)&&(T={namespaceURI:Gt,tagName:"template"});const I=hi(d.tagName),H=hi(T.tagName);return b[d.namespaceURI]?d.namespaceURI===Rn?xi(I,T,H):d.namespaceURI===_n?wi(I,T,H):d.namespaceURI===yt?Oo(I,T,H):!!(Un==="application/xhtml+xml"&&b[d.namespaceURI]):!1},Ce=function(d){vl(i.removed,{element:d});try{Q(d).removeChild(d)}catch{if(Y(d),!Q(d))throw Br("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qr=function(d){rr(d);const T=oe(d);if(T){const H=[];yl(T,ee=>{vl(H,ee)}),yl(H,ee=>{try{Y(ee)}catch{}})}const I=q(d);if(I)for(let H=I.length-1;H>=0;--H){const ee=I[H],ie=ee&&ee.name;if(typeof ie=="string")try{d.removeAttribute(ie)}catch{}}},mn=function(d,T){try{vl(i.removed,{attribute:T.getAttributeNode(d),from:T})}catch{vl(i.removed,{attribute:null,from:T})}if(T.removeAttribute(d),d==="is")if(jt||Qt)try{Ce(T)}catch{}else try{T.setAttribute(d,"")}catch{}},ki=function(d){const T=q(d);if(T)for(let I=T.length-1;I>=0;--I){const H=T[I],ee=H&&H.name;if(!(typeof ee!="string"||Ae[Pe(ee)]))try{d.removeAttribute(ee)}catch{}}},rr=function(d){const T=[d];for(;T.length>0;){const I=T.pop();(le?le(I):I.nodeType)===Zt.element&&ki(I);const ee=oe(I);if(ee)for(let ie=ee.length-1;ie>=0;--ie)T.push(ee[ie])}},Mo=function(d){if(!Ct)return;const T=[d];for(;T.length>0;){const I=T.pop(),H=le?le(I):I.nodeType;if(H===Zt.processingInstruction||H===Zt.comment&&st(Pf,I.data)){try{Y(I)}catch{}continue}if(H===Zt.element){const ie=I,je=Pe(he?he(I):I.nodeName);try{ie.hasAttribute&&ie.hasAttribute("patchsrc")&&ie.removeAttribute("patchsrc"),ie.hasAttribute&&ie.hasAttribute("for")&&je!=="label"&&je!=="output"&&ie.removeAttribute("for")}catch{}}const ee=oe(I);if(ee)for(let ie=ee.length-1;ie>=0;--ie)T.push(ee[ie])}},_l=function(d){let T=null,I=null;if(Tn)d=""+d;else{const ie=Ef(d,/^[\r\n\t ]+/);I=ie&&ie[0]}Un==="application/xhtml+xml"&&Gt===yt&&(d=''+d+"");const H=de?Be(d):d;if(Gt===yt)try{T=new A().parseFromString(H,Un)}catch{}if(!T||!T.documentElement){T=Ke.createDocument(Gt,"template",null);try{T.documentElement.innerHTML=C?Ee:H}catch{}}const ee=T.body||T.documentElement;return d&&I&&ee.insertBefore(s.createTextNode(I),ee.childNodes[0]||null),Gt===yt?$.call(T,Vt?"html":"body")[0]:Vt?T.documentElement:ee},Cr=function(d){return Ne.call(d.ownerDocument||d,d,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},_t=function(d){return d=ui(d,L," "),d=ui(d,ae," "),d=ui(d,ue," "),d},Rl=function(d){var T;d.normalize();const I=Ne.call(d.ownerDocument||d,d,R.SHOW_TEXT|R.SHOW_COMMENT|R.SHOW_CDATA_SECTION|R.SHOW_PROCESSING_INSTRUCTION,null);let H=I.nextNode();for(;H;)H.data=_t(H.data),H=I.nextNode();const ee=(T=d.querySelectorAll)===null||T===void 0?void 0:T.call(d,"template");ee&&yl(ee,ie=>{lr(ie.content)&&Rl(ie.content)})},vt=function(d){const T=he?he(d):null;return typeof T!="string"||Pe(T)!=="form"?!1:typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||d.attributes!==q(d)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function"||d.nodeType!==le(d)||d.childNodes!==oe(d)},lr=function(d){if(!le||typeof d!="object"||d===null)return!1;try{return le(d)===Zt.documentFragment}catch{return!1}},_r=function(d){if(!le||typeof d!="object"||d===null)return!1;try{return typeof le(d)=="number"}catch{return!1}};function tn(O,d,T){O.length!==0&&yl(O,I=>{I.call(i,d,T,Dt)})}const Gr=function(d,T){return!!(Ct&&d.hasChildNodes()&&!_r(d.firstElementChild)&&st(zf,d.textContent)&&st(zf,d.innerHTML)||Ct&&d.namespaceURI===yt&&T==="style"&&_r(d.firstElementChild)||d.nodeType===Zt.processingInstruction||Ct&&d.nodeType===Zt.comment&&st(Pf,d.data))},Yr=function(d,T){if(!$t[T]&&Si(T)&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,T)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(T)))return!1;if(fn&&!qe[T]){const I=Q(d),H=oe(d);if(H&&I){const ee=H.length;for(let ie=ee-1;ie>=0;--ie){const je=bn?H[ie]:re(H[ie],!0);I.insertBefore(je,J(d))}}}return Ce(d),!0},ir=function(d,T){if(tn(y.beforeSanitizeElements,d,null),d!==T&&Q(d)===null)return!0;if(vt(d))return Ce(d),!0;const I=Pe(he?he(d):d.nodeName);if(tn(y.uponSanitizeElement,d,{tagName:I,allowedTags:Te}),d!==T&&Q(d)===null)return!0;if(Gr(d,I))return Ce(d),!0;if($t[I]||!(It.tagCheck instanceof Function&&It.tagCheck(I))&&!Te[I]){const ee=Yr(d,I);return ee===!1&&tn(y.afterSanitizeElements,d,null),ee}if((le?le(d):d.nodeType)===Zt.element&&!Do(d)||(I==="noscript"||I==="noembed"||I==="noframes")&&st(Hh,d.innerHTML))return Ce(d),!0;if(ct&&d.nodeType===Zt.text){const ee=_t(d.textContent);d.textContent!==ee&&(vl(i.removed,{element:d.cloneNode()}),d.textContent=ee)}return tn(y.afterSanitizeElements,d,null),!1},Rr=function(d,T,I){if(On[T]||Ct&&T==="patchsrc"||Ct&&T==="for"&&d!=="label"&&d!=="output"||Fn&&(T==="id"||T==="name")&&(I in s||I in vi))return!1;const H=Ae[T]||It.attributeCheck instanceof Function&&It.attributeCheck(T,d);if(!(Ht&&st(me,T))){if(!(Dn&&st(ge,T))){if(H){if(!Cn[T]){if(!st(tt,ui(I,ye,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&d!=="script"&&Tf(I,"data:")===0&&dn[d])){if(!(zt&&!st(xe,ui(I,ye,"")))){if(I)return!1}}}}}else if(!(Si(d)&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,d)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(d))&&(fe.attributeNameCheck instanceof RegExp&&st(fe.attributeNameCheck,T)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(T,d))||T==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&st(fe.tagNameCheck,I)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(I))))return!1}}return!0},Fo=ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Si=function(d){return!Fo[hi(d)]&&st(Se,d)},Al=function(d,T,I,H){if(de&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!I)switch(M.getAttributeType(d,T)){case"TrustedHTML":return Be(H);case"TrustedScriptURL":return et(H)}return H},Ei=function(d,T,I,H){try{I?d.setAttributeNS(I,T,H):d.setAttribute(T,H),vt(d)?Ce(d):Sf(i.removed)}catch{mn(T,d)}},Kr=function(d){tn(y.beforeSanitizeAttributes,d,null);const T=d.attributes;if(!T||vt(d))return;const I={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let H=T.length;const ee=Pe(d.nodeName);for(;H--;){const ie=T[H],je=ie.name,Xe=ie.namespaceURI,xt=ie.value,We=Pe(je),Ze=xt;let Me=je==="value"?Ze:Ch(Ze);if(I.attrName=We,I.attrValue=Me,I.keepAttr=!0,I.forceKeepAttr=void 0,tn(y.uponSanitizeAttribute,d,I),Me=I.attrValue,Tr&&(We==="id"||We==="name")&&Tf(Me,cn)!==0&&(mn(je,d),Me=cn+Me),Ct&&st(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Me)){mn(je,d);continue}if(We==="attributename"&&Ef(Me,"href")){mn(je,d);continue}if(!I.forceKeepAttr){if(!I.keepAttr){mn(je,d);continue}if(!Pt&&st(Vh,Me)){mn(je,d);continue}if(ct&&(Me=_t(Me)),!Rr(ee,We,Me)){mn(je,d);continue}Me=Al(ee,We,Xe,Me),Me!==Ze&&Ei(d,je,Xe,Me)}}tn(y.afterSanitizeAttributes,d,null)},An=function(d){let T=null;const I=Cr(d);for(tn(y.beforeSanitizeShadowDOM,d,null);T=I.nextNode();)if(tn(y.uponSanitizeShadowNode,T,null),ir(T,d),Kr(T),lr(T.content)&&An(T.content),(le?le(T):T.nodeType)===Zt.element){const ee=W(T);lr(ee)&&(Nl(ee),An(ee))}tn(y.afterSanitizeShadowDOM,d,null)},Nl=function(d){const T=[{node:d,shadow:null}];for(;T.length>0;){const I=T.pop();if(I.shadow){An(I.shadow);continue}const H=I.node,ie=(le?le(H):H.nodeType)===Zt.element,je=oe(H);if(je)for(let Xe=je.length-1;Xe>=0;--Xe)T.push({node:je[Xe],shadow:null});if(ie){const Xe=he?he(H):null;if(typeof Xe=="string"&&Pe(Xe)==="template"){const xt=H.content;lr(xt)&&T.push({node:xt,shadow:null})}}if(ie){const Xe=W(H);lr(Xe)&&T.push({node:null,shadow:Xe},{node:Xe,shadow:null})}}};return i.sanitize=function(O){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,I=null,H=null,ee=null;if(C=!O,C&&(O="\x3C!-->"),typeof O!="string"&&!_r(O)&&(O=Lh(O),typeof O!="string"))throw Br("dirty is not a string, aborting");if(!i.isSupported)return O;En?(Te=Mn,Ae=un):El(d),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(Te=Nt(Te)),y.uponSanitizeAttribute.length>0&&(Ae=Nt(Ae)),i.removed=[];const ie=bn&&typeof O!="string"&&_r(O);if(ie){Mo(O);const We=he?he(O):O.nodeName;if(typeof We=="string"){const Ze=Pe(We);if(!Te[Ze]||$t[Ze])throw Qr(O),Br("root node is forbidden and cannot be sanitized in-place")}if(vt(O))throw Qr(O),Br("root node is clobbered and cannot be sanitized in-place");try{Nl(O)}catch(Ze){throw Qr(O),Ze}}else if(_r(O))T=_l("\x3C!---->"),I=T.ownerDocument.importNode(O,!0),I.nodeType===Zt.element&&I.nodeName==="BODY"||I.nodeName==="HTML"?T=I:T.appendChild(I),Nl(I);else{if(!jt&&!ct&&!Vt&&O.indexOf("<")===-1)return de&&tr?Be(O):O;if(T=_l(O),!T)return jt?null:tr?Ee:""}T&&Tn&&Ce(T.firstChild);const je=ie?O:T,Xe=Cr(je);try{for(;H=Xe.nextNode();)ir(H,je),Kr(H),lr(H.content)&&An(H.content)}catch(We){throw ie&&(Qr(O),yl(i.removed,Ze=>{Ze.element&&rr(Ze.element)})),We}if(ie)return yl(i.removed,We=>{We.element&&rr(We.element)}),ct&&Rl(O),O;if(jt){if(ct&&Rl(T),Qt)for(ee=F.call(T.ownerDocument);T.firstChild;)ee.appendChild(T.firstChild);else ee=T;return(Ae.shadowroot||Ae.shadowrootmode)&&(ee=U.call(c,ee,!0)),ee}let xt=Vt?T.outerHTML:T.innerHTML;return Vt&&Te["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&st(Uh,T.ownerDocument.doctype.name)&&(xt=" +`+xt),ct&&(xt=_t(xt)),de&&tr?Be(xt):xt},i.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};El(O),En=!0,Mn=Te,un=Ae},i.clearConfig=function(){Dt=null,En=!1,Mn=null,un=null,de=Ge,Ee=""},i.isValidAttribute=function(O,d,T){Dt||El({});const I=Pe(O),H=Pe(d);return Rr(I,H,T)},i.addHook=function(O,d){typeof d=="function"&&at(y,O)&&vl(y[O],d)},i.removeHook=function(O,d){if(at(y,O)){if(d!==void 0){const T=Eh(y[O],d);return T===-1?void 0:Th(y[O],T,1)[0]}return Sf(y[O])}},i.removeHooks=function(O){at(y,O)&&(y[O]=[])},i.removeAllHooks=function(){y=jf()},i}var Yh=td();function Fa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hr=Fa();function nd(a){Hr=a}var gi={exec:()=>null};function Re(a,i=""){let s=typeof a=="string"?a:a.source;const c={replace:(f,h)=>{let w=typeof h=="string"?h:h.source;return w=w.replace(Lt.caret,"$1"),s=s.replace(f,w),c},getRegex:()=>new RegExp(s,i)};return c}var Lt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}#`),htmlBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}<(?:[a-z].*>|!--)`,"i")},Kh=/^(?:[ \t]*(?:\n|$))+/,qh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ba=/(?:[*+-]|\d{1,9}[.)])/,rd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ld=Re(rd).replace(/bull/g,ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jh=Re(rd).replace(/bull/g,ba).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ba=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$h=/^[^\n]+/,Ua=/(?!\s*\])(?:\\.|[^\[\]\\])+/,em=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ua).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tm=Re(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ba).getRegex(),Io="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wa=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,nm=Re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wa).replace("tag",Io).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),id=Re(Ba).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex(),rm=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",id).getRegex(),Ha={blockquote:rm,code:qh,def:em,fences:Xh,heading:Zh,hr:yi,html:nm,lheading:ld,list:tm,newline:Kh,paragraph:id,table:gi,text:$h},Of=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex(),lm={...Ha,lheading:Jh,table:Of,paragraph:Re(Ba).replace("hr",yi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Of).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Io).getRegex()},im={...Ha,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wa).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(Ba).replace("hr",yi).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ld).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},om=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,od=/^( {2,}|\\)\n(?!\s*$)/,am=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,ud=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,pm=Re(ud,"u").replace(/punct/g,zo).getRegex(),hm=Re(ud,"u").replace(/punct/g,ad).getRegex(),cd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mm=Re(cd,"gu").replace(/notPunctSpace/g,sd).replace(/punctSpace/g,Va).replace(/punct/g,zo).getRegex(),gm=Re(cd,"gu").replace(/notPunctSpace/g,fm).replace(/punctSpace/g,cm).replace(/punct/g,ad).getRegex(),ym=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sd).replace(/punctSpace/g,Va).replace(/punct/g,zo).getRegex(),vm=Re(/\\(punct)/,"gu").replace(/punct/g,zo).getRegex(),xm=Re(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wm=Re(Wa).replace("(?:-->|$)","-->").getRegex(),km=Re("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",wm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ao=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sm=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ao).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fd=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Ao).replace("ref",Ua).getRegex(),dd=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ua).getRegex(),Em=Re("reflink|nolink(?!\\()","g").replace("reflink",fd).replace("nolink",dd).getRegex(),Qa={_backpedal:gi,anyPunctuation:vm,autolink:xm,blockSkip:dm,br:od,code:sm,del:gi,emStrongLDelim:pm,emStrongRDelimAst:mm,emStrongRDelimUnd:ym,escape:om,link:Sm,nolink:dd,punctuation:um,reflink:fd,reflinkSearch:Em,tag:km,text:am,url:gi},Tm={...Qa,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Ao).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ao).getRegex()},Ia={...Qa,emStrongRDelimAst:gm,emStrongLDelim:hm,url:Re(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Df=a=>_m[a];function jn(a,i){if(i){if(Lt.escapeTest.test(a))return a.replace(Lt.escapeReplace,Df)}else if(Lt.escapeTestNoEncode.test(a))return a.replace(Lt.escapeReplaceNoEncode,Df);return a}function Mf(a){try{a=encodeURI(a).replace(Lt.percentDecode,"%")}catch{return null}return a}function Ff(a,i){var h;const s=a.replace(Lt.findPipe,(w,v,R)=>{let k=!1,A=v;for(;--A>=0&&R[A]==="\\";)k=!k;return k?"|":" |"}),c=s.split(Lt.splitPipe);let f=0;if(c[0].trim()||c.shift(),c.length>0&&!((h=c.at(-1))!=null&&h.trim())&&c.pop(),i)if(c.length>i)c.splice(i);else for(;c.length0?-2:-1}function bf(a,i,s,c,f){const h=i.href,w=i.title||null,v=a[1].replace(f.other.outputLinkReplace,"$1");c.state.inLink=!0;const R={type:a[0].charAt(0)==="!"?"image":"link",raw:s,href:h,title:w,text:v,tokens:c.inlineTokens(v)};return c.state.inLink=!1,R}function Am(a,i,s){const c=a.match(s.other.indentCodeCompensation);if(c===null)return i;const f=c[1];return i.split(` `).map(h=>{const w=h.match(s.other.beginningSpace);if(w===null)return h;const[v]=w;return v.length>=f.length?h.slice(f.length):h}).join(` `)}var No=class{constructor(a){Ie(this,"options");Ie(this,"rules");Ie(this,"lexer");this.options=a||Hr}space(a){const i=this.rules.block.newline.exec(a);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(a){const i=this.rules.block.code.exec(a);if(i){const s=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?s:di(s,` -`)}}}fences(a){const i=this.rules.block.fences.exec(a);if(i){const s=i[0],c=Rm(s,i[3]||"",this.rules);return{type:"code",raw:s,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:c}}}heading(a){const i=this.rules.block.heading.exec(a);if(i){let s=i[2].trim();if(this.rules.other.endingHash.test(s)){const c=di(s,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(s=c.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(a){const i=this.rules.block.hr.exec(a);if(i)return{type:"hr",raw:di(i[0],` +`)}}}fences(a){const i=this.rules.block.fences.exec(a);if(i){const s=i[0],c=Am(s,i[3]||"",this.rules);return{type:"code",raw:s,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:c}}}heading(a){const i=this.rules.block.heading.exec(a);if(i){let s=i[2].trim();if(this.rules.other.endingHash.test(s)){const c=di(s,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(s=c.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(a){const i=this.rules.block.hr.exec(a);if(i)return{type:"hr",raw:di(i[0],` `)}}blockquote(a){const i=this.rules.block.blockquote.exec(a);if(i){let s=di(i[0],` `).split(` `),c="",f="";const h=[];for(;s.length>0;){let w=!1;const v=[];let R;for(R=0;RM.type==="space"),A=k.length>0&&k.some(M=>this.rules.other.anyLine.test(M.raw));f.loose=A}if(f.loose)for(let R=0;R({text:R,tokens:this.lexer.inline(R),header:!1,align:h.align[k]})));return h}}lheading(a){const i=this.rules.block.lheading.exec(a);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(a){const i=this.rules.block.paragraph.exec(a);if(i){const s=i[1].charAt(i[1].length-1)===` -`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:s,tokens:this.lexer.inline(s)}}}text(a){const i=this.rules.block.text.exec(a);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(a){const i=this.rules.inline.escape.exec(a);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(a){const i=this.rules.inline.tag.exec(a);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(a){const i=this.rules.inline.link.exec(a);if(i){const s=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const h=di(s.slice(0,-1),"\\");if((s.length-h.length)%2===0)return}else{const h=_m(i[2],"()");if(h===-2)return;if(h>-1){const v=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,v).trim(),i[3]=""}}let c=i[2],f="";if(this.options.pedantic){const h=this.rules.other.pedanticHrefTitle.exec(c);h&&(c=h[1],f=h[3])}else f=i[3]?i[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?c=c.slice(1):c=c.slice(1,-1)),bf(i,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(a,i){let s;if((s=this.rules.inline.reflink.exec(a))||(s=this.rules.inline.nolink.exec(a))){const c=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=i[c.toLowerCase()];if(!f){const h=s[0].charAt(0);return{type:"text",raw:h,text:h}}return bf(s,f,s[0],this.lexer,this.rules)}}emStrong(a,i,s=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!c||c[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(c[1]||c[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const h=[...c[0]].length-1;let w,v,R=h,k=0;const A=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(A.lastIndex=0,i=i.slice(-1*a.length+h);(c=A.exec(i))!=null;){if(w=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!w)continue;if(v=[...w].length,c[3]||c[4]){R+=v;continue}else if((c[5]||c[6])&&h%3&&!((h+v)%3)){k+=v;continue}if(R-=v,R>0)continue;v=Math.min(v,v+R+k);const M=[...c[0]][0].length,N=a.slice(0,h+c.index+M+v);if(Math.min(h,v)%2){const Y=N.slice(1,-1);return{type:"em",raw:N,text:Y,tokens:this.lexer.inlineTokens(Y)}}const re=N.slice(2,-2);return{type:"strong",raw:N,text:re,tokens:this.lexer.inlineTokens(re)}}}}codespan(a){const i=this.rules.inline.code.exec(a);if(i){let s=i[2].replace(this.rules.other.newLineCharGlobal," ");const c=this.rules.other.nonSpaceChar.test(s),f=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return c&&f&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:i[0],text:s}}}br(a){const i=this.rules.inline.br.exec(a);if(i)return{type:"br",raw:i[0]}}del(a){const i=this.rules.inline.del.exec(a);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(a){const i=this.rules.inline.autolink.exec(a);if(i){let s,c;return i[2]==="@"?(s=i[1],c="mailto:"+s):(s=i[1],c=s),{type:"link",raw:i[0],text:s,href:c,tokens:[{type:"text",raw:s,text:s}]}}}url(a){var s;let i;if(i=this.rules.inline.url.exec(a)){let c,f;if(i[2]==="@")c=i[0],f="mailto:"+c;else{let h;do h=i[0],i[0]=((s=this.rules.inline._backpedal.exec(i[0]))==null?void 0:s[0])??"";while(h!==i[0]);c=i[0],i[1]==="www."?f="http://"+i[0]:f=i[0]}return{type:"link",raw:i[0],text:c,href:f,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(a){const i=this.rules.inline.text.exec(a);if(i){const s=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:s}}}},Zn=class za{constructor(i){Ie(this,"tokens");Ie(this,"options");Ie(this,"state");Ie(this,"tokenizer");Ie(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||Hr,this.options.tokenizer=this.options.tokenizer||new No,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:Lt,block:_o.normal,inline:fi.normal};this.options.pedantic?(s.block=_o.pedantic,s.inline=fi.pedantic):this.options.gfm&&(s.block=_o.gfm,this.options.breaks?s.inline=fi.breaks:s.inline=fi.gfm),this.tokenizer.rules=s}static get rules(){return{block:_o,inline:fi}}static lex(i,s){return new za(s).lex(i)}static lexInline(i,s){return new za(s).inlineTokens(i)}lex(i){i=i.replace(Lt.carriageReturn,` +`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:s,tokens:this.lexer.inline(s)}}}text(a){const i=this.rules.block.text.exec(a);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(a){const i=this.rules.inline.escape.exec(a);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(a){const i=this.rules.inline.tag.exec(a);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(a){const i=this.rules.inline.link.exec(a);if(i){const s=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const h=di(s.slice(0,-1),"\\");if((s.length-h.length)%2===0)return}else{const h=Rm(i[2],"()");if(h===-2)return;if(h>-1){const v=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,v).trim(),i[3]=""}}let c=i[2],f="";if(this.options.pedantic){const h=this.rules.other.pedanticHrefTitle.exec(c);h&&(c=h[1],f=h[3])}else f=i[3]?i[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?c=c.slice(1):c=c.slice(1,-1)),bf(i,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:f&&f.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(a,i){let s;if((s=this.rules.inline.reflink.exec(a))||(s=this.rules.inline.nolink.exec(a))){const c=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),f=i[c.toLowerCase()];if(!f){const h=s[0].charAt(0);return{type:"text",raw:h,text:h}}return bf(s,f,s[0],this.lexer,this.rules)}}emStrong(a,i,s=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!c||c[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(c[1]||c[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const h=[...c[0]].length-1;let w,v,R=h,k=0;const A=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(A.lastIndex=0,i=i.slice(-1*a.length+h);(c=A.exec(i))!=null;){if(w=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!w)continue;if(v=[...w].length,c[3]||c[4]){R+=v;continue}else if((c[5]||c[6])&&h%3&&!((h+v)%3)){k+=v;continue}if(R-=v,R>0)continue;v=Math.min(v,v+R+k);const M=[...c[0]][0].length,N=a.slice(0,h+c.index+M+v);if(Math.min(h,v)%2){const Y=N.slice(1,-1);return{type:"em",raw:N,text:Y,tokens:this.lexer.inlineTokens(Y)}}const re=N.slice(2,-2);return{type:"strong",raw:N,text:re,tokens:this.lexer.inlineTokens(re)}}}}codespan(a){const i=this.rules.inline.code.exec(a);if(i){let s=i[2].replace(this.rules.other.newLineCharGlobal," ");const c=this.rules.other.nonSpaceChar.test(s),f=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return c&&f&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:i[0],text:s}}}br(a){const i=this.rules.inline.br.exec(a);if(i)return{type:"br",raw:i[0]}}del(a){const i=this.rules.inline.del.exec(a);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(a){const i=this.rules.inline.autolink.exec(a);if(i){let s,c;return i[2]==="@"?(s=i[1],c="mailto:"+s):(s=i[1],c=s),{type:"link",raw:i[0],text:s,href:c,tokens:[{type:"text",raw:s,text:s}]}}}url(a){var s;let i;if(i=this.rules.inline.url.exec(a)){let c,f;if(i[2]==="@")c=i[0],f="mailto:"+c;else{let h;do h=i[0],i[0]=((s=this.rules.inline._backpedal.exec(i[0]))==null?void 0:s[0])??"";while(h!==i[0]);c=i[0],i[1]==="www."?f="http://"+i[0]:f=i[0]}return{type:"link",raw:i[0],text:c,href:f,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(a){const i=this.rules.inline.text.exec(a);if(i){const s=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:s}}}},Zn=class za{constructor(i){Ie(this,"tokens");Ie(this,"options");Ie(this,"state");Ie(this,"tokenizer");Ie(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=i||Hr,this.options.tokenizer=this.options.tokenizer||new No,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:Lt,block:_o.normal,inline:fi.normal};this.options.pedantic?(s.block=_o.pedantic,s.inline=fi.pedantic):this.options.gfm&&(s.block=_o.gfm,this.options.breaks?s.inline=fi.breaks:s.inline=fi.gfm),this.tokenizer.rules=s}static get rules(){return{block:_o,inline:fi}}static lex(i,s){return new za(s).lex(i)}static lexInline(i,s){return new za(s).inlineTokens(i)}lex(i){i=i.replace(Lt.carriageReturn,` `),this.blockTokens(i,this.tokens);for(let s=0;s(v=k.call({lexer:this},i,s))?(i=i.substring(v.raw.length),s.push(v),!0):!1))continue;if(v=this.tokenizer.space(i)){i=i.substring(v.raw.length);const k=s.at(-1);v.raw.length===1&&k!==void 0?k.raw+=` `:s.push(v);continue}if(v=this.tokenizer.code(i)){i=i.substring(v.raw.length);const k=s.at(-1);(k==null?void 0:k.type)==="paragraph"||(k==null?void 0:k.type)==="text"?(k.raw+=` `+v.raw,k.text+=` @@ -109,13 +109,13 @@ ${this.parser.parse(a)} ${a} `}tablecell(a){const i=this.parser.parseInline(a.tokens),s=a.header?"th":"td";return(a.align?`<${s} align="${a.align}">`:`<${s}>`)+i+` `}strong({tokens:a}){return`${this.parser.parseInline(a)}`}em({tokens:a}){return`${this.parser.parseInline(a)}`}codespan({text:a}){return`${jn(a,!0)}`}br(a){return"
"}del({tokens:a}){return`${this.parser.parseInline(a)}`}link({href:a,title:i,tokens:s}){const c=this.parser.parseInline(s),f=Mf(a);if(f===null)return c;a=f;let h='
",h}image({href:a,title:i,text:s,tokens:c}){c&&(s=this.parser.parseInline(c,this.parser.textRenderer));const f=Mf(a);if(f===null)return jn(s);a=f;let h=`${s}{const R=w[v].flat(1/0);s=s.concat(this.walkTokens(R,i))}):w.tokens&&(s=s.concat(this.walkTokens(w.tokens,i)))}}return s}use(...a){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(s=>{const c={...s};if(c.async=this.defaults.async||c.async||!1,s.extensions&&(s.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const h=i.renderers[f.name];h?i.renderers[f.name]=function(...w){let v=f.renderer.apply(this,w);return v===!1&&(v=h.apply(this,w)),v}:i.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const h=i[f.level];h?h.unshift(f.tokenizer):i[f.level]=[f.tokenizer],f.start&&(f.level==="block"?i.startBlock?i.startBlock.push(f.start):i.startBlock=[f.start]:f.level==="inline"&&(i.startInline?i.startInline.push(f.start):i.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(i.childTokens[f.name]=f.childTokens)}),c.extensions=i),s.renderer){const f=this.defaults.renderer||new Lo(this.defaults);for(const h in s.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;const w=h,v=s.renderer[w],R=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A||""}}c.renderer=f}if(s.tokenizer){const f=this.defaults.tokenizer||new No(this.defaults);for(const h in s.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;const w=h,v=s.tokenizer[w],R=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A}}c.tokenizer=f}if(s.hooks){const f=this.defaults.hooks||new Ro;for(const h in s.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;const w=h,v=s.hooks[w],R=f[w];Ro.passThroughHooks.has(h)?f[w]=k=>{if(this.defaults.async)return Promise.resolve(v.call(f,k)).then(M=>R.call(f,M));const A=v.call(f,k);return R.call(f,A)}:f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A}}c.hooks=f}if(s.walkTokens){const f=this.defaults.walkTokens,h=s.walkTokens;c.walkTokens=function(w){let v=[];return v.push(h.call(this,w)),f&&(v=v.concat(f.call(this,w))),v}}this.defaults={...this.defaults,...c}}),this}setOptions(a){return this.defaults={...this.defaults,...a},this}lexer(a,i){return Zn.lex(a,i??this.defaults)}parser(a,i){return Jn.parse(a,i??this.defaults)}parseMarkdown(a){return(s,c)=>{const f={...c},h={...this.defaults,...f},w=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&f.async===!1)return w(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return w(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return w(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));h.hooks&&(h.hooks.options=h,h.hooks.block=a);const v=h.hooks?h.hooks.provideLexer():a?Zn.lex:Zn.lexInline,R=h.hooks?h.hooks.provideParser():a?Jn.parse:Jn.parseInline;if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(s):s).then(k=>v(k,h)).then(k=>h.hooks?h.hooks.processAllTokens(k):k).then(k=>h.walkTokens?Promise.all(this.walkTokens(k,h.walkTokens)).then(()=>k):k).then(k=>R(k,h)).then(k=>h.hooks?h.hooks.postprocess(k):k).catch(w);try{h.hooks&&(s=h.hooks.preprocess(s));let k=v(s,h);h.hooks&&(k=h.hooks.processAllTokens(k)),h.walkTokens&&this.walkTokens(k,h.walkTokens);let A=R(k,h);return h.hooks&&(A=h.hooks.postprocess(A)),A}catch(k){return w(k)}}}onError(a,i){return s=>{if(s.message+=` -Please report this to https://github.com/markedjs/marked.`,a){const c="

An error occurred:

"+jn(s.message+"",!0)+"
";return i?Promise.resolve(c):c}if(i)return Promise.reject(s);throw s}}},Wr=new Am;function _e(a,i){return Wr.parse(a,i)}_e.options=_e.setOptions=function(a){return Wr.setOptions(a),_e.defaults=Wr.defaults,nd(_e.defaults),_e};_e.getDefaults=Fa;_e.defaults=Hr;_e.use=function(...a){return Wr.use(...a),_e.defaults=Wr.defaults,nd(_e.defaults),_e};_e.walkTokens=function(a,i){return Wr.walkTokens(a,i)};_e.parseInline=Wr.parseInline;_e.Parser=Jn;_e.parser=Jn.parse;_e.Renderer=Lo;_e.TextRenderer=Ga;_e.Lexer=Zn;_e.lexer=Zn.lex;_e.Tokenizer=No;_e.Hooks=Ro;_e.parse=_e;_e.options;_e.setOptions;_e.use;_e.walkTokens;_e.parseInline;Jn.parse;Zn.lex;const ja={items:[],running:!1,usage:null,streamKind:"",turnEnded:!1,model:""},Nm={approved:"已允许",denied:"已拒绝",timeout:"已超时(按拒绝处理)",cancelled:"已取消"};function Bf(a){switch(a){case"allowed":return"已允许";case"rejected":return"已拒绝";case"expired":return"(已过期)";default:return Nm[a]??a}}function Uf(a,i,s){const c=a.items.slice(),f=c[c.length-1];return a.streamKind===i&&f&&f.kind===i?c[c.length-1]={...f,text:f.text+s}:c.push({kind:i,text:s}),{...a,items:c,streamKind:i}}function Ur(a,i){return{...a,items:[...a.items,i],streamKind:""}}function Wf(a){return a.map(i=>i.kind==="perm"&&i.state==="open"?{...i,state:"expired"}:i)}function Lm(a,i,s){const c=a.items.slice();for(let f=c.length-1;f>=0;f--){const h=c[f];if(!(h.kind!=="tool"||h.tcId!==i)){switch(s.kind){case"subagent_tool":{const w=(h.subItems??[]).slice(),v=w.findIndex(k=>k.id===s.id),R={id:s.id??String(w.length),title:s.title??"",status:s.status??"run"};v>=0?w[v]={...R,title:R.title||w[v].title}:w.push(R),c[f]={...h,subItems:w};break}case"output":c[f]={...h,lastLine:s.line};break;case"child_session":c[f]={...h,childSessionId:s.childSessionId};break}return{...a,items:c}}}return a}function Im(a,i){var s,c;switch(i.sessionUpdate){case"agent_message_chunk":return Uf(a,"agent",((s=i.content)==null?void 0:s.text)??"");case"agent_thought_chunk":return Uf(a,"thought",((c=i.content)==null?void 0:c.text)??"");case"tool_call":return Ur(a,{kind:"tool",tcId:i.toolCallId??"",title:i.title||i.kind||"工具调用",status:"run",out:""});case"tool_call_update":{if(i.status==="in_progress")return i.progress?Lm(a,i.toolCallId??"",i.progress):a;const f=a.items.slice();for(let h=f.length-1;h>=0;h--){const w=f[h];if(w.kind==="tool"&&w.tcId===i.toolCallId){const v=typeof i.rawOutput=="string"?i.rawOutput.split(` -`)[0].slice(0,160):"";f[h]={...w,status:i.status==="completed"?"ok":"fail",out:v,lastLine:void 0};break}}return{...a,items:f}}case"plan":{const f=a.items.slice();for(let h=f.length-1;h>=0;h--)if(f[h].kind==="plan")return f[h]={kind:"plan",entries:i.entries??[]},{...a,items:f,streamKind:""};return Ur(a,{kind:"plan",entries:i.entries??[]})}case"llm_call_retry":return Ur(a,{kind:"sys",text:`模型调用重试 #${i.attempt??"?"}: ${i.message??""}`});case"usage_update":return{...a,usage:{used:i.used??0,size:i.size??0}};case"compact_status":return Ur(a,{kind:"sys",text:i.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const f=i.model??"";return{...Ur(a,{kind:"sys",text:`模型已切换为 ${f}`}),model:f}}default:return a}}function zm(a,i){switch(i.type){case"task-started":return{...a,running:!0};case"task-ended":return{...a,running:!1,streamKind:"",turnEnded:!0,items:[...Wf(a.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const s=ai(i);return{...a,running:!1,streamKind:"",items:[...Wf(a.items),{kind:"sys",text:"✗ "+((s==null?void 0:s.error)||"未知错误"),error:!0}]}}case"user-input":{const s=ai(i);let c="";try{c=s!=null&&s.content?Da(s.content):""}catch{c=(s==null?void 0:s.content)??""}return Ur(a,{kind:"user",text:c})}case"permission-req":{const s=ai(i);return s!=null&&s.id?Ur(a,{kind:"perm",id:s.id,title:s.title??"",tool:s.tool??"",state:"open"}):a}case"permission-resolved":{const s=ai(i);return s!=null&&s.id?{...a,items:a.items.map(c=>c.kind==="perm"&&c.id===s.id&&c.state==="open"?{...c,state:s.outcome??"expired"}:c)}:a}case"task-running":if(i.kind==="acp_event"){const s=ai(i);if(s!=null&&s.update)return Im(a,s.update)}return a;default:return a}}function pd(a,i){let s=a;for(const c of i)s=zm(s,c);return s}function Pm(a,i,s){return{...a,items:a.items.map(c=>c.kind==="perm"&&c.id===i&&c.state==="open"?{...c,state:s?"allowed":"rejected"}:c)}}_e.setOptions({gfm:!0,breaks:!0});const Tt="ui-monospace,Menlo,monospace";function jm({text:a}){const i=Z.useMemo(()=>Gh.sanitize(_e.parse(a,{async:!1})),[a]);return p.jsx("div",{className:"md",dangerouslySetInnerHTML:{__html:i}})}function Om({meta:a,active:i,onClick:s}){const c=a.status==="running"?{text:"运行中",color:"var(--amberT)"}:a.status==="error"?{text:"出错",color:"var(--err)"}:a.status==="interrupted"?{text:"已中断",color:"var(--t5)"}:{text:a.turns>0?a.turns+" 轮":"",color:"var(--t5)"};return p.jsx("div",{className:"hv-cardh",title:a.workdir,onClick:s,style:{background:i?"var(--card2)":"transparent",borderRadius:10,padding:"9px 13px",cursor:"pointer"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,fontWeight:i?600:400,color:i?"var(--t1)":"var(--t3)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:a.title||"(未命名)"}),a.worktree&&p.jsx("span",{title:"隔离 worktree 会话",style:{flex:"none",fontSize:10,fontWeight:600,color:"var(--amberT)",background:"var(--amberBg)",borderRadius:5,padding:"1px 6px"},children:"隔离"}),p.jsx("span",{style:{marginLeft:"auto",fontSize:11,fontWeight:400,color:c.color},children:c.text})]})})}function Dm({text:a}){const[i,s]=Z.useState(!1),c=a.trim().split(` -`)[0]||"…";return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[p.jsxs("div",{className:"hv-t3",onClick:()=>s(!i),style:{display:"flex",alignItems:"center",gap:9,fontSize:12,color:"var(--t4)",cursor:"pointer",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{flex:"none"},children:"✦ 思考"}),p.jsxs("span",{style:{color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["— ",c]}),p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:i?"▾":"▸"})]}),i&&p.jsx("div",{style:{borderLeft:"2px solid var(--line)",padding:"2px 0 2px 14px",fontSize:12.5,color:"var(--t4)",lineHeight:1.8,whiteSpace:"pre-wrap",animation:"mcin .2s ease"},children:a})]})}function Mm({entries:a}){const i=s=>s==="completed"?"☑":s==="in_progress"?"◐":"☐";return p.jsx("div",{style:{border:"1px solid var(--line)",borderRadius:14,background:"var(--card)",padding:"13px 16px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:a.map((s,c)=>p.jsxs("div",{style:{color:s.status==="completed"?"var(--t5)":s.status==="in_progress"?"var(--amberT)":"var(--t3)",textDecoration:s.status==="completed"?"line-through":"none"},children:[p.jsx("span",{style:{display:"inline-block",width:18},children:i(s.status)})," ",s.content]},c))})}function Hf(a){return a==="run"?"◌":a==="ok"?"✓":"✗"}const Vf=5;function Fm({item:a,radius:i,onOpenChild:s}){const c=a.subItems??[],f=c.length-Vf,h=a.title.indexOf(" "),w=h>0?a.title.slice(0,h):"",v=h>0?a.title.slice(h+1):a.title,R={display:"flex",gap:8,alignItems:"baseline",padding:"0 14px 7px 35px",font:"11.5px/1.7 "+Tt,color:"var(--t4)",whiteSpace:"nowrap",minWidth:0};return p.jsxs("div",{style:{background:"var(--card)",borderRadius:i,overflow:"hidden"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"9px 14px",fontSize:12.5,whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:a.status==="run"?"var(--t4)":a.status==="ok"?"var(--ok)":"var(--err)",fontSize:11,flex:"none",display:"inline-block",animation:a.status==="run"?"mcspin 1s linear infinite":"none"},children:Hf(a.status)}),w&&p.jsx("span",{style:{color:"var(--t3)",flex:"none"},children:w}),p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:v}),a.childSessionId&&s&&p.jsx("span",{className:"hv-t1",onClick:()=>s(a.childSessionId),style:{font:"11.5px "+Tt,color:"var(--amberT)",cursor:"pointer",flex:"none"},children:"查看子会话"}),a.out&&p.jsx("span",{style:{marginLeft:"auto",color:"var(--t5)",fontSize:11,flex:"none",maxWidth:"45%",overflow:"hidden",textOverflow:"ellipsis"},children:a.out})]}),f>0&&p.jsxs("div",{style:{...R,color:"var(--t5)"},children:[p.jsx("span",{style:{flex:"none"},children:"↳"}),"… 已省略前 ",f," 步"]}),c.slice(-Vf).map(k=>p.jsxs("div",{style:R,children:[p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:"↳"}),p.jsx("span",{style:{color:k.status==="run"?"var(--t4)":k.status==="ok"?"var(--ok)":"var(--err)",fontSize:10,flex:"none"},children:Hf(k.status)}),p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:k.title})]},k.id)),a.status==="run"&&a.lastLine&&p.jsxs("div",{style:{...R,display:"block",color:"var(--t5)",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",animation:"mcpulse 1.2s infinite"},children:["↳ ",a.lastLine]})]})}function Qf(a){switch(a){case"allowed":case"approved":return{text:"✓ 已允许",color:"var(--ok)"};case"rejected":case"denied":return{text:"✕ 已拒绝",color:"var(--err)"};case"timeout":return{text:"✕ "+Bf(a),color:"var(--err)"};default:return{text:Bf(a),color:"var(--t5)"}}}function bm({item:a,onAnswer:i}){const s={padding:"7px 18px",background:"var(--card2)",color:"var(--t2)",borderRadius:9,cursor:"pointer"};return p.jsxs("div",{style:{border:"1px solid var(--amberBd)",borderRadius:14,background:"var(--amberBg)",padding:"15px 17px",maxWidth:540,animation:"mcin .25s ease"},children:[p.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--amberT)",whiteSpace:"nowrap"},children:["需要确认 · ",a.tool||"执行操作"]}),p.jsx("div",{style:{margin:"10px 0 12px",padding:"9px 13px",background:"var(--codeBg)",borderRadius:9,font:"12.5px "+Tt,color:"var(--t1)",wordBreak:"break-all"},children:a.title}),a.state==="open"?p.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12.5,fontWeight:600,flexWrap:"wrap"},children:[p.jsx("div",{className:"hv-op",onClick:()=>i(a.id,"allow"),style:{...s,background:"var(--amber)",color:"var(--onAmber)"},children:"允许"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(a.id,"always"),style:s,children:"本会话始终"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(a.id,"persist"),style:s,children:"此项目永久"}),p.jsx("div",{className:"hv-err",onClick:()=>i(a.id,"deny"),style:{padding:"7px 14px",color:"var(--t4)",borderRadius:9,cursor:"pointer"},children:"拒绝"}),p.jsx("span",{style:{marginLeft:"auto",fontWeight:400,fontSize:11,color:"var(--t5)"},children:"⏎ 允许 · esc 拒绝"})]}):p.jsx("div",{style:{fontSize:12,color:Qf(a.state).color},children:Qf(a.state).text})]})}function Bm({item:a,onPermAnswer:i}){switch(a.kind){case"user":return p.jsx("div",{style:{alignSelf:"flex-end",maxWidth:"70%",background:"var(--card2)",borderRadius:"16px 16px 5px 16px",padding:"10px 16px",color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:a.text});case"agent":return p.jsx("div",{style:{maxWidth:"90%",color:"var(--t2)",wordBreak:"break-word",animation:"mcin .25s ease"},children:p.jsx(jm,{text:a.text})});case"thought":return p.jsx(Dm,{text:a.text});case"plan":return p.jsx(Mm,{entries:a.entries});case"sys":return p.jsx("div",{style:{color:a.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:a.text});case"perm":return p.jsx(bm,{item:a,onAnswer:i})}}function hd({items:a,onPermAnswer:i,onOpenChild:s}){const c=[];for(let f=0;fp.jsx(Fm,{item:k,onOpenChild:s,radius:R===1?"11px":A===0?"11px 11px 4px 4px":A===R-1?"4px 4px 11px 11px":"4px"},k.tcId||A))},"g"+w))}else c.push(p.jsx(Bm,{item:h,onPermAnswer:i},f)),f++}return p.jsx(p.Fragment,{children:c})}function Um(a){const i=[];let s=0,c=0;for(const f of a.split(` -`)){const h=f.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(h){s=+h[1],c=+h[2],i.push({no:"",text:f,kind:"h"});continue}f.startsWith("diff ")||f.startsWith("index ")||f.startsWith("+++")||f.startsWith("---")||f.startsWith("new file")||f.startsWith("deleted file")||f.startsWith("similarity")||f.startsWith("rename")||f.startsWith("old mode")||f.startsWith("new mode")||(f.startsWith("+")?i.push({no:String(c++),text:f,kind:"add"}):f.startsWith("-")?i.push({no:String(s++),text:f,kind:"del"}):(i.push({no:String(c),text:f,kind:"ctx"}),s++,c++))}return i}function Wm({text:a}){const i=Z.useMemo(()=>Um(a),[a]);return i.some(s=>s.kind==="h")?p.jsx("div",{style:{font:"12px/1.9 "+Tt},children:i.map((s,c)=>s.kind==="h"?p.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--card)",color:"var(--t4)",fontSize:11},children:[p.jsx("span",{style:{width:36,flex:"none"}}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:s.text})]},c):p.jsxs("div",{style:{display:"flex",padding:"0 24px",background:s.kind==="add"?"var(--addBg)":s.kind==="del"?"var(--delBg)":"transparent",color:s.kind==="add"?"var(--addT)":s.kind==="del"?"var(--delT)":"var(--t3)"},children:[p.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:s.no}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:s.text||" "})]},c))}):p.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:a})}const Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAqiklEQVR42u1dB3xUVfb+3ps+kx5CCB0EEQVlBZUiglRhseEq6toLKLpiZ1fR1cX2d1fXhoKKYGFRRFBUiiIiAgqKIlV6JwkJKZNMy5T3/+59byaTELDsRorv5je/STJvXrnn3FO/c65V44A5frfDak6ByQDmMBnAHCYDmMNkAHOYDGAOkwHMYTKAOUwGMIfJAOYwGcAcJgOYw2QAc5gMYA6TAcxhMoA5TAYwh8kA5jAZwBwmA5jDZABzmAxgDpMBzGEywDE0NPnSE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9byfu31UadGEASbEdyaxCdlWJxqwgCSZ2DXOLdzMRF+go38ccwxwwFY0BoF/TZg1zky6iMcxQ/TfBQMciil+ejPJY5HUOHp2DatPJNLvh7QmA5jDZABzmAxgDpMBzGEygDlMBjCHyQDmMBnAHCYDmMNkAHOYDGAOkwHMYTKAyQDmFJgMYA6TAcxhMoA5TAYwh8kA5jAZwBwmA5jDZABzmAxgDpMBzGEygDlMBjDHsTv+HxbPMt2OHSwMAAAAAElFTkSuQmCC";function Yf(a){const i={};let s=0;for(const c of a.split(` -`)){const f=c.indexOf("=");if(f<=0)continue;const h=c.slice(0,f).trim();h&&(i[h]=c.slice(f+1).trim(),s++)}return s?i:void 0}const Hm=a=>a&&typeof a=="object"?Object.entries(a).map(([i,s])=>`${i}=${String(s)}`).join(` -`):"";function Vm(a){const i={};for(const s of a){const c=s.name.trim();if(c)if(s.type==="stdio"){if(!s.command.trim())continue;const f=s.args.trim()?s.args.trim().split(/\s+/):void 0;i[c]={command:s.command.trim(),args:f,env:Yf(s.kv)}}else{if(!s.url.trim())continue;i[c]={url:s.url.trim(),headers:Yf(s.kv)}}}return i}function Qm(a){return Object.entries(a).map(([i,s])=>{const c=s??{},f=typeof c.command=="string"&&c.command!=="";return{name:i,type:f?"stdio":"http",url:typeof c.url=="string"?c.url:"",command:typeof c.command=="string"?c.command:"",args:Array.isArray(c.args)?c.args.map(String).join(" "):"",kv:Hm(f?c.env:c.headers)}})}const xl={width:588,maxWidth:"100%",background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:18,boxSizing:"border-box"},Xn={width:"100%",background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 11px",font:"11.5px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"},Kf={background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 8px",fontSize:12,color:"var(--t1)",outline:"none",cursor:"pointer"},Ea={padding:"7px 14px",background:"var(--card2)",borderRadius:9,cursor:"pointer",fontSize:12,fontWeight:600,color:"var(--t2)",whiteSpace:"nowrap",userSelect:"none"};function Sn({label:a,children:i}){return p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:11,color:"var(--t4)",marginBottom:4},children:a}),i]})}function Gm(){try{return localStorage.getItem("mc.theme")==="light"?"light":"dark"}catch{return"dark"}}function Ym(a){document.documentElement.classList.toggle("light",a==="light");try{localStorage.setItem("mc.theme",a)}catch{}}function Km(){const[a,i]=Z.useState(Gm()),s=f=>{Ym(f),i(f)},c=(f,h)=>p.jsx("div",{onClick:()=>s(f),style:{padding:"6px 18px",fontSize:12.5,fontWeight:600,borderRadius:8,cursor:"pointer",userSelect:"none",background:a===f?"var(--amber)":"transparent",color:a===f?"var(--onAmber)":"var(--t3)"},children:h});return p.jsxs("div",{style:{display:"inline-flex",background:"var(--card)",borderRadius:10,padding:3,gap:2},children:[c("dark","深色"),c("light","浅色")]})}const qf=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),qm=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function Xm({onClose:a}){const i=Aa(),[s,c]=Z.useState([]),[f,h]=Z.useState(0),[w,v]=Z.useState([]),[R,k]=Z.useState(!1),[A,M]=Z.useState(""),[N,re]=Z.useState(!1);Z.useEffect(()=>{i&&uh().then(Q=>{const W=(Q==null?void 0:Q.models)??[];c(W.length?W:[qf()]),h(Math.max(0,W.findIndex(q=>q.default))),v(Qm((Q==null?void 0:Q.mcp_servers)??{})),k(!0)}).catch(Q=>M("读取配置失败: "+(Q instanceof Error?Q.message:String(Q))))},[i]);const Y=(Q,W)=>c(q=>q.map((le,he)=>he===Q?{...le,...W}:le)),J=(Q,W)=>v(q=>q.map((le,he)=>he===Q?{...le,...W}:le)),oe=async()=>{for(const W of s)if(!W.name.trim()||!W.base_url.trim()||!W.api_key.trim()||!W.model.trim()){M(`模型「${W.name.trim()||"未命名"}」信息不完整(需名称/接口地址/API Key/模型标识)`);return}const Q=new Set;for(const W of s){if(Q.has(W.name.trim())){M(`模型名称重复: ${W.name.trim()}`);return}Q.add(W.name.trim())}M(""),re(!0);try{await ch({models:s.map((W,q)=>({...W,name:W.name.trim(),default:q===f})),mcp_servers:Vm(w)})}catch(W){M(W instanceof Error?W.message:String(W)),re(!1)}};return p.jsx("div",{style:{flex:1,overflowY:"auto",animation:"mcin .25s ease"},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:14,padding:"40px 24px 60px"},children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center"},children:[p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"设置"}),p.jsx("div",{className:"hv-cardh",onClick:a,style:{...Ea,marginLeft:"auto"},children:"返回"})]}),p.jsx("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"外观"})}),p.jsxs("div",{style:{...xl,display:"flex",alignItems:"center",gap:12},children:[p.jsx(Km,{}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"跟随本机保存,重启后保持。"})]}),!i&&p.jsx("div",{style:{...xl,color:"var(--t4)",fontSize:12.5,lineHeight:1.7},children:"浏览器模式下配置只读:模型与 MCP 由启动 mc-agent 的宿主(桌面应用或环境变量)管理。"}),i&&!R&&!A&&p.jsx("div",{style:{fontSize:12.5,color:"var(--t5)"},children:"读取配置中…"}),i&&R&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"模型"}),p.jsx("div",{className:"hv-cardh",onClick:()=>c(Q=>[...Q,qf()]),style:{...Ea,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加模型"})]}),s.length===0&&p.jsx("div",{style:{...xl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"还没有模型。保存后应用可运行,但需要添加模型才能开始任务。"}),s.map((Q,W)=>p.jsxs("div",{style:xl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Sn,{label:"名称",children:p.jsx("input",{style:Xn,value:Q.name,placeholder:"如: 主力模型",onChange:q=>Y(W,{name:q.target.value})})}),p.jsx(Sn,{label:"协议",children:p.jsxs("select",{style:{...Kf,width:"100%"},value:Q.provider||"anthropic",onChange:q=>Y(W,{provider:q.target.value}),children:[p.jsx("option",{value:"anthropic",children:"anthropic"}),p.jsx("option",{value:"openai",children:"openai(Chat Completions)"}),p.jsx("option",{value:"openai_responses",children:"openai_responses(Responses)"})]})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:"接口地址",children:p.jsx("input",{style:Xn,value:Q.base_url,placeholder:"https://api.example.com",onChange:q=>Y(W,{base_url:q.target.value})})})}),p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Sn,{label:"API Key",children:p.jsx("input",{style:Xn,type:"password",value:Q.api_key,placeholder:"sk-...",onChange:q=>Y(W,{api_key:q.target.value})})}),p.jsx(Sn,{label:"模型标识",children:p.jsx("input",{style:Xn,value:Q.model,placeholder:"请求中的 model 字段",onChange:q=>Y(W,{model:q.target.value})})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:12,fontSize:12},children:[W===f?p.jsx("span",{style:{color:"var(--amberT)",fontWeight:600},children:"✓ 默认模型"}):p.jsx("span",{className:"hv-t1",style:{color:"var(--t4)",cursor:"pointer"},onClick:()=>h(W),children:"设为默认"}),p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>{c(q=>q.filter((le,he)=>he!==W)),h(q=>Wv(Q=>[...Q,qm()]),style:{...Ea,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加 MCP"})]}),w.length===0&&p.jsx("div",{style:{...xl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"未配置 MCP 服务器(可选)。项目级 .mc-agent/mcp.json 仍随仓库生效。"}),w.map((Q,W)=>p.jsxs("div",{style:xl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Sn,{label:"名称",children:p.jsx("input",{style:Xn,value:Q.name,placeholder:"如: context7",onChange:q=>J(W,{name:q.target.value})})}),p.jsx(Sn,{label:"类型",children:p.jsxs("select",{style:{...Kf,width:"100%"},value:Q.type,onChange:q=>J(W,{type:q.target.value}),children:[p.jsx("option",{value:"http",children:"HTTP(URL)"}),p.jsx("option",{value:"stdio",children:"stdio(本地命令)"})]})})]}),Q.type==="http"?p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:"URL",children:p.jsx("input",{style:Xn,value:Q.url,placeholder:"https://mcp.example.com/mcp",onChange:q=>J(W,{url:q.target.value})})})}):p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Sn,{label:"命令",children:p.jsx("input",{style:Xn,value:Q.command,placeholder:"npx",onChange:q=>J(W,{command:q.target.value})})}),p.jsx(Sn,{label:"参数(空格分隔)",children:p.jsx("input",{style:Xn,value:Q.args,placeholder:"@playwright/mcp",onChange:q=>J(W,{args:q.target.value})})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:Q.type==="http"?"Headers(每行 KEY=VALUE)":"环境变量(每行 KEY=VALUE)",children:p.jsx("textarea",{style:{...Xn,resize:"vertical"},rows:2,value:Q.kv,onChange:q=>J(W,{kv:q.target.value})})})}),p.jsx("div",{style:{display:"flex",marginTop:12,fontSize:12},children:p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>v(q=>q.filter((le,he)=>he!==W)),children:"删除"})})]},W)),p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",gap:12,marginTop:16},children:[p.jsx("div",{className:"hv-op",onClick:()=>!N&&void oe(),style:{padding:"9px 22px",borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",fontWeight:700,fontSize:13,cursor:"pointer",opacity:N?.5:1,userSelect:"none"},children:N?"保存并重启内核中…":"保存"}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"保存后内核自动重启,会话在磁盘不丢失。"})]})]}),A&&p.jsx("div",{style:{width:588,maxWidth:"100%",fontSize:12.5,color:"var(--err)"},children:A})]})})}let md=-1/0;const Ta=a=>{md=a.timeStamp},Ca=a=>a.nativeEvent.isComposing||a.timeStamp-md<100,_a=a=>a>=1e3?Math.round(a/100)/10+"k":String(a),Xf=a=>a.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||a,pi="~/MonkeyCode";function Zm(a){var c;const i=new Map;for(const f of a){const h=((c=f.worktree)==null?void 0:c.repo)||f.workdir,w=i.get(h);w?w.push(f):i.set(h,[f])}const s=[...i.entries()].map(([f,h])=>{var w;return h.sort((v,R)=>(R.updated_at??"").localeCompare(v.updated_at??"")),{dir:f,name:f.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||f,latest:((w=h[0])==null?void 0:w.updated_at)??"",items:h}});return s.sort((f,h)=>h.latest.localeCompare(f.latest)),s}const wl={width:720,maxWidth:"100%"};function Jm(){var Rn,yt,Gt;const[a,i]=Z.useState([]),[s,c]=Z.useState(null),[f,h]=Z.useState("new"),[w,v]=Z.useState(ja),[R,k]=Z.useState("未连接"),[A,M]=Z.useState(null),[N,re]=Z.useState(""),[Y,J]=Z.useState(!1),[oe,Q]=Z.useState(null),[W,q]=Z.useState(""),[le,he]=Z.useState(null),[de,Ee]=Z.useState(""),[Ge,mt]=Z.useState(null),[be,Jt]=Z.useState([]),[Be,et]=Z.useState(""),[ut,Ue]=Z.useState(!1),[Ke,Ne]=Z.useState(null),[F,$]=Z.useState(pi),[U,y]=Z.useState(!1),[L,ae]=Z.useState(""),[ue,me]=Z.useState(""),[ge,xe]=Z.useState(""),[ye,Se]=Z.useState(!1),[tt,Te]=Z.useState(!1),[$n,Ae]=Z.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("mc.collapsedGroups")||"[]"))}catch{return new Set}}),er=C=>{Ae(b=>{const ce=new Set(b);return ce.has(C)?ce.delete(C):ce.add(C),localStorage.setItem("mc.collapsedGroups",JSON.stringify([...ce])),ce})},fe=Z.useRef(null),$t=Z.useRef(null),On=Z.useRef(null),It=Z.useRef(null),Dn=Z.useRef(!0),Ht=Z.useRef(null),zt=Z.useRef(!1),Pt=Z.useCallback(async()=>{const C=await ih();return i(C),C},[]),ct=Z.useCallback(async()=>{const C=fe.current;if(!C)return[];try{const b=await C.call("repo_file_changes");if(b.error)return re(b.error),M([]),[];re("");const ce=b.result??[];return M(ce),ce}catch(b){return re(b instanceof Error?b.message:String(b)),M([]),[]}},[]),Ct=Z.useCallback((C,b)=>{var ce;(ce=fe.current)==null||ce.close(),c(C),h("session"),v(ja),M(null),re(""),J(!1),Q(null),Ue(!1),he(null),et(b??""),localStorage.setItem("mc.lastSession",C),fe.current=Jf(C,{onFrames:Le=>v(Ot=>pd(Ot,Le)),onStatus:Le=>k(Le)}),Pt()},[Pt]);Z.useEffect(()=>{const C=fh("open-settings",()=>h("settings"));return Promise.all([oh().catch(()=>[]),Pt()]).then(([b,ce])=>{var hn;Jt(b),ae(((hn=b.find(en=>en.default))==null?void 0:hn.name)??"");const Le=localStorage.getItem("mc.lastSession"),Ot=ce.find(en=>en.id===Le);Ot&&Ct(Ot.id,Ot.model),b.length===0&&Aa()&&h("settings")}).catch(b=>k("无法连接服务: "+(b instanceof Error?b.message:b))),()=>{var b;C(),(b=fe.current)==null||b.close()}},[]),Z.useEffect(()=>{w.model&&et(w.model)},[w.model]);const Vt=((Rn=[...a].sort((C,b)=>(b.updated_at??"").localeCompare(C.updated_at??""))[0])==null?void 0:Rn.workdir)??"";Z.useEffect(()=>{zt.current||$(Vt||pi)},[Vt]);const En=R.startsWith("已连接");Z.useEffect(()=>{var b;if(!En)return;ct();const C=Ht.current;C&&((b=fe.current)!=null&&b.send("user-input",{content:mi(C)}))&&(Ht.current=null)},[En,ct]),Z.useEffect(()=>{w.turnEnded&&(v(C=>({...C,turnEnded:!1})),ct(),Pt())},[w.turnEnded,ct,Pt]),Z.useEffect(()=>{var C;w.running||!le||(C=fe.current)!=null&&C.send("user-input",{content:mi(le)})&&he(null)},[w.running,le]),Z.useEffect(()=>{const C=$t.current;C&&Dn.current&&(C.scrollTop=C.scrollHeight)},[w.items,w.running]),Z.useEffect(()=>{const C=On.current;C&&(C.style.height="auto",C.style.height=Math.min(C.scrollHeight,160)+"px")},[W]);const Mn=()=>{const C=$t.current;C&&(Dn.current=C.scrollHeight-C.scrollTop-C.clientHeight<40)},un=()=>{const C=W.trim();if(!(!C||!fe.current)){if(w.running){he(C),q("");return}fe.current.send("user-input",{content:mi(C)})&&q("")}},Tn=(C,b)=>{var Le;const ce=b!=="deny";(Le=fe.current)!=null&&Le.send("permission-resp",{id:C,approved:ce,remember:b==="always"||b==="persist",persist:b==="persist"})&&v(Ot=>Pm(Ot,C,ce))},jt=async C=>{if(Ue(!1),!(!fe.current||!C||C===Be))try{const b=await fe.current.call("session_set_model",{model:C});if(b.error){k("⚠ 切换模型失败: "+b.error);return}et(C),Pt()}catch(b){k("⚠ 切换模型失败: "+(b instanceof Error?b.message:b))}},Qt=async C=>{var b;Q({path:C,text:"加载中…"});try{const ce=await fe.current.call("repo_file_diff",{path:C});Q({path:C,text:ce.error?"✗ "+ce.error:((b=ce.result)==null?void 0:b.diff)||"(无差异)"})}catch(ce){Q({path:C,text:"✗ "+(ce instanceof Error?ce.message:ce)})}},tr=()=>{J(!0),ct().then(C=>{C.length?Qt(C[0].path):Q(null)})},Fn=async(C=!1)=>{const b=F.trim();if(!(!b||tt)){Te(!0),xe(""),Se(!1);try{const ce=await sh(b,L,C||b===pi),Le=ue.trim();Le&&(Ht.current=Le),me(""),await Pt(),Ct(ce.id,ce.model)}catch(ce){const Le=ce instanceof Error?ce.message:String(ce);xe("创建失败: "+Le),Le.includes("目录不存在")&&Se(!0)}finally{Te(!1)}}},Tr=async()=>{const C=await ah();C&&(zt.current=!0,$(C),xe(""),Se(!1))},cn=a.find(C=>C.id===s),fn=Be||((yt=be.find(C=>C.default))==null?void 0:yt.name)||"",bn=Be&&!be.some(C=>C.name===Be)?[...be,{name:Be,default:!1}]:be,gt=w.usage,qe=[...w.items].reverse().find(C=>C.kind==="perm"&&C.state==="open"),Bn=w.items.some(C=>C.kind==="tool"&&C.status==="run"),dn=qe?"等待权限确认":Bn?"执行中":"思考中",pn=Math.max(1,w.items.filter(C=>C.kind==="user").length),Cn=de.trim().toLowerCase(),nr=(Cn?a.filter(C=>(C.title||"").toLowerCase().includes(Cn)||C.workdir.toLowerCase().includes(Cn)):a).slice().sort((C,b)=>(b.updated_at??"").localeCompare(C.updated_at??"")),_n=f==="new"||s===null;return Z.useEffect(()=>{const C=b=>{var ce;if((b.metaKey||b.ctrlKey)&&b.key.toLowerCase()==="k"){b.preventDefault(),(ce=It.current)==null||ce.focus();return}if(b.key==="Escape"){if(ut)return Ue(!1);if(Ge)return mt(null);if(Y)return J(!1);if(f==="settings")return h(s?"session":"new");qe&&Tn(qe.id,"deny");return}if(b.key==="Enter"&&!b.isComposing&&qe&&!_n){const Le=b.target;if(Le&&(Le.tagName==="TEXTAREA"||Le.tagName==="INPUT")&&W.trim())return;b.preventDefault(),Tn(qe.id,"allow")}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)}),p.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",background:"var(--bg)",color:"var(--t2)",fontSize:13.5,overflow:"hidden",position:"relative"},children:[p.jsxs("div",{style:{width:292,flex:"none",display:"flex",flexDirection:"column",background:"var(--side)",borderRight:"1px solid var(--line)",minWidth:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"20px 18px 14px"},children:[p.jsx("img",{src:Gf,alt:"",draggable:!1,style:{width:28,height:28,borderRadius:9,flex:"none"}}),p.jsx("div",{style:{fontWeight:700,fontSize:14.5,color:"var(--t1)",letterSpacing:"-.01em"},children:"MonkeyCode"})]}),p.jsx("div",{style:{padding:"0 14px 12px"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:"var(--card)",borderRadius:9,padding:"0 11px"},children:[p.jsx("span",{style:{color:"var(--t4)",fontSize:12},children:"⌕"}),p.jsx("input",{ref:It,value:de,onChange:C=>Ee(C.target.value),placeholder:"搜索会话",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:12.5,padding:"8px 0",minWidth:0}}),p.jsx("span",{style:{font:"10px "+Tt,color:"var(--t5)"},children:"⌘K"})]})}),p.jsxs("div",{style:{padding:"0 14px",flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 8px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"云端任务"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"跑在服务器"})]}),p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有云端任务。长任务可以派发到服务器上跑,关掉客户端也会继续。"})]}),p.jsx("div",{style:{padding:"16px 14px 0",flex:"none"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 6px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"本地会话"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"这台电脑"}),p.jsx("span",{className:"hv-cardh",title:"新建任务",onClick:()=>{h("new"),Ue(!1)},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",userSelect:"none"},children:"+"})]})}),p.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 14px"},children:[a.length===0&&p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有会话。在右侧输入第一个任务开始。"}),a.length>0&&nr.length===0&&p.jsxs("div",{style:{padding:"2px 4px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:["没有匹配「",de.trim(),"」的会话。"]}),Zm(nr).map(C=>p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{title:C.dir,onClick:()=>er(C.dir),onMouseEnter:()=>Ne(C.dir),onMouseLeave:()=>Ne(null),style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:$n.has(C.dir)?"▶":"▼"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:C.name}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:C.items.length}),p.jsx("span",{className:"hv-t1",title:"在 "+C.dir+" 新建会话",onClick:b=>{b.stopPropagation(),zt.current=!0,$(C.dir),y(!1),h("new")},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",visibility:Ke===C.dir?"visible":"hidden"},children:"+"})]}),!$n.has(C.dir)&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:C.items.map(b=>p.jsx(Om,{meta:b,active:b.id===s&&f==="session",onClick:()=>Ct(b.id,b.model)},b.id))})]},C.dir))]}),p.jsxs("div",{style:{padding:"14px 18px",display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",borderTop:"1px solid var(--line)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:En?"var(--ok)":"var(--t5)",flex:"none"}}),p.jsx("span",{title:R,style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:R}),p.jsx("span",{className:"hv-t1",title:"设置",onClick:()=>{Ue(!1),h("settings")},style:{marginLeft:"auto",cursor:"pointer",fontSize:15},children:"⚙"})]})]}),p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:f==="settings"?p.jsx(Xm,{onClose:()=>h(s?"session":"new")}):_n?p.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,animation:"mcin .25s ease",padding:"0 24px"},children:[a.length===0?p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,marginBottom:2},children:[p.jsx("img",{src:Gf,alt:"",draggable:!1,style:{width:52,height:52,borderRadius:16}}),p.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"把第一个任务交给 MonkeyCode"}),p.jsxs("div",{style:{fontSize:13,color:"var(--t4)",maxWidth:460,textAlign:"center",lineHeight:1.7},children:["描述你想做的事。工作目录"," ",p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t3)"},children:F||pi})," ","已自动准备好,也可以换成你的项目目录。"]})]}):p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"开始一个新任务"}),p.jsxs("div",{style:{display:"flex",gap:12,maxWidth:"100%",flexWrap:"wrap",justifyContent:"center"},children:[p.jsxs("div",{style:{width:288,border:"1px solid var(--amberBd)",borderRadius:16,background:"var(--amberBg)",padding:20,boxSizing:"border-box"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--amberT)",whiteSpace:"nowrap"},children:["⌂ 本地",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--amberBg)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"默认 ⏎"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在这台电脑上,直接读写本地文件;每步权限逐一确认。"}),U?p.jsx("input",{value:F,autoFocus:!0,onChange:C=>{zt.current=!0,$(C.target.value),xe(""),Se(!1)},onCompositionEnd:Ta,onKeyDown:C=>C.key==="Enter"&&!Ca(C)&&y(!1),onBlur:()=>y(!1),placeholder:"/home/you/dev/project",style:{width:"100%",marginTop:12,background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"7px 10px",font:"11px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"}}):p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:12,font:"11px "+Tt,color:"var(--t5)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:F}),F===pi&&p.jsx("span",{style:{flex:"none"},children:"· 自动创建"}),p.jsx("span",{className:"hv-t1",onClick:()=>y(!0),style:{marginLeft:"auto",cursor:"pointer",flex:"none",font:"12px system-ui"},children:"更改"}),Aa()&&p.jsx("span",{className:"hv-t1",onClick:()=>void Tr(),style:{cursor:"pointer",flex:"none",font:"12px system-ui"},children:"浏览…"})]})]}),p.jsxs("div",{style:{width:288,border:"1px solid var(--line)",borderRadius:16,background:"var(--card)",padding:20,boxSizing:"border-box",opacity:.7},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--t1)",whiteSpace:"nowrap"},children:["☁ 云端",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--card2)",color:"var(--t4)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"即将上线"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在云上服务器,关掉客户端也继续;完成后打包改动回来审查。"}),p.jsxs("div",{style:{display:"flex",font:"11px "+Tt,color:"var(--t5)",marginTop:12,whiteSpace:"nowrap"},children:["需要连接平台",p.jsx("span",{style:{marginLeft:"auto"},children:"长任务推荐"})]})]})]}),ge&&p.jsxs("div",{style:{...wl,width:588,fontSize:12,color:"var(--err)"},children:[ge,ye&&p.jsx("span",{className:"hv-op",onClick:()=>void Fn(!0),style:{cursor:"pointer",color:"var(--amberT)",marginLeft:8},children:"创建该目录并继续 →"})]}),p.jsxs("div",{style:{...wl,width:588,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("input",{value:ue,autoFocus:!0,onChange:C=>me(C.target.value),onCompositionEnd:Ta,onKeyDown:C=>C.key==="Enter"&&!Ca(C)&&void Fn(),placeholder:"描述任务…(可留空,先建会话)",style:{width:"100%",background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:13.5,boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:12,fontSize:12,color:"var(--t5)"},children:[be.length>1?p.jsx("select",{value:L,onChange:C=>ae(C.target.value),style:{background:"transparent",border:"none",outline:"none",color:"var(--t4)",fontSize:12,cursor:"pointer"},children:be.map(C=>p.jsxs("option",{value:C.name,children:[C.name,C.default?"(默认)":""]},C.name))}):p.jsx("span",{children:((Gt=be[0])==null?void 0:Gt.name)??""}),p.jsx("div",{className:"hv-op",onClick:()=>void Fn(),style:{marginLeft:"auto",width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:tt?.5:1},children:"↑"})]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 24px",height:56,flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,fontWeight:600,color:"var(--t1)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:(cn==null?void 0:cn.title)||"(未命名)"}),p.jsxs("span",{style:{font:"400 11px "+Tt,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["⌂ ",(cn==null?void 0:cn.workdir)??""]})]}),p.jsxs("div",{className:"hv-card",title:"查看本轮文件改动",onClick:tr,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:8,cursor:"pointer",whiteSpace:"nowrap",fontSize:12,color:"var(--t3)",flex:"none",userSelect:"none"},children:[p.jsx("span",{style:{color:"var(--amberT)"},children:"⇄"})," 改动",A&&A.length>0?` · ${A.length}`:""]})]}),p.jsx("div",{style:{height:1,background:"var(--line)",margin:"0 24px",flex:"none"}}),p.jsx("div",{ref:$t,onScroll:Mn,style:{flex:1,overflowY:"auto",display:"flex",justifyContent:"center"},children:p.jsx("div",{style:{...wl,maxWidth:"calc(100% - 48px)",padding:"28px 0 16px",display:"flex",flexDirection:"column",gap:18,lineHeight:1.8,height:"fit-content"},children:p.jsx(hd,{items:w.items,onPermAnswer:Tn,onOpenChild:mt})})}),w.running&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{...wl,display:"flex",alignItems:"center",gap:10,fontSize:12.5,color:"var(--t3)",padding:"2px 0",boxSizing:"border-box"},children:[p.jsx("span",{style:{width:12,height:12,border:"2px solid var(--amber)",borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .8s linear infinite",flex:"none"}}),dn,p.jsxs("span",{style:{color:"var(--t5)"},children:["· 第 ",pn," 轮",gt?` · 已用 ${_a(gt.used)} tokens`:""]}),p.jsx("span",{className:"hv-cardh",onClick:()=>{var C;return(C=fe.current)==null?void 0:C.send("user-cancel",{})},style:{marginLeft:"auto",padding:"5px 13px",background:"var(--card2)",borderRadius:8,color:"var(--err)",cursor:"pointer",fontWeight:600,whiteSpace:"nowrap"},children:"■ 停止"})]})}),le&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{...wl,display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",background:"var(--card)",borderRadius:10,padding:"7px 13px",boxSizing:"border-box"},children:[p.jsx("span",{style:{animation:"mcpulse 1.2s infinite"},children:"⏳"}),"已排队:",p.jsx("span",{style:{color:"var(--t2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:le}),p.jsx("span",{style:{marginLeft:"auto",whiteSpace:"nowrap"},children:"运行结束后自动发送"}),p.jsx("span",{className:"hv-err",onClick:()=>he(null),style:{cursor:"pointer",color:"var(--t5)"},children:"✕"})]})}),p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 20px",flex:"none"},children:p.jsxs("div",{style:{...wl,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("textarea",{ref:On,rows:1,value:W,placeholder:w.running?"补充说明…运行中发送会排队":"输入任务…",onChange:C=>q(C.target.value),onCompositionEnd:Ta,onKeyDown:C=>{C.key==="Enter"&&!C.shiftKey&&!Ca(C)&&(C.preventDefault(),un())},style:{width:"100%",background:"none",border:"none",outline:"none",resize:"none",color:"var(--t1)",fontSize:13.5,lineHeight:1.6,maxHeight:160,padding:0,display:"block",boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12,fontSize:12,color:"var(--t5)"},children:[p.jsx("span",{children:"⏎ 发送 · ⇧⏎ 换行"}),p.jsxs("div",{style:{marginLeft:"auto",position:"relative",flex:"none"},children:[p.jsxs("div",{className:w.running?void 0:"hv-card2",title:w.running?"轮次执行中,结束后可切换":"切换本会话模型(下一轮生效)",onClick:()=>!w.running&&Ue(!ut),style:{padding:"4px 9px",borderRadius:7,cursor:w.running?"default":"pointer",whiteSpace:"nowrap",fontSize:11.5,color:w.running?"var(--t5)":"var(--t4)",userSelect:"none"},children:[fn||"模型"," ▾"]}),ut&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:()=>Ue(!1)}),p.jsx("div",{style:{position:"absolute",bottom:32,right:0,width:220,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:12,boxShadow:"var(--shadow)",padding:6,zIndex:30,animation:"mcin .15s ease"},children:bn.map(C=>p.jsxs("div",{className:"hv-card",onClick:()=>void jt(C.name),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 11px",borderRadius:8,cursor:"pointer",fontSize:12.5,color:C.name===fn?"var(--amberT)":"var(--t2)",fontWeight:C.name===fn?600:400,whiteSpace:"nowrap"},children:[C.name,p.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)",fontWeight:400},children:C.default?"默认":""})]},C.name))})]})]}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)"},children:gt?`${_a(gt.used)} / ${_a(gt.size)}`:""}),p.jsx("div",{className:"hv-op",onClick:un,title:"发送",style:{width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:W.trim()?1:.4},children:"↑"})]})]})})]})}),Y&&p.jsxs(p.Fragment,{children:[p.jsx("div",{onClick:()=>J(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,.3)",zIndex:35}}),p.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,width:600,maxWidth:"80vw",background:"var(--pop)",borderLeft:"1px solid var(--line)",boxShadow:"var(--shadow)",zIndex:36,display:"flex",flexDirection:"column",animation:"mcslide .22s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 20px 12px",flex:"none",whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:13.5,fontWeight:700,color:"var(--t1)"},children:["改动",A&&A.length>0?` · ${A.length} 个文件`:""]}),p.jsx("span",{className:"hv-t1",onClick:()=>J(!1),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--err)"},children:N}),A&&A.length===0&&!N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--t5)"},children:"无改动(或非 git 仓库)"}),A&&A.length>0&&p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5,padding:"0 20px 12px",flex:"none"},children:A.map(C=>{const b=(oe==null?void 0:oe.path)===C.path;return p.jsxs("div",{className:"hv-cardh",onClick:()=>void Qt(C.path),style:{display:"flex",alignItems:"center",gap:7,background:b?"var(--card2)":"transparent",border:"1px solid var(--line)",borderRadius:9,padding:"6px 11px",cursor:"pointer",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"700 11px "+Tt,color:C.status==="A"?"var(--ok)":C.status==="D"?"var(--err)":"var(--amberT)"},children:C.status}),p.jsx("span",{style:{font:"11.5px "+Tt,color:b?"var(--t1)":"var(--t3)"},children:Xf(C.path)})]},C.path)})}),oe&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",borderTop:"1px solid var(--line)",flex:"none",whiteSpace:"nowrap",overflow:"hidden"},children:[p.jsx("span",{style:{font:"12.5px "+Tt,color:"var(--t1)"},children:Xf(oe.path)}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:oe.path})]}),p.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 0 20px"},children:p.jsx(Wm,{text:oe.text})})]})]})]}),Ge&&p.jsx("div",{onClick:()=>mt(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:40,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsxs("div",{onClick:C=>C.stopPropagation(),style:{width:"min(860px, 92vw)",maxHeight:"84vh",background:"var(--pop)",border:"1px solid var(--line)",borderRadius:20,boxShadow:"var(--shadow)",padding:"22px 24px",display:"flex",flexDirection:"column",overflow:"hidden",animation:"mcin .2s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12,whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:15,fontWeight:700,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:["子代理会话 ",Ge]}),p.jsx("span",{className:"hv-t1",onClick:()=>mt(null),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),p.jsx($m,{id:Ge})]})})]})}function $m({id:a}){const[i,s]=Z.useState(ja),[c,f]=Z.useState("连接中…");return Z.useEffect(()=>{const h=Jf(a,{onFrames:w=>s(v=>pd(v,w)),onStatus:w=>f(w)});return()=>h.close()},[a]),p.jsxs("div",{style:{overflowY:"auto",flex:1,paddingRight:6,display:"flex",flexDirection:"column",gap:14,lineHeight:1.8},children:[p.jsx("div",{style:{color:"var(--t4)",fontSize:12},children:c}),p.jsx(hd,{items:i.items,onPermAnswer:()=>{}})]})}lh.createRoot(document.getElementById("root")).render(p.jsx(Z.StrictMode,{children:p.jsx(Jm,{})})); +`+this.renderer.text(k);s?c+=this.renderer.paragraph({type:"paragraph",raw:A,text:A,tokens:[{type:"text",raw:A,text:A,escaped:!0}]}):c+=A;continue}default:{const k='Token with "'+R.type+'" type was not found.';if(this.options.silent)return console.error(k),"";throw new Error(k)}}}return c}parseInline(i,s=this.renderer){var f,h;let c="";for(let w=0;w{const R=w[v].flat(1/0);s=s.concat(this.walkTokens(R,i))}):w.tokens&&(s=s.concat(this.walkTokens(w.tokens,i)))}}return s}use(...a){const i=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(s=>{const c={...s};if(c.async=this.defaults.async||c.async||!1,s.extensions&&(s.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){const h=i.renderers[f.name];h?i.renderers[f.name]=function(...w){let v=f.renderer.apply(this,w);return v===!1&&(v=h.apply(this,w)),v}:i.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const h=i[f.level];h?h.unshift(f.tokenizer):i[f.level]=[f.tokenizer],f.start&&(f.level==="block"?i.startBlock?i.startBlock.push(f.start):i.startBlock=[f.start]:f.level==="inline"&&(i.startInline?i.startInline.push(f.start):i.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(i.childTokens[f.name]=f.childTokens)}),c.extensions=i),s.renderer){const f=this.defaults.renderer||new Lo(this.defaults);for(const h in s.renderer){if(!(h in f))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;const w=h,v=s.renderer[w],R=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A||""}}c.renderer=f}if(s.tokenizer){const f=this.defaults.tokenizer||new No(this.defaults);for(const h in s.tokenizer){if(!(h in f))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;const w=h,v=s.tokenizer[w],R=f[w];f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A}}c.tokenizer=f}if(s.hooks){const f=this.defaults.hooks||new Ro;for(const h in s.hooks){if(!(h in f))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;const w=h,v=s.hooks[w],R=f[w];Ro.passThroughHooks.has(h)?f[w]=k=>{if(this.defaults.async)return Promise.resolve(v.call(f,k)).then(M=>R.call(f,M));const A=v.call(f,k);return R.call(f,A)}:f[w]=(...k)=>{let A=v.apply(f,k);return A===!1&&(A=R.apply(f,k)),A}}c.hooks=f}if(s.walkTokens){const f=this.defaults.walkTokens,h=s.walkTokens;c.walkTokens=function(w){let v=[];return v.push(h.call(this,w)),f&&(v=v.concat(f.call(this,w))),v}}this.defaults={...this.defaults,...c}}),this}setOptions(a){return this.defaults={...this.defaults,...a},this}lexer(a,i){return Zn.lex(a,i??this.defaults)}parser(a,i){return Jn.parse(a,i??this.defaults)}parseMarkdown(a){return(s,c)=>{const f={...c},h={...this.defaults,...f},w=this.onError(!!h.silent,!!h.async);if(this.defaults.async===!0&&f.async===!1)return w(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return w(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return w(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));h.hooks&&(h.hooks.options=h,h.hooks.block=a);const v=h.hooks?h.hooks.provideLexer():a?Zn.lex:Zn.lexInline,R=h.hooks?h.hooks.provideParser():a?Jn.parse:Jn.parseInline;if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(s):s).then(k=>v(k,h)).then(k=>h.hooks?h.hooks.processAllTokens(k):k).then(k=>h.walkTokens?Promise.all(this.walkTokens(k,h.walkTokens)).then(()=>k):k).then(k=>R(k,h)).then(k=>h.hooks?h.hooks.postprocess(k):k).catch(w);try{h.hooks&&(s=h.hooks.preprocess(s));let k=v(s,h);h.hooks&&(k=h.hooks.processAllTokens(k)),h.walkTokens&&this.walkTokens(k,h.walkTokens);let A=R(k,h);return h.hooks&&(A=h.hooks.postprocess(A)),A}catch(k){return w(k)}}}onError(a,i){return s=>{if(s.message+=` +Please report this to https://github.com/markedjs/marked.`,a){const c="

An error occurred:

"+jn(s.message+"",!0)+"
";return i?Promise.resolve(c):c}if(i)return Promise.reject(s);throw s}}},Wr=new Nm;function _e(a,i){return Wr.parse(a,i)}_e.options=_e.setOptions=function(a){return Wr.setOptions(a),_e.defaults=Wr.defaults,nd(_e.defaults),_e};_e.getDefaults=Fa;_e.defaults=Hr;_e.use=function(...a){return Wr.use(...a),_e.defaults=Wr.defaults,nd(_e.defaults),_e};_e.walkTokens=function(a,i){return Wr.walkTokens(a,i)};_e.parseInline=Wr.parseInline;_e.Parser=Jn;_e.parser=Jn.parse;_e.Renderer=Lo;_e.TextRenderer=Ga;_e.Lexer=Zn;_e.lexer=Zn.lex;_e.Tokenizer=No;_e.Hooks=Ro;_e.parse=_e;_e.options;_e.setOptions;_e.use;_e.walkTokens;_e.parseInline;Jn.parse;Zn.lex;const ja={items:[],running:!1,usage:null,streamKind:"",turnEnded:!1,model:""},Lm={approved:"已允许",denied:"已拒绝",timeout:"已超时(按拒绝处理)",cancelled:"已取消"};function Bf(a){switch(a){case"allowed":return"已允许";case"rejected":return"已拒绝";case"expired":return"(已过期)";default:return Lm[a]??a}}function Uf(a,i,s){const c=a.items.slice(),f=c[c.length-1];return a.streamKind===i&&f&&f.kind===i?c[c.length-1]={...f,text:f.text+s}:c.push({kind:i,text:s}),{...a,items:c,streamKind:i}}function Ur(a,i){return{...a,items:[...a.items,i],streamKind:""}}function Wf(a){return a.map(i=>i.kind==="perm"&&i.state==="open"?{...i,state:"expired"}:i)}function Im(a,i,s){const c=a.items.slice();for(let f=c.length-1;f>=0;f--){const h=c[f];if(!(h.kind!=="tool"||h.tcId!==i)){switch(s.kind){case"subagent_tool":{const w=(h.subItems??[]).slice(),v=w.findIndex(k=>k.id===s.id),R={id:s.id??String(w.length),title:s.title??"",status:s.status??"run"};v>=0?w[v]={...R,title:R.title||w[v].title}:w.push(R),c[f]={...h,subItems:w};break}case"output":c[f]={...h,lastLine:s.line};break;case"child_session":c[f]={...h,childSessionId:s.childSessionId};break}return{...a,items:c}}}return a}function zm(a,i){var s,c;switch(i.sessionUpdate){case"agent_message_chunk":return Uf(a,"agent",((s=i.content)==null?void 0:s.text)??"");case"agent_thought_chunk":return Uf(a,"thought",((c=i.content)==null?void 0:c.text)??"");case"tool_call":return Ur(a,{kind:"tool",tcId:i.toolCallId??"",title:i.title||i.kind||"工具调用",status:"run",out:""});case"tool_call_update":{if(i.status==="in_progress")return i.progress?Im(a,i.toolCallId??"",i.progress):a;const f=a.items.slice();for(let h=f.length-1;h>=0;h--){const w=f[h];if(w.kind==="tool"&&w.tcId===i.toolCallId){const v=typeof i.rawOutput=="string"?i.rawOutput.split(` +`)[0].slice(0,160):"";f[h]={...w,status:i.status==="completed"?"ok":"fail",out:v,lastLine:void 0};break}}return{...a,items:f}}case"plan":{const f=a.items.slice();for(let h=f.length-1;h>=0;h--)if(f[h].kind==="plan")return f[h]={kind:"plan",entries:i.entries??[]},{...a,items:f,streamKind:""};return Ur(a,{kind:"plan",entries:i.entries??[]})}case"llm_call_retry":return Ur(a,{kind:"sys",text:`模型调用重试 #${i.attempt??"?"}: ${i.message??""}`});case"usage_update":return{...a,usage:{used:i.used??0,size:i.size??0}};case"compact_status":return Ur(a,{kind:"sys",text:i.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const f=i.model??"";return{...Ur(a,{kind:"sys",text:`模型已切换为 ${f}`}),model:f}}default:return a}}function Pm(a,i){switch(i.type){case"task-started":return{...a,running:!0};case"task-ended":return{...a,running:!1,streamKind:"",turnEnded:!0,items:[...Wf(a.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const s=ai(i);return{...a,running:!1,streamKind:"",items:[...Wf(a.items),{kind:"sys",text:"✗ "+((s==null?void 0:s.error)||"未知错误"),error:!0}]}}case"user-input":{const s=ai(i);let c="";try{c=s!=null&&s.content?Da(s.content):""}catch{c=(s==null?void 0:s.content)??""}return Ur(a,{kind:"user",text:c})}case"permission-req":{const s=ai(i);return s!=null&&s.id?Ur(a,{kind:"perm",id:s.id,title:s.title??"",tool:s.tool??"",state:"open"}):a}case"permission-resolved":{const s=ai(i);return s!=null&&s.id?{...a,items:a.items.map(c=>c.kind==="perm"&&c.id===s.id&&c.state==="open"?{...c,state:s.outcome??"expired"}:c)}:a}case"task-running":if(i.kind==="acp_event"){const s=ai(i);if(s!=null&&s.update)return zm(a,s.update)}return a;default:return a}}function pd(a,i){let s=a;for(const c of i)s=Pm(s,c);return s}function jm(a,i,s){return{...a,items:a.items.map(c=>c.kind==="perm"&&c.id===i&&c.state==="open"?{...c,state:s?"allowed":"rejected"}:c)}}_e.setOptions({gfm:!0,breaks:!0});const Tt="ui-monospace,Menlo,monospace";function Om(a){const i=a.target.closest("a");if(!i)return;a.preventDefault();const s=i.getAttribute("href")||"";/^https?:/i.test(s)&&fh(s)}function Dm({text:a}){const i=Z.useMemo(()=>Yh.sanitize(_e.parse(a,{async:!1})),[a]);return p.jsx("div",{className:"md",onClick:Om,dangerouslySetInnerHTML:{__html:i}})}function Mm({meta:a,active:i,onClick:s}){const c=a.status==="running"?{text:"运行中",color:"var(--amberT)"}:a.status==="error"?{text:"出错",color:"var(--err)"}:a.status==="interrupted"?{text:"已中断",color:"var(--t5)"}:{text:a.turns>0?a.turns+" 轮":"",color:"var(--t5)"};return p.jsx("div",{className:"hv-cardh",title:a.workdir,onClick:s,style:{background:i?"var(--card2)":"transparent",borderRadius:10,padding:"9px 13px",cursor:"pointer"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,fontWeight:i?600:400,color:i?"var(--t1)":"var(--t3)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:a.title||"(未命名)"}),a.worktree&&p.jsx("span",{title:"隔离 worktree 会话",style:{flex:"none",fontSize:10,fontWeight:600,color:"var(--amberT)",background:"var(--amberBg)",borderRadius:5,padding:"1px 6px"},children:"隔离"}),p.jsx("span",{style:{marginLeft:"auto",fontSize:11,fontWeight:400,color:c.color},children:c.text})]})})}function Fm({text:a}){const[i,s]=Z.useState(!1),c=a.trim().split(` +`)[0]||"…";return p.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[p.jsxs("div",{className:"hv-t3",onClick:()=>s(!i),style:{display:"flex",alignItems:"center",gap:9,fontSize:12,color:"var(--t4)",cursor:"pointer",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{flex:"none"},children:"✦ 思考"}),p.jsxs("span",{style:{color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["— ",c]}),p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:i?"▾":"▸"})]}),i&&p.jsx("div",{style:{borderLeft:"2px solid var(--line)",padding:"2px 0 2px 14px",fontSize:12.5,color:"var(--t4)",lineHeight:1.8,whiteSpace:"pre-wrap",animation:"mcin .2s ease"},children:a})]})}function bm({entries:a}){const i=s=>s==="completed"?"☑":s==="in_progress"?"◐":"☐";return p.jsx("div",{style:{border:"1px solid var(--line)",borderRadius:14,background:"var(--card)",padding:"13px 16px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:a.map((s,c)=>p.jsxs("div",{style:{color:s.status==="completed"?"var(--t5)":s.status==="in_progress"?"var(--amberT)":"var(--t3)",textDecoration:s.status==="completed"?"line-through":"none"},children:[p.jsx("span",{style:{display:"inline-block",width:18},children:i(s.status)})," ",s.content]},c))})}function Hf(a){return a==="run"?"◌":a==="ok"?"✓":"✗"}const Vf=5;function Bm({item:a,radius:i,onOpenChild:s}){const c=a.subItems??[],f=c.length-Vf,h=a.title.indexOf(" "),w=h>0?a.title.slice(0,h):"",v=h>0?a.title.slice(h+1):a.title,R={display:"flex",gap:8,alignItems:"baseline",padding:"0 14px 7px 35px",font:"11.5px/1.7 "+Tt,color:"var(--t4)",whiteSpace:"nowrap",minWidth:0};return p.jsxs("div",{style:{background:"var(--card)",borderRadius:i,overflow:"hidden"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"9px 14px",fontSize:12.5,whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:a.status==="run"?"var(--t4)":a.status==="ok"?"var(--ok)":"var(--err)",fontSize:11,flex:"none",display:"inline-block",animation:a.status==="run"?"mcspin 1s linear infinite":"none"},children:Hf(a.status)}),w&&p.jsx("span",{style:{color:"var(--t3)",flex:"none"},children:w}),p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:v}),a.childSessionId&&s&&p.jsx("span",{className:"hv-t1",onClick:()=>s(a.childSessionId),style:{font:"11.5px "+Tt,color:"var(--amberT)",cursor:"pointer",flex:"none"},children:"查看子会话"}),a.out&&p.jsx("span",{style:{marginLeft:"auto",color:"var(--t5)",fontSize:11,flex:"none",maxWidth:"45%",overflow:"hidden",textOverflow:"ellipsis"},children:a.out})]}),f>0&&p.jsxs("div",{style:{...R,color:"var(--t5)"},children:[p.jsx("span",{style:{flex:"none"},children:"↳"}),"… 已省略前 ",f," 步"]}),c.slice(-Vf).map(k=>p.jsxs("div",{style:R,children:[p.jsx("span",{style:{color:"var(--t5)",flex:"none"},children:"↳"}),p.jsx("span",{style:{color:k.status==="run"?"var(--t4)":k.status==="ok"?"var(--ok)":"var(--err)",fontSize:10,flex:"none"},children:Hf(k.status)}),p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:k.title})]},k.id)),a.status==="run"&&a.lastLine&&p.jsxs("div",{style:{...R,display:"block",color:"var(--t5)",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",animation:"mcpulse 1.2s infinite"},children:["↳ ",a.lastLine]})]})}function Qf(a){switch(a){case"allowed":case"approved":return{text:"✓ 已允许",color:"var(--ok)"};case"rejected":case"denied":return{text:"✕ 已拒绝",color:"var(--err)"};case"timeout":return{text:"✕ "+Bf(a),color:"var(--err)"};default:return{text:Bf(a),color:"var(--t5)"}}}function Um({item:a,onAnswer:i}){const s={padding:"7px 18px",background:"var(--card2)",color:"var(--t2)",borderRadius:9,cursor:"pointer"};return p.jsxs("div",{style:{border:"1px solid var(--amberBd)",borderRadius:14,background:"var(--amberBg)",padding:"15px 17px",maxWidth:540,animation:"mcin .25s ease"},children:[p.jsxs("div",{style:{fontSize:13,fontWeight:600,color:"var(--amberT)",whiteSpace:"nowrap"},children:["需要确认 · ",a.tool||"执行操作"]}),p.jsx("div",{style:{margin:"10px 0 12px",padding:"9px 13px",background:"var(--codeBg)",borderRadius:9,font:"12.5px "+Tt,color:"var(--t1)",wordBreak:"break-all"},children:a.title}),a.state==="open"?p.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12.5,fontWeight:600,flexWrap:"wrap"},children:[p.jsx("div",{className:"hv-op",onClick:()=>i(a.id,"allow"),style:{...s,background:"var(--amber)",color:"var(--onAmber)"},children:"允许"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(a.id,"always"),style:s,children:"本会话始终"}),p.jsx("div",{className:"hv-cardh",onClick:()=>i(a.id,"persist"),style:s,children:"此项目永久"}),p.jsx("div",{className:"hv-err",onClick:()=>i(a.id,"deny"),style:{padding:"7px 14px",color:"var(--t4)",borderRadius:9,cursor:"pointer"},children:"拒绝"}),p.jsx("span",{style:{marginLeft:"auto",fontWeight:400,fontSize:11,color:"var(--t5)"},children:"⏎ 允许 · esc 拒绝"})]}):p.jsx("div",{style:{fontSize:12,color:Qf(a.state).color},children:Qf(a.state).text})]})}function Wm({item:a,onPermAnswer:i}){switch(a.kind){case"user":return p.jsx("div",{style:{alignSelf:"flex-end",maxWidth:"70%",background:"var(--card2)",borderRadius:"16px 16px 5px 16px",padding:"10px 16px",color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:a.text});case"agent":return p.jsx("div",{style:{maxWidth:"90%",color:"var(--t2)",wordBreak:"break-word",animation:"mcin .25s ease"},children:p.jsx(Dm,{text:a.text})});case"thought":return p.jsx(Fm,{text:a.text});case"plan":return p.jsx(bm,{entries:a.entries});case"sys":return p.jsx("div",{style:{color:a.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:a.text});case"perm":return p.jsx(Um,{item:a,onAnswer:i})}}function hd({items:a,onPermAnswer:i,onOpenChild:s}){const c=[];for(let f=0;fp.jsx(Bm,{item:k,onOpenChild:s,radius:R===1?"11px":A===0?"11px 11px 4px 4px":A===R-1?"4px 4px 11px 11px":"4px"},k.tcId||A))},"g"+w))}else c.push(p.jsx(Wm,{item:h,onPermAnswer:i},f)),f++}return p.jsx(p.Fragment,{children:c})}function Hm(a){const i=[];let s=0,c=0;for(const f of a.split(` +`)){const h=f.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(h){s=+h[1],c=+h[2],i.push({no:"",text:f,kind:"h"});continue}f.startsWith("diff ")||f.startsWith("index ")||f.startsWith("+++")||f.startsWith("---")||f.startsWith("new file")||f.startsWith("deleted file")||f.startsWith("similarity")||f.startsWith("rename")||f.startsWith("old mode")||f.startsWith("new mode")||(f.startsWith("+")?i.push({no:String(c++),text:f,kind:"add"}):f.startsWith("-")?i.push({no:String(s++),text:f,kind:"del"}):(i.push({no:String(c),text:f,kind:"ctx"}),s++,c++))}return i}function Vm({text:a}){const i=Z.useMemo(()=>Hm(a),[a]);return i.some(s=>s.kind==="h")?p.jsx("div",{style:{font:"12px/1.9 "+Tt},children:i.map((s,c)=>s.kind==="h"?p.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--card)",color:"var(--t4)",fontSize:11},children:[p.jsx("span",{style:{width:36,flex:"none"}}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:s.text})]},c):p.jsxs("div",{style:{display:"flex",padding:"0 24px",background:s.kind==="add"?"var(--addBg)":s.kind==="del"?"var(--delBg)":"transparent",color:s.kind==="add"?"var(--addT)":s.kind==="del"?"var(--delT)":"var(--t3)"},children:[p.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:s.no}),p.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:s.text||" "})]},c))}):p.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:a})}const Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAqiklEQVR42u1dB3xUVfb+3ps+kx5CCB0EEQVlBZUiglRhseEq6toLKLpiZ1fR1cX2d1fXhoKKYGFRRFBUiiIiAgqKIlV6JwkJKZNMy5T3/+59byaTELDsRorv5je/STJvXrnn3FO/c65V44A5frfDak6ByQDmMBnAHCYDmMNkAHOYDGAOkwHMYTKAOUwGMIfJAOYwGcAcJgOYw2QAc5gMYA6TAcxhMoA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4xZqN01l+fqojj51CnIe9v7/JAD9DNWhGl9Laozwawn7iDvYz9byfu31UadGEASbEdyaxCdlWJxqwgCSZ2DXOLdzMRF+go38ccwxwwFY0BoF/TZg1zky6iMcxQ/TfBQMciil+ejPJY5HUOHp2DatPJNLvh7QmA5jDZABzmAxgDpMBzGEygDlMBjCHyQDmMBnAHCYDmMNkAHOYDGAOkwHMYTKAyQDmFJgMYA6TAcxhMoA5TAYwh8kA5jAZwBwmA5jDZABzmAxgDpMBzGEygDlMBjDHsTv+HxbPMt2OHSwMAAAAAElFTkSuQmCC";function Yf(a){const i={};let s=0;for(const c of a.split(` +`)){const f=c.indexOf("=");if(f<=0)continue;const h=c.slice(0,f).trim();h&&(i[h]=c.slice(f+1).trim(),s++)}return s?i:void 0}const Qm=a=>a&&typeof a=="object"?Object.entries(a).map(([i,s])=>`${i}=${String(s)}`).join(` +`):"";function Gm(a){const i={};for(const s of a){const c=s.name.trim();if(c)if(s.type==="stdio"){if(!s.command.trim())continue;const f=s.args.trim()?s.args.trim().split(/\s+/):void 0;i[c]={command:s.command.trim(),args:f,env:Yf(s.kv)}}else{if(!s.url.trim())continue;i[c]={url:s.url.trim(),headers:Yf(s.kv)}}}return i}function Ym(a){return Object.entries(a).map(([i,s])=>{const c=s??{},f=typeof c.command=="string"&&c.command!=="";return{name:i,type:f?"stdio":"http",url:typeof c.url=="string"?c.url:"",command:typeof c.command=="string"?c.command:"",args:Array.isArray(c.args)?c.args.map(String).join(" "):"",kv:Qm(f?c.env:c.headers)}})}const xl={width:588,maxWidth:"100%",background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:18,boxSizing:"border-box"},Xn={width:"100%",background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 11px",font:"11.5px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"},Kf={background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"8px 8px",fontSize:12,color:"var(--t1)",outline:"none",cursor:"pointer"},Ea={padding:"7px 14px",background:"var(--card2)",borderRadius:9,cursor:"pointer",fontSize:12,fontWeight:600,color:"var(--t2)",whiteSpace:"nowrap",userSelect:"none"};function Sn({label:a,children:i}){return p.jsxs("div",{style:{flex:1,minWidth:0},children:[p.jsx("div",{style:{fontSize:11,color:"var(--t4)",marginBottom:4},children:a}),i]})}function Km(){try{return localStorage.getItem("mc.theme")==="light"?"light":"dark"}catch{return"dark"}}function qm(a){document.documentElement.classList.toggle("light",a==="light");try{localStorage.setItem("mc.theme",a)}catch{}}function Xm(){const[a,i]=Z.useState(Km()),s=f=>{qm(f),i(f)},c=(f,h)=>p.jsx("div",{onClick:()=>s(f),style:{padding:"6px 18px",fontSize:12.5,fontWeight:600,borderRadius:8,cursor:"pointer",userSelect:"none",background:a===f?"var(--amber)":"transparent",color:a===f?"var(--onAmber)":"var(--t3)"},children:h});return p.jsxs("div",{style:{display:"inline-flex",background:"var(--card)",borderRadius:10,padding:3,gap:2},children:[c("dark","深色"),c("light","浅色")]})}const qf=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),Zm=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function Jm({onClose:a}){const i=Aa(),[s,c]=Z.useState([]),[f,h]=Z.useState(0),[w,v]=Z.useState([]),[R,k]=Z.useState(!1),[A,M]=Z.useState(""),[N,re]=Z.useState(!1);Z.useEffect(()=>{i&&uh().then(Q=>{const W=(Q==null?void 0:Q.models)??[];c(W.length?W:[qf()]),h(Math.max(0,W.findIndex(q=>q.default))),v(Ym((Q==null?void 0:Q.mcp_servers)??{})),k(!0)}).catch(Q=>M("读取配置失败: "+(Q instanceof Error?Q.message:String(Q))))},[i]);const Y=(Q,W)=>c(q=>q.map((le,he)=>he===Q?{...le,...W}:le)),J=(Q,W)=>v(q=>q.map((le,he)=>he===Q?{...le,...W}:le)),oe=async()=>{for(const W of s)if(!W.name.trim()||!W.base_url.trim()||!W.api_key.trim()||!W.model.trim()){M(`模型「${W.name.trim()||"未命名"}」信息不完整(需名称/接口地址/API Key/模型标识)`);return}const Q=new Set;for(const W of s){if(Q.has(W.name.trim())){M(`模型名称重复: ${W.name.trim()}`);return}Q.add(W.name.trim())}M(""),re(!0);try{await ch({models:s.map((W,q)=>({...W,name:W.name.trim(),default:q===f})),mcp_servers:Gm(w)})}catch(W){M(W instanceof Error?W.message:String(W)),re(!1)}};return p.jsx("div",{style:{flex:1,overflowY:"auto",animation:"mcin .25s ease"},children:p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:14,padding:"40px 24px 60px"},children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center"},children:[p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"设置"}),p.jsx("div",{className:"hv-cardh",onClick:a,style:{...Ea,marginLeft:"auto"},children:"返回"})]}),p.jsx("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"外观"})}),p.jsxs("div",{style:{...xl,display:"flex",alignItems:"center",gap:12},children:[p.jsx(Xm,{}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"跟随本机保存,重启后保持。"})]}),!i&&p.jsx("div",{style:{...xl,color:"var(--t4)",fontSize:12.5,lineHeight:1.7},children:"浏览器模式下配置只读:模型与 MCP 由启动 mc-agent 的宿主(桌面应用或环境变量)管理。"}),i&&!R&&!A&&p.jsx("div",{style:{fontSize:12.5,color:"var(--t5)"},children:"读取配置中…"}),i&&R&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",marginTop:6},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"模型"}),p.jsx("div",{className:"hv-cardh",onClick:()=>c(Q=>[...Q,qf()]),style:{...Ea,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加模型"})]}),s.length===0&&p.jsx("div",{style:{...xl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"还没有模型。保存后应用可运行,但需要添加模型才能开始任务。"}),s.map((Q,W)=>p.jsxs("div",{style:xl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Sn,{label:"名称",children:p.jsx("input",{style:Xn,value:Q.name,placeholder:"如: 主力模型",onChange:q=>Y(W,{name:q.target.value})})}),p.jsx(Sn,{label:"协议",children:p.jsxs("select",{style:{...Kf,width:"100%"},value:Q.provider||"anthropic",onChange:q=>Y(W,{provider:q.target.value}),children:[p.jsx("option",{value:"anthropic",children:"anthropic"}),p.jsx("option",{value:"openai",children:"openai(Chat Completions)"}),p.jsx("option",{value:"openai_responses",children:"openai_responses(Responses)"})]})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:"接口地址",children:p.jsx("input",{style:Xn,value:Q.base_url,placeholder:"https://api.example.com",onChange:q=>Y(W,{base_url:q.target.value})})})}),p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Sn,{label:"API Key",children:p.jsx("input",{style:Xn,type:"password",value:Q.api_key,placeholder:"sk-...",onChange:q=>Y(W,{api_key:q.target.value})})}),p.jsx(Sn,{label:"模型标识",children:p.jsx("input",{style:Xn,value:Q.model,placeholder:"请求中的 model 字段",onChange:q=>Y(W,{model:q.target.value})})})]}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:12,fontSize:12},children:[W===f?p.jsx("span",{style:{color:"var(--amberT)",fontWeight:600},children:"✓ 默认模型"}):p.jsx("span",{className:"hv-t1",style:{color:"var(--t4)",cursor:"pointer"},onClick:()=>h(W),children:"设为默认"}),p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>{c(q=>q.filter((le,he)=>he!==W)),h(q=>Wv(Q=>[...Q,Zm()]),style:{...Ea,marginLeft:"auto",padding:"4px 10px"},children:"+ 添加 MCP"})]}),w.length===0&&p.jsx("div",{style:{...xl,color:"var(--t5)",fontSize:12.5,borderStyle:"dashed"},children:"未配置 MCP 服务器(可选)。项目级 .mc-agent/mcp.json 仍随仓库生效。"}),w.map((Q,W)=>p.jsxs("div",{style:xl,children:[p.jsxs("div",{style:{display:"flex",gap:10},children:[p.jsx(Sn,{label:"名称",children:p.jsx("input",{style:Xn,value:Q.name,placeholder:"如: context7",onChange:q=>J(W,{name:q.target.value})})}),p.jsx(Sn,{label:"类型",children:p.jsxs("select",{style:{...Kf,width:"100%"},value:Q.type,onChange:q=>J(W,{type:q.target.value}),children:[p.jsx("option",{value:"http",children:"HTTP(URL)"}),p.jsx("option",{value:"stdio",children:"stdio(本地命令)"})]})})]}),Q.type==="http"?p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:"URL",children:p.jsx("input",{style:Xn,value:Q.url,placeholder:"https://mcp.example.com/mcp",onChange:q=>J(W,{url:q.target.value})})})}):p.jsxs("div",{style:{display:"flex",gap:10,marginTop:10},children:[p.jsx(Sn,{label:"命令",children:p.jsx("input",{style:Xn,value:Q.command,placeholder:"npx",onChange:q=>J(W,{command:q.target.value})})}),p.jsx(Sn,{label:"参数(空格分隔)",children:p.jsx("input",{style:Xn,value:Q.args,placeholder:"@playwright/mcp",onChange:q=>J(W,{args:q.target.value})})})]}),p.jsx("div",{style:{marginTop:10},children:p.jsx(Sn,{label:Q.type==="http"?"Headers(每行 KEY=VALUE)":"环境变量(每行 KEY=VALUE)",children:p.jsx("textarea",{style:{...Xn,resize:"vertical"},rows:2,value:Q.kv,onChange:q=>J(W,{kv:q.target.value})})})}),p.jsx("div",{style:{display:"flex",marginTop:12,fontSize:12},children:p.jsx("span",{className:"hv-err",style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer"},onClick:()=>v(q=>q.filter((le,he)=>he!==W)),children:"删除"})})]},W)),p.jsxs("div",{style:{width:588,maxWidth:"100%",display:"flex",alignItems:"center",gap:12,marginTop:16},children:[p.jsx("div",{className:"hv-op",onClick:()=>!N&&void oe(),style:{padding:"9px 22px",borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",fontWeight:700,fontSize:13,cursor:"pointer",opacity:N?.5:1,userSelect:"none"},children:N?"保存并重启内核中…":"保存"}),p.jsx("span",{style:{fontSize:12,color:"var(--t5)"},children:"保存后内核自动重启,会话在磁盘不丢失。"})]})]}),A&&p.jsx("div",{style:{width:588,maxWidth:"100%",fontSize:12.5,color:"var(--err)"},children:A})]})})}let md=-1/0;const Ta=a=>{md=a.timeStamp},Ca=a=>a.nativeEvent.isComposing||a.timeStamp-md<100,_a=a=>a>=1e3?Math.round(a/100)/10+"k":String(a),Xf=a=>a.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||a,pi="~/MonkeyCode";function $m(a){var c;const i=new Map;for(const f of a){const h=((c=f.worktree)==null?void 0:c.repo)||f.workdir,w=i.get(h);w?w.push(f):i.set(h,[f])}const s=[...i.entries()].map(([f,h])=>{var w;return h.sort((v,R)=>(R.updated_at??"").localeCompare(v.updated_at??"")),{dir:f,name:f.replace(/[\/\\]+$/,"").split(/[\/\\]/).pop()||f,latest:((w=h[0])==null?void 0:w.updated_at)??"",items:h}});return s.sort((f,h)=>h.latest.localeCompare(f.latest)),s}const wl={width:720,maxWidth:"100%"};function eg(){var Rn,yt,Gt;const[a,i]=Z.useState([]),[s,c]=Z.useState(null),[f,h]=Z.useState("new"),[w,v]=Z.useState(ja),[R,k]=Z.useState("未连接"),[A,M]=Z.useState(null),[N,re]=Z.useState(""),[Y,J]=Z.useState(!1),[oe,Q]=Z.useState(null),[W,q]=Z.useState(""),[le,he]=Z.useState(null),[de,Ee]=Z.useState(""),[Ge,mt]=Z.useState(null),[be,Jt]=Z.useState([]),[Be,et]=Z.useState(""),[ut,Ue]=Z.useState(!1),[Ke,Ne]=Z.useState(null),[F,$]=Z.useState(pi),[U,y]=Z.useState(!1),[L,ae]=Z.useState(""),[ue,me]=Z.useState(""),[ge,xe]=Z.useState(""),[ye,Se]=Z.useState(!1),[tt,Te]=Z.useState(!1),[$n,Ae]=Z.useState(()=>{try{return new Set(JSON.parse(localStorage.getItem("mc.collapsedGroups")||"[]"))}catch{return new Set}}),er=C=>{Ae(b=>{const ce=new Set(b);return ce.has(C)?ce.delete(C):ce.add(C),localStorage.setItem("mc.collapsedGroups",JSON.stringify([...ce])),ce})},fe=Z.useRef(null),$t=Z.useRef(null),On=Z.useRef(null),It=Z.useRef(null),Dn=Z.useRef(!0),Ht=Z.useRef(null),zt=Z.useRef(!1),Pt=Z.useCallback(async()=>{const C=await ih();return i(C),C},[]),ct=Z.useCallback(async()=>{const C=fe.current;if(!C)return[];try{const b=await C.call("repo_file_changes");if(b.error)return re(b.error),M([]),[];re("");const ce=b.result??[];return M(ce),ce}catch(b){return re(b instanceof Error?b.message:String(b)),M([]),[]}},[]),Ct=Z.useCallback((C,b)=>{var ce;(ce=fe.current)==null||ce.close(),c(C),h("session"),v(ja),M(null),re(""),J(!1),Q(null),Ue(!1),he(null),et(b??""),localStorage.setItem("mc.lastSession",C),fe.current=Jf(C,{onFrames:Le=>v(Ot=>pd(Ot,Le)),onStatus:Le=>k(Le)}),Pt()},[Pt]);Z.useEffect(()=>{const C=dh("open-settings",()=>h("settings"));return Promise.all([oh().catch(()=>[]),Pt()]).then(([b,ce])=>{var hn;Jt(b),ae(((hn=b.find(en=>en.default))==null?void 0:hn.name)??"");const Le=localStorage.getItem("mc.lastSession"),Ot=ce.find(en=>en.id===Le);Ot&&Ct(Ot.id,Ot.model),b.length===0&&Aa()&&h("settings")}).catch(b=>k("无法连接服务: "+(b instanceof Error?b.message:b))),()=>{var b;C(),(b=fe.current)==null||b.close()}},[]),Z.useEffect(()=>{w.model&&et(w.model)},[w.model]);const Vt=((Rn=[...a].sort((C,b)=>(b.updated_at??"").localeCompare(C.updated_at??""))[0])==null?void 0:Rn.workdir)??"";Z.useEffect(()=>{zt.current||$(Vt||pi)},[Vt]);const En=R.startsWith("已连接");Z.useEffect(()=>{var b;if(!En)return;ct();const C=Ht.current;C&&((b=fe.current)!=null&&b.send("user-input",{content:mi(C)}))&&(Ht.current=null)},[En,ct]),Z.useEffect(()=>{w.turnEnded&&(v(C=>({...C,turnEnded:!1})),ct(),Pt())},[w.turnEnded,ct,Pt]),Z.useEffect(()=>{var C;w.running||!le||(C=fe.current)!=null&&C.send("user-input",{content:mi(le)})&&he(null)},[w.running,le]),Z.useEffect(()=>{const C=$t.current;C&&Dn.current&&(C.scrollTop=C.scrollHeight)},[w.items,w.running]),Z.useEffect(()=>{const C=On.current;C&&(C.style.height="auto",C.style.height=Math.min(C.scrollHeight,160)+"px")},[W]);const Mn=()=>{const C=$t.current;C&&(Dn.current=C.scrollHeight-C.scrollTop-C.clientHeight<40)},un=()=>{const C=W.trim();if(!(!C||!fe.current)){if(w.running){he(C),q("");return}fe.current.send("user-input",{content:mi(C)})&&q("")}},Tn=(C,b)=>{var Le;const ce=b!=="deny";(Le=fe.current)!=null&&Le.send("permission-resp",{id:C,approved:ce,remember:b==="always"||b==="persist",persist:b==="persist"})&&v(Ot=>jm(Ot,C,ce))},jt=async C=>{if(Ue(!1),!(!fe.current||!C||C===Be))try{const b=await fe.current.call("session_set_model",{model:C});if(b.error){k("⚠ 切换模型失败: "+b.error);return}et(C),Pt()}catch(b){k("⚠ 切换模型失败: "+(b instanceof Error?b.message:b))}},Qt=async C=>{var b;Q({path:C,text:"加载中…"});try{const ce=await fe.current.call("repo_file_diff",{path:C});Q({path:C,text:ce.error?"✗ "+ce.error:((b=ce.result)==null?void 0:b.diff)||"(无差异)"})}catch(ce){Q({path:C,text:"✗ "+(ce instanceof Error?ce.message:ce)})}},tr=()=>{J(!0),ct().then(C=>{C.length?Qt(C[0].path):Q(null)})},Fn=async(C=!1)=>{const b=F.trim();if(!(!b||tt)){Te(!0),xe(""),Se(!1);try{const ce=await sh(b,L,C||b===pi),Le=ue.trim();Le&&(Ht.current=Le),me(""),await Pt(),Ct(ce.id,ce.model)}catch(ce){const Le=ce instanceof Error?ce.message:String(ce);xe("创建失败: "+Le),Le.includes("目录不存在")&&Se(!0)}finally{Te(!1)}}},Tr=async()=>{const C=await ah();C&&(zt.current=!0,$(C),xe(""),Se(!1))},cn=a.find(C=>C.id===s),fn=Be||((yt=be.find(C=>C.default))==null?void 0:yt.name)||"",bn=Be&&!be.some(C=>C.name===Be)?[...be,{name:Be,default:!1}]:be,gt=w.usage,qe=[...w.items].reverse().find(C=>C.kind==="perm"&&C.state==="open"),Bn=w.items.some(C=>C.kind==="tool"&&C.status==="run"),dn=qe?"等待权限确认":Bn?"执行中":"思考中",pn=Math.max(1,w.items.filter(C=>C.kind==="user").length),Cn=de.trim().toLowerCase(),nr=(Cn?a.filter(C=>(C.title||"").toLowerCase().includes(Cn)||C.workdir.toLowerCase().includes(Cn)):a).slice().sort((C,b)=>(b.updated_at??"").localeCompare(C.updated_at??"")),_n=f==="new"||s===null;return Z.useEffect(()=>{const C=b=>{var ce;if((b.metaKey||b.ctrlKey)&&b.key.toLowerCase()==="k"){b.preventDefault(),(ce=It.current)==null||ce.focus();return}if(b.key==="Escape"){if(ut)return Ue(!1);if(Ge)return mt(null);if(Y)return J(!1);if(f==="settings")return h(s?"session":"new");qe&&Tn(qe.id,"deny");return}if(b.key==="Enter"&&!b.isComposing&&qe&&!_n){const Le=b.target;if(Le&&(Le.tagName==="TEXTAREA"||Le.tagName==="INPUT")&&W.trim())return;b.preventDefault(),Tn(qe.id,"allow")}};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)}),p.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",background:"var(--bg)",color:"var(--t2)",fontSize:13.5,overflow:"hidden",position:"relative"},children:[p.jsxs("div",{style:{width:292,flex:"none",display:"flex",flexDirection:"column",background:"var(--side)",borderRight:"1px solid var(--line)",minWidth:0},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"20px 18px 14px"},children:[p.jsx("img",{src:Gf,alt:"",draggable:!1,style:{width:28,height:28,borderRadius:9,flex:"none"}}),p.jsx("div",{style:{fontWeight:700,fontSize:14.5,color:"var(--t1)",letterSpacing:"-.01em"},children:"MonkeyCode"})]}),p.jsx("div",{style:{padding:"0 14px 12px"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,background:"var(--card)",borderRadius:9,padding:"0 11px"},children:[p.jsx("span",{style:{color:"var(--t4)",fontSize:12},children:"⌕"}),p.jsx("input",{ref:It,value:de,onChange:C=>Ee(C.target.value),placeholder:"搜索会话",style:{flex:1,background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:12.5,padding:"8px 0",minWidth:0}}),p.jsx("span",{style:{font:"10px "+Tt,color:"var(--t5)"},children:"⌘K"})]})}),p.jsxs("div",{style:{padding:"0 14px",flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 8px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"云端任务"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"跑在服务器"})]}),p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有云端任务。长任务可以派发到服务器上跑,关掉客户端也会继续。"})]}),p.jsx("div",{style:{padding:"16px 14px 0",flex:"none"},children:p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 4px 6px",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"600 10.5px system-ui",color:"var(--t4)",letterSpacing:".1em"},children:"本地会话"}),p.jsx("span",{style:{marginLeft:6,font:"400 10.5px system-ui",color:"var(--t5)"},children:"这台电脑"}),p.jsx("span",{className:"hv-cardh",title:"新建任务",onClick:()=>{h("new"),Ue(!1)},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",userSelect:"none"},children:"+"})]})}),p.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 14px"},children:[a.length===0&&p.jsx("div",{style:{border:"1px dashed var(--line)",borderRadius:11,padding:"14px 13px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:"还没有会话。在右侧输入第一个任务开始。"}),a.length>0&&nr.length===0&&p.jsxs("div",{style:{padding:"2px 4px",fontSize:11.5,color:"var(--t5)",lineHeight:1.7},children:["没有匹配「",de.trim(),"」的会话。"]}),$m(nr).map(C=>p.jsxs("div",{style:{marginBottom:12},children:[p.jsxs("div",{title:C.dir,onClick:()=>er(C.dir),onMouseEnter:()=>Ne(C.dir),onMouseLeave:()=>Ne(null),style:{display:"flex",alignItems:"center",gap:7,padding:"5px 6px 5px 4px",cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{width:10,flex:"none",fontSize:9,color:"var(--t5)"},children:$n.has(C.dir)?"▶":"▼"}),p.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:C.name}),p.jsx("span",{style:{fontSize:10.5,color:"var(--t5)"},children:C.items.length}),p.jsx("span",{className:"hv-t1",title:"在 "+C.dir+" 新建会话",onClick:b=>{b.stopPropagation(),zt.current=!0,$(C.dir),y(!1),h("new")},style:{marginLeft:"auto",width:20,height:20,borderRadius:6,background:"var(--card2)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:"var(--t3)",cursor:"pointer",visibility:Ke===C.dir?"visible":"hidden"},children:"+"})]}),!$n.has(C.dir)&&p.jsx("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:8,paddingLeft:7,borderLeft:"1px solid var(--line)"},children:C.items.map(b=>p.jsx(Mm,{meta:b,active:b.id===s&&f==="session",onClick:()=>Ct(b.id,b.model)},b.id))})]},C.dir))]}),p.jsxs("div",{style:{padding:"14px 18px",display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",borderTop:"1px solid var(--line)",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:En?"var(--ok)":"var(--t5)",flex:"none"}}),p.jsx("span",{title:R,style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:R}),p.jsx("span",{className:"hv-t1",title:"设置",onClick:()=>{Ue(!1),h("settings")},style:{marginLeft:"auto",cursor:"pointer",fontSize:15},children:"⚙"})]})]}),p.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:f==="settings"?p.jsx(Jm,{onClose:()=>h(s?"session":"new")}):_n?p.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:22,animation:"mcin .25s ease",padding:"0 24px"},children:[a.length===0?p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,marginBottom:2},children:[p.jsx("img",{src:Gf,alt:"",draggable:!1,style:{width:52,height:52,borderRadius:16}}),p.jsx("div",{style:{fontSize:20,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"把第一个任务交给 MonkeyCode"}),p.jsxs("div",{style:{fontSize:13,color:"var(--t4)",maxWidth:460,textAlign:"center",lineHeight:1.7},children:["描述你想做的事。工作目录"," ",p.jsx("span",{style:{font:"12px "+Tt,color:"var(--t3)"},children:F||pi})," ","已自动准备好,也可以换成你的项目目录。"]})]}):p.jsx("div",{style:{fontSize:18,fontWeight:700,color:"var(--t1)",letterSpacing:"-.01em"},children:"开始一个新任务"}),p.jsxs("div",{style:{display:"flex",gap:12,maxWidth:"100%",flexWrap:"wrap",justifyContent:"center"},children:[p.jsxs("div",{style:{width:288,border:"1px solid var(--amberBd)",borderRadius:16,background:"var(--amberBg)",padding:20,boxSizing:"border-box"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--amberT)",whiteSpace:"nowrap"},children:["⌂ 本地",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--amberBg)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"默认 ⏎"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在这台电脑上,直接读写本地文件;每步权限逐一确认。"}),U?p.jsx("input",{value:F,autoFocus:!0,onChange:C=>{zt.current=!0,$(C.target.value),xe(""),Se(!1)},onCompositionEnd:Ta,onKeyDown:C=>C.key==="Enter"&&!Ca(C)&&y(!1),onBlur:()=>y(!1),placeholder:"/home/you/dev/project",style:{width:"100%",marginTop:12,background:"var(--codeBg)",border:"1px solid var(--line)",borderRadius:9,padding:"7px 10px",font:"11px "+Tt,color:"var(--t1)",outline:"none",minWidth:0,boxSizing:"border-box"}}):p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:12,font:"11px "+Tt,color:"var(--t5)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{color:"var(--t3)",overflow:"hidden",textOverflow:"ellipsis"},children:F}),F===pi&&p.jsx("span",{style:{flex:"none"},children:"· 自动创建"}),p.jsx("span",{className:"hv-t1",onClick:()=>y(!0),style:{marginLeft:"auto",cursor:"pointer",flex:"none",font:"12px system-ui"},children:"更改"}),Aa()&&p.jsx("span",{className:"hv-t1",onClick:()=>void Tr(),style:{cursor:"pointer",flex:"none",font:"12px system-ui"},children:"浏览…"})]})]}),p.jsxs("div",{style:{width:288,border:"1px solid var(--line)",borderRadius:16,background:"var(--card)",padding:20,boxSizing:"border-box",opacity:.7},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:14,fontWeight:700,color:"var(--t1)",whiteSpace:"nowrap"},children:["☁ 云端",p.jsx("span",{style:{marginLeft:"auto",fontSize:10,background:"var(--card2)",color:"var(--t4)",borderRadius:5,padding:"2px 8px",fontWeight:600},children:"即将上线"})]}),p.jsx("div",{style:{fontSize:12,color:"var(--t3)",lineHeight:1.7,marginTop:10},children:"Agent 跑在云上服务器,关掉客户端也继续;完成后打包改动回来审查。"}),p.jsxs("div",{style:{display:"flex",font:"11px "+Tt,color:"var(--t5)",marginTop:12,whiteSpace:"nowrap"},children:["需要连接平台",p.jsx("span",{style:{marginLeft:"auto"},children:"长任务推荐"})]})]})]}),ge&&p.jsxs("div",{style:{...wl,width:588,fontSize:12,color:"var(--err)"},children:[ge,ye&&p.jsx("span",{className:"hv-op",onClick:()=>void Fn(!0),style:{cursor:"pointer",color:"var(--amberT)",marginLeft:8},children:"创建该目录并继续 →"})]}),p.jsxs("div",{style:{...wl,width:588,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("input",{value:ue,autoFocus:!0,onChange:C=>me(C.target.value),onCompositionEnd:Ta,onKeyDown:C=>C.key==="Enter"&&!Ca(C)&&void Fn(),placeholder:"描述任务…(可留空,先建会话)",style:{width:"100%",background:"none",border:"none",outline:"none",color:"var(--t1)",fontSize:13.5,boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:12,fontSize:12,color:"var(--t5)"},children:[be.length>1?p.jsx("select",{value:L,onChange:C=>ae(C.target.value),style:{background:"transparent",border:"none",outline:"none",color:"var(--t4)",fontSize:12,cursor:"pointer"},children:be.map(C=>p.jsxs("option",{value:C.name,children:[C.name,C.default?"(默认)":""]},C.name))}):p.jsx("span",{children:((Gt=be[0])==null?void 0:Gt.name)??""}),p.jsx("div",{className:"hv-op",onClick:()=>void Fn(),style:{marginLeft:"auto",width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:tt?.5:1},children:"↑"})]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 24px",height:56,flex:"none"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,fontWeight:600,color:"var(--t1)",whiteSpace:"nowrap",minWidth:0},children:[p.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:(cn==null?void 0:cn.title)||"(未命名)"}),p.jsxs("span",{style:{font:"400 11px "+Tt,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:["⌂ ",(cn==null?void 0:cn.workdir)??""]})]}),p.jsxs("div",{className:"hv-card",title:"查看本轮文件改动",onClick:tr,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:8,cursor:"pointer",whiteSpace:"nowrap",fontSize:12,color:"var(--t3)",flex:"none",userSelect:"none"},children:[p.jsx("span",{style:{color:"var(--amberT)"},children:"⇄"})," 改动",A&&A.length>0?` · ${A.length}`:""]})]}),p.jsx("div",{style:{height:1,background:"var(--line)",margin:"0 24px",flex:"none"}}),p.jsx("div",{ref:$t,onScroll:Mn,style:{flex:1,overflowY:"auto",display:"flex",justifyContent:"center"},children:p.jsx("div",{style:{...wl,maxWidth:"calc(100% - 48px)",padding:"28px 0 16px",display:"flex",flexDirection:"column",gap:18,lineHeight:1.8,height:"fit-content"},children:p.jsx(hd,{items:w.items,onPermAnswer:Tn,onOpenChild:mt})})}),w.running&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{...wl,display:"flex",alignItems:"center",gap:10,fontSize:12.5,color:"var(--t3)",padding:"2px 0",boxSizing:"border-box"},children:[p.jsx("span",{style:{width:12,height:12,border:"2px solid var(--amber)",borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .8s linear infinite",flex:"none"}}),dn,p.jsxs("span",{style:{color:"var(--t5)"},children:["· 第 ",pn," 轮",gt?` · 已用 ${_a(gt.used)} tokens`:""]}),p.jsx("span",{className:"hv-cardh",onClick:()=>{var C;return(C=fe.current)==null?void 0:C.send("user-cancel",{})},style:{marginLeft:"auto",padding:"5px 13px",background:"var(--card2)",borderRadius:8,color:"var(--err)",cursor:"pointer",fontWeight:600,whiteSpace:"nowrap"},children:"■ 停止"})]})}),le&&p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 8px",flex:"none"},children:p.jsxs("div",{style:{...wl,display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",background:"var(--card)",borderRadius:10,padding:"7px 13px",boxSizing:"border-box"},children:[p.jsx("span",{style:{animation:"mcpulse 1.2s infinite"},children:"⏳"}),"已排队:",p.jsx("span",{style:{color:"var(--t2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:le}),p.jsx("span",{style:{marginLeft:"auto",whiteSpace:"nowrap"},children:"运行结束后自动发送"}),p.jsx("span",{className:"hv-err",onClick:()=>he(null),style:{cursor:"pointer",color:"var(--t5)"},children:"✕"})]})}),p.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"0 24px 20px",flex:"none"},children:p.jsxs("div",{style:{...wl,background:"var(--card)",border:"1px solid var(--line)",borderRadius:16,padding:"13px 16px"},children:[p.jsx("textarea",{ref:On,rows:1,value:W,placeholder:w.running?"补充说明…运行中发送会排队":"输入任务…",onChange:C=>q(C.target.value),onCompositionEnd:Ta,onKeyDown:C=>{C.key==="Enter"&&!C.shiftKey&&!Ca(C)&&(C.preventDefault(),un())},style:{width:"100%",background:"none",border:"none",outline:"none",resize:"none",color:"var(--t1)",fontSize:13.5,lineHeight:1.6,maxHeight:160,padding:0,display:"block",boxSizing:"border-box"}}),p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12,fontSize:12,color:"var(--t5)"},children:[p.jsx("span",{children:"⏎ 发送 · ⇧⏎ 换行"}),p.jsxs("div",{style:{marginLeft:"auto",position:"relative",flex:"none"},children:[p.jsxs("div",{className:w.running?void 0:"hv-card2",title:w.running?"轮次执行中,结束后可切换":"切换本会话模型(下一轮生效)",onClick:()=>!w.running&&Ue(!ut),style:{padding:"4px 9px",borderRadius:7,cursor:w.running?"default":"pointer",whiteSpace:"nowrap",fontSize:11.5,color:w.running?"var(--t5)":"var(--t4)",userSelect:"none"},children:[fn||"模型"," ▾"]}),ut&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{position:"fixed",inset:0,zIndex:29},onClick:()=>Ue(!1)}),p.jsx("div",{style:{position:"absolute",bottom:32,right:0,width:220,background:"var(--pop)",border:"1px solid var(--line)",borderRadius:12,boxShadow:"var(--shadow)",padding:6,zIndex:30,animation:"mcin .15s ease"},children:bn.map(C=>p.jsxs("div",{className:"hv-card",onClick:()=>void jt(C.name),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 11px",borderRadius:8,cursor:"pointer",fontSize:12.5,color:C.name===fn?"var(--amberT)":"var(--t2)",fontWeight:C.name===fn?600:400,whiteSpace:"nowrap"},children:[C.name,p.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--t5)",fontWeight:400},children:C.default?"默认":""})]},C.name))})]})]}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)"},children:gt?`${_a(gt.used)} / ${_a(gt.size)}`:""}),p.jsx("div",{className:"hv-op",onClick:un,title:"发送",style:{width:30,height:30,borderRadius:9,background:"var(--amber)",color:"var(--onAmber)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,cursor:"pointer",opacity:W.trim()?1:.4},children:"↑"})]})]})})]})}),Y&&p.jsxs(p.Fragment,{children:[p.jsx("div",{onClick:()=>J(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,.3)",zIndex:35}}),p.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,width:600,maxWidth:"80vw",background:"var(--pop)",borderLeft:"1px solid var(--line)",boxShadow:"var(--shadow)",zIndex:36,display:"flex",flexDirection:"column",animation:"mcslide .22s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 20px 12px",flex:"none",whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:13.5,fontWeight:700,color:"var(--t1)"},children:["改动",A&&A.length>0?` · ${A.length} 个文件`:""]}),p.jsx("span",{className:"hv-t1",onClick:()=>J(!1),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--err)"},children:N}),A&&A.length===0&&!N&&p.jsx("div",{style:{padding:"10px 20px",fontSize:12,color:"var(--t5)"},children:"无改动(或非 git 仓库)"}),A&&A.length>0&&p.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5,padding:"0 20px 12px",flex:"none"},children:A.map(C=>{const b=(oe==null?void 0:oe.path)===C.path;return p.jsxs("div",{className:"hv-cardh",onClick:()=>void Qt(C.path),style:{display:"flex",alignItems:"center",gap:7,background:b?"var(--card2)":"transparent",border:"1px solid var(--line)",borderRadius:9,padding:"6px 11px",cursor:"pointer",whiteSpace:"nowrap"},children:[p.jsx("span",{style:{font:"700 11px "+Tt,color:C.status==="A"?"var(--ok)":C.status==="D"?"var(--err)":"var(--amberT)"},children:C.status}),p.jsx("span",{style:{font:"11.5px "+Tt,color:b?"var(--t1)":"var(--t3)"},children:Xf(C.path)})]},C.path)})}),oe&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 20px",borderTop:"1px solid var(--line)",flex:"none",whiteSpace:"nowrap",overflow:"hidden"},children:[p.jsx("span",{style:{font:"12.5px "+Tt,color:"var(--t1)"},children:Xf(oe.path)}),p.jsx("span",{style:{fontSize:11,color:"var(--t5)",overflow:"hidden",textOverflow:"ellipsis"},children:oe.path})]}),p.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 0 20px"},children:p.jsx(Vm,{text:oe.text})})]})]})]}),Ge&&p.jsx("div",{onClick:()=>mt(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,.45)",zIndex:40,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsxs("div",{onClick:C=>C.stopPropagation(),style:{width:"min(860px, 92vw)",maxHeight:"84vh",background:"var(--pop)",border:"1px solid var(--line)",borderRadius:20,boxShadow:"var(--shadow)",padding:"22px 24px",display:"flex",flexDirection:"column",overflow:"hidden",animation:"mcin .2s ease"},children:[p.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:12,whiteSpace:"nowrap"},children:[p.jsxs("span",{style:{fontSize:15,fontWeight:700,color:"var(--t1)",overflow:"hidden",textOverflow:"ellipsis"},children:["子代理会话 ",Ge]}),p.jsx("span",{className:"hv-t1",onClick:()=>mt(null),style:{marginLeft:"auto",color:"var(--t4)",cursor:"pointer",fontSize:14},children:"✕"})]}),p.jsx(tg,{id:Ge})]})})]})}function tg({id:a}){const[i,s]=Z.useState(ja),[c,f]=Z.useState("连接中…");return Z.useEffect(()=>{const h=Jf(a,{onFrames:w=>s(v=>pd(v,w)),onStatus:w=>f(w)});return()=>h.close()},[a]),p.jsxs("div",{style:{overflowY:"auto",flex:1,paddingRight:6,display:"flex",flexDirection:"column",gap:14,lineHeight:1.8},children:[p.jsx("div",{style:{color:"var(--t4)",fontSize:12},children:c}),p.jsx(hd,{items:i.items,onPermAnswer:()=>{}})]})}lh.createRoot(document.getElementById("root")).render(p.jsx(Z.StrictMode,{children:p.jsx(eg,{})})); diff --git a/agent/ui/src/client.ts b/agent/ui/src/client.ts index 4a89051d..be23d8a8 100644 --- a/agent/ui/src/client.ts +++ b/agent/ui/src/client.ts @@ -96,6 +96,16 @@ export async function saveHostConfig(config: HostConfig): Promise { await tauri.core.invoke("save_config", { config }); } +/** 在系统浏览器打开外部链接:壳内经 opener 插件,浏览器模式开新标签页。 */ +export function openExternal(url: string): void { + const tauri = (window as { __TAURI__?: TauriGlobal }).__TAURI__; + if (tauri?.core?.invoke) { + tauri.core.invoke("plugin:opener|open_url", { url }).catch(() => {}); + } else { + window.open(url, "_blank", "noopener,noreferrer"); + } +} + /** 订阅壳事件(如托盘"设置"),返回退订函数;非壳环境为空操作。 */ export function onHostEvent(name: string, cb: () => void): () => void { const tauri = (window as { __TAURI__?: TauriGlobal }).__TAURI__; diff --git a/agent/ui/src/components.tsx b/agent/ui/src/components.tsx index e14db46e..4bcf832a 100644 --- a/agent/ui/src/components.tsx +++ b/agent/ui/src/components.tsx @@ -2,7 +2,8 @@ // 样式值取自「MonkeyCode 原型(离线版)」的内联样式,逐一对应,不另行发挥。 import DOMPurify from "dompurify"; import { marked } from "marked"; -import { useMemo, useState, type ReactElement } from "react"; +import { useMemo, useState, type MouseEvent as ReactMouseEvent, type ReactElement } from "react"; +import { openExternal } from "./client"; import { permStateLabel } from "./reduce"; import type { LogItem, PlanEntry, SessionMeta } from "./types"; @@ -10,10 +11,20 @@ marked.setOptions({ gfm: true, breaks: true }); export const MONO = "ui-monospace,Menlo,monospace"; +/** 正文里的链接一律不走 webview 导航(WKWebView 里点
会把应用页面跳走): + * http(s) 交系统浏览器/新标签页,其余协议直接拦下。 */ +function onMarkdownClick(e: ReactMouseEvent) { + const a = (e.target as HTMLElement).closest("a"); + if (!a) return; + e.preventDefault(); + const href = a.getAttribute("href") || ""; + if (/^https?:/i.test(href)) openExternal(href); +} + /** agent 正文按 Markdown 渲染(净化后注入);流式期间随批次重渲染 */ export function Markdown({ text }: { text: string }) { const html = useMemo(() => DOMPurify.sanitize(marked.parse(text, { async: false }) as string), [text]); - return
; + return
; } /** 侧栏会话行:名称 + 右侧状态/轮数(时间无信息量,不展示) */ diff --git a/mc-desktop/Cargo.lock b/mc-desktop/Cargo.lock index 88339f53..1e9499b3 100644 --- a/mc-desktop/Cargo.lock +++ b/mc-desktop/Cargo.lock @@ -56,6 +56,137 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "atk" version = "0.18.2" @@ -151,6 +282,19 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "brotli" version = "8.0.4" @@ -346,6 +490,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "cookie" version = "0.18.1" @@ -727,6 +880,33 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -754,6 +934,27 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "2.4.1" @@ -885,6 +1086,19 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.32" @@ -1239,6 +1453,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + [[package]] name = "hex" version = "0.4.3" @@ -1546,6 +1766,25 @@ version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "itoa" version = "1.0.18" @@ -1799,6 +2038,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-dialog", + "tauri-plugin-opener", "tauri-plugin-updater", ] @@ -2162,6 +2402,17 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +[[package]] +name = "open" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0b3d059e795d52b8a72fef45658620edd4d9c359b338564aa14391ffa511ed5" +dependencies = [ + "dunce", + "is-wsl", + "libc", +] + [[package]] name = "openssl-probe" version = "0.2.1" @@ -2174,6 +2425,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "osakit" version = "0.3.1" @@ -2213,6 +2474,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.5" @@ -2301,6 +2568,17 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.33" @@ -2346,6 +2624,20 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + [[package]] name = "potential_utf" version = "0.1.5" @@ -3026,6 +3318,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + [[package]] name = "simd-adler32" version = "0.3.9" @@ -3471,6 +3773,28 @@ dependencies = [ "url", ] +[[package]] +name = "tauri-plugin-opener" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17e1bea14edce6b793a04e2417e3fd924b9bc4faae83cdee7d714156cceeed29" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.18", + "url", + "windows", + "zbus", +] + [[package]] name = "tauri-plugin-updater" version = "2.10.1" @@ -3930,9 +4254,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "tracing-core" version = "0.1.36" @@ -3982,6 +4318,17 @@ version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + [[package]] name = "unic-char-property" version = "0.9.0" @@ -4907,6 +5254,67 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zbus" +version = "5.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28b97f866896a4be7aefd2b5a8e01bb6773d19a775d54ab28b4d094b9a4480e" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.3", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e05ad887425eecf5e8384dc2406a4a9313eb73468712fc1cdea362eb4fe0469" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.118", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039ca249fee9559680f3a9f05b55e0761fee51af4f6c1e7d8c1f31e549721d2" +dependencies = [ + "serde", + "winnow 1.0.3", + "zvariant", +] + [[package]] name = "zerofrom" version = "0.1.8" @@ -4984,3 +5392,43 @@ name = "zmij" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd2f034a4bebf216c9e4b7083603e024cf930873fd67830cfb083c9fa33129d9" + +[[package]] +name = "zvariant" +version = "5.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cf057bb00bf5c9ad77abb6147b0ca4818236a1858416e9d988e40d6322fefa7" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow 1.0.3", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8118ca6bda77bfc0ab51d660db0c955f2505eef854c9a449435bccb616933b31" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.118", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90cb9383f9b45290407a1258b202d3f8f01db719eb60b4e4055c6375af4fc7c7" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 2.0.118", + "winnow 1.0.3", +] diff --git a/mc-desktop/Cargo.toml b/mc-desktop/Cargo.toml index e4ea4db9..e42849b5 100644 --- a/mc-desktop/Cargo.toml +++ b/mc-desktop/Cargo.toml @@ -14,6 +14,7 @@ getrandom = "0.2" serde = { version = "1", features = ["derive"] } serde_json = "1" tauri-plugin-dialog = "2" +tauri-plugin-opener = "2" tauri-plugin-updater = "2" [profile.release] diff --git a/mc-desktop/src/main.rs b/mc-desktop/src/main.rs index efbfaacc..02ca3579 100644 --- a/mc-desktop/src/main.rs +++ b/mc-desktop/src/main.rs @@ -271,9 +271,27 @@ fn show_kernel_ui(app: &AppHandle, url: &str) { let _ = win.show(); let _ = win.set_focus(); } else { + let opener = app.clone(); let mut builder = WebviewWindowBuilder::new(app, "main", WebviewUrl::External(parsed)) .title("MonkeyCode") - .inner_size(1200.0, 800.0); + .inner_size(1200.0, 800.0) + // 导航守卫:webview 只许待在内核 UI(loopback)与壳自带页面; + // 其余导航(对话里的外部链接等)一律拒绝并交系统浏览器, + // 防止应用被"跳走"后无法返回。UI 侧已拦截点击,这里是兜底。 + .on_navigation(move |url| { + let internal = match url.scheme() { + "tauri" => true, // 壳自带页面(错误页) + "http" | "https" => { + matches!(url.host_str(), Some("127.0.0.1" | "localhost" | "tauri.localhost")) + } + _ => false, + }; + if !internal { + use tauri_plugin_opener::OpenerExt; + let _ = opener.opener().open_url(url.as_str(), None::<&str>); + } + internal + }); // 无头冒烟探针:页面加载后自动走一遍 远程页→IPC→壳配置 链路, // 结果经本地回环上报(无头环境唯一可靠的回读通道) if std::env::var("MC_DESKTOP_IPC_PROBE").is_ok() { @@ -286,6 +304,9 @@ fn show_kernel_ui(app: &AppHandle, url: &str) { window.__TAURI__.core.invoke('get_config') \ .then(() => report('invoke-ok')) \ .catch((e) => report('invoke-err:' + String(e).slice(0, 80))); \ + /* 导航守卫:外域跳转应被拒;页面存活才能发出 1 秒后的上报 */ \ + setTimeout(() => { location.href = 'https://nav-guard.invalid/x'; }, 1000); \ + setTimeout(() => report('nav-guard-ok'), 2000); \ }, 3000);", ); } @@ -311,6 +332,7 @@ fn main() { eprintln!("[mc-desktop] main 进入"); tauri::Builder::default() .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_updater::Builder::new().build()) .manage(Kernel(Mutex::new(None))) .manage(TrayReady(AtomicBool::new(true))) diff --git a/mc-desktop/tauri.conf.json b/mc-desktop/tauri.conf.json index 1410d790..5d60b25a 100644 --- a/mc-desktop/tauri.conf.json +++ b/mc-desktop/tauri.conf.json @@ -36,7 +36,8 @@ "core:default", "allow-get-config", "allow-save-config", - "dialog:allow-open" + "dialog:allow-open", + "opener:allow-open-url" ] } ]