repoburg 1.3.266 → 1.3.268
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-pane/backend/dist/index.js +781 -111
- package/agent-pane/backend/dist/server.js +39624 -38951
- package/agent-pane/frontend/dist/assets/index-CGMuuJwp.css +1 -0
- package/agent-pane/frontend/dist/assets/index-DJdEb4sk.js +567 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/daemon/dist/agentPane.js +5 -0
- package/daemon/dist/agentPane.spec.js +16 -2
- package/daemon/dist/index.js +8 -0
- package/package.json +1 -1
- package/tabtape/extension/dist/build-info.json +3 -3
- package/tabtape/extension/dist/manifest.json +1 -1
- package/tabtape/ui/dist/build-info.json +3 -3
- package/agent-pane/frontend/dist/assets/index-BWI1sdtn.js +0 -532
- package/agent-pane/frontend/dist/assets/index-CsD8SrgL.css +0 -1
|
@@ -1,532 +0,0 @@
|
|
|
1
|
-
var hy=Object.defineProperty;var my=(n,s,r)=>s in n?hy(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var lt=(n,s,r)=>my(n,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();function xm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qc={exports:{}},qi={},Kc={exports:{}},We={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Lp;function gy(){if(Lp)return We;Lp=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),k=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=k&&R[k]||R["@@iterator"],typeof R=="function"?R:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function b(R,_,X){this.props=R,this.context=_,this.refs=C,this.updater=X||T}b.prototype.isReactComponent={},b.prototype.setState=function(R,_){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,_,"setState")},b.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function M(){}M.prototype=b.prototype;function I(R,_,X){this.props=R,this.context=_,this.refs=C,this.updater=X||T}var W=I.prototype=new M;W.constructor=I,E(W,b.prototype),W.isPureReactComponent=!0;var O=Array.isArray,B=Object.prototype.hasOwnProperty,K={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function q(R,_,X){var se,Se={},be=null,Le=null;if(_!=null)for(se in _.ref!==void 0&&(Le=_.ref),_.key!==void 0&&(be=""+_.key),_)B.call(_,se)&&!G.hasOwnProperty(se)&&(Se[se]=_[se]);var je=arguments.length-2;if(je===1)Se.children=X;else if(1<je){for(var De=Array(je),xe=0;xe<je;xe++)De[xe]=arguments[xe+2];Se.children=De}if(R&&R.defaultProps)for(se in je=R.defaultProps,je)Se[se]===void 0&&(Se[se]=je[se]);return{$$typeof:n,type:R,key:be,ref:Le,props:Se,_owner:K.current}}function le(R,_){return{$$typeof:n,type:R.type,key:_,ref:R.ref,props:R.props,_owner:R._owner}}function de(R){return typeof R=="object"&&R!==null&&R.$$typeof===n}function me(R){var _={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(X){return _[X]})}var fe=/\/+/g;function pe(R,_){return typeof R=="object"&&R!==null&&R.key!=null?me(""+R.key):_.toString(36)}function Me(R,_,X,se,Se){var be=typeof R;(be==="undefined"||be==="boolean")&&(R=null);var Le=!1;if(R===null)Le=!0;else switch(be){case"string":case"number":Le=!0;break;case"object":switch(R.$$typeof){case n:case s:Le=!0}}if(Le)return Le=R,Se=Se(Le),R=se===""?"."+pe(Le,0):se,O(Se)?(X="",R!=null&&(X=R.replace(fe,"$&/")+"/"),Me(Se,_,X,"",function(xe){return xe})):Se!=null&&(de(Se)&&(Se=le(Se,X+(!Se.key||Le&&Le.key===Se.key?"":(""+Se.key).replace(fe,"$&/")+"/")+R)),_.push(Se)),1;if(Le=0,se=se===""?".":se+":",O(R))for(var je=0;je<R.length;je++){be=R[je];var De=se+pe(be,je);Le+=Me(be,_,X,De,Se)}else if(De=x(R),typeof De=="function")for(R=De.call(R),je=0;!(be=R.next()).done;)be=be.value,De=se+pe(be,je++),Le+=Me(be,_,X,De,Se);else if(be==="object")throw _=String(R),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.");return Le}function Z(R,_,X){if(R==null)return R;var se=[],Se=0;return Me(R,se,"","",function(be){return _.call(X,be,Se++)}),se}function re(R){if(R._status===-1){var _=R._result;_=_(),_.then(function(X){(R._status===0||R._status===-1)&&(R._status=1,R._result=X)},function(X){(R._status===0||R._status===-1)&&(R._status=2,R._result=X)}),R._status===-1&&(R._status=0,R._result=_)}if(R._status===1)return R._result.default;throw R._result}var ce={current:null},P={transition:null},ee={ReactCurrentDispatcher:ce,ReactCurrentBatchConfig:P,ReactCurrentOwner:K};function H(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:Z,forEach:function(R,_,X){Z(R,function(){_.apply(this,arguments)},X)},count:function(R){var _=0;return Z(R,function(){_++}),_},toArray:function(R){return Z(R,function(_){return _})||[]},only:function(R){if(!de(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},We.Component=b,We.Fragment=r,We.Profiler=a,We.PureComponent=I,We.StrictMode=o,We.Suspense=m,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,We.act=H,We.cloneElement=function(R,_,X){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var se=E({},R.props),Se=R.key,be=R.ref,Le=R._owner;if(_!=null){if(_.ref!==void 0&&(be=_.ref,Le=K.current),_.key!==void 0&&(Se=""+_.key),R.type&&R.type.defaultProps)var je=R.type.defaultProps;for(De in _)B.call(_,De)&&!G.hasOwnProperty(De)&&(se[De]=_[De]===void 0&&je!==void 0?je[De]:_[De])}var De=arguments.length-2;if(De===1)se.children=X;else if(1<De){je=Array(De);for(var xe=0;xe<De;xe++)je[xe]=arguments[xe+2];se.children=je}return{$$typeof:n,type:R.type,key:Se,ref:be,props:se,_owner:Le}},We.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:u,_context:R},R.Consumer=R},We.createElement=q,We.createFactory=function(R){var _=q.bind(null,R);return _.type=R,_},We.createRef=function(){return{current:null}},We.forwardRef=function(R){return{$$typeof:h,render:R}},We.isValidElement=de,We.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:re}},We.memo=function(R,_){return{$$typeof:g,type:R,compare:_===void 0?null:_}},We.startTransition=function(R){var _=P.transition;P.transition={};try{R()}finally{P.transition=_}},We.unstable_act=H,We.useCallback=function(R,_){return ce.current.useCallback(R,_)},We.useContext=function(R){return ce.current.useContext(R)},We.useDebugValue=function(){},We.useDeferredValue=function(R){return ce.current.useDeferredValue(R)},We.useEffect=function(R,_){return ce.current.useEffect(R,_)},We.useId=function(){return ce.current.useId()},We.useImperativeHandle=function(R,_,X){return ce.current.useImperativeHandle(R,_,X)},We.useInsertionEffect=function(R,_){return ce.current.useInsertionEffect(R,_)},We.useLayoutEffect=function(R,_){return ce.current.useLayoutEffect(R,_)},We.useMemo=function(R,_){return ce.current.useMemo(R,_)},We.useReducer=function(R,_,X){return ce.current.useReducer(R,_,X)},We.useRef=function(R){return ce.current.useRef(R)},We.useState=function(R){return ce.current.useState(R)},We.useSyncExternalStore=function(R,_,X){return ce.current.useSyncExternalStore(R,_,X)},We.useTransition=function(){return ce.current.useTransition()},We.version="18.3.1",We}var Pp;function zu(){return Pp||(Pp=1,Kc.exports=gy()),Kc.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Op;function vy(){if(Op)return qi;Op=1;var n=zu(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,m,g){var y,k={},x=null,T=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(T=m.ref);for(y in m)o.call(m,y)&&!u.hasOwnProperty(y)&&(k[y]=m[y]);if(h&&h.defaultProps)for(y in m=h.defaultProps,m)k[y]===void 0&&(k[y]=m[y]);return{$$typeof:s,type:h,key:x,ref:T,props:k,_owner:a.current}}return qi.Fragment=r,qi.jsx=f,qi.jsxs=f,qi}var zp;function yy(){return zp||(zp=1,qc.exports=vy()),qc.exports}var c=yy(),w=zu();const it=xm(w);var Nl={},Xc={exports:{}},En={},Yc={exports:{}},Qc={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var $p;function xy(){return $p||($p=1,(function(n){function s(P,ee){var H=P.length;P.push(ee);e:for(;0<H;){var R=H-1>>>1,_=P[R];if(0<a(_,ee))P[R]=ee,P[H]=_,H=R;else break e}}function r(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var ee=P[0],H=P.pop();if(H!==ee){P[0]=H;e:for(var R=0,_=P.length,X=_>>>1;R<X;){var se=2*(R+1)-1,Se=P[se],be=se+1,Le=P[be];if(0>a(Se,H))be<_&&0>a(Le,Se)?(P[R]=Le,P[be]=H,R=be):(P[R]=Se,P[se]=H,R=se);else if(be<_&&0>a(Le,H))P[R]=Le,P[be]=H,R=be;else break e}}return ee}function a(P,ee){var H=P.sortIndex-ee.sortIndex;return H!==0?H:P.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],g=[],y=1,k=null,x=3,T=!1,E=!1,C=!1,b=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function W(P){for(var ee=r(g);ee!==null;){if(ee.callback===null)o(g);else if(ee.startTime<=P)o(g),ee.sortIndex=ee.expirationTime,s(m,ee);else break;ee=r(g)}}function O(P){if(C=!1,W(P),!E)if(r(m)!==null)E=!0,re(B);else{var ee=r(g);ee!==null&&ce(O,ee.startTime-P)}}function B(P,ee){E=!1,C&&(C=!1,M(q),q=-1),T=!0;var H=x;try{for(W(ee),k=r(m);k!==null&&(!(k.expirationTime>ee)||P&&!me());){var R=k.callback;if(typeof R=="function"){k.callback=null,x=k.priorityLevel;var _=R(k.expirationTime<=ee);ee=n.unstable_now(),typeof _=="function"?k.callback=_:k===r(m)&&o(m),W(ee)}else o(m);k=r(m)}if(k!==null)var X=!0;else{var se=r(g);se!==null&&ce(O,se.startTime-ee),X=!1}return X}finally{k=null,x=H,T=!1}}var K=!1,G=null,q=-1,le=5,de=-1;function me(){return!(n.unstable_now()-de<le)}function fe(){if(G!==null){var P=n.unstable_now();de=P;var ee=!0;try{ee=G(!0,P)}finally{ee?pe():(K=!1,G=null)}}else K=!1}var pe;if(typeof I=="function")pe=function(){I(fe)};else if(typeof MessageChannel<"u"){var Me=new MessageChannel,Z=Me.port2;Me.port1.onmessage=fe,pe=function(){Z.postMessage(null)}}else pe=function(){b(fe,0)};function re(P){G=P,K||(K=!0,pe())}function ce(P,ee){q=b(function(){P(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(P){P.callback=null},n.unstable_continueExecution=function(){E||T||(E=!0,re(B))},n.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<P?Math.floor(1e3/P):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return r(m)},n.unstable_next=function(P){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var H=x;x=ee;try{return P()}finally{x=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(P,ee){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var H=x;x=P;try{return ee()}finally{x=H}},n.unstable_scheduleCallback=function(P,ee,H){var R=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?R+H:R):H=R,P){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=H+_,P={id:y++,callback:ee,priorityLevel:P,startTime:H,expirationTime:_,sortIndex:-1},H>R?(P.sortIndex=H,s(g,P),r(m)===null&&P===r(g)&&(C?(M(q),q=-1):C=!0,ce(O,H-R))):(P.sortIndex=_,s(m,P),E||T||(E=!0,re(B))),P},n.unstable_shouldYield=me,n.unstable_wrapCallback=function(P){var ee=x;return function(){var H=x;x=ee;try{return P.apply(this,arguments)}finally{x=H}}}})(Qc)),Qc}var Fp;function wy(){return Fp||(Fp=1,Yc.exports=xy()),Yc.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Up;function ky(){if(Up)return En;Up=1;var n=zu(),s=wy();function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y={},k={};function x(e){return m.call(k,e)?!0:m.call(y,e)?!1:g.test(e)?k[e]=!0:(y[e]=!0,!1)}function T(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,i,l){if(t===null||typeof t>"u"||T(e,t,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,i,l,d,p,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=v}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function I(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(M,I);b[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(M,I);b[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(M,I);b[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function W(e,t,i,l){var d=b.hasOwnProperty(t)?b[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(E(t,i,d,l)&&(i=null),l||d===null?x(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var O=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),K=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),le=Symbol.for("react.profiler"),de=Symbol.for("react.provider"),me=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),pe=Symbol.for("react.suspense"),Me=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ce=Symbol.for("react.offscreen"),P=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,R;function _(e){if(R===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);R=t&&t[1]||""}return`
|
|
34
|
-
`+R+e}var X=!1;function se(e,t){if(!e||X)return"";X=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(U){var l=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){l=U}e.call(t.prototype)}else{try{throw Error()}catch(U){l=U}e()}}catch(U){if(U&&l&&typeof U.stack=="string"){for(var d=U.stack.split(`
|
|
35
|
-
`),p=l.stack.split(`
|
|
36
|
-
`),v=d.length-1,N=p.length-1;1<=v&&0<=N&&d[v]!==p[N];)N--;for(;1<=v&&0<=N;v--,N--)if(d[v]!==p[N]){if(v!==1||N!==1)do if(v--,N--,0>N||d[v]!==p[N]){var A=`
|
|
37
|
-
`+d[v].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),A}while(1<=v&&0<=N);break}}}finally{X=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?_(e):""}function Se(e){switch(e.tag){case 5:return _(e.type);case 16:return _("Lazy");case 13:return _("Suspense");case 19:return _("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function be(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 G:return"Fragment";case K:return"Portal";case le:return"Profiler";case q:return"StrictMode";case pe:return"Suspense";case Me:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case me:return(e.displayName||"Context")+".Consumer";case de:return(e._context.displayName||"Context")+".Provider";case fe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:be(e.type)||"Memo";case re:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}function Le(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 be(t);case 8:return t===q?"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 je(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function De(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xe(e){var t=De(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function at(e){e._valueTracker||(e._valueTracker=xe(e))}function Pe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=De(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function ht(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 $e(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function mt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=je(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function He(e,t){t=t.checked,t!=null&&W(e,"checked",t,!1)}function Mt(e,t){He(e,t);var i=je(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ot(e,t.type,i):t.hasOwnProperty("defaultValue")&&ot(e,t.type,je(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nn(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function ot(e,t,i){(t!=="number"||ht(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var gt=Array.isArray;function Ot(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+je(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function V(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function we(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(r(92));if(gt(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:je(i)}}function Fe(e,t){var i=je(t.value),l=je(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function qe(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ct,Yt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ct=ct||document.createElement("div"),ct.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ct.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var dt={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},Xn=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(e){Xn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dt[t]=dt[e]})});function Fn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||dt.hasOwnProperty(e)&&dt[e]?(""+t).trim():t+"px"}function jn(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Fn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Yn=H({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 wn(e,t){if(t){if(Yn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!="object")throw Error(r(62))}}function Rn(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 un=null;function dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zt=null,kn=null,st=null;function kt(e){if(e=Ii(e)){if(typeof zt!="function")throw Error(r(280));var t=e.stateNode;t&&(t=Fo(t),zt(e.stateNode,e.type,t))}}function j(e){kn?st?st.push(e):st=[e]:kn=e}function ae(){if(kn){var e=kn,t=st;if(st=kn=null,kt(e),t)for(e=0;e<t.length;e++)kt(t[e])}}function te(e,t){return e(t)}function ue(){}var Ee=!1;function Ue(e,t,i){if(Ee)return e(t,i);Ee=!0;try{return te(e,t,i)}finally{Ee=!1,(kn!==null||st!==null)&&(ue(),ae())}}function ve(e,t){var i=e.stateNode;if(i===null)return null;var l=Fo(i);if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,t,typeof i));return i}var Qe=!1;if(h)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){Qe=!0}}),window.addEventListener("test",rt,rt),window.removeEventListener("test",rt,rt)}catch{Qe=!1}function xt(e,t,i,l,d,p,v,N,A){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(J){this.onError(J)}}var jt=!1,Bt=null,Rt=!1,Wt=null,sn={onError:function(e){jt=!0,Bt=e}};function tt(e,t,i,l,d,p,v,N,A){jt=!1,Bt=null,xt.apply(sn,arguments)}function At(e,t,i,l,d,p,v,N,A){if(tt.apply(this,arguments),jt){if(jt){var U=Bt;jt=!1,Bt=null}else throw Error(r(198));Rt||(Rt=!0,Wt=U)}}function Be(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function vs(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function xo(e){if(Be(e)!==e)throw Error(r(188))}function wo(e){var t=e.alternate;if(!t){if(t=Be(e),t===null)throw Error(r(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return xo(d),e;if(p===l)return xo(d),t;p=p.sibling}throw Error(r(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,N=d.child;N;){if(N===i){v=!0,i=d,l=p;break}if(N===l){v=!0,l=d,i=p;break}N=N.sibling}if(!v){for(N=p.child;N;){if(N===i){v=!0,i=p,l=d;break}if(N===l){v=!0,l=p,i=d;break}N=N.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function br(e){return e=wo(e),e!==null?pi(e):null}function pi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pi(e);if(t!==null)return t;e=e.sibling}return null}var hi=s.unstable_scheduleCallback,ko=s.unstable_cancelCallback,va=s.unstable_shouldYield,ya=s.unstable_requestPaint,St=s.unstable_now,ls=s.unstable_getCurrentPriorityLevel,Is=s.unstable_ImmediatePriority,as=s.unstable_UserBlockingPriority,Nr=s.unstable_NormalPriority,tr=s.unstable_LowPriority,So=s.unstable_IdlePriority,nr=null,An=null;function Cr(e){if(An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(nr,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:sr,Er=Math.log,Ds=Math.LN2;function sr(e){return e>>>=0,e===0?32:31-(Er(e)/Ds|0)|0}var pn=64,_r=4194304;function rr(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 ir(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,v=i&268435455;if(v!==0){var N=v&~d;N!==0?l=rr(N):(p&=v,p!==0&&(l=rr(p)))}else v=i&~d,v!==0?l=rr(v):p!==0&&(l=rr(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-fn(t),d=1<<i,l|=e[i],t&=~d;return l}function To(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-fn(p),N=1<<v,A=d[v];A===-1?((N&i)===0||(N&l)!==0)&&(d[v]=To(N,t)):A<=t&&(e.expiredLanes|=N),p&=~N}}function mi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gi(){var e=pn;return pn<<=1,(pn&4194240)===0&&(pn=64),e}function vi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function or(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=i}function No(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-fn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ms(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-fn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ke=0;function ie(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,z,Y,ke,_e,ze=!1,Xe=[],Ze=null,Tt=null,bt=null,ys=new Map,It=new Map,Ls=[],Pg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function vd(e,t){switch(e){case"focusin":case"focusout":Ze=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":ys.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function yi(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=Ii(t),t!==null&&z(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Og(e,t,i,l,d){switch(t){case"focusin":return Ze=yi(Ze,e,t,i,l,d),!0;case"dragenter":return Tt=yi(Tt,e,t,i,l,d),!0;case"mouseover":return bt=yi(bt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return ys.set(p,yi(ys.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,It.set(p,yi(It.get(p)||null,e,t,i,l,d)),!0}return!1}function yd(e){var t=lr(e.target);if(t!==null){var i=Be(t);if(i!==null){if(t=i.tag,t===13){if(t=vs(i),t!==null){e.blockedOn=t,_e(e.priority,function(){Y(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);un=l,i.target.dispatchEvent(l),un=null}else return t=Ii(i),t!==null&&z(t),e.blockedOn=i,!1;t.shift()}return!0}function xd(e,t,i){Co(e)&&i.delete(t)}function zg(){ze=!1,Ze!==null&&Co(Ze)&&(Ze=null),Tt!==null&&Co(Tt)&&(Tt=null),bt!==null&&Co(bt)&&(bt=null),ys.forEach(xd),It.forEach(xd)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,ze||(ze=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,zg)))}function wi(e){function t(d){return xi(d,e)}if(0<Xe.length){xi(Xe[0],e);for(var i=1;i<Xe.length;i++){var l=Xe[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Ze!==null&&xi(Ze,e),Tt!==null&&xi(Tt,e),bt!==null&&xi(bt,e),ys.forEach(t),It.forEach(t),i=0;i<Ls.length;i++)l=Ls[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ls.length&&(i=Ls[0],i.blockedOn===null);)yd(i),i.blockedOn===null&&Ls.shift()}var jr=O.ReactCurrentBatchConfig,Eo=!0;function $g(e,t,i,l){var d=Ke,p=jr.transition;jr.transition=null;try{Ke=1,xa(e,t,i,l)}finally{Ke=d,jr.transition=p}}function Fg(e,t,i,l){var d=Ke,p=jr.transition;jr.transition=null;try{Ke=4,xa(e,t,i,l)}finally{Ke=d,jr.transition=p}}function xa(e,t,i,l){if(Eo){var d=wa(e,t,i,l);if(d===null)Oa(e,t,l,_o,i),vd(e,l);else if(Og(d,e,t,i,l))l.stopPropagation();else if(vd(e,l),t&4&&-1<Pg.indexOf(e)){for(;d!==null;){var p=Ii(d);if(p!==null&&S(p),p=wa(e,t,i,l),p===null&&Oa(e,t,l,_o,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Oa(e,t,l,null,i)}}var _o=null;function wa(e,t,i,l){if(_o=null,e=dn(l),e=lr(e),e!==null)if(t=Be(e),t===null)e=null;else if(i=t.tag,i===13){if(e=vs(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return _o=e,null}function wd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ls()){case Is:return 1;case as:return 4;case Nr:case tr:return 16;case So:return 536870912;default:return 16}default:return 16}}var Ps=null,ka=null,jo=null;function kd(){if(jo)return jo;var e,t=ka,i=t.length,l,d="value"in Ps?Ps.value:Ps.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var v=i-e;for(l=1;l<=v&&t[i-l]===d[p-l];l++);return jo=d.slice(e,1<l?1-l:void 0)}function Ro(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ao(){return!0}function Sd(){return!1}function In(e){function t(i,l,d,p,v){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ao:Sd,this.isPropagationStopped=Sd,this}return H(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ao)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ao)},persist:function(){},isPersistent:Ao}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sa=In(Rr),ki=H({},Rr,{view:0,detail:0}),Ug=In(ki),Ta,ba,Si,Io=H({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ca,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Si&&(Si&&e.type==="mousemove"?(Ta=e.screenX-Si.screenX,ba=e.screenY-Si.screenY):ba=Ta=0,Si=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:ba}}),Td=In(Io),Bg=H({},Io,{dataTransfer:0}),Wg=In(Bg),Hg=H({},ki,{relatedTarget:0}),Na=In(Hg),Vg=H({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Gg=In(Vg),qg=H({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kg=In(qg),Xg=H({},Rr,{data:0}),bd=In(Xg),Yg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Zg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zg[e])?!!t[e]:!1}function Ca(){return Jg}var ev=H({},ki,{key:function(e){if(e.key){var t=Yg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ro(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ca,charCode:function(e){return e.type==="keypress"?Ro(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ro(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tv=In(ev),nv=H({},Io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nd=In(nv),sv=H({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ca}),rv=In(sv),iv=H({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ov=In(iv),lv=H({},Io,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),av=In(lv),cv=[9,13,27,32],Ea=h&&"CompositionEvent"in window,Ti=null;h&&"documentMode"in document&&(Ti=document.documentMode);var uv=h&&"TextEvent"in window&&!Ti,Cd=h&&(!Ea||Ti&&8<Ti&&11>=Ti),Ed=" ",_d=!1;function jd(e,t){switch(e){case"keyup":return cv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function dv(e,t){switch(e){case"compositionend":return Rd(t);case"keypress":return t.which!==32?null:(_d=!0,Ed);case"textInput":return e=t.data,e===Ed&&_d?null:e;default:return null}}function fv(e,t){if(Ar)return e==="compositionend"||!Ea&&jd(e,t)?(e=kd(),jo=ka=Ps=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cd&&t.locale!=="ko"?null:t.data;default:return null}}var pv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pv[e.type]:t==="textarea"}function Id(e,t,i,l){j(l),t=Oo(t,"onChange"),0<t.length&&(i=new Sa("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var bi=null,Ni=null;function hv(e){Yd(e,0)}function Do(e){var t=Pr(e);if(Pe(t))return e}function mv(e,t){if(e==="change")return t}var Dd=!1;if(h){var _a;if(h){var ja="oninput"in document;if(!ja){var Md=document.createElement("div");Md.setAttribute("oninput","return;"),ja=typeof Md.oninput=="function"}_a=ja}else _a=!1;Dd=_a&&(!document.documentMode||9<document.documentMode)}function Ld(){bi&&(bi.detachEvent("onpropertychange",Pd),Ni=bi=null)}function Pd(e){if(e.propertyName==="value"&&Do(Ni)){var t=[];Id(t,Ni,e,dn(e)),Ue(hv,t)}}function gv(e,t,i){e==="focusin"?(Ld(),bi=t,Ni=i,bi.attachEvent("onpropertychange",Pd)):e==="focusout"&&Ld()}function vv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Do(Ni)}function yv(e,t){if(e==="click")return Do(t)}function xv(e,t){if(e==="input"||e==="change")return Do(t)}function wv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:wv;function Ci(e,t){if(Qn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(t,d)||!Qn(e[d],t[d]))return!1}return!0}function Od(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zd(e,t){var i=Od(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Od(i)}}function $d(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$d(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fd(){for(var e=window,t=ht();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ht(e.document)}return t}function Ra(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 kv(e){var t=Fd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&$d(i.ownerDocument.documentElement,i)){if(l!==null&&Ra(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=zd(i,p);var v=zd(i,l);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Sv=h&&"documentMode"in document&&11>=document.documentMode,Ir=null,Aa=null,Ei=null,Ia=!1;function Ud(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ia||Ir==null||Ir!==ht(l)||(l=Ir,"selectionStart"in l&&Ra(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ei&&Ci(Ei,l)||(Ei=l,l=Oo(Aa,"onSelect"),0<l.length&&(t=new Sa("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Ir)))}function Mo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Dr={animationend:Mo("Animation","AnimationEnd"),animationiteration:Mo("Animation","AnimationIteration"),animationstart:Mo("Animation","AnimationStart"),transitionend:Mo("Transition","TransitionEnd")},Da={},Bd={};h&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),"TransitionEvent"in window||delete Dr.transitionend.transition);function Lo(e){if(Da[e])return Da[e];if(!Dr[e])return e;var t=Dr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Bd)return Da[e]=t[i];return e}var Wd=Lo("animationend"),Hd=Lo("animationiteration"),Vd=Lo("animationstart"),Gd=Lo("transitionend"),qd=new Map,Kd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Os(e,t){qd.set(e,t),u(t,[e])}for(var Ma=0;Ma<Kd.length;Ma++){var La=Kd[Ma],Tv=La.toLowerCase(),bv=La[0].toUpperCase()+La.slice(1);Os(Tv,"on"+bv)}Os(Wd,"onAnimationEnd"),Os(Hd,"onAnimationIteration"),Os(Vd,"onAnimationStart"),Os("dblclick","onDoubleClick"),Os("focusin","onFocus"),Os("focusout","onBlur"),Os(Gd,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _i="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nv=new Set("cancel close invalid load scroll toggle".split(" ").concat(_i));function Xd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,At(l,t,void 0,e),e.currentTarget=null}function Yd(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var p=void 0;if(t)for(var v=l.length-1;0<=v;v--){var N=l[v],A=N.instance,U=N.currentTarget;if(N=N.listener,A!==p&&d.isPropagationStopped())break e;Xd(d,N,U),p=A}else for(v=0;v<l.length;v++){if(N=l[v],A=N.instance,U=N.currentTarget,N=N.listener,A!==p&&d.isPropagationStopped())break e;Xd(d,N,U),p=A}}}if(Rt)throw e=Wt,Rt=!1,Wt=null,e}function ft(e,t){var i=t[Wa];i===void 0&&(i=t[Wa]=new Set);var l=e+"__bubble";i.has(l)||(Qd(t,e,2,!1),i.add(l))}function Pa(e,t,i){var l=0;t&&(l|=4),Qd(i,e,l,t)}var Po="_reactListening"+Math.random().toString(36).slice(2);function ji(e){if(!e[Po]){e[Po]=!0,o.forEach(function(i){i!=="selectionchange"&&(Nv.has(i)||Pa(i,!1,e),Pa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Po]||(t[Po]=!0,Pa("selectionchange",!1,t))}}function Qd(e,t,i,l){switch(wd(t)){case 1:var d=$g;break;case 4:d=Fg;break;default:d=xa}i=d.bind(null,t,i,e),d=void 0,!Qe||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Oa(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var A=v.tag;if((A===3||A===4)&&(A=v.stateNode.containerInfo,A===d||A.nodeType===8&&A.parentNode===d))return;v=v.return}for(;N!==null;){if(v=lr(N),v===null)return;if(A=v.tag,A===5||A===6){l=p=v;continue e}N=N.parentNode}}l=l.return}Ue(function(){var U=p,J=dn(i),ne=[];e:{var Q=qd.get(e);if(Q!==void 0){var he=Sa,ye=e;switch(e){case"keypress":if(Ro(i)===0)break e;case"keydown":case"keyup":he=tv;break;case"focusin":ye="focus",he=Na;break;case"focusout":ye="blur",he=Na;break;case"beforeblur":case"afterblur":he=Na;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Td;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Wg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=rv;break;case Wd:case Hd:case Vd:he=Gg;break;case Gd:he=ov;break;case"scroll":he=Ug;break;case"wheel":he=av;break;case"copy":case"cut":case"paste":he=Kg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Nd}var Te=(t&4)!==0,Dt=!Te&&e==="scroll",$=Te?Q!==null?Q+"Capture":null:Q;Te=[];for(var D=U,F;D!==null;){F=D;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,$!==null&&(oe=ve(D,$),oe!=null&&Te.push(Ri(D,oe,F)))),Dt)break;D=D.return}0<Te.length&&(Q=new he(Q,ye,null,i,J),ne.push({event:Q,listeners:Te}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",Q&&i!==un&&(ye=i.relatedTarget||i.fromElement)&&(lr(ye)||ye[xs]))break e;if((he||Q)&&(Q=J.window===J?J:(Q=J.ownerDocument)?Q.defaultView||Q.parentWindow:window,he?(ye=i.relatedTarget||i.toElement,he=U,ye=ye?lr(ye):null,ye!==null&&(Dt=Be(ye),ye!==Dt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(he=null,ye=U),he!==ye)){if(Te=Td,oe="onMouseLeave",$="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Nd,oe="onPointerLeave",$="onPointerEnter",D="pointer"),Dt=he==null?Q:Pr(he),F=ye==null?Q:Pr(ye),Q=new Te(oe,D+"leave",he,i,J),Q.target=Dt,Q.relatedTarget=F,oe=null,lr(J)===U&&(Te=new Te($,D+"enter",ye,i,J),Te.target=F,Te.relatedTarget=Dt,oe=Te),Dt=oe,he&&ye)t:{for(Te=he,$=ye,D=0,F=Te;F;F=Mr(F))D++;for(F=0,oe=$;oe;oe=Mr(oe))F++;for(;0<D-F;)Te=Mr(Te),D--;for(;0<F-D;)$=Mr($),F--;for(;D--;){if(Te===$||$!==null&&Te===$.alternate)break t;Te=Mr(Te),$=Mr($)}Te=null}else Te=null;he!==null&&Zd(ne,Q,he,Te,!1),ye!==null&&Dt!==null&&Zd(ne,Dt,ye,Te,!0)}}e:{if(Q=U?Pr(U):window,he=Q.nodeName&&Q.nodeName.toLowerCase(),he==="select"||he==="input"&&Q.type==="file")var Ne=mv;else if(Ad(Q))if(Dd)Ne=xv;else{Ne=vv;var Ae=gv}else(he=Q.nodeName)&&he.toLowerCase()==="input"&&(Q.type==="checkbox"||Q.type==="radio")&&(Ne=yv);if(Ne&&(Ne=Ne(e,U))){Id(ne,Ne,i,J);break e}Ae&&Ae(e,Q,U),e==="focusout"&&(Ae=Q._wrapperState)&&Ae.controlled&&Q.type==="number"&&ot(Q,"number",Q.value)}switch(Ae=U?Pr(U):window,e){case"focusin":(Ad(Ae)||Ae.contentEditable==="true")&&(Ir=Ae,Aa=U,Ei=null);break;case"focusout":Ei=Aa=Ir=null;break;case"mousedown":Ia=!0;break;case"contextmenu":case"mouseup":case"dragend":Ia=!1,Ud(ne,i,J);break;case"selectionchange":if(Sv)break;case"keydown":case"keyup":Ud(ne,i,J)}var Ie;if(Ea)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ar?jd(e,i)&&(Oe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Oe="onCompositionStart");Oe&&(Cd&&i.locale!=="ko"&&(Ar||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ar&&(Ie=kd()):(Ps=J,ka="value"in Ps?Ps.value:Ps.textContent,Ar=!0)),Ae=Oo(U,Oe),0<Ae.length&&(Oe=new bd(Oe,e,null,i,J),ne.push({event:Oe,listeners:Ae}),Ie?Oe.data=Ie:(Ie=Rd(i),Ie!==null&&(Oe.data=Ie)))),(Ie=uv?dv(e,i):fv(e,i))&&(U=Oo(U,"onBeforeInput"),0<U.length&&(J=new bd("onBeforeInput","beforeinput",null,i,J),ne.push({event:J,listeners:U}),J.data=Ie))}Yd(ne,t)})}function Ri(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Oo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=ve(e,i),p!=null&&l.unshift(Ri(e,p,d)),p=ve(e,t),p!=null&&l.push(Ri(e,p,d))),e=e.return}return l}function Mr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var N=i,A=N.alternate,U=N.stateNode;if(A!==null&&A===l)break;N.tag===5&&U!==null&&(N=U,d?(A=ve(i,p),A!=null&&v.unshift(Ri(i,A,N))):d||(A=ve(i,p),A!=null&&v.push(Ri(i,A,N)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var Cv=/\r\n?/g,Ev=/\u0000|\uFFFD/g;function Jd(e){return(typeof e=="string"?e:""+e).replace(Cv,`
|
|
38
|
-
`).replace(Ev,"")}function zo(e,t,i){if(t=Jd(t),Jd(e)!==t&&i)throw Error(r(425))}function $o(){}var za=null,$a=null;function Fa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ua=typeof setTimeout=="function"?setTimeout:void 0,_v=typeof clearTimeout=="function"?clearTimeout:void 0,ef=typeof Promise=="function"?Promise:void 0,jv=typeof queueMicrotask=="function"?queueMicrotask:typeof ef<"u"?function(e){return ef.resolve(null).then(e).catch(Rv)}:Ua;function Rv(e){setTimeout(function(){throw e})}function Ba(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),wi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);wi(t)}function zs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var Lr=Math.random().toString(36).slice(2),cs="__reactFiber$"+Lr,Ai="__reactProps$"+Lr,xs="__reactContainer$"+Lr,Wa="__reactEvents$"+Lr,Av="__reactListeners$"+Lr,Iv="__reactHandles$"+Lr;function lr(e){var t=e[cs];if(t)return t;for(var i=e.parentNode;i;){if(t=i[xs]||i[cs]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=tf(e);e!==null;){if(i=e[cs])return i;e=tf(e)}return t}e=i,i=e.parentNode}return null}function Ii(e){return e=e[cs]||e[xs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Pr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Fo(e){return e[Ai]||null}var Ha=[],Or=-1;function $s(e){return{current:e}}function pt(e){0>Or||(e.current=Ha[Or],Ha[Or]=null,Or--)}function ut(e,t){Or++,Ha[Or]=e.current,e.current=t}var Fs={},rn=$s(Fs),Sn=$s(!1),ar=Fs;function zr(e,t){var i=e.type.contextTypes;if(!i)return Fs;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Tn(e){return e=e.childContextTypes,e!=null}function Uo(){pt(Sn),pt(rn)}function nf(e,t,i){if(rn.current!==Fs)throw Error(r(168));ut(rn,t),ut(Sn,i)}function sf(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(r(108,Le(e)||"Unknown",d));return H({},i,l)}function Bo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fs,ar=rn.current,ut(rn,e),ut(Sn,Sn.current),!0}function rf(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=sf(e,t,ar),l.__reactInternalMemoizedMergedChildContext=e,pt(Sn),pt(rn),ut(rn,e)):pt(Sn),ut(Sn,i)}var ws=null,Wo=!1,Va=!1;function of(e){ws===null?ws=[e]:ws.push(e)}function Dv(e){Wo=!0,of(e)}function Us(){if(!Va&&ws!==null){Va=!0;var e=0,t=Ke;try{var i=ws;for(Ke=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ws=null,Wo=!1}catch(d){throw ws!==null&&(ws=ws.slice(e+1)),hi(Is,Us),d}finally{Ke=t,Va=!1}}return null}var $r=[],Fr=0,Ho=null,Vo=0,Un=[],Bn=0,cr=null,ks=1,Ss="";function ur(e,t){$r[Fr++]=Vo,$r[Fr++]=Ho,Ho=e,Vo=t}function lf(e,t,i){Un[Bn++]=ks,Un[Bn++]=Ss,Un[Bn++]=cr,cr=e;var l=ks;e=Ss;var d=32-fn(l)-1;l&=~(1<<d),i+=1;var p=32-fn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,ks=1<<32-fn(t)+d|i<<d|l,Ss=p+e}else ks=1<<p|i<<d|l,Ss=e}function Ga(e){e.return!==null&&(ur(e,1),lf(e,1,0))}function qa(e){for(;e===Ho;)Ho=$r[--Fr],$r[Fr]=null,Vo=$r[--Fr],$r[Fr]=null;for(;e===cr;)cr=Un[--Bn],Un[Bn]=null,Ss=Un[--Bn],Un[Bn]=null,ks=Un[--Bn],Un[Bn]=null}var Dn=null,Mn=null,wt=!1,Zn=null;function af(e,t){var i=Gn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function cf(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dn=e,Mn=zs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dn=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=cr!==null?{id:ks,overflow:Ss}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Gn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Dn=e,Mn=null,!0):!1;default:return!1}}function Ka(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(wt){var t=Mn;if(t){var i=t;if(!cf(e,t)){if(Ka(e))throw Error(r(418));t=zs(i.nextSibling);var l=Dn;t&&cf(e,t)?af(l,i):(e.flags=e.flags&-4097|2,wt=!1,Dn=e)}}else{if(Ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,wt=!1,Dn=e}}}function uf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dn=e}function Go(e){if(e!==Dn)return!1;if(!wt)return uf(e),wt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fa(e.type,e.memoizedProps)),t&&(t=Mn)){if(Ka(e))throw df(),Error(r(418));for(;t;)af(e,t),t=zs(t.nextSibling)}if(uf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){Mn=zs(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=Dn?zs(e.stateNode.nextSibling):null;return!0}function df(){for(var e=Mn;e;)e=zs(e.nextSibling)}function Ur(){Mn=Dn=null,wt=!1}function Ya(e){Zn===null?Zn=[e]:Zn.push(e)}var Mv=O.ReactCurrentBatchConfig;function Di(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var l=i.stateNode}if(!l)throw Error(r(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(v){var N=d.refs;v===null?delete N[p]:N[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function qo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ff(e){var t=e._init;return t(e._payload)}function pf(e){function t($,D){if(e){var F=$.deletions;F===null?($.deletions=[D],$.flags|=16):F.push(D)}}function i($,D){if(!e)return null;for(;D!==null;)t($,D),D=D.sibling;return null}function l($,D){for($=new Map;D!==null;)D.key!==null?$.set(D.key,D):$.set(D.index,D),D=D.sibling;return $}function d($,D){return $=Xs($,D),$.index=0,$.sibling=null,$}function p($,D,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<D?($.flags|=2,D):F):($.flags|=2,D)):($.flags|=1048576,D)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function N($,D,F,oe){return D===null||D.tag!==6?(D=Uc(F,$.mode,oe),D.return=$,D):(D=d(D,F),D.return=$,D)}function A($,D,F,oe){var Ne=F.type;return Ne===G?J($,D,F.props.children,oe,F.key):D!==null&&(D.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===re&&ff(Ne)===D.type)?(oe=d(D,F.props),oe.ref=Di($,D,F),oe.return=$,oe):(oe=vl(F.type,F.key,F.props,null,$.mode,oe),oe.ref=Di($,D,F),oe.return=$,oe)}function U($,D,F,oe){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Bc(F,$.mode,oe),D.return=$,D):(D=d(D,F.children||[]),D.return=$,D)}function J($,D,F,oe,Ne){return D===null||D.tag!==7?(D=yr(F,$.mode,oe,Ne),D.return=$,D):(D=d(D,F),D.return=$,D)}function ne($,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Uc(""+D,$.mode,F),D.return=$,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case B:return F=vl(D.type,D.key,D.props,null,$.mode,F),F.ref=Di($,null,D),F.return=$,F;case K:return D=Bc(D,$.mode,F),D.return=$,D;case re:var oe=D._init;return ne($,oe(D._payload),F)}if(gt(D)||ee(D))return D=yr(D,$.mode,F,null),D.return=$,D;qo($,D)}return null}function Q($,D,F,oe){var Ne=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Ne!==null?null:N($,D,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case B:return F.key===Ne?A($,D,F,oe):null;case K:return F.key===Ne?U($,D,F,oe):null;case re:return Ne=F._init,Q($,D,Ne(F._payload),oe)}if(gt(F)||ee(F))return Ne!==null?null:J($,D,F,oe,null);qo($,F)}return null}function he($,D,F,oe,Ne){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return $=$.get(F)||null,N(D,$,""+oe,Ne);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case B:return $=$.get(oe.key===null?F:oe.key)||null,A(D,$,oe,Ne);case K:return $=$.get(oe.key===null?F:oe.key)||null,U(D,$,oe,Ne);case re:var Ae=oe._init;return he($,D,F,Ae(oe._payload),Ne)}if(gt(oe)||ee(oe))return $=$.get(F)||null,J(D,$,oe,Ne,null);qo(D,oe)}return null}function ye($,D,F,oe){for(var Ne=null,Ae=null,Ie=D,Oe=D=0,Gt=null;Ie!==null&&Oe<F.length;Oe++){Ie.index>Oe?(Gt=Ie,Ie=null):Gt=Ie.sibling;var Je=Q($,Ie,F[Oe],oe);if(Je===null){Ie===null&&(Ie=Gt);break}e&&Ie&&Je.alternate===null&&t($,Ie),D=p(Je,D,Oe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je,Ie=Gt}if(Oe===F.length)return i($,Ie),wt&&ur($,Oe),Ne;if(Ie===null){for(;Oe<F.length;Oe++)Ie=ne($,F[Oe],oe),Ie!==null&&(D=p(Ie,D,Oe),Ae===null?Ne=Ie:Ae.sibling=Ie,Ae=Ie);return wt&&ur($,Oe),Ne}for(Ie=l($,Ie);Oe<F.length;Oe++)Gt=he(Ie,$,Oe,F[Oe],oe),Gt!==null&&(e&&Gt.alternate!==null&&Ie.delete(Gt.key===null?Oe:Gt.key),D=p(Gt,D,Oe),Ae===null?Ne=Gt:Ae.sibling=Gt,Ae=Gt);return e&&Ie.forEach(function(Ys){return t($,Ys)}),wt&&ur($,Oe),Ne}function Te($,D,F,oe){var Ne=ee(F);if(typeof Ne!="function")throw Error(r(150));if(F=Ne.call(F),F==null)throw Error(r(151));for(var Ae=Ne=null,Ie=D,Oe=D=0,Gt=null,Je=F.next();Ie!==null&&!Je.done;Oe++,Je=F.next()){Ie.index>Oe?(Gt=Ie,Ie=null):Gt=Ie.sibling;var Ys=Q($,Ie,Je.value,oe);if(Ys===null){Ie===null&&(Ie=Gt);break}e&&Ie&&Ys.alternate===null&&t($,Ie),D=p(Ys,D,Oe),Ae===null?Ne=Ys:Ae.sibling=Ys,Ae=Ys,Ie=Gt}if(Je.done)return i($,Ie),wt&&ur($,Oe),Ne;if(Ie===null){for(;!Je.done;Oe++,Je=F.next())Je=ne($,Je.value,oe),Je!==null&&(D=p(Je,D,Oe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je);return wt&&ur($,Oe),Ne}for(Ie=l($,Ie);!Je.done;Oe++,Je=F.next())Je=he(Ie,$,Oe,Je.value,oe),Je!==null&&(e&&Je.alternate!==null&&Ie.delete(Je.key===null?Oe:Je.key),D=p(Je,D,Oe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je);return e&&Ie.forEach(function(py){return t($,py)}),wt&&ur($,Oe),Ne}function Dt($,D,F,oe){if(typeof F=="object"&&F!==null&&F.type===G&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case B:e:{for(var Ne=F.key,Ae=D;Ae!==null;){if(Ae.key===Ne){if(Ne=F.type,Ne===G){if(Ae.tag===7){i($,Ae.sibling),D=d(Ae,F.props.children),D.return=$,$=D;break e}}else if(Ae.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===re&&ff(Ne)===Ae.type){i($,Ae.sibling),D=d(Ae,F.props),D.ref=Di($,Ae,F),D.return=$,$=D;break e}i($,Ae);break}else t($,Ae);Ae=Ae.sibling}F.type===G?(D=yr(F.props.children,$.mode,oe,F.key),D.return=$,$=D):(oe=vl(F.type,F.key,F.props,null,$.mode,oe),oe.ref=Di($,D,F),oe.return=$,$=oe)}return v($);case K:e:{for(Ae=F.key;D!==null;){if(D.key===Ae)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i($,D.sibling),D=d(D,F.children||[]),D.return=$,$=D;break e}else{i($,D);break}else t($,D);D=D.sibling}D=Bc(F,$.mode,oe),D.return=$,$=D}return v($);case re:return Ae=F._init,Dt($,D,Ae(F._payload),oe)}if(gt(F))return ye($,D,F,oe);if(ee(F))return Te($,D,F,oe);qo($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i($,D.sibling),D=d(D,F),D.return=$,$=D):(i($,D),D=Uc(F,$.mode,oe),D.return=$,$=D),v($)):i($,D)}return Dt}var Br=pf(!0),hf=pf(!1),Ko=$s(null),Xo=null,Wr=null,Qa=null;function Za(){Qa=Wr=Xo=null}function Ja(e){var t=Ko.current;pt(Ko),e._currentValue=t}function ec(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Hr(e,t){Xo=e,Qa=Wr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(bn=!0),e.firstContext=null)}function Wn(e){var t=e._currentValue;if(Qa!==e)if(e={context:e,memoizedValue:t,next:null},Wr===null){if(Xo===null)throw Error(r(308));Wr=e,Xo.dependencies={lanes:0,firstContext:e}}else Wr=Wr.next=e;return t}var dr=null;function tc(e){dr===null?dr=[e]:dr.push(e)}function mf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,tc(t)):(i.next=d.next,d.next=i),t.interleaved=i,Ts(e,l)}function Ts(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Bs=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gf(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 bs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ws(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,Ts(e,i)}return d=l.interleaved,d===null?(t.next=t,tc(l)):(t.next=d.next,d.next=t),l.interleaved=t,Ts(e,i)}function Yo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ms(e,i)}}function vf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=v:p=p.next=v,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function Qo(e,t,i,l){var d=e.updateQueue;Bs=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var A=N,U=A.next;A.next=null,v===null?p=U:v.next=U,v=A;var J=e.alternate;J!==null&&(J=J.updateQueue,N=J.lastBaseUpdate,N!==v&&(N===null?J.firstBaseUpdate=U:N.next=U,J.lastBaseUpdate=A))}if(p!==null){var ne=d.baseState;v=0,J=U=A=null,N=p;do{var Q=N.lane,he=N.eventTime;if((l&Q)===Q){J!==null&&(J=J.next={eventTime:he,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var ye=e,Te=N;switch(Q=t,he=i,Te.tag){case 1:if(ye=Te.payload,typeof ye=="function"){ne=ye.call(he,ne,Q);break e}ne=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Te.payload,Q=typeof ye=="function"?ye.call(he,ne,Q):ye,Q==null)break e;ne=H({},ne,Q);break e;case 2:Bs=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,Q=d.effects,Q===null?d.effects=[N]:Q.push(N))}else he={eventTime:he,lane:Q,tag:N.tag,payload:N.payload,callback:N.callback,next:null},J===null?(U=J=he,A=ne):J=J.next=he,v|=Q;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);if(J===null&&(A=ne),d.baseState=A,d.firstBaseUpdate=U,d.lastBaseUpdate=J,t=d.shared.interleaved,t!==null){d=t;do v|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);hr|=v,e.lanes=v,e.memoizedState=ne}}function yf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(r(191,d));d.call(l)}}}var Mi={},us=$s(Mi),Li=$s(Mi),Pi=$s(Mi);function fr(e){if(e===Mi)throw Error(r(174));return e}function sc(e,t){switch(ut(Pi,t),ut(Li,e),ut(us,Mi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yt(t,e)}pt(us),ut(us,t)}function Vr(){pt(us),pt(Li),pt(Pi)}function xf(e){fr(Pi.current);var t=fr(us.current),i=yt(t,e.type);t!==i&&(ut(Li,e),ut(us,i))}function rc(e){Li.current===e&&(pt(us),pt(Li))}var Nt=$s(0);function Zo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ic=[];function oc(){for(var e=0;e<ic.length;e++)ic[e]._workInProgressVersionPrimary=null;ic.length=0}var Jo=O.ReactCurrentDispatcher,lc=O.ReactCurrentBatchConfig,pr=0,Ct=null,$t=null,Ht=null,el=!1,Oi=!1,zi=0,Lv=0;function on(){throw Error(r(321))}function ac(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}function cc(e,t,i,l,d,p){if(pr=p,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jo.current=e===null||e.memoizedState===null?$v:Fv,e=i(l,d),Oi){p=0;do{if(Oi=!1,zi=0,25<=p)throw Error(r(301));p+=1,Ht=$t=null,t.updateQueue=null,Jo.current=Uv,e=i(l,d)}while(Oi)}if(Jo.current=sl,t=$t!==null&&$t.next!==null,pr=0,Ht=$t=Ct=null,el=!1,t)throw Error(r(300));return e}function uc(){var e=zi!==0;return zi=0,e}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Hn(){if($t===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var t=Ht===null?Ct.memoizedState:Ht.next;if(t!==null)Ht=t,$t=e;else{if(e===null)throw Error(r(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function $i(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Hn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=$t,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=v=null,A=null,U=p;do{var J=U.lane;if((pr&J)===J)A!==null&&(A=A.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var ne={lane:J,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};A===null?(N=A=ne,v=l):A=A.next=ne,Ct.lanes|=J,hr|=J}U=U.next}while(U!==null&&U!==p);A===null?v=l:A.next=N,Qn(l,t.memoizedState)||(bn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=A,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Ct.lanes|=p,hr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function fc(e){var t=Hn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);Qn(p,t.memoizedState)||(bn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function wf(){}function kf(e,t){var i=Ct,l=Hn(),d=t(),p=!Qn(l.memoizedState,d);if(p&&(l.memoizedState=d,bn=!0),l=l.queue,pc(bf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ht!==null&&Ht.memoizedState.tag&1){if(i.flags|=2048,Fi(9,Tf.bind(null,i,l,d,t),void 0,null),Vt===null)throw Error(r(349));(pr&30)!==0||Sf(i,t,d)}return d}function Sf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Tf(e,t,i,l){t.value=i,t.getSnapshot=l,Nf(t)&&Cf(e)}function bf(e,t,i){return i(function(){Nf(t)&&Cf(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Qn(e,i)}catch{return!0}}function Cf(e){var t=Ts(e,1);t!==null&&ns(t,e,1,-1)}function Ef(e){var t=ds();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:e},t.queue=e,e=e.dispatch=zv.bind(null,Ct,e),[t.memoizedState,e]}function Fi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function _f(){return Hn().memoizedState}function tl(e,t,i,l){var d=ds();Ct.flags|=e,d.memoizedState=Fi(1|t,i,void 0,l===void 0?null:l)}function nl(e,t,i,l){var d=Hn();l=l===void 0?null:l;var p=void 0;if($t!==null){var v=$t.memoizedState;if(p=v.destroy,l!==null&&ac(l,v.deps)){d.memoizedState=Fi(t,i,p,l);return}}Ct.flags|=e,d.memoizedState=Fi(1|t,i,p,l)}function jf(e,t){return tl(8390656,8,e,t)}function pc(e,t){return nl(2048,8,e,t)}function Rf(e,t){return nl(4,2,e,t)}function Af(e,t){return nl(4,4,e,t)}function If(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Df(e,t,i){return i=i!=null?i.concat([e]):null,nl(4,4,If.bind(null,t,e),i)}function hc(){}function Mf(e,t){var i=Hn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Lf(e,t){var i=Hn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Pf(e,t,i){return(pr&21)===0?(e.baseState&&(e.baseState=!1,bn=!0),e.memoizedState=i):(Qn(i,t)||(i=gi(),Ct.lanes|=i,hr|=i,e.baseState=!0),t)}function Pv(e,t){var i=Ke;Ke=i!==0&&4>i?i:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),t()}finally{Ke=i,lc.transition=l}}function Of(){return Hn().memoizedState}function Ov(e,t,i){var l=qs(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},zf(e))$f(t,i);else if(i=mf(e,t,i,l),i!==null){var d=mn();ns(i,e,l,d),Ff(i,t,l)}}function zv(e,t,i){var l=qs(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(zf(e))$f(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var v=t.lastRenderedState,N=p(v,i);if(d.hasEagerState=!0,d.eagerState=N,Qn(N,v)){var A=t.interleaved;A===null?(d.next=d,tc(t)):(d.next=A.next,A.next=d),t.interleaved=d;return}}catch{}finally{}i=mf(e,t,d,l),i!==null&&(d=mn(),ns(i,e,l,d),Ff(i,t,l))}}function zf(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function $f(e,t){Oi=el=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Ff(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ms(e,i)}}var sl={readContext:Wn,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},$v={readContext:Wn,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:Wn,useEffect:jf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,tl(4194308,4,If.bind(null,t,e),i)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var i=ds();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=ds();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Ov.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:hc,useDeferredValue:function(e){return ds().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=Pv.bind(null,e[1]),ds().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=ds();if(wt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Vt===null)throw Error(r(349));(pr&30)!==0||Sf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,jf(bf.bind(null,l,p,e),[e]),l.flags|=2048,Fi(9,Tf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=ds(),t=Vt.identifierPrefix;if(wt){var i=Ss,l=ks;i=(l&~(1<<32-fn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=zi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Lv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fv={readContext:Wn,useCallback:Mf,useContext:Wn,useEffect:pc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:dc,useRef:_f,useState:function(){return dc($i)},useDebugValue:hc,useDeferredValue:function(e){var t=Hn();return Pf(t,$t.memoizedState,e)},useTransition:function(){var e=dc($i)[0],t=Hn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1},Uv={readContext:Wn,useCallback:Mf,useContext:Wn,useEffect:pc,useImperativeHandle:Df,useInsertionEffect:Rf,useLayoutEffect:Af,useMemo:Lf,useReducer:fc,useRef:_f,useState:function(){return fc($i)},useDebugValue:hc,useDeferredValue:function(e){var t=Hn();return $t===null?t.memoizedState=e:Pf(t,$t.memoizedState,e)},useTransition:function(){var e=fc($i)[0],t=Hn().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Of,unstable_isNewReconciler:!1};function Jn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function mc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var rl={isMounted:function(e){return(e=e._reactInternals)?Be(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=mn(),d=qs(e),p=bs(l,d);p.payload=t,i!=null&&(p.callback=i),t=Ws(e,p,d),t!==null&&(ns(t,e,d,l),Yo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=mn(),d=qs(e),p=bs(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Ws(e,p,d),t!==null&&(ns(t,e,d,l),Yo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=mn(),l=qs(e),d=bs(i,l);d.tag=2,t!=null&&(d.callback=t),t=Ws(e,d,l),t!==null&&(ns(t,e,l,i),Yo(t,e,l))}};function Uf(e,t,i,l,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,v):t.prototype&&t.prototype.isPureReactComponent?!Ci(i,l)||!Ci(d,p):!0}function Bf(e,t,i){var l=!1,d=Fs,p=t.contextType;return typeof p=="object"&&p!==null?p=Wn(p):(d=Tn(t)?ar:rn.current,l=t.contextTypes,p=(l=l!=null)?zr(e,d):Fs),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Wf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&rl.enqueueReplaceState(t,t.state,null)}function gc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},nc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Wn(p):(p=Tn(t)?ar:rn.current,d.context=zr(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(mc(e,t,p,i),d.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(t=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),t!==d.state&&rl.enqueueReplaceState(d,d.state,null),Qo(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Gr(e,t){try{var i="",l=t;do i+=Se(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
|
-
Error generating stack: `+p.message+`
|
|
40
|
-
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function vc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function yc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Bv=typeof WeakMap=="function"?WeakMap:Map;function Hf(e,t,i){i=bs(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){dl||(dl=!0,Dc=l),yc(e,t)},i}function Vf(e,t,i){i=bs(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){yc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){yc(e,t),typeof l!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Gf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Bv;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(i)||(d.add(i),e=ny.bind(null,e,t,i),t.then(e,e))}function qf(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 Kf(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=bs(-1,1),t.tag=2,Ws(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Wv=O.ReactCurrentOwner,bn=!1;function hn(e,t,i,l){t.child=e===null?hf(t,null,i,l):Br(t,e.child,i,l)}function Xf(e,t,i,l,d){i=i.render;var p=t.ref;return Hr(t,d),l=cc(e,t,i,l,p,d),i=uc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ns(e,t,d)):(wt&&i&&Ga(t),t.flags|=1,hn(e,t,l,d),t.child)}function Yf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Fc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Qf(e,t,p,l,d)):(e=vl(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(i=i.compare,i=i!==null?i:Ci,i(v,l)&&e.ref===t.ref)return Ns(e,t,d)}return t.flags|=1,e=Xs(p,l),e.ref=t.ref,e.return=t,t.child=e}function Qf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Ci(p,l)&&e.ref===t.ref)if(bn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(bn=!0);else return t.lanes=e.lanes,Ns(e,t,d)}return xc(e,t,i,l,d)}function Zf(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Kr,Ln),Ln|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(Kr,Ln),Ln|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ut(Kr,Ln),Ln|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ut(Kr,Ln),Ln|=l;return hn(e,t,d,i),t.child}function Jf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function xc(e,t,i,l,d){var p=Tn(i)?ar:rn.current;return p=zr(t,p),Hr(t,d),i=cc(e,t,i,l,p,d),l=uc(),e!==null&&!bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ns(e,t,d)):(wt&&l&&Ga(t),t.flags|=1,hn(e,t,i,d),t.child)}function ep(e,t,i,l,d){if(Tn(i)){var p=!0;Bo(t)}else p=!1;if(Hr(t,d),t.stateNode===null)ol(e,t),Bf(t,i,l),gc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,N=t.memoizedProps;v.props=N;var A=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=Wn(U):(U=Tn(i)?ar:rn.current,U=zr(t,U));var J=i.getDerivedStateFromProps,ne=typeof J=="function"||typeof v.getSnapshotBeforeUpdate=="function";ne||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==l||A!==U)&&Wf(t,v,l,U),Bs=!1;var Q=t.memoizedState;v.state=Q,Qo(t,l,v,d),A=t.memoizedState,N!==l||Q!==A||Sn.current||Bs?(typeof J=="function"&&(mc(t,i,J,l),A=t.memoizedState),(N=Bs||Uf(t,i,N,l,Q,A,U))?(ne||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=A),v.props=l,v.state=A,v.context=U,l=N):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,gf(e,t),N=t.memoizedProps,U=t.type===t.elementType?N:Jn(t.type,N),v.props=U,ne=t.pendingProps,Q=v.context,A=i.contextType,typeof A=="object"&&A!==null?A=Wn(A):(A=Tn(i)?ar:rn.current,A=zr(t,A));var he=i.getDerivedStateFromProps;(J=typeof he=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==ne||Q!==A)&&Wf(t,v,l,A),Bs=!1,Q=t.memoizedState,v.state=Q,Qo(t,l,v,d);var ye=t.memoizedState;N!==ne||Q!==ye||Sn.current||Bs?(typeof he=="function"&&(mc(t,i,he,l),ye=t.memoizedState),(U=Bs||Uf(t,i,U,l,Q,ye,A)||!1)?(J||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,ye,A),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,ye,A)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ye),v.props=l,v.state=ye,v.context=A,l=U):(typeof v.componentDidUpdate!="function"||N===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),l=!1)}return wc(e,t,i,l,p,d)}function wc(e,t,i,l,d,p){Jf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&rf(t,i,!1),Ns(e,t,p);l=t.stateNode,Wv.current=t;var N=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Br(t,e.child,null,p),t.child=Br(t,null,N,p)):hn(e,t,N,p),t.memoizedState=l.state,d&&rf(t,i,!0),t.child}function tp(e){var t=e.stateNode;t.pendingContext?nf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nf(e,t.context,!1),sc(e,t.containerInfo)}function np(e,t,i,l,d){return Ur(),Ya(d),t.flags|=256,hn(e,t,i,l),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0};function Sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function sp(e,t,i){var l=t.pendingProps,d=Nt.current,p=!1,v=(t.flags&128)!==0,N;if((N=v)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ut(Nt,d&1),e===null)return Xa(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):(v=l.children,e=l.fallback,p?(l=t.mode,p=t.child,v={mode:"hidden",children:v},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=yl(v,l,0,null),e=yr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Sc(i),t.memoizedState=kc,e):Tc(t,v));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return Hv(e,t,v,l,N,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,N=d.sibling;var A={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=A,t.deletions=null):(l=Xs(d,A),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=Xs(N,p):(p=yr(p,v,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,v=e.child.memoizedState,v=v===null?Sc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=kc,l}return p=e.child,e=p.sibling,l=Xs(p,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function Tc(e,t){return t=yl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function il(e,t,i,l){return l!==null&&Ya(l),Br(t,e.child,null,i),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=vc(Error(r(422))),il(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=yl({mode:"visible",children:l.children},d,0,null),p=yr(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Br(t,e.child,null,v),t.child.memoizedState=Sc(v),t.memoizedState=kc,p);if((t.mode&1)===0)return il(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(r(419)),l=vc(p,l,void 0),il(e,t,v,l)}if(N=(v&e.childLanes)!==0,bn||N){if(l=Vt,l!==null){switch(v&-v){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Ts(e,d),ns(l,e,d,-1))}return $c(),l=vc(Error(r(421))),il(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=sy.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,Mn=zs(d.nextSibling),Dn=t,wt=!0,Zn=null,e!==null&&(Un[Bn++]=ks,Un[Bn++]=Ss,Un[Bn++]=cr,ks=e.id,Ss=e.overflow,cr=t),t=Tc(t,l.children),t.flags|=4096,t)}function rp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ec(e.return,t,i)}function bc(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function ip(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(hn(e,t,l.children,i),l=Nt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rp(e,i,t);else if(e.tag===19)rp(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(ut(Nt,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&Zo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),bc(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Zo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}bc(t,!0,i,null,p);break;case"together":bc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ol(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ns(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),hr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=Xs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Xs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Vv(e,t,i){switch(t.tag){case 3:tp(t),Ur();break;case 5:xf(t);break;case 1:Tn(t.type)&&Bo(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ut(Ko,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ut(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?sp(e,t,i):(ut(Nt,Nt.current&1),e=Ns(e,t,i),e!==null?e.sibling:null);ut(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return ip(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ut(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,Zf(e,t,i)}return Ns(e,t,i)}var op,Nc,lp,ap;op=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Nc=function(){},lp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,fr(us.current);var p=null;switch(i){case"input":d=$e(e,d),l=$e(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=V(e,d),l=V(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=$o)}wn(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var N=d[U];for(v in N)N.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var A=l[U];if(N=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&A!==N&&(A!=null||N!=null))if(U==="style")if(N){for(v in N)!N.hasOwnProperty(v)||A&&A.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in A)A.hasOwnProperty(v)&&N[v]!==A[v]&&(i||(i={}),i[v]=A[v])}else i||(p||(p=[]),p.push(U,i)),i=A;else U==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,N=N?N.__html:void 0,A!=null&&N!==A&&(p=p||[]).push(U,A)):U==="children"?typeof A!="string"&&typeof A!="number"||(p=p||[]).push(U,""+A):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(A!=null&&U==="onScroll"&&ft("scroll",e),p||N===A||(p=[])):(p=p||[]).push(U,A))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},ap=function(e,t,i,l){i!==l&&(t.flags|=4)};function Ui(e,t){if(!wt)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ln(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Gv(e,t,i){var l=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return Tn(t.type)&&Uo(),ln(t),null;case 3:return l=t.stateNode,Vr(),pt(Sn),pt(rn),oc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Go(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zn!==null&&(Pc(Zn),Zn=null))),Nc(e,t),ln(t),null;case 5:rc(t);var d=fr(Pi.current);if(i=t.type,e!==null&&t.stateNode!=null)lp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ln(t),null}if(e=fr(us.current),Go(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[cs]=t,l[Ai]=p,e=(t.mode&1)!==0,i){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(d=0;d<_i.length;d++)ft(_i[d],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":mt(l,p),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ft("invalid",l);break;case"textarea":we(l,p),ft("invalid",l)}wn(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var N=p[v];v==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&zo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&zo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(v)&&N!=null&&v==="onScroll"&&ft("scroll",l)}switch(i){case"input":at(l),nn(l,p,!0);break;case"textarea":at(l),qe(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=$o)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(i,{is:l.is}):(e=v.createElement(i),i==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,i),e[cs]=t,e[Ai]=l,op(e,t,!1,!1),t.stateNode=e;e:{switch(v=Rn(i,l),i){case"dialog":ft("cancel",e),ft("close",e),d=l;break;case"iframe":case"object":case"embed":ft("load",e),d=l;break;case"video":case"audio":for(d=0;d<_i.length;d++)ft(_i[d],e);d=l;break;case"source":ft("error",e),d=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),d=l;break;case"details":ft("toggle",e),d=l;break;case"input":mt(e,l),d=$e(e,l),ft("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),ft("invalid",e);break;case"textarea":we(e,l),d=V(e,l),ft("invalid",e);break;default:d=l}wn(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var A=N[p];p==="style"?jn(e,A):p==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,A!=null&&Yt(e,A)):p==="children"?typeof A=="string"?(i!=="textarea"||A!=="")&&xn(e,A):typeof A=="number"&&xn(e,""+A):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?A!=null&&p==="onScroll"&&ft("scroll",e):A!=null&&W(e,p,A,v))}switch(i){case"input":at(e),nn(e,l,!1);break;case"textarea":at(e),qe(e);break;case"option":l.value!=null&&e.setAttribute("value",""+je(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?Ot(e,!!l.multiple,p,!1):l.defaultValue!=null&&Ot(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=$o)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ln(t),null;case 6:if(e&&t.stateNode!=null)ap(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=fr(Pi.current),fr(us.current),Go(t)){if(l=t.stateNode,i=t.memoizedProps,l[cs]=t,(p=l.nodeValue!==i)&&(e=Dn,e!==null))switch(e.tag){case 3:zo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&zo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[cs]=t,t.stateNode=l}return ln(t),null;case 13:if(pt(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wt&&Mn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)df(),Ur(),t.flags|=98560,p=!1;else if(p=Go(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[cs]=t}else Ur(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else Zn!==null&&(Pc(Zn),Zn=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Nt.current&1)!==0?Ft===0&&(Ft=3):$c())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return Vr(),Nc(e,t),e===null&&ji(t.stateNode.containerInfo),ln(t),null;case 10:return Ja(t.type._context),ln(t),null;case 17:return Tn(t.type)&&Uo(),ln(t),null;case 19:if(pt(Nt),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)Ui(p,!1);else{if(Ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Zo(e),v!==null){for(t.flags|=128,Ui(p,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ut(Nt,Nt.current&1|2),t.child}e=e.sibling}p.tail!==null&&St()>Xr&&(t.flags|=128,l=!0,Ui(p,!1),t.lanes=4194304)}else{if(!l)if(e=Zo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Ui(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!wt)return ln(t),null}else 2*St()-p.renderingStartTime>Xr&&i!==1073741824&&(t.flags|=128,l=!0,Ui(p,!1),t.lanes=4194304);p.isBackwards?(v.sibling=t.child,t.child=v):(i=p.last,i!==null?i.sibling=v:t.child=v,p.last=v)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=St(),t.sibling=null,i=Nt.current,ut(Nt,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return zc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Ln&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function qv(e,t){switch(qa(t),t.tag){case 1:return Tn(t.type)&&Uo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vr(),pt(Sn),pt(rn),oc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return rc(t),null;case 13:if(pt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ur()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(Nt),null;case 4:return Vr(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var ll=!1,an=!1,Kv=typeof WeakSet=="function"?WeakSet:Set,ge=null;function qr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Et(e,t,l)}else i.current=null}function Cc(e,t,i){try{i()}catch(l){Et(e,t,l)}}var cp=!1;function Xv(e,t){if(za=Eo,e=Fd(),Ra(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var v=0,N=-1,A=-1,U=0,J=0,ne=e,Q=null;t:for(;;){for(var he;ne!==i||d!==0&&ne.nodeType!==3||(N=v+d),ne!==p||l!==0&&ne.nodeType!==3||(A=v+l),ne.nodeType===3&&(v+=ne.nodeValue.length),(he=ne.firstChild)!==null;)Q=ne,ne=he;for(;;){if(ne===e)break t;if(Q===i&&++U===d&&(N=v),Q===p&&++J===l&&(A=v),(he=ne.nextSibling)!==null)break;ne=Q,Q=ne.parentNode}ne=he}i=N===-1||A===-1?null:{start:N,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for($a={focusedElem:e,selectionRange:i},Eo=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;try{var ye=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var Te=ye.memoizedProps,Dt=ye.memoizedState,$=t.stateNode,D=$.getSnapshotBeforeUpdate(t.elementType===t.type?Te:Jn(t.type,Te),Dt);$.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(oe){Et(t,t.return,oe)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return ye=cp,cp=!1,ye}function Bi(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Cc(t,i,p)}d=d.next}while(d!==l)}}function al(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Ec(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function up(e){var t=e.alternate;t!==null&&(e.alternate=null,up(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cs],delete t[Ai],delete t[Wa],delete t[Av],delete t[Iv])),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 dp(e){return e.tag===5||e.tag===3||e.tag===4}function fp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(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 _c(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=$o));else if(l!==4&&(e=e.child,e!==null))for(_c(e,t,i),e=e.sibling;e!==null;)_c(e,t,i),e=e.sibling}function jc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(jc(e,t,i),e=e.sibling;e!==null;)jc(e,t,i),e=e.sibling}var Qt=null,es=!1;function Hs(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(nr,i)}catch{}switch(i.tag){case 5:an||qr(i,t);case 6:var l=Qt,d=es;Qt=null,Hs(e,t,i),Qt=l,es=d,Qt!==null&&(es?(e=Qt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Qt.removeChild(i.stateNode));break;case 18:Qt!==null&&(es?(e=Qt,i=i.stateNode,e.nodeType===8?Ba(e.parentNode,i):e.nodeType===1&&Ba(e,i),wi(e)):Ba(Qt,i.stateNode));break;case 4:l=Qt,d=es,Qt=i.stateNode.containerInfo,es=!0,Hs(e,t,i),Qt=l,es=d;break;case 0:case 11:case 14:case 15:if(!an&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&Cc(i,t,v),d=d.next}while(d!==l)}Hs(e,t,i);break;case 1:if(!an&&(qr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){Et(i,t,N)}Hs(e,t,i);break;case 21:Hs(e,t,i);break;case 22:i.mode&1?(an=(l=an)||i.memoizedState!==null,Hs(e,t,i),an=l):Hs(e,t,i);break;default:Hs(e,t,i)}}function hp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Kv),t.forEach(function(l){var d=ry.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function ts(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,v=t,N=v;e:for(;N!==null;){switch(N.tag){case 5:Qt=N.stateNode,es=!1;break e;case 3:Qt=N.stateNode.containerInfo,es=!0;break e;case 4:Qt=N.stateNode.containerInfo,es=!0;break e}N=N.return}if(Qt===null)throw Error(r(160));pp(p,v,d),Qt=null,es=!1;var A=d.alternate;A!==null&&(A.return=null),d.return=null}catch(U){Et(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mp(t,e),t=t.sibling}function mp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ts(t,e),fs(e),l&4){try{Bi(3,e,e.return),al(3,e)}catch(Te){Et(e,e.return,Te)}try{Bi(5,e,e.return)}catch(Te){Et(e,e.return,Te)}}break;case 1:ts(t,e),fs(e),l&512&&i!==null&&qr(i,i.return);break;case 5:if(ts(t,e),fs(e),l&512&&i!==null&&qr(i,i.return),e.flags&32){var d=e.stateNode;try{xn(d,"")}catch(Te){Et(e,e.return,Te)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,N=e.type,A=e.updateQueue;if(e.updateQueue=null,A!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&He(d,p),Rn(N,v);var U=Rn(N,p);for(v=0;v<A.length;v+=2){var J=A[v],ne=A[v+1];J==="style"?jn(d,ne):J==="dangerouslySetInnerHTML"?Yt(d,ne):J==="children"?xn(d,ne):W(d,J,ne,U)}switch(N){case"input":Mt(d,p);break;case"textarea":Fe(d,p);break;case"select":var Q=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var he=p.value;he!=null?Ot(d,!!p.multiple,he,!1):Q!==!!p.multiple&&(p.defaultValue!=null?Ot(d,!!p.multiple,p.defaultValue,!0):Ot(d,!!p.multiple,p.multiple?[]:"",!1))}d[Ai]=p}catch(Te){Et(e,e.return,Te)}}break;case 6:if(ts(t,e),fs(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(Te){Et(e,e.return,Te)}}break;case 3:if(ts(t,e),fs(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{wi(t.containerInfo)}catch(Te){Et(e,e.return,Te)}break;case 4:ts(t,e),fs(e);break;case 13:ts(t,e),fs(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ic=St())),l&4&&hp(e);break;case 22:if(J=i!==null&&i.memoizedState!==null,e.mode&1?(an=(U=an)||J,ts(t,e),an=U):ts(t,e),fs(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!J&&(e.mode&1)!==0)for(ge=e,J=e.child;J!==null;){for(ne=ge=J;ge!==null;){switch(Q=ge,he=Q.child,Q.tag){case 0:case 11:case 14:case 15:Bi(4,Q,Q.return);break;case 1:qr(Q,Q.return);var ye=Q.stateNode;if(typeof ye.componentWillUnmount=="function"){l=Q,i=Q.return;try{t=l,ye.props=t.memoizedProps,ye.state=t.memoizedState,ye.componentWillUnmount()}catch(Te){Et(l,i,Te)}}break;case 5:qr(Q,Q.return);break;case 22:if(Q.memoizedState!==null){yp(ne);continue}}he!==null?(he.return=Q,ge=he):yp(ne)}J=J.sibling}e:for(J=null,ne=e;;){if(ne.tag===5){if(J===null){J=ne;try{d=ne.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=ne.stateNode,A=ne.memoizedProps.style,v=A!=null&&A.hasOwnProperty("display")?A.display:null,N.style.display=Fn("display",v))}catch(Te){Et(e,e.return,Te)}}}else if(ne.tag===6){if(J===null)try{ne.stateNode.nodeValue=U?"":ne.memoizedProps}catch(Te){Et(e,e.return,Te)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===e)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===e)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===e)break e;J===ne&&(J=null),ne=ne.return}J===ne&&(J=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:ts(t,e),fs(e),l&4&&hp(e);break;case 21:break;default:ts(t,e),fs(e)}}function fs(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(dp(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(xn(d,""),l.flags&=-33);var p=fp(e);jc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,N=fp(e);_c(e,N,v);break;default:throw Error(r(161))}}catch(A){Et(e,e.return,A)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yv(e,t,i){ge=e,gp(e)}function gp(e,t,i){for(var l=(e.mode&1)!==0;ge!==null;){var d=ge,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||ll;if(!v){var N=d.alternate,A=N!==null&&N.memoizedState!==null||an;N=ll;var U=an;if(ll=v,(an=A)&&!U)for(ge=d;ge!==null;)v=ge,A=v.child,v.tag===22&&v.memoizedState!==null?xp(d):A!==null?(A.return=v,ge=A):xp(d);for(;p!==null;)ge=p,gp(p),p=p.sibling;ge=d,ll=N,an=U}vp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ge=p):vp(e)}}function vp(e){for(;ge!==null;){var t=ge;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:an||al(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!an)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:Jn(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&yf(t,p,l);break;case 3:var v=t.updateQueue;if(v!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}yf(t,v,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var A=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":A.autoFocus&&i.focus();break;case"img":A.src&&(i.src=A.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var J=U.memoizedState;if(J!==null){var ne=J.dehydrated;ne!==null&&wi(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}an||t.flags&512&&Ec(t)}catch(Q){Et(t,t.return,Q)}}if(t===e){ge=null;break}if(i=t.sibling,i!==null){i.return=t.return,ge=i;break}ge=t.return}}function yp(e){for(;ge!==null;){var t=ge;if(t===e){ge=null;break}var i=t.sibling;if(i!==null){i.return=t.return,ge=i;break}ge=t.return}}function xp(e){for(;ge!==null;){var t=ge;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{al(4,t)}catch(A){Et(t,i,A)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(A){Et(t,d,A)}}var p=t.return;try{Ec(t)}catch(A){Et(t,p,A)}break;case 5:var v=t.return;try{Ec(t)}catch(A){Et(t,v,A)}}}catch(A){Et(t,t.return,A)}if(t===e){ge=null;break}var N=t.sibling;if(N!==null){N.return=t.return,ge=N;break}ge=t.return}}var Qv=Math.ceil,cl=O.ReactCurrentDispatcher,Rc=O.ReactCurrentOwner,Vn=O.ReactCurrentBatchConfig,Ye=0,Vt=null,Lt=null,Zt=0,Ln=0,Kr=$s(0),Ft=0,Wi=null,hr=0,ul=0,Ac=0,Hi=null,Nn=null,Ic=0,Xr=1/0,Cs=null,dl=!1,Dc=null,Vs=null,fl=!1,Gs=null,pl=0,Vi=0,Mc=null,hl=-1,ml=0;function mn(){return(Ye&6)!==0?St():hl!==-1?hl:hl=St()}function qs(e){return(e.mode&1)===0?1:(Ye&2)!==0&&Zt!==0?Zt&-Zt:Mv.transition!==null?(ml===0&&(ml=gi()),ml):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:wd(e.type)),e)}function ns(e,t,i,l){if(50<Vi)throw Vi=0,Mc=null,Error(r(185));or(e,i,l),((Ye&2)===0||e!==Vt)&&(e===Vt&&((Ye&2)===0&&(ul|=i),Ft===4&&Ks(e,Zt)),Cn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(Xr=St()+500,Wo&&Us()))}function Cn(e,t){var i=e.callbackNode;bo(e,t);var l=ir(e,e===Vt?Zt:0);if(l===0)i!==null&&ko(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&ko(i),t===1)e.tag===0?Dv(kp.bind(null,e)):of(kp.bind(null,e)),jv(function(){(Ye&6)===0&&Us()}),i=null;else{switch(ie(l)){case 1:i=Is;break;case 4:i=as;break;case 16:i=Nr;break;case 536870912:i=So;break;default:i=Nr}i=jp(i,wp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function wp(e,t){if(hl=-1,ml=0,(Ye&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Yr()&&e.callbackNode!==i)return null;var l=ir(e,e===Vt?Zt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=gl(e,l);else{t=l;var d=Ye;Ye|=2;var p=Tp();(Vt!==e||Zt!==t)&&(Cs=null,Xr=St()+500,gr(e,t));do try{ey();break}catch(N){Sp(e,N)}while(!0);Za(),cl.current=p,Ye=d,Lt!==null?t=0:(Vt=null,Zt=0,t=Ft)}if(t!==0){if(t===2&&(d=mi(e),d!==0&&(l=d,t=Lc(e,d))),t===1)throw i=Wi,gr(e,0),Ks(e,l),Cn(e,St()),i;if(t===6)Ks(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Zv(d)&&(t=gl(e,l),t===2&&(p=mi(e),p!==0&&(l=p,t=Lc(e,p))),t===1))throw i=Wi,gr(e,0),Ks(e,l),Cn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:vr(e,Nn,Cs);break;case 3:if(Ks(e,l),(l&130023424)===l&&(t=Ic+500-St(),10<t)){if(ir(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){mn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ua(vr.bind(null,e,Nn,Cs),t);break}vr(e,Nn,Cs);break;case 4:if(Ks(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-fn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=St()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Qv(l/1960))-l,10<l){e.timeoutHandle=Ua(vr.bind(null,e,Nn,Cs),l);break}vr(e,Nn,Cs);break;case 5:vr(e,Nn,Cs);break;default:throw Error(r(329))}}}return Cn(e,St()),e.callbackNode===i?wp.bind(null,e):null}function Lc(e,t){var i=Hi;return e.current.memoizedState.isDehydrated&&(gr(e,t).flags|=256),e=gl(e,t),e!==2&&(t=Nn,Nn=i,t!==null&&Pc(t)),e}function Pc(e){Nn===null?Nn=e:Nn.push.apply(Nn,e)}function Zv(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!Qn(p(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ks(e,t){for(t&=~Ac,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-fn(t),l=1<<i;e[i]=-1,t&=~l}}function kp(e){if((Ye&6)!==0)throw Error(r(327));Yr();var t=ir(e,0);if((t&1)===0)return Cn(e,St()),null;var i=gl(e,t);if(e.tag!==0&&i===2){var l=mi(e);l!==0&&(t=l,i=Lc(e,l))}if(i===1)throw i=Wi,gr(e,0),Ks(e,t),Cn(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vr(e,Nn,Cs),Cn(e,St()),null}function Oc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(Xr=St()+500,Wo&&Us())}}function mr(e){Gs!==null&&Gs.tag===0&&(Ye&6)===0&&Yr();var t=Ye;Ye|=1;var i=Vn.transition,l=Ke;try{if(Vn.transition=null,Ke=1,e)return e()}finally{Ke=l,Vn.transition=i,Ye=t,(Ye&6)===0&&Us()}}function zc(){Ln=Kr.current,pt(Kr)}function gr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,_v(i)),Lt!==null)for(i=Lt.return;i!==null;){var l=i;switch(qa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Uo();break;case 3:Vr(),pt(Sn),pt(rn),oc();break;case 5:rc(l);break;case 4:Vr();break;case 13:pt(Nt);break;case 19:pt(Nt);break;case 10:Ja(l.type._context);break;case 22:case 23:zc()}i=i.return}if(Vt=e,Lt=e=Xs(e.current,null),Zt=Ln=t,Ft=0,Wi=null,Ac=ul=hr=0,Nn=Hi=null,dr!==null){for(t=0;t<dr.length;t++)if(i=dr[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var v=p.next;p.next=d,l.next=v}i.pending=l}dr=null}return e}function Sp(e,t){do{var i=Lt;try{if(Za(),Jo.current=sl,el){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}el=!1}if(pr=0,Ht=$t=Ct=null,Oi=!1,zi=0,Rc.current=null,i===null||i.return===null){Ft=1,Wi=t,Lt=null;break}e:{var p=e,v=i.return,N=i,A=t;if(t=Zt,N.flags|=32768,A!==null&&typeof A=="object"&&typeof A.then=="function"){var U=A,J=N,ne=J.tag;if((J.mode&1)===0&&(ne===0||ne===11||ne===15)){var Q=J.alternate;Q?(J.updateQueue=Q.updateQueue,J.memoizedState=Q.memoizedState,J.lanes=Q.lanes):(J.updateQueue=null,J.memoizedState=null)}var he=qf(v);if(he!==null){he.flags&=-257,Kf(he,v,N,p,t),he.mode&1&&Gf(p,U,t),t=he,A=U;var ye=t.updateQueue;if(ye===null){var Te=new Set;Te.add(A),t.updateQueue=Te}else ye.add(A);break e}else{if((t&1)===0){Gf(p,U,t),$c();break e}A=Error(r(426))}}else if(wt&&N.mode&1){var Dt=qf(v);if(Dt!==null){(Dt.flags&65536)===0&&(Dt.flags|=256),Kf(Dt,v,N,p,t),Ya(Gr(A,N));break e}}p=A=Gr(A,N),Ft!==4&&(Ft=2),Hi===null?Hi=[p]:Hi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Hf(p,A,t);vf(p,$);break e;case 1:N=A;var D=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Vs===null||!Vs.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var oe=Vf(p,N,t);vf(p,oe);break e}}p=p.return}while(p!==null)}Np(i)}catch(Ne){t=Ne,Lt===i&&i!==null&&(Lt=i=i.return);continue}break}while(!0)}function Tp(){var e=cl.current;return cl.current=sl,e===null?sl:e}function $c(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Vt===null||(hr&268435455)===0&&(ul&268435455)===0||Ks(Vt,Zt)}function gl(e,t){var i=Ye;Ye|=2;var l=Tp();(Vt!==e||Zt!==t)&&(Cs=null,gr(e,t));do try{Jv();break}catch(d){Sp(e,d)}while(!0);if(Za(),Ye=i,cl.current=l,Lt!==null)throw Error(r(261));return Vt=null,Zt=0,Ft}function Jv(){for(;Lt!==null;)bp(Lt)}function ey(){for(;Lt!==null&&!va();)bp(Lt)}function bp(e){var t=_p(e.alternate,e,Ln);e.memoizedProps=e.pendingProps,t===null?Np(e):Lt=t,Rc.current=null}function Np(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Gv(i,t,Ln),i!==null){Lt=i;return}}else{if(i=qv(i,t),i!==null){i.flags&=32767,Lt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,Lt=null;return}}if(t=t.sibling,t!==null){Lt=t;return}Lt=t=e}while(t!==null);Ft===0&&(Ft=5)}function vr(e,t,i){var l=Ke,d=Vn.transition;try{Vn.transition=null,Ke=1,ty(e,t,i,l)}finally{Vn.transition=d,Ke=l}return null}function ty(e,t,i,l){do Yr();while(Gs!==null);if((Ye&6)!==0)throw Error(r(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(No(e,p),e===Vt&&(Lt=Vt=null,Zt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||fl||(fl=!0,jp(Nr,function(){return Yr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Vn.transition,Vn.transition=null;var v=Ke;Ke=1;var N=Ye;Ye|=4,Rc.current=null,Xv(e,i),mp(i,e),kv($a),Eo=!!za,$a=za=null,e.current=i,Yv(i),ya(),Ye=N,Ke=v,Vn.transition=p}else e.current=i;if(fl&&(fl=!1,Gs=e,pl=d),p=e.pendingLanes,p===0&&(Vs=null),Cr(i.stateNode),Cn(e,St()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(dl)throw dl=!1,e=Dc,Dc=null,e;return(pl&1)!==0&&e.tag!==0&&Yr(),p=e.pendingLanes,(p&1)!==0?e===Mc?Vi++:(Vi=0,Mc=e):Vi=0,Us(),null}function Yr(){if(Gs!==null){var e=ie(pl),t=Vn.transition,i=Ke;try{if(Vn.transition=null,Ke=16>e?16:e,Gs===null)var l=!1;else{if(e=Gs,Gs=null,pl=0,(Ye&6)!==0)throw Error(r(331));var d=Ye;for(Ye|=4,ge=e.current;ge!==null;){var p=ge,v=p.child;if((ge.flags&16)!==0){var N=p.deletions;if(N!==null){for(var A=0;A<N.length;A++){var U=N[A];for(ge=U;ge!==null;){var J=ge;switch(J.tag){case 0:case 11:case 15:Bi(8,J,p)}var ne=J.child;if(ne!==null)ne.return=J,ge=ne;else for(;ge!==null;){J=ge;var Q=J.sibling,he=J.return;if(up(J),J===U){ge=null;break}if(Q!==null){Q.return=he,ge=Q;break}ge=he}}}var ye=p.alternate;if(ye!==null){var Te=ye.child;if(Te!==null){ye.child=null;do{var Dt=Te.sibling;Te.sibling=null,Te=Dt}while(Te!==null)}}ge=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,ge=v;else e:for(;ge!==null;){if(p=ge,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Bi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,ge=$;break e}ge=p.return}}var D=e.current;for(ge=D;ge!==null;){v=ge;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,ge=F;else e:for(v=D;ge!==null;){if(N=ge,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:al(9,N)}}catch(Ne){Et(N,N.return,Ne)}if(N===v){ge=null;break e}var oe=N.sibling;if(oe!==null){oe.return=N.return,ge=oe;break e}ge=N.return}}if(Ye=d,Us(),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(nr,e)}catch{}l=!0}return l}finally{Ke=i,Vn.transition=t}}return!1}function Cp(e,t,i){t=Gr(i,t),t=Hf(e,t,1),e=Ws(e,t,1),t=mn(),e!==null&&(or(e,1,t),Cn(e,t))}function Et(e,t,i){if(e.tag===3)Cp(e,e,i);else for(;t!==null;){if(t.tag===3){Cp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Vs===null||!Vs.has(l))){e=Gr(i,e),e=Vf(t,e,1),t=Ws(t,e,1),e=mn(),t!==null&&(or(t,1,e),Cn(t,e));break}}t=t.return}}function ny(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&i,Vt===e&&(Zt&i)===i&&(Ft===4||Ft===3&&(Zt&130023424)===Zt&&500>St()-Ic?gr(e,0):Ac|=i),Cn(e,t)}function Ep(e,t){t===0&&((e.mode&1)===0?t=1:(t=_r,_r<<=1,(_r&130023424)===0&&(_r=4194304)));var i=mn();e=Ts(e,t),e!==null&&(or(e,t,i),Cn(e,i))}function sy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Ep(e,i)}function ry(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(r(314))}l!==null&&l.delete(t),Ep(e,i)}var _p;_p=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sn.current)bn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return bn=!1,Vv(e,t,i);bn=(e.flags&131072)!==0}else bn=!1,wt&&(t.flags&1048576)!==0&&lf(t,Vo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;ol(e,t),e=t.pendingProps;var d=zr(t,rn.current);Hr(t,i),d=cc(null,t,l,e,d,i);var p=uc();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tn(l)?(p=!0,Bo(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,nc(t),d.updater=rl,t.stateNode=d,d._reactInternals=t,gc(t,l,e,i),t=wc(null,t,l,!0,p,i)):(t.tag=0,wt&&p&&Ga(t),hn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(ol(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=oy(l),e=Jn(l,e),d){case 0:t=xc(null,t,l,e,i);break e;case 1:t=ep(null,t,l,e,i);break e;case 11:t=Xf(null,t,l,e,i);break e;case 14:t=Yf(null,t,l,Jn(l.type,e),i);break e}throw Error(r(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),xc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),ep(e,t,l,d,i);case 3:e:{if(tp(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,gf(e,t),Qo(t,l,null,i);var v=t.memoizedState;if(l=v.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Gr(Error(r(423)),t),t=np(e,t,l,i,d);break e}else if(l!==d){d=Gr(Error(r(424)),t),t=np(e,t,l,i,d);break e}else for(Mn=zs(t.stateNode.containerInfo.firstChild),Dn=t,wt=!0,Zn=null,i=hf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ur(),l===d){t=Ns(e,t,i);break e}hn(e,t,l,i)}t=t.child}return t;case 5:return xf(t),e===null&&Xa(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Fa(l,d)?v=null:p!==null&&Fa(l,p)&&(t.flags|=32),Jf(e,t),hn(e,t,v,i),t.child;case 6:return e===null&&Xa(t),null;case 13:return sp(e,t,i);case 4:return sc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Br(t,null,l,i):hn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),Xf(e,t,l,d,i);case 7:return hn(e,t,t.pendingProps,i),t.child;case 8:return hn(e,t,t.pendingProps.children,i),t.child;case 12:return hn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,v=d.value,ut(Ko,l._currentValue),l._currentValue=v,p!==null)if(Qn(p.value,v)){if(p.children===d.children&&!Sn.current){t=Ns(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){v=p.child;for(var A=N.firstContext;A!==null;){if(A.context===l){if(p.tag===1){A=bs(-1,i&-i),A.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var J=U.pending;J===null?A.next=A:(A.next=J.next,J.next=A),U.pending=A}}p.lanes|=i,A=p.alternate,A!==null&&(A.lanes|=i),ec(p.return,i,t),N.lanes|=i;break}A=A.next}}else if(p.tag===10)v=p.type===t.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(r(341));v.lanes|=i,N=v.alternate,N!==null&&(N.lanes|=i),ec(v,i,t),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===t){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}hn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Hr(t,i),d=Wn(d),l=l(d),t.flags|=1,hn(e,t,l,i),t.child;case 14:return l=t.type,d=Jn(l,t.pendingProps),d=Jn(l.type,d),Yf(e,t,l,d,i);case 15:return Qf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),ol(e,t),t.tag=1,Tn(l)?(e=!0,Bo(t)):e=!1,Hr(t,i),Bf(t,l,d),gc(t,l,d,i),wc(null,t,l,!0,e,i);case 19:return ip(e,t,i);case 22:return Zf(e,t,i)}throw Error(r(156,t.tag))};function jp(e,t){return hi(e,t)}function iy(e,t,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(e,t,i,l){return new iy(e,t,i,l)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oy(e){if(typeof e=="function")return Fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===Z)return 14}return 2}function Xs(e,t){var i=e.alternate;return i===null?(i=Gn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function vl(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Fc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case G:return yr(i.children,d,p,t);case q:v=8,d|=8;break;case le:return e=Gn(12,i,t,d|2),e.elementType=le,e.lanes=p,e;case pe:return e=Gn(13,i,t,d),e.elementType=pe,e.lanes=p,e;case Me:return e=Gn(19,i,t,d),e.elementType=Me,e.lanes=p,e;case ce:return yl(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case de:v=10;break e;case me:v=9;break e;case fe:v=11;break e;case Z:v=14;break e;case re:v=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Gn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function yr(e,t,i,l){return e=Gn(7,e,l,t),e.lanes=i,e}function yl(e,t,i,l){return e=Gn(22,e,l,t),e.elementType=ce,e.lanes=i,e.stateNode={isHidden:!1},e}function Uc(e,t,i){return e=Gn(6,e,null,t),e.lanes=i,e}function Bc(e,t,i){return t=Gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ly(e,t,i,l,d){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=vi(0),this.expirationTimes=vi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Wc(e,t,i,l,d,p,v,N,A){return e=new ly(e,t,i,N,A),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Gn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},nc(p),e}function ay(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Rp(e){if(!e)return Fs;e=e._reactInternals;e:{if(Be(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(Tn(i))return sf(e,i,t)}return t}function Ap(e,t,i,l,d,p,v,N,A){return e=Wc(i,l,!0,e,d,p,v,N,A),e.context=Rp(null),i=e.current,l=mn(),d=qs(i),p=bs(l,d),p.callback=t??null,Ws(i,p,d),e.current.lanes=d,or(e,d,l),Cn(e,l),e}function xl(e,t,i,l){var d=t.current,p=mn(),v=qs(d);return i=Rp(i),t.context===null?t.context=i:t.pendingContext=i,t=bs(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Ws(d,t,v),e!==null&&(ns(e,d,v,p),Yo(e,d,v)),v}function wl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hc(e,t){Ip(e,t),(e=e.alternate)&&Ip(e,t)}function cy(){return null}var Dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vc(e){this._internalRoot=e}kl.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));xl(e,t,null,null)},kl.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mr(function(){xl(null,e,null,null)}),t[xs]=null}};function kl(e){this._internalRoot=e}kl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ke();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ls.length&&t!==0&&t<Ls[i].priority;i++);Ls.splice(i,0,e),i===0&&yd(e)}};function Gc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Mp(){}function uy(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=wl(v);p.call(U)}}var v=Ap(t,l,e,0,null,!1,!1,"",Mp);return e._reactRootContainer=v,e[xs]=v.current,ji(e.nodeType===8?e.parentNode:e),mr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var U=wl(A);N.call(U)}}var A=Wc(e,0,!1,null,null,!1,!1,"",Mp);return e._reactRootContainer=A,e[xs]=A.current,ji(e.nodeType===8?e.parentNode:e),mr(function(){xl(t,A,i,l)}),A}function Tl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var N=d;d=function(){var A=wl(v);N.call(A)}}xl(t,v,e,d)}else v=uy(i,t,e,d,l);return wl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=rr(t.pendingLanes);i!==0&&(Ms(t,i|1),Cn(t,St()),(Ye&6)===0&&(Xr=St()+500,Us()))}break;case 13:mr(function(){var l=Ts(e,1);if(l!==null){var d=mn();ns(l,e,1,d)}}),Hc(e,1)}},z=function(e){if(e.tag===13){var t=Ts(e,134217728);if(t!==null){var i=mn();ns(t,e,134217728,i)}Hc(e,134217728)}},Y=function(e){if(e.tag===13){var t=qs(e),i=Ts(e,t);if(i!==null){var l=mn();ns(i,e,t,l)}Hc(e,t)}},ke=function(){return Ke},_e=function(e,t){var i=Ke;try{return Ke=e,t()}finally{Ke=i}},zt=function(e,t,i){switch(t){case"input":if(Mt(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var d=Fo(l);if(!d)throw Error(r(90));Pe(l),Mt(l,d)}}}break;case"textarea":Fe(e,i);break;case"select":t=i.value,t!=null&&Ot(e,!!i.multiple,t,!1)}},te=Oc,ue=mr;var dy={usingClientEntryPoint:!1,Events:[Ii,Pr,Fo,j,ae,Oc]},Gi={findFiberByHostInstance:lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fy={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=br(e),e===null?null:e.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||cy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{nr=bl.inject(fy),An=bl}catch{}}return En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dy,En.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gc(t))throw Error(r(200));return ay(e,t,null,i)},En.createRoot=function(e,t){if(!Gc(e))throw Error(r(299));var i=!1,l="",d=Dp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wc(e,1,!1,null,null,i,!1,l,d),e[xs]=t.current,ji(e.nodeType===8?e.parentNode:e),new Vc(t)},En.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=br(t),e=e===null?null:e.stateNode,e},En.flushSync=function(e){return mr(e)},En.hydrate=function(e,t,i){if(!Sl(t))throw Error(r(200));return Tl(null,e,t,!0,i)},En.hydrateRoot=function(e,t,i){if(!Gc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Dp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=Ap(t,null,e,1,i??null,d,!1,p,v),e[xs]=t.current,ji(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new kl(t)},En.render=function(e,t,i){if(!Sl(t))throw Error(r(200));return Tl(null,e,t,!1,i)},En.unmountComponentAtNode=function(e){if(!Sl(e))throw Error(r(40));return e._reactRootContainer?(mr(function(){Tl(null,null,e,!1,function(){e._reactRootContainer=null,e[xs]=null})}),!0):!1},En.unstable_batchedUpdates=Oc,En.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!Sl(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Tl(e,t,i,!1,l)},En.version="18.3.1-next-f1338f8080-20240426",En}var Bp;function wm(){if(Bp)return Xc.exports;Bp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(s){console.error(s)}}return n(),Xc.exports=ky(),Xc.exports}var Wp;function Sy(){if(Wp)return Nl;Wp=1;var n=wm();return Nl.createRoot=n.createRoot,Nl.hydrateRoot=n.hydrateRoot,Nl}var Ty=Sy();const by=xm(Ty),Hp=n=>{let s;const r=new Set,o=(g,y)=>{const k=typeof g=="function"?g(s):g;if(!Object.is(k,s)){const x=s;s=y??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(T=>T(s,x))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(r.add(g),()=>r.delete(g))},m=s=n(o,a,h);return h},Ny=(n=>n?Hp(n):Hp),Cy=n=>n;function Ey(n,s=Cy){const r=it.useSyncExternalStore(n.subscribe,it.useCallback(()=>s(n.getState()),[n,s]),it.useCallback(()=>s(n.getInitialState()),[n,s]));return it.useDebugValue(r),r}const _y=n=>{const s=Ny(n),r=o=>Ey(s,o);return Object.assign(r,s),r},jy=(n=>_y),km="agentpane:machines",Sm="agentpane:active-machine";function Ry(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Tm(n){return`${n}.repoburg.com`}function bm(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function Nm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function Cm(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function Em(){return Nm(km,[]).filter(s=>Ry(s.mahlas)&&s.hostname===Tm(s.mahlas))}function Ay(n){const s={mahlas:n,hostname:Tm(n),lastConnectedAt:new Date().toISOString()},r=Em(),o=[s,...r.filter(a=>a.mahlas!==n)];return Cm(km,o),s}function Iy(){const n=Nm(Sm,null);return n?Em().find(s=>s.mahlas===n)??null:null}function Dy(n){Cm(Sm,n)}function My(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=bm(n);s&&(Ay(s),Dy(s))}const Vp="http://localhost:9998",Ly=["agent.repoburg.com"];function ms(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),s=n.get("bport");if(s)return`http://localhost:${s}`;const r=n.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Ly.includes(o))return Vp;if(bm(o))return"";const a=Iy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Vp}const Py="/api";async function po(n,s,r){const o=await fetch(`${ms()}${Py}${s}`,{method:n,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${s} failed: ${a}`)}return o.json()}function vn(n){return po("GET",n)}function _t(n,s){return po("POST",n,s)}function ia(n){return po("DELETE",n)}function gs(n,s){return po("PATCH",n,s)}function Oy(n,s){return po("PUT",n,s)}function zy(){return vn("/sessions")}function Ki(n){return vn(`/sessions/${n}`)}function $u(n){return _t("/sessions",n)}function Gp(n){return ia(`/sessions/${n}`)}function _m(n,s,r){return _t(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function $y(n){return _t(`/sessions/${n}/cancel`)}function Fy(n,s){return gs(`/sessions/${n}`,{title:s})}function qp(n){return gs(`/sessions/${n}`,{lifecycle:"finished"})}function Kp(n){return gs(`/sessions/${n}`,{lifecycle:"working"})}function Uy(n,s){return gs(`/sessions/${n}`,{starred:s})}function Xp(n){return gs(`/sessions/${n}`,{has_unreviewed:0})}function By(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),gs(`/sessions/${n}`,a)}function Wy(n,s){return gs(`/sessions/${n}`,{runtime_config:s})}function Hy(n,s){return _t(`/sessions/${n}/rewind`,{turn_id:s})}function Vy(n){return _t(`/sessions/${n}/restore`,{})}function Gy(n,s,r){return _t(`/sessions/${n}/branch`,{turn_id:s,title:r})}function jm(){return vn("/workspaces")}function qy(n,s){return _t("/workspaces",{path:n,label:s})}function Ky(n){return _t("/workspaces/hide",{path:n})}async function Xy(){const n=await fetch(`${ms()}/api/pick-directory`);if(n.status===204)return{cancelled:!0};if(!n.ok)throw new Error(`GET /api/pick-directory failed: ${n.status} ${n.statusText}`);return n.json()}function Rm(){return vn("/folders")}function Yy(n,s){return _t("/folders",{workspace_path:n,name:s})}function Yp(n,s){return gs(`/folders/${n}`,s)}function Qy(n){return ia(`/folders/${n}`)}function Zy(n){return _t("/sessions/reorder",{moves:n})}function ai(n){return n.status==="pending"||n.status==="running"}function Am(n){return!!(n!=null&&n.turns.some(ai))}function oa(n){return n?n.turns.some(ai)||(n.threads??[]).some(s=>(s.turns??[]).some(ai)):!1}async function Jy(n,s){const r=await Promise.allSettled(n.map(u=>s(u))),o=new Map;let a=null;return r.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function Qp(n,s){const r={...n.sessionDetails};s.forEach(h=>delete r[h]);const o={...n.backgroundTasks};s.forEach(h=>delete o[h]);const a=n.openTabs.filter(h=>!s.has(h));let u=n.activeSessionId,f=n.activeTurnIndex;if(u&&s.has(u)){u=a.length>0?a[a.length-1]:null;const h=u?r[u]:null;f=h&&h.turns.length>0?h.turns.length-1:0}return{sessions:n.sessions.filter(h=>!s.has(h.id)),sessionDetails:r,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function ex(n){const s={...n};return delete s.turns,delete s.threads,delete s.contextUsage,s}async function Zp(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Jy(r,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${m} ${u.size} of ${r.length} — ${h} failed`)}}const tx=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var r;try{const o=localStorage.getItem("agentpane:last-model-config");o&&n({lastModelConfig:JSON.parse(o)})}catch{}n({loading:!0,error:null});try{const[o,a,u]=await Promise.all([zy(),jm(),Rm()]);n({sessions:o,workspaces:a,folders:u,loading:!1});const f=new URLSearchParams(window.location.search),h=f.get("session"),m=f.get("thread"),g=h&&o.some(y=>y.id===h)?h:(r=o[0])==null?void 0:r.id;g&&!s().activeSessionId&&await s().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async r=>{if(s().sessionDetails[r]){const o=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,openTabs:s().openTabs.includes(r)?s().openTabs:[...s().openTabs,r]}),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await Ki(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",activeAppTabId:null,loading:!1})),o.has_unreviewed===1&&(Xp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:r=>{n(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){n({error:null});try{const f=await By(u,r,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),n(m=>({sessions:m.sessions.map(g=>g.id===u?f:g),sessionDetails:m.sessionDetails[u]?{...m.sessionDetails,[u]:{...m.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:m.sessionDetails})),await s().refreshActiveSession()}catch(f){n({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{n({error:null});try{const o=await $u(r);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{n(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=s().sessionDetails[r];if(!o){const a=await Ki(r);n(u=>({sessionDetails:{...u.sessionDetails,[r]:a}})),o=a}s().sessions.some(a=>a.id===r)||s().addSession(ex(o)),await s().selectSession(r)},deleteSession:async r=>{var a;n({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await Gp(r),n(u=>Qp(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{n({error:null});try{const a=await Fy(r,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{n({error:null});try{const o=await qp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Zp(n,s,r,qp,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await Uy(r,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{n({error:null});try{const o=await Kp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){n({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Zp(n,s,r,Kp,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Gp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){n({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}n(f=>Qp(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){n({error:null,submittingPrompt:r}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await _m(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const m=h.turns.findIndex(y=>y.id===u.id);if(m>=0)return{submittingPrompt:null,activeTurnIndex:m};const g={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,g]}},activeTurnIndex:h.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=oa(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:m,status:m?"running":"active"}},sessions:f.sessions.map(g=>g.id===a?{...g,is_running:m,status:m?"running":"active"}:g)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await $y(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await Hy(r,o),u=await Ki(r);n(f=>({sessionDetails:{...f.sessionDetails,[r]:u},sessions:f.sessions.map(h=>h.id===r?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),s().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{n({error:null});try{const o=await Vy(r),a=await Ki(r);n(u=>({sessionDetails:{...u.sessionDetails,[r]:a},sessions:u.sessions.map(f=>f.id===r?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{n({error:null});try{const u=await Gy(r,o,a);n(f=>({sessions:[u,...f.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){n({error:null});try{const a=await Wy(o,JSON.stringify(r));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await Ki(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),nx=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await qy(r.trim());n(a=>({workspaces:[...a.workspaces,o]})),s().addToast("success",`Workspace added — ${o.path}`)}catch(o){s().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async r=>{n({error:null});try{await Ky(r);const o=await jm();n({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{n({error:null});try{const o=s().lastModelConfig,a=await $u({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await Xy();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),Sr=new Map,Fu=new Map,Uu=new Map,Bu=new Map;function sx(n,s){Sr.set(n,s)}function rx(n){Sr.delete(n)}function Zc(n,s){Fu.set(n,s)}function Jp(n,s,r){const o=Fu.get(n);if(!o)return;const a=Sr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function ix(n,s,r,o){const a=Sr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function ox(n,s,r,o){const a=Fu.get(n);if(!a)return;const u=Sr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function lx(n,s){Uu.set(n,s)}function ax(n){Uu.delete(n)}function cx(n,s){Bu.set(n,s)}function ux(n){Bu.delete(n)}function dx(n){var r;const s=Sr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Bu.get(n))==null||r()}function fx(n){var r;const s=Sr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Uu.get(n))==null||r()}const px=(n,s)=>({wsConnected:!1,backgroundTasks:{},setWsConnected:r=>n({wsConnected:r}),onTurnCreated:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[r]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=Cl(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(m=>m.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Es(f,o,m=>({...m,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===r&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>eu(h,a))}}:{}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>eu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?s().addToast("success",`${g} completed: ${h}`):s().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>{var g,y;let m=eu(h,a);if(a.type==="agent_message"&&((g=a.data)!=null&&g.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((y=a.data)!=null&&y.text)){const k=m.thoughts?m.thoughts+`
|
|
41
|
-
`+a.data.text:a.data.text;m={...m,thoughts:k}}return m})}}:{}})},onItemDelta:(r,o,a,u)=>{ox(r,o,a,u),n(f=>{const h=f.sessionDetails[r];return h?{sessionDetails:{...f.sessionDetails,[r]:Es(h,o,m=>hx(m,a,u))}}:{}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Jp(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),n(g=>{const y=g.sessionDetails[r],k=y?Es(y,o,C=>({...C,status:"completed",token_usage:a??C.token_usage??null,...f&&!C.agent_response?{agent_response:f}:{}})):null,x=Jc(k),T=x?"running":"active",E=Cl(g.sessions,r,C=>({is_running:x,status:T,has_unreviewed:u?1:C.has_unreviewed}));return k?{sessionDetails:{...g.sessionDetails,[r]:{...k,is_running:x,status:T,has_unreviewed:u?1:k.has_unreviewed}},sessions:E}:{sessions:E}})},onTokenUsageUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Es(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),Jp(r,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[r],h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=f?Es(f,o,T=>({...T,status:m,error:a,items:T.items.map(E=>E.status==="in_progress"?{...E,status:"failed"}:E)})):null,y=Jc(g),k=y?"running":h?"active":"failed",x=Cl(u.sessions,r,()=>({is_running:y,status:k}));return g?{sessionDetails:{...u.sessionDetails,[r]:{...g,is_running:y,status:k}},sessions:x}:{sessions:x}})},onTurnCancelled:(r,o)=>{n(a=>{const u=a.sessionDetails[r],f=u?Es(u,o,y=>({...y,status:"aborted",items:y.items.map(k=>k.status==="in_progress"?{...k,status:"completed"}:k)})):null,h=Jc(f),m=h?"running":"active",g=Cl(a.sessions,r,()=>({is_running:h,status:m}));return f?{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:m}},sessions:g}:{sessions:g}})},onSessionTitle:(r,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(r,o)=>{n(a=>{if(o.length===0&&!a.backgroundTasks[r])return{};const u={...a.backgroundTasks};return o.length>0?u[r]=o:delete u[r],{backgroundTasks:u}})},onBackgroundTasksSnapshot:r=>{const o={};for(const[a,u]of Object.entries(r))u.length>0&&(o[a]=u);n({backgroundTasks:o})}});function Jc(n){return n&&(n.turns.some(ai)||(n.threads??[]).some(r=>(r.turns??[]).some(ai)))?1:0}function Cl(n,s,r){return n.some(o=>o.id===s)?n.map(o=>o.id===s?{...o,...r(o)}:o):n}function Es(n,s,r){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===s)?{...a,turns:(a.turns??[]).map(u=>u.id===s?r(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===s?r(a):a),threads:o}}function eu(n,s){const r=n.items.findIndex(o=>o.external_item_id===s.external_item_id);if(r>=0){const o=[...n.items];return o[r]=s,{...n,items:o}}if(s.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,s]}}return{...n,items:[...n.items,s]}}function hx(n,s,r){var u;const o=n.items.findIndex(f=>f.external_item_id===s);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+r,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${s}`,turn_id:n.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:r}}function mx(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return vn(`/providers/${n}/models${r}`)}const vu=160,yu=480,gx=240,$l=220,vx=300,yx=600;function Fl(){return typeof window>"u"?yx:Math.max($l,Math.round(window.innerWidth*.7))}const eh="agentpane:sidebar-width",th="agentpane:right-panel-width";function nh(n,s,r,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}const sh=200,xx=(n,s)=>({activeRightTab:"turns",changesScope:"session",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,selectedChangePath:null,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:nh(eh,vu,yu,gx),rightPanelWidth:nh(th,$l,Fl(),vx),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:r=>n({activeTurnIndex:r}),switchRightTab:r=>n({activeRightTab:r}),setChangesScope:r=>n({changesScope:r}),setShowNewSessionDialog:r=>n({showNewSessionDialog:r}),setShowRemoteModal:r=>n({showRemoteModal:r}),setShowCommandPalette:r=>n({showCommandPalette:r}),setShowModelSelector:r=>n({showModelSelector:r}),setSelectedChangePath:r=>n({selectedChangePath:r}),setDeepLinkThreadId:r=>n({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(yu,Math.max(vu,Math.round(r)));n({sidebarWidth:o});try{localStorage.setItem(eh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(Fl(),Math.max($l,Math.round(r)));n({rightPanelWidth:o});try{localStorage.setItem(th,String(o))}catch{}},toggleVscodeView:()=>{if(s().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>n({vscodeState:r,vscodeId:o,vscodeToken:a}),addToast:(r,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:r,message:o,undoAction:a,undoLabel:u}]}))},removeToast:r=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:r,message:o}];return f.length>sh&&f.splice(0,f.length-sh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await mx(r,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),wx=(n,s)=>({createThread:async(r,o)=>{try{await _t(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){s().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(r,o,a)=>{try{await _t(`/sessions/${r}/threads/${o}/followup`,{message:a}),s().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await _t(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(a){s().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await gs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await gs(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){s().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const u=await _t(`/sessions/${r}/threads/${o}/summarize`,{directives:a}),f=`
|
|
42
|
-
[Shared from a resolved discussion thread — summary of its findings]
|
|
43
|
-
|
|
44
|
-
\`\`\`QUOTE
|
|
45
|
-
${u.summary}
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
`;return n({quotedText:f}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await ia(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];if(!f)return{};const h=(f.threads??[]).map(m=>m.id===o?{...m,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:m);return{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),kx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await Rm();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await Yy(r,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await Yp(r,{name:o});n(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await Qy(r)}catch(u){n({folders:o,sessions:a}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,a=new Map(r.map(u=>[u.id,u]));n(u=>({sessions:u.sessions.map(f=>{const h=a.get(f.id);return h?{...f,folder_id:h.folder_id,sort_order:h.sort_order}:f})}));try{await Zy(r)}catch(u){n({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(r.map((u,f)=>Yp(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function rh(){return vn("/apps")}function Sx(){return vn("/apps/root")}function ih(n){return vn(`/apps/${n}/source`)}function oh(n,s=""){return vn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function Im(n,s,r=""){return Oy(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function Tx(n){return ia(`/apps/${n}`)}function bx(n){return vn(`/apps/${n}/sessions`)}function Nx(){return vn("/apps/examples")}function Cx(n){return _t(`/apps/examples/${n}/install`,{})}function Ex(n){return _t("/apps",n)}function _x(n,s){return _t("/apps/import",{id:n,files:s})}function jx(n,s,r){return _t(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function Rx(n,s){return _t(`/apps/${n}/edit-session`,s)}const Ml=new Set;async function tu(n,s){Ml.add(s),await n().loadApps();const r=n().apps.find(o=>o.id===s);n().openAppTab(s),n().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const xu="agentpane:app-workspaces";function Ax(){try{const n=JSON.parse(localStorage.getItem(xu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const Ix=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Ax(),loadApps:async()=>{try{const[r,o]=await Promise.all([rh(),Sx().catch(()=>null)]);r.forEach(a=>Ml.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r})}catch{}},refreshApps:async()=>{try{const r=await rh();for(const o of r)Ml.has(o.id)||(Ml.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));n({apps:r})}catch{}},openAppTab:r=>{n(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>n({activeAppTabId:r}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{n(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await Cx(r),await tu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await Ex(r),await tu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await _x(r,o),await tu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await Rx(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await s().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await Im(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await Tx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(xu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),lh=3e3,On={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},zn=[];let Ul=0,Wu=0,Bl=0,Hu=0,Wl=0,Vu=0,Gu=0;const lo=new Map,ao=new Map;let si=new Map,ti=0,ri=new Map,nu=!1;function Hl(n,s,r){if(zn.push({t:Date.now(),cat:n,msg:s,ms:r}),zn.length>lh){const o=zn.length-lh;zn.splice(0,o),_n=Math.max(0,_n-o)}}function ni(n,s,r){Hl(n,s,r),console.log(`[perf:${n}] ${s}`)}function Dm(n){ni("note",n)}function Mm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Dx(n,s){let r=si.get(n);r||si.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=lo.get(n);o||lo.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Mx(){ti++,Gu++}function Lx(n){ri.set(n,(ri.get(n)??0)+1),ao.set(n,(ao.get(n)??0)+1)}let Ll=0;function Px(){Ll=performance.now()}function Ox(){const n=performance.now(),s=Ll?n-Ll:null;Ll=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>On.keypressMs&&ni("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const zx=5e3,Lm=500,ah=2e3;let _n=0,su=!1;function $x(n){return _t("/perf-log",{entries:n}).then(()=>{_n+=n.length})}function Fx(){if(su||_n>=zn.length)return;const n=zn.slice(_n,_n+Lm);n.length!==0&&(su=!0,$x(n).catch(()=>{zn.length-_n>ah&&(_n=Math.max(_n,zn.length-ah))}).finally(()=>{su=!1}))}function ch(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||_n>=zn.length)return;const n=zn.slice(_n,_n+Lm);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ms()}/api/perf-log`,s),_n+=n.length}catch{}}function Ux(){let n=0;for(const o of si.values())n+=o.n;const s=[];if(n>0){const o=[...si.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Mm(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}ti>0&&s.push(`store ${ti}/s`);const r=[...ri.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");Hl("stat",o);const a=[...ri.values()].some(u=>u>On.renderPerSecLog);(n>On.wsPerSecLog||ti>On.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}si=new Map,ti=0,ri=new Map}function Bx(n){if(n instanceof Element){const s=n.id?`#${n.id}`:"",r=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${s}${r}`}return n?"window":"unknown"}function Wx(){if(nu||typeof window>"u")return()=>{};nu=!0,Ul=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>On.lagMs&&(Wu++,Bl=Math.max(Bl,f),ni("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>On.frameGapMs&&ni("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const m of f.getEntries()){const g=m.duration;if(g<On.longtaskBufferMs)continue;Hu++,Wl=Math.max(Wl,g);const y=(h=m.attribution)==null?void 0:h[0],k=(y==null?void 0:y.containerName)||(y==null?void 0:y.name)||"unknown",x=`long task ${Math.round(g)}ms (${k})`;g>=On.longtaskLogMs?ni("longtask",x,g):Hl("longtask",x,g)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const m=h.duration,g=h.processingStart-h.startTime;Vu++;const y=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${Bx(h.target)}`;m>=On.eventLogMs?ni("input",y,m):Hl("input",y,m)}});u.observe({type:"event",durationThreshold:On.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(Ux,1e3);n.push(()=>window.clearInterval(o)),Dm("perf logger session started");const a=window.setInterval(Fx,zx);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ch),n.push(()=>window.removeEventListener("beforeunload",ch)),window.__agentPanePerf={dump:Pm,reset:Om},()=>{n.forEach(u=>u()),nu=!1}}function Pm(){const n=[],s=Ul?Math.round((Date.now()-Ul)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${zn.length} buffered entries`),n.push(`event-loop lag: ${Wu} blocks >${On.lagMs}ms (max ${Math.round(Bl)}ms)`),n.push(`long tasks: ${Hu} ≥${On.longtaskBufferMs}ms (max ${Math.round(Wl)}ms)`),n.push(`slow input events (≥${On.eventBufferMs}ms): ${Vu}`),n.push(`store updates: ${Gu} total`),lo.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...lo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Mm(o.bytes)}`)}if(ao.size>0){n.push("render counts by component:");for(const[r,o]of[...ao.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of zn.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
|
|
49
|
-
`)}function Om(){zn.length=0,_n=0,Ul=Date.now(),Wu=0,Bl=0,Hu=0,Wl=0,Vu=0,Gu=0,lo.clear(),ao.clear(),si=new Map,ti=0,ri=new Map}const en={start:Wx,note:Dm,trackWsEvent:Dx,trackStoreUpdate:Mx,trackRender:Lx,markKeystroke:Px,markInputChange:Ox,dump:Pm,reset:Om},L=jy()((...n)=>({...tx(...n),...nx(...n),...px(...n),...xx(...n),...wx(...n),...kx(...n),...Ix(...n)}));typeof window<"u"&&L.subscribe(()=>en.trackStoreUpdate());function wu(n){switch(n){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Hx(n,s,r=!1,o="working",a=0){if(o==="finished")return"";if(s)return"running";if(a>0)return"background";if(r&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Vx(n,s,r=!1,o="working",a=0){if(o==="finished")return"Finished";if(s)return"Running";if(a>0)return"Background";if(r&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function la(n,s=0){const r=n.is_running===1,o=n.lifecycle==="finished",a=wu(n.runtime_type),u=Hx(n.status,r,n.has_unreviewed===1,n.lifecycle,s),f=Vx(n.status,r,n.has_unreviewed===1,n.lifecycle,s);return{dot:u,label:f,dotTitle:u==="background"?`${s} background task${s===1?"":"s"} running`:f,iconClass:a.iconClass,iconText:a.iconText,isRunning:r,isFinished:o,backgroundTaskCount:s}}function aa(n,s,r=!0){w.useEffect(()=>{if(!r)return;function o(a){n.current&&!n.current.contains(a.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,s,r])}function qu(n,s=!0){w.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n,s])}function Ku({status:n,size:s=6,title:r}){return c.jsx("span",{className:`status-dot ${n}`,style:s!==6?{width:s,height:s}:void 0,title:r})}function Xu({iconClass:n,iconText:s,size:r=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
|
|
50
|
-
* @license lucide-react v0.469.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const Gx=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zm=(...n)=>n.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v0.469.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var qx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
|
-
* @license lucide-react v0.469.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Kx=w.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>w.createElement("svg",{ref:m,...qx,width:s,height:s,stroke:n,strokeWidth:o?Number(r)*24/Number(s):r,className:zm("lucide",a),...h},[...f.map(([g,y])=>w.createElement(g,y)),...Array.isArray(u)?u:[u]]));/**
|
|
65
|
-
* @license lucide-react v0.469.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const Ce=(n,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(Kx,{ref:u,iconNode:s,className:zm(`lucide-${Gx(n)}`,o),...a}));return r.displayName=`${n}`,r};/**
|
|
70
|
-
* @license lucide-react v0.469.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const Xx=Ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
75
|
-
* @license lucide-react v0.469.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const ku=Ce("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
80
|
-
* @license lucide-react v0.469.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const Yx=Ce("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
85
|
-
* @license lucide-react v0.469.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const er=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
90
|
-
* @license lucide-react v0.469.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const ii=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
95
|
-
* @license lucide-react v0.469.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const Yu=Ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
100
|
-
* @license lucide-react v0.469.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const Qu=Ce("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
105
|
-
* @license lucide-react v0.469.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Qx=Ce("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
110
|
-
* @license lucide-react v0.469.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const Vl=Ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
115
|
-
* @license lucide-react v0.469.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const Zx=Ce("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
120
|
-
* @license lucide-react v0.469.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Jx=Ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
125
|
-
* @license lucide-react v0.469.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const e0=Ce("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
130
|
-
* @license lucide-react v0.469.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const $m=Ce("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
135
|
-
* @license lucide-react v0.469.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const uh=Ce("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
140
|
-
* @license lucide-react v0.469.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Su=Ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
145
|
-
* @license lucide-react v0.469.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const t0=Ce("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
150
|
-
* @license lucide-react v0.469.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const n0=Ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
155
|
-
* @license lucide-react v0.469.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const s0=Ce("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
160
|
-
* @license lucide-react v0.469.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const r0=Ce("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
165
|
-
* @license lucide-react v0.469.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const Fm=Ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
170
|
-
* @license lucide-react v0.469.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const ru=Ce("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
175
|
-
* @license lucide-react v0.469.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const Tu=Ce("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
180
|
-
* @license lucide-react v0.469.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const i0=Ce("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
185
|
-
* @license lucide-react v0.469.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const o0=Ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
190
|
-
* @license lucide-react v0.469.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const l0=Ce("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
195
|
-
* @license lucide-react v0.469.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const a0=Ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
200
|
-
* @license lucide-react v0.469.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const c0=Ce("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
205
|
-
* @license lucide-react v0.469.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const u0=Ce("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
210
|
-
* @license lucide-react v0.469.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const rs=Ce("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
215
|
-
* @license lucide-react v0.469.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const d0=Ce("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
220
|
-
* @license lucide-react v0.469.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const f0=Ce("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
225
|
-
* @license lucide-react v0.469.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const p0=Ce("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
230
|
-
* @license lucide-react v0.469.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const h0=Ce("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
235
|
-
* @license lucide-react v0.469.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const dh=Ce("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
|
|
240
|
-
* @license lucide-react v0.469.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const m0=Ce("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
245
|
-
* @license lucide-react v0.469.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const g0=Ce("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
250
|
-
* @license lucide-react v0.469.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const Pl=Ce("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
255
|
-
* @license lucide-react v0.469.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const v0=Ce("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
260
|
-
* @license lucide-react v0.469.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const y0=Ce("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
265
|
-
* @license lucide-react v0.469.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const wr=Ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
270
|
-
* @license lucide-react v0.469.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const Um=Ce("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
275
|
-
* @license lucide-react v0.469.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const x0=Ce("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
|
|
280
|
-
* @license lucide-react v0.469.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const co=Ce("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
285
|
-
* @license lucide-react v0.469.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const Bm=Ce("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
|
|
290
|
-
* @license lucide-react v0.469.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const w0=Ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
295
|
-
* @license lucide-react v0.469.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const ca=Ce("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
300
|
-
* @license lucide-react v0.469.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const k0=Ce("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
305
|
-
* @license lucide-react v0.469.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const ci=Ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
310
|
-
* @license lucide-react v0.469.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const Gl=Ce("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
315
|
-
* @license lucide-react v0.469.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const Wm=Ce("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
320
|
-
* @license lucide-react v0.469.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const hs=Ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
325
|
-
* @license lucide-react v0.469.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const S0=Ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
330
|
-
* @license lucide-react v0.469.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const T0=Ce("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
335
|
-
* @license lucide-react v0.469.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const b0=Ce("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
340
|
-
* @license lucide-react v0.469.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const N0=Ce("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
345
|
-
* @license lucide-react v0.469.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const C0=Ce("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
350
|
-
* @license lucide-react v0.469.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const $n=Ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
355
|
-
* @license lucide-react v0.469.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const E0=Ce("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var eo=wm();function _0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>o=>{s.forEach(a=>a(o))},s)}const ua=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ui(n){const s=Object.prototype.toString.call(n);return s==="[object Window]"||s==="[object global]"}function Zu(n){return"nodeType"in n}function yn(n){var s,r;return n?ui(n)?n:Zu(n)&&(s=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ju(n){const{Document:s}=yn(n);return n instanceof s}function ho(n){return ui(n)?!1:n instanceof yn(n).HTMLElement}function Hm(n){return n instanceof yn(n).SVGElement}function di(n){return n?ui(n)?n.document:Zu(n)?Ju(n)?n:ho(n)||Hm(n)?n.ownerDocument:document:document:document}const is=ua?w.useLayoutEffect:w.useEffect;function da(n){const s=w.useRef(n);return is(()=>{s.current=n}),w.useCallback(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return s.current==null?void 0:s.current(...o)},[])}function j0(){const n=w.useRef(null),s=w.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),r=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[s,r]}function uo(n,s){s===void 0&&(s=[n]);const r=w.useRef(n);return is(()=>{r.current!==n&&(r.current=n)},s),r}function mo(n,s){const r=w.useRef();return w.useMemo(()=>{const o=n(r.current);return r.current=o,o},[...s])}function ql(n){const s=da(n),r=w.useRef(null),o=w.useCallback(a=>{a!==r.current&&(s==null||s(a,r.current)),r.current=a},[]);return[r,o]}function Kl(n){const s=w.useRef();return w.useEffect(()=>{s.current=n},[n]),s.current}let iu={};function go(n,s){return w.useMemo(()=>{if(s)return s;const r=iu[n]==null?0:iu[n]+1;return iu[n]=r,n+"-"+r},[n,s])}function Vm(n){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[m,g]of h){const y=u[m];y!=null&&(u[m]=y+n*g)}return u},{...s})}}const oi=Vm(1),Xl=Vm(-1);function R0(n){return"clientX"in n&&"clientY"in n}function fa(n){if(!n)return!1;const{KeyboardEvent:s}=yn(n.target);return s&&n instanceof s}function A0(n){if(!n)return!1;const{TouchEvent:s}=yn(n.target);return s&&n instanceof s}function Yl(n){if(A0(n)){if(n.touches&&n.touches.length){const{clientX:s,clientY:r}=n.touches[0];return{x:s,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:s,clientY:r}=n.changedTouches[0];return{x:s,y:r}}}return R0(n)?{x:n.clientX,y:n.clientY}:null}const As=Object.freeze({Translate:{toString(n){if(!n)return;const{x:s,y:r}=n;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:s,scaleY:r}=n;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[As.Translate.toString(n),As.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:s,duration:r,easing:o}=n;return s+" "+r+"ms "+o}}}),fh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function I0(n){return n.matches(fh)?n:n.querySelector(fh)}const D0={display:"none"};function M0(n){let{id:s,value:r}=n;return it.createElement("div",{id:s,style:D0},r)}function L0(n){let{id:s,announcement:r,ariaLiveType:o="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return it.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function P0(){const[n,s]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&s(o)},[]),announcement:n}}const Gm=w.createContext(null);function O0(n){const s=w.useContext(Gm);w.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(n)},[n,s])}function z0(){const[n]=w.useState(()=>new Set),s=w.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[w.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),s]}const $0={draggable:`
|
|
360
|
-
To pick up a draggable item, press the space bar.
|
|
361
|
-
While dragging, use the arrow keys to move the item.
|
|
362
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
363
|
-
`},F0={onDragStart(n){let{active:s}=n;return"Picked up draggable item "+s.id+"."},onDragOver(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(n){let{active:s}=n;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function U0(n){let{announcements:s=F0,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=$0}=n;const{announce:u,announcement:f}=P0(),h=go("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),O0(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(s.onDragStart({active:x}))},onDragMove(k){let{active:x,over:T}=k;s.onDragMove&&u(s.onDragMove({active:x,over:T}))},onDragOver(k){let{active:x,over:T}=k;u(s.onDragOver({active:x,over:T}))},onDragEnd(k){let{active:x,over:T}=k;u(s.onDragEnd({active:x,over:T}))},onDragCancel(k){let{active:x,over:T}=k;u(s.onDragCancel({active:x,over:T}))}}),[u,s])),!m)return null;const y=it.createElement(it.Fragment,null,it.createElement(M0,{id:o,value:a.draggable}),it.createElement(L0,{id:h,announcement:f}));return r?eo.createPortal(y,r):y}var Ut;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ut||(Ut={}));function Ql(){}function B0(n,s){return w.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function W0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return w.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const os=Object.freeze({x:0,y:0});function H0(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function V0(n,s){const r=Yl(n);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function G0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function q0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function K0(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function ph(n,s,r){return s===void 0&&(s=n.left),r===void 0&&(r=n.top),{x:s+n.width*.5,y:r+n.height*.5}}const X0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=ph(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,m=r.get(h);if(m){const g=H0(ph(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(G0)};function Y0(n,s){const r=Math.max(s.top,n.top),o=Math.max(s.left,n.left),a=Math.min(s.left+s.width,n.left+n.width),u=Math.min(s.top+s.height,n.top+n.height),f=a-o,h=u-r;if(o<a&&r<u){const m=s.width*s.height,g=n.width*n.height,y=f*h,k=y/(m+g-y);return Number(k.toFixed(4))}return 0}const Q0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const m=Y0(h,s);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(q0)};function Z0(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function qm(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:os}function J0(n){return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...r})}}const ew=J0(1);function Km(n){if(n.startsWith("matrix3d(")){const s=n.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(n.startsWith("matrix(")){const s=n.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function tw(n,s,r){const o=Km(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(r),g=n.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),y=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:y,height:k,top:g,right:m+y,bottom:g+k,left:m}}const nw={ignoreTransform:!1};function fi(n,s){s===void 0&&(s=nw);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:g,transformOrigin:y}=yn(n).getComputedStyle(n);g&&(r=tw(r,g,y))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function hh(n){return fi(n,{ignoreTransform:!0})}function sw(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function rw(n,s){return s===void 0&&(s=yn(n).getComputedStyle(n)),s.position==="fixed"}function iw(n,s){s===void 0&&(s=yn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function ed(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(Ju(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!ho(a)||Hm(a)||r.includes(a))return r;const u=yn(n).getComputedStyle(a);return a!==n&&iw(a,u)&&r.push(a),rw(a,u)?r:o(a.parentNode)}return n?o(n):r}function Xm(n){const[s]=ed(n,1);return s??null}function ou(n){return!ua||!n?null:ui(n)?n:Zu(n)?Ju(n)||n===di(n).scrollingElement?window:ho(n)?n:null:null}function Ym(n){return ui(n)?n.scrollX:n.scrollLeft}function Qm(n){return ui(n)?n.scrollY:n.scrollTop}function bu(n){return{x:Ym(n),y:Qm(n)}}var Xt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Xt||(Xt={}));function Zm(n){return!ua||!n?!1:n===document.scrollingElement}function Jm(n){const s={x:0,y:0},r=Zm(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},a=n.scrollTop<=s.y,u=n.scrollLeft<=s.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:s}}const ow={x:.2,y:.2};function lw(n,s,r,o,a){let{top:u,left:f,right:h,bottom:m}=r;o===void 0&&(o=10),a===void 0&&(a=ow);const{isTop:g,isBottom:y,isLeft:k,isRight:x}=Jm(n),T={x:0,y:0},E={x:0,y:0},C={height:s.height*a.y,width:s.width*a.x};return!g&&u<=s.top+C.height?(T.y=Xt.Backward,E.y=o*Math.abs((s.top+C.height-u)/C.height)):!y&&m>=s.bottom-C.height&&(T.y=Xt.Forward,E.y=o*Math.abs((s.bottom-C.height-m)/C.height)),!x&&h>=s.right-C.width?(T.x=Xt.Forward,E.x=o*Math.abs((s.right-C.width-h)/C.width)):!k&&f<=s.left+C.width&&(T.x=Xt.Backward,E.x=o*Math.abs((s.left+C.width-f)/C.width)),{direction:T,speed:E}}function aw(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:s,left:r,right:o,bottom:a}=n.getBoundingClientRect();return{top:s,left:r,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function eg(n){return n.reduce((s,r)=>oi(s,bu(r)),os)}function cw(n){return n.reduce((s,r)=>s+Ym(r),0)}function uw(n){return n.reduce((s,r)=>s+Qm(r),0)}function tg(n,s){if(s===void 0&&(s=fi),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);Xm(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const dw=[["x",["left","right"],cw],["y",["top","bottom"],uw]];class td{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ed(r),a=eg(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of dw)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=h(o),y=a[u]-g;return this.rect[m]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class no{constructor(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var a;(a=this.target)==null||a.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function fw(n){const{EventTarget:s}=yn(n);return n instanceof s?n:di(n)}function lu(n,s){const r=Math.abs(n.x),o=Math.abs(n.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var Kn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Kn||(Kn={}));function mh(n){n.preventDefault()}function pw(n){n.stopPropagation()}var et;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(et||(et={}));const ng={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},hw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case et.Right:return{...r,x:r.x+25};case et.Left:return{...r,x:r.x-25};case et.Down:return{...r,y:r.y+25};case et.Up:return{...r,y:r.y-25}}};class sg{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new no(di(r)),this.windowListeners=new no(yn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Kn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&tg(o),r(os)}handleKeyDown(s){if(fa(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=ng,coordinateGetter:f=hw,scrollBehavior:h="smooth"}=a,{code:m}=s;if(u.end.includes(m)){this.handleEnd(s);return}if(u.cancel.includes(m)){this.handleCancel(s);return}const{collisionRect:g}=o.current,y=g?{x:g.left,y:g.top}:os;this.referenceCoordinates||(this.referenceCoordinates=y);const k=f(s,{active:r,context:o.current,currentCoordinates:y});if(k){const x=Xl(k,y),T={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const b=s.code,{isTop:M,isRight:I,isLeft:W,isBottom:O,maxScroll:B,minScroll:K}=Jm(C),G=aw(C),q={x:Math.min(b===et.Right?G.right-G.width/2:G.right,Math.max(b===et.Right?G.left:G.left+G.width/2,k.x)),y:Math.min(b===et.Down?G.bottom-G.height/2:G.bottom,Math.max(b===et.Down?G.top:G.top+G.height/2,k.y))},le=b===et.Right&&!I||b===et.Left&&!W,de=b===et.Down&&!O||b===et.Up&&!M;if(le&&q.x!==k.x){const me=C.scrollLeft+x.x,fe=b===et.Right&&me<=B.x||b===et.Left&&me>=K.x;if(fe&&!x.y){C.scrollTo({left:me,behavior:h});return}fe?T.x=C.scrollLeft-me:T.x=b===et.Right?C.scrollLeft-B.x:C.scrollLeft-K.x,T.x&&C.scrollBy({left:-T.x,behavior:h});break}else if(de&&q.y!==k.y){const me=C.scrollTop+x.y,fe=b===et.Down&&me<=B.y||b===et.Up&&me>=K.y;if(fe&&!x.x){C.scrollTo({top:me,behavior:h});return}fe?T.y=C.scrollTop-me:T.y=b===et.Down?C.scrollTop-B.y:C.scrollTop-K.y,T.y&&C.scrollBy({top:-T.y,behavior:h});break}}this.handleMove(s,oi(Xl(k,this.referenceCoordinates),T))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sg.activators=[{eventName:"onKeyDown",handler:(n,s,r)=>{let{keyboardCodes:o=ng,onActivation:a}=s,{active:u}=r;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function gh(n){return!!(n&&"distance"in n)}function vh(n){return!!(n&&"delay"in n)}class nd{constructor(s,r,o){var a;o===void 0&&(o=fw(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=di(f),this.documentListeners=new no(this.document),this.listeners=new no(o),this.windowListeners=new no(yn(f)),this.initialCoordinates=(a=Yl(u))!=null?a:os,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(Kn.Resize,this.handleCancel),this.windowListeners.add(Kn.DragStart,mh),this.windowListeners.add(Kn.VisibilityChange,this.handleCancel),this.windowListeners.add(Kn.ContextMenu,mh),this.documentListeners.add(Kn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(vh(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(gh(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(Kn.Click,pw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Kn.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(r=Yl(s))!=null?r:os,g=Xl(a,m);if(!o&&h){if(gh(h)){if(h.tolerance!=null&&lu(g,h.tolerance))return this.handleCancel();if(lu(g,h.distance))return this.handleStart()}if(vh(h)&&lu(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}s.cancelable&&s.preventDefault(),f(m)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===et.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const mw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sd extends nd{constructor(s){const{event:r}=s,o=di(r.target);super(s,mw,o)}}sd.activators=[{eventName:"onPointerDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const gw={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(n){n[n.RightClick=2]="RightClick"})(Nu||(Nu={}));class vw extends nd{constructor(s){super(s,gw,di(s.event.target))}}vw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Nu.RightClick?!1:(o==null||o({event:r}),!0)}}];const au={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class yw extends nd{constructor(s){super(s,au)}static setup(){return window.addEventListener(au.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(au.move.name,s)};function s(){}}}yw.activators=[{eventName:"onTouchStart",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var so;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(so||(so={}));var Zl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zl||(Zl={}));function xw(n){let{acceleration:s,activator:r=so.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Zl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:y,delta:k,threshold:x}=n;const T=kw({delta:k,disabled:!u}),[E,C]=j0(),b=w.useRef({x:0,y:0}),M=w.useRef({x:0,y:0}),I=w.useMemo(()=>{switch(r){case so.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case so.DraggableRect:return a}},[r,a,m]),W=w.useRef(null),O=w.useCallback(()=>{const K=W.current;if(!K)return;const G=b.current.x*M.current.x,q=b.current.y*M.current.y;K.scrollBy(G,q)},[]),B=w.useMemo(()=>h===Zl.TreeOrder?[...g].reverse():g,[h,g]);w.useEffect(()=>{if(!u||!g.length||!I){C();return}for(const K of B){if((o==null?void 0:o(K))===!1)continue;const G=g.indexOf(K),q=y[G];if(!q)continue;const{direction:le,speed:de}=lw(K,q,I,s,x);for(const me of["x","y"])T[me][le[me]]||(de[me]=0,le[me]=0);if(de.x>0||de.y>0){C(),W.current=K,E(O,f),b.current=de,M.current=le;return}}b.current={x:0,y:0},M.current={x:0,y:0},C()},[s,O,o,C,u,f,JSON.stringify(I),JSON.stringify(T),E,g,B,y,JSON.stringify(x)])}const ww={x:{[Xt.Backward]:!1,[Xt.Forward]:!1},y:{[Xt.Backward]:!1,[Xt.Forward]:!1}};function kw(n){let{delta:s,disabled:r}=n;const o=Kl(s);return mo(a=>{if(r||!o||!a)return ww;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Xt.Backward]:a.x[Xt.Backward]||u.x===-1,[Xt.Forward]:a.x[Xt.Forward]||u.x===1},y:{[Xt.Backward]:a.y[Xt.Backward]||u.y===-1,[Xt.Forward]:a.y[Xt.Forward]||u.y===1}}},[r,s,o])}function Sw(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return mo(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function Tw(n,s){return w.useMemo(()=>n.reduce((r,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:s(f.handler,o)}));return[...r,...u]},[]),[n,s])}var fo;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(fo||(fo={}));var Cu;(function(n){n.Optimized="optimized"})(Cu||(Cu={}));const yh=new Map;function bw(n,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:m,strategy:g}=a,y=w.useRef(n),k=b(),x=uo(k),T=w.useCallback(function(M){M===void 0&&(M=[]),!x.current&&f(I=>I===null?M:I.concat(M.filter(W=>!I.includes(W))))},[x]),E=w.useRef(null),C=mo(M=>{if(k&&!r)return yh;if(!M||M===yh||y.current!==n||u!=null){const I=new Map;for(let W of n){if(!W)continue;if(u&&u.length>0&&!u.includes(W.id)&&W.rect.current){I.set(W.id,W.rect.current);continue}const O=W.node.current,B=O?new td(m(O),O):null;W.rect.current=B,B&&I.set(W.id,B)}return I}return M},[n,u,r,k,m]);return w.useEffect(()=>{y.current=n},[n]),w.useEffect(()=>{k||T()},[r,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||E.current!==null||(E.current=setTimeout(()=>{T(),E.current=null},h))},[h,k,T,...o]),{droppableRects:C,measureDroppableContainers:T,measuringScheduled:u!=null};function b(){switch(g){case fo.Always:return!1;case fo.BeforeDragging:return r;default:return!r}}}function rd(n,s){return mo(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function Nw(n,s){return rd(n,s)}function Cw(n){let{callback:s,disabled:r}=n;const o=da(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function pa(n){let{callback:s,disabled:r}=n;const o=da(s),a=w.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Ew(n){return new td(fi(n),n)}function xh(n,s,r){s===void 0&&(s=Ew);const[o,a]=w.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??r)!=null?g:null}const y=s(n);return JSON.stringify(m)===JSON.stringify(y)?m:y})}const f=Cw({callback(m){if(n)for(const g of m){const{type:y,target:k}=g;if(y==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=pa({callback:u});return is(()=>{u(),n?(h==null||h.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[n]),o}function _w(n){const s=rd(n);return qm(n,s)}const wh=[];function jw(n){const s=w.useRef(n),r=mo(o=>n?o&&o!==wh&&n&&s.current&&n.parentNode===s.current.parentNode?o:ed(n):wh,[n]);return w.useEffect(()=>{s.current=n},[n]),r}function Rw(n){const[s,r]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=ou(u.target);f&&r(h=>h?(h.set(f,bu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=ou(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,bu(g)]):null}).filter(m=>m!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=ou(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>oi(u,f),os):eg(n):os,[n,s])}function kh(n,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=n!==os;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?Xl(n,r.current):os}function Aw(n){w.useEffect(()=>{if(!ua)return;const s=n.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},n.map(s=>{let{sensor:r}=s;return r}))}function Iw(n,s){return w.useMemo(()=>n.reduce((r,o)=>{let{eventName:a,handler:u}=o;return r[a]=f=>{u(f,s)},r},{}),[n,s])}function rg(n){return w.useMemo(()=>n?sw(n):null,[n])}const Sh=[];function Dw(n,s){s===void 0&&(s=fi);const[r]=n,o=rg(r?yn(r):null),[a,u]=w.useState(Sh);function f(){u(()=>n.length?n.map(m=>Zm(m)?o:new td(s(m),m)):Sh)}const h=pa({callback:f});return is(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function ig(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return ho(s)?s:n}function Mw(n){let{measure:s}=n;const[r,o]=w.useState(null),a=w.useCallback(g=>{for(const{target:y}of g)if(ho(y)){o(k=>{const x=s(y);return k?{...k,width:x.width,height:x.height}:x});break}},[s]),u=pa({callback:a}),f=w.useCallback(g=>{const y=ig(g);u==null||u.disconnect(),y&&(u==null||u.observe(y)),o(y?s(y):null)},[s,u]),[h,m]=ql(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:m}),[r,h,m])}const Lw=[{sensor:sd,options:{}},{sensor:sg,options:{}}],Pw={current:{}},Ol={draggable:{measure:hh},droppable:{measure:hh,strategy:fo.WhileDragging,frequency:Cu.Optimized},dragOverlay:{measure:fi}};class ro extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const Ow={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ro,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ql},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ol,measureDroppableContainers:Ql,windowRect:null,measuringScheduled:!1},og={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ql,draggableNodes:new Map,over:null,measureDroppableContainers:Ql},vo=w.createContext(og),lg=w.createContext(Ow);function zw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ro}}}function $w(n,s){switch(s.type){case Ut.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Ut.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:s.coordinates.x-n.draggable.initialCoordinates.x,y:s.coordinates.y-n.draggable.initialCoordinates.y}}};case Ut.DragEnd:case Ut.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ut.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new ro(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case Ut.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=s,u=n.droppable.containers.get(r);if(!u||o!==u.key)return n;const f=new ro(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Ut.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new ro(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function Fw(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(vo),u=Kl(o),f=Kl(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!fa(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:m,node:g}=h;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const y of[m.current,g.current]){if(!y)continue;const k=I0(y);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function ag(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function Uw(n){return w.useMemo(()=>({draggable:{...Ol.draggable,...n==null?void 0:n.draggable},droppable:{...Ol.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ol.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function Bw(n){let{activeNode:s,measure:r,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;is(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const g=s==null?void 0:s.node.current;if(!g||g.isConnected===!1)return;const y=r(g),k=qm(y,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=Xm(g);x&&x.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const ha=w.createContext({...os,scaleX:1,scaleY:1});var Zs;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Zs||(Zs={}));const Ww=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:y=Lw,collisionDetection:k=Q0,measuring:x,modifiers:T,...E}=s;const C=w.useReducer($w,void 0,zw),[b,M]=C,[I,W]=z0(),[O,B]=w.useState(Zs.Uninitialized),K=O===Zs.Initialized,{draggable:{active:G,nodes:q,translate:le},droppable:{containers:de}}=b,me=G!=null?q.get(G):null,fe=w.useRef({initial:null,translated:null}),pe=w.useMemo(()=>{var st;return G!=null?{id:G,data:(st=me==null?void 0:me.data)!=null?st:Pw,rect:fe}:null},[G,me]),Me=w.useRef(null),[Z,re]=w.useState(null),[ce,P]=w.useState(null),ee=uo(E,Object.values(E)),H=go("DndDescribedBy",f),R=w.useMemo(()=>de.getEnabled(),[de]),_=Uw(x),{droppableRects:X,measureDroppableContainers:se,measuringScheduled:Se}=bw(R,{dragging:K,dependencies:[le.x,le.y],config:_.droppable}),be=Sw(q,G),Le=w.useMemo(()=>ce?Yl(ce):null,[ce]),je=kn(),De=Nw(be,_.draggable.measure);Bw({activeNode:G!=null?q.get(G):null,config:je.layoutShiftCompensation,initialRect:De,measure:_.draggable.measure});const xe=xh(be,_.draggable.measure,De),at=xh(be?be.parentElement:null),Pe=w.useRef({activatorEvent:null,active:null,activeNode:be,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:de,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ht=de.getNodeFor((r=Pe.current.over)==null?void 0:r.id),$e=Mw({measure:_.dragOverlay.measure}),mt=(o=$e.nodeRef.current)!=null?o:be,He=K?(a=$e.rect)!=null?a:xe:null,Mt=!!($e.nodeRef.current&&$e.rect),nn=_w(Mt?null:xe),ot=rg(mt?yn(mt):null),gt=jw(K?ht??be:null),Ot=Dw(gt),V=ag(T,{transform:{x:le.x-nn.x,y:le.y-nn.y,scaleX:1,scaleY:1},activatorEvent:ce,active:pe,activeNodeRect:xe,containerNodeRect:at,draggingNodeRect:He,over:Pe.current.over,overlayNodeRect:$e.rect,scrollableAncestors:gt,scrollableAncestorRects:Ot,windowRect:ot}),we=Le?oi(Le,le):null,Fe=Rw(gt),qe=kh(Fe),vt=kh(Fe,[xe]),yt=oi(V,qe),ct=He?ew(He,V):null,Yt=pe&&ct?k({active:pe,collisionRect:ct,droppableRects:X,droppableContainers:R,pointerCoordinates:we}):null,xn=K0(Yt,"id"),[dt,Xn]=w.useState(null),Fn=Mt?V:oi(V,vt),jn=Z0(Fn,(u=dt==null?void 0:dt.rect)!=null?u:null,xe),Yn=w.useRef(null),wn=w.useCallback((st,kt)=>{let{sensor:j,options:ae}=kt;if(Me.current==null)return;const te=q.get(Me.current);if(!te)return;const ue=st.nativeEvent,Ee=new j({active:Me.current,activeNode:te,event:ue,options:ae,context:Pe,onAbort(ve){if(!q.get(ve))return;const{onDragAbort:rt}=ee.current,xt={id:ve};rt==null||rt(xt),I({type:"onDragAbort",event:xt})},onPending(ve,Qe,rt,xt){if(!q.get(ve))return;const{onDragPending:Bt}=ee.current,Rt={id:ve,constraint:Qe,initialCoordinates:rt,offset:xt};Bt==null||Bt(Rt),I({type:"onDragPending",event:Rt})},onStart(ve){const Qe=Me.current;if(Qe==null)return;const rt=q.get(Qe);if(!rt)return;const{onDragStart:xt}=ee.current,jt={activatorEvent:ue,active:{id:Qe,data:rt.data,rect:fe}};eo.unstable_batchedUpdates(()=>{xt==null||xt(jt),B(Zs.Initializing),M({type:Ut.DragStart,initialCoordinates:ve,active:Qe}),I({type:"onDragStart",event:jt}),re(Yn.current),P(ue)})},onMove(ve){M({type:Ut.DragMove,coordinates:ve})},onEnd:Ue(Ut.DragEnd),onCancel:Ue(Ut.DragCancel)});Yn.current=Ee;function Ue(ve){return async function(){const{active:rt,collisions:xt,over:jt,scrollAdjustedTranslate:Bt}=Pe.current;let Rt=null;if(rt&&Bt){const{cancelDrop:Wt}=ee.current;Rt={activatorEvent:ue,active:rt,collisions:xt,delta:Bt,over:jt},ve===Ut.DragEnd&&typeof Wt=="function"&&await Promise.resolve(Wt(Rt))&&(ve=Ut.DragCancel)}Me.current=null,eo.unstable_batchedUpdates(()=>{M({type:ve}),B(Zs.Uninitialized),Xn(null),re(null),P(null),Yn.current=null;const Wt=ve===Ut.DragEnd?"onDragEnd":"onDragCancel";if(Rt){const sn=ee.current[Wt];sn==null||sn(Rt),I({type:Wt,event:Rt})}})}}},[q]),Rn=w.useCallback((st,kt)=>(j,ae)=>{const te=j.nativeEvent,ue=q.get(ae);if(Me.current!==null||!ue||te.dndKit||te.defaultPrevented)return;const Ee={active:ue};st(j,kt.options,Ee)===!0&&(te.dndKit={capturedBy:kt.sensor},Me.current=ae,wn(j,kt))},[q,wn]),un=Tw(y,Rn);Aw(y),is(()=>{xe&&O===Zs.Initializing&&B(Zs.Initialized)},[xe,O]),w.useEffect(()=>{const{onDragMove:st}=ee.current,{active:kt,activatorEvent:j,collisions:ae,over:te}=Pe.current;if(!kt||!j)return;const ue={active:kt,activatorEvent:j,collisions:ae,delta:{x:yt.x,y:yt.y},over:te};eo.unstable_batchedUpdates(()=>{st==null||st(ue),I({type:"onDragMove",event:ue})})},[yt.x,yt.y]),w.useEffect(()=>{const{active:st,activatorEvent:kt,collisions:j,droppableContainers:ae,scrollAdjustedTranslate:te}=Pe.current;if(!st||Me.current==null||!kt||!te)return;const{onDragOver:ue}=ee.current,Ee=ae.get(xn),Ue=Ee&&Ee.rect.current?{id:Ee.id,rect:Ee.rect.current,data:Ee.data,disabled:Ee.disabled}:null,ve={active:st,activatorEvent:kt,collisions:j,delta:{x:te.x,y:te.y},over:Ue};eo.unstable_batchedUpdates(()=>{Xn(Ue),ue==null||ue(ve),I({type:"onDragOver",event:ve})})},[xn]),is(()=>{Pe.current={activatorEvent:ce,active:pe,activeNode:be,collisionRect:ct,collisions:Yt,droppableRects:X,draggableNodes:q,draggingNode:mt,draggingNodeRect:He,droppableContainers:de,over:dt,scrollableAncestors:gt,scrollAdjustedTranslate:yt},fe.current={initial:He,translated:ct}},[pe,be,Yt,ct,q,mt,He,X,de,dt,gt,yt]),xw({...je,delta:le,draggingRect:ct,pointerCoordinates:we,scrollableAncestors:gt,scrollableAncestorRects:Ot});const dn=w.useMemo(()=>({active:pe,activeNode:be,activeNodeRect:xe,activatorEvent:ce,collisions:Yt,containerNodeRect:at,dragOverlay:$e,draggableNodes:q,droppableContainers:de,droppableRects:X,over:dt,measureDroppableContainers:se,scrollableAncestors:gt,scrollableAncestorRects:Ot,measuringConfiguration:_,measuringScheduled:Se,windowRect:ot}),[pe,be,xe,ce,Yt,at,$e,q,de,X,dt,se,gt,Ot,_,Se,ot]),zt=w.useMemo(()=>({activatorEvent:ce,activators:un,active:pe,activeNodeRect:xe,ariaDescribedById:{draggable:H},dispatch:M,draggableNodes:q,over:dt,measureDroppableContainers:se}),[ce,un,pe,xe,M,H,q,dt,se]);return it.createElement(Gm.Provider,{value:W},it.createElement(vo.Provider,{value:zt},it.createElement(lg.Provider,{value:dn},it.createElement(ha.Provider,{value:jn},g)),it.createElement(Fw,{disabled:(h==null?void 0:h.restoreFocus)===!1})),it.createElement(U0,{...h,hiddenTextDescribedById:H}));function kn(){const st=(Z==null?void 0:Z.autoScrollEnabled)===!1,kt=typeof m=="object"?m.enabled===!1:m===!1,j=K&&!st&&!kt;return typeof m=="object"?{...m,enabled:j}:{enabled:j}}}),Hw=w.createContext(null),Th="button",Vw="Draggable";function Gw(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=go(Vw),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:y,draggableNodes:k,over:x}=w.useContext(vo),{role:T=Th,roleDescription:E="draggable",tabIndex:C=0}=a??{},b=(m==null?void 0:m.id)===s,M=w.useContext(b?ha:Hw),[I,W]=ql(),[O,B]=ql(),K=Iw(f,s),G=uo(r);is(()=>(k.set(s,{id:s,key:u,node:I,activatorNode:O,data:G}),()=>{const le=k.get(s);le&&le.key===u&&k.delete(s)}),[k,s]);const q=w.useMemo(()=>({role:T,tabIndex:C,"aria-disabled":o,"aria-pressed":b&&T===Th?!0:void 0,"aria-roledescription":E,"aria-describedby":y.draggable}),[o,T,C,b,E,y.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:q,isDragging:b,listeners:o?void 0:K,node:I,over:x,setNodeRef:W,setActivatorNodeRef:B,transform:M}}function cg(){return w.useContext(lg)}const qw="Droppable",Kw={timeout:25};function ug(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=go(qw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=w.useContext(vo),y=w.useRef({disabled:r}),k=w.useRef(!1),x=w.useRef(null),T=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:b}={...Kw,...a},M=uo(C??o),I=w.useCallback(()=>{if(!k.current){k.current=!0;return}T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{g(Array.isArray(M.current)?M.current:[M.current]),T.current=null},b)},[b]),W=pa({callback:I,disabled:E||!f}),O=w.useCallback((q,le)=>{W&&(le&&(W.unobserve(le),k.current=!1),q&&W.observe(q))},[W]),[B,K]=ql(O),G=uo(s);return w.useEffect(()=>{!W||!B.current||(W.disconnect(),k.current=!1,W.observe(B.current))},[B,W]),w.useEffect(()=>(h({type:Ut.RegisterDroppable,element:{id:o,key:u,disabled:r,node:B,rect:x,data:G}}),()=>h({type:Ut.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==y.current.disabled&&(h({type:Ut.SetDroppableDisabled,id:o,key:u,disabled:r}),y.current.disabled=r)},[o,u,r,h]),{active:f,rect:x,isOver:(m==null?void 0:m.id)===o,node:B,over:m,setNodeRef:K}}function Xw(n){let{animation:s,children:r}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=Kl(r);return!r&&!o&&h&&a(h),is(()=>{if(!u)return;const m=o==null?void 0:o.key,g=o==null?void 0:o.props.id;if(m==null||g==null){a(null);return}Promise.resolve(s(g,u)).then(()=>{a(null)})},[s,o,u]),it.createElement(it.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const Yw={x:0,y:0,scaleX:1,scaleY:1};function Qw(n){let{children:s}=n;return it.createElement(vo.Provider,{value:og},it.createElement(ha.Provider,{value:Yw},s))}const Zw={position:"fixed",touchAction:"none"},Jw=n=>fa(n)?"transform 250ms ease":void 0,ek=w.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:y=Jw}=n;if(!h)return null;const k=a?g:{...g,scaleX:1,scaleY:1},x={...Zw,width:h.width,height:h.height,top:h.top,left:h.left,transform:As.Transform.toString(k),transformOrigin:a&&o?V0(o,h):void 0,transition:typeof y=="function"?y(o):y,...m};return it.createElement(r,{className:f,style:x,ref:s},u)}),tk=n=>s=>{let{active:r,dragOverlay:o}=s;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,m]of Object.entries(u.active))m!==void 0&&(a[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,m));if(u!=null&&u.dragOverlay)for(const[h,m]of Object.entries(u.dragOverlay))m!==void 0&&o.node.style.setProperty(h,m);return f!=null&&f.active&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))r.node.style.setProperty(m,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},nk=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:As.Transform.toString(s)},{transform:As.Transform.toString(r)}]},sk={duration:250,easing:"ease",keyframes:nk,sideEffects:tk({styles:{active:{opacity:"0"}}})};function rk(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return da((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=ig(f);if(!g)return;const{transform:y}=yn(f).getComputedStyle(f),k=Km(y);if(!k)return;const x=typeof s=="function"?s:ik(s);return tg(m,a.draggable.measure),x({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function ik(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...sk,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!s)return;const y={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},x={x:m.x-y.x,y:m.y-y.y,...k},T=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:x}}),[E]=T,C=T[T.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const b=o==null?void 0:o({active:f,dragOverlay:h,...g}),M=h.node.animate(T,{duration:s,easing:r,fill:"forwards"});return new Promise(I=>{M.onfinish=()=>{b==null||b(),I()}})}}let bh=0;function ok(n){return w.useMemo(()=>{if(n!=null)return bh++,bh},[n])}const lk=it.memo(n=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:y,active:k,activeNodeRect:x,containerNodeRect:T,draggableNodes:E,droppableContainers:C,dragOverlay:b,over:M,measuringConfiguration:I,scrollableAncestors:W,scrollableAncestorRects:O,windowRect:B}=cg(),K=w.useContext(ha),G=ok(k==null?void 0:k.id),q=ag(f,{activatorEvent:y,active:k,activeNodeRect:x,containerNodeRect:T,draggingNodeRect:b.rect,over:M,overlayNodeRect:b.rect,scrollableAncestors:W,scrollableAncestorRects:O,transform:K,windowRect:B}),le=rd(x),de=rk({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:I}),me=le?b.setRef:void 0;return it.createElement(Qw,null,it.createElement(Xw,{animation:de},k&&G?it.createElement(ek,{key:G,id:k.id,ref:me,as:h,activatorEvent:y,adjustScale:s,className:m,transition:u,rect:le,style:{zIndex:g,...a},transform:q},r):null))});function dg(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function ak(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function El(n){return n!==null&&n>=0}function ck(n,s){if(n===s)return!0;if(n.length!==s.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==s[r])return!1;return!0}function uk(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const fg=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=dg(s,o,r),f=s[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},_l={scaleX:1,scaleY:1},Nh=n=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const g=u[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,..._l}:null}const m=dk(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-m,..._l}:a<r&&a>=f?{x:0,y:h.height+m,..._l}:{x:0,y:0,..._l}};function dk(n,s,r){const o=n[s],a=n[s-1],u=n[s+1];return o?r<s?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const pg="Sortable",hg=it.createContext({activeIndex:-1,containerId:pg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fg,disabled:{draggable:!1,droppable:!1}});function Ch(n){let{children:s,id:r,items:o,strategy:a=fg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:y}=cg(),k=go(pg,r),x=h.rect!==null,T=w.useMemo(()=>o.map(K=>typeof K=="object"&&"id"in K?K.id:K),[o]),E=f!=null,C=f?T.indexOf(f.id):-1,b=g?T.indexOf(g.id):-1,M=w.useRef(T),I=!ck(T,M.current),W=b!==-1&&C===-1||I,O=uk(u);is(()=>{I&&E&&y(T)},[I,T,E,y]),w.useEffect(()=>{M.current=T},[T]);const B=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:O,disableTransforms:W,items:T,overIndex:b,useDragOverlay:x,sortedRects:ak(T,m),strategy:a}),[C,k,O.draggable,O.droppable,W,T,b,m,x,a]);return it.createElement(hg.Provider,{value:B},s)}const fk=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return dg(r,o,a).indexOf(s)},pk=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===m},hk={duration:200,easing:"ease"},mg="transform",mk=As.Transition.toString({property:mg,duration:0,easing:"linear"}),gk={roleDescription:"sortable"};function vk(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(r);return is(()=>{if(!s&&r!==h.current&&o.current){const m=a.current;if(m){const g=fi(o.current,{ignoreTransform:!0}),y={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(y.x||y.y)&&f(y)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function gg(n){let{animateLayoutChanges:s=pk,attributes:r,disabled:o,data:a,getNewIndex:u=fk,id:f,strategy:h,resizeObserverConfig:m,transition:g=hk}=n;const{items:y,containerId:k,activeIndex:x,disabled:T,disableTransforms:E,sortedRects:C,overIndex:b,useDragOverlay:M,strategy:I}=w.useContext(hg),W=yk(o,T),O=y.indexOf(f),B=w.useMemo(()=>({sortable:{containerId:k,index:O,items:y},...a}),[k,a,O,y]),K=w.useMemo(()=>y.slice(y.indexOf(f)),[y,f]),{rect:G,node:q,isOver:le,setNodeRef:de}=ug({id:f,data:B,disabled:W.droppable,resizeObserverConfig:{updateMeasurementsFor:K,...m}}),{active:me,activatorEvent:fe,activeNodeRect:pe,attributes:Me,setNodeRef:Z,listeners:re,isDragging:ce,over:P,setActivatorNodeRef:ee,transform:H}=Gw({id:f,data:B,attributes:{...gk,...r},disabled:W.draggable}),R=_0(de,Z),_=!!me,X=_&&!E&&El(x)&&El(b),se=!M&&ce,Se=se&&X?H:null,Le=X?Se??(h??I)({rects:C,activeNodeRect:pe,activeIndex:x,overIndex:b,index:O}):null,je=El(x)&&El(b)?u({id:f,items:y,activeIndex:x,overIndex:b}):O,De=me==null?void 0:me.id,xe=w.useRef({activeId:De,items:y,newIndex:je,containerId:k}),at=y!==xe.current.items,Pe=s({active:me,containerId:k,isDragging:ce,isSorting:_,id:f,index:O,items:y,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:g,wasDragging:xe.current.activeId!=null}),ht=vk({disabled:!Pe,index:O,node:q,rect:G});return w.useEffect(()=>{_&&xe.current.newIndex!==je&&(xe.current.newIndex=je),k!==xe.current.containerId&&(xe.current.containerId=k),y!==xe.current.items&&(xe.current.items=y)},[_,je,k,y]),w.useEffect(()=>{if(De===xe.current.activeId)return;if(De!=null&&xe.current.activeId==null){xe.current.activeId=De;return}const mt=setTimeout(()=>{xe.current.activeId=De},50);return()=>clearTimeout(mt)},[De]),{active:me,activeIndex:x,attributes:Me,data:B,rect:G,index:O,newIndex:je,items:y,isOver:le,isSorting:_,isDragging:ce,listeners:re,node:q,overIndex:b,over:P,setNodeRef:R,setActivatorNodeRef:ee,setDroppableNodeRef:de,setDraggableNodeRef:Z,transform:ht??Le,transition:$e()};function $e(){if(ht||at&&xe.current.newIndex===O)return mk;if(!(se&&!fa(fe)||!g)&&(_||Pe))return As.Transition.toString({...g,property:mg})}}function yk(n,s){var r,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n==null?void 0:n.draggable)!=null?r:s.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:s.droppable}}et.Down,et.Right,et.Up,et.Left;function jl(n){const[s,r]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[s,o]}async function Eu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Jl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Eh(n,s){if(!s||!n.cwd)return!1;const r=Jl(n.cwd),o=Jl(s);return r.startsWith(`${o}/`)}function xk(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",m=r.get(h)??[];m.push(f),r.set(h,m)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function ea(n){return[...n].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function _h(n,s,r,o){const a=s.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function jh(n,s){return{working:ea(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:ea(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function Rl(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function wk(n){const s=new Set(n.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function Rh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=ug({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function id({inputRef:n,value:s,onChange:r,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function kk({s:n,backgroundTaskCount:s,isActive:r,isSelected:o,appIcon:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:m,onRenameConfirm:g,onRenameCancel:y,onSelect:k,onCtxMenu:x,onToggleStar:T}){const{attributes:E,listeners:C,setNodeRef:b,transform:M,transition:I,isDragging:W}=gg({id:`s:${n.id}`}),O=la(n,s);return c.jsxs("div",{ref:b,style:{transform:As.Transform.toString(M),transition:I},className:`tree-item ${r?"active":""}${o?" selected":""} ${O.isFinished?"tree-item-finished":""}${W?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(Xu,{iconClass:O.iconClass,iconText:O.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a}),u?c.jsx(id,{inputRef:h,value:f,onChange:m,onConfirm:g,onCancel:y}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!u&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:B=>{B.stopPropagation(),T()},onPointerDown:B=>B.stopPropagation(),children:c.jsx(Gl,{size:10,fill:n.starred?"currentColor":"none"})}),O.dot&&c.jsx(Ku,{status:O.dot,title:O.dotTitle})]})}function Sk({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:y,children:k}){const{attributes:x,listeners:T,setNodeRef:E,transform:C,transition:b,isDragging:M,over:I}=gg({id:`f:${n.id}`}),W=I!=null&&String(I.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:As.Transform.toString(C),transition:b},className:`tree-folder ${r?"collapsed":""}${M?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${W?" drop-over":""}`,...x,...T,onClick:()=>{o||g()},onContextMenu:y,children:o?c.jsx(id,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:m}):c.jsxs(c.Fragment,{children:[c.jsx(ii,{size:8,className:"tree-chevron"}),c.jsx(Tu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:s})]})}),!r&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function Tk(){const n=L(j=>j.sessions),s=L(j=>j.backgroundTasks),r=L(j=>j.workspaces),o=L(j=>j.folders),a=L(j=>j.activeSessionId),u=L(j=>j.selectSession),f=L(j=>j.deleteSession),h=L(j=>j.removeWorkspace),m=L(j=>j.createSessionInWorkspace),g=L(j=>j.pickAndAddWorkspace),y=L(j=>j.renameSession),k=L(j=>j.markFinished),x=L(j=>j.markFinishedMany),T=L(j=>j.toggleStar),E=L(j=>j.reopenSession),C=L(j=>j.reopenSessionMany),b=L(j=>j.deleteSessionMany),M=L(j=>j.createSidebarFolder),I=L(j=>j.renameFolder),W=L(j=>j.deleteFolder),O=L(j=>j.applyMoves),B=L(j=>j.reorderFolders),K=L(j=>j.apps),G=L(j=>j.appsRootPath),q=L(j=>j.activeAppTabId),le=L(j=>j.openAppTab),de=L(j=>j.startAppEdit),me=L(j=>j.toggleAppPin),fe=L(j=>j.deleteApp),pe=L(j=>j.openAppCatalog),[Me,Z]=jl("agentpane:sidebar-ws-collapsed"),[re,ce]=jl("agentpane:sidebar-sub-collapsed"),[P,ee]=jl("agentpane:sidebar-folders-collapsed"),[H,R]=jl("agentpane:sidebar-app-edits-collapsed"),[_,X]=w.useState(null),[se,Se]=w.useState(null),[be,Le]=w.useState(""),[je,De]=w.useState(null),[xe,at]=w.useState(new Set),[Pe,ht]=w.useState(null),$e=w.useRef(null),mt=w.useRef(null),He=W0(B0(sd,{activationConstraint:{distance:5}}));function Mt(){at(new Set),ht(null)}aa($e,()=>X(null),!!_),qu(()=>{X(null),Mt()},!!_||xe.size>0),w.useLayoutEffect(()=>{const j=$e.current;if(!_||!j)return;const ae=8,{offsetWidth:te,offsetHeight:ue}=j,Ee=_.x+te>window.innerWidth-ae?Math.max(ae,_.x-te):_.x,Ue=_.y+ue>window.innerHeight-ae?Math.max(ae,_.y-ue):_.y;j.style.left=`${Ee}px`,j.style.top=`${Ue}px`},[_]);const nn=w.useMemo(()=>new Map(n.map(j=>[j.id,j])),[n]),ot=w.useMemo(()=>new Map(o.map(j=>[j.id,j])),[o]),gt=w.useMemo(()=>{const j=new Map;for(const ae of[...o].sort((te,ue)=>te.sort_order-ue.sort_order)){const te=j.get(ae.workspace_path)??[];te.push(ae),j.set(ae.workspace_path,te)}return j},[o]);function Ot(j){Z(ae=>{const te=new Set(ae);return te.has(j)?te.delete(j):te.add(j),te})}function V(j){ce(ae=>{const te=new Set(ae);return te.has(j)?te.delete(j):te.add(j),te})}function we(j){ee(ae=>{const te=new Set(ae);return te.has(j)?te.delete(j):te.add(j),te})}function Fe(j){R(ae=>{const te=new Set(ae);return te.has(j)?te.delete(j):te.add(j),te})}w.useEffect(()=>{se&&mt.current&&(mt.current.focus(),mt.current.select())},[se]);function qe(j,ae,te,ue=""){Se({kind:j,id:ae}),Le(te||ue)}function vt(){if(se){const j=be.trim();j&&(se.kind==="session"?y(se.id,j):I(se.id,j))}Se(null)}function yt(){Se(null),Le("")}async function ct(j){const ae=wk(gt.get(j)??[]),te=await M(j,ae);te&&qe("folder",te.id,te.name)}function Yt(j){const ae=String(j.active.id);if(ae.startsWith("s:")){const te=nn.get(ae.slice(2));te&&De({kind:"session",label:te.title||te.id.slice(0,8)})}else if(ae.startsWith("f:")){const te=ot.get(ae.slice(2));te&&De({kind:"folder",label:te.name})}}function xn(j){De(null);const{active:ae,over:te}=j;if(!te)return;const ue=String(ae.id),Ee=String(te.id);if(ue.startsWith("s:")){const Ue=nn.get(ue.slice(2));if(!Ue)return;const ve=Ue.cwd||"(no directory)",Qe=Rl(Ue,ot);let rt,xt;if(Ee.startsWith("f:")){const tt=ot.get(Ee.slice(2));if(!tt)return;rt=tt.workspace_path,xt=tt.id}else if(Ee.startsWith("s:")){const tt=nn.get(Ee.slice(2));if(!tt)return;rt=tt.cwd||"(no directory)",xt=Rl(tt,ot)}else if(Ee.startsWith("c:")){const tt=Ee.slice(2),At=tt.lastIndexOf("|");rt=tt.slice(0,At);const Be=tt.slice(At+1);xt=Be==="root"?null:Be}else return;if(rt!==ve)return;const jt=ea(n.filter(tt=>(tt.cwd||"(no directory)")===rt&&Rl(tt,ot)===xt)),Bt=jt.filter(tt=>tt.id!==Ue.id);let Rt=Bt.length;if(Ee.startsWith("s:")){const tt=Bt.findIndex(At=>At.id===Ee.slice(2));tt>=0&&(Rt=tt)}const Wt=[...Bt.slice(0,Rt),Ue,...Bt.slice(Rt)],sn=[];if(xt===Qe){if(Wt.length===jt.length&&Wt.every((tt,At)=>tt.id===jt[At].id))return;Wt.forEach((tt,At)=>sn.push({id:tt.id,folder_id:xt,sort_order:Wt.length-1-At}))}else{const tt=ea(n.filter(At=>(At.cwd||"(no directory)")===ve&&Rl(At,ot)===Qe)).filter(At=>At.id!==Ue.id);tt.forEach((At,Be)=>sn.push({id:At.id,folder_id:Qe,sort_order:tt.length-1-Be})),Wt.forEach((At,Be)=>sn.push({id:At.id,folder_id:xt,sort_order:Wt.length-1-Be}))}O(sn);return}if(ue.startsWith("f:")){if(!Ee.startsWith("f:"))return;const Ue=ot.get(ue.slice(2)),ve=ot.get(Ee.slice(2));if(!Ue||!ve||Ue.id===ve.id||Ue.workspace_path!==ve.workspace_path)return;const Qe=(gt.get(Ue.workspace_path)??[]).map(jt=>jt.id),rt=Qe.indexOf(Ue.id),xt=Qe.indexOf(ve.id);Qe.splice(xt,0,...Qe.splice(rt,1)),B(Qe)}}const dt=xk(r,G?n.filter(j=>!Eh(j,G)):n),Xn=w.useMemo(()=>{const j=new Map;if(!G)return j;const ae=Jl(G);for(const te of n){if(!Eh(te,G))continue;const ue=Jl(te.cwd).slice(ae.length+1).split("/")[0],Ee=j.get(ue)??[];Ee.push(te),j.set(ue,Ee)}return j},[n,G]);function Fn(j){return{folder:null,sessions:Xn.get(j)??[],finishedKey:`app:${j}:finished`,hidden:H.has(j)}}const jn=[],Yn=j=>{if(j.hidden)return;const{working:ae,finished:te,finishedCollapsed:ue}=jh(j,re);jn.push(...ae.map(Ee=>Ee.id)),ue||jn.push(...te.map(Ee=>Ee.id))};for(const j of dt){if(Me.has(j.path))continue;const ae=gt.get(j.path)??[],te=new Set(ae.map(ue=>ue.id));_h(j,ae,te,P).forEach(Yn)}K.forEach(j=>Yn(Fn(j.id)));const wn=n.filter(j=>xe.has(j.id)),Rn=wn.filter(j=>j.lifecycle!=="finished").map(j=>j.id),un=wn.filter(j=>j.lifecycle==="finished").map(j=>j.id);function dn(j,ae){if(ae.metaKey||ae.ctrlKey){ae.preventDefault(),ht(j.id),at(te=>{const ue=new Set(te);return ue.has(j.id)?ue.delete(j.id):ue.add(j.id),ue});return}if(ae.shiftKey){ae.preventDefault();const te=Pe??j.id;ht(te);const ue=jn.indexOf(te),Ee=jn.indexOf(j.id);if(ue>=0&&Ee>=0){const[Ue,ve]=ue<Ee?[ue,Ee]:[Ee,ue];at(new Set(jn.slice(Ue,ve+1)))}return}Mt(),ht(j.id),u(j.id)}function zt(j,ae){ae.preventDefault();const te=xe.has(j.id)&&xe.size>1;xe.has(j.id)||(at(new Set),ht(j.id)),X({x:ae.clientX,y:ae.clientY,type:"session",sessionId:j.id,sessionTitle:j.title,sessionLifecycle:j.lifecycle,sessionExternalId:j.external_thread_id,multi:te})}function kn(j){var te;const ae=j.origin_app_id?K.find(ue=>ue.id===j.origin_app_id):null;return c.jsx(kk,{s:j,backgroundTaskCount:((te=s[j.id])==null?void 0:te.length)??0,isActive:a===j.id,isSelected:xe.has(j.id),appIcon:ae?ae.icon??"◧":null,renaming:(se==null?void 0:se.kind)==="session"&&se.id===j.id,renameValue:be,renameRef:mt,onRenameValue:Le,onRenameConfirm:vt,onRenameCancel:yt,onSelect:ue=>dn(j,ue),onToggleStar:()=>T(j.id),onCtxMenu:ue=>zt(j,ue)},j.id)}function st(j){var te;const ae=la(j,((te=s[j.id])==null?void 0:te.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===j.id?" active":""}${xe.has(j.id)?" selected":""}${ae.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ue=>dn(j,ue),onContextMenu:ue=>zt(j,ue),children:[c.jsx(Xu,{iconClass:ae.iconClass,iconText:ae.iconText,size:14}),(se==null?void 0:se.kind)==="session"&&se.id===j.id?c.jsx(id,{inputRef:mt,value:be,onChange:Le,onConfirm:vt,onCancel:yt}):c.jsx("span",{className:"tree-label",children:j.title||j.id.slice(0,8)}),ae.dot&&c.jsx(Ku,{status:ae.dot,title:ae.dotTitle})]},j.id)}function kt(j,ae="workspace"){const{working:te,finished:ue,finishedCollapsed:Ee}=jh(j,re),Ue=ae==="workspace"?kn:st,ve=c.jsxs(c.Fragment,{children:[te.length===0&&ue.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):te.map(Ue),ue.length>0&&c.jsxs("div",{className:`tree-subgroup ${Ee?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>V(j.finishedKey),children:[c.jsx(ii,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ue.length})]}),!Ee&&c.jsx("div",{className:"tree-subgroup-items",children:ue.map(Ue)})]})]});if(ae==="app")return ve;const Qe=[...te,...ue].map(rt=>`s:${rt.id}`);return c.jsx(Ch,{items:Qe,strategy:Nh,children:ve})}return c.jsxs("div",{className:"ide-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>g(),children:c.jsx(wr,{size:14})})]}),c.jsxs(Ww,{sensors:He,collisionDetection:X0,onDragStart:Yt,onDragEnd:xn,children:[dt.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):dt.map(j=>{const ae=Me.has(j.path),te=gt.get(j.path)??[],ue=new Set(te.map(ve=>ve.id)),Ee=_h(j,te,ue,P),Ue=Ee[Ee.length-1];return c.jsxs("div",{className:`tree-section ${ae?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>Ot(j.path),onContextMenu:ve=>{ve.preventDefault(),X({x:ve.clientX,y:ve.clientY,type:"workspace",path:j.path})},children:[c.jsx(ii,{size:9,className:"tree-chevron"}),c.jsx(Tu,{size:14}),c.jsx("span",{className:"tree-section-label",children:j.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:ve=>{ve.stopPropagation(),m(j.path)},children:c.jsx(wr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:ve=>{ve.stopPropagation(),ct(j.path)},children:c.jsx(ru,{size:11})}),c.jsx("span",{className:"tree-count",children:j.sessions.length})]}),!ae&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Ch,{items:te.map(ve=>`f:${ve.id}`),strategy:Nh,children:Ee.filter(ve=>ve.folder).map(ve=>c.jsx(Sk,{folder:ve.folder,count:ve.sessions.length,collapsed:ve.hidden,renaming:(se==null?void 0:se.kind)==="folder"&&se.id===ve.folder.id,renameValue:be,renameRef:mt,onRenameValue:Le,onRenameConfirm:vt,onRenameCancel:yt,onToggle:()=>we(ve.folder.id),onCtxMenu:Qe=>{Qe.preventDefault(),X({x:Qe.clientX,y:Qe.clientY,type:"folder",folderId:ve.folder.id,folderName:ve.folder.name})},children:c.jsx(Rh,{id:`c:${j.path}|${ve.folder.id}`,children:kt(ve)})},ve.folder.id))}),c.jsx(Rh,{id:`c:${j.path}|root`,children:kt(Ue)})]})]},j.path)}),c.jsx(lk,{children:je&&c.jsxs("div",{className:"drag-overlay",children:[je.kind==="folder"&&c.jsx(Tu,{size:12}),c.jsx("span",{children:je.label})]})})]}),c.jsxs("div",{className:"sidebar-apps",children:[c.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Apps"}),c.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>pe(),children:c.jsx(wr,{size:14})})]}),K.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),K.map(j=>{const ae=Fn(j.id),te=ae.sessions.length>0&&!ae.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${q===j.id?" active":""}`,title:j.description??void 0,onClick:()=>le(j.id),onContextMenu:ue=>{ue.preventDefault(),X({x:ue.clientX,y:ue.clientY,type:"app",appId:j.id,appPinned:j.pinned})},children:[ae.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${te?"":" closed"}`,title:"Edit sessions of this app",onClick:ue=>{ue.stopPropagation(),Fe(j.id)},children:c.jsx(ii,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:j.icon??"◧"}),c.jsx("span",{className:"tree-label",children:j.title}),ae.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:ae.sessions.length}),j.pinned&&c.jsx(Gl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),te&&c.jsx("div",{className:"sidebar-app-edits",children:kt(ae,"app")})]},j.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>g(),children:[c.jsx(ru,{size:14}),c.jsx("span",{children:"Add workspace"})]}),_&&c.jsxs("div",{ref:$e,className:"ctx-menu",style:{position:"fixed",left:_.x,top:_.y,zIndex:500},children:[_.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{m(_.path),X(null)},children:[c.jsx(wr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ct(_.path),X(null)},children:[c.jsx(ru,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(_.path),X(null)},children:[c.jsx(hs,{size:12})," Hide Workspace"]})]}),_.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{qe("folder",_.folderId,_.folderName??""),X(null)},children:[c.jsx(Pl,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{W(_.folderId),X(null)},children:[c.jsx(hs,{size:12})," Delete Folder"]})]}),_.type==="session"&&!_.multi&&c.jsx(c.Fragment,{children:_.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{qe("session",_.sessionId,_.sessionTitle??""),X(null)},children:[c.jsx(Pl,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(_.sessionId),X(null)},children:[c.jsx(Vl,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${_.sessionExternalId?"":" ctx-disabled"}`,title:_.sessionExternalId?void 0:"Session not started",onClick:()=>{_.sessionExternalId&&(Eu(_.sessionExternalId),X(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(_.sessionId),X(null)},children:[c.jsx(hs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(_.sessionId),X(null)},children:[c.jsx(co,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${_.sessionExternalId?"":" ctx-disabled"}`,title:_.sessionExternalId?void 0:"Session not started",onClick:()=>{_.sessionExternalId&&(Eu(_.sessionExternalId),X(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(_.sessionId),X(null)},children:[c.jsx(hs,{size:12})," Delete Session"]})]})}),_.type==="session"&&_.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[wn.length," sessions selected"]}),Rn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(Rn),X(null),Mt()},children:[c.jsx(Vl,{size:12})," Mark ",Rn.length," as Finished"]}),un.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(un),X(null),Mt()},children:[c.jsx(co,{size:12})," Reopen ",un.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{b([...xe]),X(null),Mt()},children:[c.jsx(hs,{size:12})," Delete ",wn.length," Sessions"]})]}),_.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(_.appId),X(null)},children:[c.jsx(Pl,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{me(_.appId),X(null)},children:[c.jsx(Gl,{size:12})," ",_.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{fe(_.appId),X(null)},children:[c.jsx(hs,{size:12})," Delete App"]})]})]})]})}function bk(){const n=L(T=>T.openTabs),s=L(T=>T.activeSessionId),r=L(T=>T.sessions),o=L(T=>T.backgroundTasks),a=L(T=>T.selectSession),u=L(T=>T.closeTab),f=L(T=>T.setShowNewSessionDialog),h=L(T=>T.apps),m=L(T=>T.openAppTabs),g=L(T=>T.activeAppTabId),y=L(T=>T.openAppTab),k=L(T=>T.closeAppTab),x=L(T=>T.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(T=>{var M;const E=r.find(I=>I.id===T);if(!E)return null;const C=la(E,((M=o[T])==null?void 0:M.length)??0),b=s===T&&g==null;return c.jsxs("div",{className:`ide-tab ${b?"active":""}`,onClick:()=>{g!=null&&x(null),a(T)},children:[c.jsx(Xu,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||T.slice(0,8),C.dot&&c.jsx(Ku,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:I=>{I.stopPropagation(),u(T)},children:c.jsx($n,{size:12})})]},T)}),m.map(T=>{const E=h.find(b=>b.id===T),C=g===T;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>y(T),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(a0,{size:12}),(E==null?void 0:E.title)??T,c.jsx("span",{className:"ide-tab-close",onClick:b=>{b.stopPropagation(),k(T)},children:c.jsx($n,{size:12})})]},T)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(wr,{size:14})})]})}function od(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tr=od();function vg(n){Tr=n}var io={exec:()=>null};function nt(n,s=""){let r=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(gn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var gn={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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Nk=/^(?:[ \t]*(?:\n|$))+/,Ck=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ek=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_k=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ld=/(?:[*+-]|\d{1,9}[.)])/,yg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xg=nt(yg).replace(/bull/g,ld).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(),jk=nt(yg).replace(/bull/g,ld).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(),ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Rk=/^[^\n]+/,cd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ak=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",cd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ik=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ld).getRegex(),ma="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",ud=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dk=nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ud).replace("tag",ma).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wg=nt(ad).replace("hr",yo).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex(),Mk=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wg).getRegex(),dd={blockquote:Mk,code:Ck,def:Ak,fences:Ek,heading:_k,hr:yo,html:Dk,lheading:xg,list:Ik,newline:Nk,paragraph:wg,table:io,text:Rk},Ah=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yo).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex(),Lk={...dd,lheading:jk,table:Ah,paragraph:nt(ad).replace("hr",yo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ah).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ma).getRegex()},Pk={...dd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ud).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:io,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(ad).replace("hr",yo).replace("heading",` *#{1,6} *[^
|
|
364
|
-
]`).replace("lheading",xg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ok=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kg=/^( {2,}|\\)\n(?!\s*$)/,$k=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,fd=/[\s\p{P}\p{S}]/u,Sg=/[^\s\p{P}\p{S}]/u,Fk=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fd).getRegex(),Tg=/(?!~)[\p{P}\p{S}]/u,Uk=/(?!~)[\s\p{P}\p{S}]/u,Bk=/(?:[^\s\p{P}\p{S}]|~)/u,Wk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,bg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hk=nt(bg,"u").replace(/punct/g,ga).getRegex(),Vk=nt(bg,"u").replace(/punct/g,Tg).getRegex(),Ng="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Gk=nt(Ng,"gu").replace(/notPunctSpace/g,Sg).replace(/punctSpace/g,fd).replace(/punct/g,ga).getRegex(),qk=nt(Ng,"gu").replace(/notPunctSpace/g,Bk).replace(/punctSpace/g,Uk).replace(/punct/g,Tg).getRegex(),Kk=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Sg).replace(/punctSpace/g,fd).replace(/punct/g,ga).getRegex(),Xk=nt(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),Yk=nt(/^<(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(),Qk=nt(ud).replace("(?:-->|$)","-->").getRegex(),Zk=nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qk).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ta=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jk=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ta).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Cg=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",ta).replace("ref",cd).getRegex(),Eg=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",cd).getRegex(),e1=nt("reflink|nolink(?!\\()","g").replace("reflink",Cg).replace("nolink",Eg).getRegex(),pd={_backpedal:io,anyPunctuation:Xk,autolink:Yk,blockSkip:Wk,br:kg,code:zk,del:io,emStrongLDelim:Hk,emStrongRDelimAst:Gk,emStrongRDelimUnd:Kk,escape:Ok,link:Jk,nolink:Eg,punctuation:Fk,reflink:Cg,reflinkSearch:e1,tag:Zk,text:$k,url:io},t1={...pd,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",ta).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ta).getRegex()},_u={...pd,emStrongRDelimAst:qk,emStrongLDelim:Vk,url:nt(/^((?: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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},n1={..._u,br:nt(kg).replace("{2,}","*").getRegex(),text:nt(_u.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Al={normal:dd,gfm:Lk,pedantic:Pk},Xi={normal:pd,gfm:_u,breaks:n1,pedantic:t1},s1={"&":"&","<":"<",">":">",'"':""","'":"'"},Ih=n=>s1[n];function ps(n,s){if(s){if(gn.escapeTest.test(n))return n.replace(gn.escapeReplace,Ih)}else if(gn.escapeTestNoEncode.test(n))return n.replace(gn.escapeReplaceNoEncode,Ih);return n}function Dh(n){try{n=encodeURI(n).replace(gn.percentDecode,"%")}catch{return null}return n}function Mh(n,s){var u;const r=n.replace(gn.findPipe,(f,h,m)=>{let g=!1,y=h;for(;--y>=0&&m[y]==="\\";)g=!g;return g?"|":" |"}),o=r.split(gn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(gn.slashPipe,"|");return o}function Yi(n,s,r){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===s;)a++;return n.slice(0,o-a)}function r1(n,s){if(n.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===s[0])r++;else if(n[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Lh(n,s,r,o,a){const u=s.href,f=s.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function i1(n,s,r){const o=n.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
|
|
365
|
-
`).map(u=>{const f=u.match(r.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
366
|
-
`)}var na=class{constructor(n){lt(this,"options");lt(this,"rules");lt(this,"lexer");this.options=n||Tr}space(n){const s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){const s=this.rules.block.code.exec(n);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Yi(r,`
|
|
367
|
-
`)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=i1(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(n){const s=this.rules.block.heading.exec(n);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=Yi(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){const s=this.rules.block.hr.exec(n);if(s)return{type:"hr",raw:Yi(s[0],`
|
|
368
|
-
`)}}blockquote(n){const s=this.rules.block.blockquote.exec(n);if(s){let r=Yi(s[0],`
|
|
369
|
-
`).split(`
|
|
370
|
-
`),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))h.push(r[m]),f=!0;else if(!f)h.push(r[m]);else break;r=r.slice(m);const g=h.join(`
|
|
371
|
-
`),y=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
372
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
373
|
-
${g}`:g,a=a?`${a}
|
|
374
|
-
${y}`:y;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,u,!0),this.lexer.state.top=k,r.length===0)break;const x=u.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){const T=x,E=T.raw+`
|
|
375
|
-
`+r.join(`
|
|
376
|
-
`),C=this.blockquote(E);u[u.length-1]=C,o=o.substring(0,o.length-T.raw.length)+C.raw,a=a.substring(0,a.length-T.text.length)+C.text;break}else if((x==null?void 0:x.type)==="list"){const T=x,E=T.raw+`
|
|
377
|
-
`+r.join(`
|
|
378
|
-
`),C=this.list(E);u[u.length-1]=C,o=o.substring(0,o.length-x.raw.length)+C.raw,a=a.substring(0,a.length-T.raw.length)+C.raw,r=E.substring(u.at(-1).raw.length).split(`
|
|
379
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let s=this.rules.block.list.exec(n);if(s){let r=s[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let f=!1;for(;n;){let m=!1,g="",y="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;g=s[0],n=n.substring(g.length);let k=s[2].split(`
|
|
380
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),x=n.split(`
|
|
381
|
-
`,1)[0],T=!k.trim(),E=0;if(this.options.pedantic?(E=2,y=k.trimStart()):T?E=s[1].length+1:(E=s[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,y=k.slice(E),E+=s[1].length),T&&this.rules.other.blankLine.test(x)&&(g+=x+`
|
|
382
|
-
`,n=n.substring(x.length+1),m=!0),!m){const M=this.rules.other.nextBulletRegex(E),I=this.rules.other.hrRegex(E),W=this.rules.other.fencesBeginRegex(E),O=this.rules.other.headingBeginRegex(E),B=this.rules.other.htmlBeginRegex(E);for(;n;){const K=n.split(`
|
|
383
|
-
`,1)[0];let G;if(x=K,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),G=x):G=x.replace(this.rules.other.tabCharGlobal," "),W.test(x)||O.test(x)||B.test(x)||M.test(x)||I.test(x))break;if(G.search(this.rules.other.nonSpaceChar)>=E||!x.trim())y+=`
|
|
384
|
-
`+G.slice(E);else{if(T||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||W.test(k)||O.test(k)||I.test(k))break;y+=`
|
|
385
|
-
`+x}!T&&!x.trim()&&(T=!0),g+=K+`
|
|
386
|
-
`,n=n.substring(K.length+1),k=G.slice(E)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let C=null,b;this.options.gfm&&(C=this.rules.other.listIsTask.exec(y),C&&(b=C[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!C,checked:b,loose:!1,text:y,tokens:[]}),a.raw+=g}const h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m=0;m<a.items.length;m++)if(this.lexer.state.top=!1,a.items[m].tokens=this.lexer.blockTokens(a.items[m].text,[]),!a.loose){const g=a.items[m].tokens.filter(k=>k.type==="space"),y=g.length>0&&g.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=y}if(a.loose)for(let m=0;m<a.items.length;m++)a.items[m].loose=!0;return a}}html(n){const s=this.rules.block.html.exec(n);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(n){const s=this.rules.block.def.exec(n);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:a}}}table(n){var f;const s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Mh(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=s[3])!=null&&f.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
387
|
-
`):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Mh(h,u.header.length).map((m,g)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[g]})));return u}}lheading(n){const s=this.rules.block.lheading.exec(n);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(n){const s=this.rules.block.paragraph.exec(n);if(s){const r=s[1].charAt(s[1].length-1)===`
|
|
388
|
-
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(n){const s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){const s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){const s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=Yi(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=r1(s[2],"()");if(u===-2)return;if(u>-1){const h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let o=s[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Lh(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=s[o.toLowerCase()];if(!a){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Lh(r,a,r[0],this.lexer,this.rules)}}emStrong(n,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let f,h,m=u,g=0;const y=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(y.lastIndex=0,s=s.slice(-1*n.length+u);(o=y.exec(s))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){m+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);const k=[...o[0]][0].length,x=n.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const E=x.slice(1,-1);return{type:"em",raw:x,text:E,tokens:this.lexer.inlineTokens(E)}}const T=x.slice(2,-2);return{type:"strong",raw:x,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(n){const s=this.rules.inline.code.exec(n);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(n){const s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n){const s=this.rules.inline.del.exec(n);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(n){const s=this.rules.inline.autolink.exec(n);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let s;if(s=this.rules.inline.url.exec(n)){let o,a;if(s[2]==="@")o=s[0],a="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?a="http://"+s[0]:a=s[0]}return{type:"link",raw:s[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const s=this.rules.inline.text.exec(n);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},js=class ju{constructor(s){lt(this,"tokens");lt(this,"options");lt(this,"state");lt(this,"tokenizer");lt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Tr,this.options.tokenizer=this.options.tokenizer||new na,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 r={other:gn,block:Al.normal,inline:Xi.normal};this.options.pedantic?(r.block=Al.pedantic,r.inline=Xi.pedantic):this.options.gfm&&(r.block=Al.gfm,this.options.breaks?r.inline=Xi.breaks:r.inline=Xi.gfm),this.tokenizer.rules=r}static get rules(){return{block:Al,inline:Xi}}static lex(s,r){return new ju(r).lex(s)}static lexInline(s,r){return new ju(r).inlineTokens(s)}lex(s){s=s.replace(gn.carriageReturn,`
|
|
389
|
-
`),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var a,u,f;for(this.options.pedantic&&(s=s.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},s,r))?(s=s.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.space(s)){s=s.substring(h.raw.length);const g=r.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
390
|
-
`:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
391
|
-
`+h.raw,g.text+=`
|
|
392
|
-
`+h.text,this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(h=this.tokenizer.fences(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.heading(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.hr(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.blockquote(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.list(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.html(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.def(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
393
|
-
`+h.raw,g.text+=`
|
|
394
|
-
`+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.lheading(s)){s=s.substring(h.raw.length),r.push(h);continue}let m=s;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const y=s.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},y),typeof k=="number"&&k>=0&&(g=Math.min(g,k))}),g<1/0&&g>=0&&(m=s.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=r.at(-1);o&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
|
|
395
|
-
`+h.raw,g.text+=`
|
|
396
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h),o=m.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const g=r.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
397
|
-
`+h.raw,g.text+=`
|
|
398
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):r.push(h);continue}if(s){const g="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,m,g;let o=s,a=null;if(this.tokens.links){const y=Object.keys(this.tokens.links);if(y.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)y.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,f="";for(;s;){u||(f=""),u=!1;let y;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(x=>(y=x.call({lexer:this},s,r))?(s=s.substring(y.raw.length),r.push(y),!0):!1))continue;if(y=this.tokenizer.escape(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.tag(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.link(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(y.raw.length);const x=r.at(-1);y.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=y.raw,x.text+=y.text):r.push(y);continue}if(y=this.tokenizer.emStrong(s,o,f)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.codespan(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.br(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.del(s)){s=s.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.autolink(s)){s=s.substring(y.raw.length),r.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(s))){s=s.substring(y.raw.length),r.push(y);continue}let k=s;if((g=this.options.extensions)!=null&&g.startInline){let x=1/0;const T=s.slice(1);let E;this.options.extensions.startInline.forEach(C=>{E=C.call({lexer:this},T),typeof E=="number"&&E>=0&&(x=Math.min(x,E))}),x<1/0&&x>=0&&(k=s.substring(0,x+1))}if(y=this.tokenizer.inlineText(k)){s=s.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(f=y.raw.slice(-1)),u=!0;const x=r.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=y.raw,x.text+=y.text):r.push(y);continue}if(s){const x="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return r}},sa=class{constructor(n){lt(this,"options");lt(this,"parser");this.options=n||Tr}space(n){return""}code({text:n,lang:s,escaped:r}){var u;const o=(u=(s||"").match(gn.notSpaceStart))==null?void 0:u[0],a=n.replace(gn.endingNewline,"")+`
|
|
399
|
-
`;return o?'<pre><code class="language-'+ps(o)+'">'+(r?a:ps(a,!0))+`</code></pre>
|
|
400
|
-
`:"<pre><code>"+(r?a:ps(a,!0))+`</code></pre>
|
|
401
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
402
|
-
${this.parser.parse(n)}</blockquote>
|
|
403
|
-
`}html({text:n}){return n}heading({tokens:n,depth:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
|
|
404
|
-
`}hr(n){return`<hr>
|
|
405
|
-
`}list(n){const s=n.ordered,r=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+a+u+`>
|
|
406
|
-
`+o+"</"+a+`>
|
|
407
|
-
`}listitem(n){var r;let s="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((r=n.tokens[0])==null?void 0:r.type)==="paragraph"?(n.tokens[0].text=o+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=o+" "+ps(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(n.tokens,!!n.loose),`<li>${s}</li>
|
|
408
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
409
|
-
`}table(n){let s="",r="";for(let a=0;a<n.header.length;a++)r+=this.tablecell(n.header[a]);s+=this.tablerow({text:r});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];r="";for(let f=0;f<u.length;f++)r+=this.tablecell(u[f]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
410
|
-
<thead>
|
|
411
|
-
`+s+`</thead>
|
|
412
|
-
`+o+`</table>
|
|
413
|
-
`}tablerow({text:n}){return`<tr>
|
|
414
|
-
${n}</tr>
|
|
415
|
-
`}tablecell(n){const s=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+s+`</${r}>
|
|
416
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ps(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:r}){const o=this.parser.parseInline(r),a=Dh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return s&&(u+=' title="'+ps(s)+'"'),u+=">"+o+"</a>",u}image({href:n,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Dh(n);if(a===null)return ps(r);n=a;let u=`<img src="${n}" alt="${r}"`;return s&&(u+=` title="${ps(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ps(n.text)}},hd=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Rs=class Ru{constructor(s){lt(this,"options");lt(this,"renderer");lt(this,"textRenderer");this.options=s||Tr,this.options.renderer=this.options.renderer||new sa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hd}static parse(s,r){return new Ru(r).parse(s)}static parseInline(s,r){return new Ru(r).parseInline(s)}parse(s,r=!0){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=h,y=this.options.extensions.renderers[g.type].call({parser:this},g);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){o+=y||"";continue}}const m=h;switch(m.type){case"space":{o+=this.renderer.space(m);continue}case"hr":{o+=this.renderer.hr(m);continue}case"heading":{o+=this.renderer.heading(m);continue}case"code":{o+=this.renderer.code(m);continue}case"table":{o+=this.renderer.table(m);continue}case"blockquote":{o+=this.renderer.blockquote(m);continue}case"list":{o+=this.renderer.list(m);continue}case"html":{o+=this.renderer.html(m);continue}case"paragraph":{o+=this.renderer.paragraph(m);continue}case"text":{let g=m,y=this.renderer.text(g);for(;f+1<s.length&&s[f+1].type==="text";)g=s[++f],y+=`
|
|
417
|
-
`+this.renderer.text(g);r?o+=this.renderer.paragraph({type:"paragraph",raw:y,text:y,tokens:[{type:"text",raw:y,text:y,escaped:!0}]}):o+=y;continue}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}parseInline(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=g||"";continue}}const m=h;switch(m.type){case"escape":{o+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.text(m);break}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},gu,zl=(gu=class{constructor(n){lt(this,"options");lt(this,"block");this.options=n||Tr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?js.lex:js.lexInline}provideParser(){return this.block?Rs.parse:Rs.parseInline}},lt(gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),gu),o1=class{constructor(...n){lt(this,"defaults",od());lt(this,"options",this.setOptions);lt(this,"parse",this.parseMarkdown(!0));lt(this,"parseInline",this.parseMarkdown(!1));lt(this,"Parser",Rs);lt(this,"Renderer",sa);lt(this,"TextRenderer",hd);lt(this,"Lexer",js);lt(this,"Tokenizer",na);lt(this,"Hooks",zl);this.use(...n)}walkTokens(n,s){var o,a;let r=[];for(const u of n)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)r=r.concat(this.walkTokens(h.tokens,s));for(const h of f.rows)for(const m of h)r=r.concat(this.walkTokens(m.tokens,s));break}case"list":{const f=u;r=r.concat(this.walkTokens(f.items,s));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const m=f[h].flat(1/0);r=r.concat(this.walkTokens(m,s))}):f.tokens&&(r=r.concat(this.walkTokens(f.tokens,s)))}}return r}use(...n){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=s.renderers[a.name];u?s.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:s.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[a.level];u?u.unshift(a.tokenizer):s[a.level]=[a.tokenizer],a.start&&(a.level==="block"?s.startBlock?s.startBlock.push(a.start):s.startBlock=[a.start]:a.level==="inline"&&(s.startInline?s.startInline.push(a.start):s.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(s.childTokens[a.name]=a.childTokens)}),o.extensions=s),r.renderer){const a=this.defaults.renderer||new sa(this.defaults);for(const u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=r.renderer[f],m=a[f];a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y||""}}o.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new na(this.defaults);for(const u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=r.tokenizer[f],m=a[f];a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y}}o.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new zl;for(const u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=r.hooks[f],m=a[f];zl.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(k=>m.call(a,k));const y=h.call(a,g);return m.call(a,y)}:a[f]=(...g)=>{let y=h.apply(a,g);return y===!1&&(y=m.apply(a,g)),y}}o.hooks=a}if(r.walkTokens){const a=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,s){return js.lex(n,s??this.defaults)}parser(n,s){return Rs.parse(n,s??this.defaults)}parseMarkdown(n){return(r,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(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 r>"u"||r===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?js.lex:js.lexInline,m=u.hooks?u.hooks.provideParser():n?Rs.parse:Rs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(g=>h(g,u)).then(g=>u.hooks?u.hooks.processAllTokens(g):g).then(g=>u.walkTokens?Promise.all(this.walkTokens(g,u.walkTokens)).then(()=>g):g).then(g=>m(g,u)).then(g=>u.hooks?u.hooks.postprocess(g):g).catch(f);try{u.hooks&&(r=u.hooks.preprocess(r));let g=h(r,u);u.hooks&&(g=u.hooks.processAllTokens(g)),u.walkTokens&&this.walkTokens(g,u.walkTokens);let y=m(g,u);return u.hooks&&(y=u.hooks.postprocess(y)),y}catch(g){return f(g)}}}onError(n,s){return r=>{if(r.message+=`
|
|
418
|
-
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ps(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},kr=new o1;function Ge(n,s){return kr.parse(n,s)}Ge.options=Ge.setOptions=function(n){return kr.setOptions(n),Ge.defaults=kr.defaults,vg(Ge.defaults),Ge};Ge.getDefaults=od;Ge.defaults=Tr;Ge.use=function(...n){return kr.use(...n),Ge.defaults=kr.defaults,vg(Ge.defaults),Ge};Ge.walkTokens=function(n,s){return kr.walkTokens(n,s)};Ge.parseInline=kr.parseInline;Ge.Parser=Rs;Ge.parser=Rs.parse;Ge.Renderer=sa;Ge.TextRenderer=hd;Ge.Lexer=js;Ge.lexer=js.lex;Ge.Tokenizer=na;Ge.Hooks=zl;Ge.parse=Ge;Ge.options;Ge.setOptions;Ge.use;Ge.walkTokens;Ge.parseInline;Rs.parse;js.lex;/*! @license DOMPurify 3.4.13 | (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.13/LICENSE */function Ph(n,s){(s==null||s>n.length)&&(s=n.length);for(var r=0,o=Array(s);r<s;r++)o[r]=n[r];return o}function l1(n){if(Array.isArray(n))return n}function a1(n,s){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(r=r.call(n)).next,s!==0)for(;!(m=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);m=!0);}catch(y){g=!0,a=y}finally{try{if(!m&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function c1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
419
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u1(n,s){return l1(n)||a1(n,s)||d1(n,s)||c1()}function d1(n,s){if(n){if(typeof n=="string")return Ph(n,s);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ph(n,s):void 0}}const _g=Object.entries,Oh=Object.setPrototypeOf,f1=Object.isFrozen,p1=Object.getPrototypeOf,h1=Object.getOwnPropertyDescriptor;let Jt=Object.freeze,tn=Object.seal,ei=Object.create,jg=typeof Reflect<"u"&&Reflect,Au=jg.apply,Iu=jg.construct;Jt||(Jt=function(s){return s});tn||(tn=function(s){return s});Au||(Au=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});Iu||(Iu=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const Qr=Pt(Array.prototype.forEach),m1=Pt(Array.prototype.lastIndexOf),zh=Pt(Array.prototype.pop),Zr=Pt(Array.prototype.push),g1=Pt(Array.prototype.splice),Js=Array.isArray,to=Pt(String.prototype.toLowerCase),cu=Pt(String.prototype.toString),$h=Pt(String.prototype.match),Qi=Pt(String.prototype.replace),Fh=Pt(String.prototype.indexOf),v1=Pt(String.prototype.trim),y1=Pt(Number.prototype.toString),x1=Pt(Boolean.prototype.toString),Uh=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Bh=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),Kt=Pt(Object.prototype.hasOwnProperty),Zi=Pt(Object.prototype.toString),qt=Pt(RegExp.prototype.test),xr=w1(TypeError);function Pt(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Au(n,s,o)}}function w1(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Iu(n,r)}}function Ve(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:to;if(Oh&&Oh(n,null),!Js(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(f1(s)||(s[o]=u),a=u)}n[a]=!0}return n}function k1(n){for(let s=0;s<n.length;s++)Kt(n,s)||(n[s]=null);return n}function cn(n){const s=ei(null);for(const o of _g(n)){var r=u1(o,2);const a=r[0],u=r[1];Kt(n,a)&&(Js(u)?s[a]=k1(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function S1(n){switch(typeof n){case"string":return n;case"number":return y1(n);case"boolean":return x1(n);case"bigint":return Uh?Uh(n):"0";case"symbol":return Bh?Bh(n):"Symbol()";case"undefined":return Zi(n);case"function":case"object":{if(n===null)return Zi(n);const s=n,r=ss(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:Zi(o)}return Zi(n)}default:return Zi(n)}}function ss(n,s){for(;n!==null;){const o=h1(n,s);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}n=p1(n)}function r(){return null}return r}function T1(n){try{return qt(n,""),!0}catch{return!1}}const Wh=Jt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=Jt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),du=Jt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),b1=Jt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fu=Jt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),N1=Jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hh=Jt(["#text"]),Vh=Jt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),pu=Jt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Gh=Jt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Il=Jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C1=tn(/{{[\w\W]*|^[\w\W]*}}/g),E1=tn(/<%[\w\W]*|^[\w\W]*%>/g),_1=tn(/\${[\w\W]*/g),j1=tn(/^data-[\-\w.\u00B7-\uFFFF]+$/),R1=tn(/^aria-[\-\w]+$/),qh=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),A1=tn(/^(?:\w+script|data):/i),I1=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),D1=tn(/^html$/i),M1=tn(/^[a-z][.\w]*(-[.\w]+)+$/i),Kh=tn(/<[/\w!]/g),Xh=tn(/<[/\w]/g),L1=tn(/<\/no(script|embed|frames)/i),P1=tn(/\/>/i),Pn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},O1=function(){return typeof window>"u"?null:window},z1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Yh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Qs=function(s,r,o,a){return Kt(s,r)&&Js(s[r])?Ve(a.base?cn(a.base):{},s[r],a.transform):o};function Rg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O1();const s=ie=>Rg(ie);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==Pn.document||!n.Element)return s.isSupported=!1,s;let r=n.document;const o=r,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,k=n.trustedTypes,x=h.prototype,T=ss(x,"cloneNode"),E=ss(x,"remove"),C=ss(x,"nextSibling"),b=ss(x,"childNodes"),M=ss(x,"parentNode"),I=ss(x,"shadowRoot"),W=ss(x,"attributes"),O=f&&f.prototype?ss(f.prototype,"nodeType"):null,B=f&&f.prototype?ss(f.prototype,"nodeName"):null,K=f&&f.prototype?ss(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const ie=r.createElement("template");ie.content&&ie.content.ownerDocument&&(r=ie.content.ownerDocument)}let G,q="",le,de=!1,me=0;const fe=function(){if(me>0)throw xr('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.')},pe=function(S){fe(),me++;try{return G.createHTML(S)}finally{me--}},Me=function(S){fe(),me++;try{return G.createScriptURL(S)}finally{me--}},Z=function(){return de||(le=z1(k,a),de=!0),le},re=r,ce=re.implementation,P=re.createNodeIterator,ee=re.createDocumentFragment,H=re.getElementsByTagName,R=o.importNode;let _=Yh();s.isSupported=typeof _g=="function"&&typeof M=="function"&&ce&&ce.createHTMLDocument!==void 0;const X=C1,se=E1,Se=_1,be=j1,Le=R1,je=A1,De=I1,xe=M1;let at=qh,Pe=null;const ht=Ve({},[...Wh,...uu,...du,...fu,...Hh]);let $e=null;const mt=Ve({},[...Vh,...pu,...Gh,...Il]);let He=Object.seal(ei(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}})),Mt=null,nn=null;const ot=Object.seal(ei(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let gt=!0,Ot=!0,V=!1,we=!0,Fe=!1,qe=!0,vt=!1,yt=!1,ct=null,Yt=null,xn=!1,dt=!1,Xn=!1,Fn=!1,jn=!0,Yn=!1;const wn="user-content-";let Rn=!0,un=!1,dn={},zt=null;const kn=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 st=null;const kt=Ve({},["audio","video","img","source","image","track"]);let j=null;const ae=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),te="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",Ee="http://www.w3.org/1999/xhtml";let Ue=Ee,ve=!1,Qe=null;const rt=Ve({},[te,ue,Ee],cu),xt=Jt(["mi","mo","mn","ms","mtext"]);let jt=Ve({},xt);const Bt=Jt(["annotation-xml"]);let Rt=Ve({},Bt);const Wt=Ve({},["title","style","font","a","script"]);let sn=null;const tt=["application/xhtml+xml","text/html"],At="text/html";let Be=null,vs=null;const xo=r.createElement("form"),wo=function(S){return S instanceof RegExp||S instanceof Function},br=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vs&&vs===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),sn=tt.indexOf(S.PARSER_MEDIA_TYPE)===-1?At:S.PARSER_MEDIA_TYPE,Be=sn==="application/xhtml+xml"?cu:to,Pe=Qs(S,"ALLOWED_TAGS",ht,{transform:Be}),$e=Qs(S,"ALLOWED_ATTR",mt,{transform:Be}),Qe=Qs(S,"ALLOWED_NAMESPACES",rt,{transform:cu}),j=Qs(S,"ADD_URI_SAFE_ATTR",ae,{transform:Be,base:ae}),st=Qs(S,"ADD_DATA_URI_TAGS",kt,{transform:Be,base:kt}),zt=Qs(S,"FORBID_CONTENTS",kn,{transform:Be}),Mt=Qs(S,"FORBID_TAGS",cn({}),{transform:Be}),nn=Qs(S,"FORBID_ATTR",cn({}),{transform:Be}),dn=Kt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,gt=S.ALLOW_ARIA_ATTR!==!1,Ot=S.ALLOW_DATA_ATTR!==!1,V=S.ALLOW_UNKNOWN_PROTOCOLS||!1,we=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=S.SAFE_FOR_TEMPLATES||!1,qe=S.SAFE_FOR_XML!==!1,vt=S.WHOLE_DOCUMENT||!1,dt=S.RETURN_DOM||!1,Xn=S.RETURN_DOM_FRAGMENT||!1,Fn=S.RETURN_TRUSTED_TYPE||!1,xn=S.FORCE_BODY||!1,jn=S.SANITIZE_DOM!==!1,Yn=S.SANITIZE_NAMED_PROPS||!1,Rn=S.KEEP_CONTENT!==!1,un=S.IN_PLACE||!1,at=T1(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:qh,Ue=typeof S.NAMESPACE=="string"?S.NAMESPACE:Ee,jt=Kt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ve({},xt),Rt=Kt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ve({},Bt);const z=Kt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):ei(null);if(He=ei(null),Kt(z,"tagNameCheck")&&wo(z.tagNameCheck)&&(He.tagNameCheck=z.tagNameCheck),Kt(z,"attributeNameCheck")&&wo(z.attributeNameCheck)&&(He.attributeNameCheck=z.attributeNameCheck),Kt(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(He.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),tn(He),Fe&&(Ot=!1),Xn&&(dt=!0),dn&&(Pe=Ve({},Hh),$e=ei(null),dn.html===!0&&(Ve(Pe,Wh),Ve($e,Vh)),dn.svg===!0&&(Ve(Pe,uu),Ve($e,pu),Ve($e,Il)),dn.svgFilters===!0&&(Ve(Pe,du),Ve($e,pu),Ve($e,Il)),dn.mathMl===!0&&(Ve(Pe,fu),Ve($e,Gh),Ve($e,Il))),ot.tagCheck=null,ot.attributeCheck=null,Kt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?ot.tagCheck=S.ADD_TAGS:Js(S.ADD_TAGS)&&(Pe===ht&&(Pe=cn(Pe)),Ve(Pe,S.ADD_TAGS,Be))),Kt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?ot.attributeCheck=S.ADD_ATTR:Js(S.ADD_ATTR)&&($e===mt&&($e=cn($e)),Ve($e,S.ADD_ATTR,Be))),Kt(S,"ADD_URI_SAFE_ATTR")&&Js(S.ADD_URI_SAFE_ATTR)&&Ve(j,S.ADD_URI_SAFE_ATTR,Be),Kt(S,"FORBID_CONTENTS")&&Js(S.FORBID_CONTENTS)&&(zt===kn&&(zt=cn(zt)),Ve(zt,S.FORBID_CONTENTS,Be)),Kt(S,"ADD_FORBID_CONTENTS")&&Js(S.ADD_FORBID_CONTENTS)&&(zt===kn&&(zt=cn(zt)),Ve(zt,S.ADD_FORBID_CONTENTS,Be)),Rn&&(Pe["#text"]=!0),vt&&Ve(Pe,["html","head","body"]),Pe.table&&(Ve(Pe,["tbody"]),delete Mt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Y=G;G=S.TRUSTED_TYPES_POLICY;try{q=pe("")}catch(ke){throw G=Y,ke}}else S.TRUSTED_TYPES_POLICY===null?(G=void 0,q=""):(G===void 0&&(G=Z()),G&&typeof q=="string"&&(q=pe("")));Jt&&Jt(S),vs=S},pi=Ve({},[...uu,...du,...b1]),hi=Ve({},[...fu,...N1]),ko=function(S,z,Y){return z.namespaceURI===Ee?S==="svg":z.namespaceURI===te?S==="svg"&&(Y==="annotation-xml"||jt[Y]):!!pi[S]},va=function(S,z,Y){return z.namespaceURI===Ee?S==="math":z.namespaceURI===ue?S==="math"&&Rt[Y]:!!hi[S]},ya=function(S,z,Y){return z.namespaceURI===ue&&!Rt[Y]||z.namespaceURI===te&&!jt[Y]?!1:!hi[S]&&(Wt[S]||!pi[S])},St=function(S){let z=M(S);(!z||!z.tagName)&&(z={namespaceURI:Ue,tagName:"template"});const Y=to(S.tagName),ke=to(z.tagName);return Qe[S.namespaceURI]?S.namespaceURI===ue?ko(Y,z,ke):S.namespaceURI===te?va(Y,z,ke):S.namespaceURI===Ee?ya(Y,z,ke):!!(sn==="application/xhtml+xml"&&Qe[S.namespaceURI]):!1},ls=function(S){Zr(s.removed,{element:S});try{M(S).removeChild(S)}catch{if(E(S),!M(S))throw xr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Is=function(S){tr(S);const z=b(S);if(z){const ke=[];Qr(z,_e=>{Zr(ke,_e)}),Qr(ke,_e=>{try{E(_e)}catch{}})}const Y=W(S);if(Y)for(let ke=Y.length-1;ke>=0;--ke){const _e=Y[ke],ze=_e&&_e.name;if(typeof ze=="string")try{S.removeAttribute(ze)}catch{}}},as=function(S,z){try{Zr(s.removed,{attribute:z.getAttributeNode(S),from:z})}catch{Zr(s.removed,{attribute:null,from:z})}if(z.removeAttribute(S),S==="is")if(dt||Xn)try{ls(z)}catch{}else try{z.setAttribute(S,"")}catch{}},Nr=function(S){const z=W(S);if(z)for(let Y=z.length-1;Y>=0;--Y){const ke=z[Y],_e=ke&&ke.name;if(!(typeof _e!="string"||$e[Be(_e)]))try{S.removeAttribute(_e)}catch{}}},tr=function(S){const z=[S];for(;z.length>0;){const Y=z.pop();(O?O(Y):Y.nodeType)===Pn.element&&Nr(Y);const _e=b(Y);if(_e)for(let ze=_e.length-1;ze>=0;--ze)z.push(_e[ze])}},So=function(S){if(!qe)return;const z=[S];for(;z.length>0;){const Y=z.pop(),ke=O?O(Y):Y.nodeType;if(ke===Pn.processingInstruction||ke===Pn.comment&&qt(Xh,Y.data)){try{E(Y)}catch{}continue}if(ke===Pn.element){const ze=Y,Xe=Be(B?B(Y):Y.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&Xe!=="label"&&Xe!=="output"&&ze.removeAttribute("for")}catch{}}const _e=b(Y);if(_e)for(let ze=_e.length-1;ze>=0;--ze)z.push(_e[ze])}},nr=function(S){let z=null,Y=null;if(xn)S="<remove></remove>"+S;else{const ze=$h(S,/^[\r\n\t ]+/);Y=ze&&ze[0]}sn==="application/xhtml+xml"&&Ue===Ee&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ke=G?pe(S):S;if(Ue===Ee)try{z=new y().parseFromString(ke,sn)}catch{}if(!z||!z.documentElement){z=ce.createDocument(Ue,"template",null);try{z.documentElement.innerHTML=ve?q:ke}catch{}}const _e=z.body||z.documentElement;return S&&Y&&_e.insertBefore(r.createTextNode(Y),_e.childNodes[0]||null),Ue===Ee?H.call(z,vt?"html":"body")[0]:vt?z.documentElement:_e},An=function(S){const z=K?K(S):S.ownerDocument;return P.call(z||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Cr=function(S){return S=Qi(S,X," "),S=Qi(S,se," "),S=Qi(S,Se," "),S},fn=function(S){var z;S.normalize();const Y=K?K(S):S.ownerDocument,ke=P.call(Y||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let _e=ke.nextNode();for(;_e;)_e.data=Cr(_e.data),_e=ke.nextNode();const ze=(z=S.querySelectorAll)===null||z===void 0?void 0:z.call(S,"template");ze&&Qr(ze,Xe=>{Ds(Xe.content)&&fn(Xe.content)})},Er=function(S){const z=B?B(S):null;return typeof z!="string"||Be(z)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==W(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==O(S)||S.childNodes!==b(S)},Ds=function(S){if(!O||typeof S!="object"||S===null)return!1;try{return O(S)===Pn.documentFragment}catch{return!1}},sr=function(S){if(!O||typeof S!="object"||S===null)return!1;try{return typeof O(S)=="number"}catch{return!1}};function pn(ie,S,z){ie.length!==0&&Qr(ie,Y=>{Y.call(s,S,z,vs)})}const _r=function(S,z){return!!(qe&&S.hasChildNodes()&&!sr(S.firstElementChild)&&qt(Kh,S.textContent)&&qt(Kh,S.innerHTML)||qe&&S.namespaceURI===Ee&&z==="style"&&sr(S.firstElementChild)||S.nodeType===Pn.processingInstruction||qe&&S.nodeType===Pn.comment&&qt(Xh,S.data))},rr=function(S,z,Y){if(!Mt[z]&&gi(z)&&(He.tagNameCheck instanceof RegExp&&qt(He.tagNameCheck,z)||He.tagNameCheck instanceof Function&&He.tagNameCheck(z)))return!1;if(Rn&&!zt[z]){const ke=M(S),_e=b(S);if(_e&&ke){const ze=_e.length;for(let Xe=ze-1;Xe>=0;--Xe){const Ze=S===Y?T(_e[Xe],!0):_e[Xe];ke.insertBefore(Ze,C(S))}}}return ls(S),!0},ir=function(S,z,Y,ke){return S.length===0?z:z===Y||z===ke?cn(z):z},To=function(S,z){if(pn(_.beforeSanitizeElements,S,null),S!==z&&M(S)===null)return un&&tr(S),!0;if(Er(S))return ls(S),!0;const Y=Be(B?B(S):S.nodeName);if(Pe=ir(_.uponSanitizeElement,Pe,ht,ct),pn(_.uponSanitizeElement,S,{tagName:Y,allowedTags:Pe}),S!==z&&M(S)===null)return un&&tr(S),!0;if(_r(S,Y))return ls(S),!0;if(Mt[Y]||!(ot.tagCheck instanceof Function&&ot.tagCheck(Y))&&!Pe[Y]){const _e=rr(S,Y,z);return _e===!1&&pn(_.afterSanitizeElements,S,null),_e}if((O?O(S):S.nodeType)===Pn.element&&!St(S)||(Y==="noscript"||Y==="noembed"||Y==="noframes")&&qt(L1,S.innerHTML))return ls(S),!0;if(Fe&&S.nodeType===Pn.text){const _e=Cr(S.textContent);S.textContent!==_e&&(Zr(s.removed,{element:S.cloneNode()}),S.textContent=_e)}return pn(_.afterSanitizeElements,S,null),!1},bo=function(S,z,Y){if(nn[z]||qe&&z==="patchsrc"||qe&&z==="for"&&S!=="label"&&S!=="output"||jn&&(z==="id"||z==="name")&&(Y in r||Y in xo))return!1;const ke=$e[z]||ot.attributeCheck instanceof Function&&ot.attributeCheck(z,S);if(!(Ot&&qt(be,z))){if(!(gt&&qt(Le,z))){if(ke){if(!j[z]){if(!qt(at,Qi(Y,De,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&S!=="script"&&Fh(Y,"data:")===0&&st[S])){if(!(V&&!qt(je,Qi(Y,De,"")))){if(Y)return!1}}}}}else if(!(gi(S)&&(He.tagNameCheck instanceof RegExp&&qt(He.tagNameCheck,S)||He.tagNameCheck instanceof Function&&He.tagNameCheck(S))&&(He.attributeNameCheck instanceof RegExp&&qt(He.attributeNameCheck,z)||He.attributeNameCheck instanceof Function&&He.attributeNameCheck(z,S))||z==="is"&&He.allowCustomizedBuiltInElements&&(He.tagNameCheck instanceof RegExp&&qt(He.tagNameCheck,Y)||He.tagNameCheck instanceof Function&&He.tagNameCheck(Y))))return!1}}return!0},mi=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),gi=function(S){return!mi[to(S)]&&qt(xe,S)},vi=function(S,z,Y,ke){if(G&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Y)switch(k.getAttributeType(S,z)){case"TrustedHTML":return pe(ke);case"TrustedScriptURL":return Me(ke)}return ke},or=function(S,z,Y,ke){try{Y?S.setAttributeNS(Y,z,ke):S.setAttribute(z,ke),Er(S)?ls(S):zh(s.removed)}catch{as(z,S)}},No=function(S){pn(_.beforeSanitizeAttributes,S,null);const z=S.attributes;if(!z||Er(S))return;$e=ir(_.uponSanitizeAttribute,$e,mt,Yt);const Y={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let ke=z.length;const _e=Be(S.nodeName);for(;ke--;){const ze=z[ke],Xe=ze.name,Ze=ze.namespaceURI,Tt=ze.value,bt=Be(Xe),ys=Tt;let It=Xe==="value"?ys:v1(ys);if(Y.attrName=bt,Y.attrValue=It,Y.keepAttr=!0,Y.forceKeepAttr=void 0,pn(_.uponSanitizeAttribute,S,Y),It=Y.attrValue,Yn&&(bt==="id"||bt==="name")&&Fh(It,wn)!==0&&(as(Xe,S),It=wn+It),qe&&qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){as(Xe,S);continue}if(bt==="attributename"&&$h(It,"href")){as(Xe,S);continue}if(!Y.forceKeepAttr){if(!Y.keepAttr){as(Xe,S);continue}if(!we&&qt(P1,It)){as(Xe,S);continue}if(Fe&&(It=Cr(It)),!bo(_e,bt,It)){as(Xe,S);continue}It=vi(_e,bt,Ze,It),It!==ys&&or(S,Xe,Ze,It)}}pn(_.afterSanitizeAttributes,S,null)},Ms=function(S){let z=null;const Y=An(S);for(pn(_.beforeSanitizeShadowDOM,S,null);z=Y.nextNode();)if(pn(_.uponSanitizeShadowNode,z,null),To(z,S),No(z),Ds(z.content)&&Ms(z.content),(O?O(z):z.nodeType)===Pn.element){const _e=I(z);Ds(_e)&&(Ke(_e),Ms(_e))}pn(_.afterSanitizeShadowDOM,S,null)},Ke=function(S){const z=[{node:S,shadow:null}];for(;z.length>0;){const Y=z.pop();if(Y.shadow){Ms(Y.shadow);continue}const ke=Y.node,ze=(O?O(ke):ke.nodeType)===Pn.element,Xe=b(ke);if(Xe)for(let Ze=Xe.length-1;Ze>=0;--Ze)z.push({node:Xe[Ze],shadow:null});if(ze){const Ze=B?B(ke):null;if(typeof Ze=="string"&&Be(Ze)==="template"){const Tt=ke.content;Ds(Tt)&&z.push({node:Tt,shadow:null})}}if(ze){const Ze=I(ke);Ds(Ze)&&z.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return s.sanitize=function(ie){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,Y=null,ke=null,_e=null;if(ve=!ie,ve&&(ie="<!-->"),typeof ie!="string"&&!sr(ie)&&(ie=S1(ie),typeof ie!="string"))throw xr("dirty is not a string, aborting");if(!s.isSupported)return ie;yt?(Pe=ct,$e=Yt):br(S),(_.uponSanitizeElement.length>0||_.uponSanitizeAttribute.length>0)&&(Pe=cn(Pe)),_.uponSanitizeAttribute.length>0&&($e=cn($e)),s.removed=[];const ze=un&&typeof ie!="string"&&sr(ie);if(ze){So(ie);const Tt=B?B(ie):ie.nodeName;if(typeof Tt=="string"){const bt=Be(Tt);if(!Pe[bt]||Mt[bt])throw Is(ie),xr("root node is forbidden and cannot be sanitized in-place")}if(Er(ie))throw Is(ie),xr("root node is clobbered and cannot be sanitized in-place");try{Ke(ie)}catch(bt){throw Is(ie),bt}}else if(sr(ie))z=nr("<!---->"),Y=z.ownerDocument.importNode(ie,!0),Y.nodeType===Pn.element&&Y.nodeName==="BODY"||Y.nodeName==="HTML"?z=Y:z.appendChild(Y),Ke(Y);else{if(!dt&&!Fe&&!vt&&ie.indexOf("<")===-1)return G&&Fn?pe(ie):ie;if(z=nr(ie),!z)return dt?null:Fn?q:""}z&&xn&&ls(z.firstChild);const Xe=ze?ie:z;try{const Tt=An(Xe);for(;ke=Tt.nextNode();)To(ke,Xe),No(ke),Ds(ke.content)&&Ms(ke.content)}catch(Tt){throw ze&&(Is(ie),Qr(s.removed,bt=>{bt.element&&tr(bt.element)})),Tt}if(ze)return Qr(s.removed,Tt=>{Tt.element&&tr(Tt.element)}),Fe&&fn(ie),ie;if(dt){if(Fe&&fn(z),Xn)for(_e=ee.call(z.ownerDocument);z.firstChild;)_e.appendChild(z.firstChild);else _e=z;return($e.shadowroot||$e.shadowrootmode)&&(_e=R.call(o,_e,!0)),_e}let Ze=vt?z.outerHTML:z.innerHTML;return vt&&Pe["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&qt(D1,z.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
420
|
-
`+Ze),Fe&&(Ze=Cr(Ze)),G&&Fn?pe(Ze):Ze},s.setConfig=function(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};br(ie),yt=!0,ct=Pe,Yt=$e},s.clearConfig=function(){vs=null,yt=!1,ct=null,Yt=null,G=le,q=""},s.isValidAttribute=function(ie,S,z){vs||br({});const Y=Be(ie),ke=Be(S);return bo(Y,ke,z)},s.addHook=function(ie,S){typeof S=="function"&&Kt(_,ie)&&Zr(_[ie],S)},s.removeHook=function(ie,S){if(Kt(_,ie)){if(S!==void 0){const z=m1(_[ie],S);return z===-1?void 0:g1(_[ie],z,1)[0]}return zh(_[ie])}},s.removeHooks=function(ie){Kt(_,ie)&&(_[ie]=[])},s.removeAllHooks=function(){_=Yh()},s}var md=Rg();const $1=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Qh(n){return $1.has(n.type)}function F1({items:n,runtimeType:s,turn:r,threads:o=[]}){const[a,u]=w.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(C0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(Yu,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(h=>c.jsx(_s,{item:h,runtimeType:s,turn:r,threads:o},h.id))})]})}Ge.setOptions({breaks:!0,gfm:!0});function U1(n){const s=Ge.parse(n);return md.sanitize(s)}function Zh(n,s){var a;const r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>s)return{node:u,offset:s-o};o+=f}return null}function B1(n,s,r){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,s)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,m=f;if(u===s.startContainer&&(h=Math.min(s.startOffset,f)),u===s.endContainer&&(m=Math.min(s.endOffset,f)),h>=m)continue;m<f&&u.splitText(m);const g=h>0?u.splitText(h):u,y=r(),k=g.parentNode;k&&(k.insertBefore(y,g),y.appendChild(g))}}function W1(n,s){n.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Zh(n,r.start_offset),a=Zh(n,r.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),B1(n,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",r.id),r.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function H1(n){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!n.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(r.startContainer,r.startOffset);const a=o.toString().length,u=r.toString();return{start:a,end:a+u.length,text:u}}function V1({itemId:n,turnId:s,sessionId:r,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),m=w.useRef(""),g=w.useRef(0),[y,k]=w.useState(!1),[x,T]=w.useState({x:0,y:0}),[E,C]=w.useState(!1),[b,M]=w.useState({x:0,y:0}),[I,W]=w.useState(""),[O,B]=w.useState(null),[K,G]=w.useState(!1),q=L(H=>H.createThread),le=L(H=>H.switchRightTab),de=L(H=>oa(H.sessionDetails[r])),me=w.useCallback(async()=>{await Eu(o||""),G(!0),setTimeout(()=>G(!1),1500)},[o]),fe=w.useCallback(()=>{var R;if(!O)return;const H=`
|
|
421
|
-
\`\`\`QUOTE
|
|
422
|
-
${O.text}
|
|
423
|
-
\`\`\`
|
|
424
|
-
|
|
425
|
-
`;L.setState({quotedText:H}),k(!1),B(null),(R=window.getSelection())==null||R.removeAllRanges()},[O]),pe=w.useMemo(()=>U1(o||"…"),[o]),Me=w.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);w.useEffect(()=>{u.current&&W1(u.current,Me)},[pe,Me]),w.useEffect(()=>{m.current=I},[I]),w.useEffect(()=>{function H(R){f.current&&!f.current.contains(R.target)&&(k(!1),m.current.trim()||C(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const Z=w.useCallback(()=>{k(!1),m.current.trim()||C(!1)},[]),re=w.useCallback(()=>{const H=u.current;if(!H)return;const R=H1(H);if(R&&R.text.trim().length>0){const _=window.getSelection();if(_&&_.rangeCount>0&&_.anchorNode&&_.focusNode){const se=_.getRangeAt(0).getBoundingClientRect(),Se=28,be=6,Le=170;let je=!1;try{const at=document.createRange();at.setStart(_.focusNode,_.focusOffset),at.setEnd(_.focusNode,_.focusOffset);const Pe=document.createRange();Pe.setStart(_.anchorNode,_.anchorOffset),Pe.setEnd(_.anchorNode,_.anchorOffset),je=Pe.compareBoundaryPoints(Range.START_TO_START,at)>0}catch{je=!1}let De=se.top-Se-be;De<8&&(De=se.bottom+be);let xe=je?se.left-Le:se.right;xe=Math.max(8,Math.min(xe,window.innerWidth-Le-8)),T({x:xe,y:De}),k(!0),B(R)}}else k(!1)},[]);w.useEffect(()=>{function H(R){const _=R.target;_&&(_.closest(".selection-actions")||_.closest(".thread-create-popover"))||re()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[re]);const ce=w.useCallback(()=>{k(!1),C(!0),M({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!E)return;const H=h.current;if(!H)return;const R=H.offsetWidth,_=H.offsetHeight,X=8;let se=x.x,Se=x.y;se-R<X&&(se=R+X),se>window.innerWidth-X&&(se=window.innerWidth-X),Se<X&&(Se=X),Se+_>window.innerHeight-X&&(Se=window.innerHeight-_-X),M({x:se,y:Se})},[E,x]);const P=w.useCallback(async()=>{var H;de||!O||!I.trim()||(await q(r,{itemId:n,turnId:s,startOffset:O.start,endOffset:O.end,selectedText:O.text,message:I.trim()}),W(""),C(!1),B(null),(H=window.getSelection())==null||H.removeAllRanges(),le("threads"))},[O,I,q,r,n,s,le,de]),ee=w.useCallback(H=>{const R=H.target;if(R.tagName==="MARK"&&R.hasAttribute("data-thread-id")){H.preventDefault(),le("threads");const _=R.getAttribute("data-thread-id");setTimeout(()=>{const X=document.getElementById(`thread-${_}`);X&&(X.scrollIntoView({behavior:"smooth",block:"center"}),X.classList.add("thread-card-highlighted"),setTimeout(()=>X.classList.remove("thread-card-highlighted"),1500))},100)}},[le]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:pe},onMouseDown:Z,onClick:ee}),c.jsx("button",{className:`copy-text-btn${K?" copied":""}`,onClick:me,title:K?"Copied":"Copy message","aria-label":"Copy message text",children:K?c.jsx(er,{size:14}):c.jsx(Su,{size:14})}),y&&!E&&c.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!de&&c.jsxs("button",{className:"discuss-button",onClick:ce,title:"Start a discussion about this text",children:[c.jsx(f0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:fe,title:"Quote this text in your message",children:[c.jsx(Um,{size:14}),c.jsx("span",{children:"Quote"})]})]}),E&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:b.x,top:b.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',O==null?void 0:O.text.slice(0,80),O&&O.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),B(null)},children:c.jsx($n,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:I,onChange:H=>W(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),P()),H.key==="Escape")if(m.current.trim()){const R=Date.now();g.current&&R-g.current<400?(g.current=0,C(!1),B(null)):g.current=R}else C(!1),B(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:P,disabled:!I.trim()||de,title:de?"Wait for the running turn to finish first":void 0,children:[c.jsx(ca,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Jh=w.memo(V1),ra=new Map,Ag=new Set,Du=new Set,em=new Map;function Ig(){Du.forEach(n=>n())}function Dg(n,s){return`${n}:${s}`}function G1(n,s,r,o,a){var m;const u=Dg(s,r),f=ra.get(n)??new Map,h=new Map(f);((m=h.get(u))==null?void 0:m.answer)===a?h.delete(u):h.set(u,{itemIndex:s,groupIndex:r,question:o,answer:a}),ra.set(n,h),Ig()}function q1(n){ra.delete(n),Ig()}function K1(n){Ag.add(n),q1(n)}function X1(n){const s=w.useCallback(r=>(Du.add(r),()=>{Du.delete(r)}),[]);return w.useSyncExternalStore(s,()=>ra.get(n)??em,()=>em)}function Y1(n){return[...n].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
|
|
426
|
-
${s.answer}`).join(`
|
|
427
|
-
|
|
428
|
-
`)}function tm({item:n,turn:s}){var T;const r=n.data??{},o=w.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(E=>!!E&&Array.isArray(E.selections)&&E.selections.length>0):[],[r.groups]),a=X1(s.id),u=L(E=>s.session_id?E.sessionDetails[s.session_id]:null),f=L(E=>E.activeSessionId),h=s.items.findIndex(E=>E.id===n.id),m=u?((T=u.turns[u.turns.length-1])==null?void 0:T.id)===s.id:!0,g=Ag.has(s.id),y=g||Am(u)||!m||s.session_id!==f,k=(E,C,b)=>{y||G1(s.id,h,E,C,b)},x=()=>{const E=[...a.values()];if(E.length===0)return;const C=Y1(E);K1(s.id),L.getState().submitPrompt(C)};return c.jsxs("div",{className:"render-content ask-user-card",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Zx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),g&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((E,C)=>c.jsxs("div",{className:"ask-user-group",children:[E.question&&c.jsx("div",{className:"ask-user-question",children:E.question}),c.jsx("div",{className:"ask-user-options",children:E.selections.map(b=>{var I;const M=((I=a.get(Dg(h,C)))==null?void 0:I.answer)===b;return c.jsx("button",{type:"button",className:`ask-user-option ${M?"selected":""}`,disabled:y,onClick:()=>k(C,E.question,b),children:b},b)})})]},C)),y?g&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[c.jsx(ca,{size:12}),"Send"]})]}):r.question?c.jsx("p",{className:"user-message",children:r.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}Ge.setOptions({breaks:!0,gfm:!0});function Q1({attachments:n}){const[s,r]=w.useState(null);return w.useEffect(()=>{if(!s)return;function o(a){a.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(n)||n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"attachment-pills",children:n.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return c.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>r(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?c.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):c.jsx(Fm,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),s&&c.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:s,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:c.jsx($n,{size:20})})]})})]})}function Z1(n){const s=Ge.parse(n);return md.sanitize(s)}function nm(n){var s;return(s=n.data)!=null&&s.text?n.data.text:""}function J1(n){const s=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:n}const sm='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function eS(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${sm}</body>`):n+sm}function tS({html:n}){const[s,r]=w.useState(480),o=w.useRef(null);return w.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&r(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:eS(n),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const rm=1e4;function nS({item:n,runtimeType:s,turn:r,threads:o}){var h,m,g,y,k,x,T,E;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:b}=wu(s??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${C}`,children:b}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Jh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:nm(n)||"…",threads:o,runtimeType:s})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Yx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:Z1(nm(n))}})]});case"command_execution":{const C=n.data||{},b=J1(C.command||""),M=C.aggregated_output||"",I=C.exit_code,W=a?"running…":I!==null?`exit ${I}`:"",O=M.length>rm,B=O&&!u?M.slice(0,rm)+`
|
|
429
|
-
… (truncated, click to expand)`:M;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Wm,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),W&&c.jsx("span",{className:"turn-header-meta",children:W})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:b})}),M&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:B})}),O&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(K=>!K),children:u?"Show less":`Show full output (${(M.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,b=Array.isArray(C)?C:[],M=`${b.length} file${b.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(r0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:M})]}),c.jsx("div",{className:"file-change-list",children:b.map((I,W)=>{const O=I.kind==="add"?"A":I.kind==="delete"?"D":"M",B=I.kind==="add"?"fc-add":I.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${B}`,children:O}),c.jsx("span",{className:"fc-name",children:I.path})]},W)})})]})}case"mcp_tool_call":{const C=n.data||{},b=C.tool||"mcp";if(b==="Agent"){const q=C.arguments,le=(q==null?void 0:q.description)||(q==null?void 0:q.prompt)||"Subagent",de=n.status==="failed",me=a?"running…":de?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ku,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:le}),c.jsx("span",{className:`agent-call-status ${a?"running":de?"failed":"done"}`,children:me})]})}const M=C.server||"",I=C.arguments,W=C.result,O=C.error,B=n.status==="failed"||!!O,K=a?"running…":B?"failed":"done",G=((m=W==null?void 0:W.content)==null?void 0:m.filter(q=>q.type==="text").map(q=>q.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(y0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",b]}),M&&c.jsx("span",{className:"turn-header-meta",children:M}),c.jsx("span",{className:"turn-header-meta",style:B?{color:"var(--red)"}:void 0,children:K})]}),I&&Object.keys(I).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(I).map(([q,le])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:q}),q==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(le)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof le=="string"?le:JSON.stringify(le,null,2)})]},q))}),G.length>0&&G.map((q,le)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:q})},le)),O&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:O})})]})}case"web_search":{const C=((g=n.data)==null?void 0:g.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(w0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((y=n.data)==null?void 0:y.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(c0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((b,M)=>c.jsxs("li",{className:b.completed?"todo-done":"todo-pending",children:[b.completed?c.jsx(er,{size:14}):c.jsx(ci,{size:14})," ",b.text]},M))})]})}case"ask_user":return c.jsx(tm,{item:n,turn:r});case"final_result":{const C=n.data??{},b=C.text||"",M=C.html||null,I=Array.isArray(C.groups)?C.groups.filter(B=>!!B&&Array.isArray(B.selections)&&B.selections.length>0):[],{iconClass:W,iconText:O}=wu(s??"codex");return c.jsxs(c.Fragment,{children:[(b||M)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${W}`,children:O}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),b&&c.jsx(Jh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:b,threads:o,runtimeType:s}),M&&c.jsx(tS,{html:M})]}),I.length>0&&c.jsx(tm,{item:n,turn:r})]})}case"background_task":{const C=n.data||{},b=C.task_type||"unknown",M=C.subagent_type||null,I=C.description||"",W=C.status||"running",O=C.last_tool_name||null,B=C.token_count||null,K=b==="local_agent",G=b==="local_bash",q=K?ku:G?Bm:$m,le=K?`Subagent${M?`: ${M}`:""}`:G?"Monitor":"Background Task",de=W==="running"?"running…":W==="completed"?"done":W==="failed"?"failed":W==="stopped"?"stopped":W,me=n.status==="failed"||W==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(q,{size:14})}),c.jsx("span",{className:"turn-header-title",children:le}),c.jsx("span",{className:"turn-header-meta",style:me?{color:"var(--red)"}:void 0,children:de})]}),I&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:I}),O&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",O,B!=null&&` · ${B.toLocaleString()} tokens`]}),c.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const C=((k=n.data)==null?void 0:k.trigger)??"auto",b=((x=n.data)==null?void 0:x.pre_tokens)??0,M=((T=n.data)==null?void 0:T.post_tokens)??0,I=b>0?Math.round((1-M/b)*100):0,W=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(h0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:W})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[b.toLocaleString()," → ",M.toLocaleString()," tokens (",I,"% reduction)"]})]})}case"error":{const C=((E=n.data)==null?void 0:E.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(Qu,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const _s=w.memo(nS,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function sS({turn:n,runtimeType:s,threads:r=[]}){en.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const b=n.items.some(M=>M.type==="background_task"&&M.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!b&&a(!1)},[n.status,n.items]);let u=-1;for(let b=n.items.length-1;b>=0;b--)if(n.items[b].type==="agent_message"){u=b;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(b=>b.type==="final_result"||b.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(b=>{var M;return!(b.type==="reasoning"&&(!((M=b.data)!=null&&M.text)||b.data.text===""))}).filter(b=>!(b.type==="background_task"||b.type==="ask_user"||b.type==="final_result")),x=[];let T=null;for(const b of k)b.type==="agent_message"?(T&&x.push(T),T={agentMessage:b,toolItems:[],otherItems:[]}):(T||(T={agentMessage:null,toolItems:[],otherItems:[]}),Qh(b)?T.toolItems.push(b):T.otherItems.push(b));T&&x.push(T);const E=k.filter(b=>Qh(b)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending");return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(Q1,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(b=>!b),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(l0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:"thinking…"}),c.jsx(Yu,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((b,M)=>c.jsxs("div",{className:"intermediate-segment",children:[b.agentMessage&&c.jsx(_s,{item:b.agentMessage,runtimeType:s,turn:n,threads:r}),b.otherItems.map(I=>c.jsx(_s,{item:I,runtimeType:s,turn:n,threads:r},I.id)),b.toolItems.length>0&&c.jsx(F1,{items:b.toolItems,runtimeType:s,turn:n,threads:r})]},M))})]}),n.items.filter(b=>b.type==="background_task").map(b=>c.jsx(_s,{item:b,runtimeType:s,turn:n,threads:r},`task-${b.id}`)),f&&c.jsx(_s,{item:n.items[u],runtimeType:s,turn:n,threads:r},n.items[u].id),g&&c.jsx(_s,{item:g,runtimeType:s,turn:n,threads:r},g.id),f&&n.items.slice(u+1).filter(b=>b.type!=="ask_user"&&b.type!=="background_task"&&b.type!=="final_result").map(b=>c.jsx(_s,{item:b,runtimeType:s,turn:n,threads:r},b.id)),n.items.filter(b=>b.type==="final_result").map(b=>c.jsx(_s,{item:b,runtimeType:s,turn:n,threads:r},`final-${b.id}`)),n.items.filter(b=>b.type==="ask_user").map(b=>c.jsx(_s,{item:b,runtimeType:s,turn:n,threads:r},`ask-${b.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(ci,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const rS=w.memo(sS);function Mg(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>im(u,f,o));else{const u=n[r];u&&im(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function im(n,s,r){var o;for(const a of n.items)if(a.type==="file_change"&&((o=a.data)!=null&&o.changes)){const u=a.data.changes;for(const f of u)r.push({path:f.path,kind:f.kind,turnIdx:s})}}const iS=[],Dl=50;function oS(){en.trackRender("RenderArea");const n=L(M=>M.activeSessionId),s=L(M=>M.activeSessionId?M.sessionDetails[M.activeSessionId]:null),r=L(M=>M.activeTurnIndex),o=L(M=>M.activeRightTab),a=L(M=>M.changesScope),u=L(M=>M.submittingPrompt),f=L(M=>M.loading),h=L(M=>M.selectedChangePath),m=L(M=>M.setSelectedChangePath),g=(s==null?void 0:s.turns)??[],y=(s==null?void 0:s.threads)??iS,k=w.useRef(null),[x,T]=w.useState(Dl);w.useEffect(()=>{T(Dl)},[n]);const E=g.filter(M=>!M.thread_id),C=Math.max(0,E.length-x),b=E.slice(C);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!h||o!=="changes")return;const M=setTimeout(()=>{const I=h.replace(/[^a-zA-Z0-9]/g,"-"),W=document.getElementById(`diff-${I}`);W&&(W.scrollIntoView({behavior:"smooth",block:"start"}),W.classList.add("diff-highlight"),setTimeout(()=>W.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(M)},[h,o,m]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const M=Mg(g,a,r);return M.length===0?c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):c.jsx("div",{className:"render-scroll",ref:k,children:c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{style:{marginBottom:"20px"},children:[c.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:a==="session"?"All Session Changes":"Current Turn Changes"}),c.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[M.length," file",M.length>1?"s":""]})]}),M.map(I=>{const W=I.path.split("/").pop()||I.path,O=I.path.replace("/"+W,""),B=I.kind==="add"?"Added":I.kind==="delete"?"Deleted":"Modified",K=I.kind==="add"?"fc-add":I.kind==="delete"?"fc-del":"fc-mod",G=I.kind==="add"?"A":I.kind==="delete"?"D":"M",q=I.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${q}`,children:[c.jsx("span",{className:`diff-file-status ${K}`,children:G}),c.jsxs("span",{className:"diff-file-name",children:[O&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[O,"/"]}),W]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${K}`,children:B})})]}),c.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},I.path)})]})})}return f&&!s?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):s?c.jsxs("div",{className:"render-scroll",ref:k,children:[u&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:u})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),g.length===0&&!u&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),C>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>T(M=>M+Dl),children:["Show ",Math.min(Dl,C)," earlier turns (",C," hidden)"]})}),b.map((M,I)=>c.jsx("div",{id:`turn-${C+I}`,className:"turn-block",children:c.jsx(rS,{turn:M,runtimeType:s.runtime_type,threads:y})},M.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const lS=w.memo(oS),aS=[{id:"model",label:"/model",hint:"Change model",capability:"dynamicModels"},{id:"sandbox",label:"/sandbox",hint:"Sandbox mode",capability:"sandbox",subPopup:"sandbox"},{id:"websearch",label:"/websearch",hint:"Web search mode",capability:"webSearch",subPopup:"websearch"},{id:"network",label:"/network",hint:"Network access",capability:"networkAccess",subPopup:"network"},{id:"skills",label:"/skills",hint:"Browse skills",capability:"skills"},{id:"plugins",label:"/plugins",hint:"Browse plugins",capability:"plugins"},{id:"mcp",label:"/mcp",hint:"Browse MCP servers",capability:"mcpServers"}];function cS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function uS(n,s,r=[]){const o=[...aS,...cS(r)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!s[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function dS({commands:n,selectedIndex:s,onSelect:r,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function hu({title:n,options:s,currentValue:r,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),s.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function fS(n){return vn("/skills")}function pS({filter:n,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{fS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const y=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),m(T=>Math.min(T+1,y.length-1))):x.key==="ArrowUp"?(x.preventDefault(),m(T=>Math.max(T-1,0))):x.key==="Enter"?(x.preventDefault(),y[h]&&s(y[h])):x.key==="Escape"&&(x.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[y,h,s,r]),c.jsxs("div",{className:"slash-popup",ref:g,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&y.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),y.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>m(x),onClick:()=>s(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function hS(){return vn("/providers")}function mS(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return vn(`/providers/${n}/commands${r}`)}const gS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function vS(n){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{hS().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const u=s.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??gS,loading:o}}const Jr=32,mu=200;function om(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function lm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let am=0;function yS(){return am+=1,`att-${Date.now()}-${am}`}function xS(){en.trackRender("CommandInputBar");const[n,s]=w.useState(""),r=w.useRef(null),o=w.useRef(Jr),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=L(),g=L(V=>V.activeSessionId),y=L(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=L(V=>V.quotedText),x=Am(y),T=!g,{capabilities:E}=vS(y==null?void 0:y.runtime_type),C=(y==null?void 0:y.runtime_type)??null,b=E.imageAttachments,[M,I]=w.useState([]),[W,O]=w.useState(!1),[B,K]=w.useState(null),[G,q]=w.useState([]);w.useEffect(()=>{if(!C){q([]);return}let V=!1;return mS(C,(y==null?void 0:y.cwd)??void 0).then(we=>{V||q(we)}).catch(()=>{V||q([])}),()=>{V=!0}},[C,y==null?void 0:y.cwd]);const[le,de]=w.useState(!1),[me,fe]=w.useState(""),[pe,Me]=w.useState(0),[Z,re]=w.useState(void 0),[ce,P]=w.useState(!1),[ee,H]=w.useState(""),[R,_]=w.useState([]),X=le?uS(me,E,G):[];w.useEffect(()=>{k!==null&&(s(V=>V+k),setTimeout(()=>{if(r.current){at(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),L.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function V(we){we.key==="Escape"&&(we.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[x,f]),w.useEffect(()=>{de(!1),re(void 0),P(!1),_([]),I(V=>{for(const we of V)we.previewUrl&&URL.revokeObjectURL(we.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!B)return;function V(we){we.key==="Escape"&&(we.preventDefault(),K(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[B]);const se=w.useCallback(V=>{if(!V)return;const we=Array.from(V);for(const Fe of we){const qe=new FileReader;qe.onload=()=>{const yt=qe.result.split(",")[1]??"",ct=Fe.type.startsWith("image/")?URL.createObjectURL(Fe):void 0;I(Yt=>[...Yt,{id:yS(),name:Fe.name,media_type:Fe.type||"application/octet-stream",data:yt,previewUrl:ct,size:Fe.size}])},qe.readAsDataURL(Fe)}},[]),Se=w.useCallback(V=>{I(we=>{const Fe=we.find(qe=>qe.id===V);return Fe!=null&&Fe.previewUrl&&URL.revokeObjectURL(Fe.previewUrl),we.filter(qe=>qe.id!==V)})},[]),be=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!b||x)&&O(!0)},[b,x]),Le=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),O(!1)},[]),je=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),O(!1),!(!b||x)&&se(V.dataTransfer.files)},[b,x,se]),De=w.useCallback(V=>{var qe;if(!b)return;const we=(qe=V.clipboardData)==null?void 0:qe.items;if(!we)return;const Fe=[];for(let vt=0;vt<we.length;vt++){const yt=we[vt];if(yt.type.startsWith("image/")){const ct=yt.getAsFile();ct&&Fe.push(ct)}}Fe.length>0&&(V.preventDefault(),se(Fe))},[b,se]);function xe(V){const we=r.current;we&&(we.style.height=`${V}px`,o.current=V)}function at(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const we=Math.min(V.scrollHeight,mu);we!==o.current&&xe(we);return}o.current>Jr&&(V.style.height="auto",xe(Math.min(V.scrollHeight,mu)))}}function Pe(){const V=n.trim();if(!V||x)return;let we=V;R.length>0&&(we=`${R.map(vt=>`$${vt.name}`).join(" ")}
|
|
430
|
-
|
|
431
|
-
${V}`);const Fe=M.map(({id:qe,previewUrl:vt,size:yt,...ct})=>ct);s(""),_([]),xe(Jr),de(!1),re(void 0),P(!1);for(const qe of M)qe.previewUrl&&URL.revokeObjectURL(qe.previewUrl);I([]),u(we,Fe.length>0?Fe:void 0)}function ht(V){if(V.insertAsText){const we=`/${V.id} `;s(we),de(!1),re(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Fe=we.length;r.current.setSelectionRange(Fe,Fe),at()}});return}V.subPopup?re(V.subPopup):V.id==="skills"?(P(!0),H(""),de(!1),s("")):V.id==="model"?(m(!0),de(!1),s("")):(de(!1),s(""))}function $e(V){_(we=>[...we,V]),P(!1),s(""),xe(Jr)}function mt(V){const we=om(y==null?void 0:y.runtime_config);Z==="sandbox"?we.sandboxMode=V:Z==="websearch"?we.webSearchMode=V:Z==="network"&&(we.networkAccessEnabled=V==="true"),h(we),re(void 0),de(!1),s(""),xe(Jr)}function He(V){if(en.markKeystroke(),le&&!Z){if(V.key==="ArrowDown"){V.preventDefault(),Me(we=>Math.min(we+1,X.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),Me(we=>Math.max(we-1,0));return}if(V.key==="Enter"){V.preventDefault(),X[pe]&&ht(X[pe]);return}if(V.key==="Escape"){V.preventDefault(),de(!1),s("");return}}if(Z&&V.key==="Escape"){V.preventDefault(),re(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!x){V.preventDefault(),Pe();return}V.key==="Escape"&&x&&(V.preventDefault(),f())}function Mt(V){en.markInputChange();const we=V.target.value;s(we),at(),we.startsWith("/")&&!we.includes(" ")&&!x?(de(!0),fe(we.slice(1)),Me(0)):(de(!1),re(void 0)),we.startsWith("$")&&!x?(P(!0),H(we.slice(1))):we.startsWith("$")||P(!1)}const nn=om(y==null?void 0:y.runtime_config),ot=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],gt=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],Ot=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${W?" drag-over":""}`,onDragOver:be,onDragLeave:Le,onDrop:je,children:[le&&!Z&&c.jsx(dS,{commands:X,selectedIndex:pe,onSelect:ht,onHover:Me}),le&&Z==="sandbox"&&c.jsx(hu,{title:"Sandbox Mode",options:ot,currentValue:nn.sandboxMode,onSelect:mt,onClose:()=>re(void 0)}),le&&Z==="websearch"&&c.jsx(hu,{title:"Web Search",options:gt,currentValue:nn.webSearchMode,onSelect:mt,onClose:()=>re(void 0)}),le&&Z==="network"&&c.jsx(hu,{title:"Network Access",options:Ot,currentValue:nn.networkAccessEnabled===!0?"true":"false",onSelect:mt,onClose:()=>re(void 0)}),ce&&c.jsx(pS,{filter:ee,onSelect:$e,onClose:()=>{P(!1),s("")}}),R.length>0&&c.jsx("div",{className:"skill-badges",children:R.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>_(we=>we.filter(Fe=>Fe.id!==V.id)),children:"×"})]},V.id))}),M.length>0&&c.jsx("div",{className:"attachment-preview-area",children:M.map(V=>c.jsxs("div",{className:"attachment-chip",title:V.name,children:[V.previewUrl?c.jsx("img",{src:V.previewUrl,alt:V.name,className:"attachment-thumb",onClick:()=>K(V),style:{cursor:"pointer"}}):c.jsx(Fm,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:V.name}),c.jsx("span",{className:"attachment-size",children:lm(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>Se(V.id),title:"Remove attachment",children:c.jsx($n,{size:14})})]},V.id))}),b&&!x&&!T&&c.jsx("input",{ref:a,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:V=>{se(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[b&&!x&&!T&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var V;return(V=a.current)==null?void 0:V.click()},title:"Attach files",disabled:x,children:c.jsx(g0,{size:16})}),c.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:T?"Select or create a session…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:x||T,rows:1,style:{minHeight:Jr,maxHeight:mu},onChange:Mt,onKeyDown:He,onPaste:De}),x?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(ci,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:Pe,disabled:!n.trim()||T,title:"Send (⌘↵)",children:c.jsx(Xx,{size:16})})]}),B&&c.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:c.jsxs("div",{className:"image-preview-content",onClick:V=>V.stopPropagation(),children:[c.jsx("img",{src:B.previewUrl,alt:B.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:B.name}),c.jsx("span",{children:lm(B.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:c.jsx($n,{size:20})})]})})]})}function wS(){const n=L(b=>b.activeSessionId),s=L(b=>b.activeSessionId?b.sessionDetails[b.activeSessionId]:null),r=L(b=>b.activeTurnIndex),o=L(b=>b.setActiveTurnIndex),a=L(b=>b.rewindToTurn),u=L(b=>b.restoreSession),f=L(b=>b.branchFromTurn),h=(s==null?void 0:s.turns)??[],m=oa(s),g=!!(s!=null&&s.rewound_at_turn_id),y=(s==null?void 0:s.runtime_type)==="repoburg",k=y?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[x,T]=w.useState(null),E=w.useRef(null);if(aa(E,()=>T(null),!!x),qu(()=>T(null),!!x),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(b){o(b),requestAnimationFrame(()=>{var M;(M=document.getElementById(`turn-${b}`))==null||M.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((b,M)=>{const I=M===r,W=b.user_prompt.length>50?b.user_prompt.slice(0,50)+"…":b.user_prompt,O=b.status==="running"||b.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${I?"active":""}`,onClick:()=>C(M),onContextMenu:B=>{B.preventDefault(),T({x:B.clientX,y:B.clientY,turnId:b.id,turnIndex:M,isLast:M===h.length-1,isSlashCommand:b.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(N0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:W}),O&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},b.id)}),x&&c.jsxs("div",{ref:E,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${x.isLast||m||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||m||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),T(null))},children:[c.jsx(x0,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),g&&!y&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),T(null)},children:[c.jsx(co,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),T(null)},children:[c.jsx(i0,{size:12})," Branch from Here"]})]})]})}function kS(){const n=L(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),s=L(h=>h.changesScope),r=L(h=>h.setChangesScope),o=L(h=>h.activeTurnIndex),a=L(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Mg(u,s,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${s==="session"?"active":""}`,onClick:()=>r("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${s==="turngroup"?"active":""}`,onClick:()=>r("turngroup"),children:"Current Turn"})]}),f.length===0?c.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Changed Files (",f.length,")"]}),f.map(h=>{const m=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",g=h.kind==="add"?"A":h.kind==="delete"?"D":"M",y=h.path.split("/").pop()||h.path,k=h.path.replace("/"+y,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[c.jsx("span",{className:`fc-status ${m}`,children:g}),c.jsxs("span",{className:"fc-name",children:[k&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),y]})]},h.path)})]})]})}const cm=2e4;function SS(n){const s=[];return n.forEach((r,o)=>{var a;for(const u of r.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function TS({entry:n}){const{item:s,turnIndex:r,turnPrompt:o}=n,a=s.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",m=a.status||"running",g=a.summary||null,y=a.last_tool_name||null,k=a.token_count||null,x=a.output||"",T=s.status==="in_progress",E=u==="local_agent",C=u==="local_bash",b=E?ku:C?Bm:$m,M=E?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",I=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,W=s.status==="failed"||m==="failed",[O,B]=w.useState(T),[K,G]=w.useState(!1),q=w.useRef(null);w.useEffect(()=>{T&&B(!0)},[T]),w.useEffect(()=>{O&&T&&q.current&&(q.current.scrollTop=q.current.scrollHeight)},[O,T,x]);const le=x.length>cm,de=le&&!K?x.slice(0,cm)+`
|
|
432
|
-
… (truncated, click to expand)`:x,me=T?null:m==="completed"?c.jsx(er,{size:12}):W?c.jsx(Qu,{size:12}):c.jsx(ci,{size:12});return c.jsxs("div",{className:`task-card ${T?"task-running":""} ${W?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>B(fe=>!fe),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(b,{size:14})}),c.jsx("span",{className:"task-card-type",children:M}),c.jsxs("span",{className:`task-card-status ${W?"task-status-failed":T?"task-status-running":"task-status-done"}`,children:[me," ",I]}),c.jsx(Yu,{size:14,className:"task-card-chevron",style:{transform:O?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),T&&y&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",y,k!=null&&` · ${k.toLocaleString()} tokens`]}),O&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:q,children:c.jsx("code",{children:de})}),le&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>G(fe=>!fe),children:K?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):g?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:g})}):T?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const bS=w.memo(TS);function NS(){var m,g;const n=L(y=>y.activeSessionId?y.sessionDetails[y.activeSessionId]:null),s=L(y=>y.activeSessionId?y.backgroundTasks[y.activeSessionId]:void 0),r=(n==null?void 0:n.turns)??[],o=s??[],a=SS(r),u=[...a].sort((y,k)=>{const x=y.item.status==="in_progress",T=k.item.status==="in_progress";return x&&!T?-1:!x&&T?1:k.turnIndex-y.turnIndex}),f=new Map;for(const y of o)y.task_type==="local_bash"&&f.set(y.task_id,y.task_type);for(const y of a)if(y.item.status==="in_progress"){const k=((m=y.item.data)==null?void 0:m.task_id)??y.item.external_item_id,x=((g=y.item.data)==null?void 0:g.task_type)??"unknown";f.set(k,x)}const h=[...f.values()].filter(y=>y==="local_bash").length;return a.length===0?c.jsx("div",{className:"empty-state",children:"No background tasks yet"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Background Tasks (",a.length,")",h>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",h," running"]})]}),u.map(y=>c.jsx(bS,{entry:y},y.item.id))]})}const CS=w.memo(NS);function ES({thread:n,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=L(),[u,f]=w.useState(""),[h,m]=w.useState(!1),[g,y]=w.useState(!1);async function k(){if(!r||h)return;m(!0),await a(r,n.id,u)?s():m(!1)}async function x(){!r||g||(y(!0),await o(r,n.id),s())}const T=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:T?void 0:s,children:c.jsxs("div",{className:"dialog",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Resolve thread"}),c.jsx("button",{className:"dialog-close",onClick:s,disabled:T,children:c.jsx($n,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),c.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",c.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:E=>f(E.target.value),rows:3,disabled:T,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:T,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:T,title:"Resolve without sharing",children:[g?c.jsx(rs,{size:13,className:"spin"}):c.jsx(Vl,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:T,children:[h?c.jsx(rs,{size:13,className:"spin"}):c.jsx(k0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const um=[];Ge.setOptions({breaks:!0,gfm:!0});function _S(n){const s=Ge.parse(n);return md.sanitize(s)}function jS(n){var s,r,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(s=n.data)==null?void 0:s.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((r=n.data)==null?void 0:r.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
|
|
433
|
-
|
|
434
|
-
`):null}return null}function RS(n){const s=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:n}function AS({turn:n}){const s=RS(n.user_prompt),r=n.items.map(jS).filter(o=>o!==null);return r.length===0&&n.status==="completed"&&n.agent_response&&r.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:s}),r.map((o,a)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:_S(o)}},a)),r.length===0&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"thread-card-pending",children:n.status==="running"?"AI is responding…":"Waiting…"}),n.status==="failed"&&c.jsx("div",{className:"thread-card-pending",children:n.error||"Turn failed"})]})}function IS({thread:n,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var pe,Me,Z;const[m,g]=w.useState(""),[y,k]=w.useState(!0),x=w.useRef(null),T=w.useRef(null),[E,C]=w.useState(!1),[b,M]=w.useState({x:0,y:0}),[I,W]=w.useState(""),O=s.some(ai),B=28,K=120,G=w.useRef(B);w.useEffect(()=>{const re=T.current;re&&(re.scrollTop=re.scrollHeight)},[s.length,y]);function q(re){const ce=x.current;ce&&(ce.style.height=`${re}px`,G.current=re)}function le(){const re=x.current;if(re){if(re.scrollHeight>re.clientHeight){const ce=Math.min(re.scrollHeight,K);ce!==G.current&&q(ce);return}G.current>B&&(re.style.height="auto",q(Math.min(re.scrollHeight,K)))}}const de=w.useCallback(()=>{C(!1)},[]),me=w.useCallback(()=>{const re=T.current;if(!re)return;const ce=window.getSelection();if(!ce||ce.rangeCount===0||ce.isCollapsed){C(!1);return}const P=ce.getRangeAt(0);if(!re.contains(P.commonAncestorContainer)){C(!1);return}const ee=P.commonAncestorContainer.nodeType===Node.TEXT_NODE?P.commonAncestorContainer.parentElement:P.commonAncestorContainer;if(!(ee!=null&&ee.closest(".thread-card-ai-response"))){C(!1);return}const H=ce.toString();if(!H.trim()){C(!1);return}const R=P.getBoundingClientRect(),_=28,X=6,se=170;let Se=!1;if(ce.anchorNode&&ce.focusNode)try{const je=document.createRange();je.setStart(ce.focusNode,ce.focusOffset),je.setEnd(ce.focusNode,ce.focusOffset);const De=document.createRange();De.setStart(ce.anchorNode,ce.anchorOffset),De.setEnd(ce.anchorNode,ce.anchorOffset),Se=De.compareBoundaryPoints(Range.START_TO_START,je)>0}catch{Se=!1}let be=R.top-_-X;be<8&&(be=R.bottom+X);let Le=Se?R.left-se:R.right;Le=Math.max(8,Math.min(Le,window.innerWidth-se-8)),M({x:Le,y:be}),W(H),C(!0)},[]);w.useEffect(()=>{function re(ce){const P=ce.target;P&&P.closest(".selection-actions")||me()}return document.addEventListener("mouseup",re),()=>document.removeEventListener("mouseup",re)},[me]);const fe=w.useCallback(()=>{var ce;const re=`
|
|
435
|
-
\`\`\`QUOTE
|
|
436
|
-
${I}
|
|
437
|
-
\`\`\`
|
|
438
|
-
|
|
439
|
-
`;g(P=>P+re),C(!1),W(""),(ce=window.getSelection())==null||ce.removeAllRanges(),setTimeout(()=>{if(x.current){le(),x.current.focus();const P=x.current.value.length;x.current.setSelectionRange(P,P)}},0)},[I]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(re=>!re),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Z=(Me=(pe=n.turns)==null?void 0:pe[0])==null?void 0:Me.user_prompt)==null?void 0:Z.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),c.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&c.jsx("button",{className:"thread-locate-btn",onClick:re=>{re.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(m0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),y&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:T,onMouseDown:de,children:[s.map(re=>c.jsx(AS,{turn:re},re.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:b.x,top:b.y},children:c.jsxs("button",{className:"discuss-button",onClick:fe,title:"Quote this text in your follow-up",children:[c.jsx(Um,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:O?"Agent is running…":"Type a follow-up…",value:m,onChange:re=>{en.markInputChange(),g(re.target.value),le()},disabled:O,rows:1,style:{minHeight:B,maxHeight:K},onKeyDown:re=>{en.markKeystroke(),re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&!O&&m.trim()&&(re.preventDefault(),f(m.trim()),g(""),q(B))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:O||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(ca,{size:13})}),O&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:c.jsx(ci,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Vl,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(co,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(hs,{size:13})," Delete"]})]})]})]})}function DS(){en.trackRender("ThreadsPanel");const n=L(I=>I.activeSessionId),s=L(I=>{var W;return I.activeSessionId?((W=I.sessionDetails[I.activeSessionId])==null?void 0:W.threads)??um:um}),r=L(I=>I.followupThread),o=L(I=>I.cancelThreadTurn),a=L(I=>I.reopenThread),u=L(I=>I.deleteThread),f=L(I=>I.activeRightTab),h=L(I=>I.switchRightTab),m=L(I=>I.deepLinkThreadId),g=L(I=>I.setDeepLinkThreadId),[y,k]=w.useState("open"),[x,T]=w.useState(null);w.useEffect(()=>{if(!m)return;const I=m;g(null),k(O=>s.some(B=>B.id===I&&B.status==="open")?O:"all");const W=setTimeout(()=>{const O=document.getElementById(`thread-${I}`);O&&(O.scrollIntoView({behavior:"smooth",block:"center"}),O.classList.add("thread-card-highlighted"),setTimeout(()=>O.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(W)},[m,g,s]);const E=s.filter(I=>y==="open"?I.status==="open":y==="resolved"?I.status==="resolved":!0),C=s.filter(I=>I.status==="open").length,b=s.filter(I=>I.status==="resolved").length;function M(I){f==="changes"&&h("turns"),setTimeout(()=>{const W=document.querySelector(`mark[data-thread-id="${I}"]`);W&&(W.scrollIntoView({behavior:"smooth",block:"center"}),W.classList.add("thread-mark-flash"),setTimeout(()=>W.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(p0,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"No threads yet."}),c.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):c.jsxs("div",{children:[c.jsxs("div",{className:"thread-filter-tabs",children:[c.jsxs("button",{className:`thread-filter-tab ${y==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${y==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",b,")"]}),c.jsxs("button",{className:`thread-filter-tab ${y==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",s.length,")"]})]}),E.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",y," threads."]}):E.map(I=>c.jsx(IS,{thread:I,threadTurns:I.turns??[],onStop:()=>o(n,I.id),onResolve:()=>T(I),onReopen:()=>a(n,I.id),onDelete:()=>u(n,I.id),onFollowup:W=>r(n,I.id,W),onLocate:()=>M(I.id)},I.id)),x&&c.jsx(ES,{thread:x,onClose:()=>T(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function MS(){const n=L(f=>f.apps),s=L(f=>f.activeAppTabId),r=L(f=>f.openAppTab),o=L(f=>f.startAppEdit),a=L(f=>f.toggleAppPin),u=L(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${s===f.id?" active":""}`,onClick:()=>r(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Pl,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Gl,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(hs,{size:12})})]},f.id))})}function LS(){var f;en.trackRender("RightPanel");const n=L(h=>h.activeRightTab),s=L(h=>h.switchRightTab),r=L(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),o=L(h=>{var m;return h.activeSessionId?((m=h.backgroundTasks[h.activeSessionId])==null?void 0:m.length)??0:0}),a=((f=r==null?void 0:r.threads)==null?void 0:f.filter(h=>h.status==="open").length)??0,u=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:o||void 0},{id:"threads",label:"Threads",badge:a||void 0},{id:"apps",label:"Apps"}];return c.jsxs("div",{className:"ide-right",children:[c.jsx("div",{className:"right-tabs",children:u.map(h=>c.jsxs("div",{className:`right-tab ${n===h.id?"active":""}`,onClick:()=>s(h.id),children:[h.label,h.badge?c.jsx("span",{className:"right-tab-badge",children:h.badge}):null]},h.id))}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(wS,{}),n==="changes"&&c.jsx(kS,{}),n==="tasks"&&c.jsx(CS,{}),n==="threads"&&c.jsx(DS,{}),n==="apps"&&c.jsx(MS,{})]})]})}const Re={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Mu=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max,Re.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high,Re.xhigh,Re.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Re.low,Re.medium,Re.high]}]}];function PS(n){return Mu.find(s=>s.id===n)}function gd(n){const s=PS(n);return(s==null?void 0:s.models)??[]}function Lg(n,s){return gd(n).find(r=>r.slug===s)}function Lu(n,s){var r;return((r=Lg(n,s))==null?void 0:r.reasoningLevels)??[]}function Pu(n,s){var r;return(r=Lg(n,s))==null?void 0:r.defaultReasoning}function OS(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=L(),o=L(Z=>Z.showModelSelector),a=L(Z=>Z.setShowModelSelector),u=s.find(Z=>Z.id===n),f=L(Z=>Z.models),h=L(Z=>Z.modelsLoading),m=L(Z=>Z.loadModels),[g,y]=w.useState(!1),k=w.useRef(null);if(aa(k,()=>y(!1),g),qu(()=>y(!1),g),w.useEffect(()=>{o&&(y(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&m(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,m]),!u)return null;const x=u.runtime_type,T=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],b=gd(x),I=[...C.length>0?C:b];if(T&&!I.some(Z=>Z.slug===T)){const Z=b[0];I.unshift({slug:T,displayName:T,description:"Custom model",defaultReasoning:(Z==null?void 0:Z.defaultReasoning)??"medium",reasoningLevels:(Z==null?void 0:Z.reasoningLevels)??[]})}function W(Z){return I.find(re=>re.slug===Z)}function O(Z){var re;return C.length>0?((re=W(Z))==null?void 0:re.reasoningLevels)??[]:Lu(x,Z)}function B(Z){var re;return C.length>0?(re=W(Z))==null?void 0:re.defaultReasoning:Pu(x,Z)}const K=Mu.find(Z=>Z.id===x),G=W(T),q=T?O(T):[],le=(K==null?void 0:K.label)??x,de=(G==null?void 0:G.displayName)??(T||"Default"),me=q.find(Z=>Z.effort===E),fe=(me==null?void 0:me.label)??(E||"Default");function pe(Z){var ee;const re=O(Z),P=re.some(H=>H.effort===E)?E:B(Z)??((ee=re[0])==null?void 0:ee.effort)??"";r(Z,P),y(!1)}function Me(Z){r(T,Z),y(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>y(!g),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:le}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:de}),fe!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:fe})]}),c.jsx(ii,{size:12,className:"model-selector-chevron"})]}),g&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Mu.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.id===x?"selected":""} ${Z.available?"":"disabled"}`,onClick:()=>{if(Z.available){if(Z.id===x){y(!1);return}r("","",Z.id)}},children:[c.jsx("span",{children:Z.label}),!Z.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(d0,{size:10})," Soon"]}),Z.id===x&&c.jsx(er,{size:12})]},Z.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&I.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),I.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.slug===T?"selected":""}`,onClick:()=>pe(Z.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Z.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Z.description})]}),Z.slug===T&&c.jsx(er,{size:12})]},Z.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),q.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),q.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.effort===E?"selected":""}`,onClick:()=>Me(Z.effort),children:[c.jsx("span",{children:Z.label}),Z.effort===E&&c.jsx(er,{size:12})]},Z.effort))]})]})]})}function Ji(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function dm(){const n=L(s=>s.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(E0,{size:14})," Repoburg"]})}function fm(){const n=L(r=>r.vscodeViewOpen),s=L(r=>r.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:s,children:[c.jsx(e0,{size:14})," Code"]})}function zS(){var x,T;en.trackRender("StatusBar");const n=L(E=>E.activeSessionId),s=L(E=>n?E.sessions.find(C=>C.id===n)??null:null),r=L(E=>n?E.sessionDetails[n]??null:null),o=L(E=>n?E.backgroundTasks[n]:void 0),a=L(E=>E.wsConnected),u=L(E=>E.switchRightTab),f=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(uh,{size:14})," K"]})]});const h=o??[],m=la(s,h.length),g=new Set,y=new Map;for(const E of h)g.add(E.task_id),y.set(E.task_id,E.task_type);for(const E of(r==null?void 0:r.turns)??[])for(const C of E.items)if(C.type==="background_task"&&C.status==="in_progress"){const b=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,M=((T=C.data)==null?void 0:T.task_type)??"unknown";g.add(b),y.set(b,M)}const k=[...y.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(fm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(OS,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[c.jsx(Wm,{size:14})," ",k]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:m.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:m.dot==="background"?m.dotTitle:void 0,children:m.label}),f&&c.jsx($S,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(uh,{size:14})," K"]})]})}function $S({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${Ji(n.totalTokens)} / ${Ji(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${Ji(n.autoCompactThreshold)}`:"");return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:r,children:c.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(n.percentage),"% / ",Ji(n.totalTokens)," / ",Ji(n.contextWindow)]})})]})}function pm(n){return vn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function FS(n){return _t("/vscode-web/start",{folder:n})}function US(n){return _t("/vscode-web/heartbeat",{id:n})}const BS=1e3,WS=5*6e4;function hm({children:n}){const s=L(r=>r.toggleVscodeView);return c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[n,c.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:s,children:c.jsx($n,{size:16})})]})}function HS(){const n=L(E=>E.vscodeState),s=L(E=>E.vscodeId),r=L(E=>E.vscodeToken),o=L(E=>E.setVscodeView),a=L(E=>{var b;const C=E.activeSessionId?E.sessions.find(M=>M.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((b=E.workspaces.find(M=>M.deleted===0))==null?void 0:b.path)??null}),[u,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null),y=ms(),k=y===""||y===window.location.origin,x=`${y}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){g.current&&(clearInterval(g.current),g.current=null)}async function b(){try{let I=await pm(a);if((I.state==="stopped"||I.state==="error")&&(I=await FS(a)),E||(o(I.state,I.id,I.token),I.state==="running"||I.state==="error"))return;g.current=setInterval(async()=>{const W=await pm(a);E||(o(W.state,W.id,W.token),(W.state==="running"||W.state==="error"||W.state==="stopped")&&C())},BS)}catch{E||o("error",null,null)}}b();const M=setInterval(()=>{const I=L.getState().vscodeId;I&&US(I).catch(()=>{})},WS);return()=>{E=!0,C(),clearInterval(M)}},[h,a,o]);function T(){f(!1),o("starting",null,null),m(E=>E+1)}return n!=="running"||!r||!s?c.jsx(hm,{children:n==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"VS Code could not start."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:T,children:[c.jsx(co,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(rs,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(rs,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]}):c.jsxs(hm,{children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[c.jsx(n0,{size:14})," Open VS Code in a new tab"]})]})}const VS=`(function () {
|
|
440
|
-
var nextId = 1;
|
|
441
|
-
var pending = new Map();
|
|
442
|
-
var listeners = [];
|
|
443
|
-
// Absolute http(s) URL, or null. Relative and #fragment hrefs are not
|
|
444
|
-
// external and keep their in-frame behavior.
|
|
445
|
-
function externalUrl(raw) {
|
|
446
|
-
if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
|
|
447
|
-
try { return new URL(raw.trim()).href; } catch (err) { return null; }
|
|
448
|
-
}
|
|
449
|
-
// New browser tab. The sandbox lets popups escape it, so the page loads
|
|
450
|
-
// like any other tab; noopener leaves it no handle back to this frame.
|
|
451
|
-
function openTab(url) {
|
|
452
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
453
|
-
}
|
|
454
|
-
// A plain external link would navigate THIS frame: the app disappears and
|
|
455
|
-
// most sites refuse to be framed anyway. Open it in a new tab instead.
|
|
456
|
-
// Bubble phase on window, so the app's own handlers run first and can
|
|
457
|
-
// still claim the click with preventDefault(). Modifier clicks and
|
|
458
|
-
// target="_blank" links already open a tab natively.
|
|
459
|
-
window.addEventListener('click', function (e) {
|
|
460
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
461
|
-
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
462
|
-
if (!a) return;
|
|
463
|
-
var target = (a.getAttribute('target') || '').toLowerCase();
|
|
464
|
-
if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
|
|
465
|
-
var url = externalUrl(a.getAttribute('href'));
|
|
466
|
-
if (!url) return;
|
|
467
|
-
e.preventDefault();
|
|
468
|
-
openTab(url);
|
|
469
|
-
});
|
|
470
|
-
window.addEventListener('message', function (e) {
|
|
471
|
-
var msg = e.data;
|
|
472
|
-
if (!msg || msg.source !== 'agentpane-host') return;
|
|
473
|
-
if (msg.id != null && pending.has(msg.id)) {
|
|
474
|
-
var p = pending.get(msg.id);
|
|
475
|
-
pending.delete(msg.id);
|
|
476
|
-
if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
|
|
477
|
-
} else if (msg.event) {
|
|
478
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
479
|
-
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
function call(method, params) {
|
|
484
|
-
return new Promise(function (resolve, reject) {
|
|
485
|
-
var id = nextId++;
|
|
486
|
-
pending.set(id, { resolve: resolve, reject: reject });
|
|
487
|
-
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
window.AgentPane = {
|
|
491
|
-
getApp: function () { return call('getApp'); },
|
|
492
|
-
getState: function () { return call('getState'); },
|
|
493
|
-
setState: function (data) { return call('setState', { data: data }); },
|
|
494
|
-
createSession: function (opts) { return call('createSession', opts); },
|
|
495
|
-
submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
|
|
496
|
-
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
497
|
-
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
498
|
-
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
499
|
-
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
500
|
-
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
|
|
501
|
-
openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
|
|
502
|
-
openUrl: function (url) {
|
|
503
|
-
var href = externalUrl(url);
|
|
504
|
-
if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
|
|
505
|
-
try { openTab(href); } catch (err) { return Promise.reject(err); }
|
|
506
|
-
return Promise.resolve({ ok: true });
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
510
|
-
window.addEventListener('error', function (e) {
|
|
511
|
-
parent.postMessage({
|
|
512
|
-
source: 'agentpane-app', report: 'error',
|
|
513
|
-
message: e.message || 'Unknown error',
|
|
514
|
-
stack: (e.error && e.error.stack) || '',
|
|
515
|
-
line: e.lineno || 0, col: e.colno || 0
|
|
516
|
-
}, '*');
|
|
517
|
-
});
|
|
518
|
-
window.addEventListener('unhandledrejection', function (e) {
|
|
519
|
-
var r = e.reason;
|
|
520
|
-
var msg = r && (r.message || String(r)) || 'unknown';
|
|
521
|
-
parent.postMessage({
|
|
522
|
-
source: 'agentpane-app', report: 'error',
|
|
523
|
-
message: 'Unhandled promise rejection: ' + msg,
|
|
524
|
-
stack: (r && r.stack) || '', line: 0, col: 0
|
|
525
|
-
}, '*');
|
|
526
|
-
});
|
|
527
|
-
})();`;function mm(n){return n.replace(/<\/script/gi,"<\\/script")}function GS(n,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function gm(n,s,r){const o=GS(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function qS(n,s,r){let o=n;const a=`<script>${mm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=gm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${mm(r)}<\/script>`;o=gm(o,"</body>",u)}return o}function KS({appId:n,workspace:s=""}){const r=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[m,g]=w.useState([]);w.useEffect(()=>{let x=!0;sx(n,E=>{var C,b;return(b=(C=r.current)==null?void 0:C.contentWindow)==null?void 0:b.postMessage(E,"*")});const T=async E=>{var W,O,B,K,G,q,le,de,me;if(E.source!==((W=r.current)==null?void 0:W.contentWindow))return;const C=E.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const fe={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};g(pe=>{const Me=pe[pe.length-1];return Me&&Me.message===fe.message?pe:[...pe,fe].slice(-20)});return}if(typeof C.method!="string")return;let b=!0,M,I;try{switch(C.method){case"getApp":M={id:n};break;case"getState":M=o.current;break;case"setState":{const fe=((O=C.params)==null?void 0:O.data)??null,pe=await Im(n,{data:fe},s);o.current=pe,M=pe;break}case"createSession":{const fe=C.params??{},pe=await $u({title:typeof fe.title=="string"?fe.title:void 0,runtime_type:typeof fe.runtime_type=="string"?fe.runtime_type:void 0,model:typeof fe.model=="string"?fe.model:void 0,model_reasoning_effort:typeof fe.model_reasoning_effort=="string"?fe.model_reasoning_effort:void 0,cwd:typeof fe.cwd=="string"?fe.cwd:void 0,origin_app_id:n});Zc(pe.id,n),L.getState().addSession(pe),M=pe;break}case"submitTurn":{const fe=String(((B=C.params)==null?void 0:B.sessionId)??""),pe=String(((K=C.params)==null?void 0:K.prompt)??""),Me=await _m(fe,pe);Zc(fe,n),M=Me;break}case"resolveToolCall":{const fe=String(((G=C.params)==null?void 0:G.callId)??""),pe=(q=C.params)==null?void 0:q.result;await jx(fe,pe),M={ok:!0};break}case"openSession":{if(L.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const fe=typeof((le=C.params)==null?void 0:le.sessionId)=="string"?C.params.sessionId.trim():"";if(!fe)throw new Error("openSession: sessionId is required");try{await L.getState().revealSession(fe)}catch(pe){throw new Error(`openSession: ${pe instanceof Error?pe.message:String(pe)}`)}M={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(fe){b=!1,I=fe instanceof Error?fe.message:String(fe)}(me=(de=r.current)==null?void 0:de.contentWindow)==null||me.postMessage({source:"agentpane-host",id:C.id,ok:b,result:M,error:I},"*")};return window.addEventListener("message",T),cx(n,()=>{oh(n,s).then(E=>{x&&(o.current=E)}).catch(()=>{})}),lx(n,()=>{ih(n).then(E=>{x&&(u(E),g([]))}).catch(()=>{})}),(async()=>{try{const[E,C,b]=await Promise.all([ih(n),oh(n,s),bx(n).catch(()=>[])]);if(!x)return;o.current=C,b.forEach(M=>Zc(M.id,n)),u(E)}catch(E){x&&h(E instanceof Error?E.message:String(E))}})(),()=>{x=!1,rx(n),ax(n),ux(n),window.removeEventListener("message",T)}},[n,s]);const y=w.useMemo(()=>a?qS(a.html,VS,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!y)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((x,T)=>c.jsxs("div",{className:"miniapp-diag",children:[x.file,":",x.line,":",x.column," — ",x.message]},T))]}),c.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${n}`,srcDoc:y}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((x,T)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:x.message}),x.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:x.stack})]},T))})]})}function XS({appId:n,active:s}){const r=L(x=>x.apps),o=L(x=>x.workspaces),a=L(x=>x.appWorkspaces),u=L(x=>x.setAppWorkspace),f=L(x=>x.setActiveAppTab),h=L(x=>x.startAppEdit),m=r.find(x=>x.id===n),g=a[n]??"",y=o.filter(x=>x.deleted!==1),k=g!==""&&!y.some(x=>x.path===g)?g:null;return c.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(m==null?void 0:m.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(m==null?void 0:m.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:g,onChange:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),y.map(x=>c.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(v0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx($n,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(KS,{appId:n,workspace:g},`${n}:${g}`)})]})}function YS({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(x=>{const T=x.clientX-h.current,E=n==="left"?m.current+T:m.current-T,C=Math.min(r,Math.max(s,E));a(C)},[n,s,r,a]),y=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(x=>{var T,E;x.preventDefault(),x.stopPropagation();try{(E=(T=x.currentTarget)==null?void 0:T.setPointerCapture)==null||E.call(T,x.pointerId)}catch{}h.current=x.clientX,m.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",y)},[o,g,y]),dragging:u}}function vm({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=YS({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function QS(){en.trackRender("IdeWorkspace");const n=L(m=>m.sidebarWidth),s=L(m=>m.rightPanelWidth),r=L(m=>m.setSidebarWidth),o=L(m=>m.setRightPanelWidth),a=L(m=>m.vscodeViewOpen),u=L(m=>m.activeAppTabId),f=L(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const g=Fl(),{rightPanelWidth:y,setRightPanelWidth:k}=L.getState();y>g&&k(g)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const h=`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:h},children:[c.jsx(Tk,{}),c.jsx(vm,{side:"left",minWidth:vu,maxWidth:yu,getWidth:()=>L.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(bk,{}),c.jsxs("div",{className:"ide-render",children:[f.map(m=>c.jsx(XS,{appId:m,active:u===m},m)),u==null&&c.jsx(lS,{})]}),c.jsx(xS,{})]}),c.jsx(vm,{side:"right",minWidth:$l,maxWidth:Fl(),getWidth:()=>L.getState().rightPanelWidth,setWidth:o}),c.jsx(LS,{})]}),a&&c.jsx(HS,{}),c.jsx(zS,{})]})}function ZS(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=L(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,m]=w.useState(""),[g,y]=w.useState(u),[k,x]=w.useState(f),[T,E]=w.useState("");if(!n)return null;const C=gd(a),b=g?Lu(a,g):[];function M(){r({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:T.trim()||void 0,runtime_type:a}),m(""),E("")}function I(O){O.key==="Escape"&&s(!1)}function W(O){var G;y(O);const B=Lu(a,O);B.some(q=>q.effort===k)||x(Pu(a,O)??((G=B[0])==null?void 0:G.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:I,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx($n,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:O=>m(O.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:O=>W(O.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(O=>c.jsxs("option",{value:O.slug,children:[O.displayName," — ",O.description]},O.slug))]})]}),b.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:O=>x(O.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Pu(a,g),")"]}),b.map(O=>c.jsx("option",{value:O.effort,children:O.label},O.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:O=>E(O.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:M,children:"Create"})]})]})})}const JS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,eT=512*1024;function tT(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function nT(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=L(),[f,h]=w.useState("examples"),[m,g]=w.useState(null),[y,k]=w.useState(null),[x,T]=w.useState(!1),[E,C]=w.useState(""),[b,M]=w.useState(""),[I,W]=w.useState(""),[O,B]=w.useState(""),[K,G]=w.useState(null),[q,le]=w.useState(""),de=w.useRef(null);if(w.useEffect(()=>{n&&(g(null),Nx().then(g).catch(()=>g([])))},[n]),w.useEffect(()=>{de.current&&(de.current.webkitdirectory=!0)},[f]),!n)return null;const me=new Set(r.map(P=>P.id));async function fe(P){k(P);try{await o(P)&&s()}finally{k(null)}}async function pe(){if(x)return;const P=E.trim(),ee=b.trim();if(!(!P||!ee)){T(!0);try{await a({id:P,title:ee,description:I.trim()||void 0,icon:O.trim()||void 0})&&(C(""),M(""),W(""),B(""),s())}finally{T(!1)}}}async function Me(P){const ee=Array.from(P.target.files??[]),H={};let R="";for(const _ of ee){const se=(_.webkitRelativePath??"").split("/");!R&&se.length>1&&(R=se[0]);const Se=se[se.length-1];if(!(!Se||!JS.test(Se))&&!(_.size>eT))try{H[Se]=await _.text()}catch{}}G(Object.keys(H).length>0?H:null),le(tT(R))}async function Z(){if(!(x||!K||!q.trim())){T(!0);try{await u(q.trim(),K)&&(G(null),le(""),s())}finally{T(!1)}}}function re(P){P.key==="Escape"&&s()}const ce=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:s,children:c.jsxs("div",{className:"dialog app-catalog",onClick:P=>P.stopPropagation(),onKeyDown:re,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ce.map(P=>c.jsx("button",{className:`catalog-tab${f===P.key?" active":""}`,onClick:()=>h(P.key),children:P.label},P.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:m===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):m.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):m.map(P=>{const ee=me.has(P.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:P.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:P.title}),P.description&&c.jsx("span",{className:"example-desc",children:P.description})]}),c.jsx("button",{className:"example-install",disabled:ee||y===P.id,onClick:()=>fe(P.id),title:ee?"Already installed":"Install this example",children:ee?"Installed":y===P.id?"Installing…":"Install"})]},P.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:P=>C(P.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:P=>M(P.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:I,onChange:P=>W(P.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:O,onChange:P=>B(P.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!b.trim(),onClick:pe,children:[c.jsx(wr,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:de,type:"file",multiple:!0,onChange:Me}),K&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:q,onChange:P=>le(P.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(K).length," file(s):"," ",Object.keys(K).slice(0,6).join(", "),Object.keys(K).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!K||!q.trim(),onClick:Z,children:[c.jsx(b0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function sT(){const n=L(k=>k.showCommandPalette),s=L(k=>k.setShowCommandPalette),r=L(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,x=oa(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:wr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:hs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ca,action:()=>{const T=document.querySelector(".cmd-input");T==null||T.focus()},available:!!r.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:ci,action:()=>r.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:u0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:s0,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:$n,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),g=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=m.filter(T=>T.available);return k?x.filter(T=>T.label.toLowerCase().includes(k)||T.hint.toLowerCase().includes(k)):x},[m,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function y(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=g[u];x&&(x.action(),s(!1))}else k.key==="Escape"&&s(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:y}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:g.map((k,x)=>{const T=k.icon;return c.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>f(x),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(T,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&c.jsx(t0,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const ym=/^[a-z][a-z0-9-]{1,30}$/,rT=2e3;function iT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=L(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,m]=w.useState(!1),[g,y]=w.useState(!1),[k,x]=w.useState(!1),[T,E]=w.useState(!1),[C,b]=w.useState("main"),[M,I]=w.useState(""),[W,O]=w.useState(!1),[B,K]=w.useState(null),G=w.useRef(null);aa(G,()=>E(!1),T);const q=g||k,le=w.useCallback(async()=>{m(!0),f(null);try{const P=await fetch(`${ms()}/remote/status`,{headers:{Accept:"application/json"}});if(!P.ok)throw new Error(`status ${P.status}`);a(await P.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(b("main"),K(null),le())},[n,le]);const de=B!==null&&B.state==="running";if(w.useEffect(()=>{if(!de)return;const P=setInterval(async()=>{try{const ee=await fetch(`${ms()}/remote/enable`,{headers:{Accept:"application/json"}});ee.ok&&K(await ee.json())}catch{}},rT);return()=>clearInterval(P)},[de]),!n)return null;const me=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function fe(P){P.key==="Escape"&&s(!1)}async function pe(P){if(ym.test(P)){O(!0);try{const ee=await fetch(`${ms()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:P})});if(!ee.ok)throw new Error(`enable ${ee.status}`);K(await ee.json()),b("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{O(!1)}}}function Me(){B!=null&&B.troubleshootingSessionId&&(r(B.troubleshootingSessionId),s(!1))}async function Z(){y(!0);try{await fetch(`${ms()}/remote/disable`,{method:"POST"}),await le()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{y(!1)}}async function re(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
|
|
528
|
-
|
|
529
|
-
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
530
|
-
|
|
531
|
-
This cannot be undone.`)){x(!0);try{const ee=await fetch(`${ms()}/remote/uninstall`,{method:"DELETE"});if(!ee.ok)throw new Error(`uninstall ${ee.status}`);await le()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function ce(){if(!B)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:M,onChange:R=>I(R.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>b("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!ym.test(M)||W,onClick:()=>void pe(M),children:[W?c.jsx(rs,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const P=["detect","provision","install","verify","ready"],ee=P.indexOf(B.step),H=B.state==="ready";return c.jsxs(c.Fragment,{children:[B.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(rs,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),B.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(er,{size:14})," Setup complete — you can close this window."]}),B.state==="ready"&&B.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${B.hostname}`,target:"_blank",rel:"noreferrer",children:B.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:P.map((R,_)=>{const X=H||ee>-1&&_<ee,se=!H&&_===ee&&B.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:X||se?1:.4,color:X?"var(--green)":void 0},children:[X?c.jsx(er,{size:13}):se?c.jsx(rs,{size:13,className:"spin"}):c.jsx(Jx,{size:9,style:{marginLeft:2,marginRight:2}}),R]},R)})}),B.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:B.logs.slice(-3).map(R=>R.message).join(`
|
|
532
|
-
`)}),B.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Me,children:"Open troubleshooting session"})})]}),B.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",B.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void le(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:fe,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx($n,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[h&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(rs,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?ce():c.jsxs(c.Fragment,{children:[me&&(o==null?void 0:o.tunnel.hostname)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),c.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[c.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void Z(),disabled:q,children:[g?c.jsx(rs,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>E(P=>!P),disabled:q,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":T,children:k?c.jsx(rs,{size:14,className:"spin"}):c.jsx(ii,{size:14})}),T&&c.jsx("div",{ref:G,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:c.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void re(),children:[c.jsx(hs,{size:12})," Remove tunnel"]})})]})]}),!me&&c.jsx(c.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void pe(o.tunnel.mahlas),disabled:W,children:[W?c.jsx(rs,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(dh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>b("setup"),children:[c.jsx(dh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const oT={success:Qx,error:Qu,info:o0,warn:S0},lT=4e3;function aT({toast:n}){const s=L(f=>f.removeToast),r=oT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>s(n.id),lT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,s]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(r,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),s(n.id)},children:[c.jsx(T0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>s(n.id),children:c.jsx($n,{size:14})})]})}function cT(){const n=L(s=>s.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(s=>c.jsx(aT,{toast:s},s.id))})}let qn=null,li=null,oo=1e3;const uT=1e4;function dT(){const n=ms();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ou(){qn&&(qn.readyState===WebSocket.OPEN||qn.readyState===WebSocket.CONNECTING)||(qn=new WebSocket(dT()),qn.onopen=()=>{const n=oo>1e3;if(oo=1e3,L.getState().setWsConnected(!0),L.getState().addLogEntry("INFO","WebSocket connected"),n){const s=L.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},qn.onclose=()=>{L.getState().setWsConnected(!1),L.getState().addLogEntry("WARN","WebSocket disconnected"),L.getState().addToast("warn","WebSocket disconnected — reconnecting…"),pT()},qn.onerror=()=>{},qn.onmessage=n=>{try{const s=JSON.parse(n.data);en.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof n.data=="string"?n.data.length:0);const r=hT[s.event];r&&r(s.data)}catch{}})}function fT(){li&&(clearTimeout(li),li=null),qn&&(qn.onclose=null,qn.close(),qn=null),L.getState().setWsConnected(!1)}function pT(){li||(li=window.setTimeout(()=>{li=null,Ou()},oo),oo=Math.min(oo*2,uT))}const hT={"turn:created":n=>{const s=n;L.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":n=>{const s=n;en.note(`turn:started — ${s.turnId.slice(0,8)}`),L.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":n=>{const s=n;L.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":n=>{const s=n;L.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":n=>{const s=n;L.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":n=>{const s=n;L.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":n=>{const s=n;en.note(`turn:completed — ${s.turnId.slice(0,8)}`),L.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":n=>{const s=n;L.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":n=>{const s=n,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage,...s.autoCompactThreshold?{autoCompactThreshold:s.autoCompactThreshold}:{}};L.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":n=>{const s=n;L.getState().onTurnFailed(s.sessionId,s.turnId,s.error)},"turn:cancelled":n=>{const s=n;L.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":n=>{const s=n;L.getState().onSessionTitle(s.sessionId,s.title)},background_tasks:n=>{const s=n;en.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),L.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":n=>{const s=n;L.getState().onBackgroundTasksSnapshot(s.sessions??{})},"thread:created":n=>{const s=n;L.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":n=>{const s=n;L.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":n=>{const s=n;L.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":n=>{const s=n;L.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":n=>{const s=n;ix(s.appId,s.callId,s.tool,s.args??{})},"app:source:updated":n=>{fx(n.appId)},"app:state_changed":n=>{dx(n.appId)}};function mT(){const n=L(s=>s.init);return w.useEffect(()=>{My(),n(),L.getState().loadApps(),Ou();function s(){if(document.visibilityState!=="visible")return;const r=L.getState(),o=r.activeSessionId;if(!o)return;const a=r.sessionDetails[o];r.wsConnected||Ou(),a&&a.is_running===1&&(r.refreshActiveSession(),r.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",s),()=>{fT(),document.removeEventListener("visibilitychange",s)}},[n]),null}function gT(){const n=L(a=>a.loading),s=L(a=>a.error),r=L(a=>a.sessions),o=L(a=>a.setShowCommandPalette);return w.useEffect(()=>en.start(),[]),w.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(mT,{}),n&&r.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",s]}):c.jsxs(c.Fragment,{children:[c.jsx(QS,{}),c.jsx(ZS,{}),c.jsx(nT,{}),c.jsx(iT,{}),c.jsx(sT,{}),c.jsx(cT,{})]})]})}by.createRoot(document.getElementById("root")).render(c.jsx(it.StrictMode,{children:c.jsx(gT,{})}));
|