repoburg 1.3.268 → 1.3.270
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 +214 -60
- package/agent-pane/backend/dist/server.js +216 -60
- package/agent-pane/frontend/dist/assets/index-CcL4MDxZ.js +572 -0
- package/agent-pane/frontend/dist/assets/index-Cr-XES2b.css +1 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- 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-CGMuuJwp.css +0 -1
- package/agent-pane/frontend/dist/assets/index-DJdEb4sk.js +0 -567
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
var My=Object.defineProperty;var Dy=(n,s,r)=>s in n?My(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var ot=(n,s,r)=>Dy(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 Rm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jc={exports:{}},Xi={},eu={exports:{}},He={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Bp;function Ly(){if(Bp)return He;Bp=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"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function x(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function R(A,j,X){this.props=A,this.context=j,this.refs=C,this.updater=X||T}R.prototype.isReactComponent={},R.prototype.setState=function(A,j){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,j,"setState")},R.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function L(){}L.prototype=R.prototype;function b(A,j,X){this.props=A,this.context=j,this.refs=C,this.updater=X||T}var U=b.prototype=new L;U.constructor=b,E(U,R.prototype),U.isPureReactComponent=!0;var P=Array.isArray,W=Object.prototype.hasOwnProperty,K={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function G(A,j,X){var re,ve={},Te=null,Pe=null;if(j!=null)for(re in j.ref!==void 0&&(Pe=j.ref),j.key!==void 0&&(Te=""+j.key),j)W.call(j,re)&&!q.hasOwnProperty(re)&&(ve[re]=j[re]);var Re=arguments.length-2;if(Re===1)ve.children=X;else if(1<Re){for(var De=Array(Re),Ne=0;Ne<Re;Ne++)De[Ne]=arguments[Ne+2];ve.children=De}if(A&&A.defaultProps)for(re in Re=A.defaultProps,Re)ve[re]===void 0&&(ve[re]=Re[re]);return{$$typeof:n,type:A,key:Te,ref:Pe,props:ve,_owner:K.current}}function ce(A,j){return{$$typeof:n,type:A.type,key:j,ref:A.ref,props:A.props,_owner:A._owner}}function pe(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function ue(A){var j={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(X){return j[X]})}var de=/\/+/g;function he(A,j){return typeof A=="object"&&A!==null&&A.key!=null?ue(""+A.key):j.toString(36)}function Le(A,j,X,re,ve){var Te=typeof A;(Te==="undefined"||Te==="boolean")&&(A=null);var Pe=!1;if(A===null)Pe=!0;else switch(Te){case"string":case"number":Pe=!0;break;case"object":switch(A.$$typeof){case n:case s:Pe=!0}}if(Pe)return Pe=A,ve=ve(Pe),A=re===""?"."+he(Pe,0):re,P(ve)?(X="",A!=null&&(X=A.replace(de,"$&/")+"/"),Le(ve,j,X,"",function(Ne){return Ne})):ve!=null&&(pe(ve)&&(ve=ce(ve,X+(!ve.key||Pe&&Pe.key===ve.key?"":(""+ve.key).replace(de,"$&/")+"/")+A)),j.push(ve)),1;if(Pe=0,re=re===""?".":re+":",P(A))for(var Re=0;Re<A.length;Re++){Te=A[Re];var De=re+he(Te,Re);Pe+=Le(Te,j,X,De,ve)}else if(De=x(A),typeof De=="function")for(A=De.call(A),Re=0;!(Te=A.next()).done;)Te=Te.value,De=re+he(Te,Re++),Pe+=Le(Te,j,X,De,ve);else if(Te==="object")throw j=String(A),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return Pe}function te(A,j,X){if(A==null)return A;var re=[],ve=0;return Le(A,re,"","",function(Te){return j.call(X,Te,ve++)}),re}function ie(A){if(A._status===-1){var j=A._result;j=j(),j.then(function(X){(A._status===0||A._status===-1)&&(A._status=1,A._result=X)},function(X){(A._status===0||A._status===-1)&&(A._status=2,A._result=X)}),A._status===-1&&(A._status=0,A._result=j)}if(A._status===1)return A._result.default;throw A._result}var le={current:null},$={transition:null},Y={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:$,ReactCurrentOwner:K};function H(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:te,forEach:function(A,j,X){te(A,function(){j.apply(this,arguments)},X)},count:function(A){var j=0;return te(A,function(){j++}),j},toArray:function(A){return te(A,function(j){return j})||[]},only:function(A){if(!pe(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},He.Component=R,He.Fragment=r,He.Profiler=a,He.PureComponent=b,He.StrictMode=o,He.Suspense=g,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,He.act=H,He.cloneElement=function(A,j,X){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var re=E({},A.props),ve=A.key,Te=A.ref,Pe=A._owner;if(j!=null){if(j.ref!==void 0&&(Te=j.ref,Pe=K.current),j.key!==void 0&&(ve=""+j.key),A.type&&A.type.defaultProps)var Re=A.type.defaultProps;for(De in j)W.call(j,De)&&!q.hasOwnProperty(De)&&(re[De]=j[De]===void 0&&Re!==void 0?Re[De]:j[De])}var De=arguments.length-2;if(De===1)re.children=X;else if(1<De){Re=Array(De);for(var Ne=0;Ne<De;Ne++)Re[Ne]=arguments[Ne+2];re.children=Re}return{$$typeof:n,type:A.type,key:ve,ref:Te,props:re,_owner:Pe}},He.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},He.createElement=G,He.createFactory=function(A){var j=G.bind(null,A);return j.type=A,j},He.createRef=function(){return{current:null}},He.forwardRef=function(A){return{$$typeof:h,render:A}},He.isValidElement=pe,He.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:ie}},He.memo=function(A,j){return{$$typeof:m,type:A,compare:j===void 0?null:j}},He.startTransition=function(A){var j=$.transition;$.transition={};try{A()}finally{$.transition=j}},He.unstable_act=H,He.useCallback=function(A,j){return le.current.useCallback(A,j)},He.useContext=function(A){return le.current.useContext(A)},He.useDebugValue=function(){},He.useDeferredValue=function(A){return le.current.useDeferredValue(A)},He.useEffect=function(A,j){return le.current.useEffect(A,j)},He.useId=function(){return le.current.useId()},He.useImperativeHandle=function(A,j,X){return le.current.useImperativeHandle(A,j,X)},He.useInsertionEffect=function(A,j){return le.current.useInsertionEffect(A,j)},He.useLayoutEffect=function(A,j){return le.current.useLayoutEffect(A,j)},He.useMemo=function(A,j){return le.current.useMemo(A,j)},He.useReducer=function(A,j,X){return le.current.useReducer(A,j,X)},He.useRef=function(A){return le.current.useRef(A)},He.useState=function(A){return le.current.useState(A)},He.useSyncExternalStore=function(A,j,X){return le.current.useSyncExternalStore(A,j,X)},He.useTransition=function(){return le.current.useTransition()},He.version="18.3.1",He}var Wp;function qu(){return Wp||(Wp=1,eu.exports=Ly()),eu.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 Hp;function Py(){if(Hp)return Xi;Hp=1;var n=qu(),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,g,m){var v,k={},x=null,T=null;m!==void 0&&(x=""+m),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(T=g.ref);for(v in g)o.call(g,v)&&!u.hasOwnProperty(v)&&(k[v]=g[v]);if(h&&h.defaultProps)for(v in g=h.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:s,type:h,key:x,ref:T,props:k,_owner:a.current}}return Xi.Fragment=r,Xi.jsx=f,Xi.jsxs=f,Xi}var Vp;function Oy(){return Vp||(Vp=1,Jc.exports=Py()),Jc.exports}var c=Oy(),w=qu();const rt=Rm(w);var _a={},tu={exports:{}},Nn={},nu={exports:{}},su={};/**
|
|
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 qp;function zy(){return qp||(qp=1,(function(n){function s($,Y){var H=$.length;$.push(Y);e:for(;0<H;){var A=H-1>>>1,j=$[A];if(0<a(j,Y))$[A]=Y,$[H]=j,H=A;else break e}}function r($){return $.length===0?null:$[0]}function o($){if($.length===0)return null;var Y=$[0],H=$.pop();if(H!==Y){$[0]=H;e:for(var A=0,j=$.length,X=j>>>1;A<X;){var re=2*(A+1)-1,ve=$[re],Te=re+1,Pe=$[Te];if(0>a(ve,H))Te<j&&0>a(Pe,ve)?($[A]=Pe,$[Te]=H,A=Te):($[A]=ve,$[re]=H,A=re);else if(Te<j&&0>a(Pe,H))$[A]=Pe,$[Te]=H,A=Te;else break e}}return Y}function a($,Y){var H=$.sortIndex-Y.sortIndex;return H!==0?H:$.id-Y.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 g=[],m=[],v=1,k=null,x=3,T=!1,E=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U($){for(var Y=r(m);Y!==null;){if(Y.callback===null)o(m);else if(Y.startTime<=$)o(m),Y.sortIndex=Y.expirationTime,s(g,Y);else break;Y=r(m)}}function P($){if(C=!1,U($),!E)if(r(g)!==null)E=!0,ie(W);else{var Y=r(m);Y!==null&&le(P,Y.startTime-$)}}function W($,Y){E=!1,C&&(C=!1,L(G),G=-1),T=!0;var H=x;try{for(U(Y),k=r(g);k!==null&&(!(k.expirationTime>Y)||$&&!ue());){var A=k.callback;if(typeof A=="function"){k.callback=null,x=k.priorityLevel;var j=A(k.expirationTime<=Y);Y=n.unstable_now(),typeof j=="function"?k.callback=j:k===r(g)&&o(g),U(Y)}else o(g);k=r(g)}if(k!==null)var X=!0;else{var re=r(m);re!==null&&le(P,re.startTime-Y),X=!1}return X}finally{k=null,x=H,T=!1}}var K=!1,q=null,G=-1,ce=5,pe=-1;function ue(){return!(n.unstable_now()-pe<ce)}function de(){if(q!==null){var $=n.unstable_now();pe=$;var Y=!0;try{Y=q(!0,$)}finally{Y?he():(K=!1,q=null)}}else K=!1}var he;if(typeof b=="function")he=function(){b(de)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,te=Le.port2;Le.port1.onmessage=de,he=function(){te.postMessage(null)}}else he=function(){R(de,0)};function ie($){q=$,K||(K=!0,he())}function le($,Y){G=R(function(){$(n.unstable_now())},Y)}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($){$.callback=null},n.unstable_continueExecution=function(){E||T||(E=!0,ie(W))},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ce=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return r(g)},n.unstable_next=function($){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var H=x;x=Y;try{return $()}finally{x=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=x;x=$;try{return Y()}finally{x=H}},n.unstable_scheduleCallback=function($,Y,H){var A=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?A+H:A):H=A,$){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=H+j,$={id:v++,callback:Y,priorityLevel:$,startTime:H,expirationTime:j,sortIndex:-1},H>A?($.sortIndex=H,s(m,$),r(g)===null&&$===r(m)&&(C?(L(G),G=-1):C=!0,le(P,H-A))):($.sortIndex=j,s(g,$),E||T||(E=!0,ie(W))),$},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function($){var Y=x;return function(){var H=x;x=Y;try{return $.apply(this,arguments)}finally{x=H}}}})(su)),su}var Gp;function $y(){return Gp||(Gp=1,nu.exports=zy()),nu.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 Kp;function Fy(){if(Kp)return Nn;Kp=1;var n=qu(),s=$y();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"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},k={};function x(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[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,y){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=y}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[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];R[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[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){R[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function b(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(L,b);R[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(L,b);R[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(L,b);R[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,i,l){var d=R.hasOwnProperty(t)?R[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 P=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),K=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),pe=Symbol.for("react.provider"),ue=Symbol.for("react.context"),de=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Le=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,A;function j(e){if(A===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);A=t&&t[1]||""}return`
|
|
34
|
-
`+A+e}var X=!1;function re(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(B){var l=B}Reflect.construct(e,[],t)}else{try{t.call()}catch(B){l=B}e.call(t.prototype)}else{try{throw Error()}catch(B){l=B}e()}}catch(B){if(B&&l&&typeof B.stack=="string"){for(var d=B.stack.split(`
|
|
35
|
-
`),p=l.stack.split(`
|
|
36
|
-
`),y=d.length-1,N=p.length-1;1<=y&&0<=N&&d[y]!==p[N];)N--;for(;1<=y&&0<=N;y--,N--)if(d[y]!==p[N]){if(y!==1||N!==1)do if(y--,N--,0>N||d[y]!==p[N]){var I=`
|
|
37
|
-
`+d[y].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=y&&0<=N);break}}}finally{X=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?j(e):""}function ve(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function Te(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 q:return"Fragment";case K:return"Portal";case ce:return"Profiler";case G:return"StrictMode";case he:return"Suspense";case Le:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ue:return(e.displayName||"Context")+".Consumer";case pe:return(e._context.displayName||"Context")+".Provider";case de:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:Te(e.type)||"Memo";case ie:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}function Pe(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 Te(t);case 8:return t===G?"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 Re(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 Ne(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(y){l=""+y,p.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function st(e){e._valueTracker||(e._valueTracker=Ne(e))}function Oe(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 mt(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 Fe(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function _t(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Re(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 Ue(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function Yt(e,t){Ue(e,t);var i=Re(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")?at(e,t.type,i):t.hasOwnProperty("defaultValue")&&at(e,t.type,Re(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function On(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 at(e,t,i){(t!=="number"||mt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var yt=Array.isArray;function lt(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=""+Re(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 Ft(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function V(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(yt(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Re(i)}}function me(e,t){var i=Re(t.value),l=Re(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 Be(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Je(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 ct(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Je(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ut,gt=(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(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ut.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xt(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var xt={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},Kn=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){Kn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function En(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function ys(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=En(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 un(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 zn(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 tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dt=null,dn=null,nt=null;function At(e){if(e=Li(e)){if(typeof Dt!="function")throw Error(r(280));var t=e.stateNode;t&&(t=Wo(t),Dt(e.stateNode,e.type,t))}}function jt(e){dn?nt?nt.push(e):nt=[e]:dn=e}function Ut(){if(dn){var e=dn,t=nt;if(nt=dn=null,At(e),t)for(e=0;e<t.length;e++)At(t[e])}}function _(e,t){return e(t)}function se(){}var Q=!1;function ge(e,t,i){if(Q)return e(t,i);Q=!0;try{return _(e,t,i)}finally{Q=!1,(dn!==null||nt!==null)&&(se(),Ut())}}function Ce(e,t){var i=e.stateNode;if(i===null)return null;var l=Wo(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 We=!1;if(h)try{var je={};Object.defineProperty(je,"passive",{get:function(){We=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch{We=!1}function et(e,t,i,l,d,p,y,N,I){var B=Array.prototype.slice.call(arguments,3);try{t.apply(i,B)}catch(ee){this.onError(ee)}}var ft=!1,wt=null,kt=!1,sn=null,fn={onError:function(e){ft=!0,wt=e}};function ls(e,t,i,l,d,p,y,N,I){ft=!1,wt=null,et.apply(fn,arguments)}function Is(e,t,i,l,d,p,y,N,I){if(ls.apply(this,arguments),ft){if(ft){var B=wt;ft=!1,wt=null}else throw Error(r(198));kt||(kt=!0,sn=B)}}function Ee(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 it(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 Xn(e){if(Ee(e)!==e)throw Error(r(188))}function To(e){var t=e.alternate;if(!t){if(t=Ee(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 Xn(d),e;if(p===l)return Xn(d),t;p=p.sibling}throw Error(r(188))}if(i.return!==l.return)i=d,l=p;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,l=p;break}if(N===l){y=!0,l=d,i=p;break}N=N.sibling}if(!y){for(N=p.child;N;){if(N===i){y=!0,i=p,l=d;break}if(N===l){y=!0,l=p,i=d;break}N=N.sibling}if(!y)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 Er(e){return e=To(e),e!==null?gi(e):null}function gi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gi(e);if(t!==null)return t;e=e.sibling}return null}var vi=s.unstable_scheduleCallback,bo=s.unstable_cancelCallback,Tl=s.unstable_shouldYield,bl=s.unstable_requestPaint,St=s.unstable_now,cs=s.unstable_getCurrentPriorityLevel,Ms=s.unstable_ImmediatePriority,us=s.unstable_UserBlockingPriority,_r=s.unstable_NormalPriority,nr=s.unstable_LowPriority,No=s.unstable_IdlePriority,sr=null,_n=null;function jr(e){if(_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(sr,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:rr,Rr=Math.log,Ds=Math.LN2;function rr(e){return e>>>=0,e===0?32:31-(Rr(e)/Ds|0)|0}var hn=64,Ar=4194304;function ir(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function or(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?l=ir(N):(p&=y,p!==0&&(l=ir(p)))}else y=i&~d,y!==0?l=ir(y):p!==0&&(l=ir(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-pn(t),d=1<<i,l|=e[i],t&=~d;return l}function Co(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 Eo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var y=31-pn(p),N=1<<y,I=d[y];I===-1?((N&i)===0||(N&l)!==0)&&(d[y]=Co(N,t)):I<=t&&(e.expiredLanes|=N),p&=~N}}function yi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xi(){var e=hn;return hn<<=1,(hn&4194240)===0&&(hn=64),e}function wi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ar(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=i}function _o(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-pn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ls(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-pn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ge=0;function oe(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,O,Z,ke,_e,$e=!1,Ke=[],Xe=null,Tt=null,bt=null,xs=new Map,It=new Map,Ps=[],tv="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 bd(e,t){switch(e){case"focusin":case"focusout":Xe=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":xs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function ki(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=Li(t),t!==null&&O(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function nv(e,t,i,l,d){switch(t){case"focusin":return Xe=ki(Xe,e,t,i,l,d),!0;case"dragenter":return Tt=ki(Tt,e,t,i,l,d),!0;case"mouseover":return bt=ki(bt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return xs.set(p,ki(xs.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,It.set(p,ki(It.get(p)||null,e,t,i,l,d)),!0}return!1}function Nd(e){var t=lr(e.target);if(t!==null){var i=Ee(t);if(i!==null){if(t=i.tag,t===13){if(t=it(i),t!==null){e.blockedOn=t,_e(e.priority,function(){Z(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 jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Cl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);tn=l,i.target.dispatchEvent(l),tn=null}else return t=Li(i),t!==null&&O(t),e.blockedOn=i,!1;t.shift()}return!0}function Cd(e,t,i){jo(e)&&i.delete(t)}function sv(){$e=!1,Xe!==null&&jo(Xe)&&(Xe=null),Tt!==null&&jo(Tt)&&(Tt=null),bt!==null&&jo(bt)&&(bt=null),xs.forEach(Cd),It.forEach(Cd)}function Si(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,sv)))}function Ti(e){function t(d){return Si(d,e)}if(0<Ke.length){Si(Ke[0],e);for(var i=1;i<Ke.length;i++){var l=Ke[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Xe!==null&&Si(Xe,e),Tt!==null&&Si(Tt,e),bt!==null&&Si(bt,e),xs.forEach(t),It.forEach(t),i=0;i<Ps.length;i++)l=Ps[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ps.length&&(i=Ps[0],i.blockedOn===null);)Nd(i),i.blockedOn===null&&Ps.shift()}var Ir=P.ReactCurrentBatchConfig,Ro=!0;function rv(e,t,i,l){var d=Ge,p=Ir.transition;Ir.transition=null;try{Ge=1,Nl(e,t,i,l)}finally{Ge=d,Ir.transition=p}}function iv(e,t,i,l){var d=Ge,p=Ir.transition;Ir.transition=null;try{Ge=4,Nl(e,t,i,l)}finally{Ge=d,Ir.transition=p}}function Nl(e,t,i,l){if(Ro){var d=Cl(e,t,i,l);if(d===null)Wl(e,t,l,Ao,i),bd(e,l);else if(nv(d,e,t,i,l))l.stopPropagation();else if(bd(e,l),t&4&&-1<tv.indexOf(e)){for(;d!==null;){var p=Li(d);if(p!==null&&S(p),p=Cl(e,t,i,l),p===null&&Wl(e,t,l,Ao,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Wl(e,t,l,null,i)}}var Ao=null;function Cl(e,t,i,l){if(Ao=null,e=nn(l),e=lr(e),e!==null)if(t=Ee(e),t===null)e=null;else if(i=t.tag,i===13){if(e=it(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 Ao=e,null}function Ed(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(cs()){case Ms:return 1;case us:return 4;case _r:case nr:return 16;case No:return 536870912;default:return 16}default:return 16}}var Os=null,El=null,Io=null;function _d(){if(Io)return Io;var e,t=El,i=t.length,l,d="value"in Os?Os.value:Os.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var y=i-e;for(l=1;l<=y&&t[i-l]===d[p-l];l++);return Io=d.slice(e,1<l?1-l:void 0)}function Mo(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 Do(){return!0}function jd(){return!1}function jn(e){function t(i,l,d,p,y){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=y,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)?Do:jd,this.isPropagationStopped=jd,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=Do)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),t}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=jn(Mr),bi=H({},Mr,{view:0,detail:0}),ov=jn(bi),jl,Rl,Ni,Lo=H({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Il,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!==Ni&&(Ni&&e.type==="mousemove"?(jl=e.screenX-Ni.screenX,Rl=e.screenY-Ni.screenY):Rl=jl=0,Ni=e),jl)},movementY:function(e){return"movementY"in e?e.movementY:Rl}}),Rd=jn(Lo),av=H({},Lo,{dataTransfer:0}),lv=jn(av),cv=H({},bi,{relatedTarget:0}),Al=jn(cv),uv=H({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),dv=jn(uv),fv=H({},Mr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pv=jn(fv),hv=H({},Mr,{data:0}),Ad=jn(hv),mv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gv={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"},vv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vv[e])?!!t[e]:!1}function Il(){return yv}var xv=H({},bi,{key:function(e){if(e.key){var t=mv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Il,charCode:function(e){return e.type==="keypress"?Mo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wv=jn(xv),kv=H({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Id=jn(kv),Sv=H({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Il}),Tv=jn(Sv),bv=H({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nv=jn(bv),Cv=H({},Lo,{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}),Ev=jn(Cv),_v=[9,13,27,32],Ml=h&&"CompositionEvent"in window,Ci=null;h&&"documentMode"in document&&(Ci=document.documentMode);var jv=h&&"TextEvent"in window&&!Ci,Md=h&&(!Ml||Ci&&8<Ci&&11>=Ci),Dd=" ",Ld=!1;function Pd(e,t){switch(e){case"keyup":return _v.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Od(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dr=!1;function Rv(e,t){switch(e){case"compositionend":return Od(t);case"keypress":return t.which!==32?null:(Ld=!0,Dd);case"textInput":return e=t.data,e===Dd&&Ld?null:e;default:return null}}function Av(e,t){if(Dr)return e==="compositionend"||!Ml&&Pd(e,t)?(e=_d(),Io=El=Os=null,Dr=!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 Md&&t.locale!=="ko"?null:t.data;default:return null}}var Iv={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 zd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Iv[e.type]:t==="textarea"}function $d(e,t,i,l){jt(l),t=Fo(t,"onChange"),0<t.length&&(i=new _l("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ei=null,_i=null;function Mv(e){sf(e,0)}function Po(e){var t=$r(e);if(Oe(t))return e}function Dv(e,t){if(e==="change")return t}var Fd=!1;if(h){var Dl;if(h){var Ll="oninput"in document;if(!Ll){var Ud=document.createElement("div");Ud.setAttribute("oninput","return;"),Ll=typeof Ud.oninput=="function"}Dl=Ll}else Dl=!1;Fd=Dl&&(!document.documentMode||9<document.documentMode)}function Bd(){Ei&&(Ei.detachEvent("onpropertychange",Wd),_i=Ei=null)}function Wd(e){if(e.propertyName==="value"&&Po(_i)){var t=[];$d(t,_i,e,nn(e)),ge(Mv,t)}}function Lv(e,t,i){e==="focusin"?(Bd(),Ei=t,_i=i,Ei.attachEvent("onpropertychange",Wd)):e==="focusout"&&Bd()}function Pv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Po(_i)}function Ov(e,t){if(e==="click")return Po(t)}function zv(e,t){if(e==="input"||e==="change")return Po(t)}function $v(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:$v;function ji(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(!g.call(t,d)||!Qn(e[d],t[d]))return!1}return!0}function Hd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vd(e,t){var i=Hd(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=Hd(i)}}function qd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gd(){for(var e=window,t=mt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=mt(e.document)}return t}function Pl(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 Fv(e){var t=Gd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&qd(i.ownerDocument.documentElement,i)){if(l!==null&&Pl(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=Vd(i,p);var y=Vd(i,l);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.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 Uv=h&&"documentMode"in document&&11>=document.documentMode,Lr=null,Ol=null,Ri=null,zl=!1;function Kd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;zl||Lr==null||Lr!==mt(l)||(l=Lr,"selectionStart"in l&&Pl(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}),Ri&&ji(Ri,l)||(Ri=l,l=Fo(Ol,"onSelect"),0<l.length&&(t=new _l("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Lr)))}function Oo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Pr={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionend:Oo("Transition","TransitionEnd")},$l={},Yd={};h&&(Yd=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function zo(e){if($l[e])return $l[e];if(!Pr[e])return e;var t=Pr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Yd)return $l[e]=t[i];return e}var Xd=zo("animationend"),Qd=zo("animationiteration"),Zd=zo("animationstart"),Jd=zo("transitionend"),ef=new Map,tf="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 zs(e,t){ef.set(e,t),u(t,[e])}for(var Fl=0;Fl<tf.length;Fl++){var Ul=tf[Fl],Bv=Ul.toLowerCase(),Wv=Ul[0].toUpperCase()+Ul.slice(1);zs(Bv,"on"+Wv)}zs(Xd,"onAnimationEnd"),zs(Qd,"onAnimationIteration"),zs(Zd,"onAnimationStart"),zs("dblclick","onDoubleClick"),zs("focusin","onFocus"),zs("focusout","onBlur"),zs(Jd,"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 Ai="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(" "),Hv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ai));function nf(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,Is(l,t,void 0,e),e.currentTarget=null}function sf(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 y=l.length-1;0<=y;y--){var N=l[y],I=N.instance,B=N.currentTarget;if(N=N.listener,I!==p&&d.isPropagationStopped())break e;nf(d,N,B),p=I}else for(y=0;y<l.length;y++){if(N=l[y],I=N.instance,B=N.currentTarget,N=N.listener,I!==p&&d.isPropagationStopped())break e;nf(d,N,B),p=I}}}if(kt)throw e=sn,kt=!1,sn=null,e}function pt(e,t){var i=t[Yl];i===void 0&&(i=t[Yl]=new Set);var l=e+"__bubble";i.has(l)||(rf(t,e,2,!1),i.add(l))}function Bl(e,t,i){var l=0;t&&(l|=4),rf(i,e,l,t)}var $o="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[$o]){e[$o]=!0,o.forEach(function(i){i!=="selectionchange"&&(Hv.has(i)||Bl(i,!1,e),Bl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$o]||(t[$o]=!0,Bl("selectionchange",!1,t))}}function rf(e,t,i,l){switch(Ed(t)){case 1:var d=rv;break;case 4:d=iv;break;default:d=Nl}i=d.bind(null,t,i,e),d=void 0,!We||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 Wl(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=l.return;y!==null;){var I=y.tag;if((I===3||I===4)&&(I=y.stateNode.containerInfo,I===d||I.nodeType===8&&I.parentNode===d))return;y=y.return}for(;N!==null;){if(y=lr(N),y===null)return;if(I=y.tag,I===5||I===6){l=p=y;continue e}N=N.parentNode}}l=l.return}ge(function(){var B=p,ee=nn(i),ne=[];e:{var J=ef.get(e);if(J!==void 0){var fe=_l,we=e;switch(e){case"keypress":if(Mo(i)===0)break e;case"keydown":case"keyup":fe=wv;break;case"focusin":we="focus",fe=Al;break;case"focusout":we="blur",fe=Al;break;case"beforeblur":case"afterblur":fe=Al;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":fe=Rd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=lv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Tv;break;case Xd:case Qd:case Zd:fe=dv;break;case Jd:fe=Nv;break;case"scroll":fe=ov;break;case"wheel":fe=Ev;break;case"copy":case"cut":case"paste":fe=pv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Id}var Se=(t&4)!==0,Mt=!Se&&e==="scroll",z=Se?J!==null?J+"Capture":null:J;Se=[];for(var M=B,F;M!==null;){F=M;var ae=F.stateNode;if(F.tag===5&&ae!==null&&(F=ae,z!==null&&(ae=Ce(M,z),ae!=null&&Se.push(Mi(M,ae,F)))),Mt)break;M=M.return}0<Se.length&&(J=new fe(J,we,null,i,ee),ne.push({event:J,listeners:Se}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",J&&i!==tn&&(we=i.relatedTarget||i.fromElement)&&(lr(we)||we[ws]))break e;if((fe||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,fe?(we=i.relatedTarget||i.toElement,fe=B,we=we?lr(we):null,we!==null&&(Mt=Ee(we),we!==Mt||we.tag!==5&&we.tag!==6)&&(we=null)):(fe=null,we=B),fe!==we)){if(Se=Rd,ae="onMouseLeave",z="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Id,ae="onPointerLeave",z="onPointerEnter",M="pointer"),Mt=fe==null?J:$r(fe),F=we==null?J:$r(we),J=new Se(ae,M+"leave",fe,i,ee),J.target=Mt,J.relatedTarget=F,ae=null,lr(ee)===B&&(Se=new Se(z,M+"enter",we,i,ee),Se.target=F,Se.relatedTarget=Mt,ae=Se),Mt=ae,fe&&we)t:{for(Se=fe,z=we,M=0,F=Se;F;F=Or(F))M++;for(F=0,ae=z;ae;ae=Or(ae))F++;for(;0<M-F;)Se=Or(Se),M--;for(;0<F-M;)z=Or(z),F--;for(;M--;){if(Se===z||z!==null&&Se===z.alternate)break t;Se=Or(Se),z=Or(z)}Se=null}else Se=null;fe!==null&&of(ne,J,fe,Se,!1),we!==null&&Mt!==null&&of(ne,Mt,we,Se,!0)}}e:{if(J=B?$r(B):window,fe=J.nodeName&&J.nodeName.toLowerCase(),fe==="select"||fe==="input"&&J.type==="file")var be=Dv;else if(zd(J))if(Fd)be=zv;else{be=Pv;var Ie=Lv}else(fe=J.nodeName)&&fe.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(be=Ov);if(be&&(be=be(e,B))){$d(ne,be,i,ee);break e}Ie&&Ie(e,J,B),e==="focusout"&&(Ie=J._wrapperState)&&Ie.controlled&&J.type==="number"&&at(J,"number",J.value)}switch(Ie=B?$r(B):window,e){case"focusin":(zd(Ie)||Ie.contentEditable==="true")&&(Lr=Ie,Ol=B,Ri=null);break;case"focusout":Ri=Ol=Lr=null;break;case"mousedown":zl=!0;break;case"contextmenu":case"mouseup":case"dragend":zl=!1,Kd(ne,i,ee);break;case"selectionchange":if(Uv)break;case"keydown":case"keyup":Kd(ne,i,ee)}var Me;if(Ml)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Dr?Pd(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(Md&&i.locale!=="ko"&&(Dr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Dr&&(Me=_d()):(Os=ee,El="value"in Os?Os.value:Os.textContent,Dr=!0)),Ie=Fo(B,ze),0<Ie.length&&(ze=new Ad(ze,e,null,i,ee),ne.push({event:ze,listeners:Ie}),Me?ze.data=Me:(Me=Od(i),Me!==null&&(ze.data=Me)))),(Me=jv?Rv(e,i):Av(e,i))&&(B=Fo(B,"onBeforeInput"),0<B.length&&(ee=new Ad("onBeforeInput","beforeinput",null,i,ee),ne.push({event:ee,listeners:B}),ee.data=Me))}sf(ne,t)})}function Mi(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Fo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Ce(e,i),p!=null&&l.unshift(Mi(e,p,d)),p=Ce(e,t),p!=null&&l.push(Mi(e,p,d))),e=e.return}return l}function Or(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function of(e,t,i,l,d){for(var p=t._reactName,y=[];i!==null&&i!==l;){var N=i,I=N.alternate,B=N.stateNode;if(I!==null&&I===l)break;N.tag===5&&B!==null&&(N=B,d?(I=Ce(i,p),I!=null&&y.unshift(Mi(i,I,N))):d||(I=Ce(i,p),I!=null&&y.push(Mi(i,I,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var Vv=/\r\n?/g,qv=/\u0000|\uFFFD/g;function af(e){return(typeof e=="string"?e:""+e).replace(Vv,`
|
|
38
|
-
`).replace(qv,"")}function Uo(e,t,i){if(t=af(t),af(e)!==t&&i)throw Error(r(425))}function Bo(){}var Hl=null,Vl=null;function ql(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 Gl=typeof setTimeout=="function"?setTimeout:void 0,Gv=typeof clearTimeout=="function"?clearTimeout:void 0,lf=typeof Promise=="function"?Promise:void 0,Kv=typeof queueMicrotask=="function"?queueMicrotask:typeof lf<"u"?function(e){return lf.resolve(null).then(e).catch(Yv)}:Gl;function Yv(e){setTimeout(function(){throw e})}function Kl(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),Ti(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ti(t)}function $s(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 cf(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 zr=Math.random().toString(36).slice(2),ds="__reactFiber$"+zr,Di="__reactProps$"+zr,ws="__reactContainer$"+zr,Yl="__reactEvents$"+zr,Xv="__reactListeners$"+zr,Qv="__reactHandles$"+zr;function lr(e){var t=e[ds];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ws]||i[ds]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=cf(e);e!==null;){if(i=e[ds])return i;e=cf(e)}return t}e=i,i=e.parentNode}return null}function Li(e){return e=e[ds]||e[ws],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $r(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Wo(e){return e[Di]||null}var Xl=[],Fr=-1;function Fs(e){return{current:e}}function ht(e){0>Fr||(e.current=Xl[Fr],Xl[Fr]=null,Fr--)}function dt(e,t){Fr++,Xl[Fr]=e.current,e.current=t}var Us={},rn=Fs(Us),wn=Fs(!1),cr=Us;function Ur(e,t){var i=e.type.contextTypes;if(!i)return Us;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 kn(e){return e=e.childContextTypes,e!=null}function Ho(){ht(wn),ht(rn)}function uf(e,t,i){if(rn.current!==Us)throw Error(r(168));dt(rn,t),dt(wn,i)}function df(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,Pe(e)||"Unknown",d));return H({},i,l)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Us,cr=rn.current,dt(rn,e),dt(wn,wn.current),!0}function ff(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=df(e,t,cr),l.__reactInternalMemoizedMergedChildContext=e,ht(wn),ht(rn),dt(rn,e)):ht(wn),dt(wn,i)}var ks=null,qo=!1,Ql=!1;function pf(e){ks===null?ks=[e]:ks.push(e)}function Zv(e){qo=!0,pf(e)}function Bs(){if(!Ql&&ks!==null){Ql=!0;var e=0,t=Ge;try{var i=ks;for(Ge=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ks=null,qo=!1}catch(d){throw ks!==null&&(ks=ks.slice(e+1)),vi(Ms,Bs),d}finally{Ge=t,Ql=!1}}return null}var Br=[],Wr=0,Go=null,Ko=0,$n=[],Fn=0,ur=null,Ss=1,Ts="";function dr(e,t){Br[Wr++]=Ko,Br[Wr++]=Go,Go=e,Ko=t}function hf(e,t,i){$n[Fn++]=Ss,$n[Fn++]=Ts,$n[Fn++]=ur,ur=e;var l=Ss;e=Ts;var d=32-pn(l)-1;l&=~(1<<d),i+=1;var p=32-pn(t)+d;if(30<p){var y=d-d%5;p=(l&(1<<y)-1).toString(32),l>>=y,d-=y,Ss=1<<32-pn(t)+d|i<<d|l,Ts=p+e}else Ss=1<<p|i<<d|l,Ts=e}function Zl(e){e.return!==null&&(dr(e,1),hf(e,1,0))}function Jl(e){for(;e===Go;)Go=Br[--Wr],Br[Wr]=null,Ko=Br[--Wr],Br[Wr]=null;for(;e===ur;)ur=$n[--Fn],$n[Fn]=null,Ts=$n[--Fn],$n[Fn]=null,Ss=$n[--Fn],$n[Fn]=null}var Rn=null,An=null,vt=!1,Zn=null;function mf(e,t){var i=Hn(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 gf(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,Rn=e,An=$s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rn=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=ur!==null?{id:Ss,overflow:Ts}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Hn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Rn=e,An=null,!0):!1;default:return!1}}function ec(e){return(e.mode&1)!==0&&(e.flags&128)===0}function tc(e){if(vt){var t=An;if(t){var i=t;if(!gf(e,t)){if(ec(e))throw Error(r(418));t=$s(i.nextSibling);var l=Rn;t&&gf(e,t)?mf(l,i):(e.flags=e.flags&-4097|2,vt=!1,Rn=e)}}else{if(ec(e))throw Error(r(418));e.flags=e.flags&-4097|2,vt=!1,Rn=e}}}function vf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rn=e}function Yo(e){if(e!==Rn)return!1;if(!vt)return vf(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ql(e.type,e.memoizedProps)),t&&(t=An)){if(ec(e))throw yf(),Error(r(418));for(;t;)mf(e,t),t=$s(t.nextSibling)}if(vf(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){An=$s(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}An=null}}else An=Rn?$s(e.stateNode.nextSibling):null;return!0}function yf(){for(var e=An;e;)e=$s(e.nextSibling)}function Hr(){An=Rn=null,vt=!1}function nc(e){Zn===null?Zn=[e]:Zn.push(e)}var Jv=P.ReactCurrentBatchConfig;function Pi(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(y){var N=d.refs;y===null?delete N[p]:N[p]=y},t._stringRef=p,t)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function Xo(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xf(e){var t=e._init;return t(e._payload)}function wf(e){function t(z,M){if(e){var F=z.deletions;F===null?(z.deletions=[M],z.flags|=16):F.push(M)}}function i(z,M){if(!e)return null;for(;M!==null;)t(z,M),M=M.sibling;return null}function l(z,M){for(z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function d(z,M){return z=Xs(z,M),z.index=0,z.sibling=null,z}function p(z,M,F){return z.index=F,e?(F=z.alternate,F!==null?(F=F.index,F<M?(z.flags|=2,M):F):(z.flags|=2,M)):(z.flags|=1048576,M)}function y(z){return e&&z.alternate===null&&(z.flags|=2),z}function N(z,M,F,ae){return M===null||M.tag!==6?(M=Gc(F,z.mode,ae),M.return=z,M):(M=d(M,F),M.return=z,M)}function I(z,M,F,ae){var be=F.type;return be===q?ee(z,M,F.props.children,ae,F.key):M!==null&&(M.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===ie&&xf(be)===M.type)?(ae=d(M,F.props),ae.ref=Pi(z,M,F),ae.return=z,ae):(ae=wa(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Pi(z,M,F),ae.return=z,ae)}function B(z,M,F,ae){return M===null||M.tag!==4||M.stateNode.containerInfo!==F.containerInfo||M.stateNode.implementation!==F.implementation?(M=Kc(F,z.mode,ae),M.return=z,M):(M=d(M,F.children||[]),M.return=z,M)}function ee(z,M,F,ae,be){return M===null||M.tag!==7?(M=xr(F,z.mode,ae,be),M.return=z,M):(M=d(M,F),M.return=z,M)}function ne(z,M,F){if(typeof M=="string"&&M!==""||typeof M=="number")return M=Gc(""+M,z.mode,F),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case W:return F=wa(M.type,M.key,M.props,null,z.mode,F),F.ref=Pi(z,null,M),F.return=z,F;case K:return M=Kc(M,z.mode,F),M.return=z,M;case ie:var ae=M._init;return ne(z,ae(M._payload),F)}if(yt(M)||Y(M))return M=xr(M,z.mode,F,null),M.return=z,M;Xo(z,M)}return null}function J(z,M,F,ae){var be=M!==null?M.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return be!==null?null:N(z,M,""+F,ae);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===be?I(z,M,F,ae):null;case K:return F.key===be?B(z,M,F,ae):null;case ie:return be=F._init,J(z,M,be(F._payload),ae)}if(yt(F)||Y(F))return be!==null?null:ee(z,M,F,ae,null);Xo(z,F)}return null}function fe(z,M,F,ae,be){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return z=z.get(F)||null,N(M,z,""+ae,be);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case W:return z=z.get(ae.key===null?F:ae.key)||null,I(M,z,ae,be);case K:return z=z.get(ae.key===null?F:ae.key)||null,B(M,z,ae,be);case ie:var Ie=ae._init;return fe(z,M,F,Ie(ae._payload),be)}if(yt(ae)||Y(ae))return z=z.get(F)||null,ee(M,z,ae,be,null);Xo(M,ae)}return null}function we(z,M,F,ae){for(var be=null,Ie=null,Me=M,ze=M=0,Ht=null;Me!==null&&ze<F.length;ze++){Me.index>ze?(Ht=Me,Me=null):Ht=Me.sibling;var Qe=J(z,Me,F[ze],ae);if(Qe===null){Me===null&&(Me=Ht);break}e&&Me&&Qe.alternate===null&&t(z,Me),M=p(Qe,M,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe,Me=Ht}if(ze===F.length)return i(z,Me),vt&&dr(z,ze),be;if(Me===null){for(;ze<F.length;ze++)Me=ne(z,F[ze],ae),Me!==null&&(M=p(Me,M,ze),Ie===null?be=Me:Ie.sibling=Me,Ie=Me);return vt&&dr(z,ze),be}for(Me=l(z,Me);ze<F.length;ze++)Ht=fe(Me,z,ze,F[ze],ae),Ht!==null&&(e&&Ht.alternate!==null&&Me.delete(Ht.key===null?ze:Ht.key),M=p(Ht,M,ze),Ie===null?be=Ht:Ie.sibling=Ht,Ie=Ht);return e&&Me.forEach(function(Qs){return t(z,Qs)}),vt&&dr(z,ze),be}function Se(z,M,F,ae){var be=Y(F);if(typeof be!="function")throw Error(r(150));if(F=be.call(F),F==null)throw Error(r(151));for(var Ie=be=null,Me=M,ze=M=0,Ht=null,Qe=F.next();Me!==null&&!Qe.done;ze++,Qe=F.next()){Me.index>ze?(Ht=Me,Me=null):Ht=Me.sibling;var Qs=J(z,Me,Qe.value,ae);if(Qs===null){Me===null&&(Me=Ht);break}e&&Me&&Qs.alternate===null&&t(z,Me),M=p(Qs,M,ze),Ie===null?be=Qs:Ie.sibling=Qs,Ie=Qs,Me=Ht}if(Qe.done)return i(z,Me),vt&&dr(z,ze),be;if(Me===null){for(;!Qe.done;ze++,Qe=F.next())Qe=ne(z,Qe.value,ae),Qe!==null&&(M=p(Qe,M,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe);return vt&&dr(z,ze),be}for(Me=l(z,Me);!Qe.done;ze++,Qe=F.next())Qe=fe(Me,z,ze,Qe.value,ae),Qe!==null&&(e&&Qe.alternate!==null&&Me.delete(Qe.key===null?ze:Qe.key),M=p(Qe,M,ze),Ie===null?be=Qe:Ie.sibling=Qe,Ie=Qe);return e&&Me.forEach(function(Iy){return t(z,Iy)}),vt&&dr(z,ze),be}function Mt(z,M,F,ae){if(typeof F=="object"&&F!==null&&F.type===q&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var be=F.key,Ie=M;Ie!==null;){if(Ie.key===be){if(be=F.type,be===q){if(Ie.tag===7){i(z,Ie.sibling),M=d(Ie,F.props.children),M.return=z,z=M;break e}}else if(Ie.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===ie&&xf(be)===Ie.type){i(z,Ie.sibling),M=d(Ie,F.props),M.ref=Pi(z,Ie,F),M.return=z,z=M;break e}i(z,Ie);break}else t(z,Ie);Ie=Ie.sibling}F.type===q?(M=xr(F.props.children,z.mode,ae,F.key),M.return=z,z=M):(ae=wa(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Pi(z,M,F),ae.return=z,z=ae)}return y(z);case K:e:{for(Ie=F.key;M!==null;){if(M.key===Ie)if(M.tag===4&&M.stateNode.containerInfo===F.containerInfo&&M.stateNode.implementation===F.implementation){i(z,M.sibling),M=d(M,F.children||[]),M.return=z,z=M;break e}else{i(z,M);break}else t(z,M);M=M.sibling}M=Kc(F,z.mode,ae),M.return=z,z=M}return y(z);case ie:return Ie=F._init,Mt(z,M,Ie(F._payload),ae)}if(yt(F))return we(z,M,F,ae);if(Y(F))return Se(z,M,F,ae);Xo(z,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,M!==null&&M.tag===6?(i(z,M.sibling),M=d(M,F),M.return=z,z=M):(i(z,M),M=Gc(F,z.mode,ae),M.return=z,z=M),y(z)):i(z,M)}return Mt}var Vr=wf(!0),kf=wf(!1),Qo=Fs(null),Zo=null,qr=null,sc=null;function rc(){sc=qr=Zo=null}function ic(e){var t=Qo.current;ht(Qo),e._currentValue=t}function oc(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 Gr(e,t){Zo=e,sc=qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Un(e){var t=e._currentValue;if(sc!==e)if(e={context:e,memoizedValue:t,next:null},qr===null){if(Zo===null)throw Error(r(308));qr=e,Zo.dependencies={lanes:0,firstContext:e}}else qr=qr.next=e;return t}var fr=null;function ac(e){fr===null?fr=[e]:fr.push(e)}function Sf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,ac(t)):(i.next=d.next,d.next=i),t.interleaved=i,bs(e,l)}function bs(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 Ws=!1;function lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tf(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 Ns(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hs(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,bs(e,i)}return d=l.interleaved,d===null?(t.next=t,ac(l)):(t.next=d.next,d.next=t),l.interleaved=t,bs(e,i)}function Jo(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,Ls(e,i)}}function bf(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 y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=y:p=p.next=y,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 ea(e,t,i,l){var d=e.updateQueue;Ws=!1;var p=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var I=N,B=I.next;I.next=null,y===null?p=B:y.next=B,y=I;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==y&&(N===null?ee.firstBaseUpdate=B:N.next=B,ee.lastBaseUpdate=I))}if(p!==null){var ne=d.baseState;y=0,ee=B=I=null,N=p;do{var J=N.lane,fe=N.eventTime;if((l&J)===J){ee!==null&&(ee=ee.next={eventTime:fe,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var we=e,Se=N;switch(J=t,fe=i,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ne=we.call(fe,ne,J);break e}ne=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,J=typeof we=="function"?we.call(fe,ne,J):we,J==null)break e;ne=H({},ne,J);break e;case 2:Ws=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,J=d.effects,J===null?d.effects=[N]:J.push(N))}else fe={eventTime:fe,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(B=ee=fe,I=ne):ee=ee.next=fe,y|=J;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;J=N,N=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);if(ee===null&&(I=ne),d.baseState=I,d.firstBaseUpdate=B,d.lastBaseUpdate=ee,t=d.shared.interleaved,t!==null){d=t;do y|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);mr|=y,e.lanes=y,e.memoizedState=ne}}function Nf(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 Oi={},fs=Fs(Oi),zi=Fs(Oi),$i=Fs(Oi);function pr(e){if(e===Oi)throw Error(r(174));return e}function cc(e,t){switch(dt($i,t),dt(zi,e),dt(fs,Oi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ct(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ct(t,e)}ht(fs),dt(fs,t)}function Kr(){ht(fs),ht(zi),ht($i)}function Cf(e){pr($i.current);var t=pr(fs.current),i=ct(t,e.type);t!==i&&(dt(zi,e),dt(fs,i))}function uc(e){zi.current===e&&(ht(fs),ht(zi))}var Nt=Fs(0);function ta(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 dc=[];function fc(){for(var e=0;e<dc.length;e++)dc[e]._workInProgressVersionPrimary=null;dc.length=0}var na=P.ReactCurrentDispatcher,pc=P.ReactCurrentBatchConfig,hr=0,Ct=null,Ot=null,Bt=null,sa=!1,Fi=!1,Ui=0,ey=0;function on(){throw Error(r(321))}function hc(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 mc(e,t,i,l,d,p){if(hr=p,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,na.current=e===null||e.memoizedState===null?ry:iy,e=i(l,d),Fi){p=0;do{if(Fi=!1,Ui=0,25<=p)throw Error(r(301));p+=1,Bt=Ot=null,t.updateQueue=null,na.current=oy,e=i(l,d)}while(Fi)}if(na.current=oa,t=Ot!==null&&Ot.next!==null,hr=0,Bt=Ot=Ct=null,sa=!1,t)throw Error(r(300));return e}function gc(){var e=Ui!==0;return Ui=0,e}function ps(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ct.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Bn(){if(Ot===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var t=Bt===null?Ct.memoizedState:Bt.next;if(t!==null)Bt=t,Ot=e;else{if(e===null)throw Error(r(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Bt===null?Ct.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Bi(e,t){return typeof t=="function"?t(e):t}function vc(e){var t=Bn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=Ot,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var y=d.next;d.next=p.next,p.next=y}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=y=null,I=null,B=p;do{var ee=B.lane;if((hr&ee)===ee)I!==null&&(I=I.next={lane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),l=B.hasEagerState?B.eagerState:e(l,B.action);else{var ne={lane:ee,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null};I===null?(N=I=ne,y=l):I=I.next=ne,Ct.lanes|=ee,mr|=ee}B=B.next}while(B!==null&&B!==p);I===null?y=l:I.next=N,Qn(l,t.memoizedState)||(Sn=!0),t.memoizedState=l,t.baseState=y,t.baseQueue=I,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Ct.lanes|=p,mr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function yc(e){var t=Bn(),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 y=d=d.next;do p=e(p,y.action),y=y.next;while(y!==d);Qn(p,t.memoizedState)||(Sn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function Ef(){}function _f(e,t){var i=Ct,l=Bn(),d=t(),p=!Qn(l.memoizedState,d);if(p&&(l.memoizedState=d,Sn=!0),l=l.queue,xc(Af.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Bt!==null&&Bt.memoizedState.tag&1){if(i.flags|=2048,Wi(9,Rf.bind(null,i,l,d,t),void 0,null),Wt===null)throw Error(r(349));(hr&30)!==0||jf(i,t,d)}return d}function jf(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 Rf(e,t,i,l){t.value=i,t.getSnapshot=l,If(t)&&Mf(e)}function Af(e,t,i){return i(function(){If(t)&&Mf(e)})}function If(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Qn(e,i)}catch{return!0}}function Mf(e){var t=bs(e,1);t!==null&&ns(t,e,1,-1)}function Df(e){var t=ps();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:e},t.queue=e,e=e.dispatch=sy.bind(null,Ct,e),[t.memoizedState,e]}function Wi(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 Lf(){return Bn().memoizedState}function ra(e,t,i,l){var d=ps();Ct.flags|=e,d.memoizedState=Wi(1|t,i,void 0,l===void 0?null:l)}function ia(e,t,i,l){var d=Bn();l=l===void 0?null:l;var p=void 0;if(Ot!==null){var y=Ot.memoizedState;if(p=y.destroy,l!==null&&hc(l,y.deps)){d.memoizedState=Wi(t,i,p,l);return}}Ct.flags|=e,d.memoizedState=Wi(1|t,i,p,l)}function Pf(e,t){return ra(8390656,8,e,t)}function xc(e,t){return ia(2048,8,e,t)}function Of(e,t){return ia(4,2,e,t)}function zf(e,t){return ia(4,4,e,t)}function $f(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 Ff(e,t,i){return i=i!=null?i.concat([e]):null,ia(4,4,$f.bind(null,t,e),i)}function wc(){}function Uf(e,t){var i=Bn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&hc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Bf(e,t){var i=Bn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&hc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Wf(e,t,i){return(hr&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=i):(Qn(i,t)||(i=xi(),Ct.lanes|=i,mr|=i,e.baseState=!0),t)}function ty(e,t){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var l=pc.transition;pc.transition={};try{e(!1),t()}finally{Ge=i,pc.transition=l}}function Hf(){return Bn().memoizedState}function ny(e,t,i){var l=Ks(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Vf(e))qf(t,i);else if(i=Sf(e,t,i,l),i!==null){var d=gn();ns(i,e,l,d),Gf(i,t,l)}}function sy(e,t,i){var l=Ks(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Vf(e))qf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var y=t.lastRenderedState,N=p(y,i);if(d.hasEagerState=!0,d.eagerState=N,Qn(N,y)){var I=t.interleaved;I===null?(d.next=d,ac(t)):(d.next=I.next,I.next=d),t.interleaved=d;return}}catch{}finally{}i=Sf(e,t,d,l),i!==null&&(d=gn(),ns(i,e,l,d),Gf(i,t,l))}}function Vf(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function qf(e,t){Fi=sa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Gf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ls(e,i)}}var oa={readContext:Un,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},ry={readContext:Un,useCallback:function(e,t){return ps().memoizedState=[e,t===void 0?null:t],e},useContext:Un,useEffect:Pf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,ra(4194308,4,$f.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var i=ps();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=ps();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=ny.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=ps();return e={current:e},t.memoizedState=e},useState:Df,useDebugValue:wc,useDeferredValue:function(e){return ps().memoizedState=e},useTransition:function(){var e=Df(!1),t=e[0];return e=ty.bind(null,e[1]),ps().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=ps();if(vt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Wt===null)throw Error(r(349));(hr&30)!==0||jf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,Pf(Af.bind(null,l,p,e),[e]),l.flags|=2048,Wi(9,Rf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=ps(),t=Wt.identifierPrefix;if(vt){var i=Ts,l=Ss;i=(l&~(1<<32-pn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Ui++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=ey++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},iy={readContext:Un,useCallback:Uf,useContext:Un,useEffect:xc,useImperativeHandle:Ff,useInsertionEffect:Of,useLayoutEffect:zf,useMemo:Bf,useReducer:vc,useRef:Lf,useState:function(){return vc(Bi)},useDebugValue:wc,useDeferredValue:function(e){var t=Bn();return Wf(t,Ot.memoizedState,e)},useTransition:function(){var e=vc(Bi)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Ef,useSyncExternalStore:_f,useId:Hf,unstable_isNewReconciler:!1},oy={readContext:Un,useCallback:Uf,useContext:Un,useEffect:xc,useImperativeHandle:Ff,useInsertionEffect:Of,useLayoutEffect:zf,useMemo:Bf,useReducer:yc,useRef:Lf,useState:function(){return yc(Bi)},useDebugValue:wc,useDeferredValue:function(e){var t=Bn();return Ot===null?t.memoizedState=e:Wf(t,Ot.memoizedState,e)},useTransition:function(){var e=yc(Bi)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Ef,useSyncExternalStore:_f,useId:Hf,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 kc(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 aa={isMounted:function(e){return(e=e._reactInternals)?Ee(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Ks(e),p=Ns(l,d);p.payload=t,i!=null&&(p.callback=i),t=Hs(e,p,d),t!==null&&(ns(t,e,d,l),Jo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Ks(e),p=Ns(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Hs(e,p,d),t!==null&&(ns(t,e,d,l),Jo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=gn(),l=Ks(e),d=Ns(i,l);d.tag=2,t!=null&&(d.callback=t),t=Hs(e,d,l),t!==null&&(ns(t,e,l,i),Jo(t,e,l))}};function Kf(e,t,i,l,d,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,y):t.prototype&&t.prototype.isPureReactComponent?!ji(i,l)||!ji(d,p):!0}function Yf(e,t,i){var l=!1,d=Us,p=t.contextType;return typeof p=="object"&&p!==null?p=Un(p):(d=kn(t)?cr:rn.current,l=t.contextTypes,p=(l=l!=null)?Ur(e,d):Us),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=aa,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Xf(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&&aa.enqueueReplaceState(t,t.state,null)}function Sc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},lc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Un(p):(p=kn(t)?cr:rn.current,d.context=Ur(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(kc(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&&aa.enqueueReplaceState(d,d.state,null),ea(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Yr(e,t){try{var i="",l=t;do i+=ve(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 Tc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function bc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var ay=typeof WeakMap=="function"?WeakMap:Map;function Qf(e,t,i){i=Ns(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){ha||(ha=!0,$c=l),bc(e,t)},i}function Zf(e,t,i){i=Ns(-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(){bc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){bc(e,t),typeof l!="function"&&(qs===null?qs=new Set([this]):qs.add(this));var y=t.stack;this.componentDidCatch(t.value,{componentStack:y!==null?y:""})}),i}function Jf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new ay;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=ky.bind(null,e,t,i),t.then(e,e))}function ep(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 tp(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=Ns(-1,1),t.tag=2,Hs(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var ly=P.ReactCurrentOwner,Sn=!1;function mn(e,t,i,l){t.child=e===null?kf(t,null,i,l):Vr(t,e.child,i,l)}function np(e,t,i,l,d){i=i.render;var p=t.ref;return Gr(t,d),l=mc(e,t,i,l,p,d),i=gc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Cs(e,t,d)):(vt&&i&&Zl(t),t.flags|=1,mn(e,t,l,d),t.child)}function sp(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!qc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,rp(e,t,p,l,d)):(e=wa(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 y=p.memoizedProps;if(i=i.compare,i=i!==null?i:ji,i(y,l)&&e.ref===t.ref)return Cs(e,t,d)}return t.flags|=1,e=Xs(p,l),e.ref=t.ref,e.return=t,t.child=e}function rp(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(ji(p,l)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Cs(e,t,d)}return Nc(e,t,i,l,d)}function ip(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},dt(Qr,In),In|=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,dt(Qr,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,dt(Qr,In),In|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,dt(Qr,In),In|=l;return mn(e,t,d,i),t.child}function op(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Nc(e,t,i,l,d){var p=kn(i)?cr:rn.current;return p=Ur(t,p),Gr(t,d),i=mc(e,t,i,l,p,d),l=gc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Cs(e,t,d)):(vt&&l&&Zl(t),t.flags|=1,mn(e,t,i,d),t.child)}function ap(e,t,i,l,d){if(kn(i)){var p=!0;Vo(t)}else p=!1;if(Gr(t,d),t.stateNode===null)ca(e,t),Yf(t,i,l),Sc(t,i,l,d),l=!0;else if(e===null){var y=t.stateNode,N=t.memoizedProps;y.props=N;var I=y.context,B=i.contextType;typeof B=="object"&&B!==null?B=Un(B):(B=kn(i)?cr:rn.current,B=Ur(t,B));var ee=i.getDerivedStateFromProps,ne=typeof ee=="function"||typeof y.getSnapshotBeforeUpdate=="function";ne||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==l||I!==B)&&Xf(t,y,l,B),Ws=!1;var J=t.memoizedState;y.state=J,ea(t,l,y,d),I=t.memoizedState,N!==l||J!==I||wn.current||Ws?(typeof ee=="function"&&(kc(t,i,ee,l),I=t.memoizedState),(N=Ws||Kf(t,i,N,l,J,I,B))?(ne||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(t.flags|=4194308)):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=I),y.props=l,y.state=I,y.context=B,l=N):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{y=t.stateNode,Tf(e,t),N=t.memoizedProps,B=t.type===t.elementType?N:Jn(t.type,N),y.props=B,ne=t.pendingProps,J=y.context,I=i.contextType,typeof I=="object"&&I!==null?I=Un(I):(I=kn(i)?cr:rn.current,I=Ur(t,I));var fe=i.getDerivedStateFromProps;(ee=typeof fe=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==ne||J!==I)&&Xf(t,y,l,I),Ws=!1,J=t.memoizedState,y.state=J,ea(t,l,y,d);var we=t.memoizedState;N!==ne||J!==we||wn.current||Ws?(typeof fe=="function"&&(kc(t,i,fe,l),we=t.memoizedState),(B=Ws||Kf(t,i,B,l,J,we,I)||!1)?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,we,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,we,I)),typeof y.componentDidUpdate=="function"&&(t.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=we),y.props=l,y.state=we,y.context=I,l=B):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),l=!1)}return Cc(e,t,i,l,p,d)}function Cc(e,t,i,l,d,p){op(e,t);var y=(t.flags&128)!==0;if(!l&&!y)return d&&ff(t,i,!1),Cs(e,t,p);l=t.stateNode,ly.current=t;var N=y&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&y?(t.child=Vr(t,e.child,null,p),t.child=Vr(t,null,N,p)):mn(e,t,N,p),t.memoizedState=l.state,d&&ff(t,i,!0),t.child}function lp(e){var t=e.stateNode;t.pendingContext?uf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uf(e,t.context,!1),cc(e,t.containerInfo)}function cp(e,t,i,l,d){return Hr(),nc(d),t.flags|=256,mn(e,t,i,l),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0};function _c(e){return{baseLanes:e,cachePool:null,transitions:null}}function up(e,t,i){var l=t.pendingProps,d=Nt.current,p=!1,y=(t.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),dt(Nt,d&1),e===null)return tc(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):(y=l.children,e=l.fallback,p?(l=t.mode,p=t.child,y={mode:"hidden",children:y},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=y):p=ka(y,l,0,null),e=xr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=_c(i),t.memoizedState=Ec,e):jc(t,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return cy(e,t,y,l,N,d,i);if(p){p=l.fallback,y=t.mode,d=e.child,N=d.sibling;var I={mode:"hidden",children:l.children};return(y&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=I,t.deletions=null):(l=Xs(d,I),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=Xs(N,p):(p=xr(p,y,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,y=e.child.memoizedState,y=y===null?_c(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},p.memoizedState=y,p.childLanes=e.childLanes&~i,t.memoizedState=Ec,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 jc(e,t){return t=ka({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function la(e,t,i,l){return l!==null&&nc(l),Vr(t,e.child,null,i),e=jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cy(e,t,i,l,d,p,y){if(i)return t.flags&256?(t.flags&=-257,l=Tc(Error(r(422))),la(e,t,y,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ka({mode:"visible",children:l.children},d,0,null),p=xr(p,d,y,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Vr(t,e.child,null,y),t.child.memoizedState=_c(y),t.memoizedState=Ec,p);if((t.mode&1)===0)return la(e,t,y,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(r(419)),l=Tc(p,l,void 0),la(e,t,y,l)}if(N=(y&e.childLanes)!==0,Sn||N){if(l=Wt,l!==null){switch(y&-y){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|y))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,bs(e,d),ns(l,e,d,-1))}return Vc(),l=Tc(Error(r(421))),la(e,t,y,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=Sy.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,An=$s(d.nextSibling),Rn=t,vt=!0,Zn=null,e!==null&&($n[Fn++]=Ss,$n[Fn++]=Ts,$n[Fn++]=ur,Ss=e.id,Ts=e.overflow,ur=t),t=jc(t,l.children),t.flags|=4096,t)}function dp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),oc(e.return,t,i)}function Rc(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 fp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(mn(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&&dp(e,i,t);else if(e.tag===19)dp(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(dt(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&&ta(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Rc(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&&ta(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Rc(t,!0,i,null,p);break;case"together":Rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ca(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Cs(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),mr|=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 uy(e,t,i){switch(t.tag){case 3:lp(t),Hr();break;case 5:Cf(t);break;case 1:kn(t.type)&&Vo(t);break;case 4:cc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;dt(Qo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(dt(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?up(e,t,i):(dt(Nt,Nt.current&1),e=Cs(e,t,i),e!==null?e.sibling:null);dt(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return fp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),dt(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,ip(e,t,i)}return Cs(e,t,i)}var pp,Ac,hp,mp;pp=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}},Ac=function(){},hp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,pr(fs.current);var p=null;switch(i){case"input":d=Fe(e,d),l=Fe(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=Ft(e,d),l=Ft(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Bo)}un(i,l);var y;i=null;for(B in d)if(!l.hasOwnProperty(B)&&d.hasOwnProperty(B)&&d[B]!=null)if(B==="style"){var N=d[B];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}else B!=="dangerouslySetInnerHTML"&&B!=="children"&&B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(a.hasOwnProperty(B)?p||(p=[]):(p=p||[]).push(B,null));for(B in l){var I=l[B];if(N=d!=null?d[B]:void 0,l.hasOwnProperty(B)&&I!==N&&(I!=null||N!=null))if(B==="style")if(N){for(y in N)!N.hasOwnProperty(y)||I&&I.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in I)I.hasOwnProperty(y)&&N[y]!==I[y]&&(i||(i={}),i[y]=I[y])}else i||(p||(p=[]),p.push(B,i)),i=I;else B==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,N=N?N.__html:void 0,I!=null&&N!==I&&(p=p||[]).push(B,I)):B==="children"?typeof I!="string"&&typeof I!="number"||(p=p||[]).push(B,""+I):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&(a.hasOwnProperty(B)?(I!=null&&B==="onScroll"&&pt("scroll",e),p||N===I||(p=[])):(p=p||[]).push(B,I))}i&&(p=p||[]).push("style",i);var B=p;(t.updateQueue=B)&&(t.flags|=4)}},mp=function(e,t,i,l){i!==l&&(t.flags|=4)};function Hi(e,t){if(!vt)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 an(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 dy(e,t,i){var l=t.pendingProps;switch(Jl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return kn(t.type)&&Ho(),an(t),null;case 3:return l=t.stateNode,Kr(),ht(wn),ht(rn),fc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Yo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zn!==null&&(Bc(Zn),Zn=null))),Ac(e,t),an(t),null;case 5:uc(t);var d=pr($i.current);if(i=t.type,e!==null&&t.stateNode!=null)hp(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 an(t),null}if(e=pr(fs.current),Yo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[ds]=t,l[Di]=p,e=(t.mode&1)!==0,i){case"dialog":pt("cancel",l),pt("close",l);break;case"iframe":case"object":case"embed":pt("load",l);break;case"video":case"audio":for(d=0;d<Ai.length;d++)pt(Ai[d],l);break;case"source":pt("error",l);break;case"img":case"image":case"link":pt("error",l),pt("load",l);break;case"details":pt("toggle",l);break;case"input":_t(l,p),pt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},pt("invalid",l);break;case"textarea":V(l,p),pt("invalid",l)}un(i,p),d=null;for(var y in p)if(p.hasOwnProperty(y)){var N=p[y];y==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&Uo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Uo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&pt("scroll",l)}switch(i){case"input":st(l),On(l,p,!0);break;case"textarea":st(l),Be(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Bo)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{y=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Je(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=y.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=y.createElement(i,{is:l.is}):(e=y.createElement(i),i==="select"&&(y=e,l.multiple?y.multiple=!0:l.size&&(y.size=l.size))):e=y.createElementNS(e,i),e[ds]=t,e[Di]=l,pp(e,t,!1,!1),t.stateNode=e;e:{switch(y=zn(i,l),i){case"dialog":pt("cancel",e),pt("close",e),d=l;break;case"iframe":case"object":case"embed":pt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ai.length;d++)pt(Ai[d],e);d=l;break;case"source":pt("error",e),d=l;break;case"img":case"image":case"link":pt("error",e),pt("load",e),d=l;break;case"details":pt("toggle",e),d=l;break;case"input":_t(e,l),d=Fe(e,l),pt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),pt("invalid",e);break;case"textarea":V(e,l),d=Ft(e,l),pt("invalid",e);break;default:d=l}un(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var I=N[p];p==="style"?ys(e,I):p==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&>(e,I)):p==="children"?typeof I=="string"?(i!=="textarea"||I!=="")&&Xt(e,I):typeof I=="number"&&Xt(e,""+I):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?I!=null&&p==="onScroll"&&pt("scroll",e):I!=null&&U(e,p,I,y))}switch(i){case"input":st(e),On(e,l,!1);break;case"textarea":st(e),Be(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Re(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?lt(e,!!l.multiple,p,!1):l.defaultValue!=null&<(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Bo)}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 an(t),null;case 6:if(e&&t.stateNode!=null)mp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=pr($i.current),pr(fs.current),Yo(t)){if(l=t.stateNode,i=t.memoizedProps,l[ds]=t,(p=l.nodeValue!==i)&&(e=Rn,e!==null))switch(e.tag){case 3:Uo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Uo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[ds]=t,t.stateNode=l}return an(t),null;case 13:if(ht(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&An!==null&&(t.mode&1)!==0&&(t.flags&128)===0)yf(),Hr(),t.flags|=98560,p=!1;else if(p=Yo(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[ds]=t}else Hr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;an(t),p=!1}else Zn!==null&&(Bc(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?zt===0&&(zt=3):Vc())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Kr(),Ac(e,t),e===null&&Ii(t.stateNode.containerInfo),an(t),null;case 10:return ic(t.type._context),an(t),null;case 17:return kn(t.type)&&Ho(),an(t),null;case 19:if(ht(Nt),p=t.memoizedState,p===null)return an(t),null;if(l=(t.flags&128)!==0,y=p.rendering,y===null)if(l)Hi(p,!1);else{if(zt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(y=ta(e),y!==null){for(t.flags|=128,Hi(p,!1),l=y.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,y=p.alternate,y===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=y.childLanes,p.lanes=y.lanes,p.child=y.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=y.memoizedProps,p.memoizedState=y.memoizedState,p.updateQueue=y.updateQueue,p.type=y.type,e=y.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return dt(Nt,Nt.current&1|2),t.child}e=e.sibling}p.tail!==null&&St()>Zr&&(t.flags|=128,l=!0,Hi(p,!1),t.lanes=4194304)}else{if(!l)if(e=ta(y),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Hi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!vt)return an(t),null}else 2*St()-p.renderingStartTime>Zr&&i!==1073741824&&(t.flags|=128,l=!0,Hi(p,!1),t.lanes=4194304);p.isBackwards?(y.sibling=t.child,t.child=y):(i=p.last,i!==null?i.sibling=y:t.child=y,p.last=y)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=St(),t.sibling=null,i=Nt.current,dt(Nt,l?i&1|2:i&1),t):(an(t),null);case 22:case 23:return Hc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(In&1073741824)!==0&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function fy(e,t){switch(Jl(t),t.tag){case 1:return kn(t.type)&&Ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),ht(wn),ht(rn),fc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return uc(t),null;case 13:if(ht(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Hr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(Nt),null;case 4:return Kr(),null;case 10:return ic(t.type._context),null;case 22:case 23:return Hc(),null;case 24:return null;default:return null}}var ua=!1,ln=!1,py=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Xr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Rt(e,t,l)}else i.current=null}function Ic(e,t,i){try{i()}catch(l){Rt(e,t,l)}}var gp=!1;function hy(e,t){if(Hl=Ro,e=Gd(),Pl(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 y=0,N=-1,I=-1,B=0,ee=0,ne=e,J=null;t:for(;;){for(var fe;ne!==i||d!==0&&ne.nodeType!==3||(N=y+d),ne!==p||l!==0&&ne.nodeType!==3||(I=y+l),ne.nodeType===3&&(y+=ne.nodeValue.length),(fe=ne.firstChild)!==null;)J=ne,ne=fe;for(;;){if(ne===e)break t;if(J===i&&++B===d&&(N=y),J===p&&++ee===l&&(I=y),(fe=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=fe}i=N===-1||I===-1?null:{start:N,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(Vl={focusedElem:e,selectionRange:i},Ro=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var we=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,Mt=we.memoizedState,z=t.stateNode,M=z.getSnapshotBeforeUpdate(t.elementType===t.type?Se:Jn(t.type,Se),Mt);z.__reactInternalSnapshotBeforeUpdate=M}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(ae){Rt(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return we=gp,gp=!1,we}function Vi(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&&Ic(t,i,p)}d=d.next}while(d!==l)}}function da(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 Mc(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 vp(e){var t=e.alternate;t!==null&&(e.alternate=null,vp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ds],delete t[Di],delete t[Yl],delete t[Xv],delete t[Qv])),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 yp(e){return e.tag===5||e.tag===3||e.tag===4}function xp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(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 Dc(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=Bo));else if(l!==4&&(e=e.child,e!==null))for(Dc(e,t,i),e=e.sibling;e!==null;)Dc(e,t,i),e=e.sibling}function Lc(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(Lc(e,t,i),e=e.sibling;e!==null;)Lc(e,t,i),e=e.sibling}var Qt=null,es=!1;function Vs(e,t,i){for(i=i.child;i!==null;)wp(e,t,i),i=i.sibling}function wp(e,t,i){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(sr,i)}catch{}switch(i.tag){case 5:ln||Xr(i,t);case 6:var l=Qt,d=es;Qt=null,Vs(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?Kl(e.parentNode,i):e.nodeType===1&&Kl(e,i),Ti(e)):Kl(Qt,i.stateNode));break;case 4:l=Qt,d=es,Qt=i.stateNode.containerInfo,es=!0,Vs(e,t,i),Qt=l,es=d;break;case 0:case 11:case 14:case 15:if(!ln&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,y=p.destroy;p=p.tag,y!==void 0&&((p&2)!==0||(p&4)!==0)&&Ic(i,t,y),d=d.next}while(d!==l)}Vs(e,t,i);break;case 1:if(!ln&&(Xr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){Rt(i,t,N)}Vs(e,t,i);break;case 21:Vs(e,t,i);break;case 22:i.mode&1?(ln=(l=ln)||i.memoizedState!==null,Vs(e,t,i),ln=l):Vs(e,t,i);break;default:Vs(e,t,i)}}function kp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new py),t.forEach(function(l){var d=Ty.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,y=t,N=y;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));wp(p,y,d),Qt=null,es=!1;var I=d.alternate;I!==null&&(I.return=null),d.return=null}catch(B){Rt(d,t,B)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Sp(t,e),t=t.sibling}function Sp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ts(t,e),hs(e),l&4){try{Vi(3,e,e.return),da(3,e)}catch(Se){Rt(e,e.return,Se)}try{Vi(5,e,e.return)}catch(Se){Rt(e,e.return,Se)}}break;case 1:ts(t,e),hs(e),l&512&&i!==null&&Xr(i,i.return);break;case 5:if(ts(t,e),hs(e),l&512&&i!==null&&Xr(i,i.return),e.flags&32){var d=e.stateNode;try{Xt(d,"")}catch(Se){Rt(e,e.return,Se)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,y=i!==null?i.memoizedProps:p,N=e.type,I=e.updateQueue;if(e.updateQueue=null,I!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Ue(d,p),zn(N,y);var B=zn(N,p);for(y=0;y<I.length;y+=2){var ee=I[y],ne=I[y+1];ee==="style"?ys(d,ne):ee==="dangerouslySetInnerHTML"?gt(d,ne):ee==="children"?Xt(d,ne):U(d,ee,ne,B)}switch(N){case"input":Yt(d,p);break;case"textarea":me(d,p);break;case"select":var J=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var fe=p.value;fe!=null?lt(d,!!p.multiple,fe,!1):J!==!!p.multiple&&(p.defaultValue!=null?lt(d,!!p.multiple,p.defaultValue,!0):lt(d,!!p.multiple,p.multiple?[]:"",!1))}d[Di]=p}catch(Se){Rt(e,e.return,Se)}}break;case 6:if(ts(t,e),hs(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(Se){Rt(e,e.return,Se)}}break;case 3:if(ts(t,e),hs(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ti(t.containerInfo)}catch(Se){Rt(e,e.return,Se)}break;case 4:ts(t,e),hs(e);break;case 13:ts(t,e),hs(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(zc=St())),l&4&&kp(e);break;case 22:if(ee=i!==null&&i.memoizedState!==null,e.mode&1?(ln=(B=ln)||ee,ts(t,e),ln=B):ts(t,e),hs(e),l&8192){if(B=e.memoizedState!==null,(e.stateNode.isHidden=B)&&!ee&&(e.mode&1)!==0)for(ye=e,ee=e.child;ee!==null;){for(ne=ye=ee;ye!==null;){switch(J=ye,fe=J.child,J.tag){case 0:case 11:case 14:case 15:Vi(4,J,J.return);break;case 1:Xr(J,J.return);var we=J.stateNode;if(typeof we.componentWillUnmount=="function"){l=J,i=J.return;try{t=l,we.props=t.memoizedProps,we.state=t.memoizedState,we.componentWillUnmount()}catch(Se){Rt(l,i,Se)}}break;case 5:Xr(J,J.return);break;case 22:if(J.memoizedState!==null){Np(ne);continue}}fe!==null?(fe.return=J,ye=fe):Np(ne)}ee=ee.sibling}e:for(ee=null,ne=e;;){if(ne.tag===5){if(ee===null){ee=ne;try{d=ne.stateNode,B?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=ne.stateNode,I=ne.memoizedProps.style,y=I!=null&&I.hasOwnProperty("display")?I.display:null,N.style.display=En("display",y))}catch(Se){Rt(e,e.return,Se)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=B?"":ne.memoizedProps}catch(Se){Rt(e,e.return,Se)}}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;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:ts(t,e),hs(e),l&4&&kp(e);break;case 21:break;default:ts(t,e),hs(e)}}function hs(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(yp(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&&(Xt(d,""),l.flags&=-33);var p=xp(e);Lc(e,p,d);break;case 3:case 4:var y=l.stateNode.containerInfo,N=xp(e);Dc(e,N,y);break;default:throw Error(r(161))}}catch(I){Rt(e,e.return,I)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function my(e,t,i){ye=e,Tp(e)}function Tp(e,t,i){for(var l=(e.mode&1)!==0;ye!==null;){var d=ye,p=d.child;if(d.tag===22&&l){var y=d.memoizedState!==null||ua;if(!y){var N=d.alternate,I=N!==null&&N.memoizedState!==null||ln;N=ua;var B=ln;if(ua=y,(ln=I)&&!B)for(ye=d;ye!==null;)y=ye,I=y.child,y.tag===22&&y.memoizedState!==null?Cp(d):I!==null?(I.return=y,ye=I):Cp(d);for(;p!==null;)ye=p,Tp(p),p=p.sibling;ye=d,ua=N,ln=B}bp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ye=p):bp(e)}}function bp(e){for(;ye!==null;){var t=ye;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ln||da(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ln)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&&Nf(t,p,l);break;case 3:var y=t.updateQueue;if(y!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Nf(t,y,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var I=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&i.focus();break;case"img":I.src&&(i.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var B=t.alternate;if(B!==null){var ee=B.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Ti(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ln||t.flags&512&&Mc(t)}catch(J){Rt(t,t.return,J)}}if(t===e){ye=null;break}if(i=t.sibling,i!==null){i.return=t.return,ye=i;break}ye=t.return}}function Np(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var i=t.sibling;if(i!==null){i.return=t.return,ye=i;break}ye=t.return}}function Cp(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{da(4,t)}catch(I){Rt(t,i,I)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(I){Rt(t,d,I)}}var p=t.return;try{Mc(t)}catch(I){Rt(t,p,I)}break;case 5:var y=t.return;try{Mc(t)}catch(I){Rt(t,y,I)}}}catch(I){Rt(t,t.return,I)}if(t===e){ye=null;break}var N=t.sibling;if(N!==null){N.return=t.return,ye=N;break}ye=t.return}}var gy=Math.ceil,fa=P.ReactCurrentDispatcher,Pc=P.ReactCurrentOwner,Wn=P.ReactCurrentBatchConfig,Ye=0,Wt=null,Lt=null,Zt=0,In=0,Qr=Fs(0),zt=0,qi=null,mr=0,pa=0,Oc=0,Gi=null,Tn=null,zc=0,Zr=1/0,Es=null,ha=!1,$c=null,qs=null,ma=!1,Gs=null,ga=0,Ki=0,Fc=null,va=-1,ya=0;function gn(){return(Ye&6)!==0?St():va!==-1?va:va=St()}function Ks(e){return(e.mode&1)===0?1:(Ye&2)!==0&&Zt!==0?Zt&-Zt:Jv.transition!==null?(ya===0&&(ya=xi()),ya):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:Ed(e.type)),e)}function ns(e,t,i,l){if(50<Ki)throw Ki=0,Fc=null,Error(r(185));ar(e,i,l),((Ye&2)===0||e!==Wt)&&(e===Wt&&((Ye&2)===0&&(pa|=i),zt===4&&Ys(e,Zt)),bn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(Zr=St()+500,qo&&Bs()))}function bn(e,t){var i=e.callbackNode;Eo(e,t);var l=or(e,e===Wt?Zt:0);if(l===0)i!==null&&bo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&bo(i),t===1)e.tag===0?Zv(_p.bind(null,e)):pf(_p.bind(null,e)),Kv(function(){(Ye&6)===0&&Bs()}),i=null;else{switch(oe(l)){case 1:i=Ms;break;case 4:i=us;break;case 16:i=_r;break;case 536870912:i=No;break;default:i=_r}i=Pp(i,Ep.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function Ep(e,t){if(va=-1,ya=0,(Ye&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Jr()&&e.callbackNode!==i)return null;var l=or(e,e===Wt?Zt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=xa(e,l);else{t=l;var d=Ye;Ye|=2;var p=Rp();(Wt!==e||Zt!==t)&&(Es=null,Zr=St()+500,vr(e,t));do try{xy();break}catch(N){jp(e,N)}while(!0);rc(),fa.current=p,Ye=d,Lt!==null?t=0:(Wt=null,Zt=0,t=zt)}if(t!==0){if(t===2&&(d=yi(e),d!==0&&(l=d,t=Uc(e,d))),t===1)throw i=qi,vr(e,0),Ys(e,l),bn(e,St()),i;if(t===6)Ys(e,l);else{if(d=e.current.alternate,(l&30)===0&&!vy(d)&&(t=xa(e,l),t===2&&(p=yi(e),p!==0&&(l=p,t=Uc(e,p))),t===1))throw i=qi,vr(e,0),Ys(e,l),bn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:yr(e,Tn,Es);break;case 3:if(Ys(e,l),(l&130023424)===l&&(t=zc+500-St(),10<t)){if(or(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){gn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Gl(yr.bind(null,e,Tn,Es),t);break}yr(e,Tn,Es);break;case 4:if(Ys(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var y=31-pn(l);p=1<<y,y=t[y],y>d&&(d=y),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*gy(l/1960))-l,10<l){e.timeoutHandle=Gl(yr.bind(null,e,Tn,Es),l);break}yr(e,Tn,Es);break;case 5:yr(e,Tn,Es);break;default:throw Error(r(329))}}}return bn(e,St()),e.callbackNode===i?Ep.bind(null,e):null}function Uc(e,t){var i=Gi;return e.current.memoizedState.isDehydrated&&(vr(e,t).flags|=256),e=xa(e,t),e!==2&&(t=Tn,Tn=i,t!==null&&Bc(t)),e}function Bc(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function vy(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 Ys(e,t){for(t&=~Oc,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-pn(t),l=1<<i;e[i]=-1,t&=~l}}function _p(e){if((Ye&6)!==0)throw Error(r(327));Jr();var t=or(e,0);if((t&1)===0)return bn(e,St()),null;var i=xa(e,t);if(e.tag!==0&&i===2){var l=yi(e);l!==0&&(t=l,i=Uc(e,l))}if(i===1)throw i=qi,vr(e,0),Ys(e,t),bn(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yr(e,Tn,Es),bn(e,St()),null}function Wc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(Zr=St()+500,qo&&Bs())}}function gr(e){Gs!==null&&Gs.tag===0&&(Ye&6)===0&&Jr();var t=Ye;Ye|=1;var i=Wn.transition,l=Ge;try{if(Wn.transition=null,Ge=1,e)return e()}finally{Ge=l,Wn.transition=i,Ye=t,(Ye&6)===0&&Bs()}}function Hc(){In=Qr.current,ht(Qr)}function vr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Gv(i)),Lt!==null)for(i=Lt.return;i!==null;){var l=i;switch(Jl(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Ho();break;case 3:Kr(),ht(wn),ht(rn),fc();break;case 5:uc(l);break;case 4:Kr();break;case 13:ht(Nt);break;case 19:ht(Nt);break;case 10:ic(l.type._context);break;case 22:case 23:Hc()}i=i.return}if(Wt=e,Lt=e=Xs(e.current,null),Zt=In=t,zt=0,qi=null,Oc=pa=mr=0,Tn=Gi=null,fr!==null){for(t=0;t<fr.length;t++)if(i=fr[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var y=p.next;p.next=d,l.next=y}i.pending=l}fr=null}return e}function jp(e,t){do{var i=Lt;try{if(rc(),na.current=oa,sa){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}sa=!1}if(hr=0,Bt=Ot=Ct=null,Fi=!1,Ui=0,Pc.current=null,i===null||i.return===null){zt=1,qi=t,Lt=null;break}e:{var p=e,y=i.return,N=i,I=t;if(t=Zt,N.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var B=I,ee=N,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var fe=ep(y);if(fe!==null){fe.flags&=-257,tp(fe,y,N,p,t),fe.mode&1&&Jf(p,B,t),t=fe,I=B;var we=t.updateQueue;if(we===null){var Se=new Set;Se.add(I),t.updateQueue=Se}else we.add(I);break e}else{if((t&1)===0){Jf(p,B,t),Vc();break e}I=Error(r(426))}}else if(vt&&N.mode&1){var Mt=ep(y);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),tp(Mt,y,N,p,t),nc(Yr(I,N));break e}}p=I=Yr(I,N),zt!==4&&(zt=2),Gi===null?Gi=[p]:Gi.push(p),p=y;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var z=Qf(p,I,t);bf(p,z);break e;case 1:N=I;var M=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(qs===null||!qs.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var ae=Zf(p,N,t);bf(p,ae);break e}}p=p.return}while(p!==null)}Ip(i)}catch(be){t=be,Lt===i&&i!==null&&(Lt=i=i.return);continue}break}while(!0)}function Rp(){var e=fa.current;return fa.current=oa,e===null?oa:e}function Vc(){(zt===0||zt===3||zt===2)&&(zt=4),Wt===null||(mr&268435455)===0&&(pa&268435455)===0||Ys(Wt,Zt)}function xa(e,t){var i=Ye;Ye|=2;var l=Rp();(Wt!==e||Zt!==t)&&(Es=null,vr(e,t));do try{yy();break}catch(d){jp(e,d)}while(!0);if(rc(),Ye=i,fa.current=l,Lt!==null)throw Error(r(261));return Wt=null,Zt=0,zt}function yy(){for(;Lt!==null;)Ap(Lt)}function xy(){for(;Lt!==null&&!Tl();)Ap(Lt)}function Ap(e){var t=Lp(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?Ip(e):Lt=t,Pc.current=null}function Ip(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=dy(i,t,In),i!==null){Lt=i;return}}else{if(i=fy(i,t),i!==null){i.flags&=32767,Lt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zt=6,Lt=null;return}}if(t=t.sibling,t!==null){Lt=t;return}Lt=t=e}while(t!==null);zt===0&&(zt=5)}function yr(e,t,i){var l=Ge,d=Wn.transition;try{Wn.transition=null,Ge=1,wy(e,t,i,l)}finally{Wn.transition=d,Ge=l}return null}function wy(e,t,i,l){do Jr();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(_o(e,p),e===Wt&&(Lt=Wt=null,Zt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ma||(ma=!0,Pp(_r,function(){return Jr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Wn.transition,Wn.transition=null;var y=Ge;Ge=1;var N=Ye;Ye|=4,Pc.current=null,hy(e,i),Sp(i,e),Fv(Vl),Ro=!!Hl,Vl=Hl=null,e.current=i,my(i),bl(),Ye=N,Ge=y,Wn.transition=p}else e.current=i;if(ma&&(ma=!1,Gs=e,ga=d),p=e.pendingLanes,p===0&&(qs=null),jr(i.stateNode),bn(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(ha)throw ha=!1,e=$c,$c=null,e;return(ga&1)!==0&&e.tag!==0&&Jr(),p=e.pendingLanes,(p&1)!==0?e===Fc?Ki++:(Ki=0,Fc=e):Ki=0,Bs(),null}function Jr(){if(Gs!==null){var e=oe(ga),t=Wn.transition,i=Ge;try{if(Wn.transition=null,Ge=16>e?16:e,Gs===null)var l=!1;else{if(e=Gs,Gs=null,ga=0,(Ye&6)!==0)throw Error(r(331));var d=Ye;for(Ye|=4,ye=e.current;ye!==null;){var p=ye,y=p.child;if((ye.flags&16)!==0){var N=p.deletions;if(N!==null){for(var I=0;I<N.length;I++){var B=N[I];for(ye=B;ye!==null;){var ee=ye;switch(ee.tag){case 0:case 11:case 15:Vi(8,ee,p)}var ne=ee.child;if(ne!==null)ne.return=ee,ye=ne;else for(;ye!==null;){ee=ye;var J=ee.sibling,fe=ee.return;if(vp(ee),ee===B){ye=null;break}if(J!==null){J.return=fe,ye=J;break}ye=fe}}}var we=p.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var Mt=Se.sibling;Se.sibling=null,Se=Mt}while(Se!==null)}}ye=p}}if((p.subtreeFlags&2064)!==0&&y!==null)y.return=p,ye=y;else e:for(;ye!==null;){if(p=ye,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Vi(9,p,p.return)}var z=p.sibling;if(z!==null){z.return=p.return,ye=z;break e}ye=p.return}}var M=e.current;for(ye=M;ye!==null;){y=ye;var F=y.child;if((y.subtreeFlags&2064)!==0&&F!==null)F.return=y,ye=F;else e:for(y=M;ye!==null;){if(N=ye,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:da(9,N)}}catch(be){Rt(N,N.return,be)}if(N===y){ye=null;break e}var ae=N.sibling;if(ae!==null){ae.return=N.return,ye=ae;break e}ye=N.return}}if(Ye=d,Bs(),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(sr,e)}catch{}l=!0}return l}finally{Ge=i,Wn.transition=t}}return!1}function Mp(e,t,i){t=Yr(i,t),t=Qf(e,t,1),e=Hs(e,t,1),t=gn(),e!==null&&(ar(e,1,t),bn(e,t))}function Rt(e,t,i){if(e.tag===3)Mp(e,e,i);else for(;t!==null;){if(t.tag===3){Mp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(qs===null||!qs.has(l))){e=Yr(i,e),e=Zf(t,e,1),t=Hs(t,e,1),e=gn(),t!==null&&(ar(t,1,e),bn(t,e));break}}t=t.return}}function ky(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=gn(),e.pingedLanes|=e.suspendedLanes&i,Wt===e&&(Zt&i)===i&&(zt===4||zt===3&&(Zt&130023424)===Zt&&500>St()-zc?vr(e,0):Oc|=i),bn(e,t)}function Dp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ar,Ar<<=1,(Ar&130023424)===0&&(Ar=4194304)));var i=gn();e=bs(e,t),e!==null&&(ar(e,t,i),bn(e,i))}function Sy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Dp(e,i)}function Ty(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),Dp(e,i)}var Lp;Lp=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||wn.current)Sn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return Sn=!1,uy(e,t,i);Sn=(e.flags&131072)!==0}else Sn=!1,vt&&(t.flags&1048576)!==0&&hf(t,Ko,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;ca(e,t),e=t.pendingProps;var d=Ur(t,rn.current);Gr(t,i),d=mc(null,t,l,e,d,i);var p=gc();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,kn(l)?(p=!0,Vo(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,lc(t),d.updater=aa,t.stateNode=d,d._reactInternals=t,Sc(t,l,e,i),t=Cc(null,t,l,!0,p,i)):(t.tag=0,vt&&p&&Zl(t),mn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(ca(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Ny(l),e=Jn(l,e),d){case 0:t=Nc(null,t,l,e,i);break e;case 1:t=ap(null,t,l,e,i);break e;case 11:t=np(null,t,l,e,i);break e;case 14:t=sp(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),Nc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),ap(e,t,l,d,i);case 3:e:{if(lp(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,Tf(e,t),ea(t,l,null,i);var y=t.memoizedState;if(l=y.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Yr(Error(r(423)),t),t=cp(e,t,l,i,d);break e}else if(l!==d){d=Yr(Error(r(424)),t),t=cp(e,t,l,i,d);break e}else for(An=$s(t.stateNode.containerInfo.firstChild),Rn=t,vt=!0,Zn=null,i=kf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Hr(),l===d){t=Cs(e,t,i);break e}mn(e,t,l,i)}t=t.child}return t;case 5:return Cf(t),e===null&&tc(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,y=d.children,ql(l,d)?y=null:p!==null&&ql(l,p)&&(t.flags|=32),op(e,t),mn(e,t,y,i),t.child;case 6:return e===null&&tc(t),null;case 13:return up(e,t,i);case 4:return cc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Vr(t,null,l,i):mn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),np(e,t,l,d,i);case 7:return mn(e,t,t.pendingProps,i),t.child;case 8:return mn(e,t,t.pendingProps.children,i),t.child;case 12:return mn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,y=d.value,dt(Qo,l._currentValue),l._currentValue=y,p!==null)if(Qn(p.value,y)){if(p.children===d.children&&!wn.current){t=Cs(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){y=p.child;for(var I=N.firstContext;I!==null;){if(I.context===l){if(p.tag===1){I=Ns(-1,i&-i),I.tag=2;var B=p.updateQueue;if(B!==null){B=B.shared;var ee=B.pending;ee===null?I.next=I:(I.next=ee.next,ee.next=I),B.pending=I}}p.lanes|=i,I=p.alternate,I!==null&&(I.lanes|=i),oc(p.return,i,t),N.lanes|=i;break}I=I.next}}else if(p.tag===10)y=p.type===t.type?null:p.child;else if(p.tag===18){if(y=p.return,y===null)throw Error(r(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),oc(y,i,t),y=p.sibling}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===t){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}mn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Gr(t,i),d=Un(d),l=l(d),t.flags|=1,mn(e,t,l,i),t.child;case 14:return l=t.type,d=Jn(l,t.pendingProps),d=Jn(l.type,d),sp(e,t,l,d,i);case 15:return rp(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),ca(e,t),t.tag=1,kn(l)?(e=!0,Vo(t)):e=!1,Gr(t,i),Yf(t,l,d),Sc(t,l,d,i),Cc(null,t,l,!0,e,i);case 19:return fp(e,t,i);case 22:return ip(e,t,i)}throw Error(r(156,t.tag))};function Pp(e,t){return vi(e,t)}function by(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 Hn(e,t,i,l){return new by(e,t,i,l)}function qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ny(e){if(typeof e=="function")return qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===de)return 11;if(e===te)return 14}return 2}function Xs(e,t){var i=e.alternate;return i===null?(i=Hn(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 wa(e,t,i,l,d,p){var y=2;if(l=e,typeof e=="function")qc(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case q:return xr(i.children,d,p,t);case G:y=8,d|=8;break;case ce:return e=Hn(12,i,t,d|2),e.elementType=ce,e.lanes=p,e;case he:return e=Hn(13,i,t,d),e.elementType=he,e.lanes=p,e;case Le:return e=Hn(19,i,t,d),e.elementType=Le,e.lanes=p,e;case le:return ka(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:y=10;break e;case ue:y=9;break e;case de:y=11;break e;case te:y=14;break e;case ie:y=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Hn(y,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function xr(e,t,i,l){return e=Hn(7,e,l,t),e.lanes=i,e}function ka(e,t,i,l){return e=Hn(22,e,l,t),e.elementType=le,e.lanes=i,e.stateNode={isHidden:!1},e}function Gc(e,t,i){return e=Hn(6,e,null,t),e.lanes=i,e}function Kc(e,t,i){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cy(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=wi(0),this.expirationTimes=wi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Yc(e,t,i,l,d,p,y,N,I){return e=new Cy(e,t,i,N,I),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Hn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},lc(p),e}function Ey(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 Op(e){if(!e)return Us;e=e._reactInternals;e:{if(Ee(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(kn(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(kn(i))return df(e,i,t)}return t}function zp(e,t,i,l,d,p,y,N,I){return e=Yc(i,l,!0,e,d,p,y,N,I),e.context=Op(null),i=e.current,l=gn(),d=Ks(i),p=Ns(l,d),p.callback=t??null,Hs(i,p,d),e.current.lanes=d,ar(e,d,l),bn(e,l),e}function Sa(e,t,i,l){var d=t.current,p=gn(),y=Ks(d);return i=Op(i),t.context===null?t.context=i:t.pendingContext=i,t=Ns(p,y),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Hs(d,t,y),e!==null&&(ns(e,d,y,p),Jo(e,d,y)),y}function Ta(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 $p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Xc(e,t){$p(e,t),(e=e.alternate)&&$p(e,t)}function _y(){return null}var Fp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}ba.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));Sa(e,t,null,null)},ba.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){Sa(null,e,null,null)}),t[ws]=null}};function ba(e){this._internalRoot=e}ba.prototype.unstable_scheduleHydration=function(e){if(e){var t=ke();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ps.length&&t!==0&&t<Ps[i].priority;i++);Ps.splice(i,0,e),i===0&&Nd(e)}};function Zc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Na(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Up(){}function jy(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var B=Ta(y);p.call(B)}}var y=zp(t,l,e,0,null,!1,!1,"",Up);return e._reactRootContainer=y,e[ws]=y.current,Ii(e.nodeType===8?e.parentNode:e),gr(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var B=Ta(I);N.call(B)}}var I=Yc(e,0,!1,null,null,!1,!1,"",Up);return e._reactRootContainer=I,e[ws]=I.current,Ii(e.nodeType===8?e.parentNode:e),gr(function(){Sa(t,I,i,l)}),I}function Ca(e,t,i,l,d){var p=i._reactRootContainer;if(p){var y=p;if(typeof d=="function"){var N=d;d=function(){var I=Ta(y);N.call(I)}}Sa(t,y,e,d)}else y=jy(i,t,e,d,l);return Ta(y)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=ir(t.pendingLanes);i!==0&&(Ls(t,i|1),bn(t,St()),(Ye&6)===0&&(Zr=St()+500,Bs()))}break;case 13:gr(function(){var l=bs(e,1);if(l!==null){var d=gn();ns(l,e,1,d)}}),Xc(e,1)}},O=function(e){if(e.tag===13){var t=bs(e,134217728);if(t!==null){var i=gn();ns(t,e,134217728,i)}Xc(e,134217728)}},Z=function(e){if(e.tag===13){var t=Ks(e),i=bs(e,t);if(i!==null){var l=gn();ns(i,e,t,l)}Xc(e,t)}},ke=function(){return Ge},_e=function(e,t){var i=Ge;try{return Ge=e,t()}finally{Ge=i}},Dt=function(e,t,i){switch(t){case"input":if(Yt(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=Wo(l);if(!d)throw Error(r(90));Oe(l),Yt(l,d)}}}break;case"textarea":me(e,i);break;case"select":t=i.value,t!=null&<(e,!!i.multiple,t,!1)}},_=Wc,se=gr;var Ry={usingClientEntryPoint:!1,Events:[Li,$r,Wo,jt,Ut,Wc]},Yi={findFiberByHostInstance:lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ay={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Er(e),e===null?null:e.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||_y,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 Ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ea.isDisabled&&Ea.supportsFiber)try{sr=Ea.inject(Ay),_n=Ea}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ry,Nn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zc(t))throw Error(r(200));return Ey(e,t,null,i)},Nn.createRoot=function(e,t){if(!Zc(e))throw Error(r(299));var i=!1,l="",d=Fp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Yc(e,1,!1,null,null,i,!1,l,d),e[ws]=t.current,Ii(e.nodeType===8?e.parentNode:e),new Qc(t)},Nn.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=Er(t),e=e===null?null:e.stateNode,e},Nn.flushSync=function(e){return gr(e)},Nn.hydrate=function(e,t,i){if(!Na(t))throw Error(r(200));return Ca(null,e,t,!0,i)},Nn.hydrateRoot=function(e,t,i){if(!Zc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",y=Fp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),t=zp(t,null,e,1,i??null,d,!1,p,y),e[ws]=t.current,Ii(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 ba(t)},Nn.render=function(e,t,i){if(!Na(t))throw Error(r(200));return Ca(null,e,t,!1,i)},Nn.unmountComponentAtNode=function(e){if(!Na(e))throw Error(r(40));return e._reactRootContainer?(gr(function(){Ca(null,null,e,!1,function(){e._reactRootContainer=null,e[ws]=null})}),!0):!1},Nn.unstable_batchedUpdates=Wc,Nn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!Na(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ca(e,t,i,!1,l)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var Yp;function Am(){if(Yp)return tu.exports;Yp=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(),tu.exports=Fy(),tu.exports}var Xp;function Uy(){if(Xp)return _a;Xp=1;var n=Am();return _a.createRoot=n.createRoot,_a.hydrateRoot=n.hydrateRoot,_a}var By=Uy();const Wy=Rm(By),Qp=n=>{let s;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(s):m;if(!Object.is(k,s)){const x=s;s=v??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(T=>T(s,x))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=s=n(o,a,h);return h},Hy=(n=>n?Qp(n):Qp),Vy=n=>n;function qy(n,s=Vy){const r=rt.useSyncExternalStore(n.subscribe,rt.useCallback(()=>s(n.getState()),[n,s]),rt.useCallback(()=>s(n.getInitialState()),[n,s]));return rt.useDebugValue(r),r}const Gy=n=>{const s=Hy(n),r=o=>qy(s,o);return Object.assign(r,s),r},Ky=(n=>Gy),Im="agentpane:machines",Mm="agentpane:active-machine";function Yy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Dm(n){return`${n}.repoburg.com`}function Lm(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function Pm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function Om(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function zm(){return Pm(Im,[]).filter(s=>Yy(s.mahlas)&&s.hostname===Dm(s.mahlas))}function Xy(n){const s={mahlas:n,hostname:Dm(n),lastConnectedAt:new Date().toISOString()},r=zm(),o=[s,...r.filter(a=>a.mahlas!==n)];return Om(Im,o),s}function Qy(){const n=Pm(Mm,null);return n?zm().find(s=>s.mahlas===n)??null:null}function Zy(n){Om(Mm,n)}function Jy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=Lm(n);s&&(Xy(s),Zy(s))}const Zp="http://localhost:9998",ex=["agent.repoburg.com"];function is(){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(ex.includes(o))return Zp;if(Lm(o))return"";const a=Qy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Zp}const tx="/api";async function vo(n,s,r){const o=await fetch(`${is()}${tx}${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 yn(n){return vo("GET",n)}function Et(n,s){return vo("POST",n,s)}function ul(n){return vo("DELETE",n)}function vs(n,s){return vo("PATCH",n,s)}function nx(n,s){return vo("PUT",n,s)}function sx(){return yn("/sessions")}function Qi(n){return yn(`/sessions/${n}`)}function Gu(n){return Et("/sessions",n)}function Jp(n){return ul(`/sessions/${n}`)}function $m(n,s,r){return Et(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function rx(n){return Et(`/sessions/${n}/cancel`)}function ix(n,s){return Et(`/sessions/${n}/turns/${s}/resume`)}function ox(n,s){return vs(`/sessions/${n}`,{title:s})}function eh(n){return vs(`/sessions/${n}`,{lifecycle:"finished"})}function th(n){return vs(`/sessions/${n}`,{lifecycle:"working"})}function ax(n,s){return vs(`/sessions/${n}`,{starred:s})}function nh(n){return vs(`/sessions/${n}`,{has_unreviewed:0})}function lx(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),vs(`/sessions/${n}`,a)}function cx(n,s){return vs(`/sessions/${n}`,{runtime_config:s})}function ux(n,s){return Et(`/sessions/${n}/rewind`,{turn_id:s})}function dx(n){return Et(`/sessions/${n}/restore`,{})}function fx(n,s,r){return Et(`/sessions/${n}/branch`,{turn_id:s,title:r})}function Fm(){return yn("/workspaces")}function px(n,s){return Et("/workspaces",{path:n,label:s})}function hx(n){return Et("/workspaces/hide",{path:n})}async function mx(){const n=await fetch(`${is()}/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 Um(){return yn("/folders")}function gx(n,s){return Et("/folders",{workspace_path:n,name:s})}function sh(n,s){return vs(`/folders/${n}`,s)}function vx(n){return ul(`/folders/${n}`)}function yx(n){return Et("/sessions/reorder",{moves:n})}function Tr(n){return n.status==="pending"||n.status==="running"}function Bm(n){return!!(n!=null&&n.turns.some(Tr))}function dl(n){return n?n.turns.some(Tr)||(n.threads??[]).some(s=>(s.turns??[]).some(Tr)):!1}const Wm=1;function Hm(){let n="";try{n=is()}catch{}return`agentpane:tabs:${n||window.location.origin}`}function rh(n){return Array.isArray(n)&&n.every(s=>typeof s=="string")}function ih(n){return n===null||typeof n=="string"}function xx(n){if(n==null)return null;let s;try{s=JSON.parse(n)}catch{return null}if(typeof s!="object"||s===null)return null;const r=s;return r.v!==Wm||!rh(r.openTabs)||!ih(r.activeSessionId)||!rh(r.openAppTabs)||!ih(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId}}const Vm=[()=>window.sessionStorage,()=>window.localStorage];function wx(){const n=Hm();for(const s of Vm)try{const r=xx(s().getItem(n));if(r)return r}catch{}return null}function kx(n){const s=Hm(),r=JSON.stringify({v:Wm,openTabs:n.openTabs,activeSessionId:n.activeSessionId,openAppTabs:n.openAppTabs,activeAppTabId:n.activeAppTabId});for(const o of Vm)try{o().setItem(s,r)}catch{}}function Sx(n){return n.subscribe((s,r)=>{(s.openTabs!==r.openTabs||s.activeSessionId!==r.activeSessionId||s.openAppTabs!==r.openAppTabs||s.activeAppTabId!==r.activeAppTabId)&&kx(s)})}function Ba(n){return[...new Set(n)]}function Tx(n,s,r,o){const a=m=>r===null||r.has(m),u=Ba(((n==null?void 0:n.openTabs)??[]).filter(m=>s.has(m))),f=Ba(((n==null?void 0:n.openAppTabs)??[]).filter(a));let h=(n==null?void 0:n.activeSessionId)??null;h!==null&&!s.has(h)&&(h=null),h!==null&&!u.includes(h)&&u.push(h),h??(h=u.at(-1)??null);let g=(n==null?void 0:n.activeAppTabId)??null;return g!==null&&!a(g)&&(g=null),g!==null&&!f.includes(g)&&f.push(g),o!==null&&s.has(o)&&(u.includes(o)||u.push(o),h=o,g=null),{openTabs:u,activeSessionId:h,openAppTabs:f,activeAppTabId:g}}function bx(){const n=new URLSearchParams(window.location.search);return{session:n.get("session"),thread:n.get("thread")}}function Nx(){const n=new URL(window.location.href);!n.searchParams.has("session")&&!n.searchParams.has("thread")||(n.searchParams.delete("session"),n.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",n))}let ru=0;async function Cx(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 oh(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 ah(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Cx(r,o);u.size>0&&n(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));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 g=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${g} ${u.size} of ${r.length} — ${h} failed`)}}const _x=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=bx(),o=wx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&n({lastModelConfig:JSON.parse(a)})}catch{}n({loading:!0,error:null});try{const a=s().loadApps(),[u,f,h]=await Promise.all([sx(),Fm(),Um()]);n({sessions:u,workspaces:f,folders:h,loading:!1}),Nx();const g=await a,m=Tx(o,new Set(u.map(v=>v.id)),g?new Set(s().apps.map(v=>v.id)):null,r.session);n(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ba([...m.openTabs,...v.openTabs]),openAppTabs:Ba([...m.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!s().activeSessionId&&await s().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(n({deepLinkThreadId:r.thread}),s().switchRightTab("threads"))}catch(a){n({loading:!1,error:a.message})}},selectSession:async(r,o)=>{const a=++ru,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=h=>h.includes(r)?h:[...h,r];if(s().sessionDetails[r]){const h=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:"turns",...u,openTabs:f(s().openTabs)}),h.has_unreviewed===1&&(nh(r).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...h,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const h=await Qi(r);if(a!==ru){n(g=>({sessionDetails:{...g.sessionDetails,[r]:h},openTabs:f(g.openTabs),loading:!1}));return}n(g=>({sessionDetails:{...g.sessionDetails,[r]:h},activeSessionId:r,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:"turns",...u,openTabs:f(g.openTabs),loading:!1})),h.has_unreviewed===1&&(nh(r).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...h,has_unreviewed:0}}})))}catch(h){n(a===ru?{loading:!1,error:h.message}:{loading:!1})}},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 lx(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(g=>({sessions:g.sessions.map(m=>m.id===u?f:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:g.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 Gu(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 Qi(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 Jp(r),n(u=>oh(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 ox(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 eh(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 ah(n,s,r,eh,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await ax(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 th(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 ah(n,s,r,th,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Jp(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=>oh(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 g=h.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},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 g=dl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:g,status:g?"running":"active"}},sessions:f.sessions.map(m=>m.id===a?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await rx(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await ux(r,o),u=await Qi(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 dx(r),a=await Qi(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 fx(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 cx(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 Qi(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})}}}),jx=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await px(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 hx(r);const o=await Fm();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 Gu({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 mx();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),Nr=new Map,Ku=new Map,Yu=new Map,Xu=new Map;function Rx(n,s){Nr.set(n,s)}function Ax(n){Nr.delete(n)}function iu(n,s){Ku.set(n,s)}function lh(n,s,r){const o=Ku.get(n);if(!o)return;const a=Nr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function Ix(n,s,r,o){const a=Nr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function Mx(n,s,r,o){const a=Ku.get(n);if(!a)return;const u=Nr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function Dx(n,s){Yu.set(n,s)}function Lx(n){Yu.delete(n)}function Px(n,s){Xu.set(n,s)}function Ox(n){Xu.delete(n)}function zx(n){var r;const s=Nr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Xu.get(n))==null||r()}function $x(n){var r;const s=Nr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Yu.get(n))==null||r()}const Fx=(n,s)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},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=ei(a.sessions,r,()=>({is_running:1,status:"running"})),f=a.sessionDetails[r];if(!f)return{sessions:u};const h=f.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Vn(f,o,g=>({...g,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=ch(a)?wr(u.retryStates,o):u.retryStates,h=u.sessionDetails[r];return h?{sessionDetails:{...u.sessionDetails,[r]:Vn(h,o,g=>au(g,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Vn(f,o,h=>au(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",m=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?s().addToast("success",`${m} completed: ${h}`):s().addToast("error",`${m} failed: ${h}`)}n(u=>{const f=ch(a)?wr(u.retryStates,o):u.retryStates,h=u.sessionDetails[r];return h?{retryStates:f,sessionDetails:{...u.sessionDetails,[r]:Vn(h,o,g=>{var v,k;let m=au(g,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const x=m.thoughts?m.thoughts+`
|
|
41
|
-
`+a.data.text:a.data.text;m={...m,thoughts:x}}return m})}}:{retryStates:f}})},onItemDelta:(r,o,a,u)=>{Mx(r,o,a,u),n(f=>{const h=wr(f.retryStates,o),g=f.sessionDetails[r];return g?{sessionDetails:{...f.sessionDetails,[r]:Vn(g,o,m=>Bx(m,a,u))},retryStates:h}:{retryStates:h}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${g} out`),lh(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),n(m=>{const v=m.sessionDetails[r],k=v?Vn(v,o,R=>({...R,status:"completed",token_usage:a??R.token_usage??null,...f&&!R.agent_response?{agent_response:f}:{}})):null,x=ou(k),T=x&&k?ja(k):"active",E=ei(m.sessions,r,R=>({is_running:x,status:T,has_unreviewed:u?1:R.has_unreviewed})),C=wr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:x,status:T,has_unreviewed:u?1:k.has_unreviewed}},sessions:E,retryStates:C}:{sessions:E,retryStates:C}})},onTokenUsageUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Vn(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,u)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),lh(r,"turn:failed",{turnId:o,error:a}),n(f=>{const h=f.sessionDetails[r],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=h?Vn(h,o,C=>({...C,status:m,error:a,...u?{resume_state:u}:{},items:C.items.map(R=>R.status==="in_progress"?{...R,status:"failed"}:R)})):null,k=ou(v),x=k&&v?ja(v):g?"active":"failed",T=ei(f.sessions,r,()=>({is_running:k,status:x})),E=wr(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[r]:{...v,is_running:k,status:x}},sessions:T,retryStates:E}:{sessions:T,retryStates:E}})},onTurnCancelled:(r,o)=>{n(a=>{const u=a.sessionDetails[r],f=u?Vn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(x=>x.status==="in_progress"?{...x,status:"completed"}:x)})):null,h=ou(f),g=h&&f?ja(f):"active",m=ei(a.sessions,r,()=>({is_running:h,status:g})),v=wr(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,a)=>{s().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),s().addToast("warn",Ux(a.reason)),n(u=>{const f=u.sessionDetails[r],h=f?Vn(f,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts})):null,g=h?ja(h):"interrupted",m=ei(u.sessions,r,()=>({is_running:1,status:g})),v=wr(u.retryStates,o);return h?{sessionDetails:{...u.sessionDetails,[r]:{...h,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,a)=>{s().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),n(u=>{const f=ei(u.sessions,r,()=>({is_running:1,status:"running"})),h=u.sessionDetails[r];return h?{sessionDetails:{...u.sessionDetails,[r]:{...Vn(h,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:f}:{sessions:f}})},onTurnResumed:(r,o)=>{s().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),s().addToast("success","Interrupted turn resumed"),n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:Vn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,a)=>{s().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),n(u=>({retryStates:{...u.retryStates,[o]:a}}))},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 Ux(n){switch(n){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";default:return"The agent host restarted — resuming the turn"}}function ja(n){const s=[...n.turns,...(n.threads??[]).flatMap(r=>r.turns??[])].filter(Tr);return s.length>0&&s.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function ch(n){return n.type!=="background_task"&&n.type!=="error"&&n.type!=="interruption"}function wr(n,s){if(!(s in n))return n;const r={...n};return delete r[s],r}function ou(n){return n&&(n.turns.some(Tr)||(n.threads??[]).some(r=>(r.turns??[]).some(Tr)))?1:0}function ei(n,s,r){return n.some(o=>o.id===s)?n.map(o=>o.id===s?{...o,...r(o)}:o):n}function Vn(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 au(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 Bx(n,s,r){var u;const o=n.items.findIndex(f=>f.external_item_id===s);if(o>=0){const f=n.items[o],g=(((u=f.data)==null?void 0:u.text)??"")+r,m=[...n.items];return m[o]={...f,data:{...f.data,text:g}},{...n,items:m,agent_response:g}}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 Wx(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return yn(`/providers/${n}/models${r}`)}const Nu=160,Cu=480,Hx=240,Wa=220,Vx=300,qx=600,Gx=36;function Ha(){return typeof window>"u"?qx:Math.max(Wa,Math.round(window.innerWidth*.7))}const uh="agentpane:sidebar-width",dh="agentpane:right-panel-width",lu="agentpane:right-panel-collapsed";function fh(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}}function Kx(n){try{return localStorage.getItem(n)==="true"}catch{return!1}}function ph(n,s){try{localStorage.setItem(n,String(s))}catch{}}const hh=200,Yx=(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:fh(uh,Nu,Cu,Hx),rightPanelWidth:fh(dh,Wa,Ha(),Vx),rightPanelCollapsed:Kx(lu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:r=>n({activeTurnIndex:r}),switchRightTab:r=>{s().rightPanelCollapsed&&ph(lu,!1),n({activeRightTab:r,rightPanelCollapsed:!1})},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(Cu,Math.max(Nu,Math.round(r)));n({sidebarWidth:o});try{localStorage.setItem(uh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(Ha(),Math.max(Wa,Math.round(r)));n({rightPanelWidth:o});try{localStorage.setItem(dh,String(o))}catch{}},setRightPanelCollapsed:r=>{n({rightPanelCollapsed:r}),ph(lu,r)},toggleRightPanel:()=>s().setRightPanelCollapsed(!s().rightPanelCollapsed),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>hh&&f.splice(0,f.length-hh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await Wx(r,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),Xx=(n,s)=>({createThread:async(r,o)=>{try{await Et(`/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 Et(`/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 Et(`/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 vs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await vs(`/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 Et(`/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 ul(`/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(g=>g.id===o?{...g,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:g);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)}}}:{}})}}),Qx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await Um();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await gx(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 sh(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 vx(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 yx(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)=>sh(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function mh(){return yn("/apps")}function Zx(){return yn("/apps/root")}function gh(n){return yn(`/apps/${n}/source`)}function vh(n,s=""){return yn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function qm(n,s,r=""){return nx(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function Jx(n){return ul(`/apps/${n}`)}function e0(n){return yn(`/apps/${n}/sessions`)}function t0(){return yn("/apps/examples")}function n0(n){return Et(`/apps/examples/${n}/install`,{})}function s0(n){return Et("/apps",n)}function r0(n,s){return Et("/apps/import",{id:n,files:s})}function i0(n,s,r){return Et(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function o0(n,s){return Et(`/apps/${n}/edit-session`,s)}const Oa=new Set;async function cu(n,s){Oa.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 Eu="agentpane:app-workspaces";function a0(){try{const n=JSON.parse(localStorage.getItem(Eu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const l0=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:a0(),loadApps:async()=>{try{const[r,o]=await Promise.all([mh(),Zx().catch(()=>null)]);return r.forEach(a=>Oa.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await mh();for(const o of r)Oa.has(o.id)||(Oa.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(Eu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await n0(r),await cu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await s0(r),await cu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await r0(r,o),await cu(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 o0(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),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 qm(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await Jx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(Eu,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}`)}}}),yh=3e3,Dn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Ln=[];let Va=0,Qu=0,qa=0,Zu=0,Ga=0,Ju=0,ed=0;const fo=new Map,po=new Map;let ai=new Map,ii=0,li=new Map,uu=!1;function Ka(n,s,r){if(Ln.push({t:Date.now(),cat:n,msg:s,ms:r}),Ln.length>yh){const o=Ln.length-yh;Ln.splice(0,o),Cn=Math.max(0,Cn-o)}}function oi(n,s,r){Ka(n,s,r),console.log(`[perf:${n}] ${s}`)}function Gm(n){oi("note",n)}function Km(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function c0(n,s){let r=ai.get(n);r||ai.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=fo.get(n);o||fo.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function u0(){ii++,ed++}function d0(n){li.set(n,(li.get(n)??0)+1),po.set(n,(po.get(n)??0)+1)}let za=0;function f0(){za=performance.now()}function p0(){const n=performance.now(),s=za?n-za:null;za=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>Dn.keypressMs&&oi("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const h0=5e3,Ym=500,xh=2e3;let Cn=0,du=!1;function m0(n){return Et("/perf-log",{entries:n}).then(()=>{Cn+=n.length})}function g0(){if(du||Cn>=Ln.length)return;const n=Ln.slice(Cn,Cn+Ym);n.length!==0&&(du=!0,m0(n).catch(()=>{Ln.length-Cn>xh&&(Cn=Math.max(Cn,Ln.length-xh))}).finally(()=>{du=!1}))}function wh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Cn>=Ln.length)return;const n=Ln.slice(Cn,Cn+Ym);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${is()}/api/perf-log`,s),Cn+=n.length}catch{}}function v0(){let n=0;for(const o of ai.values())n+=o.n;const s=[];if(n>0){const o=[...ai.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Km(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}ii>0&&s.push(`store ${ii}/s`);const r=[...li.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(" · ");Ka("stat",o);const a=[...li.values()].some(u=>u>Dn.renderPerSecLog);(n>Dn.wsPerSecLog||ii>Dn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ai=new Map,ii=0,li=new Map}function y0(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 x0(){if(uu||typeof window>"u")return()=>{};uu=!0,Va=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>Dn.lagMs&&(Qu++,qa=Math.max(qa,f),oi("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=g=>{const m=g-u;u=g,m>Dn.frameGapMs&&oi("lag",`frame gap ${Math.round(m)}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 g of f.getEntries()){const m=g.duration;if(m<Dn.longtaskBufferMs)continue;Zu++,Ga=Math.max(Ga,m);const v=(h=g.attribution)==null?void 0:h[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",x=`long task ${Math.round(m)}ms (${k})`;m>=Dn.longtaskLogMs?oi("longtask",x,m):Ka("longtask",x,m)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const g=h.duration,m=h.processingStart-h.startTime;Ju++;const v=`${h.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${y0(h.target)}`;g>=Dn.eventLogMs?oi("input",v,g):Ka("input",v,g)}});u.observe({type:"event",durationThreshold:Dn.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(v0,1e3);n.push(()=>window.clearInterval(o)),Gm("perf logger session started");const a=window.setInterval(g0,h0);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",wh),n.push(()=>window.removeEventListener("beforeunload",wh)),window.__agentPanePerf={dump:Xm,reset:Qm},()=>{n.forEach(u=>u()),uu=!1}}function Xm(){const n=[],s=Va?Math.round((Date.now()-Va)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${Ln.length} buffered entries`),n.push(`event-loop lag: ${Qu} blocks >${Dn.lagMs}ms (max ${Math.round(qa)}ms)`),n.push(`long tasks: ${Zu} ≥${Dn.longtaskBufferMs}ms (max ${Math.round(Ga)}ms)`),n.push(`slow input events (≥${Dn.eventBufferMs}ms): ${Ju}`),n.push(`store updates: ${ed} total`),fo.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...fo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Km(o.bytes)}`)}if(po.size>0){n.push("render counts by component:");for(const[r,o]of[...po.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of Ln.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
|
|
49
|
-
`)}function Qm(){Ln.length=0,Cn=0,Va=Date.now(),Qu=0,qa=0,Zu=0,Ga=0,Ju=0,ed=0,fo.clear(),po.clear(),ai=new Map,ii=0,li=new Map}const Kt={start:x0,note:Gm,trackWsEvent:c0,trackStoreUpdate:u0,trackRender:d0,markKeystroke:f0,markInputChange:p0,dump:Xm,reset:Qm},D=Ky()((...n)=>({..._x(...n),...jx(...n),...Fx(...n),...Yx(...n),...Xx(...n),...Qx(...n),...l0(...n)}));typeof window<"u"&&(D.subscribe(()=>Kt.trackStoreUpdate()),Sx(D));function _u(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 w0(n,s,r=!1,o="working",a=0){if(o==="finished")return"";if(n==="interrupted")return"interrupted";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 k0(n,s,r=!1,o="working",a=0){if(o==="finished")return"Finished";if(n==="interrupted")return"Interrupted";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 fl(n,s=0){const r=n.is_running===1,o=n.lifecycle==="finished",a=_u(n.runtime_type),u=w0(n.status,r,n.has_unreviewed===1,n.lifecycle,s),f=k0(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 pl(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 td(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 nd({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 sd({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 S0=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 T0={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 b0=w.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},g)=>w.createElement("svg",{ref:g,...T0,width:s,height:s,stroke:n,strokeWidth:o?Number(r)*24/Number(s):r,className:Zm("lucide",a),...h},[...f.map(([m,v])=>w.createElement(m,v)),...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 xe=(n,s)=>{const r=w.forwardRef(({className:o,...a},u)=>w.createElement(b0,{ref:u,iconNode:s,className:Zm(`lucide-${S0(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 N0=xe("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 ju=xe("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 C0=xe("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 tr=xe("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 ci=xe("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 rd=xe("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 hl=xe("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 E0=xe("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 Ya=xe("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 _0=xe("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 j0=xe("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 R0=xe("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 Jm=xe("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 kh=xe("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 Ru=xe("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 A0=xe("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 I0=xe("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 eg=xe("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 M0=xe("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 tg=xe("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 fu=xe("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 Au=xe("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 D0=xe("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 L0=xe("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 P0=xe("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 ng=xe("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 O0=xe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["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 z0=xe("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
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 $0=xe("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"}]]);/**
|
|
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 F0=xe("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"}]]);/**
|
|
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 rs=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 U0=xe("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"}]]);/**
|
|
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 B0=xe("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"}]]);/**
|
|
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 sg=xe("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"}]]);/**
|
|
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 W0=xe("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"}]]);/**
|
|
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 Sh=xe("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"}]]);/**
|
|
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 H0=xe("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
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=xe("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
|
|
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 q0=xe("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
|
|
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 G0=xe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 K0=xe("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"}]]);/**
|
|
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 $a=xe("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"}]]);/**
|
|
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 Y0=xe("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"}]]);/**
|
|
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 X0=xe("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"}]]);/**
|
|
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 Sr=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 rg=xe("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"}]]);/**
|
|
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 Q0=xe("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"}]]);/**
|
|
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 ho=xe("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"}]]);/**
|
|
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 ig=xe("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
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 og=xe("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"}]]);/**
|
|
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 Z0=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 ml=xe("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"}]]);/**
|
|
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 J0=xe("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"}]]);/**
|
|
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 fi=xe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Xa=xe("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"}]]);/**
|
|
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 ag=xe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 gs=xe("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"}]]);/**
|
|
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 ew=xe("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"}]]);/**
|
|
360
|
-
* @license lucide-react v0.469.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const tw=xe("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"}]]);/**
|
|
365
|
-
* @license lucide-react v0.469.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const nw=xe("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"}]]);/**
|
|
370
|
-
* @license lucide-react v0.469.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const sw=xe("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"}]]);/**
|
|
375
|
-
* @license lucide-react v0.469.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const lg=xe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
380
|
-
* @license lucide-react v0.469.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const rw=xe("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"}]]);/**
|
|
385
|
-
* @license lucide-react v0.469.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const Pn=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
390
|
-
* @license lucide-react v0.469.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const iw=xe("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 so=Am();function ow(){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 gl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pi(n){const s=Object.prototype.toString.call(n);return s==="[object Window]"||s==="[object global]"}function id(n){return"nodeType"in n}function xn(n){var s,r;return n?pi(n)?n:id(n)&&(s=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function od(n){const{Document:s}=xn(n);return n instanceof s}function yo(n){return pi(n)?!1:n instanceof xn(n).HTMLElement}function cg(n){return n instanceof xn(n).SVGElement}function hi(n){return n?pi(n)?n.document:id(n)?od(n)?n:yo(n)||cg(n)?n.ownerDocument:document:document:document}const os=gl?w.useLayoutEffect:w.useEffect;function vl(n){const s=w.useRef(n);return os(()=>{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 aw(){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 mo(n,s){s===void 0&&(s=[n]);const r=w.useRef(n);return os(()=>{r.current!==n&&(r.current=n)},s),r}function xo(n,s){const r=w.useRef();return w.useMemo(()=>{const o=n(r.current);return r.current=o,o},[...s])}function Qa(n){const s=vl(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 Za(n){const s=w.useRef();return w.useEffect(()=>{s.current=n},[n]),s.current}let pu={};function wo(n,s){return w.useMemo(()=>{if(s)return s;const r=pu[n]==null?0:pu[n]+1;return pu[n]=r,n+"-"+r},[n,s])}function ug(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[g,m]of h){const v=u[g];v!=null&&(u[g]=v+n*m)}return u},{...s})}}const ui=ug(1),Ja=ug(-1);function lw(n){return"clientX"in n&&"clientY"in n}function yl(n){if(!n)return!1;const{KeyboardEvent:s}=xn(n.target);return s&&n instanceof s}function cw(n){if(!n)return!1;const{TouchEvent:s}=xn(n.target);return s&&n instanceof s}function el(n){if(cw(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 lw(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}}}),Th="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function uw(n){return n.matches(Th)?n:n.querySelector(Th)}const dw={display:"none"};function fw(n){let{id:s,value:r}=n;return rt.createElement("div",{id:s,style:dw},r)}function pw(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 rt.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function hw(){const[n,s]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&s(o)},[]),announcement:n}}const dg=w.createContext(null);function mw(n){const s=w.useContext(dg);w.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(n)},[n,s])}function gw(){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 vw={draggable:`
|
|
395
|
-
To pick up a draggable item, press the space bar.
|
|
396
|
-
While dragging, use the arrow keys to move the item.
|
|
397
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
398
|
-
`},yw={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 xw(n){let{announcements:s=yw,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=vw}=n;const{announce:u,announcement:f}=hw(),h=wo("DndLiveRegion"),[g,m]=w.useState(!1);if(w.useEffect(()=>{m(!0)},[]),mw(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])),!g)return null;const v=rt.createElement(rt.Fragment,null,rt.createElement(fw,{id:o,value:a.draggable}),rt.createElement(pw,{id:h,announcement:f}));return r?so.createPortal(v,r):v}var $t;(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"})($t||($t={}));function tl(){}function ww(n,s){return w.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function kw(){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 as=Object.freeze({x:0,y:0});function Sw(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function Tw(n,s){const r=el(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 bw(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function Nw(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function Cw(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function bh(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 Ew=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=bh(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,g=r.get(h);if(g){const m=Sw(bh(g),a);u.push({id:h,data:{droppableContainer:f,value:m}})}}return u.sort(bw)};function _w(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 g=s.width*s.height,m=n.width*n.height,v=f*h,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const jw=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 g=_w(h,s);g>0&&a.push({id:f,data:{droppableContainer:u,value:g}})}}return a.sort(Nw)};function Rw(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function fg(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:as}function Aw(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 Iw=Aw(1);function pg(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 Mw(n,s,r){const o=pg(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,g=n.left-f-(1-a)*parseFloat(r),m=n.top-h-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),v=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const Dw={ignoreTransform:!1};function mi(n,s){s===void 0&&(s=Dw);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:m,transformOrigin:v}=xn(n).getComputedStyle(n);m&&(r=Mw(r,m,v))}const{top:o,left:a,width:u,height:f,bottom:h,right:g}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:g}}function Nh(n){return mi(n,{ignoreTransform:!0})}function Lw(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function Pw(n,s){return s===void 0&&(s=xn(n).getComputedStyle(n)),s.position==="fixed"}function Ow(n,s){s===void 0&&(s=xn(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 ad(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(od(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!yo(a)||cg(a)||r.includes(a))return r;const u=xn(n).getComputedStyle(a);return a!==n&&Ow(a,u)&&r.push(a),Pw(a,u)?r:o(a.parentNode)}return n?o(n):r}function hg(n){const[s]=ad(n,1);return s??null}function hu(n){return!gl||!n?null:pi(n)?n:id(n)?od(n)||n===hi(n).scrollingElement?window:yo(n)?n:null:null}function mg(n){return pi(n)?n.scrollX:n.scrollLeft}function gg(n){return pi(n)?n.scrollY:n.scrollTop}function Iu(n){return{x:mg(n),y:gg(n)}}var Gt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Gt||(Gt={}));function vg(n){return!gl||!n?!1:n===document.scrollingElement}function yg(n){const s={x:0,y:0},r=vg(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 zw={x:.2,y:.2};function $w(n,s,r,o,a){let{top:u,left:f,right:h,bottom:g}=r;o===void 0&&(o=10),a===void 0&&(a=zw);const{isTop:m,isBottom:v,isLeft:k,isRight:x}=yg(n),T={x:0,y:0},E={x:0,y:0},C={height:s.height*a.y,width:s.width*a.x};return!m&&u<=s.top+C.height?(T.y=Gt.Backward,E.y=o*Math.abs((s.top+C.height-u)/C.height)):!v&&g>=s.bottom-C.height&&(T.y=Gt.Forward,E.y=o*Math.abs((s.bottom-C.height-g)/C.height)),!x&&h>=s.right-C.width?(T.x=Gt.Forward,E.x=o*Math.abs((s.right-C.width-h)/C.width)):!k&&f<=s.left+C.width&&(T.x=Gt.Backward,E.x=o*Math.abs((s.left+C.width-f)/C.width)),{direction:T,speed:E}}function Fw(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 xg(n){return n.reduce((s,r)=>ui(s,Iu(r)),as)}function Uw(n){return n.reduce((s,r)=>s+mg(r),0)}function Bw(n){return n.reduce((s,r)=>s+gg(r),0)}function wg(n,s){if(s===void 0&&(s=mi),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);hg(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const Ww=[["x",["left","right"],Uw],["y",["top","bottom"],Bw]];class ld{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=ad(r),a=xg(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of Ww)for(const g of f)Object.defineProperty(this,g,{get:()=>{const m=h(o),v=a[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class oo{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 Hw(n){const{EventTarget:s}=xn(n);return n instanceof s?n:hi(n)}function mu(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 Gn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Gn||(Gn={}));function Ch(n){n.preventDefault()}function Vw(n){n.stopPropagation()}var Ze;(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"})(Ze||(Ze={}));const kg={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},qw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case Ze.Right:return{...r,x:r.x+25};case Ze.Left:return{...r,x:r.x-25};case Ze.Down:return{...r,y:r.y+25};case Ze.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 oo(hi(r)),this.windowListeners=new oo(xn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&wg(o),r(as)}handleKeyDown(s){if(yl(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=kg,coordinateGetter:f=qw,scrollBehavior:h="smooth"}=a,{code:g}=s;if(u.end.includes(g)){this.handleEnd(s);return}if(u.cancel.includes(g)){this.handleCancel(s);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:as;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(s,{active:r,context:o.current,currentCoordinates:v});if(k){const x=Ja(k,v),T={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const R=s.code,{isTop:L,isRight:b,isLeft:U,isBottom:P,maxScroll:W,minScroll:K}=yg(C),q=Fw(C),G={x:Math.min(R===Ze.Right?q.right-q.width/2:q.right,Math.max(R===Ze.Right?q.left:q.left+q.width/2,k.x)),y:Math.min(R===Ze.Down?q.bottom-q.height/2:q.bottom,Math.max(R===Ze.Down?q.top:q.top+q.height/2,k.y))},ce=R===Ze.Right&&!b||R===Ze.Left&&!U,pe=R===Ze.Down&&!P||R===Ze.Up&&!L;if(ce&&G.x!==k.x){const ue=C.scrollLeft+x.x,de=R===Ze.Right&&ue<=W.x||R===Ze.Left&&ue>=K.x;if(de&&!x.y){C.scrollTo({left:ue,behavior:h});return}de?T.x=C.scrollLeft-ue:T.x=R===Ze.Right?C.scrollLeft-W.x:C.scrollLeft-K.x,T.x&&C.scrollBy({left:-T.x,behavior:h});break}else if(pe&&G.y!==k.y){const ue=C.scrollTop+x.y,de=R===Ze.Down&&ue<=W.y||R===Ze.Up&&ue>=K.y;if(de&&!x.x){C.scrollTo({top:ue,behavior:h});return}de?T.y=C.scrollTop-ue:T.y=R===Ze.Down?C.scrollTop-W.y:C.scrollTop-K.y,T.y&&C.scrollBy({top:-T.y,behavior:h});break}}this.handleMove(s,ui(Ja(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=kg,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 Eh(n){return!!(n&&"distance"in n)}function _h(n){return!!(n&&"delay"in n)}class cd{constructor(s,r,o){var a;o===void 0&&(o=Hw(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=hi(f),this.documentListeners=new oo(this.document),this.listeners=new oo(o),this.windowListeners=new oo(xn(f)),this.initialCoordinates=(a=el(u))!=null?a:as,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(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.DragStart,Ch),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),this.windowListeners.add(Gn.ContextMenu,Ch),this.documentListeners.add(Gn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_h(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Eh(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(Gn.Click,Vw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gn.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 g=(r=el(s))!=null?r:as,m=Ja(a,g);if(!o&&h){if(Eh(h)){if(h.tolerance!=null&&mu(m,h.tolerance))return this.handleCancel();if(mu(m,h.distance))return this.handleStart()}if(_h(h)&&mu(m,h.tolerance))return this.handleCancel();this.handlePending(h,m);return}s.cancelable&&s.preventDefault(),f(g)}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===Ze.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const Gw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ud extends cd{constructor(s){const{event:r}=s,o=hi(r.target);super(s,Gw,o)}}ud.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 Kw={move:{name:"mousemove"},end:{name:"mouseup"}};var Mu;(function(n){n[n.RightClick=2]="RightClick"})(Mu||(Mu={}));class Yw extends cd{constructor(s){super(s,Kw,hi(s.event.target))}}Yw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Mu.RightClick?!1:(o==null||o({event:r}),!0)}}];const gu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xw extends cd{constructor(s){super(s,gu)}static setup(){return window.addEventListener(gu.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(gu.move.name,s)};function s(){}}}Xw.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 ao;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ao||(ao={}));var nl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(nl||(nl={}));function Qw(n){let{acceleration:s,activator:r=ao.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=nl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:x}=n;const T=Jw({delta:k,disabled:!u}),[E,C]=aw(),R=w.useRef({x:0,y:0}),L=w.useRef({x:0,y:0}),b=w.useMemo(()=>{switch(r){case ao.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ao.DraggableRect:return a}},[r,a,g]),U=w.useRef(null),P=w.useCallback(()=>{const K=U.current;if(!K)return;const q=R.current.x*L.current.x,G=R.current.y*L.current.y;K.scrollBy(q,G)},[]),W=w.useMemo(()=>h===nl.TreeOrder?[...m].reverse():m,[h,m]);w.useEffect(()=>{if(!u||!m.length||!b){C();return}for(const K of W){if((o==null?void 0:o(K))===!1)continue;const q=m.indexOf(K),G=v[q];if(!G)continue;const{direction:ce,speed:pe}=$w(K,G,b,s,x);for(const ue of["x","y"])T[ue][ce[ue]]||(pe[ue]=0,ce[ue]=0);if(pe.x>0||pe.y>0){C(),U.current=K,E(P,f),R.current=pe,L.current=ce;return}}R.current={x:0,y:0},L.current={x:0,y:0},C()},[s,P,o,C,u,f,JSON.stringify(b),JSON.stringify(T),E,m,W,v,JSON.stringify(x)])}const Zw={x:{[Gt.Backward]:!1,[Gt.Forward]:!1},y:{[Gt.Backward]:!1,[Gt.Forward]:!1}};function Jw(n){let{delta:s,disabled:r}=n;const o=Za(s);return xo(a=>{if(r||!o||!a)return Zw;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Gt.Backward]:a.x[Gt.Backward]||u.x===-1,[Gt.Forward]:a.x[Gt.Forward]||u.x===1},y:{[Gt.Backward]:a.y[Gt.Backward]||u.y===-1,[Gt.Forward]:a.y[Gt.Forward]||u.y===1}}},[r,s,o])}function e1(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return xo(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function t1(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 go;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(go||(go={}));var Du;(function(n){n.Optimized="optimized"})(Du||(Du={}));const jh=new Map;function n1(n,s){let{dragging:r,dependencies:o,config:a}=s;const[u,f]=w.useState(null),{frequency:h,measure:g,strategy:m}=a,v=w.useRef(n),k=R(),x=mo(k),T=w.useCallback(function(L){L===void 0&&(L=[]),!x.current&&f(b=>b===null?L:b.concat(L.filter(U=>!b.includes(U))))},[x]),E=w.useRef(null),C=xo(L=>{if(k&&!r)return jh;if(!L||L===jh||v.current!==n||u!=null){const b=new Map;for(let U of n){if(!U)continue;if(u&&u.length>0&&!u.includes(U.id)&&U.rect.current){b.set(U.id,U.rect.current);continue}const P=U.node.current,W=P?new ld(g(P),P):null;U.rect.current=W,W&&b.set(U.id,W)}return b}return L},[n,u,r,k,g]);return w.useEffect(()=>{v.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 R(){switch(m){case go.Always:return!1;case go.BeforeDragging:return r;default:return!r}}}function dd(n,s){return xo(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function s1(n,s){return dd(n,s)}function r1(n){let{callback:s,disabled:r}=n;const o=vl(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 xl(n){let{callback:s,disabled:r}=n;const o=vl(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 i1(n){return new ld(mi(n),n)}function Rh(n,s,r){s===void 0&&(s=i1);const[o,a]=w.useState(null);function u(){a(g=>{if(!n)return null;if(n.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=s(n);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const f=r1({callback(g){if(n)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=xl({callback:u});return os(()=>{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 o1(n){const s=dd(n);return fg(n,s)}const Ah=[];function a1(n){const s=w.useRef(n),r=xo(o=>n?o&&o!==Ah&&n&&s.current&&n.parentNode===s.current.parentNode?o:ad(n):Ah,[n]);return w.useEffect(()=>{s.current=n},[n]),r}function l1(n){const[s,r]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=hu(u.target);f&&r(h=>h?(h.set(f,Iu(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(g=>{const m=hu(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,Iu(m)]):null}).filter(g=>g!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(g=>{const m=hu(g);m==null||m.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>ui(u,f),as):xg(n):as,[n,s])}function Ih(n,s){s===void 0&&(s=[]);const r=w.useRef(null);return w.useEffect(()=>{r.current=null},s),w.useEffect(()=>{const o=n!==as;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?Ja(n,r.current):as}function c1(n){w.useEffect(()=>{if(!gl)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 u1(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 Tg(n){return w.useMemo(()=>n?Lw(n):null,[n])}const Mh=[];function d1(n,s){s===void 0&&(s=mi);const[r]=n,o=Tg(r?xn(r):null),[a,u]=w.useState(Mh);function f(){u(()=>n.length?n.map(g=>vg(g)?o:new ld(s(g),g)):Mh)}const h=xl({callback:f});return os(()=>{h==null||h.disconnect(),f(),n.forEach(g=>h==null?void 0:h.observe(g))},[n]),a}function bg(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return yo(s)?s:n}function f1(n){let{measure:s}=n;const[r,o]=w.useState(null),a=w.useCallback(m=>{for(const{target:v}of m)if(yo(v)){o(k=>{const x=s(v);return k?{...k,width:x.width,height:x.height}:x});break}},[s]),u=xl({callback:a}),f=w.useCallback(m=>{const v=bg(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?s(v):null)},[s,u]),[h,g]=Qa(f);return w.useMemo(()=>({nodeRef:h,rect:r,setRef:g}),[r,h,g])}const p1=[{sensor:ud,options:{}},{sensor:Sg,options:{}}],h1={current:{}},Fa={draggable:{measure:Nh},droppable:{measure:Nh,strategy:go.WhileDragging,frequency:Du.Optimized},dragOverlay:{measure:mi}};class lo 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 m1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Fa,measureDroppableContainers:tl,windowRect:null,measuringScheduled:!1},Ng={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tl,draggableNodes:new Map,over:null,measureDroppableContainers:tl},ko=w.createContext(Ng),Cg=w.createContext(m1);function g1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lo}}}function v1(n,s){switch(s.type){case $t.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case $t.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 $t.DragEnd:case $t.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new lo(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case $t.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 lo(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case $t.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new lo(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function y1(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=w.useContext(ko),u=Za(o),f=Za(r==null?void 0:r.id);return w.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!yl(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:g,node:m}=h;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=uw(v);if(k){k.focus();break}}})}},[o,s,a,f,u]),null}function Eg(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function x1(n){return w.useMemo(()=>({draggable:{...Fa.draggable,...n==null?void 0:n.draggable},droppable:{...Fa.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Fa.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 w1(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;os(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const m=s==null?void 0:s.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=fg(v,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=hg(m);x&&x.scrollBy({top:k.y,left:k.x})}},[s,f,h,o,r])}const wl=w.createContext({...as,scaleX:1,scaleY:1});var Js;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Js||(Js={}));const k1=w.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:g=!0,children:m,sensors:v=p1,collisionDetection:k=jw,measuring:x,modifiers:T,...E}=s;const C=w.useReducer(v1,void 0,g1),[R,L]=C,[b,U]=gw(),[P,W]=w.useState(Js.Uninitialized),K=P===Js.Initialized,{draggable:{active:q,nodes:G,translate:ce},droppable:{containers:pe}}=R,ue=q!=null?G.get(q):null,de=w.useRef({initial:null,translated:null}),he=w.useMemo(()=>{var nt;return q!=null?{id:q,data:(nt=ue==null?void 0:ue.data)!=null?nt:h1,rect:de}:null},[q,ue]),Le=w.useRef(null),[te,ie]=w.useState(null),[le,$]=w.useState(null),Y=mo(E,Object.values(E)),H=wo("DndDescribedBy",f),A=w.useMemo(()=>pe.getEnabled(),[pe]),j=x1(x),{droppableRects:X,measureDroppableContainers:re,measuringScheduled:ve}=n1(A,{dragging:K,dependencies:[ce.x,ce.y],config:j.droppable}),Te=e1(G,q),Pe=w.useMemo(()=>le?el(le):null,[le]),Re=dn(),De=s1(Te,j.draggable.measure);w1({activeNode:q!=null?G.get(q):null,config:Re.layoutShiftCompensation,initialRect:De,measure:j.draggable.measure});const Ne=Rh(Te,j.draggable.measure,De),st=Rh(Te?Te.parentElement:null),Oe=w.useRef({activatorEvent:null,active:null,activeNode:Te,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:pe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),mt=pe.getNodeFor((r=Oe.current.over)==null?void 0:r.id),Fe=f1({measure:j.dragOverlay.measure}),_t=(o=Fe.nodeRef.current)!=null?o:Te,Ue=K?(a=Fe.rect)!=null?a:Ne:null,Yt=!!(Fe.nodeRef.current&&Fe.rect),On=o1(Yt?null:Ne),at=Tg(_t?xn(_t):null),yt=a1(K?mt??Te:null),lt=d1(yt),Ft=Eg(T,{transform:{x:ce.x-On.x,y:ce.y-On.y,scaleX:1,scaleY:1},activatorEvent:le,active:he,activeNodeRect:Ne,containerNodeRect:st,draggingNodeRect:Ue,over:Oe.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:yt,scrollableAncestorRects:lt,windowRect:at}),V=Pe?ui(Pe,ce):null,me=l1(yt),Be=Ih(me),Je=Ih(me,[Ne]),ct=ui(Ft,Be),ut=Ue?Iw(Ue,Ft):null,gt=he&&ut?k({active:he,collisionRect:ut,droppableRects:X,droppableContainers:A,pointerCoordinates:V}):null,Xt=Cw(gt,"id"),[xt,Kn]=w.useState(null),En=Yt?Ft:ui(Ft,Je),ys=Rw(En,(u=xt==null?void 0:xt.rect)!=null?u:null,Ne),Yn=w.useRef(null),un=w.useCallback((nt,At)=>{let{sensor:jt,options:Ut}=At;if(Le.current==null)return;const _=G.get(Le.current);if(!_)return;const se=nt.nativeEvent,Q=new jt({active:Le.current,activeNode:_,event:se,options:Ut,context:Oe,onAbort(Ce){if(!G.get(Ce))return;const{onDragAbort:je}=Y.current,et={id:Ce};je==null||je(et),b({type:"onDragAbort",event:et})},onPending(Ce,We,je,et){if(!G.get(Ce))return;const{onDragPending:wt}=Y.current,kt={id:Ce,constraint:We,initialCoordinates:je,offset:et};wt==null||wt(kt),b({type:"onDragPending",event:kt})},onStart(Ce){const We=Le.current;if(We==null)return;const je=G.get(We);if(!je)return;const{onDragStart:et}=Y.current,ft={activatorEvent:se,active:{id:We,data:je.data,rect:de}};so.unstable_batchedUpdates(()=>{et==null||et(ft),W(Js.Initializing),L({type:$t.DragStart,initialCoordinates:Ce,active:We}),b({type:"onDragStart",event:ft}),ie(Yn.current),$(se)})},onMove(Ce){L({type:$t.DragMove,coordinates:Ce})},onEnd:ge($t.DragEnd),onCancel:ge($t.DragCancel)});Yn.current=Q;function ge(Ce){return async function(){const{active:je,collisions:et,over:ft,scrollAdjustedTranslate:wt}=Oe.current;let kt=null;if(je&&wt){const{cancelDrop:sn}=Y.current;kt={activatorEvent:se,active:je,collisions:et,delta:wt,over:ft},Ce===$t.DragEnd&&typeof sn=="function"&&await Promise.resolve(sn(kt))&&(Ce=$t.DragCancel)}Le.current=null,so.unstable_batchedUpdates(()=>{L({type:Ce}),W(Js.Uninitialized),Kn(null),ie(null),$(null),Yn.current=null;const sn=Ce===$t.DragEnd?"onDragEnd":"onDragCancel";if(kt){const fn=Y.current[sn];fn==null||fn(kt),b({type:sn,event:kt})}})}}},[G]),zn=w.useCallback((nt,At)=>(jt,Ut)=>{const _=jt.nativeEvent,se=G.get(Ut);if(Le.current!==null||!se||_.dndKit||_.defaultPrevented)return;const Q={active:se};nt(jt,At.options,Q)===!0&&(_.dndKit={capturedBy:At.sensor},Le.current=Ut,un(jt,At))},[G,un]),tn=t1(v,zn);c1(v),os(()=>{Ne&&P===Js.Initializing&&W(Js.Initialized)},[Ne,P]),w.useEffect(()=>{const{onDragMove:nt}=Y.current,{active:At,activatorEvent:jt,collisions:Ut,over:_}=Oe.current;if(!At||!jt)return;const se={active:At,activatorEvent:jt,collisions:Ut,delta:{x:ct.x,y:ct.y},over:_};so.unstable_batchedUpdates(()=>{nt==null||nt(se),b({type:"onDragMove",event:se})})},[ct.x,ct.y]),w.useEffect(()=>{const{active:nt,activatorEvent:At,collisions:jt,droppableContainers:Ut,scrollAdjustedTranslate:_}=Oe.current;if(!nt||Le.current==null||!At||!_)return;const{onDragOver:se}=Y.current,Q=Ut.get(Xt),ge=Q&&Q.rect.current?{id:Q.id,rect:Q.rect.current,data:Q.data,disabled:Q.disabled}:null,Ce={active:nt,activatorEvent:At,collisions:jt,delta:{x:_.x,y:_.y},over:ge};so.unstable_batchedUpdates(()=>{Kn(ge),se==null||se(Ce),b({type:"onDragOver",event:Ce})})},[Xt]),os(()=>{Oe.current={activatorEvent:le,active:he,activeNode:Te,collisionRect:ut,collisions:gt,droppableRects:X,draggableNodes:G,draggingNode:_t,draggingNodeRect:Ue,droppableContainers:pe,over:xt,scrollableAncestors:yt,scrollAdjustedTranslate:ct},de.current={initial:Ue,translated:ut}},[he,Te,gt,ut,G,_t,Ue,X,pe,xt,yt,ct]),Qw({...Re,delta:ce,draggingRect:ut,pointerCoordinates:V,scrollableAncestors:yt,scrollableAncestorRects:lt});const nn=w.useMemo(()=>({active:he,activeNode:Te,activeNodeRect:Ne,activatorEvent:le,collisions:gt,containerNodeRect:st,dragOverlay:Fe,draggableNodes:G,droppableContainers:pe,droppableRects:X,over:xt,measureDroppableContainers:re,scrollableAncestors:yt,scrollableAncestorRects:lt,measuringConfiguration:j,measuringScheduled:ve,windowRect:at}),[he,Te,Ne,le,gt,st,Fe,G,pe,X,xt,re,yt,lt,j,ve,at]),Dt=w.useMemo(()=>({activatorEvent:le,activators:tn,active:he,activeNodeRect:Ne,ariaDescribedById:{draggable:H},dispatch:L,draggableNodes:G,over:xt,measureDroppableContainers:re}),[le,tn,he,Ne,L,H,G,xt,re]);return rt.createElement(dg.Provider,{value:U},rt.createElement(ko.Provider,{value:Dt},rt.createElement(Cg.Provider,{value:nn},rt.createElement(wl.Provider,{value:ys},m)),rt.createElement(y1,{disabled:(h==null?void 0:h.restoreFocus)===!1})),rt.createElement(xw,{...h,hiddenTextDescribedById:H}));function dn(){const nt=(te==null?void 0:te.autoScrollEnabled)===!1,At=typeof g=="object"?g.enabled===!1:g===!1,jt=K&&!nt&&!At;return typeof g=="object"?{...g,enabled:jt}:{enabled:jt}}}),S1=w.createContext(null),Dh="button",T1="Draggable";function b1(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=wo(T1),{activators:f,activatorEvent:h,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(ko),{role:T=Dh,roleDescription:E="draggable",tabIndex:C=0}=a??{},R=(g==null?void 0:g.id)===s,L=w.useContext(R?wl:S1),[b,U]=Qa(),[P,W]=Qa(),K=u1(f,s),q=mo(r);os(()=>(k.set(s,{id:s,key:u,node:b,activatorNode:P,data:q}),()=>{const ce=k.get(s);ce&&ce.key===u&&k.delete(s)}),[k,s]);const G=w.useMemo(()=>({role:T,tabIndex:C,"aria-disabled":o,"aria-pressed":R&&T===Dh?!0:void 0,"aria-roledescription":E,"aria-describedby":v.draggable}),[o,T,C,R,E,v.draggable]);return{active:g,activatorEvent:h,activeNodeRect:m,attributes:G,isDragging:R,listeners:o?void 0:K,node:b,over:x,setNodeRef:U,setActivatorNodeRef:W,transform:L}}function _g(){return w.useContext(Cg)}const N1="Droppable",C1={timeout:25};function jg(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=wo(N1),{active:f,dispatch:h,over:g,measureDroppableContainers:m}=w.useContext(ko),v=w.useRef({disabled:r}),k=w.useRef(!1),x=w.useRef(null),T=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:R}={...C1,...a},L=mo(C??o),b=w.useCallback(()=>{if(!k.current){k.current=!0;return}T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{m(Array.isArray(L.current)?L.current:[L.current]),T.current=null},R)},[R]),U=xl({callback:b,disabled:E||!f}),P=w.useCallback((G,ce)=>{U&&(ce&&(U.unobserve(ce),k.current=!1),G&&U.observe(G))},[U]),[W,K]=Qa(P),q=mo(s);return w.useEffect(()=>{!U||!W.current||(U.disconnect(),k.current=!1,U.observe(W.current))},[W,U]),w.useEffect(()=>(h({type:$t.RegisterDroppable,element:{id:o,key:u,disabled:r,node:W,rect:x,data:q}}),()=>h({type:$t.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{r!==v.current.disabled&&(h({type:$t.SetDroppableDisabled,id:o,key:u,disabled:r}),v.current.disabled=r)},[o,u,r,h]),{active:f,rect:x,isOver:(g==null?void 0:g.id)===o,node:W,over:g,setNodeRef:K}}function E1(n){let{animation:s,children:r}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=Za(r);return!r&&!o&&h&&a(h),os(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){a(null);return}Promise.resolve(s(m,u)).then(()=>{a(null)})},[s,o,u]),rt.createElement(rt.Fragment,null,r,o?w.cloneElement(o,{ref:f}):null)}const _1={x:0,y:0,scaleX:1,scaleY:1};function j1(n){let{children:s}=n;return rt.createElement(ko.Provider,{value:Ng},rt.createElement(wl.Provider,{value:_1},s))}const R1={position:"fixed",touchAction:"none"},A1=n=>yl(n)?"transform 250ms ease":void 0,I1=w.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:g,transform:m,transition:v=A1}=n;if(!h)return null;const k=a?m:{...m,scaleX:1,scaleY:1},x={...R1,width:h.width,height:h.height,top:h.top,left:h.left,transform:As.Transform.toString(k),transformOrigin:a&&o?Tw(o,h):void 0,transition:typeof v=="function"?v(o):v,...g};return rt.createElement(r,{className:f,style:x,ref:s},u)}),M1=n=>s=>{let{active:r,dragOverlay:o}=s;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,g]of Object.entries(u.active))g!==void 0&&(a[h]=r.node.style.getPropertyValue(h),r.node.style.setProperty(h,g));if(u!=null&&u.dragOverlay)for(const[h,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(h,g);return f!=null&&f.active&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[g,m]of Object.entries(a))r.node.style.setProperty(g,m);f!=null&&f.active&&r.node.classList.remove(f.active)}},D1=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:As.Transform.toString(s)},{transform:As.Transform.toString(r)}]},L1={duration:250,easing:"ease",keyframes:D1,sideEffects:M1({styles:{active:{opacity:"0"}}})};function P1(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return vl((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const g=h.node.current;if(!g)return;const m=bg(f);if(!m)return;const{transform:v}=xn(f).getComputedStyle(f),k=pg(v);if(!k)return;const x=typeof s=="function"?s:O1(s);return wg(g,a.draggable.measure),x({active:{id:u,data:h.data,node:g,rect:a.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function O1(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...L1,...n};return u=>{let{active:f,dragOverlay:h,transform:g,...m}=u;if(!s)return;const v={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:g.scaleX!==1?f.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?f.rect.height*g.scaleY/h.rect.height:1},x={x:g.x-v.x,y:g.y-v.y,...k},T=a({...m,active:f,dragOverlay:h,transform:{initial:g,final:x}}),[E]=T,C=T[T.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const R=o==null?void 0:o({active:f,dragOverlay:h,...m}),L=h.node.animate(T,{duration:s,easing:r,fill:"forwards"});return new Promise(b=>{L.onfinish=()=>{R==null||R(),b()}})}}let Lh=0;function z1(n){return w.useMemo(()=>{if(n!=null)return Lh++,Lh},[n])}const $1=rt.memo(n=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:g,zIndex:m=999}=n;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:T,draggableNodes:E,droppableContainers:C,dragOverlay:R,over:L,measuringConfiguration:b,scrollableAncestors:U,scrollableAncestorRects:P,windowRect:W}=_g(),K=w.useContext(wl),q=z1(k==null?void 0:k.id),G=Eg(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:T,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:U,scrollableAncestorRects:P,transform:K,windowRect:W}),ce=dd(x),pe=P1({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:b}),ue=ce?R.setRef:void 0;return rt.createElement(j1,null,rt.createElement(E1,{animation:pe},k&&q?rt.createElement(I1,{key:q,id:k.id,ref:ue,as:h,activatorEvent:v,adjustScale:s,className:g,transition:u,rect:ce,style:{zIndex:m,...a},transform:G},r):null))});function Rg(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function F1(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function Ra(n){return n!==null&&n>=0}function U1(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 B1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Ag=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=Rg(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}},Aa={scaleX:1,scaleY:1},Ph=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 m=u[f];return m?{x:0,y:r<f?m.top+m.height-(h.top+h.height):m.top-h.top,...Aa}:null}const g=W1(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-g,...Aa}:a<r&&a>=f?{x:0,y:h.height+g,...Aa}:{x:0,y:0,...Aa}};function W1(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 Ig="Sortable",Mg=rt.createContext({activeIndex:-1,containerId:Ig,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ag,disabled:{draggable:!1,droppable:!1}});function Oh(n){let{children:s,id:r,items:o,strategy:a=Ag,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=_g(),k=wo(Ig,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,R=m?T.indexOf(m.id):-1,L=w.useRef(T),b=!U1(T,L.current),U=R!==-1&&C===-1||b,P=B1(u);os(()=>{b&&E&&v(T)},[b,T,E,v]),w.useEffect(()=>{L.current=T},[T]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:P,disableTransforms:U,items:T,overIndex:R,useDragOverlay:x,sortedRects:F1(T,g),strategy:a}),[C,k,P.draggable,P.droppable,U,T,R,g,x,a]);return rt.createElement(Mg.Provider,{value:W},s)}const H1=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return Rg(r,o,a).indexOf(s)},V1=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:g,transition:m}=n;return!m||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===g},q1={duration:200,easing:"ease"},Dg="transform",G1=As.Transition.toString({property:Dg,duration:0,easing:"linear"}),K1={roleDescription:"sortable"};function Y1(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(r);return os(()=>{if(!s&&r!==h.current&&o.current){const g=a.current;if(g){const m=mi(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&f(v)}}r!==h.current&&(h.current=r)},[s,r,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Lg(n){let{animateLayoutChanges:s=V1,attributes:r,disabled:o,data:a,getNewIndex:u=H1,id:f,strategy:h,resizeObserverConfig:g,transition:m=q1}=n;const{items:v,containerId:k,activeIndex:x,disabled:T,disableTransforms:E,sortedRects:C,overIndex:R,useDragOverlay:L,strategy:b}=w.useContext(Mg),U=X1(o,T),P=v.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:P,items:v},...a}),[k,a,P,v]),K=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:q,node:G,isOver:ce,setNodeRef:pe}=jg({id:f,data:W,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:K,...g}}),{active:ue,activatorEvent:de,activeNodeRect:he,attributes:Le,setNodeRef:te,listeners:ie,isDragging:le,over:$,setActivatorNodeRef:Y,transform:H}=b1({id:f,data:W,attributes:{...K1,...r},disabled:U.draggable}),A=ow(pe,te),j=!!ue,X=j&&!E&&Ra(x)&&Ra(R),re=!L&&le,ve=re&&X?H:null,Pe=X?ve??(h??b)({rects:C,activeNodeRect:he,activeIndex:x,overIndex:R,index:P}):null,Re=Ra(x)&&Ra(R)?u({id:f,items:v,activeIndex:x,overIndex:R}):P,De=ue==null?void 0:ue.id,Ne=w.useRef({activeId:De,items:v,newIndex:Re,containerId:k}),st=v!==Ne.current.items,Oe=s({active:ue,containerId:k,isDragging:le,isSorting:j,id:f,index:P,items:v,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:m,wasDragging:Ne.current.activeId!=null}),mt=Y1({disabled:!Oe,index:P,node:G,rect:q});return w.useEffect(()=>{j&&Ne.current.newIndex!==Re&&(Ne.current.newIndex=Re),k!==Ne.current.containerId&&(Ne.current.containerId=k),v!==Ne.current.items&&(Ne.current.items=v)},[j,Re,k,v]),w.useEffect(()=>{if(De===Ne.current.activeId)return;if(De!=null&&Ne.current.activeId==null){Ne.current.activeId=De;return}const _t=setTimeout(()=>{Ne.current.activeId=De},50);return()=>clearTimeout(_t)},[De]),{active:ue,activeIndex:x,attributes:Le,data:W,rect:q,index:P,newIndex:Re,items:v,isOver:ce,isSorting:j,isDragging:le,listeners:ie,node:G,overIndex:R,over:$,setNodeRef:A,setActivatorNodeRef:Y,setDroppableNodeRef:pe,setDraggableNodeRef:te,transform:mt??Pe,transition:Fe()};function Fe(){if(mt||st&&Ne.current.newIndex===P)return G1;if(!(re&&!yl(de)||!m)&&(j||Oe))return As.Transition.toString({...m,property:Dg})}}function X1(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}}Ze.Down,Ze.Right,Ze.Up,Ze.Left;function Ia(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 Lu(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 sl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function zh(n,s){if(!s||!n.cwd)return!1;const r=sl(n.cwd),o=sl(s);return r.startsWith(`${o}/`)}function Q1(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",g=r.get(h)??[];g.push(f),r.set(h,g)}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 rl(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 Fh(n,s){return{working:rl(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:rl(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function Ma(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function Z1(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 Uh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=jg({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function fd({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 J1({s:n,backgroundTaskCount:s,isActive:r,isSelected:o,appIcon:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:T}){const{attributes:E,listeners:C,setNodeRef:R,transform:L,transition:b,isDragging:U}=Lg({id:`s:${n.id}`}),P=fl(n,s);return c.jsxs("div",{ref:R,style:{transform:As.Transform.toString(L),transition:b},className:`tree-item ${r?"active":""}${o?" selected":""} ${P.isFinished?"tree-item-finished":""}${U?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(sd,{iconClass:P.iconClass,iconText:P.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a}),u?c.jsx(fd,{inputRef:h,value:f,onChange:g,onConfirm:m,onCancel:v}):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:W=>{W.stopPropagation(),T()},onPointerDown:W=>W.stopPropagation(),children:c.jsx(Xa,{size:10,fill:n.starred?"currentColor":"none"})}),P.dot&&c.jsx(nd,{status:P.dot,title:P.dotTitle})]})}function ek({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:x,listeners:T,setNodeRef:E,transform:C,transition:R,isDragging:L,over:b}=Lg({id:`f:${n.id}`}),U=b!=null&&String(b.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:As.Transform.toString(C),transition:R},className:`tree-folder ${r?"collapsed":""}${L?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${U?" drop-over":""}`,...x,...T,onClick:()=>{o||m()},onContextMenu:v,children:o?c.jsx(fd,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:g}):c.jsxs(c.Fragment,{children:[c.jsx(ci,{size:8,className:"tree-chevron"}),c.jsx(Au,{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=D(_=>_.sessions),s=D(_=>_.backgroundTasks),r=D(_=>_.workspaces),o=D(_=>_.folders),a=D(_=>_.activeSessionId),u=D(_=>_.selectSession),f=D(_=>_.deleteSession),h=D(_=>_.removeWorkspace),g=D(_=>_.createSessionInWorkspace),m=D(_=>_.pickAndAddWorkspace),v=D(_=>_.renameSession),k=D(_=>_.markFinished),x=D(_=>_.markFinishedMany),T=D(_=>_.toggleStar),E=D(_=>_.reopenSession),C=D(_=>_.reopenSessionMany),R=D(_=>_.deleteSessionMany),L=D(_=>_.createSidebarFolder),b=D(_=>_.renameFolder),U=D(_=>_.deleteFolder),P=D(_=>_.applyMoves),W=D(_=>_.reorderFolders),K=D(_=>_.apps),q=D(_=>_.appsRootPath),G=D(_=>_.activeAppTabId),ce=D(_=>_.openAppTab),pe=D(_=>_.startAppEdit),ue=D(_=>_.toggleAppPin),de=D(_=>_.deleteApp),he=D(_=>_.openAppCatalog),[Le,te]=Ia("agentpane:sidebar-ws-collapsed"),[ie,le]=Ia("agentpane:sidebar-sub-collapsed"),[$,Y]=Ia("agentpane:sidebar-folders-collapsed"),[H,A]=Ia("agentpane:sidebar-app-edits-collapsed"),[j,X]=w.useState(null),[re,ve]=w.useState(null),[Te,Pe]=w.useState(""),[Re,De]=w.useState(null),[Ne,st]=w.useState(new Set),[Oe,mt]=w.useState(null),Fe=w.useRef(null),_t=w.useRef(null),Ue=w.useRef(null),Yt=w.useRef(!1),On=kw(ww(ud,{activationConstraint:{distance:5}}));function at(){st(new Set),mt(null)}pl(Fe,()=>X(null),!!j),td(()=>{X(null),at()},!!j||Ne.size>0),w.useLayoutEffect(()=>{const _=Fe.current;if(!j||!_)return;const se=8,{offsetWidth:Q,offsetHeight:ge}=_,Ce=j.x+Q>window.innerWidth-se?Math.max(se,j.x-Q):j.x,We=j.y+ge>window.innerHeight-se?Math.max(se,j.y-ge):j.y;_.style.left=`${Ce}px`,_.style.top=`${We}px`},[j]);const yt=w.useMemo(()=>new Map(n.map(_=>[_.id,_])),[n]),lt=w.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),Ft=w.useMemo(()=>{const _=new Map;for(const se of[...o].sort((Q,ge)=>Q.sort_order-ge.sort_order)){const Q=_.get(se.workspace_path)??[];Q.push(se),_.set(se.workspace_path,Q)}return _},[o]);function V(_){te(se=>{const Q=new Set(se);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function me(_){le(se=>{const Q=new Set(se);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function Be(_){Y(se=>{const Q=new Set(se);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function Je(_){A(se=>{const Q=new Set(se);return Q.has(_)?Q.delete(_):Q.add(_),Q})}w.useEffect(()=>{re&&_t.current&&(_t.current.focus(),_t.current.select())},[re]),w.useEffect(()=>{var _,se,Q;Yt.current||!a||(Yt.current=!0,(Q=(se=(_=Ue.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:se.scrollIntoView)==null||Q.call(se,{block:"nearest"}))},[a]);function ct(_,se,Q,ge=""){ve({kind:_,id:se}),Pe(Q||ge)}function ut(){if(re){const _=Te.trim();_&&(re.kind==="session"?v(re.id,_):b(re.id,_))}ve(null)}function gt(){ve(null),Pe("")}async function Xt(_){const se=Z1(Ft.get(_)??[]),Q=await L(_,se);Q&&ct("folder",Q.id,Q.name)}function xt(_){const se=String(_.active.id);if(se.startsWith("s:")){const Q=yt.get(se.slice(2));Q&&De({kind:"session",label:Q.title||Q.id.slice(0,8)})}else if(se.startsWith("f:")){const Q=lt.get(se.slice(2));Q&&De({kind:"folder",label:Q.name})}}function Kn(_){De(null);const{active:se,over:Q}=_;if(!Q)return;const ge=String(se.id),Ce=String(Q.id);if(ge.startsWith("s:")){const We=yt.get(ge.slice(2));if(!We)return;const je=We.cwd||"(no directory)",et=Ma(We,lt);let ft,wt;if(Ce.startsWith("f:")){const Ee=lt.get(Ce.slice(2));if(!Ee)return;ft=Ee.workspace_path,wt=Ee.id}else if(Ce.startsWith("s:")){const Ee=yt.get(Ce.slice(2));if(!Ee)return;ft=Ee.cwd||"(no directory)",wt=Ma(Ee,lt)}else if(Ce.startsWith("c:")){const Ee=Ce.slice(2),it=Ee.lastIndexOf("|");ft=Ee.slice(0,it);const Xn=Ee.slice(it+1);wt=Xn==="root"?null:Xn}else return;if(ft!==je)return;const kt=rl(n.filter(Ee=>(Ee.cwd||"(no directory)")===ft&&Ma(Ee,lt)===wt)),sn=kt.filter(Ee=>Ee.id!==We.id);let fn=sn.length;if(Ce.startsWith("s:")){const Ee=sn.findIndex(it=>it.id===Ce.slice(2));Ee>=0&&(fn=Ee)}const ls=[...sn.slice(0,fn),We,...sn.slice(fn)],Is=[];if(wt===et){if(ls.length===kt.length&&ls.every((Ee,it)=>Ee.id===kt[it].id))return;ls.forEach((Ee,it)=>Is.push({id:Ee.id,folder_id:wt,sort_order:ls.length-1-it}))}else{const Ee=rl(n.filter(it=>(it.cwd||"(no directory)")===je&&Ma(it,lt)===et)).filter(it=>it.id!==We.id);Ee.forEach((it,Xn)=>Is.push({id:it.id,folder_id:et,sort_order:Ee.length-1-Xn})),ls.forEach((it,Xn)=>Is.push({id:it.id,folder_id:wt,sort_order:ls.length-1-Xn}))}P(Is);return}if(ge.startsWith("f:")){if(!Ce.startsWith("f:"))return;const We=lt.get(ge.slice(2)),je=lt.get(Ce.slice(2));if(!We||!je||We.id===je.id||We.workspace_path!==je.workspace_path)return;const et=(Ft.get(We.workspace_path)??[]).map(kt=>kt.id),ft=et.indexOf(We.id),wt=et.indexOf(je.id);et.splice(wt,0,...et.splice(ft,1)),W(et)}}const En=Q1(r,q?n.filter(_=>!zh(_,q)):n),ys=w.useMemo(()=>{const _=new Map;if(!q)return _;const se=sl(q);for(const Q of n){if(!zh(Q,q))continue;const ge=sl(Q.cwd).slice(se.length+1).split("/")[0],Ce=_.get(ge)??[];Ce.push(Q),_.set(ge,Ce)}return _},[n,q]);function Yn(_){return{folder:null,sessions:ys.get(_)??[],finishedKey:`app:${_}:finished`,hidden:H.has(_)}}const un=[],zn=_=>{if(_.hidden)return;const{working:se,finished:Q,finishedCollapsed:ge}=Fh(_,ie);un.push(...se.map(Ce=>Ce.id)),ge||un.push(...Q.map(Ce=>Ce.id))};for(const _ of En){if(Le.has(_.path))continue;const se=Ft.get(_.path)??[],Q=new Set(se.map(ge=>ge.id));$h(_,se,Q,$).forEach(zn)}K.forEach(_=>zn(Yn(_.id)));const tn=n.filter(_=>Ne.has(_.id)),nn=tn.filter(_=>_.lifecycle!=="finished").map(_=>_.id),Dt=tn.filter(_=>_.lifecycle==="finished").map(_=>_.id);function dn(_,se){if(se.metaKey||se.ctrlKey){se.preventDefault(),mt(_.id),st(Q=>{const ge=new Set(Q);return ge.has(_.id)?ge.delete(_.id):ge.add(_.id),ge});return}if(se.shiftKey){se.preventDefault();const Q=Oe??_.id;mt(Q);const ge=un.indexOf(Q),Ce=un.indexOf(_.id);if(ge>=0&&Ce>=0){const[We,je]=ge<Ce?[ge,Ce]:[Ce,ge];st(new Set(un.slice(We,je+1)))}return}at(),mt(_.id),u(_.id)}function nt(_,se){se.preventDefault();const Q=Ne.has(_.id)&&Ne.size>1;Ne.has(_.id)||(st(new Set),mt(_.id)),X({x:se.clientX,y:se.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:Q})}function At(_){var Q;const se=_.origin_app_id?K.find(ge=>ge.id===_.origin_app_id):null;return c.jsx(J1,{s:_,backgroundTaskCount:((Q=s[_.id])==null?void 0:Q.length)??0,isActive:a===_.id,isSelected:Ne.has(_.id),appIcon:se?se.icon??"◧":null,renaming:(re==null?void 0:re.kind)==="session"&&re.id===_.id,renameValue:Te,renameRef:_t,onRenameValue:Pe,onRenameConfirm:ut,onRenameCancel:gt,onSelect:ge=>dn(_,ge),onToggleStar:()=>T(_.id),onCtxMenu:ge=>nt(_,ge)},_.id)}function jt(_){var Q;const se=fl(_,((Q=s[_.id])==null?void 0:Q.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ne.has(_.id)?" selected":""}${se.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ge=>dn(_,ge),onContextMenu:ge=>nt(_,ge),children:[c.jsx(sd,{iconClass:se.iconClass,iconText:se.iconText,size:14}),(re==null?void 0:re.kind)==="session"&&re.id===_.id?c.jsx(fd,{inputRef:_t,value:Te,onChange:Pe,onConfirm:ut,onCancel:gt}):c.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),se.dot&&c.jsx(nd,{status:se.dot,title:se.dotTitle})]},_.id)}function Ut(_,se="workspace"){const{working:Q,finished:ge,finishedCollapsed:Ce}=Fh(_,ie),We=se==="workspace"?At:jt,je=c.jsxs(c.Fragment,{children:[Q.length===0&&ge.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):Q.map(We),ge.length>0&&c.jsxs("div",{className:`tree-subgroup ${Ce?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>me(_.finishedKey),children:[c.jsx(ci,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ge.length})]}),!Ce&&c.jsx("div",{className:"tree-subgroup-items",children:ge.map(We)})]})]});if(se==="app")return je;const et=[...Q,...ge].map(ft=>`s:${ft.id}`);return c.jsx(Oh,{items:et,strategy:Ph,children:je})}return c.jsxs("div",{className:"ide-sidebar",ref:Ue,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:()=>m(),children:c.jsx(Sr,{size:14})})]}),c.jsxs(k1,{sensors:On,collisionDetection:Ew,onDragStart:xt,onDragEnd:Kn,children:[En.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):En.map(_=>{const se=Le.has(_.path),Q=Ft.get(_.path)??[],ge=new Set(Q.map(je=>je.id)),Ce=$h(_,Q,ge,$),We=Ce[Ce.length-1];return c.jsxs("div",{className:`tree-section ${se?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>V(_.path),onContextMenu:je=>{je.preventDefault(),X({x:je.clientX,y:je.clientY,type:"workspace",path:_.path})},children:[c.jsx(ci,{size:9,className:"tree-chevron"}),c.jsx(Au,{size:14}),c.jsx("span",{className:"tree-section-label",children:_.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:je=>{je.stopPropagation(),g(_.path)},children:c.jsx(Sr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:je=>{je.stopPropagation(),Xt(_.path)},children:c.jsx(fu,{size:11})}),c.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!se&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Oh,{items:Q.map(je=>`f:${je.id}`),strategy:Ph,children:Ce.filter(je=>je.folder).map(je=>c.jsx(ek,{folder:je.folder,count:je.sessions.length,collapsed:je.hidden,renaming:(re==null?void 0:re.kind)==="folder"&&re.id===je.folder.id,renameValue:Te,renameRef:_t,onRenameValue:Pe,onRenameConfirm:ut,onRenameCancel:gt,onToggle:()=>Be(je.folder.id),onCtxMenu:et=>{et.preventDefault(),X({x:et.clientX,y:et.clientY,type:"folder",folderId:je.folder.id,folderName:je.folder.name})},children:c.jsx(Uh,{id:`c:${_.path}|${je.folder.id}`,children:Ut(je)})},je.folder.id))}),c.jsx(Uh,{id:`c:${_.path}|root`,children:Ut(We)})]})]},_.path)}),c.jsx($1,{children:Re&&c.jsxs("div",{className:"drag-overlay",children:[Re.kind==="folder"&&c.jsx(Au,{size:12}),c.jsx("span",{children:Re.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:()=>he(),children:c.jsx(Sr,{size:14})})]}),K.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),K.map(_=>{const se=Yn(_.id),Q=se.sessions.length>0&&!se.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${G===_.id?" active":""}`,title:_.description??void 0,onClick:()=>ce(_.id),onContextMenu:ge=>{ge.preventDefault(),X({x:ge.clientX,y:ge.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[se.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${Q?"":" closed"}`,title:"Edit sessions of this app",onClick:ge=>{ge.stopPropagation(),Je(_.id)},children:c.jsx(ci,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:_.icon??"◧"}),c.jsx("span",{className:"tree-label",children:_.title}),se.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:se.sessions.length}),_.pinned&&c.jsx(Xa,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),Q&&c.jsx("div",{className:"sidebar-app-edits",children:Ut(se,"app")})]},_.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(fu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),j&&c.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:j.x,top:j.y,zIndex:500},children:[j.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(j.path),X(null)},children:[c.jsx(Sr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Xt(j.path),X(null)},children:[c.jsx(fu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(j.path),X(null)},children:[c.jsx(gs,{size:12})," Hide Workspace"]})]}),j.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ct("folder",j.folderId,j.folderName??""),X(null)},children:[c.jsx($a,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{U(j.folderId),X(null)},children:[c.jsx(gs,{size:12})," Delete Folder"]})]}),j.type==="session"&&!j.multi&&c.jsx(c.Fragment,{children:j.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ct("session",j.sessionId,j.sessionTitle??""),X(null)},children:[c.jsx($a,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(j.sessionId),X(null)},children:[c.jsx(Ya,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${j.sessionExternalId?"":" ctx-disabled"}`,title:j.sessionExternalId?void 0:"Session not started",onClick:()=>{j.sessionExternalId&&(Lu(j.sessionExternalId),X(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(j.sessionId),X(null)},children:[c.jsx(gs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(j.sessionId),X(null)},children:[c.jsx(ho,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${j.sessionExternalId?"":" ctx-disabled"}`,title:j.sessionExternalId?void 0:"Session not started",onClick:()=>{j.sessionExternalId&&(Lu(j.sessionExternalId),X(null))},children:[c.jsx(Ru,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(j.sessionId),X(null)},children:[c.jsx(gs,{size:12})," Delete Session"]})]})}),j.type==="session"&&j.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[tn.length," sessions selected"]}),nn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(nn),X(null),at()},children:[c.jsx(Ya,{size:12})," Mark ",nn.length," as Finished"]}),Dt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(Dt),X(null),at()},children:[c.jsx(ho,{size:12})," Reopen ",Dt.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{R([...Ne]),X(null),at()},children:[c.jsx(gs,{size:12})," Delete ",tn.length," Sessions"]})]}),j.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{pe(j.appId),X(null)},children:[c.jsx($a,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(j.appId),X(null)},children:[c.jsx(Xa,{size:12})," ",j.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{de(j.appId),X(null)},children:[c.jsx(gs,{size:12})," Delete App"]})]})]})]})}function nk(){const n=D(T=>T.openTabs),s=D(T=>T.activeSessionId),r=D(T=>T.sessions),o=D(T=>T.backgroundTasks),a=D(T=>T.selectSession),u=D(T=>T.closeTab),f=D(T=>T.setShowNewSessionDialog),h=D(T=>T.apps),g=D(T=>T.openAppTabs),m=D(T=>T.activeAppTabId),v=D(T=>T.openAppTab),k=D(T=>T.closeAppTab),x=D(T=>T.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(T=>{var L;const E=r.find(b=>b.id===T);if(!E)return null;const C=fl(E,((L=o[T])==null?void 0:L.length)??0),R=s===T&&m==null;return c.jsxs("div",{className:`ide-tab ${R?"active":""}`,onClick:()=>{m!=null&&x(null),a(T)},children:[c.jsx(sd,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||T.slice(0,8),C.dot&&c.jsx(nd,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:b=>{b.stopPropagation(),u(T)},children:c.jsx(Pn,{size:12})})]},T)}),g.map(T=>{const E=h.find(R=>R.id===T),C=m===T;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>v(T),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(ng,{size:12}),(E==null?void 0:E.title)??T,c.jsx("span",{className:"ide-tab-close",onClick:R=>{R.stopPropagation(),k(T)},children:c.jsx(Pn,{size:12})})]},T)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(Sr,{size:14})})]})}function pd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Cr=pd();function Pg(n){Cr=n}var co={exec:()=>null};function tt(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(vn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var vn={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")},sk=/^(?:[ \t]*(?:\n|$))+/,rk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ik=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,So=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ok=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hd=/(?:[*+-]|\d{1,9}[.)])/,Og=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zg=tt(Og).replace(/bull/g,hd).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(),ak=tt(Og).replace(/bull/g,hd).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(),md=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,lk=/^[^\n]+/,gd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ck=tt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),uk=tt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hd).getRegex(),kl="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",vd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dk=tt("^ {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",vd).replace("tag",kl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$g=tt(md).replace("hr",So).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",kl).getRegex(),fk=tt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$g).getRegex(),yd={blockquote:fk,code:rk,def:ck,fences:ik,heading:ok,hr:So,html:dk,lheading:zg,list:uk,newline:sk,paragraph:$g,table:co,text:lk},Bh=tt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",So).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",kl).getRegex(),pk={...yd,lheading:ak,table:Bh,paragraph:tt(md).replace("hr",So).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bh).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",kl).getRegex()},hk={...yd,html:tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vd).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:co,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tt(md).replace("hr",So).replace("heading",` *#{1,6} *[^
|
|
399
|
-
]`).replace("lheading",zg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fg=/^( {2,}|\\)\n(?!\s*$)/,vk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Sl=/[\p{P}\p{S}]/u,xd=/[\s\p{P}\p{S}]/u,Ug=/[^\s\p{P}\p{S}]/u,yk=tt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xd).getRegex(),Bg=/(?!~)[\p{P}\p{S}]/u,xk=/(?!~)[\s\p{P}\p{S}]/u,wk=/(?:[^\s\p{P}\p{S}]|~)/u,kk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Wg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Sk=tt(Wg,"u").replace(/punct/g,Sl).getRegex(),Tk=tt(Wg,"u").replace(/punct/g,Bg).getRegex(),Hg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bk=tt(Hg,"gu").replace(/notPunctSpace/g,Ug).replace(/punctSpace/g,xd).replace(/punct/g,Sl).getRegex(),Nk=tt(Hg,"gu").replace(/notPunctSpace/g,wk).replace(/punctSpace/g,xk).replace(/punct/g,Bg).getRegex(),Ck=tt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ug).replace(/punctSpace/g,xd).replace(/punct/g,Sl).getRegex(),Ek=tt(/\\(punct)/,"gu").replace(/punct/g,Sl).getRegex(),_k=tt(/^<(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(),jk=tt(vd).replace("(?:-->|$)","-->").getRegex(),Rk=tt("^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",jk).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),il=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ak=tt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",il).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vg=tt(/^!?\[(label)\]\[(ref)\]/).replace("label",il).replace("ref",gd).getRegex(),qg=tt(/^!?\[(ref)\](?:\[\])?/).replace("ref",gd).getRegex(),Ik=tt("reflink|nolink(?!\\()","g").replace("reflink",Vg).replace("nolink",qg).getRegex(),wd={_backpedal:co,anyPunctuation:Ek,autolink:_k,blockSkip:kk,br:Fg,code:gk,del:co,emStrongLDelim:Sk,emStrongRDelimAst:bk,emStrongRDelimUnd:Ck,escape:mk,link:Ak,nolink:qg,punctuation:yk,reflink:Vg,reflinkSearch:Ik,tag:Rk,text:vk,url:co},Mk={...wd,link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",il).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",il).getRegex()},Pu={...wd,emStrongRDelimAst:Nk,emStrongLDelim:Tk,url:tt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Dk={...Pu,br:tt(Fg).replace("{2,}","*").getRegex(),text:tt(Pu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Da={normal:yd,gfm:pk,pedantic:hk},Zi={normal:wd,gfm:Pu,breaks:Dk,pedantic:Mk},Lk={"&":"&","<":"<",">":">",'"':""","'":"'"},Wh=n=>Lk[n];function ms(n,s){if(s){if(vn.escapeTest.test(n))return n.replace(vn.escapeReplace,Wh)}else if(vn.escapeTestNoEncode.test(n))return n.replace(vn.escapeReplaceNoEncode,Wh);return n}function Hh(n){try{n=encodeURI(n).replace(vn.percentDecode,"%")}catch{return null}return n}function Vh(n,s){var u;const r=n.replace(vn.findPipe,(f,h,g)=>{let m=!1,v=h;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(vn.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(vn.slashPipe,"|");return o}function Ji(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 Pk(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 qh(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 g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,g}function Ok(n,s,r){const o=n.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
|
|
400
|
-
`).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(`
|
|
401
|
-
`)}var ol=class{constructor(n){ot(this,"options");ot(this,"rules");ot(this,"lexer");this.options=n||Cr}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:Ji(r,`
|
|
402
|
-
`)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=Ok(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=Ji(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:Ji(s[0],`
|
|
403
|
-
`)}}blockquote(n){const s=this.rules.block.blockquote.exec(n);if(s){let r=Ji(s[0],`
|
|
404
|
-
`).split(`
|
|
405
|
-
`),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))h.push(r[g]),f=!0;else if(!f)h.push(r[g]);else break;r=r.slice(g);const m=h.join(`
|
|
406
|
-
`),v=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
407
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
408
|
-
${m}`:m,a=a?`${a}
|
|
409
|
-
${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,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+`
|
|
410
|
-
`+r.join(`
|
|
411
|
-
`),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+`
|
|
412
|
-
`+r.join(`
|
|
413
|
-
`),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(`
|
|
414
|
-
`);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 g=!1,m="",v="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;m=s[0],n=n.substring(m.length);let k=s[2].split(`
|
|
415
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,L=>" ".repeat(3*L.length)),x=n.split(`
|
|
416
|
-
`,1)[0],T=!k.trim(),E=0;if(this.options.pedantic?(E=2,v=k.trimStart()):T?E=s[1].length+1:(E=s[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,v=k.slice(E),E+=s[1].length),T&&this.rules.other.blankLine.test(x)&&(m+=x+`
|
|
417
|
-
`,n=n.substring(x.length+1),g=!0),!g){const L=this.rules.other.nextBulletRegex(E),b=this.rules.other.hrRegex(E),U=this.rules.other.fencesBeginRegex(E),P=this.rules.other.headingBeginRegex(E),W=this.rules.other.htmlBeginRegex(E);for(;n;){const K=n.split(`
|
|
418
|
-
`,1)[0];let q;if(x=K,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),q=x):q=x.replace(this.rules.other.tabCharGlobal," "),U.test(x)||P.test(x)||W.test(x)||L.test(x)||b.test(x))break;if(q.search(this.rules.other.nonSpaceChar)>=E||!x.trim())v+=`
|
|
419
|
-
`+q.slice(E);else{if(T||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(k)||P.test(k)||b.test(k))break;v+=`
|
|
420
|
-
`+x}!T&&!x.trim()&&(T=!0),m+=K+`
|
|
421
|
-
`,n=n.substring(K.length+1),k=q.slice(E)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0));let C=null,R;this.options.gfm&&(C=this.rules.other.listIsTask.exec(v),C&&(R=C[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:m,task:!!C,checked:R,loose:!1,text:v,tokens:[]}),a.raw+=m}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 g=0;g<a.items.length;g++)if(this.lexer.state.top=!1,a.items[g].tokens=this.lexer.blockTokens(a.items[g].text,[]),!a.loose){const m=a.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=v}if(a.loose)for(let g=0;g<a.items.length;g++)a.items[g].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=Vh(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(`
|
|
422
|
-
`):[],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(Vh(h,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));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)===`
|
|
423
|
-
`?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=Ji(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=Pk(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)),qh(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 qh(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,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,s=s.slice(-1*n.length+u);(o=v.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]){g+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){m+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g+m);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 Ou{constructor(s){ot(this,"tokens");ot(this,"options");ot(this,"state");ot(this,"tokenizer");ot(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Cr,this.options.tokenizer=this.options.tokenizer||new ol,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:vn,block:Da.normal,inline:Zi.normal};this.options.pedantic?(r.block=Da.pedantic,r.inline=Zi.pedantic):this.options.gfm&&(r.block=Da.gfm,this.options.breaks?r.inline=Zi.breaks:r.inline=Zi.gfm),this.tokenizer.rules=r}static get rules(){return{block:Da,inline:Zi}}static lex(s,r){return new Ou(r).lex(s)}static lexInline(s,r){return new Ou(r).inlineTokens(s)}lex(s){s=s.replace(vn.carriageReturn,`
|
|
424
|
-
`),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(vn.tabCharGlobal," ").replace(vn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(m=>(h=m.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 m=r.at(-1);h.raw.length===1&&m!==void 0?m.raw+=`
|
|
425
|
-
`:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
426
|
-
`+h.raw,m.text+=`
|
|
427
|
-
`+h.text,this.inlineQueue.at(-1).src=m.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 m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
428
|
-
`+h.raw,m.text+=`
|
|
429
|
-
`+h.raw,this.inlineQueue.at(-1).src=m.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 g=s;if((f=this.options.extensions)!=null&&f.startBlock){let m=1/0;const v=s.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},v),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(g=s.substring(0,m+1))}if(this.state.top&&(h=this.tokenizer.paragraph(g))){const m=r.at(-1);o&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=`
|
|
430
|
-
`+h.raw,m.text+=`
|
|
431
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(h),o=g.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
432
|
-
`+h.raw,m.text+=`
|
|
433
|
-
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(h);continue}if(s){const m="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,g,m;let o=s,a=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.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 v;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(x=>(v=x.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);const x=r.at(-1);v.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,o,f)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let k=s;if((m=this.options.extensions)!=null&&m.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(v=this.tokenizer.inlineText(k)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(f=v.raw.slice(-1)),u=!0;const x=r.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):r.push(v);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}},al=class{constructor(n){ot(this,"options");ot(this,"parser");this.options=n||Cr}space(n){return""}code({text:n,lang:s,escaped:r}){var u;const o=(u=(s||"").match(vn.notSpaceStart))==null?void 0:u[0],a=n.replace(vn.endingNewline,"")+`
|
|
434
|
-
`;return o?'<pre><code class="language-'+ms(o)+'">'+(r?a:ms(a,!0))+`</code></pre>
|
|
435
|
-
`:"<pre><code>"+(r?a:ms(a,!0))+`</code></pre>
|
|
436
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
437
|
-
${this.parser.parse(n)}</blockquote>
|
|
438
|
-
`}html({text:n}){return n}heading({tokens:n,depth:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
|
|
439
|
-
`}hr(n){return`<hr>
|
|
440
|
-
`}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+`>
|
|
441
|
-
`+o+"</"+a+`>
|
|
442
|
-
`}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+" "+ms(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>
|
|
443
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
444
|
-
`}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>
|
|
445
|
-
<thead>
|
|
446
|
-
`+s+`</thead>
|
|
447
|
-
`+o+`</table>
|
|
448
|
-
`}tablerow({text:n}){return`<tr>
|
|
449
|
-
${n}</tr>
|
|
450
|
-
`}tablecell(n){const s=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+s+`</${r}>
|
|
451
|
-
`}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>${ms(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=Hh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return s&&(u+=' title="'+ms(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=Hh(n);if(a===null)return ms(r);n=a;let u=`<img src="${n}" alt="${r}"`;return s&&(u+=` title="${ms(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ms(n.text)}},kd=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 zu{constructor(s){ot(this,"options");ot(this,"renderer");ot(this,"textRenderer");this.options=s||Cr,this.options.renderer=this.options.renderer||new al,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kd}static parse(s,r){return new zu(r).parse(s)}static parseInline(s,r){return new zu(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 m=h,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=h;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;f+1<s.length&&s[f+1].type==="text";)m=s[++f],v+=`
|
|
452
|
-
`+this.renderer.text(m);r?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}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 m=this.options.extensions.renderers[h.type].call({parser:this},h);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=m||"";continue}}const g=h;switch(g.type){case"escape":{o+=r.text(g);break}case"html":{o+=r.html(g);break}case"link":{o+=r.link(g);break}case"image":{o+=r.image(g);break}case"strong":{o+=r.strong(g);break}case"em":{o+=r.em(g);break}case"codespan":{o+=r.codespan(g);break}case"br":{o+=r.br(g);break}case"del":{o+=r.del(g);break}case"text":{o+=r.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},bu,Ua=(bu=class{constructor(n){ot(this,"options");ot(this,"block");this.options=n||Cr}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}},ot(bu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),bu),zk=class{constructor(...n){ot(this,"defaults",pd());ot(this,"options",this.setOptions);ot(this,"parse",this.parseMarkdown(!0));ot(this,"parseInline",this.parseMarkdown(!1));ot(this,"Parser",Rs);ot(this,"Renderer",al);ot(this,"TextRenderer",kd);ot(this,"Lexer",js);ot(this,"Tokenizer",ol);ot(this,"Hooks",Ua);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 g of h)r=r.concat(this.walkTokens(g.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 g=f[h].flat(1/0);r=r.concat(this.walkTokens(g,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 al(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],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v||""}}o.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new ol(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],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new Ua;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],g=a[f];Ua.passThroughHooks.has(u)?a[f]=m=>{if(this.defaults.async)return Promise.resolve(h.call(a,m)).then(k=>g.call(a,k));const v=h.call(a,m);return g.call(a,v)}:a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}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,g=u.hooks?u.hooks.provideParser():n?Rs.parse:Rs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(m=>h(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(f);try{u.hooks&&(r=u.hooks.preprocess(r));let m=h(r,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return f(m)}}}onError(n,s){return r=>{if(r.message+=`
|
|
453
|
-
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ms(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},br=new zk;function qe(n,s){return br.parse(n,s)}qe.options=qe.setOptions=function(n){return br.setOptions(n),qe.defaults=br.defaults,Pg(qe.defaults),qe};qe.getDefaults=pd;qe.defaults=Cr;qe.use=function(...n){return br.use(...n),qe.defaults=br.defaults,Pg(qe.defaults),qe};qe.walkTokens=function(n,s){return br.walkTokens(n,s)};qe.parseInline=br.parseInline;qe.Parser=Rs;qe.parser=Rs.parse;qe.Renderer=al;qe.TextRenderer=kd;qe.Lexer=js;qe.lexer=js.lex;qe.Tokenizer=ol;qe.Hooks=Ua;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.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 Gh(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 $k(n){if(Array.isArray(n))return n}function Fk(n,s){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,a,u,f,h=[],g=!0,m=!1;try{if(u=(r=r.call(n)).next,s!==0)for(;!(g=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);g=!0);}catch(v){m=!0,a=v}finally{try{if(!g&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(m)throw a}}return h}}function Uk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
454
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bk(n,s){return $k(n)||Fk(n,s)||Wk(n,s)||Uk()}function Wk(n,s){if(n){if(typeof n=="string")return Gh(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)?Gh(n,s):void 0}}const Gg=Object.entries,Kh=Object.setPrototypeOf,Hk=Object.isFrozen,Vk=Object.getPrototypeOf,qk=Object.getOwnPropertyDescriptor;let Jt=Object.freeze,en=Object.seal,ri=Object.create,Kg=typeof Reflect<"u"&&Reflect,$u=Kg.apply,Fu=Kg.construct;Jt||(Jt=function(s){return s});en||(en=function(s){return s});$u||($u=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)});Fu||(Fu=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 ti=Pt(Array.prototype.forEach),Gk=Pt(Array.prototype.lastIndexOf),Yh=Pt(Array.prototype.pop),ni=Pt(Array.prototype.push),Kk=Pt(Array.prototype.splice),er=Array.isArray,ro=Pt(String.prototype.toLowerCase),vu=Pt(String.prototype.toString),Xh=Pt(String.prototype.match),eo=Pt(String.prototype.replace),Qh=Pt(String.prototype.indexOf),Yk=Pt(String.prototype.trim),Xk=Pt(Number.prototype.toString),Qk=Pt(Boolean.prototype.toString),Zh=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Jh=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),qt=Pt(Object.prototype.hasOwnProperty),to=Pt(Object.prototype.toString),Vt=Pt(RegExp.prototype.test),kr=Zk(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 $u(n,s,o)}}function Zk(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Fu(n,r)}}function Ve(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ro;if(Kh&&Kh(n,null),!er(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(Hk(s)||(s[o]=u),a=u)}n[a]=!0}return n}function Jk(n){for(let s=0;s<n.length;s++)qt(n,s)||(n[s]=null);return n}function cn(n){const s=ri(null);for(const o of Gg(n)){var r=Bk(o,2);const a=r[0],u=r[1];qt(n,a)&&(er(u)?s[a]=Jk(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function eS(n){switch(typeof n){case"string":return n;case"number":return Xk(n);case"boolean":return Qk(n);case"bigint":return Zh?Zh(n):"0";case"symbol":return Jh?Jh(n):"Symbol()";case"undefined":return to(n);case"function":case"object":{if(n===null)return to(n);const s=n,r=ss(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:to(o)}return to(n)}default:return to(n)}}function ss(n,s){for(;n!==null;){const o=qk(n,s);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}n=Vk(n)}function r(){return null}return r}function tS(n){try{return Vt(n,""),!0}catch{return!1}}const em=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"]),yu=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"]),xu=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"]),nS=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"]),wu=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"]),sS=Jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),tm=Jt(["#text"]),nm=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"]),ku=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"]),sm=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"]),La=Jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rS=en(/{{[\w\W]*|^[\w\W]*}}/g),iS=en(/<%[\w\W]*|^[\w\W]*%>/g),oS=en(/\${[\w\W]*/g),aS=en(/^data-[\-\w.\u00B7-\uFFFF]+$/),lS=en(/^aria-[\-\w]+$/),rm=en(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cS=en(/^(?:\w+script|data):/i),uS=en(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dS=en(/^html$/i),fS=en(/^[a-z][.\w]*(-[.\w]+)+$/i),im=en(/<[/\w!]/g),om=en(/<[/\w]/g),pS=en(/<\/no(script|embed|frames)/i),hS=en(/\/>/i),Mn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mS=function(){return typeof window>"u"?null:window},gS=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}},am=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Zs=function(s,r,o,a){return qt(s,r)&&er(s[r])?Ve(a.base?cn(a.base):{},s[r],a.transform):o};function Yg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mS();const s=oe=>Yg(oe);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==Mn.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,g=n.NodeFilter,m=n.NamedNodeMap;m===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,k=n.trustedTypes,x=h.prototype,T=ss(x,"cloneNode"),E=ss(x,"remove"),C=ss(x,"nextSibling"),R=ss(x,"childNodes"),L=ss(x,"parentNode"),b=ss(x,"shadowRoot"),U=ss(x,"attributes"),P=f&&f.prototype?ss(f.prototype,"nodeType"):null,W=f&&f.prototype?ss(f.prototype,"nodeName"):null,K=f&&f.prototype?ss(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const oe=r.createElement("template");oe.content&&oe.content.ownerDocument&&(r=oe.content.ownerDocument)}let q,G="",ce,pe=!1,ue=0;const de=function(){if(ue>0)throw kr('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.')},he=function(S){de(),ue++;try{return q.createHTML(S)}finally{ue--}},Le=function(S){de(),ue++;try{return q.createScriptURL(S)}finally{ue--}},te=function(){return pe||(ce=gS(k,a),pe=!0),ce},ie=r,le=ie.implementation,$=ie.createNodeIterator,Y=ie.createDocumentFragment,H=ie.getElementsByTagName,A=o.importNode;let j=am();s.isSupported=typeof Gg=="function"&&typeof L=="function"&&le&&le.createHTMLDocument!==void 0;const X=rS,re=iS,ve=oS,Te=aS,Pe=lS,Re=cS,De=uS,Ne=fS;let st=rm,Oe=null;const mt=Ve({},[...em,...yu,...xu,...wu,...tm]);let Fe=null;const _t=Ve({},[...nm,...ku,...sm,...La]);let Ue=Object.seal(ri(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}})),Yt=null,On=null;const at=Object.seal(ri(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let yt=!0,lt=!0,Ft=!1,V=!0,me=!1,Be=!0,Je=!1,ct=!1,ut=null,gt=null,Xt=!1,xt=!1,Kn=!1,En=!1,ys=!0,Yn=!1;const un="user-content-";let zn=!0,tn=!1,nn={},Dt=null;const dn=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 nt=null;const At=Ve({},["audio","video","img","source","image","track"]);let jt=null;const Ut=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",Q="http://www.w3.org/1999/xhtml";let ge=Q,Ce=!1,We=null;const je=Ve({},[_,se,Q],vu),et=Jt(["mi","mo","mn","ms","mtext"]);let ft=Ve({},et);const wt=Jt(["annotation-xml"]);let kt=Ve({},wt);const sn=Ve({},["title","style","font","a","script"]);let fn=null;const ls=["application/xhtml+xml","text/html"],Is="text/html";let Ee=null,it=null;const Xn=r.createElement("form"),To=function(S){return S instanceof RegExp||S instanceof Function},Er=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(it&&it===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),fn=ls.indexOf(S.PARSER_MEDIA_TYPE)===-1?Is:S.PARSER_MEDIA_TYPE,Ee=fn==="application/xhtml+xml"?vu:ro,Oe=Zs(S,"ALLOWED_TAGS",mt,{transform:Ee}),Fe=Zs(S,"ALLOWED_ATTR",_t,{transform:Ee}),We=Zs(S,"ALLOWED_NAMESPACES",je,{transform:vu}),jt=Zs(S,"ADD_URI_SAFE_ATTR",Ut,{transform:Ee,base:Ut}),nt=Zs(S,"ADD_DATA_URI_TAGS",At,{transform:Ee,base:At}),Dt=Zs(S,"FORBID_CONTENTS",dn,{transform:Ee}),Yt=Zs(S,"FORBID_TAGS",cn({}),{transform:Ee}),On=Zs(S,"FORBID_ATTR",cn({}),{transform:Ee}),nn=qt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,yt=S.ALLOW_ARIA_ATTR!==!1,lt=S.ALLOW_DATA_ATTR!==!1,Ft=S.ALLOW_UNKNOWN_PROTOCOLS||!1,V=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=S.SAFE_FOR_TEMPLATES||!1,Be=S.SAFE_FOR_XML!==!1,Je=S.WHOLE_DOCUMENT||!1,xt=S.RETURN_DOM||!1,Kn=S.RETURN_DOM_FRAGMENT||!1,En=S.RETURN_TRUSTED_TYPE||!1,Xt=S.FORCE_BODY||!1,ys=S.SANITIZE_DOM!==!1,Yn=S.SANITIZE_NAMED_PROPS||!1,zn=S.KEEP_CONTENT!==!1,tn=S.IN_PLACE||!1,st=tS(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:rm,ge=typeof S.NAMESPACE=="string"?S.NAMESPACE:Q,ft=qt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ve({},et),kt=qt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ve({},wt);const O=qt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):ri(null);if(Ue=ri(null),qt(O,"tagNameCheck")&&To(O.tagNameCheck)&&(Ue.tagNameCheck=O.tagNameCheck),qt(O,"attributeNameCheck")&&To(O.attributeNameCheck)&&(Ue.attributeNameCheck=O.attributeNameCheck),qt(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(Ue.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),en(Ue),me&&(lt=!1),Kn&&(xt=!0),nn&&(Oe=Ve({},tm),Fe=ri(null),nn.html===!0&&(Ve(Oe,em),Ve(Fe,nm)),nn.svg===!0&&(Ve(Oe,yu),Ve(Fe,ku),Ve(Fe,La)),nn.svgFilters===!0&&(Ve(Oe,xu),Ve(Fe,ku),Ve(Fe,La)),nn.mathMl===!0&&(Ve(Oe,wu),Ve(Fe,sm),Ve(Fe,La))),at.tagCheck=null,at.attributeCheck=null,qt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?at.tagCheck=S.ADD_TAGS:er(S.ADD_TAGS)&&(Oe===mt&&(Oe=cn(Oe)),Ve(Oe,S.ADD_TAGS,Ee))),qt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?at.attributeCheck=S.ADD_ATTR:er(S.ADD_ATTR)&&(Fe===_t&&(Fe=cn(Fe)),Ve(Fe,S.ADD_ATTR,Ee))),qt(S,"ADD_URI_SAFE_ATTR")&&er(S.ADD_URI_SAFE_ATTR)&&Ve(jt,S.ADD_URI_SAFE_ATTR,Ee),qt(S,"FORBID_CONTENTS")&&er(S.FORBID_CONTENTS)&&(Dt===dn&&(Dt=cn(Dt)),Ve(Dt,S.FORBID_CONTENTS,Ee)),qt(S,"ADD_FORBID_CONTENTS")&&er(S.ADD_FORBID_CONTENTS)&&(Dt===dn&&(Dt=cn(Dt)),Ve(Dt,S.ADD_FORBID_CONTENTS,Ee)),zn&&(Oe["#text"]=!0),Je&&Ve(Oe,["html","head","body"]),Oe.table&&(Ve(Oe,["tbody"]),delete Yt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw kr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=q;q=S.TRUSTED_TYPES_POLICY;try{G=he("")}catch(ke){throw q=Z,ke}}else S.TRUSTED_TYPES_POLICY===null?(q=void 0,G=""):(q===void 0&&(q=te()),q&&typeof G=="string"&&(G=he("")));Jt&&Jt(S),it=S},gi=Ve({},[...yu,...xu,...nS]),vi=Ve({},[...wu,...sS]),bo=function(S,O,Z){return O.namespaceURI===Q?S==="svg":O.namespaceURI===_?S==="svg"&&(Z==="annotation-xml"||ft[Z]):!!gi[S]},Tl=function(S,O,Z){return O.namespaceURI===Q?S==="math":O.namespaceURI===se?S==="math"&&kt[Z]:!!vi[S]},bl=function(S,O,Z){return O.namespaceURI===se&&!kt[Z]||O.namespaceURI===_&&!ft[Z]?!1:!vi[S]&&(sn[S]||!gi[S])},St=function(S){let O=L(S);(!O||!O.tagName)&&(O={namespaceURI:ge,tagName:"template"});const Z=ro(S.tagName),ke=ro(O.tagName);return We[S.namespaceURI]?S.namespaceURI===se?bo(Z,O,ke):S.namespaceURI===_?Tl(Z,O,ke):S.namespaceURI===Q?bl(Z,O,ke):!!(fn==="application/xhtml+xml"&&We[S.namespaceURI]):!1},cs=function(S){ni(s.removed,{element:S});try{L(S).removeChild(S)}catch{if(E(S),!L(S))throw kr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ms=function(S){nr(S);const O=R(S);if(O){const ke=[];ti(O,_e=>{ni(ke,_e)}),ti(ke,_e=>{try{E(_e)}catch{}})}const Z=U(S);if(Z)for(let ke=Z.length-1;ke>=0;--ke){const _e=Z[ke],$e=_e&&_e.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},us=function(S,O){try{ni(s.removed,{attribute:O.getAttributeNode(S),from:O})}catch{ni(s.removed,{attribute:null,from:O})}if(O.removeAttribute(S),S==="is")if(xt||Kn)try{cs(O)}catch{}else try{O.setAttribute(S,"")}catch{}},_r=function(S){const O=U(S);if(O)for(let Z=O.length-1;Z>=0;--Z){const ke=O[Z],_e=ke&&ke.name;if(!(typeof _e!="string"||Fe[Ee(_e)]))try{S.removeAttribute(_e)}catch{}}},nr=function(S){const O=[S];for(;O.length>0;){const Z=O.pop();(P?P(Z):Z.nodeType)===Mn.element&&_r(Z);const _e=R(Z);if(_e)for(let $e=_e.length-1;$e>=0;--$e)O.push(_e[$e])}},No=function(S){if(!Be)return;const O=[S];for(;O.length>0;){const Z=O.pop(),ke=P?P(Z):Z.nodeType;if(ke===Mn.processingInstruction||ke===Mn.comment&&Vt(om,Z.data)){try{E(Z)}catch{}continue}if(ke===Mn.element){const $e=Z,Ke=Ee(W?W(Z):Z.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&$e.removeAttribute("for")}catch{}}const _e=R(Z);if(_e)for(let $e=_e.length-1;$e>=0;--$e)O.push(_e[$e])}},sr=function(S){let O=null,Z=null;if(Xt)S="<remove></remove>"+S;else{const $e=Xh(S,/^[\r\n\t ]+/);Z=$e&&$e[0]}fn==="application/xhtml+xml"&&ge===Q&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ke=q?he(S):S;if(ge===Q)try{O=new v().parseFromString(ke,fn)}catch{}if(!O||!O.documentElement){O=le.createDocument(ge,"template",null);try{O.documentElement.innerHTML=Ce?G:ke}catch{}}const _e=O.body||O.documentElement;return S&&Z&&_e.insertBefore(r.createTextNode(Z),_e.childNodes[0]||null),ge===Q?H.call(O,Je?"html":"body")[0]:Je?O.documentElement:_e},_n=function(S){const O=K?K(S):S.ownerDocument;return $.call(O||S,S,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},jr=function(S){return S=eo(S,X," "),S=eo(S,re," "),S=eo(S,ve," "),S},pn=function(S){var O;S.normalize();const Z=K?K(S):S.ownerDocument,ke=$.call(Z||S,S,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let _e=ke.nextNode();for(;_e;)_e.data=jr(_e.data),_e=ke.nextNode();const $e=(O=S.querySelectorAll)===null||O===void 0?void 0:O.call(S,"template");$e&&ti($e,Ke=>{Ds(Ke.content)&&pn(Ke.content)})},Rr=function(S){const O=W?W(S):null;return typeof O!="string"||Ee(O)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==U(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==P(S)||S.childNodes!==R(S)},Ds=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return P(S)===Mn.documentFragment}catch{return!1}},rr=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return typeof P(S)=="number"}catch{return!1}};function hn(oe,S,O){oe.length!==0&&ti(oe,Z=>{Z.call(s,S,O,it)})}const Ar=function(S,O){return!!(Be&&S.hasChildNodes()&&!rr(S.firstElementChild)&&Vt(im,S.textContent)&&Vt(im,S.innerHTML)||Be&&S.namespaceURI===Q&&O==="style"&&rr(S.firstElementChild)||S.nodeType===Mn.processingInstruction||Be&&S.nodeType===Mn.comment&&Vt(om,S.data))},ir=function(S,O,Z){if(!Yt[O]&&xi(O)&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,O)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(O)))return!1;if(zn&&!Dt[O]){const ke=L(S),_e=R(S);if(_e&&ke){const $e=_e.length;for(let Ke=$e-1;Ke>=0;--Ke){const Xe=S===Z?T(_e[Ke],!0):_e[Ke];ke.insertBefore(Xe,C(S))}}}return cs(S),!0},or=function(S,O,Z,ke){return S.length===0?O:O===Z||O===ke?cn(O):O},Co=function(S,O){if(hn(j.beforeSanitizeElements,S,null),S!==O&&L(S)===null)return tn&&nr(S),!0;if(Rr(S))return cs(S),!0;const Z=Ee(W?W(S):S.nodeName);if(Oe=or(j.uponSanitizeElement,Oe,mt,ut),hn(j.uponSanitizeElement,S,{tagName:Z,allowedTags:Oe}),S!==O&&L(S)===null)return tn&&nr(S),!0;if(Ar(S,Z))return cs(S),!0;if(Yt[Z]||!(at.tagCheck instanceof Function&&at.tagCheck(Z))&&!Oe[Z]){const _e=ir(S,Z,O);return _e===!1&&hn(j.afterSanitizeElements,S,null),_e}if((P?P(S):S.nodeType)===Mn.element&&!St(S)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Vt(pS,S.innerHTML))return cs(S),!0;if(me&&S.nodeType===Mn.text){const _e=jr(S.textContent);S.textContent!==_e&&(ni(s.removed,{element:S.cloneNode()}),S.textContent=_e)}return hn(j.afterSanitizeElements,S,null),!1},Eo=function(S,O,Z){if(On[O]||Be&&O==="patchsrc"||Be&&O==="for"&&S!=="label"&&S!=="output"||ys&&(O==="id"||O==="name")&&(Z in r||Z in Xn))return!1;const ke=Fe[O]||at.attributeCheck instanceof Function&&at.attributeCheck(O,S);if(!(lt&&Vt(Te,O))){if(!(yt&&Vt(Pe,O))){if(ke){if(!jt[O]){if(!Vt(st,eo(Z,De,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&S!=="script"&&Qh(Z,"data:")===0&&nt[S])){if(!(Ft&&!Vt(Re,eo(Z,De,"")))){if(Z)return!1}}}}}else if(!(xi(S)&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,S)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(S))&&(Ue.attributeNameCheck instanceof RegExp&&Vt(Ue.attributeNameCheck,O)||Ue.attributeNameCheck instanceof Function&&Ue.attributeNameCheck(O,S))||O==="is"&&Ue.allowCustomizedBuiltInElements&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,Z)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(Z))))return!1}}return!0},yi=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),xi=function(S){return!yi[ro(S)]&&Vt(Ne,S)},wi=function(S,O,Z,ke){if(q&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Z)switch(k.getAttributeType(S,O)){case"TrustedHTML":return he(ke);case"TrustedScriptURL":return Le(ke)}return ke},ar=function(S,O,Z,ke){try{Z?S.setAttributeNS(Z,O,ke):S.setAttribute(O,ke),Rr(S)?cs(S):Yh(s.removed)}catch{us(O,S)}},_o=function(S){hn(j.beforeSanitizeAttributes,S,null);const O=S.attributes;if(!O||Rr(S))return;Fe=or(j.uponSanitizeAttribute,Fe,_t,gt);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0};let ke=O.length;const _e=Ee(S.nodeName);for(;ke--;){const $e=O[ke],Ke=$e.name,Xe=$e.namespaceURI,Tt=$e.value,bt=Ee(Ke),xs=Tt;let It=Ke==="value"?xs:Yk(xs);if(Z.attrName=bt,Z.attrValue=It,Z.keepAttr=!0,Z.forceKeepAttr=void 0,hn(j.uponSanitizeAttribute,S,Z),It=Z.attrValue,Yn&&(bt==="id"||bt==="name")&&Qh(It,un)!==0&&(us(Ke,S),It=un+It),Be&&Vt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){us(Ke,S);continue}if(bt==="attributename"&&Xh(It,"href")){us(Ke,S);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){us(Ke,S);continue}if(!V&&Vt(hS,It)){us(Ke,S);continue}if(me&&(It=jr(It)),!Eo(_e,bt,It)){us(Ke,S);continue}It=wi(_e,bt,Xe,It),It!==xs&&ar(S,Ke,Xe,It)}}hn(j.afterSanitizeAttributes,S,null)},Ls=function(S){let O=null;const Z=_n(S);for(hn(j.beforeSanitizeShadowDOM,S,null);O=Z.nextNode();)if(hn(j.uponSanitizeShadowNode,O,null),Co(O,S),_o(O),Ds(O.content)&&Ls(O.content),(P?P(O):O.nodeType)===Mn.element){const _e=b(O);Ds(_e)&&(Ge(_e),Ls(_e))}hn(j.afterSanitizeShadowDOM,S,null)},Ge=function(S){const O=[{node:S,shadow:null}];for(;O.length>0;){const Z=O.pop();if(Z.shadow){Ls(Z.shadow);continue}const ke=Z.node,$e=(P?P(ke):ke.nodeType)===Mn.element,Ke=R(ke);if(Ke)for(let Xe=Ke.length-1;Xe>=0;--Xe)O.push({node:Ke[Xe],shadow:null});if($e){const Xe=W?W(ke):null;if(typeof Xe=="string"&&Ee(Xe)==="template"){const Tt=ke.content;Ds(Tt)&&O.push({node:Tt,shadow:null})}}if($e){const Xe=b(ke);Ds(Xe)&&O.push({node:null,shadow:Xe},{node:Xe,shadow:null})}}};return s.sanitize=function(oe){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,Z=null,ke=null,_e=null;if(Ce=!oe,Ce&&(oe="<!-->"),typeof oe!="string"&&!rr(oe)&&(oe=eS(oe),typeof oe!="string"))throw kr("dirty is not a string, aborting");if(!s.isSupported)return oe;ct?(Oe=ut,Fe=gt):Er(S),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(Oe=cn(Oe)),j.uponSanitizeAttribute.length>0&&(Fe=cn(Fe)),s.removed=[];const $e=tn&&typeof oe!="string"&&rr(oe);if($e){No(oe);const Tt=W?W(oe):oe.nodeName;if(typeof Tt=="string"){const bt=Ee(Tt);if(!Oe[bt]||Yt[bt])throw Ms(oe),kr("root node is forbidden and cannot be sanitized in-place")}if(Rr(oe))throw Ms(oe),kr("root node is clobbered and cannot be sanitized in-place");try{Ge(oe)}catch(bt){throw Ms(oe),bt}}else if(rr(oe))O=sr("<!---->"),Z=O.ownerDocument.importNode(oe,!0),Z.nodeType===Mn.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?O=Z:O.appendChild(Z),Ge(Z);else{if(!xt&&!me&&!Je&&oe.indexOf("<")===-1)return q&&En?he(oe):oe;if(O=sr(oe),!O)return xt?null:En?G:""}O&&Xt&&cs(O.firstChild);const Ke=$e?oe:O;try{const Tt=_n(Ke);for(;ke=Tt.nextNode();)Co(ke,Ke),_o(ke),Ds(ke.content)&&Ls(ke.content)}catch(Tt){throw $e&&(Ms(oe),ti(s.removed,bt=>{bt.element&&nr(bt.element)})),Tt}if($e)return ti(s.removed,Tt=>{Tt.element&&nr(Tt.element)}),me&&pn(oe),oe;if(xt){if(me&&pn(O),Kn)for(_e=Y.call(O.ownerDocument);O.firstChild;)_e.appendChild(O.firstChild);else _e=O;return(Fe.shadowroot||Fe.shadowrootmode)&&(_e=A.call(o,_e,!0)),_e}let Xe=Je?O.outerHTML:O.innerHTML;return Je&&Oe["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Vt(dS,O.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
455
|
-
`+Xe),me&&(Xe=jr(Xe)),q&&En?he(Xe):Xe},s.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Er(oe),ct=!0,ut=Oe,gt=Fe},s.clearConfig=function(){it=null,ct=!1,ut=null,gt=null,q=ce,G=""},s.isValidAttribute=function(oe,S,O){it||Er({});const Z=Ee(oe),ke=Ee(S);return Eo(Z,ke,O)},s.addHook=function(oe,S){typeof S=="function"&&qt(j,oe)&&ni(j[oe],S)},s.removeHook=function(oe,S){if(qt(j,oe)){if(S!==void 0){const O=Gk(j[oe],S);return O===-1?void 0:Kk(j[oe],O,1)[0]}return Yh(j[oe])}},s.removeHooks=function(oe){qt(j,oe)&&(j[oe]=[])},s.removeAllHooks=function(){j=am()},s}var Sd=Yg();const vS=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function lm(n){return vS.has(n.type)}function yS({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(rw,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(rd,{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))})]})}qe.setOptions({breaks:!0,gfm:!0});function xS(n){const s=qe.parse(n);return Sd.sanitize(s)}function cm(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 wS(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,g=f;if(u===s.startContainer&&(h=Math.min(s.startOffset,f)),u===s.endContainer&&(g=Math.min(s.endOffset,f)),h>=g)continue;g<f&&u.splitText(g);const m=h>0?u.splitText(h):u,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function kS(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=cm(n,r.start_offset),a=cm(n,r.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),wS(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 SS(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 TS({itemId:n,turnId:s,sessionId:r,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),g=w.useRef(""),m=w.useRef(0),[v,k]=w.useState(!1),[x,T]=w.useState({x:0,y:0}),[E,C]=w.useState(!1),[R,L]=w.useState({x:0,y:0}),[b,U]=w.useState(""),[P,W]=w.useState(null),[K,q]=w.useState(!1),G=D(H=>H.createThread),ce=D(H=>H.switchRightTab),pe=D(H=>dl(H.sessionDetails[r])),ue=w.useCallback(async()=>{await Lu(o||""),q(!0),setTimeout(()=>q(!1),1500)},[o]),de=w.useCallback(()=>{var A;if(!P)return;const H=`
|
|
456
|
-
\`\`\`QUOTE
|
|
457
|
-
${P.text}
|
|
458
|
-
\`\`\`
|
|
459
|
-
|
|
460
|
-
`;D.setState({quotedText:H}),k(!1),W(null),(A=window.getSelection())==null||A.removeAllRanges()},[P]),he=w.useMemo(()=>xS(o||"…"),[o]),Le=w.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);w.useEffect(()=>{u.current&&kS(u.current,Le)},[he,Le]),w.useEffect(()=>{g.current=b},[b]),w.useEffect(()=>{function H(A){f.current&&!f.current.contains(A.target)&&(k(!1),g.current.trim()||C(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const te=w.useCallback(()=>{k(!1),g.current.trim()||C(!1)},[]),ie=w.useCallback(()=>{const H=u.current;if(!H)return;const A=SS(H);if(A&&A.text.trim().length>0){const j=window.getSelection();if(j&&j.rangeCount>0&&j.anchorNode&&j.focusNode){const re=j.getRangeAt(0).getBoundingClientRect(),ve=28,Te=6,Pe=170;let Re=!1;try{const st=document.createRange();st.setStart(j.focusNode,j.focusOffset),st.setEnd(j.focusNode,j.focusOffset);const Oe=document.createRange();Oe.setStart(j.anchorNode,j.anchorOffset),Oe.setEnd(j.anchorNode,j.anchorOffset),Re=Oe.compareBoundaryPoints(Range.START_TO_START,st)>0}catch{Re=!1}let De=re.top-ve-Te;De<8&&(De=re.bottom+Te);let Ne=Re?re.left-Pe:re.right;Ne=Math.max(8,Math.min(Ne,window.innerWidth-Pe-8)),T({x:Ne,y:De}),k(!0),W(A)}}else k(!1)},[]);w.useEffect(()=>{function H(A){const j=A.target;j&&(j.closest(".selection-actions")||j.closest(".thread-create-popover"))||ie()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[ie]);const le=w.useCallback(()=>{k(!1),C(!0),L({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!E)return;const H=h.current;if(!H)return;const A=H.offsetWidth,j=H.offsetHeight,X=8;let re=x.x,ve=x.y;re-A<X&&(re=A+X),re>window.innerWidth-X&&(re=window.innerWidth-X),ve<X&&(ve=X),ve+j>window.innerHeight-X&&(ve=window.innerHeight-j-X),L({x:re,y:ve})},[E,x]);const $=w.useCallback(async()=>{var H;pe||!P||!b.trim()||(await G(r,{itemId:n,turnId:s,startOffset:P.start,endOffset:P.end,selectedText:P.text,message:b.trim()}),U(""),C(!1),W(null),(H=window.getSelection())==null||H.removeAllRanges(),ce("threads"))},[P,b,G,r,n,s,ce,pe]),Y=w.useCallback(H=>{const A=H.target;if(A.tagName==="MARK"&&A.hasAttribute("data-thread-id")){H.preventDefault(),ce("threads");const j=A.getAttribute("data-thread-id");setTimeout(()=>{const X=document.getElementById(`thread-${j}`);X&&(X.scrollIntoView({behavior:"smooth",block:"center"}),X.classList.add("thread-card-highlighted"),setTimeout(()=>X.classList.remove("thread-card-highlighted"),1500))},100)}},[ce]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:he},onMouseDown:te,onClick:Y}),c.jsx("button",{className:`copy-text-btn${K?" copied":""}`,onClick:ue,title:K?"Copied":"Copy message","aria-label":"Copy message text",children:K?c.jsx(tr,{size:14}):c.jsx(Ru,{size:14})}),v&&!E&&c.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!pe&&c.jsxs("button",{className:"discuss-button",onClick:le,title:"Start a discussion about this text",children:[c.jsx(B0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:de,title:"Quote this text in your message",children:[c.jsx(rg,{size:14}),c.jsx("span",{children:"Quote"})]})]}),E&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:R.x,top:R.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',P==null?void 0:P.text.slice(0,80),P&&P.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),W(null)},children:c.jsx(Pn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:b,onChange:H=>U(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),$()),H.key==="Escape")if(g.current.trim()){const A=Date.now();m.current&&A-m.current<400?(m.current=0,C(!1),W(null)):m.current=A}else C(!1),W(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:$,disabled:!b.trim()||pe,title:pe?"Wait for the running turn to finish first":void 0,children:[c.jsx(ml,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const um=w.memo(TS),ll=new Map,Xg=new Set,Uu=new Set,dm=new Map;function Qg(){Uu.forEach(n=>n())}function Zg(n,s){return`${n}:${s}`}function bS(n,s,r,o,a){var g;const u=Zg(s,r),f=ll.get(n)??new Map,h=new Map(f);((g=h.get(u))==null?void 0:g.answer)===a?h.delete(u):h.set(u,{itemIndex:s,groupIndex:r,question:o,answer:a}),ll.set(n,h),Qg()}function NS(n){ll.delete(n),Qg()}function CS(n){Xg.add(n),NS(n)}function ES(n){const s=w.useCallback(r=>(Uu.add(r),()=>{Uu.delete(r)}),[]);return w.useSyncExternalStore(s,()=>ll.get(n)??dm,()=>dm)}function _S(n){return[...n].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
|
|
461
|
-
${s.answer}`).join(`
|
|
462
|
-
|
|
463
|
-
`)}function fm({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=ES(s.id),u=D(E=>s.session_id?E.sessionDetails[s.session_id]:null),f=D(E=>E.activeSessionId),h=s.items.findIndex(E=>E.id===n.id),g=u?((T=u.turns[u.turns.length-1])==null?void 0:T.id)===s.id:!0,m=Xg.has(s.id),v=m||Bm(u)||!g||s.session_id!==f,k=(E,C,R)=>{v||bS(s.id,h,E,C,R)},x=()=>{const E=[...a.values()];if(E.length===0)return;const C=_S(E);CS(s.id),D.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(_0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),m&&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(R=>{var b;const L=((b=a.get(Zg(h,C)))==null?void 0:b.answer)===R;return c.jsx("button",{type:"button",className:`ask-user-option ${L?"selected":""}`,disabled:v,onClick:()=>k(C,E.question,R),children:R},R)})})]},C)),v?m&&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(ml,{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"})]})}const jS={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function io(n){return n&&jS[n]||"interrupted"}function cl(n){if(!n)return"";const s=new Date(n);return Number.isNaN(s.getTime())?"":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function RS(n){switch(n){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function AS(n){return n.items.filter(s=>s.type==="interruption").map(s=>s.data)}function IS({item:n}){const s=n.data,r=cl(s.interrupted_at);let o="";switch(s.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=s.resumed_at?`resumed ${cl(s.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return c.jsx("div",{className:"interruption-marker",title:s.detail??void 0,children:c.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",io(s.reason),") · ",o]})})}function MS({turn:n,label:s}){const[r,o]=w.useState(!1),a=D(f=>f.addToast),u=()=>{o(!0),ix(n.session_id,n.id).catch(f=>a("error",`Could not resume the turn — ${f.message}`)).finally(()=>o(!1))};return c.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:r,children:[c.jsx(ig,{size:12}),s]})}function DS({turn:n}){const s=n.resume_state;if(!s||s==="cancelled")return null;const r=n.interrupt_reason,o=AS(n),a=o[o.length-1],u=cl(n.interrupted_at??(a==null?void 0:a.interrupted_at));if(s==="resumed"){const m=cl(a==null?void 0:a.resumed_at),v=n.status==="running"||n.status==="pending";return c.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(ig,{size:12})}),c.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",io(r),") · resumed",m?` ${m}`:"",v?" — continuing…":""]})]})}let f,h=null,g=null;switch(s){case"waiting":f=RS(r),g="Resume now";break;case"resuming":f=`Interrupted (${io(r)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);f=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,h=n.error&&!n.error.startsWith("Automatic resume stopped")?n.error:null,g="Resume";break}case"skipped":f=`Interrupted${u?` ${u}`:""} (${io(r)}) — too long ago to resume automatically.`,g="Resume";break;default:f=`Interrupted (${io(r)}) — this turn cannot be resumed.`,h=n.error}return c.jsxs("div",{className:"interruption-banner","data-state":s,children:[c.jsx("span",{className:"banner-icon",children:r==="network"?c.jsx(lg,{size:12}):c.jsx(hl,{size:12})}),c.jsxs("span",{className:"banner-text",children:[f,h&&c.jsx("span",{className:"banner-detail",children:h})]}),g&&c.jsx(MS,{turn:n,label:g})]})}function LS({turnId:n}){const s=D(o=>o.retryStates[n]);if(!s)return null;const r=s.errorStatus?`API error ${s.errorStatus}`:"Connection problem";return c.jsxs("div",{className:"retry-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(lg,{size:12})}),c.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",s.attempt," of ",s.maxRetries,")…"]})]})}qe.setOptions({breaks:!0,gfm:!0});function PS({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(tg,{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(Pn,{size:20})})]})})]})}function OS(n){const s=qe.parse(n);return Sd.sanitize(s)}function pm(n){var s;return(s=n.data)!=null&&s.text?n.data.text:""}function zS(n){const s=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:n}const hm='<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 $S(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${hm}</body>`):n+hm}function FS({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:$S(n),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const mm=1e4;function US({item:n,runtimeType:s,turn:r,threads:o}){var h,g,m,v,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:R}=_u(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:R}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(um,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:pm(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(C0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:OS(pm(n))}})]});case"command_execution":{const C=n.data||{},R=zS(C.command||""),L=C.aggregated_output||"",b=C.exit_code,U=a?"running…":b!==null?`exit ${b}`:"",P=L.length>mm,W=P&&!u?L.slice(0,mm)+`
|
|
464
|
-
… (truncated, click to expand)`:L;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(ag,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),U&&c.jsx("span",{className:"turn-header-meta",children:U})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:R})}),L&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),P&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(K=>!K),children:u?"Show less":`Show full output (${(L.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,R=Array.isArray(C)?C:[],L=`${R.length} file${R.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(M0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:L})]}),c.jsx("div",{className:"file-change-list",children:R.map((b,U)=>{const P=b.kind==="add"?"A":b.kind==="delete"?"D":"M",W=b.kind==="add"?"fc-add":b.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:P}),c.jsx("span",{className:"fc-name",children:b.path})]},U)})})]})}case"mcp_tool_call":{const C=n.data||{},R=C.tool||"mcp";if(R==="Agent"){const G=C.arguments,ce=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",pe=n.status==="failed",ue=a?"running…":pe?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ju,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ce}),c.jsx("span",{className:`agent-call-status ${a?"running":pe?"failed":"done"}`,children:ue})]})}const L=C.server||"",b=C.arguments,U=C.result,P=C.error,W=n.status==="failed"||!!P,K=a?"running…":W?"failed":"done",q=((g=U==null?void 0:U.content)==null?void 0:g.filter(G=>G.type==="text").map(G=>G.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(X0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",R]}),L&&c.jsx("span",{className:"turn-header-meta",children:L}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:K})]}),b&&Object.keys(b).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(b).map(([G,ce])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:G}),G==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ce)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ce=="string"?ce:JSON.stringify(ce,null,2)})]},G))}),q.length>0&&q.map((G,ce)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},ce)),P&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:P})})]})}case"web_search":{const C=((m=n.data)==null?void 0:m.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(Z0,{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=((v=n.data)==null?void 0:v.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($0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((R,L)=>c.jsxs("li",{className:R.completed?"todo-done":"todo-pending",children:[R.completed?c.jsx(tr,{size:14}):c.jsx(fi,{size:14})," ",R.text]},L))})]})}case"ask_user":return c.jsx(fm,{item:n,turn:r});case"final_result":{const C=n.data??{},R=C.text||"",L=C.html||null,b=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:U,iconText:P}=_u(s??"codex");return c.jsxs(c.Fragment,{children:[(R||L)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${U}`,children:P}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),R&&c.jsx(um,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:R,threads:o,runtimeType:s}),L&&c.jsx(FS,{html:L})]}),b.length>0&&c.jsx(fm,{item:n,turn:r})]})}case"background_task":{const C=n.data||{},R=C.task_type||"unknown",L=C.subagent_type||null,b=C.description||"",U=C.status||"running",P=C.last_tool_name||null,W=C.token_count||null,K=R==="local_agent",q=R==="local_bash",G=K?ju:q?og:Jm,ce=K?`Subagent${L?`: ${L}`:""}`:q?"Monitor":"Background Task",pe=U==="running"?"running…":U==="completed"?"done":U==="failed"?"failed":U==="stopped"?"stopped":U,ue=n.status==="failed"||U==="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(G,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ce}),c.jsx("span",{className:"turn-header-meta",style:ue?{color:"var(--red)"}:void 0,children:pe})]}),b&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:b}),P&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",P,W!=null&&` · ${W.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",R=((x=n.data)==null?void 0:x.pre_tokens)??0,L=((T=n.data)==null?void 0:T.post_tokens)??0,b=R>0?Math.round((1-L/R)*100):0,U=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(W0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:U})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[R.toLocaleString()," → ",L.toLocaleString()," tokens (",b,"% reduction)"]})]})}case"interruption":return c.jsx(IS,{item:n});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(hl,{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(US,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function BS({turn:n,runtimeType:s,threads:r=[]}){Kt.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const b=n.items.some(U=>U.type==="background_task"&&U.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,g=n.items.some(b=>b.type==="final_result"||b.type==="ask_user"),m=!f&&n.status==="completed"&&n.agent_response&&!g?{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 U;return!(b.type==="reasoning"&&(!((U=b.data)!=null&&U.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:[]}):b.type==="interruption"||b.type==="error"?(T&&x.push(T),x.push({agentMessage:null,toolItems:[],otherItems:[b]}),T=null):(T||(T={agentMessage:null,toolItems:[],otherItems:[]}),lm(b)?T.toolItems.push(b):T.otherItems.push(b));T&&x.push(T);const E=k.filter(b=>lm(b)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending"),R=n.status==="pending"&&n.resume_state==="waiting",L=n.resume_state==="gave_up"||n.resume_state==="skipped"||n.resume_state==="unsupported";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(PS,{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(P0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:R?"interrupted":"thinking…"}),c.jsx(rd,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((b,U)=>c.jsxs("div",{className:"intermediate-segment",children:[b.agentMessage&&c.jsx(_s,{item:b.agentMessage,runtimeType:s,turn:n,threads:r}),b.otherItems.map(P=>c.jsx(_s,{item:P,runtimeType:s,turn:n,threads:r},P.id)),b.toolItems.length>0&&c.jsx(yS,{items:b.toolItems,runtimeType:s,turn:n,threads:r})]},U))})]}),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),m&&c.jsx(_s,{item:m,runtimeType:s,turn:n,threads:r},m.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&&!L&&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==="running"&&c.jsx(LS,{turnId:n.id}),c.jsx(DS,{turn:n}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(fi,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const WS=w.memo(BS);function Jg(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>gm(u,f,o));else{const u=n[r];u&&gm(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function gm(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 HS=[],Pa=50;function VS(){Kt.trackRender("RenderArea");const n=D(L=>L.activeSessionId),s=D(L=>L.activeSessionId?L.sessionDetails[L.activeSessionId]:null),r=D(L=>L.activeTurnIndex),o=D(L=>L.activeRightTab),a=D(L=>L.changesScope),u=D(L=>L.submittingPrompt),f=D(L=>L.loading),h=D(L=>L.selectedChangePath),g=D(L=>L.setSelectedChangePath),m=(s==null?void 0:s.turns)??[],v=(s==null?void 0:s.threads)??HS,k=w.useRef(null),[x,T]=w.useState(Pa);w.useEffect(()=>{T(Pa)},[n]);const E=m.filter(L=>!L.thread_id),C=Math.max(0,E.length-x),R=E.slice(C);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,m.length]),w.useEffect(()=>{if(!h||o!=="changes")return;const L=setTimeout(()=>{const b=h.replace(/[^a-zA-Z0-9]/g,"-"),U=document.getElementById(`diff-${b}`);U&&(U.scrollIntoView({behavior:"smooth",block:"start"}),U.classList.add("diff-highlight"),setTimeout(()=>U.classList.remove("diff-highlight"),1500)),g(null)},50);return()=>clearTimeout(L)},[h,o,g]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const L=Jg(m,a,r);return L.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:[L.length," file",L.length>1?"s":""]})]}),L.map(b=>{const U=b.path.split("/").pop()||b.path,P=b.path.replace("/"+U,""),W=b.kind==="add"?"Added":b.kind==="delete"?"Deleted":"Modified",K=b.kind==="add"?"fc-add":b.kind==="delete"?"fc-del":"fc-mod",q=b.kind==="add"?"A":b.kind==="delete"?"D":"M",G=b.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${G}`,children:[c.jsx("span",{className:`diff-file-status ${K}`,children:q}),c.jsxs("span",{className:"diff-file-name",children:[P&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[P,"/"]}),U]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${K}`,children:W})})]}),c.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},b.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…"})})]})}),m.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(L=>L+Pa),children:["Show ",Math.min(Pa,C)," earlier turns (",C," hidden)"]})}),R.map((L,b)=>c.jsx("div",{id:`turn-${C+b}`,className:"turn-block",children:c.jsx(WS,{turn:L,runtimeType:s.runtime_type,threads:v})},L.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const qS=w.memo(VS),GS=[{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 KS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function YS(n,s,r=[]){const o=[...GS,...KS(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 XS({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 Su({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 QS(n){return yn("/skills")}function ZS({filter:n,onSelect:s,onClose:r}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,g]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{QS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{g(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),g(T=>Math.min(T+1,v.length-1))):x.key==="ArrowUp"?(x.preventDefault(),g(T=>Math.max(T-1,0))):x.key==="Enter"?(x.preventDefault(),v[h]&&s(v[h])):x.key==="Escape"&&(x.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,h,s,r]),c.jsxs("div",{className:"slash-popup",ref:m,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&&v.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>g(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 JS(){return yn("/providers")}function eT(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return yn(`/providers/${n}/commands${r}`)}const tT={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function nT(n){const[s,r]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{JS().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)??tT,loading:o}}const si=32,Tu=200;function vm(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function ym(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let xm=0;function sT(){return xm+=1,`att-${Date.now()}-${xm}`}function rT(){Kt.trackRender("CommandInputBar");const[n,s]=w.useState(""),r=w.useRef(null),o=w.useRef(si),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:g}=D(),m=D(V=>V.activeSessionId),v=D(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=D(V=>V.quotedText),x=Bm(v),T=!!(v!=null&&v.turns.some(V=>V.status==="pending"&&V.resume_state==="waiting")),E=!m,{capabilities:C}=nT(v==null?void 0:v.runtime_type),R=(v==null?void 0:v.runtime_type)??null,L=C.imageAttachments,[b,U]=w.useState([]),[P,W]=w.useState(!1),[K,q]=w.useState(null),[G,ce]=w.useState([]);w.useEffect(()=>{if(!R){ce([]);return}let V=!1;return eT(R,(v==null?void 0:v.cwd)??void 0).then(me=>{V||ce(me)}).catch(()=>{V||ce([])}),()=>{V=!0}},[R,v==null?void 0:v.cwd]);const[pe,ue]=w.useState(!1),[de,he]=w.useState(""),[Le,te]=w.useState(0),[ie,le]=w.useState(void 0),[$,Y]=w.useState(!1),[H,A]=w.useState(""),[j,X]=w.useState([]),re=pe?YS(de,C,G):[];w.useEffect(()=>{k!==null&&(s(V=>V+k),setTimeout(()=>{if(r.current){Oe(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),D.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function V(me){me.key==="Escape"&&(me.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[x,f]),w.useEffect(()=>{ue(!1),le(void 0),Y(!1),X([]),U(V=>{for(const me of V)me.previewUrl&&URL.revokeObjectURL(me.previewUrl);return[]})},[m]),w.useEffect(()=>{if(!K)return;function V(me){me.key==="Escape"&&(me.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[K]);const ve=w.useCallback(V=>{if(!V)return;const me=Array.from(V);for(const Be of me){const Je=new FileReader;Je.onload=()=>{const ut=Je.result.split(",")[1]??"",gt=Be.type.startsWith("image/")?URL.createObjectURL(Be):void 0;U(Xt=>[...Xt,{id:sT(),name:Be.name,media_type:Be.type||"application/octet-stream",data:ut,previewUrl:gt,size:Be.size}])},Je.readAsDataURL(Be)}},[]),Te=w.useCallback(V=>{U(me=>{const Be=me.find(Je=>Je.id===V);return Be!=null&&Be.previewUrl&&URL.revokeObjectURL(Be.previewUrl),me.filter(Je=>Je.id!==V)})},[]),Pe=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!L||x)&&W(!0)},[L,x]),Re=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),W(!1)},[]),De=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),W(!1),!(!L||x)&&ve(V.dataTransfer.files)},[L,x,ve]),Ne=w.useCallback(V=>{var Je;if(!L)return;const me=(Je=V.clipboardData)==null?void 0:Je.items;if(!me)return;const Be=[];for(let ct=0;ct<me.length;ct++){const ut=me[ct];if(ut.type.startsWith("image/")){const gt=ut.getAsFile();gt&&Be.push(gt)}}Be.length>0&&(V.preventDefault(),ve(Be))},[L,ve]);function st(V){const me=r.current;me&&(me.style.height=`${V}px`,o.current=V)}function Oe(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const me=Math.min(V.scrollHeight,Tu);me!==o.current&&st(me);return}o.current>si&&(V.style.height="auto",st(Math.min(V.scrollHeight,Tu)))}}function mt(){const V=n.trim();if(!V||x)return;let me=V;j.length>0&&(me=`${j.map(ct=>`$${ct.name}`).join(" ")}
|
|
465
|
-
|
|
466
|
-
${V}`);const Be=b.map(({id:Je,previewUrl:ct,size:ut,...gt})=>gt);s(""),X([]),st(si),ue(!1),le(void 0),Y(!1);for(const Je of b)Je.previewUrl&&URL.revokeObjectURL(Je.previewUrl);U([]),u(me,Be.length>0?Be:void 0)}function Fe(V){if(V.insertAsText){const me=`/${V.id} `;s(me),ue(!1),le(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Be=me.length;r.current.setSelectionRange(Be,Be),Oe()}});return}V.subPopup?le(V.subPopup):V.id==="skills"?(Y(!0),A(""),ue(!1),s("")):V.id==="model"?(g(!0),ue(!1),s("")):(ue(!1),s(""))}function _t(V){X(me=>[...me,V]),Y(!1),s(""),st(si)}function Ue(V){const me=vm(v==null?void 0:v.runtime_config);ie==="sandbox"?me.sandboxMode=V:ie==="websearch"?me.webSearchMode=V:ie==="network"&&(me.networkAccessEnabled=V==="true"),h(me),le(void 0),ue(!1),s(""),st(si)}function Yt(V){if(Kt.markKeystroke(),pe&&!ie){if(V.key==="ArrowDown"){V.preventDefault(),te(me=>Math.min(me+1,re.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),te(me=>Math.max(me-1,0));return}if(V.key==="Enter"){V.preventDefault(),re[Le]&&Fe(re[Le]);return}if(V.key==="Escape"){V.preventDefault(),ue(!1),s("");return}}if(ie&&V.key==="Escape"){V.preventDefault(),le(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!x){V.preventDefault(),mt();return}V.key==="Escape"&&x&&(V.preventDefault(),f())}function On(V){Kt.markInputChange();const me=V.target.value;s(me),Oe(),me.startsWith("/")&&!me.includes(" ")&&!x?(ue(!0),he(me.slice(1)),te(0)):(ue(!1),le(void 0)),me.startsWith("$")&&!x?(Y(!0),A(me.slice(1))):me.startsWith("$")||Y(!1)}const at=vm(v==null?void 0:v.runtime_config),yt=[{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"}],lt=[{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"}],Ft=[{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${P?" drag-over":""}`,onDragOver:Pe,onDragLeave:Re,onDrop:De,children:[pe&&!ie&&c.jsx(XS,{commands:re,selectedIndex:Le,onSelect:Fe,onHover:te}),pe&&ie==="sandbox"&&c.jsx(Su,{title:"Sandbox Mode",options:yt,currentValue:at.sandboxMode,onSelect:Ue,onClose:()=>le(void 0)}),pe&&ie==="websearch"&&c.jsx(Su,{title:"Web Search",options:lt,currentValue:at.webSearchMode,onSelect:Ue,onClose:()=>le(void 0)}),pe&&ie==="network"&&c.jsx(Su,{title:"Network Access",options:Ft,currentValue:at.networkAccessEnabled===!0?"true":"false",onSelect:Ue,onClose:()=>le(void 0)}),$&&c.jsx(ZS,{filter:H,onSelect:_t,onClose:()=>{Y(!1),s("")}}),j.length>0&&c.jsx("div",{className:"skill-badges",children:j.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>X(me=>me.filter(Be=>Be.id!==V.id)),children:"×"})]},V.id))}),b.length>0&&c.jsx("div",{className:"attachment-preview-area",children:b.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:()=>q(V),style:{cursor:"pointer"}}):c.jsx(tg,{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:ym(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>Te(V.id),title:"Remove attachment",children:c.jsx(Pn,{size:14})})]},V.id))}),L&&!x&&!E&&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=>{ve(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[L&&!x&&!E&&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(K0,{size:16})}),c.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:E?"Select or create a session…":T?"Interrupted — waiting to resume…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:x||E,rows:1,style:{minHeight:si,maxHeight:Tu},onChange:On,onKeyDown:Yt,onPaste:Ne}),x?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(fi,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:mt,disabled:!n.trim()||E,title:"Send (⌘↵)",children:c.jsx(N0,{size:16})})]}),K&&c.jsx("div",{className:"image-preview-modal",onClick:()=>q(null),children:c.jsxs("div",{className:"image-preview-content",onClick:V=>V.stopPropagation(),children:[c.jsx("img",{src:K.previewUrl,alt:K.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:K.name}),c.jsx("span",{children:ym(K.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:c.jsx(Pn,{size:20})})]})})]})}function iT(){const n=D(R=>R.activeSessionId),s=D(R=>R.activeSessionId?R.sessionDetails[R.activeSessionId]:null),r=D(R=>R.activeTurnIndex),o=D(R=>R.setActiveTurnIndex),a=D(R=>R.rewindToTurn),u=D(R=>R.restoreSession),f=D(R=>R.branchFromTurn),h=(s==null?void 0:s.turns)??[],g=dl(s),m=!!(s!=null&&s.rewound_at_turn_id),v=(s==null?void 0:s.runtime_type)==="repoburg",k=v?"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(pl(E,()=>T(null),!!x),td(()=>T(null),!!x),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(R){o(R),requestAnimationFrame(()=>{var L;(L=document.getElementById(`turn-${R}`))==null||L.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((R,L)=>{const b=L===r,U=R.user_prompt.length>50?R.user_prompt.slice(0,50)+"…":R.user_prompt,P=R.status==="running"||R.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${b?"active":""}`,onClick:()=>C(L),onContextMenu:W=>{W.preventDefault(),T({x:W.clientX,y:W.clientY,turnId:R.id,turnIndex:L,isLast:L===h.length-1,isSlashCommand:R.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(sw,{size:12})}),c.jsx("span",{className:"turn-item-label",children:U}),P&&c.jsx("span",{className:"turn-item-status",children:R.status==="pending"&&R.resume_state==="waiting"?"interrupted":"running…"})]})},R.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||g||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||g||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),T(null))},children:[c.jsx(Q0,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),m&&!v&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),T(null)},children:[c.jsx(ho,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),T(null)},children:[c.jsx(D0,{size:12})," Branch from Here"]})]})]})}function oT(){const n=D(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),s=D(h=>h.changesScope),r=D(h=>h.setChangesScope),o=D(h=>h.activeTurnIndex),a=D(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Jg(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 g=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",m=h.kind==="add"?"A":h.kind==="delete"?"D":"M",v=h.path.split("/").pop()||h.path,k=h.path.replace("/"+v,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[c.jsx("span",{className:`fc-status ${g}`,children:m}),c.jsxs("span",{className:"fc-name",children:[k&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),v]})]},h.path)})]})]})}const wm=2e4;function aT(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 lT({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||"",g=a.status||"running",m=a.summary||null,v=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",R=E?ju:C?og:Jm,L=E?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",b=g==="running"?"running…":g==="completed"?"done":g==="failed"?"failed":g==="stopped"?"stopped":g,U=s.status==="failed"||g==="failed",[P,W]=w.useState(T),[K,q]=w.useState(!1),G=w.useRef(null);w.useEffect(()=>{T&&W(!0)},[T]),w.useEffect(()=>{P&&T&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[P,T,x]);const ce=x.length>wm,pe=ce&&!K?x.slice(0,wm)+`
|
|
467
|
-
… (truncated, click to expand)`:x,ue=T?null:g==="completed"?c.jsx(tr,{size:12}):U?c.jsx(hl,{size:12}):c.jsx(fi,{size:12});return c.jsxs("div",{className:`task-card ${T?"task-running":""} ${U?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(de=>!de),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(R,{size:14})}),c.jsx("span",{className:"task-card-type",children:L}),c.jsxs("span",{className:`task-card-status ${U?"task-status-failed":T?"task-status-running":"task-status-done"}`,children:[ue," ",b]}),c.jsx(rd,{size:14,className:"task-card-chevron",style:{transform:P?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),T&&v&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),P&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:G,children:c.jsx("code",{children:pe})}),ce&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>q(de=>!de),children:K?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):m?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:m})}):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 cT=w.memo(lT);function uT(){var g,m;const n=D(v=>v.activeSessionId?v.sessionDetails[v.activeSessionId]:null),s=D(v=>v.activeSessionId?v.backgroundTasks[v.activeSessionId]:void 0),r=(n==null?void 0:n.turns)??[],o=s??[],a=aT(r),u=[...a].sort((v,k)=>{const x=v.item.status==="in_progress",T=k.item.status==="in_progress";return x&&!T?-1:!x&&T?1:k.turnIndex-v.turnIndex}),f=new Map;for(const v of o)v.task_type==="local_bash"&&f.set(v.task_id,v.task_type);for(const v of a)if(v.item.status==="in_progress"){const k=((g=v.item.data)==null?void 0:g.task_id)??v.item.external_item_id,x=((m=v.item.data)==null?void 0:m.task_type)??"unknown";f.set(k,x)}const h=[...f.values()].filter(v=>v==="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(v=>c.jsx(cT,{entry:v},v.item.id))]})}const dT=w.memo(uT);function fT({thread:n,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=D(),[u,f]=w.useState(""),[h,g]=w.useState(!1),[m,v]=w.useState(!1);async function k(){if(!r||h)return;g(!0),await a(r,n.id,u)?s():g(!1)}async function x(){!r||m||(v(!0),await o(r,n.id),s())}const T=h||m;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(Pn,{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:[m?c.jsx(rs,{size:13,className:"spin"}):c.jsx(Ya,{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(J0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const km=[];qe.setOptions({breaks:!0,gfm:!0});function pT(n){const s=qe.parse(n);return Sd.sanitize(s)}function hT(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(`
|
|
468
|
-
|
|
469
|
-
`):null}return null}function mT(n){const s=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:n}function gT({turn:n}){const s=mT(n.user_prompt),r=n.items.map(hT).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:pT(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 vT({thread:n,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var he,Le,te;const[g,m]=w.useState(""),[v,k]=w.useState(!0),x=w.useRef(null),T=w.useRef(null),[E,C]=w.useState(!1),[R,L]=w.useState({x:0,y:0}),[b,U]=w.useState(""),P=s.some(Tr),W=28,K=120,q=w.useRef(W);w.useEffect(()=>{const ie=T.current;ie&&(ie.scrollTop=ie.scrollHeight)},[s.length,v]);function G(ie){const le=x.current;le&&(le.style.height=`${ie}px`,q.current=ie)}function ce(){const ie=x.current;if(ie){if(ie.scrollHeight>ie.clientHeight){const le=Math.min(ie.scrollHeight,K);le!==q.current&&G(le);return}q.current>W&&(ie.style.height="auto",G(Math.min(ie.scrollHeight,K)))}}const pe=w.useCallback(()=>{C(!1)},[]),ue=w.useCallback(()=>{const ie=T.current;if(!ie)return;const le=window.getSelection();if(!le||le.rangeCount===0||le.isCollapsed){C(!1);return}const $=le.getRangeAt(0);if(!ie.contains($.commonAncestorContainer)){C(!1);return}const Y=$.commonAncestorContainer.nodeType===Node.TEXT_NODE?$.commonAncestorContainer.parentElement:$.commonAncestorContainer;if(!(Y!=null&&Y.closest(".thread-card-ai-response"))){C(!1);return}const H=le.toString();if(!H.trim()){C(!1);return}const A=$.getBoundingClientRect(),j=28,X=6,re=170;let ve=!1;if(le.anchorNode&&le.focusNode)try{const Re=document.createRange();Re.setStart(le.focusNode,le.focusOffset),Re.setEnd(le.focusNode,le.focusOffset);const De=document.createRange();De.setStart(le.anchorNode,le.anchorOffset),De.setEnd(le.anchorNode,le.anchorOffset),ve=De.compareBoundaryPoints(Range.START_TO_START,Re)>0}catch{ve=!1}let Te=A.top-j-X;Te<8&&(Te=A.bottom+X);let Pe=ve?A.left-re:A.right;Pe=Math.max(8,Math.min(Pe,window.innerWidth-re-8)),L({x:Pe,y:Te}),U(H),C(!0)},[]);w.useEffect(()=>{function ie(le){const $=le.target;$&&$.closest(".selection-actions")||ue()}return document.addEventListener("mouseup",ie),()=>document.removeEventListener("mouseup",ie)},[ue]);const de=w.useCallback(()=>{var le;const ie=`
|
|
470
|
-
\`\`\`QUOTE
|
|
471
|
-
${b}
|
|
472
|
-
\`\`\`
|
|
473
|
-
|
|
474
|
-
`;m($=>$+ie),C(!1),U(""),(le=window.getSelection())==null||le.removeAllRanges(),setTimeout(()=>{if(x.current){ce(),x.current.focus();const $=x.current.value.length;x.current.setSelectionRange($,$)}},0)},[b]);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(ie=>!ie),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((te=(Le=(he=n.turns)==null?void 0:he[0])==null?void 0:Le.user_prompt)==null?void 0:te.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:ie=>{ie.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(H0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),v&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:T,onMouseDown:pe,children:[s.map(ie=>c.jsx(gT,{turn:ie},ie.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:R.x,top:R.y},children:c.jsxs("button",{className:"discuss-button",onClick:de,title:"Quote this text in your follow-up",children:[c.jsx(rg,{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:P?"Agent is running…":"Type a follow-up…",value:g,onChange:ie=>{Kt.markInputChange(),m(ie.target.value),ce()},disabled:P,rows:1,style:{minHeight:W,maxHeight:K},onKeyDown:ie=>{Kt.markKeystroke(),ie.key==="Enter"&&(ie.metaKey||ie.ctrlKey)&&!P&&g.trim()&&(ie.preventDefault(),f(g.trim()),m(""),G(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:P||!g.trim(),onClick:()=>{f(g.trim()),m("")},children:c.jsx(ml,{size:13})}),P&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:c.jsx(fi,{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(Ya,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(ho,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(gs,{size:13})," Delete"]})]})]})]})}function yT(){Kt.trackRender("ThreadsPanel");const n=D(b=>b.activeSessionId),s=D(b=>{var U;return b.activeSessionId?((U=b.sessionDetails[b.activeSessionId])==null?void 0:U.threads)??km:km}),r=D(b=>b.followupThread),o=D(b=>b.cancelThreadTurn),a=D(b=>b.reopenThread),u=D(b=>b.deleteThread),f=D(b=>b.activeRightTab),h=D(b=>b.switchRightTab),g=D(b=>b.deepLinkThreadId),m=D(b=>b.setDeepLinkThreadId),[v,k]=w.useState("open"),[x,T]=w.useState(null);w.useEffect(()=>{if(!g)return;const b=g;m(null),k(P=>s.some(W=>W.id===b&&W.status==="open")?P:"all");const U=setTimeout(()=>{const P=document.getElementById(`thread-${b}`);P&&(P.scrollIntoView({behavior:"smooth",block:"center"}),P.classList.add("thread-card-highlighted"),setTimeout(()=>P.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(U)},[g,m,s]);const E=s.filter(b=>v==="open"?b.status==="open":v==="resolved"?b.status==="resolved":!0),C=s.filter(b=>b.status==="open").length,R=s.filter(b=>b.status==="resolved").length;function L(b){f==="changes"&&h("turns"),setTimeout(()=>{const U=document.querySelector(`mark[data-thread-id="${b}"]`);U&&(U.scrollIntoView({behavior:"smooth",block:"center"}),U.classList.add("thread-mark-flash"),setTimeout(()=>U.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(sg,{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 ${v==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${v==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",R,")"]}),c.jsxs("button",{className:`thread-filter-tab ${v==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",s.length,")"]})]}),E.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",v," threads."]}):E.map(b=>c.jsx(vT,{thread:b,threadTurns:b.turns??[],onStop:()=>o(n,b.id),onResolve:()=>T(b),onReopen:()=>a(n,b.id),onDelete:()=>u(n,b.id),onFollowup:U=>r(n,b.id,U),onLocate:()=>L(b.id)},b.id)),x&&c.jsx(fT,{thread:x,onClose:()=>T(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function xT(){const n=D(f=>f.apps),s=D(f=>f.activeAppTabId),r=D(f=>f.openAppTab),o=D(f=>f.startAppEdit),a=D(f=>f.toggleAppPin),u=D(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($a,{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(Xa,{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(gs,{size:12})})]},f.id))})}function wT(){var g;Kt.trackRender("RightPanel");const n=D(m=>m.activeRightTab),s=D(m=>m.switchRightTab),r=D(m=>m.rightPanelCollapsed),o=D(m=>m.toggleRightPanel),a=D(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=D(m=>{var v;return m.activeSessionId?((v=m.backgroundTasks[m.activeSessionId])==null?void 0:v.length)??0:0}),f=((g=a==null?void 0:a.threads)==null?void 0:g.filter(m=>m.status==="open").length)??0,h=[{id:"turns",label:"Turns",icon:z0},{id:"changes",label:"Changes",icon:eg},{id:"tasks",label:"Tasks",icon:O0,badge:u||void 0},{id:"threads",label:"Threads",icon:sg,badge:f||void 0},{id:"apps",label:"Apps",icon:ng}];return r?c.jsxs("div",{className:"ide-right collapsed",children:[c.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:c.jsx(q0,{size:15})}),c.jsx("div",{className:"right-rail-divider"}),h.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return c.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${n===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>s(m.id),children:[c.jsx(v,{size:15}),m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):c.jsxs("div",{className:"ide-right",children:[c.jsxs("div",{className:"right-header",children:[c.jsx("div",{className:"right-tabs",children:h.map(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>s(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:c.jsx(V0,{size:14})})]}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(iT,{}),n==="changes"&&c.jsx(oT,{}),n==="tasks"&&c.jsx(dT,{}),n==="threads"&&c.jsx(yT,{}),n==="apps"&&c.jsx(xT,{})]})]})}const Ae={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"}},Bu=[{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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]}]}];function kT(n){return Bu.find(s=>s.id===n)}function Td(n){const s=kT(n);return(s==null?void 0:s.models)??[]}function ev(n,s){return Td(n).find(r=>r.slug===s)}function Wu(n,s){var r;return((r=ev(n,s))==null?void 0:r.reasoningLevels)??[]}function Hu(n,s){var r;return(r=ev(n,s))==null?void 0:r.defaultReasoning}function ST(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=D(),o=D(te=>te.showModelSelector),a=D(te=>te.setShowModelSelector),u=s.find(te=>te.id===n),f=D(te=>te.models),h=D(te=>te.modelsLoading),g=D(te=>te.loadModels),[m,v]=w.useState(!1),k=w.useRef(null);if(pl(k,()=>v(!1),m),td(()=>v(!1),m),w.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const x=u.runtime_type,T=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],R=Td(x),b=[...C.length>0?C:R];if(T&&!b.some(te=>te.slug===T)){const te=R[0];b.unshift({slug:T,displayName:T,description:"Custom model",defaultReasoning:(te==null?void 0:te.defaultReasoning)??"medium",reasoningLevels:(te==null?void 0:te.reasoningLevels)??[]})}function U(te){return b.find(ie=>ie.slug===te)}function P(te){var ie;return C.length>0?((ie=U(te))==null?void 0:ie.reasoningLevels)??[]:Wu(x,te)}function W(te){var ie;return C.length>0?(ie=U(te))==null?void 0:ie.defaultReasoning:Hu(x,te)}const K=Bu.find(te=>te.id===x),q=U(T),G=T?P(T):[],ce=(K==null?void 0:K.label)??x,pe=(q==null?void 0:q.displayName)??(T||"Default"),ue=G.find(te=>te.effort===E),de=(ue==null?void 0:ue.label)??(E||"Default");function he(te){var Y;const ie=P(te),$=ie.some(H=>H.effort===E)?E:W(te)??((Y=ie[0])==null?void 0:Y.effort)??"";r(te,$),v(!1)}function Le(te){r(T,te),v(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ce}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:pe}),de!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:de})]}),c.jsx(ci,{size:12,className:"model-selector-chevron"})]}),m&&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"}),Bu.map(te=>c.jsxs("div",{className:`model-selector-item ${te.id===x?"selected":""} ${te.available?"":"disabled"}`,onClick:()=>{if(te.available){if(te.id===x){v(!1);return}r("","",te.id)}},children:[c.jsx("span",{children:te.label}),!te.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(U0,{size:10})," Soon"]}),te.id===x&&c.jsx(tr,{size:12})]},te.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&&b.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),b.map(te=>c.jsxs("div",{className:`model-selector-item ${te.slug===T?"selected":""}`,onClick:()=>he(te.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:te.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:te.description})]}),te.slug===T&&c.jsx(tr,{size:12})]},te.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),G.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),G.map(te=>c.jsxs("div",{className:`model-selector-item ${te.effort===E?"selected":""}`,onClick:()=>Le(te.effort),children:[c.jsx("span",{children:te.label}),te.effort===E&&c.jsx(tr,{size:12})]},te.effort))]})]})]})}function no(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Sm(){const n=D(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(iw,{size:14})," Repoburg"]})}function Tm(){const n=D(r=>r.vscodeViewOpen),s=D(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(R0,{size:14})," Code"]})}function TT(){var x,T;Kt.trackRender("StatusBar");const n=D(E=>E.activeSessionId),s=D(E=>n?E.sessions.find(C=>C.id===n)??null:null),r=D(E=>n?E.sessionDetails[n]??null:null),o=D(E=>n?E.backgroundTasks[n]:void 0),a=D(E=>E.wsConnected),u=D(E=>E.switchRightTab),f=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Sm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Tm,{}),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(kh,{size:14})," K"]})]});const h=o??[],g=fl(s,h.length),m=new Set,v=new Map;for(const E of h)m.add(E.task_id),v.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 R=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,L=((T=C.data)==null?void 0:T.task_type)??"unknown";m.add(R),v.set(R,L)}const k=[...v.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Sm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Tm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(ST,{}),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(ag,{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:g.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),f&&c.jsx(bT,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(kh,{size:14})," K"]})]})}function bT({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${no(n.totalTokens)} / ${no(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${no(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),"% / ",no(n.totalTokens)," / ",no(n.contextWindow)]})})]})}function bm(n){return yn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function NT(n){return Et("/vscode-web/start",{folder:n})}function CT(n){return Et("/vscode-web/heartbeat",{id:n})}const ET=1e3,_T=5*6e4;function Nm({children:n}){const s=D(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(Pn,{size:16})})]})}function jT(){const n=D(E=>E.vscodeState),s=D(E=>E.vscodeId),r=D(E=>E.vscodeToken),o=D(E=>E.setVscodeView),a=D(E=>{var R;const C=E.activeSessionId?E.sessions.find(L=>L.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((R=E.workspaces.find(L=>L.deleted===0))==null?void 0:R.path)??null}),[u,f]=w.useState(!1),[h,g]=w.useState(0),m=w.useRef(null),v=is(),k=v===""||v===window.location.origin,x=`${v}/vscode/${s??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){m.current&&(clearInterval(m.current),m.current=null)}async function R(){try{let b=await bm(a);if((b.state==="stopped"||b.state==="error")&&(b=await NT(a)),E||(o(b.state,b.id,b.token),b.state==="running"||b.state==="error"))return;m.current=setInterval(async()=>{const U=await bm(a);E||(o(U.state,U.id,U.token),(U.state==="running"||U.state==="error"||U.state==="stopped")&&C())},ET)}catch{E||o("error",null,null)}}R();const L=setInterval(()=>{const b=D.getState().vscodeId;b&&CT(b).catch(()=>{})},_T);return()=>{E=!0,C(),clearInterval(L)}},[h,a,o]);function T(){f(!1),o("starting",null,null),g(E=>E+1)}return n!=="running"||!r||!s?c.jsx(Nm,{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(ho,{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(Nm,{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(I0,{size:14})," Open VS Code in a new tab"]})]})}const RT=`(function () {
|
|
475
|
-
var nextId = 1;
|
|
476
|
-
var pending = new Map();
|
|
477
|
-
var listeners = [];
|
|
478
|
-
// Absolute http(s) URL, or null. Relative and #fragment hrefs are not
|
|
479
|
-
// external and keep their in-frame behavior.
|
|
480
|
-
function externalUrl(raw) {
|
|
481
|
-
if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
|
|
482
|
-
try { return new URL(raw.trim()).href; } catch (err) { return null; }
|
|
483
|
-
}
|
|
484
|
-
// New browser tab. The sandbox lets popups escape it, so the page loads
|
|
485
|
-
// like any other tab; noopener leaves it no handle back to this frame.
|
|
486
|
-
function openTab(url) {
|
|
487
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
488
|
-
}
|
|
489
|
-
// A plain external link would navigate THIS frame: the app disappears and
|
|
490
|
-
// most sites refuse to be framed anyway. Open it in a new tab instead.
|
|
491
|
-
// Bubble phase on window, so the app's own handlers run first and can
|
|
492
|
-
// still claim the click with preventDefault(). Modifier clicks and
|
|
493
|
-
// target="_blank" links already open a tab natively.
|
|
494
|
-
window.addEventListener('click', function (e) {
|
|
495
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
496
|
-
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
497
|
-
if (!a) return;
|
|
498
|
-
var target = (a.getAttribute('target') || '').toLowerCase();
|
|
499
|
-
if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
|
|
500
|
-
var url = externalUrl(a.getAttribute('href'));
|
|
501
|
-
if (!url) return;
|
|
502
|
-
e.preventDefault();
|
|
503
|
-
openTab(url);
|
|
504
|
-
});
|
|
505
|
-
window.addEventListener('message', function (e) {
|
|
506
|
-
var msg = e.data;
|
|
507
|
-
if (!msg || msg.source !== 'agentpane-host') return;
|
|
508
|
-
if (msg.id != null && pending.has(msg.id)) {
|
|
509
|
-
var p = pending.get(msg.id);
|
|
510
|
-
pending.delete(msg.id);
|
|
511
|
-
if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
|
|
512
|
-
} else if (msg.event) {
|
|
513
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
514
|
-
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
function call(method, params) {
|
|
519
|
-
return new Promise(function (resolve, reject) {
|
|
520
|
-
var id = nextId++;
|
|
521
|
-
pending.set(id, { resolve: resolve, reject: reject });
|
|
522
|
-
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
window.AgentPane = {
|
|
526
|
-
getApp: function () { return call('getApp'); },
|
|
527
|
-
getState: function () { return call('getState'); },
|
|
528
|
-
setState: function (data) { return call('setState', { data: data }); },
|
|
529
|
-
createSession: function (opts) { return call('createSession', opts); },
|
|
530
|
-
submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
|
|
531
|
-
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
532
|
-
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
533
|
-
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
534
|
-
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
535
|
-
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
|
|
536
|
-
openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
|
|
537
|
-
openUrl: function (url) {
|
|
538
|
-
var href = externalUrl(url);
|
|
539
|
-
if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
|
|
540
|
-
try { openTab(href); } catch (err) { return Promise.reject(err); }
|
|
541
|
-
return Promise.resolve({ ok: true });
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
545
|
-
window.addEventListener('error', function (e) {
|
|
546
|
-
parent.postMessage({
|
|
547
|
-
source: 'agentpane-app', report: 'error',
|
|
548
|
-
message: e.message || 'Unknown error',
|
|
549
|
-
stack: (e.error && e.error.stack) || '',
|
|
550
|
-
line: e.lineno || 0, col: e.colno || 0
|
|
551
|
-
}, '*');
|
|
552
|
-
});
|
|
553
|
-
window.addEventListener('unhandledrejection', function (e) {
|
|
554
|
-
var r = e.reason;
|
|
555
|
-
var msg = r && (r.message || String(r)) || 'unknown';
|
|
556
|
-
parent.postMessage({
|
|
557
|
-
source: 'agentpane-app', report: 'error',
|
|
558
|
-
message: 'Unhandled promise rejection: ' + msg,
|
|
559
|
-
stack: (r && r.stack) || '', line: 0, col: 0
|
|
560
|
-
}, '*');
|
|
561
|
-
});
|
|
562
|
-
})();`;function Cm(n){return n.replace(/<\/script/gi,"<\\/script")}function AT(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 Em(n,s,r){const o=AT(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function IT(n,s,r){let o=n;const a=`<script>${Cm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=Em(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${Cm(r)}<\/script>`;o=Em(o,"</body>",u)}return o}function MT({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),[g,m]=w.useState([]);w.useEffect(()=>{let x=!0;Rx(n,E=>{var C,R;return(R=(C=r.current)==null?void 0:C.contentWindow)==null?void 0:R.postMessage(E,"*")});const T=async E=>{var U,P,W,K,q,G,ce,pe,ue;if(E.source!==((U=r.current)==null?void 0:U.contentWindow))return;const C=E.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const de={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};m(he=>{const Le=he[he.length-1];return Le&&Le.message===de.message?he:[...he,de].slice(-20)});return}if(typeof C.method!="string")return;let R=!0,L,b;try{switch(C.method){case"getApp":L={id:n};break;case"getState":L=o.current;break;case"setState":{const de=((P=C.params)==null?void 0:P.data)??null,he=await qm(n,{data:de},s);o.current=he,L=he;break}case"createSession":{const de=C.params??{},he=await Gu({title:typeof de.title=="string"?de.title:void 0,runtime_type:typeof de.runtime_type=="string"?de.runtime_type:void 0,model:typeof de.model=="string"?de.model:void 0,model_reasoning_effort:typeof de.model_reasoning_effort=="string"?de.model_reasoning_effort:void 0,cwd:typeof de.cwd=="string"?de.cwd:void 0,origin_app_id:n});iu(he.id,n),D.getState().addSession(he),L=he;break}case"submitTurn":{const de=String(((W=C.params)==null?void 0:W.sessionId)??""),he=String(((K=C.params)==null?void 0:K.prompt)??""),Le=await $m(de,he);iu(de,n),L=Le;break}case"resolveToolCall":{const de=String(((q=C.params)==null?void 0:q.callId)??""),he=(G=C.params)==null?void 0:G.result;await i0(de,he),L={ok:!0};break}case"openSession":{if(D.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const de=typeof((ce=C.params)==null?void 0:ce.sessionId)=="string"?C.params.sessionId.trim():"";if(!de)throw new Error("openSession: sessionId is required");try{await D.getState().revealSession(de)}catch(he){throw new Error(`openSession: ${he instanceof Error?he.message:String(he)}`)}L={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(de){R=!1,b=de instanceof Error?de.message:String(de)}(ue=(pe=r.current)==null?void 0:pe.contentWindow)==null||ue.postMessage({source:"agentpane-host",id:C.id,ok:R,result:L,error:b},"*")};return window.addEventListener("message",T),Px(n,()=>{vh(n,s).then(E=>{x&&(o.current=E)}).catch(()=>{})}),Dx(n,()=>{gh(n).then(E=>{x&&(u(E),m([]))}).catch(()=>{})}),(async()=>{try{const[E,C,R]=await Promise.all([gh(n),vh(n,s),e0(n).catch(()=>[])]);if(!x)return;o.current=C,R.forEach(L=>iu(L.id,n)),u(E)}catch(E){x&&h(E instanceof Error?E.message:String(E))}})(),()=>{x=!1,Ax(n),Lx(n),Ox(n),window.removeEventListener("message",T)}},[n,s]);const v=w.useMemo(()=>a?IT(a.html,RT,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)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:v}),g.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.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 DT({appId:n,active:s}){const r=D(x=>x.apps),o=D(x=>x.workspaces),a=D(x=>x.appWorkspaces),u=D(x=>x.setAppWorkspace),f=D(x=>x.setActiveAppTab),h=D(x=>x.startAppEdit),g=r.find(x=>x.id===n),m=a[n]??"",v=o.filter(x=>x.deleted!==1),k=m!==""&&!v.some(x=>x.path===m)?m: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:(g==null?void 0:g.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.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:m,onChange:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),v.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(Y0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Pn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(MT,{appId:n,workspace:m},`${n}:${m}`)})]})}function LT({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),g=w.useRef(0),m=w.useCallback(x=>{const T=x.clientX-h.current,E=n==="left"?g.current+T:g.current-T,C=Math.min(r,Math.max(s,E));a(C)},[n,s,r,a]),v=w.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),f(!1)},[m]);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,g.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function _m({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=LT({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 PT(){Kt.trackRender("IdeWorkspace");const n=D(m=>m.sidebarWidth),s=D(m=>m.rightPanelWidth),r=D(m=>m.setSidebarWidth),o=D(m=>m.setRightPanelWidth),a=D(m=>m.rightPanelCollapsed),u=D(m=>m.vscodeViewOpen),f=D(m=>m.activeAppTabId),h=D(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const v=Ha(),{rightPanelWidth:k,setRightPanelWidth:x}=D.getState();k>v&&x(v)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const g=a?`${n}px 6px 1fr ${Gx}px`:`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${u?"ide-hidden":""}`,style:{gridTemplateColumns:g},children:[c.jsx(tk,{}),c.jsx(_m,{side:"left",minWidth:Nu,maxWidth:Cu,getWidth:()=>D.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(nk,{}),c.jsxs("div",{className:"ide-render",children:[h.map(m=>c.jsx(DT,{appId:m,active:f===m},m)),f==null&&c.jsx(qS,{})]}),c.jsx(rT,{})]}),!a&&c.jsx(_m,{side:"right",minWidth:Wa,maxWidth:Ha(),getWidth:()=>D.getState().rightPanelWidth,setWidth:o}),c.jsx(wT,{})]}),u&&c.jsx(jT,{}),c.jsx(TT,{})]})}function OT(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=D(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,g]=w.useState(""),[m,v]=w.useState(u),[k,x]=w.useState(f),[T,E]=w.useState("");if(!n)return null;const C=Td(a),R=m?Wu(a,m):[];function L(){r({title:h.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:T.trim()||void 0,runtime_type:a}),g(""),E("")}function b(P){P.key==="Escape"&&s(!1)}function U(P){var q;v(P);const W=Wu(a,P);W.some(G=>G.effort===k)||x(Hu(a,P)??((q=W[0])==null?void 0:q.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:b,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(Pn,{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:P=>g(P.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:m,onChange:P=>U(P.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(P=>c.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),R.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Hu(a,m),")"]}),R.map(P=>c.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:P=>E(P.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:L,children:"Create"})]})]})})}const zT=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,$T=512*1024;function FT(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function UT(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=D(),[f,h]=w.useState("examples"),[g,m]=w.useState(null),[v,k]=w.useState(null),[x,T]=w.useState(!1),[E,C]=w.useState(""),[R,L]=w.useState(""),[b,U]=w.useState(""),[P,W]=w.useState(""),[K,q]=w.useState(null),[G,ce]=w.useState(""),pe=w.useRef(null);if(w.useEffect(()=>{n&&(m(null),t0().then(m).catch(()=>m([])))},[n]),w.useEffect(()=>{pe.current&&(pe.current.webkitdirectory=!0)},[f]),!n)return null;const ue=new Set(r.map($=>$.id));async function de($){k($);try{await o($)&&s()}finally{k(null)}}async function he(){if(x)return;const $=E.trim(),Y=R.trim();if(!(!$||!Y)){T(!0);try{await a({id:$,title:Y,description:b.trim()||void 0,icon:P.trim()||void 0})&&(C(""),L(""),U(""),W(""),s())}finally{T(!1)}}}async function Le($){const Y=Array.from($.target.files??[]),H={};let A="";for(const j of Y){const re=(j.webkitRelativePath??"").split("/");!A&&re.length>1&&(A=re[0]);const ve=re[re.length-1];if(!(!ve||!zT.test(ve))&&!(j.size>$T))try{H[ve]=await j.text()}catch{}}q(Object.keys(H).length>0?H:null),ce(FT(A))}async function te(){if(!(x||!K||!G.trim())){T(!0);try{await u(G.trim(),K)&&(q(null),ce(""),s())}finally{T(!1)}}}function ie($){$.key==="Escape"&&s()}const le=[{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:$=>$.stopPropagation(),onKeyDown:ie,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:le.map($=>c.jsx("button",{className:`catalog-tab${f===$.key?" active":""}`,onClick:()=>h($.key),children:$.label},$.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:g===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map($=>{const Y=ue.has($.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:$.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:$.title}),$.description&&c.jsx("span",{className:"example-desc",children:$.description})]}),c.jsx("button",{className:"example-install",disabled:Y||v===$.id,onClick:()=>de($.id),title:Y?"Already installed":"Install this example",children:Y?"Installed":v===$.id?"Installing…":"Install"})]},$.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:$=>C($.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:R,onChange:$=>L($.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:b,onChange:$=>U($.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:P,onChange:$=>W($.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!R.trim(),onClick:he,children:[c.jsx(Sr,{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:pe,type:"file",multiple:!0,onChange:Le}),K&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:G,onChange:$=>ce($.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||!G.trim(),onClick:te,children:[c.jsx(nw,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function BT(){const n=D(k=>k.showCommandPalette),s=D(k=>k.setShowCommandPalette),r=D(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),g=w.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,x=dl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Sr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:gs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ml,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:fi,action:()=>r.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:F0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:eg,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:r.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:G0,action:()=>r.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Pn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),m=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=g.filter(T=>T.available);return k?x.filter(T=>T.label.toLowerCase().includes(k)||T.hint.toLowerCase().includes(k)):x},[g,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,m.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=m[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:v}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:m.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(A0,{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 jm=/^[a-z][a-z0-9-]{1,30}$/,WT=2e3;function HT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=D(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,g]=w.useState(!1),[m,v]=w.useState(!1),[k,x]=w.useState(!1),[T,E]=w.useState(!1),[C,R]=w.useState("main"),[L,b]=w.useState(""),[U,P]=w.useState(!1),[W,K]=w.useState(null),q=w.useRef(null);pl(q,()=>E(!1),T);const G=m||k,ce=w.useCallback(async()=>{g(!0),f(null);try{const $=await fetch(`${is()}/remote/status`,{headers:{Accept:"application/json"}});if(!$.ok)throw new Error(`status ${$.status}`);a(await $.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);w.useEffect(()=>{n&&(R("main"),K(null),ce())},[n,ce]);const pe=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!pe)return;const $=setInterval(async()=>{try{const Y=await fetch(`${is()}/remote/enable`,{headers:{Accept:"application/json"}});Y.ok&&K(await Y.json())}catch{}},WT);return()=>clearInterval($)},[pe]),!n)return null;const ue=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function de($){$.key==="Escape"&&s(!1)}async function he($){if(jm.test($)){P(!0);try{const Y=await fetch(`${is()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:$})});if(!Y.ok)throw new Error(`enable ${Y.status}`);K(await Y.json()),R("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Le(){W!=null&&W.troubleshootingSessionId&&(r(W.troubleshootingSessionId),s(!1))}async function te(){v(!0);try{await fetch(`${is()}/remote/disable`,{method:"POST"}),await ce()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function ie(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
|
|
563
|
-
|
|
564
|
-
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
565
|
-
|
|
566
|
-
This cannot be undone.`)){x(!0);try{const Y=await fetch(`${is()}/remote/uninstall`,{method:"DELETE"});if(!Y.ok)throw new Error(`uninstall ${Y.status}`);await ce()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function le(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:L,onChange:A=>b(A.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:()=>R("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!jm.test(L)||U,onClick:()=>void he(L),children:[U?c.jsx(rs,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const $=["detect","provision","install","verify","ready"],Y=$.indexOf(W.step),H=W.state==="ready";return c.jsxs(c.Fragment,{children:[W.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…"]}),W.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(tr,{size:14})," Setup complete — you can close this window."]}),W.state==="ready"&&W.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${W.hostname}`,target:"_blank",rel:"noreferrer",children:W.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:$.map((A,j)=>{const X=H||Y>-1&&j<Y,re=!H&&j===Y&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:X||re?1:.4,color:X?"var(--green)":void 0},children:[X?c.jsx(tr,{size:13}):re?c.jsx(rs,{size:13,className:"spin"}):c.jsx(j0,{size:9,style:{marginLeft:2,marginRight:2}}),A]},A)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(A=>A.message).join(`
|
|
567
|
-
`)}),W.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:Le,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ce(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:$=>$.stopPropagation(),onKeyDown:de,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(Pn,{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"?le():c.jsxs(c.Fragment,{children:[ue&&(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 te(),disabled:G,children:[m?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($=>!$),disabled:G,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":T,children:k?c.jsx(rs,{size:14,className:"spin"}):c.jsx(ci,{size:14})}),T&&c.jsx("div",{ref:q,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 ie(),children:[c.jsx(gs,{size:12})," Remove tunnel"]})})]})]}),!ue&&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 he(o.tunnel.mahlas),disabled:U,children:[U?c.jsx(rs,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(Sh,{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:()=>R("setup"),children:[c.jsx(Sh,{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 VT={success:E0,error:hl,info:L0,warn:ew},qT=4e3;function GT({toast:n}){const s=D(f=>f.removeToast),r=VT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>s(n.id),qT)}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(tw,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>s(n.id),children:c.jsx(Pn,{size:14})})]})}function KT(){const n=D(s=>s.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(s=>c.jsx(GT,{toast:s},s.id))})}let qn=null,di=null,uo=1e3;const YT=1e4;function XT(){const n=is();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Vu(){qn&&(qn.readyState===WebSocket.OPEN||qn.readyState===WebSocket.CONNECTING)||(qn=new WebSocket(XT()),qn.onopen=()=>{const n=uo>1e3;if(uo=1e3,D.getState().setWsConnected(!0),D.getState().addLogEntry("INFO","WebSocket connected"),n){const s=D.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},qn.onclose=()=>{D.getState().setWsConnected(!1),D.getState().addLogEntry("WARN","WebSocket disconnected"),D.getState().addToast("warn","WebSocket disconnected — reconnecting…"),ZT()},qn.onerror=()=>{},qn.onmessage=n=>{try{const s=JSON.parse(n.data);Kt.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof n.data=="string"?n.data.length:0);const r=JT[s.event];r&&r(s.data)}catch{}})}function QT(){di&&(clearTimeout(di),di=null),qn&&(qn.onclose=null,qn.close(),qn=null),D.getState().setWsConnected(!1)}function ZT(){di||(di=window.setTimeout(()=>{di=null,Vu()},uo),uo=Math.min(uo*2,YT))}const JT={"turn:created":n=>{const s=n;D.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":n=>{const s=n;Kt.note(`turn:started — ${s.turnId.slice(0,8)}`),D.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":n=>{const s=n;D.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":n=>{const s=n;D.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":n=>{const s=n;D.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":n=>{const s=n;D.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":n=>{const s=n;Kt.note(`turn:completed — ${s.turnId.slice(0,8)}`),D.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":n=>{const s=n;D.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}:{}};D.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":n=>{const s=n;D.getState().onTurnFailed(s.sessionId,s.turnId,s.error,s.resumeState)},"turn:interrupted":n=>{const s=n;Kt.note(`turn:interrupted — ${s.turnId.slice(0,8)} (${s.reason})`),D.getState().onTurnInterrupted(s.sessionId,s.turnId,{reason:s.reason,interruptedAt:s.interruptedAt,attempts:s.attempts,detail:s.detail??null})},"turn:resuming":n=>{const s=n;D.getState().onTurnResuming(s.sessionId,s.turnId,s.attempt)},"turn:resumed":n=>{const s=n;D.getState().onTurnResumed(s.sessionId,s.turnId)},"turn:retrying":n=>{const s=n;D.getState().onTurnRetrying(s.sessionId,s.turnId,{attempt:s.attempt,maxRetries:s.maxRetries,retryDelayMs:s.retryDelayMs,errorStatus:s.errorStatus??null,error:s.error??null})},"turn:cancelled":n=>{const s=n;D.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":n=>{const s=n;D.getState().onSessionTitle(s.sessionId,s.title)},background_tasks:n=>{const s=n;Kt.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),D.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":n=>{const s=n;D.getState().onBackgroundTasksSnapshot(s.sessions??{})},"thread:created":n=>{const s=n;D.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":n=>{const s=n;D.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":n=>{const s=n;D.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":n=>{const s=n;D.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=>{$x(n.appId)},"app:state_changed":n=>{zx(n.appId)}};function eb(){const n=D(s=>s.init);return w.useEffect(()=>{Jy(),n(),Vu();function s(){if(document.visibilityState!=="visible")return;const r=D.getState(),o=r.activeSessionId;if(!o)return;const a=r.sessionDetails[o];r.wsConnected||Vu(),a&&a.is_running===1&&(r.refreshActiveSession(),r.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",s),()=>{QT(),document.removeEventListener("visibilitychange",s)}},[n]),null}function tb(){const n=D(a=>a.loading),s=D(a=>a.error),r=D(a=>a.sessions),o=D(a=>a.setShowCommandPalette);return w.useEffect(()=>Kt.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(eb,{}),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(PT,{}),c.jsx(OT,{}),c.jsx(UT,{}),c.jsx(HT,{}),c.jsx(BT,{}),c.jsx(KT,{})]})]})}Wy.createRoot(document.getElementById("root")).render(c.jsx(rt.StrictMode,{children:c.jsx(tb,{})}));
|